Merge pull request 'gdpaoup' (#120) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/120
This commit is contained in:
		
						commit
						720af35b11
					
				
							
								
								
									
										21
									
								
								App.vue
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								App.vue
									
									
									
									
									
								
							@ -1,6 +1,9 @@
 | 
			
		||||
<script>
 | 
			
		||||
	import { mapMutations } from 'vuex';
 | 
			
		||||
	import { mapMutations, mapState } from 'vuex';
 | 
			
		||||
	export default {
 | 
			
		||||
        computed: {
 | 
			
		||||
            ...mapState(["hasLogin"])
 | 
			
		||||
        },
 | 
			
		||||
		onLaunch() {
 | 
			
		||||
			// 缓存token
 | 
			
		||||
			uni.getStorage({
 | 
			
		||||
@ -9,9 +12,23 @@
 | 
			
		||||
					this.loginIn(res.data);
 | 
			
		||||
				}
 | 
			
		||||
			})
 | 
			
		||||
            // 刷新token
 | 
			
		||||
            if (this.hasLogin) {
 | 
			
		||||
                this.refreshToken_function();
 | 
			
		||||
            }
 | 
			
		||||
		},
 | 
			
		||||
		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>
 | 
			
		||||
 | 
			
		||||
@ -3,8 +3,8 @@ const install = (Vue, vm) => {
 | 
			
		||||
	Vue.prototype.$u.http.setConfig({
 | 
			
		||||
		baseUrl: 'https://dmmall.sdbairui.com/api',
 | 
			
		||||
		loadingText: '努力加载中~',
 | 
			
		||||
		loadingTime: 800
 | 
			
		||||
 | 
			
		||||
		loadingTime: 800,
 | 
			
		||||
        // originalData: true
 | 
			
		||||
	});
 | 
			
		||||
	
 | 
			
		||||
	// 请求拦截,配置Token等参数
 | 
			
		||||
@ -17,6 +17,28 @@ const install = (Vue, vm) => {
 | 
			
		||||
		return config;
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
    
 | 
			
		||||
    // 响应拦截,如配置,每次请求结束都会执行本方法
 | 
			
		||||
    Vue.prototype.$u.http.interceptor.response = (res) => {
 | 
			
		||||
        if(parseInt(res.errCode) == 0) {
 | 
			
		||||
            // res为服务端返回值,可能有errCode,result等字段
 | 
			
		||||
            // 这里对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;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
<template>
 | 
			
		||||
    <view class="daren-item" @click="toDetailsPage">
 | 
			
		||||
        <image class="head" :src="info.member_avatar"></image>
 | 
			
		||||
    <view class="daren-item">
 | 
			
		||||
        <image class="head" @click="toDetailsPage" :src="info.member_avatar"></image>
 | 
			
		||||
        <text class="name">{{ info.member_nickname }}</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>
 | 
			
		||||
@ -8,17 +8,31 @@
 | 
			
		||||
    </view>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { mapState } from 'vuex';
 | 
			
		||||
export default {
 | 
			
		||||
	name:"daren-item",
 | 
			
		||||
	props: {
 | 
			
		||||
		info: Object,
 | 
			
		||||
	},
 | 
			
		||||
    computed: {
 | 
			
		||||
      ...mapState(["login","hasLogin"]),
 | 
			
		||||
    },
 | 
			
		||||
    watch: {
 | 
			
		||||
        info(newVal, old) {
 | 
			
		||||
            // console.log(newVal);
 | 
			
		||||
        },
 | 
			
		||||
        deep: true
 | 
			
		||||
    },
 | 
			
		||||
	methods: {
 | 
			
		||||
		toDetailsPage() {
 | 
			
		||||
			// 判断是否登录
 | 
			
		||||
			const toke = uni.getStorageSync('token');
 | 
			
		||||
			if (toke) {
 | 
			
		||||
				console.log(toke);
 | 
			
		||||
            // console.log();
 | 
			
		||||
			if (this.hasLogin) {
 | 
			
		||||
				this.$u.route({
 | 
			
		||||
                    url: "/pageB/details/index",
 | 
			
		||||
                    params: {
 | 
			
		||||
                        id: this.info.member_id
 | 
			
		||||
                    }
 | 
			
		||||
                });
 | 
			
		||||
			}else{
 | 
			
		||||
				uni.navigateTo({
 | 
			
		||||
					url: '/pageA/login/login'
 | 
			
		||||
@ -32,8 +46,8 @@ export default {
 | 
			
		||||
			// })
 | 
			
		||||
		},
 | 
			
		||||
		changeType:function(type){
 | 
			
		||||
			console.log("111")
 | 
			
		||||
			this.$emit("pChangeType",type) 
 | 
			
		||||
			// console.log("111")
 | 
			
		||||
			this.$emit("pChangeType",type);
 | 
			
		||||
		},
 | 
			
		||||
		
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
@ -37,12 +37,13 @@
 | 
			
		||||
</template>
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
.video-item{
 | 
			
		||||
    margin-top: 20rpx;
 | 
			
		||||
    flex-shrink: 0;
 | 
			
		||||
    width: 335rpx;
 | 
			
		||||
    box-shadow:0 3rpx 7rpx 0 rgba(153, 153, 153, 0.35);
 | 
			
		||||
    padding-bottom: 20rpx;
 | 
			
		||||
    border-radius: 20rpx;
 | 
			
		||||
    margin-top: 20rpx;
 | 
			
		||||
    overflow: hidden;
 | 
			
		||||
    border-radius: 20rpx;
 | 
			
		||||
    box-shadow:0 3rpx 7rpx 0 rgba(153, 153, 153, 0.35);
 | 
			
		||||
    .head{
 | 
			
		||||
        width: 100%;
 | 
			
		||||
        height: 334rpx;
 | 
			
		||||
@ -195,29 +196,40 @@ export default {
 | 
			
		||||
		// console.log(this.item);
 | 
			
		||||
		this.show = -1;
 | 
			
		||||
	},
 | 
			
		||||
    watch: {
 | 
			
		||||
        item(newVal, old) {
 | 
			
		||||
            // console.log(newVal);
 | 
			
		||||
            this.item = newVal;
 | 
			
		||||
        },
 | 
			
		||||
        deep: true
 | 
			
		||||
    },
 | 
			
		||||
	methods: {
 | 
			
		||||
		showAction() {
 | 
			
		||||
			this.show = this.show > 0 ? -1 : this.item.article_id;
 | 
			
		||||
		},
 | 
			
		||||
        // 点赞
 | 
			
		||||
		articleLike() {
 | 
			
		||||
            this.item.is_like = !this.item.is_like;
 | 
			
		||||
			this.$u.api.articleLike({
 | 
			
		||||
				article_id: this.item.article_id,
 | 
			
		||||
			}).then(res => {
 | 
			
		||||
				console.log(res)
 | 
			
		||||
				if(res.errCode == 0) {
 | 
			
		||||
                    this.$u.toast(res.message);
 | 
			
		||||
					this.$emit("getArticlelist");
 | 
			
		||||
					// this.$emit("getArticlelist");
 | 
			
		||||
				}
 | 
			
		||||
			})
 | 
			
		||||
		},
 | 
			
		||||
        // 收藏
 | 
			
		||||
		articleCollect() {
 | 
			
		||||
            this.item.is_collect = !this.item.is_collect;
 | 
			
		||||
			this.$u.api.articleCollect({
 | 
			
		||||
				article_id: this.item.article_id,
 | 
			
		||||
			}).then(res => {
 | 
			
		||||
				console.log(res);
 | 
			
		||||
				if(res.errCode == 0) {
 | 
			
		||||
                    this.$u.toast(res.message);
 | 
			
		||||
					this.$emit("getArticlelist");
 | 
			
		||||
					// this.$emit("getArticlelist");
 | 
			
		||||
				}
 | 
			
		||||
			})
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<view id="info_title">
 | 
			
		||||
		<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>
 | 
			
		||||
				<text>{{item.text}}</text>
 | 
			
		||||
			</view>
 | 
			
		||||
@ -56,33 +56,15 @@
 | 
			
		||||
		props:['information'],
 | 
			
		||||
		name: "info_title",
 | 
			
		||||
		data() {
 | 
			
		||||
 | 
			
		||||
			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: {
 | 
			
		||||
			// 点击顶部的标题模块跳转
 | 
			
		||||
			route_skip(index) {
 | 
			
		||||
 | 
			
		||||
@ -187,19 +187,9 @@
 | 
			
		||||
					rgb.push(color)
 | 
			
		||||
				}
 | 
			
		||||
				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() {
 | 
			
		||||
		this.refreshToken_function();
 | 
			
		||||
		// 3秒倒计时调用
 | 
			
		||||
		this.remaining_time();
 | 
			
		||||
		this.apiwelcome();
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
<template>
 | 
			
		||||
    <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>
 | 
			
		||||
        <view class="price">
 | 
			
		||||
            <view>¥{{ info.pintuan_goods_price }}</view>
 | 
			
		||||
@ -47,9 +47,9 @@ export default {
 | 
			
		||||
    width: 210rpx;
 | 
			
		||||
	overflow: hidden;
 | 
			
		||||
    .head{
 | 
			
		||||
        width: 210rpx;
 | 
			
		||||
        height: 131rpx;
 | 
			
		||||
        border-radius: 6rpx;
 | 
			
		||||
        width: 150rpx;
 | 
			
		||||
        height: 150rpx;
 | 
			
		||||
        border-radius: 10rpx;
 | 
			
		||||
    }
 | 
			
		||||
    .title{
 | 
			
		||||
		display: inline-block;
 | 
			
		||||
 | 
			
		||||
@ -18,7 +18,7 @@
 | 
			
		||||
				</view>
 | 
			
		||||
 | 
			
		||||
				<!-- 服务协议 -->
 | 
			
		||||
				<view class="pact">
 | 
			
		||||
				<view class="pact" v-if="0">
 | 
			
		||||
					<view>
 | 
			
		||||
						<view></view>
 | 
			
		||||
						<text>我已详细阅读并同意</text>
 | 
			
		||||
 | 
			
		||||
@ -19,7 +19,7 @@ export default {
 | 
			
		||||
		console.log(option)
 | 
			
		||||
		// 协议类型调用不同的的协议
 | 
			
		||||
		let typeIindex = option.index;
 | 
			
		||||
		this.typeIndexRquest(typeIindex)
 | 
			
		||||
		this.typeIndexRquest(typeIindex);
 | 
			
		||||
	}, 
 | 
			
		||||
	methods: {
 | 
			
		||||
		typeIndexRquest(typeIindex){
 | 
			
		||||
@ -28,16 +28,22 @@ export default {
 | 
			
		||||
				this.$u.api.documentInfo({
 | 
			
		||||
					document_code: 'agreement'
 | 
			
		||||
				}).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);
 | 
			
		||||
					this.document_content = data 
 | 
			
		||||
					this.document_content = data;
 | 
			
		||||
				})
 | 
			
		||||
			}
 | 
			
		||||
			if(typeIindex == 1){
 | 
			
		||||
				this.$u.api.documentInfo({
 | 
			
		||||
					document_code: 'privacy'
 | 
			
		||||
				}).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);
 | 
			
		||||
					this.document_content = data 
 | 
			
		||||
				})
 | 
			
		||||
@ -46,7 +52,10 @@ export default {
 | 
			
		||||
				this.$u.api.documentInfo({
 | 
			
		||||
					document_code: 'use'
 | 
			
		||||
				}).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);
 | 
			
		||||
					this.document_content = data 
 | 
			
		||||
				})
 | 
			
		||||
 | 
			
		||||
@ -1,27 +1,29 @@
 | 
			
		||||
<template>
 | 
			
		||||
    <view class="userinfo">
 | 
			
		||||
 | 
			
		||||
        <view class="user">
 | 
			
		||||
            <view class="info">
 | 
			
		||||
                <image></image>
 | 
			
		||||
                <view>
 | 
			
		||||
                    <text>达人昵称</text>
 | 
			
		||||
                    <text>关注数量</text>
 | 
			
		||||
                <view class="avatar">
 | 
			
		||||
                    <image :src="item.member_avatar"></image>
 | 
			
		||||
                </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>
 | 
			
		||||
            <view class="guanzhu">关注</view>
 | 
			
		||||
            <view class="btn" :class="[ is_follow ? 'btn-follow' : 'btn-unfollow' ]" @click="following">{{ is_follow ? "已关注" : "关注" }}</view>
 | 
			
		||||
        </view>
 | 
			
		||||
        <view class="profile">个性签名</view>
 | 
			
		||||
        <view class="profile" :class="{'u-line-2': is_open }" @click="openPro">
 | 
			
		||||
            个性签名:{{ item.recommend ? item.recommend : "对方很懒没有留下任何东西~~" }}
 | 
			
		||||
            </view>
 | 
			
		||||
    </view>
 | 
			
		||||
</template>
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
image{
 | 
			
		||||
    background-color: #0f0;
 | 
			
		||||
}
 | 
			
		||||
.userinfo{
 | 
			
		||||
    height: 261rpx;
 | 
			
		||||
    width: 100%;
 | 
			
		||||
    // height: 261rpx;
 | 
			
		||||
    padding: 30rpx;
 | 
			
		||||
    .user{
 | 
			
		||||
        display: flex;
 | 
			
		||||
@ -31,53 +33,92 @@ image{
 | 
			
		||||
        .info{
 | 
			
		||||
            display: flex;
 | 
			
		||||
            align-items: center;
 | 
			
		||||
            >image{
 | 
			
		||||
                width: 140rpx;
 | 
			
		||||
                height: 140rpx;
 | 
			
		||||
                border-radius: 50%;
 | 
			
		||||
 | 
			
		||||
            .avatar {
 | 
			
		||||
                &>image{
 | 
			
		||||
                    width: 140rpx;
 | 
			
		||||
                    height: 140rpx;
 | 
			
		||||
                    border-radius: 50%;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            >view{
 | 
			
		||||
                margin-left: 40rpx;
 | 
			
		||||
            .box {
 | 
			
		||||
                display: flex;
 | 
			
		||||
                height: 79rpx;
 | 
			
		||||
                justify-content: space-between;
 | 
			
		||||
                flex-direction: column;
 | 
			
		||||
                >text:first-child{
 | 
			
		||||
                height: 79rpx;
 | 
			
		||||
                margin-left: 40rpx;
 | 
			
		||||
                color: #333;
 | 
			
		||||
                .name {
 | 
			
		||||
                    font-size: 28rpx;
 | 
			
		||||
                    color:#333;
 | 
			
		||||
                }
 | 
			
		||||
                >text:last-child{
 | 
			
		||||
                .num {
 | 
			
		||||
                    font-size: 24rpx;
 | 
			
		||||
                    color: #333;
 | 
			
		||||
                    & > :first-child {
 | 
			
		||||
                        margin-right: 20rpx;
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        .guanzhu{
 | 
			
		||||
        .btn{
 | 
			
		||||
            width: 140rpx;
 | 
			
		||||
            height: 60rpx;
 | 
			
		||||
            font-size: 26rpx;
 | 
			
		||||
            color:#fff;
 | 
			
		||||
            line-height: 60rpx;
 | 
			
		||||
            border-radius: 30rpx;
 | 
			
		||||
            background-color: #FF780F;
 | 
			
		||||
            text-align: center;
 | 
			
		||||
            color:#fff;
 | 
			
		||||
            border-radius: 30rpx;
 | 
			
		||||
        }
 | 
			
		||||
        .btn-follow {
 | 
			
		||||
            background-color: #007AFF;
 | 
			
		||||
        }
 | 
			
		||||
        .btn-unfollow {
 | 
			
		||||
            background-color: #FF780F;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    .profile{
 | 
			
		||||
        margin-top: 19rpx;
 | 
			
		||||
        margin-top: 20rpx;
 | 
			
		||||
        font-size: 24rpx;
 | 
			
		||||
        color: #333;
 | 
			
		||||
        margin-left: 14rpx;
 | 
			
		||||
        line-height: 1.2;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
<script>
 | 
			
		||||
export default {
 | 
			
		||||
    name:"userinfo",
 | 
			
		||||
    props: ["list"],
 | 
			
		||||
    data(){
 | 
			
		||||
        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);
 | 
			
		||||
                }
 | 
			
		||||
            })
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
<template>
 | 
			
		||||
    <view class="details">
 | 
			
		||||
        <view style="border-top: 1rpx solid #ececec;"></view>
 | 
			
		||||
        <userinfo></userinfo>
 | 
			
		||||
        <userinfo :list="userInfo"></userinfo>
 | 
			
		||||
        <view style="border-top: 20rpx solid #ececec;"></view>
 | 
			
		||||
        <u-tabs :is-scroll="false" bar-width="70" ref="tabs" :list="list" :current="num" :bar-style="{
 | 
			
		||||
                'background-color':'#FF780F',
 | 
			
		||||
@ -13,39 +13,15 @@
 | 
			
		||||
            }"
 | 
			
		||||
            :bold="false"
 | 
			
		||||
            @change="dianji"
 | 
			
		||||
            :show-bar="false"></u-tabs>
 | 
			
		||||
        <swiper class="card" @change="dianji" :current="num">
 | 
			
		||||
            <swiper-item>
 | 
			
		||||
                <scroll-view style="width:100%;height:100%" scroll-y="true">
 | 
			
		||||
                    <view class="box">
 | 
			
		||||
                        <view class="list">
 | 
			
		||||
                            <view >
 | 
			
		||||
                                <videoItem v-for="item in 10" :key="index"></videoItem>
 | 
			
		||||
                            </view>
 | 
			
		||||
                            <view style="margin-left:20rpx">
 | 
			
		||||
                                <videoItem v-for="item in 10" :key="index"></videoItem>
 | 
			
		||||
                            </view>
 | 
			
		||||
                        </view>
 | 
			
		||||
                    </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>
 | 
			
		||||
            :show-bar="false">
 | 
			
		||||
        </u-tabs>
 | 
			
		||||
        <scroll-view class="scroll-box" scroll-y="true">
 | 
			
		||||
            <view class="box">
 | 
			
		||||
            	<videoItem v-for="item in listInfo" :key="item.article_id" :item="item"
 | 
			
		||||
            	 @getArticlelist="getArticlelist"></videoItem>
 | 
			
		||||
                 <view class="no-data" v-show="!listInfo && !page">暂无数据</view>
 | 
			
		||||
            </view>
 | 
			
		||||
        </scroll-view>
 | 
			
		||||
    </view>
 | 
			
		||||
</template>
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
@ -61,39 +37,85 @@
 | 
			
		||||
            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>
 | 
			
		||||
<script>
 | 
			
		||||
import videoItem from "@/components/index/video-item/index" 
 | 
			
		||||
import zhiboItem from "@/components/index/zhibo-item/index" 
 | 
			
		||||
import userinfo from "../components/details/userinfo"
 | 
			
		||||
import videoItem from "@/components/index/video-item/index"
 | 
			
		||||
export default {
 | 
			
		||||
    name:"details",
 | 
			
		||||
    // name:"details",
 | 
			
		||||
    components:{
 | 
			
		||||
       userinfo,
 | 
			
		||||
       videoItem,
 | 
			
		||||
       zhiboItem
 | 
			
		||||
       videoItem
 | 
			
		||||
    },
 | 
			
		||||
    data(){
 | 
			
		||||
        return {
 | 
			
		||||
            list:[
 | 
			
		||||
                {
 | 
			
		||||
					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:{
 | 
			
		||||
        // 获取信息
 | 
			
		||||
        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){
 | 
			
		||||
            console.log(a)
 | 
			
		||||
            console.log(a);
 | 
			
		||||
            if(typeof a == "object"){
 | 
			
		||||
                this.num = a.detail.current
 | 
			
		||||
            }else{
 | 
			
		||||
                this.num = a
 | 
			
		||||
            }
 | 
			
		||||
            this.getArticlelist();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -14,7 +14,7 @@
 | 
			
		||||
                <text>图片</text>
 | 
			
		||||
                <view v-for="(item,index) in list.photo" :key="index" :style="{'background-color':index == swiper_id ? '#fff' : '#ede8e8'}"></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="info">{{ list.article_content }}</view>
 | 
			
		||||
			<view class="box">
 | 
			
		||||
@ -29,7 +29,7 @@
 | 
			
		||||
				<text>评论</text>
 | 
			
		||||
				<u-icon name="arrow-down" color="#333" size="28" @click="is_comment=false"></u-icon>
 | 
			
		||||
			</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">
 | 
			
		||||
					<view class="box">
 | 
			
		||||
						<image :src="item.member_avatar" mode="aspectFill"></image>
 | 
			
		||||
@ -373,6 +373,7 @@ export default {
 | 
			
		||||
        return {
 | 
			
		||||
            list:{},
 | 
			
		||||
			swiper_id: "",
 | 
			
		||||
            page: 1, //
 | 
			
		||||
			cart_type: false, // 显示购物车
 | 
			
		||||
			is_comment: false, // 显示评论
 | 
			
		||||
			is_focus: false, // 聚焦
 | 
			
		||||
@ -489,6 +490,10 @@ export default {
 | 
			
		||||
				current: e.currentTarget.dataset.url,
 | 
			
		||||
			})
 | 
			
		||||
		},
 | 
			
		||||
        // 评论滚动到底部
 | 
			
		||||
        scrollBottom(e) {
 | 
			
		||||
            console.log(e);
 | 
			
		||||
        },
 | 
			
		||||
		// 跳转到商品
 | 
			
		||||
		gotoInfo(id) {
 | 
			
		||||
			console.log(id);
 | 
			
		||||
 | 
			
		||||
@ -84,7 +84,7 @@
 | 
			
		||||
				{
 | 
			
		||||
					"path": "follow/index",
 | 
			
		||||
					"style": {
 | 
			
		||||
						"navigationBarTitleText": "推荐达人列表",
 | 
			
		||||
						"navigationBarTitleText": "推荐达人",
 | 
			
		||||
						"app-plus":{
 | 
			
		||||
							"titleNView":{
 | 
			
		||||
								"backgroundColor":"#ffffff"
 | 
			
		||||
@ -95,7 +95,7 @@
 | 
			
		||||
				{
 | 
			
		||||
					"path": "details/index",
 | 
			
		||||
					"style": {
 | 
			
		||||
						"navigationBarTitleText": "",
 | 
			
		||||
						"navigationBarTitleText": "达人详情",
 | 
			
		||||
						"app-plus":{
 | 
			
		||||
							"titleNView":{
 | 
			
		||||
								"backgroundColor":"#ffffff"
 | 
			
		||||
 | 
			
		||||
@ -61,7 +61,7 @@
 | 
			
		||||
										<view></view>
 | 
			
		||||
										<text>推荐达人</text>
 | 
			
		||||
									</view>
 | 
			
		||||
									<image class="right" src="/static/image/common/1.png"></image>
 | 
			
		||||
									<u-icon name="arrow-right" color="#666" size="28"></u-icon>
 | 
			
		||||
								</view>
 | 
			
		||||
								<view class="tuijianlist">
 | 
			
		||||
									<!-- <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>
 | 
			
		||||
								</view>
 | 
			
		||||
							</view>
 | 
			
		||||
							<view class="list">
 | 
			
		||||
								<view>
 | 
			
		||||
									<!-- <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 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 class="rec-list">
 | 
			
		||||
								<view class="rec-box">
 | 
			
		||||
                                    <!-- {{ fansList }} -->
 | 
			
		||||
									<videoItem isguanzhu="true" v-for="item in fansList" :key="item.article_id"
 | 
			
		||||
									 :item="item"></videoItem>
 | 
			
		||||
                                     <view class="no-data" v-show="!fansList.length">您还没有关注哦,赶紧去点点关注!</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>
 | 
			
		||||
<script>
 | 
			
		||||
@ -206,7 +213,8 @@
 | 
			
		||||
				recommendList: [], // 推荐达人
 | 
			
		||||
				indexImageSwiper: [],
 | 
			
		||||
				zhiboImageSwiper: [],
 | 
			
		||||
				tabLiveLists: []
 | 
			
		||||
				tabLiveLists: [],
 | 
			
		||||
                fansList: [], // 关注的发现列表
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		components: {
 | 
			
		||||
@ -221,18 +229,21 @@
 | 
			
		||||
			this.getSwiper();
 | 
			
		||||
			this.getZhiBoSwiper();
 | 
			
		||||
			this.tabLiveList();
 | 
			
		||||
            this.getFollowList();
 | 
			
		||||
		},
 | 
			
		||||
		onPullDownRefresh() {
 | 
			
		||||
            this.getArticlelist();
 | 
			
		||||
			// this.getManicureList({ load: 'reload' });
 | 
			
		||||
		},
 | 
			
		||||
		methods: {
 | 
			
		||||
            // 列表
 | 
			
		||||
			tabLiveList() {
 | 
			
		||||
				this.$u.api.tabLiveList().then((res) => {
 | 
			
		||||
					console.log(res)
 | 
			
		||||
					this.tabLiveLists = res.data
 | 
			
		||||
					this.tabLiveLists = res.data;
 | 
			
		||||
				})
 | 
			
		||||
			},
 | 
			
		||||
            // 轮播图
 | 
			
		||||
			getSwiper() {
 | 
			
		||||
				this.$u.api.getIndexSwiper().then(res => {
 | 
			
		||||
					if (res.errCode == 0) {
 | 
			
		||||
@ -240,14 +251,16 @@
 | 
			
		||||
					}
 | 
			
		||||
				})
 | 
			
		||||
			},
 | 
			
		||||
            // 关注
 | 
			
		||||
			changeType(member_id) {
 | 
			
		||||
				console.log(member_id);
 | 
			
		||||
				this.$emit("pChangeType")
 | 
			
		||||
				// this.$emit("pChangeType");
 | 
			
		||||
				this.$u.api.attentionMember({
 | 
			
		||||
					member_id: member_id
 | 
			
		||||
				}).then((res) => {
 | 
			
		||||
					console.log(res)
 | 
			
		||||
					this.getRecommendList();
 | 
			
		||||
                    this.getFollowList(); // 刷新发现的列表
 | 
			
		||||
				})
 | 
			
		||||
			},
 | 
			
		||||
			getZhiBoSwiper() {
 | 
			
		||||
@ -257,26 +270,29 @@
 | 
			
		||||
					}
 | 
			
		||||
				})
 | 
			
		||||
			},
 | 
			
		||||
            // 切换导航
 | 
			
		||||
			dianji(a) {
 | 
			
		||||
				// console.log(a)
 | 
			
		||||
				console.log(a);
 | 
			
		||||
				if (typeof a == "object") {
 | 
			
		||||
					this.num = a.detail.current
 | 
			
		||||
				} else {
 | 
			
		||||
					this.num = a
 | 
			
		||||
				}
 | 
			
		||||
			},
 | 
			
		||||
            // 发现别表
 | 
			
		||||
			getArticlelist() {
 | 
			
		||||
				this.$u.api.getArticlelist({
 | 
			
		||||
					page: this.page,
 | 
			
		||||
					is_video_img: 0, // 查询视频1 图文2 都查0
 | 
			
		||||
				}).then(res => {
 | 
			
		||||
                    uni.stopPullDownRefresh();
 | 
			
		||||
					console.log('37647744ghj', res)
 | 
			
		||||
                    // uni.stopPullDownRefresh();
 | 
			
		||||
					// console.log('37647744ghj', res)
 | 
			
		||||
					if (res.errCode == 0) {
 | 
			
		||||
						this.articleList = res.data.list;
 | 
			
		||||
					}
 | 
			
		||||
				})
 | 
			
		||||
			},
 | 
			
		||||
            // 达人列表
 | 
			
		||||
			getRecommendList() {
 | 
			
		||||
				this.$u.api.getRecommendList().then(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() {
 | 
			
		||||
				console.log("22");
 | 
			
		||||
				uni.navigateTo({
 | 
			
		||||
 | 
			
		||||
@ -31,8 +31,12 @@
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
    import { mapState } from 'vuex';
 | 
			
		||||
	import titles from "@/components/informations/titles/titles"
 | 
			
		||||
	export default {
 | 
			
		||||
        computed: {
 | 
			
		||||
            ...mapState(["hasLogin,token"])
 | 
			
		||||
        },
 | 
			
		||||
		data() {
 | 
			
		||||
			return {
 | 
			
		||||
				information_dles : [{
 | 
			
		||||
@ -49,7 +53,6 @@
 | 
			
		||||
						id: 0,
 | 
			
		||||
						url: '../../static/pageD/info(14).png',
 | 
			
		||||
						text: '交易物流'
 | 
			
		||||
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						id: 0,
 | 
			
		||||
@ -94,7 +97,9 @@
 | 
			
		||||
		},
 | 
			
		||||
		onLoad() {
 | 
			
		||||
			// /消息模块的请求
 | 
			
		||||
			this.messageIndex()
 | 
			
		||||
			if (this.hasLogin) {
 | 
			
		||||
					this.messageIndex();
 | 
			
		||||
			}
 | 
			
		||||
			if(this.$store.state.hasLogin){
 | 
			
		||||
				const user = uni.getStorageSync('user_info');
 | 
			
		||||
				console.log(user)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user