Merge pull request 'gdpaoup' (#120) from gyh into master

Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/120
This commit is contained in:
gyh 2020-08-05 21:11:49 +08:00
commit 720af35b11
15 changed files with 305 additions and 159 deletions

21
App.vue
View File

@ -1,6 +1,9 @@
<script> <script>
import { mapMutations } from 'vuex'; import { mapMutations, mapState } from 'vuex';
export default { export default {
computed: {
...mapState(["hasLogin"])
},
onLaunch() { onLaunch() {
// token // token
uni.getStorage({ uni.getStorage({
@ -9,9 +12,23 @@
this.loginIn(res.data); this.loginIn(res.data);
} }
}) })
// token
if (this.hasLogin) {
this.refreshToken_function();
}
}, },
methods: { methods: {
...mapMutations(['loginIn']) ...mapMutations(['loginIn']),
// token
refreshToken_function(){
this.$u.api.refreshToken({}).then((res) => {
// console.log(res);
if (res.errCode == 0) {
let token = res.data.token;
uni.setStorageSync('token', token);//toke
}
})
},
} }
} }
</script> </script>

View File

@ -3,8 +3,8 @@ const install = (Vue, vm) => {
Vue.prototype.$u.http.setConfig({ Vue.prototype.$u.http.setConfig({
baseUrl: 'https://dmmall.sdbairui.com/api', baseUrl: 'https://dmmall.sdbairui.com/api',
loadingText: '努力加载中~', loadingText: '努力加载中~',
loadingTime: 800 loadingTime: 800,
// originalData: true
}); });
// 请求拦截配置Token等参数 // 请求拦截配置Token等参数
@ -18,6 +18,28 @@ const install = (Vue, vm) => {
} }
// 响应拦截,如配置,每次请求结束都会执行本方法
Vue.prototype.$u.http.interceptor.response = (res) => {
if(parseInt(res.errCode) == 0) {
// res为服务端返回值可能有errCoderesult等字段
// 这里对res.result进行返回将会在this.$u.post(url).then(res => {})的then回调中的res的到
// 如果配置了originalData为true请留意这里的返回值
return res;
} else if(res.errCode == 401) {
// 假设201为token失效这里跳转登录
vm.$u.toast('验证失败,请重新登录');
setTimeout(() => {
// 此为uView的方法详见路由相关文档
vm.$u.route('/pageA/login/login')
}, 1500)
return false;
} else {
// 如果返回false则会调用Promise的reject回调
// 并将进入this.$u.post(url).then().catch(res=>{})的catch回调中res为服务端的返回值
return false;
}
}
} }
export default { export default {

View File

@ -1,6 +1,6 @@
<template> <template>
<view class="daren-item" @click="toDetailsPage"> <view class="daren-item">
<image class="head" :src="info.member_avatar"></image> <image class="head" @click="toDetailsPage" :src="info.member_avatar"></image>
<text class="name">{{ info.member_nickname }}</text> <text class="name">{{ info.member_nickname }}</text>
<text class="zhuangtai">状态: {{ info.live_status == 1 ? '正在直播' : '未开播' }}</text> <text class="zhuangtai">状态: {{ info.live_status == 1 ? '正在直播' : '未开播' }}</text>
<view class="guanzhu action" @tap="changeType(info.member_id)" v-if="info.is_attention == 1">已关注</view> <view class="guanzhu action" @tap="changeType(info.member_id)" v-if="info.is_attention == 1">已关注</view>
@ -8,17 +8,31 @@
</view> </view>
</template> </template>
<script> <script>
import { mapState } from 'vuex';
export default { export default {
name:"daren-item", name:"daren-item",
props: { props: {
info: Object, info: Object,
}, },
computed: {
...mapState(["login","hasLogin"]),
},
watch: {
info(newVal, old) {
// console.log(newVal);
},
deep: true
},
methods: { methods: {
toDetailsPage() { toDetailsPage() {
// // console.log();
const toke = uni.getStorageSync('token'); if (this.hasLogin) {
if (toke) { this.$u.route({
console.log(toke); url: "/pageB/details/index",
params: {
id: this.info.member_id
}
});
}else{ }else{
uni.navigateTo({ uni.navigateTo({
url: '/pageA/login/login' url: '/pageA/login/login'
@ -32,8 +46,8 @@ export default {
// }) // })
}, },
changeType:function(type){ changeType:function(type){
console.log("111") // console.log("111")
this.$emit("pChangeType",type) this.$emit("pChangeType",type);
}, },
}, },

View File

@ -37,12 +37,13 @@
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.video-item{ .video-item{
margin-top: 20rpx; flex-shrink: 0;
width: 335rpx; width: 335rpx;
box-shadow:0 3rpx 7rpx 0 rgba(153, 153, 153, 0.35);
padding-bottom: 20rpx; padding-bottom: 20rpx;
border-radius: 20rpx; margin-top: 20rpx;
overflow: hidden; overflow: hidden;
border-radius: 20rpx;
box-shadow:0 3rpx 7rpx 0 rgba(153, 153, 153, 0.35);
.head{ .head{
width: 100%; width: 100%;
height: 334rpx; height: 334rpx;
@ -195,29 +196,40 @@ export default {
// console.log(this.item); // console.log(this.item);
this.show = -1; this.show = -1;
}, },
watch: {
item(newVal, old) {
// console.log(newVal);
this.item = newVal;
},
deep: true
},
methods: { methods: {
showAction() { showAction() {
this.show = this.show > 0 ? -1 : this.item.article_id; this.show = this.show > 0 ? -1 : this.item.article_id;
}, },
//
articleLike() { articleLike() {
this.item.is_like = !this.item.is_like;
this.$u.api.articleLike({ this.$u.api.articleLike({
article_id: this.item.article_id, article_id: this.item.article_id,
}).then(res => { }).then(res => {
console.log(res) console.log(res)
if(res.errCode == 0) { if(res.errCode == 0) {
this.$u.toast(res.message); this.$u.toast(res.message);
this.$emit("getArticlelist"); // this.$emit("getArticlelist");
} }
}) })
}, },
//
articleCollect() { articleCollect() {
this.item.is_collect = !this.item.is_collect;
this.$u.api.articleCollect({ this.$u.api.articleCollect({
article_id: this.item.article_id, article_id: this.item.article_id,
}).then(res => { }).then(res => {
console.log(res); console.log(res);
if(res.errCode == 0) { if(res.errCode == 0) {
this.$u.toast(res.message); this.$u.toast(res.message);
this.$emit("getArticlelist"); // this.$emit("getArticlelist");
} }
}) })
}, },

View File

@ -1,7 +1,7 @@
<template> <template>
<view id="info_title"> <view id="info_title">
<view> <view>
<view class="url_info" v-for="(item,index) in list" :key="index" @click="route_skip(index)"> <view class="url_info" v-for="(item,index) in information" :key="index" @click="route_skip(index)">
<image :src="item.url"></image> <image :src="item.url"></image>
<text>{{item.text}}</text> <text>{{item.text}}</text>
</view> </view>
@ -56,33 +56,15 @@
props:['information'], props:['information'],
name: "info_title", name: "info_title",
data() { data() {
return { return {
list: [{
id: 0,
url: '../../static/pageD/info(11).png',
text: '公告/资讯'
},
{
id: 0,
url: '../../static/pageD/info(6).png',
text: '活动消息'
},
{
id: 0,
url: '../../static/pageD/info(14).png',
text: '交易物流'
},
{
id: 0,
url: '../../static/pageD/info(15).png',
text: '关注消息'
},
],
} }
}, },
watch: {
information(newVal, old) {
console.log(newVal);
},
deep: true
},
methods: { methods: {
// //
route_skip(index) { route_skip(index) {

View File

@ -187,19 +187,9 @@
rgb.push(color) rgb.push(color)
} }
return '#' + rgb.join('') return '#' + rgb.join('')
},
refreshToken_function(){
this.$u.api.refreshToken({}).then((res) => {
console.log(res)
if (res.errCode == 0) {
let token = res.data.token;
uni.setStorageSync('token', token);//toke
}
})
} }
}, },
mounted() { mounted() {
this.refreshToken_function();
// 3 // 3
this.remaining_time(); this.remaining_time();
this.apiwelcome(); this.apiwelcome();

View File

@ -1,6 +1,6 @@
<template> <template>
<view class="item" @click="toDetailsPage"> <view class="item" @click="toDetailsPage">
<image class="head" :src="info.pintuan_image"></image> <image class="head" :src="info.pintuan_image" mode="widthFix"></image>
<text class="title u-line-1">{{ info.pintuan_goods_name }}</text> <text class="title u-line-1">{{ info.pintuan_goods_name }}</text>
<view class="price"> <view class="price">
<view>{{ info.pintuan_goods_price }}</view> <view>{{ info.pintuan_goods_price }}</view>
@ -47,9 +47,9 @@ export default {
width: 210rpx; width: 210rpx;
overflow: hidden; overflow: hidden;
.head{ .head{
width: 210rpx; width: 150rpx;
height: 131rpx; height: 150rpx;
border-radius: 6rpx; border-radius: 10rpx;
} }
.title{ .title{
display: inline-block; display: inline-block;

View File

@ -18,7 +18,7 @@
</view> </view>
<!-- 服务协议 --> <!-- 服务协议 -->
<view class="pact"> <view class="pact" v-if="0">
<view> <view>
<view></view> <view></view>
<text>我已详细阅读并同意</text> <text>我已详细阅读并同意</text>

View File

@ -19,7 +19,7 @@ export default {
console.log(option) console.log(option)
// //
let typeIindex = option.index; let typeIindex = option.index;
this.typeIndexRquest(typeIindex) this.typeIndexRquest(typeIindex);
}, },
methods: { methods: {
typeIndexRquest(typeIindex){ typeIndexRquest(typeIindex){
@ -28,16 +28,22 @@ export default {
this.$u.api.documentInfo({ this.$u.api.documentInfo({
document_code: 'agreement' document_code: 'agreement'
}).then((res)=>{ }).then((res)=>{
console.log(res) // console.log(res.data.document_title);
uni.setNavigationBarTitle({
title: res.data.document_title
})
let data = common.unescapeHTML(res.data.document_content); let data = common.unescapeHTML(res.data.document_content);
this.document_content = data this.document_content = data;
}) })
} }
if(typeIindex == 1){ if(typeIindex == 1){
this.$u.api.documentInfo({ this.$u.api.documentInfo({
document_code: 'privacy' document_code: 'privacy'
}).then((res)=>{ }).then((res)=>{
console.log(res) // console.log(res.data.document_title);
uni.setNavigationBarTitle({
title: res.data.document_title
})
let data = common.unescapeHTML(res.data.document_content); let data = common.unescapeHTML(res.data.document_content);
this.document_content = data this.document_content = data
}) })
@ -46,7 +52,10 @@ export default {
this.$u.api.documentInfo({ this.$u.api.documentInfo({
document_code: 'use' document_code: 'use'
}).then((res)=>{ }).then((res)=>{
console.log(res) // console.log(res.data.document_title);
uni.setNavigationBarTitle({
title: res.data.document_title
})
let data = common.unescapeHTML(res.data.document_content); let data = common.unescapeHTML(res.data.document_content);
this.document_content = data this.document_content = data
}) })

View File

@ -1,27 +1,29 @@
<template> <template>
<view class="userinfo"> <view class="userinfo">
<view class="user"> <view class="user">
<view class="info"> <view class="info">
<image></image> <view class="avatar">
<view> <image :src="item.member_avatar"></image>
<text>达人昵称</text>
<text>关注数量</text>
</view> </view>
<view class="box">
<view class="name">{{ item.member_nickname }}</view>
<view class="num">
<text>粉丝数{{ item.fans_num }}</text>
<text>评论数{{ item.comment_num }}</text>
</view> </view>
<view class="guanzhu">关注</view>
</view> </view>
<view class="profile">个性签名</view> </view>
<view class="btn" :class="[ is_follow ? 'btn-follow' : 'btn-unfollow' ]" @click="following">{{ is_follow ? "已关注" : "关注" }}</view>
</view>
<view class="profile" :class="{'u-line-2': is_open }" @click="openPro">
个性签名{{ item.recommend ? item.recommend : "对方很懒没有留下任何东西~~" }}
</view>
</view> </view>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
image{
background-color: #0f0;
}
.userinfo{ .userinfo{
height: 261rpx;
width: 100%; width: 100%;
// height: 261rpx;
padding: 30rpx; padding: 30rpx;
.user{ .user{
display: flex; display: flex;
@ -31,53 +33,92 @@ image{
.info{ .info{
display: flex; display: flex;
align-items: center; align-items: center;
>image{ .avatar {
&>image{
width: 140rpx; width: 140rpx;
height: 140rpx; height: 140rpx;
border-radius: 50%; border-radius: 50%;
} }
>view{ }
margin-left: 40rpx; .box {
display: flex; display: flex;
height: 79rpx;
justify-content: space-between; justify-content: space-between;
flex-direction: column; flex-direction: column;
>text:first-child{ height: 79rpx;
font-size: 28rpx; margin-left: 40rpx;
color:#333;
}
>text:last-child{
font-size: 24rpx;
color: #333; color: #333;
.name {
font-size: 28rpx;
}
.num {
font-size: 24rpx;
& > :first-child {
margin-right: 20rpx;
} }
} }
} }
.guanzhu{ }
.btn{
width: 140rpx; width: 140rpx;
height: 60rpx; height: 60rpx;
font-size: 26rpx; font-size: 26rpx;
color:#fff;
line-height: 60rpx; line-height: 60rpx;
border-radius: 30rpx;
background-color: #FF780F;
text-align: center; text-align: center;
color:#fff;
border-radius: 30rpx;
}
.btn-follow {
background-color: #007AFF;
}
.btn-unfollow {
background-color: #FF780F;
} }
} }
.profile{ .profile{
margin-top: 19rpx; margin-top: 20rpx;
font-size: 24rpx; font-size: 24rpx;
color: #333; color: #333;
margin-left: 14rpx; line-height: 1.2;
} }
} }
</style> </style>
<script> <script>
export default { export default {
name:"userinfo", name:"userinfo",
props: ["list"],
data(){ data(){
return { return {
item: {},
is_open: true,
is_follow: false,
}
},
watch: {
list(newVal, old) {
// console.log(newVal);
this.item = newVal;
this.is_follow = newVal.is_attention;
},
deep: true
},
methods: {
//
openPro() {
this.is_open = !this.is_open;
},
//
following() {
this.$u.api.attentionMember({
member_id: this.item.member_id
}).then(res => {
console.log(res);
if (res.errCode == 0) {
this.is_follow = !this.is_follow;
this.$u.toast(res.message);
} else {
this.$u.toast(res.message);
}
})
} }
} }
} }

View File

@ -1,7 +1,7 @@
<template> <template>
<view class="details"> <view class="details">
<view style="border-top: 1rpx solid #ececec;"></view> <view style="border-top: 1rpx solid #ececec;"></view>
<userinfo></userinfo> <userinfo :list="userInfo"></userinfo>
<view style="border-top: 20rpx solid #ececec;"></view> <view style="border-top: 20rpx solid #ececec;"></view>
<u-tabs :is-scroll="false" bar-width="70" ref="tabs" :list="list" :current="num" :bar-style="{ <u-tabs :is-scroll="false" bar-width="70" ref="tabs" :list="list" :current="num" :bar-style="{
'background-color':'#FF780F', 'background-color':'#FF780F',
@ -13,39 +13,15 @@
}" }"
:bold="false" :bold="false"
@change="dianji" @change="dianji"
:show-bar="false"></u-tabs> :show-bar="false">
<swiper class="card" @change="dianji" :current="num"> </u-tabs>
<swiper-item> <scroll-view class="scroll-box" scroll-y="true">
<scroll-view style="width:100%;height:100%" scroll-y="true">
<view class="box"> <view class="box">
<view class="list"> <videoItem v-for="item in listInfo" :key="item.article_id" :item="item"
<view > @getArticlelist="getArticlelist"></videoItem>
<videoItem v-for="item in 10" :key="index"></videoItem> <view class="no-data" v-show="!listInfo && !page">暂无数据</view>
</view> </view>
<view style="margin-left:20rpx">
<videoItem v-for="item in 10" :key="index"></videoItem>
</view>
</view>
</view>
</scroll-view> </scroll-view>
</swiper-item>
<swiper-item>
<scroll-view style="width:100%;height:100%" scroll-y="true">
<view class="box">
<view class="list">
<view >
<zhiboItem v-for="item in 10" :key="index"></zhiboItem>
</view>
<view style="margin-left:20rpx">
<zhiboItem v-for="item in 10" :key="index"></zhiboItem>
</view>
</view>
</view>
</scroll-view>
</swiper-item>
</swiper>
</view> </view>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -61,39 +37,85 @@
display: flex; display: flex;
} }
} }
.scroll-box {
// display: flex;
padding: 20rpx;
box-sizing: border-box;
.box {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.no-data {
margin: 100rpx auto 0;
}
}
}
} }
</style> </style>
<script> <script>
import videoItem from "@/components/index/video-item/index"
import zhiboItem from "@/components/index/zhibo-item/index"
import userinfo from "../components/details/userinfo" import userinfo from "../components/details/userinfo"
import videoItem from "@/components/index/video-item/index"
export default { export default {
name:"details", // name:"details",
components:{ components:{
userinfo, userinfo,
videoItem, videoItem
zhiboItem
}, },
data(){ data(){
return { return {
list:[ list:[
{ {
name: '短视频'
}, {
name: '图文' name: '图文'
}, {
name: '短视频'
} }
], ],
num:0 num: 0,
userInfo: {}, //
listInfo: [], //
member_id: 0,
page: 0,
} }
}, },
onLoad(option) {
// console.log(option);
this.member_id = option.id;
this.getUserInfo(option.id);
this.getArticlelist();
},
methods:{ methods:{
//
getUserInfo(id) {
this.$u.post("MemberExpert/expertInfo",{member_id: id}).then(res => {
// console.log(res);
this.userInfo = res.data.info;
// console.log(this.userInfo);
})
},
//
getArticlelist() {
this.$u.api.getArticlelist({
page: this.page,
is_video_img: this.num + 1,
member_id: this.member_id,
}).then(res => {
if (res.errCode == 0) {
// console.log(res);
this.listInfo = res.data.list;
console.log(this.listInfo);
} else {
console.log(res.message);
}
})
},
dianji(a){ dianji(a){
console.log(a) console.log(a);
if(typeof a == "object"){ if(typeof a == "object"){
this.num = a.detail.current this.num = a.detail.current
}else{ }else{
this.num = a this.num = a
} }
this.getArticlelist();
} }
} }
} }

View File

@ -14,7 +14,7 @@
<text>图片</text> <text>图片</text>
<view v-for="(item,index) in list.photo" :key="index" :style="{'background-color':index == swiper_id ? '#fff' : '#ede8e8'}"></view> <view v-for="(item,index) in list.photo" :key="index" :style="{'background-color':index == swiper_id ? '#fff' : '#ede8e8'}"></view>
</view> </view>
<view class="username">{{ list.member_nickname }}</view> <view class="username">@{{ list.member_nickname }}</view>
<view class="title">{{ list.article_title }}</view> <view class="title">{{ list.article_title }}</view>
<view class="info">{{ list.article_content }}</view> <view class="info">{{ list.article_content }}</view>
<view class="box"> <view class="box">
@ -29,7 +29,7 @@
<text>评论</text> <text>评论</text>
<u-icon name="arrow-down" color="#333" size="28" @click="is_comment=false"></u-icon> <u-icon name="arrow-down" color="#333" size="28" @click="is_comment=false"></u-icon>
</view> </view>
<scroll-view class="scroll-box" scroll-y="true" > <scroll-view class="scroll-box" scroll-y="true" @scrolltolower="scrollBottom">
<block v-for="(item,index) in commentList" :key="index" v-if="commentList.length"> <block v-for="(item,index) in commentList" :key="index" v-if="commentList.length">
<view class="box"> <view class="box">
<image :src="item.member_avatar" mode="aspectFill"></image> <image :src="item.member_avatar" mode="aspectFill"></image>
@ -373,6 +373,7 @@ export default {
return { return {
list:{}, list:{},
swiper_id: "", swiper_id: "",
page: 1, //
cart_type: false, // cart_type: false, //
is_comment: false, // is_comment: false, //
is_focus: false, // is_focus: false, //
@ -489,6 +490,10 @@ export default {
current: e.currentTarget.dataset.url, current: e.currentTarget.dataset.url,
}) })
}, },
//
scrollBottom(e) {
console.log(e);
},
// //
gotoInfo(id) { gotoInfo(id) {
console.log(id); console.log(id);

View File

@ -84,7 +84,7 @@
{ {
"path": "follow/index", "path": "follow/index",
"style": { "style": {
"navigationBarTitleText": "推荐达人列表", "navigationBarTitleText": "推荐达人",
"app-plus":{ "app-plus":{
"titleNView":{ "titleNView":{
"backgroundColor":"#ffffff" "backgroundColor":"#ffffff"
@ -95,7 +95,7 @@
{ {
"path": "details/index", "path": "details/index",
"style": { "style": {
"navigationBarTitleText": "", "navigationBarTitleText": "达人详情",
"app-plus":{ "app-plus":{
"titleNView":{ "titleNView":{
"backgroundColor":"#ffffff" "backgroundColor":"#ffffff"

View File

@ -61,7 +61,7 @@
<view></view> <view></view>
<text>推荐达人</text> <text>推荐达人</text>
</view> </view>
<image class="right" src="/static/image/common/1.png"></image> <u-icon name="arrow-right" color="#666" size="28"></u-icon>
</view> </view>
<view class="tuijianlist"> <view class="tuijianlist">
<!-- <darenItem style="margin-right:23rpx"></darenItem> <!-- <darenItem style="margin-right:23rpx"></darenItem>
@ -69,16 +69,12 @@
<darenItem v-for="item in recommendList.slice(0,3)" :key="item.id" :info="item" v-on:pChangeType="changeType"></darenItem> <darenItem v-for="item in recommendList.slice(0,3)" :key="item.id" :info="item" v-on:pChangeType="changeType"></darenItem>
</view> </view>
</view> </view>
<view class="list"> <view class="rec-list">
<view> <view class="rec-box">
<!-- <videoItem isguanzhu="true" v-for="item in 10"></videoItem> --> <!-- {{ fansList }} -->
<videoItem isguanzhu="true" v-for="item in articleList.filter((_, index) => !(index&1))" :key="item.article_id" <videoItem isguanzhu="true" v-for="item in fansList" :key="item.article_id"
:item="item" @getArticlelist="getArticlelist"></videoItem> :item="item"></videoItem>
</view> <view class="no-data" v-show="!fansList.length">您还没有关注哦赶紧去点点关注</view>
<view style="margin-left:20rpx">
<!-- <videoItem isguanzhu="true" v-for="item in 10"></videoItem> -->
<videoItem isguanzhu="true" v-for="item in articleList.filter((_, index) => index&1)" :key="item.article_id"
:item="item" @getArticlelist="getArticlelist"></videoItem>
</view> </view>
</view> </view>
</view> </view>
@ -181,6 +177,17 @@
} }
} }
} }
.rec-list {
width: 100%;
.rec-box {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.no-data {
margin: 200rpx auto 0;
}
}
}
} }
</style> </style>
<script> <script>
@ -206,7 +213,8 @@
recommendList: [], // recommendList: [], //
indexImageSwiper: [], indexImageSwiper: [],
zhiboImageSwiper: [], zhiboImageSwiper: [],
tabLiveLists: [] tabLiveLists: [],
fansList: [], //
} }
}, },
components: { components: {
@ -221,18 +229,21 @@
this.getSwiper(); this.getSwiper();
this.getZhiBoSwiper(); this.getZhiBoSwiper();
this.tabLiveList(); this.tabLiveList();
this.getFollowList();
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.getArticlelist(); this.getArticlelist();
// this.getManicureList({ load: 'reload' }); // this.getManicureList({ load: 'reload' });
}, },
methods: { methods: {
//
tabLiveList() { tabLiveList() {
this.$u.api.tabLiveList().then((res) => { this.$u.api.tabLiveList().then((res) => {
console.log(res) console.log(res)
this.tabLiveLists = res.data this.tabLiveLists = res.data;
}) })
}, },
//
getSwiper() { getSwiper() {
this.$u.api.getIndexSwiper().then(res => { this.$u.api.getIndexSwiper().then(res => {
if (res.errCode == 0) { if (res.errCode == 0) {
@ -240,14 +251,16 @@
} }
}) })
}, },
//
changeType(member_id) { changeType(member_id) {
console.log(member_id); console.log(member_id);
this.$emit("pChangeType") // this.$emit("pChangeType");
this.$u.api.attentionMember({ this.$u.api.attentionMember({
member_id: member_id member_id: member_id
}).then((res) => { }).then((res) => {
console.log(res) console.log(res)
this.getRecommendList(); this.getRecommendList();
this.getFollowList(); //
}) })
}, },
getZhiBoSwiper() { getZhiBoSwiper() {
@ -257,26 +270,29 @@
} }
}) })
}, },
//
dianji(a) { dianji(a) {
// console.log(a) console.log(a);
if (typeof a == "object") { if (typeof a == "object") {
this.num = a.detail.current this.num = a.detail.current
} else { } else {
this.num = a this.num = a
} }
}, },
//
getArticlelist() { getArticlelist() {
this.$u.api.getArticlelist({ this.$u.api.getArticlelist({
page: this.page, page: this.page,
is_video_img: 0, // 1 2 0 is_video_img: 0, // 1 2 0
}).then(res => { }).then(res => {
uni.stopPullDownRefresh(); // uni.stopPullDownRefresh();
console.log('37647744ghj', res) // console.log('37647744ghj', res)
if (res.errCode == 0) { if (res.errCode == 0) {
this.articleList = res.data.list; this.articleList = res.data.list;
} }
}) })
}, },
//
getRecommendList() { getRecommendList() {
this.$u.api.getRecommendList().then(res => { this.$u.api.getRecommendList().then(res => {
console.log(res) console.log(res)
@ -285,6 +301,17 @@
} }
}) })
}, },
//
getFollowList() {
this.$u.post("article/attentionArticleList",{
page: 0,
}).then(res => {
if (res.errCode == 0) {
this.fansList = res.data.list;
}
// console.log(res);
})
},
toSearchPage() { toSearchPage() {
console.log("22"); console.log("22");
uni.navigateTo({ uni.navigateTo({

View File

@ -31,8 +31,12 @@
</template> </template>
<script> <script>
import { mapState } from 'vuex';
import titles from "@/components/informations/titles/titles" import titles from "@/components/informations/titles/titles"
export default { export default {
computed: {
...mapState(["hasLogin,token"])
},
data() { data() {
return { return {
information_dles : [{ information_dles : [{
@ -49,7 +53,6 @@
id: 0, id: 0,
url: '../../static/pageD/info(14).png', url: '../../static/pageD/info(14).png',
text: '交易物流' text: '交易物流'
}, },
{ {
id: 0, id: 0,
@ -94,7 +97,9 @@
}, },
onLoad() { onLoad() {
// / // /
this.messageIndex() if (this.hasLogin) {
this.messageIndex();
}
if(this.$store.state.hasLogin){ if(this.$store.state.hasLogin){
const user = uni.getStorageSync('user_info'); const user = uni.getStorageSync('user_info');
console.log(user) console.log(user)