作者 lihongjuan

富文本样式

... ... @@ -6,7 +6,40 @@
<script>
export default {
name: "App"
// name: "App"
data() {
return {
};
},
created() {
this.getuserinfo()
},
methods: {
// 获取用户信息
getuserinfo() {
let that = this;
var url = "/api/member/index";
var params = {};
console.log("7766554", params);
that.$axios
.post(url, params)
.then(res => {
console.log(res)
localStorage.setItem("avatar", res.data.avatar)
localStorage.setItem("address", res.data.address)
localStorage.setItem("nickname", res.data.nickname)
localStorage.setItem("label", JSON.stringify(resd.ata.label))
})
.catch(err => {
console.log(err)
});
},
}
};
</script>
... ... @@ -17,7 +50,7 @@ html {
}
#app {
}
a标签去除默认样式
/* a标签去除默认样式 */
/*包含以下四种的链接*/
a {
text-decoration: none;
... ...
... ... @@ -5,7 +5,8 @@
<script>
import Vue from "vue";
import { getUrlKey } from "../utils/utils.js";
const murl = "http://zhongmian.h.brofirst.cn";
const murl = "http://forum.chinesenooddles.com";
const now_url = sessionStorage.getItem("now_url");
console.log("页面路径", now_url);
... ... @@ -26,11 +27,11 @@ export default {
this.$axios
.post(url, param)
.then(function(res) {
console.log(res);
.then(function (res) {
console.log(res.data.wechat_url);
window.location.href = res.data.wechat_url;
})
.catch(function(error) {
.catch(function (error) {
console.log(error);
});
} else {
... ... @@ -49,7 +50,6 @@ export default {
sessionStorage.setItem("token", res.data.token);
}
console.log(now_url, 99999);
if (now_url) {
window.location.replace(murl + now_url);
} else {
... ...
... ... @@ -9,12 +9,14 @@
>
<div class="tiezitop flexone">
<div class="tieziimg">
<img :src="item.user.avatar" alt="" />
<img :src="item.avatar ? item.avatar : item.user.avatar" alt="" />
</div>
<div class="tieziright">
<div class="tiezirighttop flex">
<div>
<div class="tieziming">{{ item.user.nickname }}</div>
<div class="tieziming">
{{ item.nickname ? item.nickname : item.user.nickname }}
</div>
<div class="tiezifen">30分钟</div>
</div>
... ... @@ -23,24 +25,25 @@
<img src="../assets/vip_icon@2x.png" alt="" />
<div class="vipname">{{ item.user.level.name1 }}</div>
</div>
<div class="tiezizhuan">
面坊转让
</div>
<div class="tiezizhuan">面坊转让</div>
</div>
<img
src="../assets/banggong_icon@2x.png"
:src="item"
class="banggongimg"
alt=""
v-for="(item, index) in item.user.label"
:key="index"
/>
<img
<!-- <img
src="../assets/peisong_icon@2x.png"
class="banggongimg"
alt=""
/>
/> -->
<img
src="../assets/yirenzheng_icon@2x.png"
class="banggongimg"
alt=""
v-if="item.is_card == 1"
/>
</div>
<div class="tiezibto flexone"></div>
... ... @@ -83,7 +86,10 @@
</div>
</div>
<div class="tiezipingbot">
<div class="teizipingitem flexone" v-if="item.comment != 0">
<div
class="teizipingitem flexone"
v-if="item.comment != 0 && fenlei != 3"
>
<img src="../assets/pinglun_icon@2x.png" alt="" class="lunimg" />
{{ item.comment }}
</div>
... ... @@ -149,7 +155,7 @@ export default {
that.$axios
.post(url, param)
.then(function(res) {
.then(function (res) {
console.log(res, "jssdkjsskd");
wx.config({
debug: false,
... ... @@ -161,7 +167,7 @@ export default {
jsApiList: ["previewImage"]
});
})
.catch(function(err) {
.catch(function (err) {
console.log(err);
});
},
... ... @@ -218,7 +224,7 @@ export default {
console.log("参数", params);
that.$axios
.post(url, params)
.then(res => {})
.then(res => { })
.catch(err => {
console.log(err);
});
... ...
... ... @@ -101,14 +101,14 @@
}
.homekind {
padding: 0.32rem 0.8rem;
padding: 0.32rem 0.5rem;
box-sizing: border-box;
background: #fff;
flex-wrap: wrap;
}
.homepageboxitem {
margin-right: 0.42rem;
margin-right: 0.62rem;
margin-bottom: 0.17rem;
}
... ... @@ -315,7 +315,7 @@
.publishwrap {
width: 7.5rem;
height: 3.31rem;
height: 3.61rem;
position: absolute;
bottom: 0;
left: 0;
... ...
... ... @@ -187,6 +187,8 @@ export default {
});
}
}
}
};
</script>
... ...
<template >
<div class="content">
<div class="teacherfooter">
<div
class="teacherfootitem"
@click="gotab(item, index)"
v-for="(item, index) in list"
:key="index"
>
<div class="teacherfootitemtop shou">
<img
:src="
currentTabIndex == index ? item.selectedIconPath : item.iconPath
"
alt=""
/>
</div>
<div
class="teacherfootname"
:class="currentTabIndex == index ? 'activename' : ''"
>
{{ item.text }}
</div>
</div>
</div>
<!-- 弹出层 -->
<div class="register" v-if="showpublish">
<div class="publishwrap">
<div class="flextwo">
<div class="homepageboxitem flexfour" @click="duanshipin(1)">
<img
src="../assets/duanzhipin.png"
alt=""
class="homepageitemimg"
/>
<div class="homepageitemname">短视频区</div>
</div>
<div class="homepageboxitem flexfour" @click="duanshipin(2)">
<img src="../assets/banggong.png" alt="" class="homepageitemimg" />
<div class="homepageitemname">帮工招聘</div>
</div>
<div class="homepageboxitem flexfour" @click="duanshipin(3)">
<img src="../assets/zhuanrang.png" alt="" class="homepageitemimg" />
<div class="homepageitemname">面坊转让</div>
</div>
<div class="homepageboxitem flexfour" @click="duanshipin(4)">
<img src="../assets/zhenghun.png" alt="" class="homepageitemimg" />
<div class="homepageitemname">征婚交友</div>
</div>
</div>
<div class="chahao" @click="hidetanceng">
<img src="../assets/chahao.png" alt="" />
</div>
</div>
</div>
<!-- 电话 -->
<div class="register" v-if="showphone">
<div class="quxiaofix">
<div class="phone flexthree">
<img src="../assets/phone.png" alt="" class="phonimg" />
<a :href="'tel:' + '400-0230-777'" class="ponenum">
呼叫400-0230-777</a
>
</div>
<div class="quxiao" @click="cancelphone">取消</div>
</div>
</div>
</div>
</template>
<script>
export default {
props: {
active: Number
},
data() {
return {
list: [{
"pagePath": "/",
"iconPath": require("../assets/home.png"),
"selectedIconPath": require("../assets/homeactive.png"),
"text": "首页",
}, {
"pagePath": "/xiaoxi",
"iconPath": require("../assets/xiaoxi.png"),
"selectedIconPath": require("../assets/xiaoxiactive.png"),
"text": "消息"
},
{
"pagePath": "",
"iconPath": require("../assets/fabu.png"),
"selectedIconPath": require("../assets/fabu.png"),
"text": "发布"
},
{
"pagePath": "",
"iconPath": require("../assets/kefu.png"),
"selectedIconPath": require("../assets/kefu.png"),
"text": "客服"
},
{
"pagePath": "/mine",
"iconPath": require("../assets/mine.png"),
"selectedIconPath": require("../assets/mineactive.png"),
"text": "个人中心"
}
],
currentTabIndex: this.active,
showpublish: false,
showphone: false,
}
},
methods: {
gotab(item, index) {
if (index == 2) {
this.showpublish = true;
} else if (index == 3) {
this.showphone = true;
} else {
this.$router.push({
path: item.pagePath
})
}
},
// 短视频跳转
duanshipin(id) {
if (id == 1) {
this.$router.push({
path: "/publish",
query: {
type: 1
}
});
} else if (id == 2) {
this.$router.push({
path: "/publish",
query: {
type: 2
}
});
} else if (id == 3) {
this.$router.push({
path: "/publish",
query: {
type: 3
}
});
} else if (id == 4) {
this.$router.push({
path: "/publish",
query: {
type: 4
}
});
}
},
hidetanceng() {
this.showpublish = false;
},
cancelphone() {
this.showphone = false;
},
}
}
</script>
<style scoped>
@import "./style/homepage.css";
.teacherfooter {
width: 7.5rem;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0.1rem 0.7rem;
box-sizing: border-box;
position: fixed;
bottom: 0;
left: 0;
background: #fff;
border-top: 1px solid #f5f5f5;
}
.teacherfootitem {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.teacherfootname {
color: #5b5e63;
font-size: 0.22rem;
margin-top: 0.05rem;
}
.shou {
width: 0.35rem;
height: 0.33rem;
font-size: 0;
}
.activename {
color: #f19b18;
}
</style>
\ No newline at end of file
... ...
... ... @@ -23,24 +23,25 @@
<img src="../assets/vip_icon@2x.png" alt="" />
<div class="vipname">{{ item.user.level.name1 }}</div>
</div>
<div class="tiezizhuan">
面坊转让
</div>
<div class="tiezizhuan">面坊转让</div>
</div>
<img
src="../assets/banggong_icon@2x.png"
:src="item"
class="banggongimg"
alt=""
v-for="(item, index) in item.user.label"
:key="index"
/>
<img
<!-- <img
src="../assets/peisong_icon@2x.png"
class="banggongimg"
alt=""
/>
/> -->
<img
src="../assets/yirenzheng_icon@2x.png"
class="banggongimg"
alt=""
v-if="item.is_card == 1"
/>
</div>
<div class="tiezibto flexone"></div>
... ... @@ -147,7 +148,7 @@ export default {
that.$axios
.post(url, param)
.then(function(res) {
.then(function (res) {
console.log(res, "jssdkjsskd");
wx.config({
debug: false,
... ... @@ -159,7 +160,7 @@ export default {
jsApiList: ["previewImage"]
});
})
.catch(function(err) {
.catch(function (err) {
console.log(err);
});
},
... ...
<template>
<div class="container containerbox">
<div class="top">{{ detail.name }}</div>
<div class="arcticlebox" v-html="content"></div>
</div>
</template>
<script>
export default {
data() {
return {
id: '',
content: '',
detail: ''
}
},
created() {
let name = this.$route.query.name
document.title = name;
if (name == '投诉维权') {
this.id = this.$route.query.id;
this.gettousudetail()
} else if (name == '中面资质') {
this.getzizhidetail()
}
},
methods: {
// 投诉维权
gettousudetail(id) {
let that = this;
var url = '/api/protect/get_detail';
var params = {
protect_id: that.id,
}
that.$axios.post(url, params).then((res) => {
console.log(res);
that.content = res.data.content;
that.detail = res.data
}).catch((err) => {
console.log(err)
})
},
// 中面资质
getzizhidetail() {
let that = this;
var url = '/api/forum/get_forum_category_detail';
var params = {}
that.$axios.post(url, params).then((res) => {
that.detail = res.data
this.content = res.data.content
}).catch((err) => {
console.log(err)
})
}
}
}
</script>
<style scoped>
.containerbox {
padding: 0.32rem;
box-sizing: border-box;
color: #333;
font-size: 0.28rem;
}
.top {
color: #333;
font-size: 0.3rem;
font-weight: bold;
margin-bottom: 0.2rem;
}
</style>
\ No newline at end of file
... ...
... ... @@ -2,7 +2,7 @@
<div class="container">
<div class="tiezitop tiezilisttopk">
<div class="hometopbark hometopbackk flextwo">
<div class="homesearch flexone">
<div class="homesearch flexone">
<img src="../../../assets/sousuo.png" alt="" class="souimg" />
<div class="souenter">
<input
... ... @@ -13,7 +13,7 @@
/>
</div>
</div>
<div class="searchpro flexone" @click="showprovince">
<div class="searchpro flexone" @click="showprovince">
<div class="proname">{{ proname }}</div>
<img src="../../../assets/xiasanjiao.png" alt="" class="xiasanjiao" />
... ... @@ -116,7 +116,8 @@ export default {
province_id: "",
kindtype: "",
search_type: "",
keyword: ""
keyword: "",
page: 1
};
},
created() {
... ...
... ... @@ -109,19 +109,22 @@
<div class="tiezizhuan">面坊转让</div>
</div>
<img
src="../../../assets/banggong_icon@2x.png"
:src="item"
class="banggongimg"
alt=""
v-for="(item, index) in item.user.label"
:key="index"
/>
<img
<!-- <img
src="../../../assets/peisong_icon@2x.png"
class="banggongimg"
alt=""
/>
/> -->
<img
src="../../../assets/yirenzheng_icon@2x.png"
class="banggongimg"
alt=""
v-if="item.is_card == 1"
/>
</div>
<div class="tiezibto flexone"></div>
... ... @@ -267,10 +270,11 @@
<script>
import Vue from "vue";
import wx from "weixin-js-sdk";
import tabBar from "@/components/tabBar.vue";
import tabBar from "@/components/tabsec.vue";
import { Swipe, SwipeItem, List, Toast } from "vant";
import area from "../../../utils/area.js";
import { changename } from "../../../utils/base.js"; //城市去掉市
import { text } from "../../../utils/base.js"; //城市去掉市
Vue.use(List);
Vue.use(Swipe);
... ... @@ -457,54 +461,8 @@ export default {
console.log(err);
});
},
// 格式化富文本
text(details) {
var texts = ""; //待拼接的内容
while (details.indexOf("<img") != -1) {
//寻找img 循环
texts += details.substring("0", details.indexOf("<img") + 4); //截取到<img前面的内容
details = details.substring(details.indexOf("<img") + 4); //<img 后面的内容
if (
details.indexOf("style=") != -1 &&
details.indexOf("style=") < details.indexOf(">")
) {
texts +=
details.substring(0, details.indexOf('style="') + 7) +
"max-width:100%;height:auto;margin:0 auto;"; //从 <img 后面的内容 截取到style= 加上自己要加的内容
details = details.substring(details.indexOf('style="') + 7); //style后面的内容拼接
} else {
texts += ' style="max-width:100%;height:auto;margin:0 auto;" ';
}
}
while (details.indexOf("<td") != -1) {
//寻找img 循环
texts += details.substring("0", details.indexOf("<td") + 4); //截取到<img前面的内容
details = details.substring(details.indexOf("<td") + 4); //<img 后面的内容
if (
details.indexOf("style=") != -1 &&
details.indexOf("style=") < details.indexOf(">")
) {
texts +=
details.substring(0, details.indexOf('style="') + 7) +
"max-width:74!important;height:auto;margin:0 auto;"; //从 <img 后面的内容 截取到style= 加上自己要加的内容
details = details.substring(details.indexOf('style="') + 7); //style后面的内容拼接
} else {
texts += ' style="max-width:100%;height:auto;margin:0 auto;" ';
}
}
texts += details; //最后拼接的内容
return texts;
},
// 获取分类列表
gettiezikind() {
let that = this;
... ... @@ -544,7 +502,7 @@ export default {
.then(function (res) {
that.tiezilist = that.tiezilist.concat(res.data);
that.tiezilist.forEach(function (value, index, array) {
value.content = that.text(value.content);
value.content = text(value.content);
});
if (that.page > 1) {
if (res.data.length == 0) {
... ... @@ -641,11 +599,32 @@ export default {
id: item.id
}
});
} else if (item.id == 4) {
} else if (item.id == 5) {
this.$router.push({
path: "/zhenghunlist"
path: "/zhongmianzixun"
});
} else if (item.id == 8) {
} else if (item.id == 6) {
this.$router.push({
path: "/articledetail",
query: {
name: '中面资质'
}
});
}
else if (item.id == 7) {
this.$router.push({
path: "/tousuweiquan"
});
}
else if (item.id == 8) {
this.$router.push({
path: "/mykaoshi"
});
}
else if (item.id == 8) {
this.$router.push({
path: "/mykaoshi"
});
... ...
... ... @@ -90,7 +90,7 @@
:after-read="afterRead"
:max-count="9"
@delete="deleftimg"
style="margin-right:0.2rem"
style="margin-right: 0.2rem"
/>
<!-- <img src="../../../assets/add.png" alt="" /> -->
</div>
... ... @@ -193,7 +193,7 @@ export default {
var url = "/api/common/upload";
that.$uploadFile
.post(url, formdata)
.then(function(res) {
.then(function (res) {
console.log(res);
that.cardzheng = false;
let url = "http://tangyuanji.t.brotop.cn" + res.data.url;
... ... @@ -206,16 +206,13 @@ export default {
} else {
for (var i = 0; i < file.length; i++) {
console.log(file[i].file);
var formdata = new FormData();
formdata.append("file", file[i].file);
that.delimg.push(file[i].file.name);
var url = "/api/common/upload";
that.$uploadFile
.post(url, formdata)
.then(function(res) {
.then(function (res) {
console.log(res);
that.cardzheng = false;
let url = "https://app.chinesenooddles.com" + res.data.url;
... ... @@ -233,7 +230,7 @@ export default {
deleftimg(e) {
let that = this;
let item = e.file.name;
this.delimg.forEach(function(value, index, array) {
this.delimg.forEach(function (value, index, array) {
if (value == item) {
that.delimg.splice(index, 1);
that.images.splice(index, 1);
... ... @@ -244,7 +241,6 @@ export default {
this.delimg = this.delimg;
this.images = this.images;
this.chuanimage = this.chuanimage;
this.$forceUpdate();
},
... ... @@ -264,7 +260,7 @@ export default {
var url = "/api/common/upload";
that.$uploadFile
.post(url, formdata)
.then(function(res) {
.then(function (res) {
console.log(res);
that.cardzheng = false;
that.videoimg = res.data.url;
... ... @@ -351,7 +347,7 @@ export default {
},
// 验证
yanzheng() {},
yanzheng() { },
sure() {
let that = this;
... ...
<template>
<div class="container">
<div class="weiquanlist">
<div class="weiquanitem flextwo">
<div class="weiguitou">
违规行为投诉
</div>
<img src="../../../assets/youjiantou.png" alt="" class="youjian" />
</div>
<div class="weiquanitem flextwo">
<div class="weiguitou">
侵权投诉(人身权,知识产权等被侵犯)
</div>
<img src="../../../assets/youjiantou.png" alt="" class="youjian" />
</div>
<div class="weiquanitem flextwo">
<div class="weiguitou">
品牌维护
</div>
<img src="../../../assets/youjiantou.png" alt="" class="youjian" />
</div>
<div class="weiquanitem flextwo">
<div class="weiguitou">
功能使用意见或建议反馈
</div>
<div
class="weiquanitem flextwo"
v-for="(item, index) in tousulist"
:key="index"
@click="enterweiquan(item.id)"
>
<div class="weiguitou">{{ item.name }}</div>
<img src="../../../assets/youjiantou.png" alt="" class="youjian" />
</div>
... ... @@ -34,7 +16,43 @@
</template>
<script>
export default {};
export default {
data() {
return {
tousulist: []
}
},
created() {
this.gettousu()
},
methods: {
// 获取投诉维权
gettousu() {
let that = this;
var url = '/api/protect/get_list';
var params = {
}
that.$axios.post(url, params).then((res) => {
console.log(res);
that.tousulist = res.data
}).catch((err) => {
console.log(err)
})
},
// 进入维权详情页
enterweiquan(id) {
this.$router.push({
path: '/articledetail',
query: {
name: "投诉维权",
id: id
}
})
}
}
};
</script>
<style scoped>
... ...
<template>
<div class="container">
<div class="zixunlist">
<div class="zixunitem flex">
<div class="zixunitemleft">
<img src="../../../assets/banner.png" alt="" />
</div>
<div class="zixunitemright">
<div class="flextwo">
<div class="tiezicontentname tiezicontentnamek">滚滚长江东逝水</div>
<img
src="../../../assets/xingxing_icon@2x.png"
alt=""
class="starimg"
/>
<!-- <img
src="../../../assets/weishoucang_icon@2x.png"
alt=""
class="starimg"
/> -->
<van-list
v-model="loading"
:finished="finished"
finished-text="没有更多了"
@load="onLoad"
>
<div
class="zixunitem flex"
v-for="(item, index) in zixunlist"
:key="index"
>
<div class="zixunitemleft">
<img :src="item.image" alt="" />
</div>
<div class="tieziwordbox tieziwordboxk">滚滚长江东逝水</div>
<div class="flexone luntandibu">
<div class="teizipingitem teizipingitemk flexone">
<img
src="../../../assets/pinglun_icon@2x.png"
alt=""
class="lunimg"
/>
1005
</div>
<div class="teizipingitem teizipingitemk flexone">
<img
src="../../../assets/zan_icon@2x.png"
alt=""
class="lunimg zanimg"
/>
1005
</div>
<div class="teizipingitem teizipingitemk flexone">
<div class="zixunitemright">
<div class="flextwo">
<div class="tiezicontentname tiezicontentnamek">
{{ item.name }}
</div>
<img
src="../../../assets/cai_icon@2x.png"
src="../../../assets/xingxing_icon@2x.png"
alt=""
class="lunimg zanimg"
class="starimg"
/>
1005
</div>
</div>
</div>
</div>
<div class="zixunitem flex">
<div class="zixunitemleft">
<img src="../../../assets/banner.png" alt="" />
</div>
<div class="zixunitemright">
<div class="flextwo">
<div class="tiezicontentname tiezicontentnamek">滚滚长江东逝水</div>
<img
src="../../../assets/xingxing_icon@2x.png"
alt=""
class="starimg"
/>
<!-- <img
<!-- <img
src="../../../assets/weishoucang_icon@2x.png"
alt=""
class="starimg"
/> -->
</div>
<div class="tieziwordbox tieziwordboxk">滚滚长江东逝水</div>
<div class="flexone luntandibu">
<div class="teizipingitem teizipingitemk flexone">
<img
src="../../../assets/pinglun_icon@2x.png"
alt=""
class="lunimg"
/>
1005
</div>
<div class="teizipingitem teizipingitemk flexone">
<img
src="../../../assets/zan_icon@2x.png"
alt=""
class="lunimg zanimg"
/>
1005
</div>
<div class="teizipingitem teizipingitemk flexone">
<img
src="../../../assets/cai_icon@2x.png"
alt=""
class="lunimg zanimg"
/>
1005
</div>
</div>
</div>
</div>
<div class="zixunitem flex">
<div class="zixunitemleft">
<img src="../../../assets/banner.png" alt="" />
</div>
<div class="zixunitemright">
<div class="flextwo">
<div class="tiezicontentname tiezicontentnamek">滚滚长江东逝水</div>
<img
src="../../../assets/xingxing_icon@2x.png"
alt=""
class="starimg"
/>
<!-- <img
src="../../../assets/weishoucang_icon@2x.png"
alt=""
class="starimg"
/> -->
</div>
<div class="tieziwordbox tieziwordboxk">滚滚长江东逝水</div>
<div class="flexone luntandibu">
<div class="teizipingitem teizipingitemk flexone">
<img
src="../../../assets/pinglun_icon@2x.png"
alt=""
class="lunimg"
/>
1005
</div>
<div class="teizipingitem teizipingitemk flexone">
<img
src="../../../assets/zan_icon@2x.png"
alt=""
class="lunimg zanimg"
/>
1005
</div>
<div class="teizipingitem teizipingitemk flexone">
<img
src="../../../assets/cai_icon@2x.png"
alt=""
class="lunimg zanimg"
/>
1005
<div class="tieziwordbox tieziwordboxk">滚滚长江东逝水</div>
<div class="flexone luntandibu">
<div class="teizipingitem teizipingitemk flexone">
<img
src="../../../assets/pinglun_icon@2x.png"
alt=""
class="lunimg"
/>
1005
</div>
<div class="teizipingitem teizipingitemk flexone">
<img
src="../../../assets/zan_icon@2x.png"
alt=""
class="lunimg zanimg"
/>
1005
</div>
<div class="teizipingitem teizipingitemk flexone">
<img
src="../../../assets/cai_icon@2x.png"
alt=""
class="lunimg zanimg"
/>
1005
</div>
</div>
</div>
</div>
</div>
</van-list>
</div>
</div>
</template>
<script>
export default {};
export default {
data() {
return {
page: 1,
zixunlist: [],
showpull: false,
loading: false,
finished: false,
}
},
created() {
this.getzixunlist()
},
methods: {
onLoad() {
// 异步更新数据
// setTimeout 仅做示例,真实场景中一般为 ajax 请求
setTimeout(() => {
let newpage = this.page;
newpage++;
this.page = newpage;
this.getzixunlist();
// 加载状态结束
this.loading = false;
// 数据全部加载完成
if (this.showpull == false) {
this.finished = true;
}
}, 1000);
},
// 获取中面咨讯
getzixunlist() {
let that = this;
var url = '/api/article/get_list';
var params = {
page: that.page,
}
that.$axios.post(url, params).then((res) => {
console.log(res);
that.zixunlist = that.zixunlist.concat(res.data)
if (that.page > 1) {
if (res.data.length == 0) {
that.showpull = true
}
}
}).catch((err) => {
console.log(err)
})
},
}
};
</script>
<style scoped>
... ...
... ... @@ -2,7 +2,7 @@
<div class="container">
<div class="minetopkkk">
<div class="minetophezi" v-if="show">
<div class="flexone">
<div class="flexone" @click="personziliao">
<div class="tieziimg tieziimgkk">
<img :src="userinfo.avatar" alt="" />
</div>
... ... @@ -19,19 +19,22 @@
</div>
</div>
<img
src="../../../assets/banggong_icon@2x.png"
:src="item.logo_image"
class="banggongimg"
alt=""
v-for="(item, index) in label"
:key="index"
/>
<img
<!-- <img
src="../../../assets/peisong_icon@2x.png"
class="banggongimg"
alt=""
/>
/> -->
<img
src="../../../assets/yirenzheng_icon@2x.png"
class="banggongimg banggongimgkk"
alt=""
v-if="userinfo.is_card == 1"
/>
</div>
<div class="tiezibto flexone"></div>
... ... @@ -57,7 +60,6 @@
</div>
</div>
</div>
<div class="collectbox">
<div class="collectboxitem flexone" @click="collect(1)">
<img
... ... @@ -67,22 +69,22 @@
/>
我的收藏
</div>
<div class="collectboxitem flexone" @click="collect(2)">
<!-- <div class="collectboxitem flexone" @click="collect(2)">
<img
src="../../../assets/huiyuan_icon@2x.png"
alt=""
class="collectimg"
/>
我的会员
</div>
<div class="collectboxitem flexone" @click="collect(3)">
</div> -->
<!-- <div class="collectboxitem flexone" @click="collect(3)">
<img
src="../../../assets/shezhi_icon@2x.png"
alt=""
class="collectimg"
/>
设置
</div>
</div> -->
<div class="collectboxitem flexone" @click="collect(4)">
<img
src="../../../assets/guanyu_icon@2x.png"
... ... @@ -95,9 +97,8 @@
<tabBar v-bind:active="4" />
</div>
</template>
<script>
import tabBar from "@/components/tabBar.vue";
import tabBar from "@/components/tabsec.vue";
export default {
components: {
tabBar
... ... @@ -109,13 +110,36 @@ export default {
total1: "",
total2: "",
total3: "",
total4: ""
total4: "",
guanwang: "",
label: ''
};
},
created() {
this.getuserinfo();
// 获取中面官网
this.getgaunwang()
},
methods: {
// 获取中面官网
getgaunwang() {
let that = this;
var url = '/api/sundry/get_page';
var params = {
id: 13
}
that.$axios.post(url, params).then((res) => {
console.log(res, 999999)
that.guanwang = res.data.content;
console.log(that.guanwang)
}).catch((err) => {
})
},
collect(id) {
if (id == 1) {
this.$router.push({
... ... @@ -131,8 +155,16 @@ export default {
type: 3
}
});
} else if (id == 4) {
window.location.href = this.guanwang
}
},
// 修改个人资料
personziliao() {
this.$router.push({
path: '/personziliao'
})
},
// 获取用户信息
getuserinfo() {
let that = this;
... ... @@ -143,13 +175,14 @@ export default {
.post(url, params)
.then(res => {
that.userinfo = res.data;
setTimeout(function() {
this.label = res.data.label
setTimeout(function () {
that.show = true;
}, 50);
// 获取帖子数量
that.gettiezinum();
})
.catch(err => {});
.catch(err => { });
},
// 获取帖子数量
gettiezinum() {
... ... @@ -166,7 +199,7 @@ export default {
that.total3 = res.data.total3;
that.total4 = res.data.total4;
})
.catch(err => {});
.catch(err => { });
},
// 进入我的收藏
goenter(id) {
... ...
... ... @@ -3,14 +3,53 @@
<div class="weiquanlist">
<div class="weiquanitem flextwo">
<div class="weiguitou flexone">
<div>昵称</div>
<div class="nameitem">小麦</div>
<div class="left">用户头像</div>
<!-- @click="chooseImage" -->
</div>
<img src="../../../assets/youjiantou.png" alt="" class="youjian" />
<div class="flexone">
<div class="right rightavatar">
<input
type="file"
class="shangtu"
accept="image/*"
@change="afterRead"
/>
<img
:src="avatar == '' ? '../../static/headtou.png' : avatar"
class="avator"
alt=""
/>
</div>
<img src="../../../assets/youjiantou.png" alt="" class="youjian" />
</div>
</div>
<div class="weiquanitem flextwo">
<div class="weiguitou flexone">
<div class="left">昵称</div>
</div>
<div class="nameitemright flexone">
<div class="nameitemk">
<input type="text" placeholder="请输入昵称" v-model="nickname" />
</div>
<!-- <img src="../../../assets/youjiantou.png" alt="" class="youjian" /> -->
</div>
</div>
<div class="weiquanitem flextwo">
<div class="weiguitou flexone">
<div class="left">地址</div>
</div>
<div class="nameitemright flexone">
<div class="nameitemk">
<input type="text" placeholder="请输入地址" v-model="address" />
</div>
<!-- <img src="../../../assets/youjiantou.png" alt="" class="youjian" /> -->
</div>
</div>
<!-- <div class="weiquanitem flextwo">
<div class="weiguitou flexone">
<div>性别</div>
<div class="nameitem">女</div>
</div>
... ... @@ -38,16 +77,144 @@
</div>
<img src="../../../assets/youjiantou.png" alt="" class="youjian" />
</div>
</div> -->
</div>
<div class="tuichu">保存</div>
<div class="tuichu" @click="save">保存</div>
<van-loading type="spinner" color="#1989fa" v-if="cardzheng" />
</div>
</template>
<script>
export default {};
</script>
import Vue from "vue";
import { Toast, Uploader, Loading } from "vant";
import "vant/lib/index.css";
Vue.use(Loading);
Vue.use(Toast);
Vue.use(Uploader);
export default {
data() {
return {
avatar: '',
cardzheng: false,
nickname: '',
address: ''
}
},
created() {
this.avatar = localStorage.getItem("avatar")
this.address = localStorage.getItem("address")
this.nickname = localStorage.getItem("nickname")
},
methods: {
// 上传图片
afterRead(e) {
console.log(e);
let file = e.target.files[0];
let that = this;
that.cardzheng = true;
var formdata = new FormData();
formdata.append("file", file);
var url = "/api/common/upload";
let param = {
id: 1
};
that.$uploadFile
.post(url, formdata)
.then(function (res) {
that.cardzheng = false;
console.log(res);
that.cardzheng = false;
let url = "https://app.chinesenooddles.com" + res.data.url;
that.avatar = url;
console.log(that.avatar)
that.chuanimage = res.data.url;
})
.catch(err => {
console.log(err);
});
},
save() {
let that = this;
if (that.avatar == '') {
Toast("请上传头像")
return false
}
if (that.nickname == '') {
Toast("请输入昵称")
return false
}
var url = '/api/member/update_user';
var params = {
avatar: that.avatar,
nickname: that.nickname,
address: that.address
}
console.log('7766554', params)
that.$axios.post(url, params).then((res) => {
console.log(res);
Toast("提交成功")
setTimeout(function () {
that.$router.go(-1)
}, 1500)
}).catch((err) => {
console.log(err)
})
}
}
};
</script>
<style scoped>
@import "../../style/homepage.css";
.van-loading {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 99;
}
.avator {
width: 0.92rem;
height: 0.92rem;
border-radius: 50%;
/* margin-left: 0.2rem; */
}
.left {
width: 1.3rem;
}
.nameitemk {
flex: 1;
margin-right: 0.2rem;
color: #191919;
font-size: 0.28rem;
}
.nameitemk input {
text-align: right;
width: 100%;
}
.nameitemright {
flex: 1;
}
.rightavatar {
position: relative;
margin-right: 0.2rem;
}
.shangtu {
width: 0.78rem;
height: 0.78rem;
position: absolute;
left: 0;
top: 0;
background: transparent;
border: none;
outline: none;
opacity: 0;
}
</style>
... ...
<template>
<div class="container">
<div class="minetopkkk ">
<div class="minetopkkk">
<div class="minetophezi tiezibox flextwo">
<div
class="xiaoxiitem flexfour"
... ... @@ -66,7 +66,7 @@
</template>
<script>
import tabBar from "@/components/tabBar.vue";
import tabBar from "@/components/tabsec.vue";
export default {
components: {
tabBar
... ...
... ... @@ -36,7 +36,8 @@ router.beforeEach((to, from, next) => {
const token = sessionStorage.getItem("token");
console.log("我是token", token);
console.log(to);
console.log(next());
console.log(next);
console.log(from);
if (!token) {
if (to.path === "/login") {
... ...
... ... @@ -157,6 +157,13 @@ export default new Router({
require(["@/components/views/homepage/examinetext.vue"], resolve)
},
{
path: "/articledetail",
name: "articledetail",
meta: { title: "中国面条" },
component: resolve =>
require(["@/components/views/homepage/articledetail.vue"], resolve)
},
{
path: "/myxianzan",
name: "myxianzan",
meta: { title: "中国面条" },
... ...
... ... @@ -13,4 +13,53 @@ function changename(value) {
return name;
}
export { changename };
\ No newline at end of file
// 格式富文本图片
var text = function(details) {
var texts = ""; //待拼接的内容
while (details.indexOf("<img") != -1) {
//寻找img 循环
texts += details.substring("0", details.indexOf("<img") + 4); //截取到<img前面的内容
details = details.substring(details.indexOf("<img") + 4); //<img 后面的内容
if (
details.indexOf("style=") != -1 &&
details.indexOf("style=") < details.indexOf(">")
) {
texts +=
details.substring(0, details.indexOf('style="') + 7) +
"max-width:100%;height:auto!important;margin:0 auto;"; //从 <img 后面的内容 截取到style= 加上自己要加的内容
details = details.substring(details.indexOf('style="') + 7); //style后面的内容拼接
} else {
texts += ' style="max-width:100%;height:auto!important;margin:0 auto;" ';
}
}
while (details.indexOf("<td") != -1) {
//寻找img 循环
texts += details.substring("0", details.indexOf("<td") + 4); //截取到<img前面的内容
details = details.substring(details.indexOf("<td") + 4); //<img 后面的内容
if (
details.indexOf("style=") != -1 &&
details.indexOf("style=") < details.indexOf(">")
) {
texts +=
details.substring(0, details.indexOf('style="') + 7) +
"max-width:74!important;height:auto!important;margin:0 auto;"; //从 <img 后面的内容 截取到style= 加上自己要加的内容
details = details.substring(details.indexOf('style="') + 7); //style后面的内容拼接
} else {
texts += ' style="max-width:100%;height:auto!important;margin:0 auto;" ';
}
}
texts += details; //最后拼接的内容
return texts;
};
export { changename, text };
\ No newline at end of file
... ...
... ... @@ -2,6 +2,7 @@ import Vue from "vue";
import axios from "./common.js";
console.log(axios);
Vue.prototype.$axios = axios;
// 获取路径地址
export function getUrlKey(name) {
return (
decodeURIComponent(
... ...