修复链接失败 #217
							
								
								
									
										34
									
								
								App.vue
									
									
									
									
									
								
							
							
						
						
									
										34
									
								
								App.vue
									
									
									
									
									
								
							@ -4,9 +4,9 @@
 | 
			
		||||
		globalData: {  
 | 
			
		||||
			im: {}  
 | 
			
		||||
		},  
 | 
			
		||||
        computed: {
 | 
			
		||||
            ...mapState(["hasLogin"])
 | 
			
		||||
        },
 | 
			
		||||
		computed: {
 | 
			
		||||
				...mapState(["hasLogin"])
 | 
			
		||||
		},
 | 
			
		||||
		onLaunch() {
 | 
			
		||||
			getApp().globalData.im = this.imService
 | 
			
		||||
			// 缓存token
 | 
			
		||||
@ -16,23 +16,23 @@
 | 
			
		||||
					this.loginIn(res.data);
 | 
			
		||||
				}
 | 
			
		||||
			})
 | 
			
		||||
            // 刷新token
 | 
			
		||||
            if (this.hasLogin) {
 | 
			
		||||
                this.refreshToken_function();
 | 
			
		||||
            }
 | 
			
		||||
			// 刷新token
 | 
			
		||||
			if (this.hasLogin) {
 | 
			
		||||
					this.refreshToken_function();
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		methods: {
 | 
			
		||||
			...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值
 | 
			
		||||
            		}
 | 
			
		||||
            	})
 | 
			
		||||
            },
 | 
			
		||||
			// 刷新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>
 | 
			
		||||
 | 
			
		||||
@ -54,6 +54,10 @@ export default {
 | 
			
		||||
			getRecommendList(){
 | 
			
		||||
                return vm.$u.post('MemberExpert/recommendList');
 | 
			
		||||
			},
 | 
			
		||||
			// 获取所有达人
 | 
			
		||||
			getAllRecommendList({ page }) {
 | 
			
		||||
				return vm.$u.post('MemberExpert/getRecommendList', { page });
 | 
			
		||||
			},
 | 
			
		||||
			// 达人(搜索)列表
 | 
			
		||||
			getExpertList({ page, store_id, live_status, like_nickname }){
 | 
			
		||||
                return vm.$u.post('MemberExpert/expertList', {
 | 
			
		||||
 | 
			
		||||
@ -415,7 +415,7 @@ export default {
 | 
			
		||||
			},
 | 
			
		||||
			// 关注用户列表
 | 
			
		||||
			attentionMemberList({ page = 1,role } = {}) {
 | 
			
		||||
				return vm.$u.post('member/attentionMemberList', { page,role });
 | 
			
		||||
				return vm.$u.post('member/attentionMemberList', { page, role });
 | 
			
		||||
			},
 | 
			
		||||
			// 可用优惠券商品
 | 
			
		||||
			couponGoodsList({ voucher_id, page, order }) {
 | 
			
		||||
@ -437,6 +437,10 @@ export default {
 | 
			
		||||
					friend_tomid:id
 | 
			
		||||
				});
 | 
			
		||||
			},
 | 
			
		||||
			// 设置里的帮助
 | 
			
		||||
			getSettingHelpList() {
 | 
			
		||||
				return vm.$u.post('document/help');
 | 
			
		||||
			},
 | 
			
		||||
			//获取默认头像
 | 
			
		||||
			getDefaultAvatar(){
 | 
			
		||||
				return vm.$u.post("member/getDefaultAvatar")
 | 
			
		||||
 | 
			
		||||
@ -47,6 +47,10 @@ const install = (Vue, vm) => {
 | 
			
		||||
            // 假设201为token失效,这里跳转登录
 | 
			
		||||
            // vm.$u.toast('您还没有登录哦,请先去登录!');
 | 
			
		||||
            if (res.data.data.action != "memberinfo") {
 | 
			
		||||
                uni.showToast({
 | 
			
		||||
                    title: "您还没有登录,请先去登录哦!",
 | 
			
		||||
                    icon: "none"
 | 
			
		||||
                })
 | 
			
		||||
                setTimeout(() => {
 | 
			
		||||
                    // 此为uView的方法,详见路由相关文档
 | 
			
		||||
                    uni.navigateTo({
 | 
			
		||||
 | 
			
		||||
@ -18,7 +18,8 @@ const store = new Vuex.Store({
 | 
			
		||||
		loadmore: {}, // 下拉加载返回的数据
 | 
			
		||||
		hasLogin: false, // 登录状态
 | 
			
		||||
		token: "", // 储存token
 | 
			
		||||
        showLoginModel: false, // 登录框
 | 
			
		||||
		showLoginModel: false, // 登录框
 | 
			
		||||
		question: {}, // 帮助与反馈
 | 
			
		||||
	},
 | 
			
		||||
	getters: {
 | 
			
		||||
		getOrderAddress(state) {
 | 
			
		||||
@ -75,6 +76,9 @@ const store = new Vuex.Store({
 | 
			
		||||
		},
 | 
			
		||||
		setLoadMore(state, info) {
 | 
			
		||||
			state.loadmore = info;
 | 
			
		||||
		},
 | 
			
		||||
		setQuestion(state, question) {
 | 
			
		||||
			state.question = question;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
@ -46,6 +46,7 @@ export default {
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		viewGoodsDetails(item) {
 | 
			
		||||
			if(this.closeAction()) return false;
 | 
			
		||||
			const list = this.list.filter(item => {
 | 
			
		||||
				return item.show;
 | 
			
		||||
			})
 | 
			
		||||
@ -57,6 +58,17 @@ export default {
 | 
			
		||||
				}
 | 
			
		||||
			})
 | 
			
		||||
		},
 | 
			
		||||
		closeAction() {
 | 
			
		||||
			let status = false;
 | 
			
		||||
			this.list.map((val, idx) => {
 | 
			
		||||
				if(val.show) {
 | 
			
		||||
					status = true;
 | 
			
		||||
					this.$set(this.list[idx], 'show', false);
 | 
			
		||||
				};
 | 
			
		||||
			})
 | 
			
		||||
			this.$forceUpdate();
 | 
			
		||||
			return status;
 | 
			
		||||
		},
 | 
			
		||||
		getGoodsFavoritesList() {
 | 
			
		||||
			this.$u.api.getFavoritesList().then(res => {
 | 
			
		||||
				if(res.errCode == 0) {
 | 
			
		||||
 | 
			
		||||
@ -3,32 +3,28 @@
 | 
			
		||||
	<view>
 | 
			
		||||
		<view class="login">
 | 
			
		||||
			<view class="content">
 | 
			
		||||
				<view class="title">手机登录</view>
 | 
			
		||||
				<view class="title">请绑定手机号</view>
 | 
			
		||||
				<view class="labales">
 | 
			
		||||
					<text>手机号</text>
 | 
			
		||||
					<input type="tel" placeholder="" />
 | 
			
		||||
					<input type="number" maxlength="11" v-model="phone" placeholder="手机号" />
 | 
			
		||||
				</view>
 | 
			
		||||
				<view class="labales">
 | 
			
		||||
					<text>请输入验证码</text>
 | 
			
		||||
					<input type="tel" placeholder="" />
 | 
			
		||||
					<text class="identifying">获取验证码</text>
 | 
			
		||||
				<view class="labales flex-inp">
 | 
			
		||||
					<input type="number" maxlength="6" placeholder="请输入验证码" v-model="sms_code" />
 | 
			
		||||
					<button class="identifying" :class="is_sendcode ? 'sended' : ''" @click="getCode" :disabled="is_sendcode">{{ is_sendcode ? time_count + "后可以重新发送" : "发送验证码" }}</button>
 | 
			
		||||
				</view>
 | 
			
		||||
				<!-- 服务协议 -->
 | 
			
		||||
				<view class="pact">
 | 
			
		||||
					<view></view>
 | 
			
		||||
                    <checkbox-group @change="change">
 | 
			
		||||
                        <checkbox class="check-tit" color="#1ADE00" :checked="checked" />
 | 
			
		||||
                    </checkbox-group>
 | 
			
		||||
					<text>我已详细阅读并同意</text>
 | 
			
		||||
					<text class="pact_text">《用户协议》</text>
 | 
			
		||||
					<text class="pact_text">《隐私协议》</text>
 | 
			
		||||
					<text class="pact_text">《使用协议》</text>
 | 
			
		||||
					<u-checkbox-group @change="checkboxGroupChange" size="27">
 | 
			
		||||
						<u-checkbox @change="checkboxChange" v-model="item.checked" v-for="(item, index) in list" :key="index" :name="item.name"
 | 
			
		||||
						 shape="circle" size="14" active-color="#19BE6B"></u-checkbox>
 | 
			
		||||
					</u-checkbox-group>
 | 
			
		||||
					<text class="pact_text" v-for="(item,index) in pactList" :key="index" @click="infoPact(index)">
 | 
			
		||||
                        {{ item }}
 | 
			
		||||
                    </text>
 | 
			
		||||
				</view>
 | 
			
		||||
			</view>
 | 
			
		||||
			<!-- denglu QQ weixin -->
 | 
			
		||||
			<u-button>{{login}}</u-button>
 | 
			
		||||
			
 | 
			
		||||
			<view class="btn-login" @click="bindPhone">{{login}}</view>
 | 
			
		||||
            <u-toast ref="uToast" />
 | 
			
		||||
		</view>
 | 
			
		||||
	</view>
 | 
			
		||||
</template>
 | 
			
		||||
@ -36,81 +32,151 @@
 | 
			
		||||
	export default {
 | 
			
		||||
		data() {
 | 
			
		||||
			return {
 | 
			
		||||
				list: [{
 | 
			
		||||
					checked: false,
 | 
			
		||||
					disabled: false
 | 
			
		||||
				}],
 | 
			
		||||
				value: '',
 | 
			
		||||
				login: '注册',
 | 
			
		||||
				show: true
 | 
			
		||||
                phone: "",
 | 
			
		||||
                sms_code: "",
 | 
			
		||||
				login: '绑定',
 | 
			
		||||
				show: true,
 | 
			
		||||
                checked: false,
 | 
			
		||||
                // 时间
 | 
			
		||||
                timer: null,
 | 
			
		||||
				is_sendcode: false, // 60s
 | 
			
		||||
                time_count: 60,
 | 
			
		||||
                pactList: [ "《用户协议》", "《隐私协议》", "《使用协议》" ],
 | 
			
		||||
			};
 | 
			
		||||
		},
 | 
			
		||||
		methods: {
 | 
			
		||||
			// 选中某个复选框时,由checkbox时触发
 | 
			
		||||
			checkboxChange(e) {
 | 
			
		||||
				//console.log(e);
 | 
			
		||||
			},
 | 
			
		||||
			// 选中任一checkbox时,由checkbox-group触发
 | 
			
		||||
			checkboxGroupChange(e) {
 | 
			
		||||
				// console.log(e);
 | 
			
		||||
			},
 | 
			
		||||
			mask_u(){
 | 
			
		||||
				this.show = !this.show
 | 
			
		||||
			},
 | 
			
		||||
            // 勾选协议
 | 
			
		||||
			change(e) {
 | 
			
		||||
                this.checked = !this.checked;
 | 
			
		||||
                console.log(this.checked);
 | 
			
		||||
            },
 | 
			
		||||
            // 获取验证码
 | 
			
		||||
            getCode() {
 | 
			
		||||
                if (this.$u.test.isEmpty(this.phone)) {
 | 
			
		||||
                    this.$refs.uToast.show({
 | 
			
		||||
                        title: '手机号格式不能为空!',
 | 
			
		||||
                        type: 'error',
 | 
			
		||||
                    })
 | 
			
		||||
                    return;
 | 
			
		||||
                }
 | 
			
		||||
                if(!(/^1[3456789]\d{9}$/.test(this.phone))){
 | 
			
		||||
                    this.$refs.uToast.show({
 | 
			
		||||
                        title: '手机号格式不正确!',
 | 
			
		||||
                        type: 'warning',
 | 
			
		||||
                    })
 | 
			
		||||
                    return;
 | 
			
		||||
                }
 | 
			
		||||
                this.$u.api.sendSmsCode({
 | 
			
		||||
                    member_mobile: this.phone,
 | 
			
		||||
                    smslog_type: 4,
 | 
			
		||||
                }).then(res => {
 | 
			
		||||
                    if (res.errCode == 0) {
 | 
			
		||||
                        console.log(res);
 | 
			
		||||
                        this.$refs.uToast.show({
 | 
			
		||||
                            title: res.message,
 | 
			
		||||
                            type: 'success',
 | 
			
		||||
                        })
 | 
			
		||||
                        // 发送验证码
 | 
			
		||||
                        this.getSendCode();
 | 
			
		||||
                    } else {
 | 
			
		||||
                        this.$refs.uToast.show({
 | 
			
		||||
                            title: res.message,
 | 
			
		||||
                            type: 'warning',
 | 
			
		||||
                        })
 | 
			
		||||
                    }
 | 
			
		||||
                })
 | 
			
		||||
            },
 | 
			
		||||
            // 绑定手机号
 | 
			
		||||
            bindPhone() {
 | 
			
		||||
                if (this.$u.test.isEmpty(this.phone)) {
 | 
			
		||||
                    this.$refs.uToast.show({
 | 
			
		||||
                        title: '手机号不能为空!',
 | 
			
		||||
                        type: 'error',
 | 
			
		||||
                    })
 | 
			
		||||
                    return;
 | 
			
		||||
                }
 | 
			
		||||
                if(!(/^1[3456789]\d{9}$/.test(this.phone))){
 | 
			
		||||
                    this.$refs.uToast.show({
 | 
			
		||||
                        title: '手机号格式不正确!',
 | 
			
		||||
                        type: 'warning',
 | 
			
		||||
                    })
 | 
			
		||||
                    return;
 | 
			
		||||
                }
 | 
			
		||||
                if(this.$u.test.isEmpty(this.sms_code)){
 | 
			
		||||
                    this.$refs.uToast.show({
 | 
			
		||||
                        title: '验证码不能为空!',
 | 
			
		||||
                        type: 'warning',
 | 
			
		||||
                    })
 | 
			
		||||
                    return;
 | 
			
		||||
                }
 | 
			
		||||
                if(this.sms_code.length == 0){
 | 
			
		||||
                    this.$refs.uToast.show({
 | 
			
		||||
                        title: '验证码有误!',
 | 
			
		||||
                        type: 'warning',
 | 
			
		||||
                    })
 | 
			
		||||
                    return;
 | 
			
		||||
                }
 | 
			
		||||
                if(!this.checked){
 | 
			
		||||
                    this.$refs.uToast.show({
 | 
			
		||||
                        title: '请同意协议!',
 | 
			
		||||
                        type: 'warning',
 | 
			
		||||
                    })
 | 
			
		||||
                    return;
 | 
			
		||||
                }
 | 
			
		||||
                this.$u.api.mobileBind({
 | 
			
		||||
                    member_mobile: this.phone,
 | 
			
		||||
                    sms_code: this.sms_code,
 | 
			
		||||
                }).then(res => {
 | 
			
		||||
                    console.log(res);
 | 
			
		||||
                    if (res.errCode == 0) {
 | 
			
		||||
                        this.$refs.uToast.show({
 | 
			
		||||
                            title: res.message,
 | 
			
		||||
                            type: 'success',
 | 
			
		||||
                        })
 | 
			
		||||
                        uni.switchTab({
 | 
			
		||||
                             url: '/pages/index/index'
 | 
			
		||||
                        });
 | 
			
		||||
                    } else {
 | 
			
		||||
                        this.$refs.uToast.show({
 | 
			
		||||
                            title: res.message,
 | 
			
		||||
                            type: 'warning',
 | 
			
		||||
                        })
 | 
			
		||||
                    }
 | 
			
		||||
                })
 | 
			
		||||
            },
 | 
			
		||||
            // 协议详情
 | 
			
		||||
            infoPact(index) {
 | 
			
		||||
                // console.log(index);
 | 
			
		||||
                uni.navigateTo({
 | 
			
		||||
				    url: '/pageA/pactList/pactList?index=' + index
 | 
			
		||||
				});
 | 
			
		||||
            },
 | 
			
		||||
            // 60s
 | 
			
		||||
            getSendCode() {
 | 
			
		||||
                const TIME_COUNT = 60;
 | 
			
		||||
                if (!this.timer) {
 | 
			
		||||
                    this.time_count = TIME_COUNT;
 | 
			
		||||
                    this.is_sendcode = true;
 | 
			
		||||
                    this.timer = setInterval(() => {
 | 
			
		||||
                        if (this.time_count > 0 && this.time_count <= TIME_COUNT) {
 | 
			
		||||
                            this.time_count--;
 | 
			
		||||
                        } else {
 | 
			
		||||
                            this.is_sendcode = false;
 | 
			
		||||
                            clearInterval(this.timer);
 | 
			
		||||
                            this.timer = null;
 | 
			
		||||
                        }
 | 
			
		||||
                    }, 1000);
 | 
			
		||||
                }
 | 
			
		||||
            },
 | 
			
		||||
		}
 | 
			
		||||
	};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
	.uni-page-wrapper{
 | 
			
		||||
		background: #fff;
 | 
			
		||||
	}
 | 
			
		||||
	.login {
 | 
			
		||||
		// background: url(../../static/pageA/loginbackground.png) no-repeat!important;
 | 
			
		||||
		.images {
 | 
			
		||||
			position: fixed;
 | 
			
		||||
			width: 100%;
 | 
			
		||||
			height: 100%;
 | 
			
		||||
			top: 0;
 | 
			
		||||
			left: 0;
 | 
			
		||||
			z-index: -1;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		.backes {
 | 
			
		||||
			background: rgba(0, 0, 0, 0.4);
 | 
			
		||||
			position: fixed;
 | 
			
		||||
			width: 100%;
 | 
			
		||||
			height: 100%;
 | 
			
		||||
			z-index: -1;
 | 
			
		||||
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		text {
 | 
			
		||||
			z-index: 9;
 | 
			
		||||
			color: #fff;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		.more_Login {
 | 
			
		||||
			overflow: hidden;
 | 
			
		||||
			zoom: 1;
 | 
			
		||||
			width: 630rpx;
 | 
			
		||||
			margin: 0 auto;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		.more_Login text {
 | 
			
		||||
			display: inline-block;
 | 
			
		||||
			width: 50%;
 | 
			
		||||
			float: left;
 | 
			
		||||
			font-size: 30rpx;
 | 
			
		||||
			color: rgba(255, 255, 255, 1);
 | 
			
		||||
			line-height: 36px;
 | 
			
		||||
			margin: 97rpx 0;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		.more_Login .other {
 | 
			
		||||
			text-align: right;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
    
 | 
			
		||||
    page {
 | 
			
		||||
        background-color: #fff;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	.title {
 | 
			
		||||
		font-size: 36rpx;
 | 
			
		||||
@ -124,163 +190,87 @@
 | 
			
		||||
		z-index: 99999;
 | 
			
		||||
		margin: 0 auto;
 | 
			
		||||
		padding-top: 130rpx;
 | 
			
		||||
        
 | 
			
		||||
        .labales {
 | 
			
		||||
            position: relative;
 | 
			
		||||
            display: flex;
 | 
			
		||||
            align-items: center;
 | 
			
		||||
            padding: 20rpx;
 | 
			
		||||
        	border-bottom: 1px #BFBFBF solid;
 | 
			
		||||
            input {
 | 
			
		||||
                width: 100%;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        .flex-inp {
 | 
			
		||||
            justify-content: space-between;
 | 
			
		||||
            margin-top: 70rpx;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
		.labales text {
 | 
			
		||||
			font-size: 30rpx;
 | 
			
		||||
			color: #999;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		.labales {
 | 
			
		||||
			border-bottom: 1px #BFBFBF solid;
 | 
			
		||||
			margin-bottom: 90rpx;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		.labales {
 | 
			
		||||
			position: relative;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
        
 | 
			
		||||
		.identifying {
 | 
			
		||||
			position: absolute;
 | 
			
		||||
			right: 0;
 | 
			
		||||
			top: 0;
 | 
			
		||||
			bottom: 0;
 | 
			
		||||
			margin: auto;
 | 
			
		||||
			font-size: 30rpx;
 | 
			
		||||
            flex-shrink: 0;
 | 
			
		||||
			font-size: 26rpx;
 | 
			
		||||
			font-weight: 500;
 | 
			
		||||
			color: #FF780F!important;
 | 
			
		||||
			color: #FF780F !important;
 | 
			
		||||
            border: none;
 | 
			
		||||
		    background-color: #fff;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	.pact text {
 | 
			
		||||
		font-size: 22rpx;
 | 
			
		||||
		font-weight: 400;
 | 
			
		||||
		color: #333;
 | 
			
		||||
		line-height: 36px;
 | 
			
		||||
        .sended {
 | 
			
		||||
            color: #666 !important;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
    
 | 
			
		||||
    .pact {
 | 
			
		||||
        display: flex;
 | 
			
		||||
        align-items: center;
 | 
			
		||||
        flex-wrap: wrap;
 | 
			
		||||
        margin: 20rpx 0;
 | 
			
		||||
        &>text {
 | 
			
		||||
            font-size: 22rpx;
 | 
			
		||||
            font-weight: 400;
 | 
			
		||||
            color: #333;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    .check-tit {
 | 
			
		||||
        font-size: 20rpx;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    ::v-deep uni-checkbox .uni-checkbox-input {
 | 
			
		||||
        width: 24rpx;
 | 
			
		||||
        height: 24rpx;
 | 
			
		||||
        border-color: #d1d1d1 !important;
 | 
			
		||||
        border-radius: 50% !important;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    ::v-deep uni-checkbox .uni-checkbox-input-checked:before {
 | 
			
		||||
        font-size: 28rpx;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	.pact_text {
 | 
			
		||||
		font-size: 22px;
 | 
			
		||||
		font-weight: 400;
 | 
			
		||||
		color: rgba(129, 188, 253, 1) !important;
 | 
			
		||||
		line-height: 36px;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	//单选框的样式
 | 
			
		||||
	.pact {
 | 
			
		||||
		position: relative;
 | 
			
		||||
		padding-left: 38rpx;
 | 
			
		||||
	}
 | 
			
		||||
	.btn-login {
 | 
			
		||||
        width: 650rpx;
 | 
			
		||||
        height: 90rpx;
 | 
			
		||||
        margin: 300rpx auto 0;
 | 
			
		||||
        text-align: center;
 | 
			
		||||
        line-height: 90rpx;
 | 
			
		||||
        color: #fff;
 | 
			
		||||
        font-size: 34rpx;
 | 
			
		||||
        border-radius: 50rpx !important;
 | 
			
		||||
        background-color: #FF780F;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
	.u-checkbox-group {
 | 
			
		||||
		position: absolute;
 | 
			
		||||
		left: 0;
 | 
			
		||||
		top: 0;
 | 
			
		||||
		bottom: 0;
 | 
			
		||||
		margin: auto;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	.u-checkbox__icon--square {
 | 
			
		||||
		border-radius: 50rpx !important;
 | 
			
		||||
		width: 22rpx;
 | 
			
		||||
		height: 22rpx;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	.u-btn {
 | 
			
		||||
		width: 628rpx;
 | 
			
		||||
		height: 98rpx;
 | 
			
		||||
		background: rgba(255, 120, 15, 1) !important;
 | 
			
		||||
		border-radius: 49rpx;
 | 
			
		||||
		margin: 0 auto;
 | 
			
		||||
		font-size: 36rpx;
 | 
			
		||||
		color: rgba(255, 255, 255, 1) !important;
 | 
			
		||||
		line-height: 36px;
 | 
			
		||||
		border: 1px #ff780f solid;
 | 
			
		||||
		outline: none;
 | 
			
		||||
		border-color: rgba(255, 120, 15, 1) !important;
 | 
			
		||||
		margin-top: 225rpx;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	.warp {
 | 
			
		||||
		display: flex;
 | 
			
		||||
		align-items: center;
 | 
			
		||||
		justify-content: center;
 | 
			
		||||
		height: 100%;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	.rect {
 | 
			
		||||
		width: 558rpx;
 | 
			
		||||
		height: 300rpx;
 | 
			
		||||
		background-color: #fff;
 | 
			
		||||
		border-radius: 20rpx;
 | 
			
		||||
		overflow: hidden;
 | 
			
		||||
		zoom: 1;
 | 
			
		||||
		position: relative;
 | 
			
		||||
		display: flex;
 | 
			
		||||
		 flex-wrap:wrap;
 | 
			
		||||
		 display: -webkit-flex; /* Safari */
 | 
			
		||||
		.rect_view{
 | 
			
		||||
			width: 100rpx;
 | 
			
		||||
			height: 100rpx;
 | 
			
		||||
			.image{
 | 
			
		||||
			width: 45rpx;
 | 
			
		||||
			height: 53rpx;
 | 
			
		||||
			display: inline-block;
 | 
			
		||||
			
 | 
			
		||||
			}
 | 
			
		||||
			flex:1;
 | 
			
		||||
			margin-top: 77rpx;
 | 
			
		||||
		}
 | 
			
		||||
		.rect_view:nth-child(2) image{
 | 
			
		||||
			width: 57rpx;
 | 
			
		||||
			height: 45rpx;
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		.rect_butoon{
 | 
			
		||||
			width: 100%;
 | 
			
		||||
			position: absolute;
 | 
			
		||||
			bottom: 0;
 | 
			
		||||
			height: 85rpx;
 | 
			
		||||
			text-align: center;
 | 
			
		||||
			line-height: 85rpx;
 | 
			
		||||
			border-top: 1px #999999 solid;
 | 
			
		||||
		}
 | 
			
		||||
		view{
 | 
			
		||||
			color: #666;
 | 
			
		||||
			font-size:24rpx;
 | 
			
		||||
			margin-top: 30rpx;
 | 
			
		||||
			
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	.rect_view:nth-child(1) image,.rect_view:nth-child(1) view{
 | 
			
		||||
		float: right;
 | 
			
		||||
	}
 | 
			
		||||
	.rect_view:nth-child(1) image{
 | 
			
		||||
		margin-right: 20rpx;
 | 
			
		||||
	}
 | 
			
		||||
	.rect_view:nth-child(1){
 | 
			
		||||
		position: relative;
 | 
			
		||||
		margin-right: 79rpx;
 | 
			
		||||
	}
 | 
			
		||||
	.rect_view:nth-child(1) view{
 | 
			
		||||
		position: absolute;
 | 
			
		||||
		bottom: 0;
 | 
			
		||||
		right: 0;
 | 
			
		||||
	}
 | 
			
		||||
	.rect_view:nth-child(2) image,.rect_view:nth-child(2) view{
 | 
			
		||||
		float: left;
 | 
			
		||||
	}
 | 
			
		||||
	.rect_view:nth-child(2) image{
 | 
			
		||||
		margin-left: 20rpx;
 | 
			
		||||
	}
 | 
			
		||||
	.rect_view:nth-child(2){
 | 
			
		||||
		position: relative;
 | 
			
		||||
	}
 | 
			
		||||
	.rect_view:nth-child(2) view{
 | 
			
		||||
		position: absolute;
 | 
			
		||||
		bottom: 0;
 | 
			
		||||
		left: 0;
 | 
			
		||||
	}
 | 
			
		||||
	u-button{
 | 
			
		||||
		margin-top: 225rpx;
 | 
			
		||||
	}
 | 
			
		||||
    button::after{ border: none; }
 | 
			
		||||
</style>
 | 
			
		||||
 | 
			
		||||
@ -226,14 +226,20 @@
 | 
			
		||||
												member_nickname: data.userInfo.nickName,
 | 
			
		||||
												member_avatar: data.userInfo.avatarUrl,
 | 
			
		||||
											}).then(res => {
 | 
			
		||||
												console.log(res.errCode);
 | 
			
		||||
												if (res.errCode == 0) {
 | 
			
		||||
													this.loginIn(res.data.token);
 | 
			
		||||
                                                    uni.setStorageSync('user_info',res.data);
 | 
			
		||||
                          uni.setStorageSync('user_info',res.data);
 | 
			
		||||
													this.show = false;
 | 
			
		||||
													uni.switchTab({
 | 
			
		||||
														url: "../../pages/index/index"
 | 
			
		||||
													})
 | 
			
		||||
                                                    console.log(res.data.member.member_mobilebind);
 | 
			
		||||
													if(res.data.member.member_mobilebind) {
 | 
			
		||||
														uni.switchTab({
 | 
			
		||||
																url: "/pages/index/index"
 | 
			
		||||
														});
 | 
			
		||||
													} else {
 | 
			
		||||
														uni.navigateTo({
 | 
			
		||||
															 url: '/pageA/bindinges/bindinges'
 | 
			
		||||
														});
 | 
			
		||||
													}
 | 
			
		||||
												}
 | 
			
		||||
											})
 | 
			
		||||
										}
 | 
			
		||||
@ -247,11 +253,11 @@
 | 
			
		||||
							uni.login({
 | 
			
		||||
								provider: 'weixin',
 | 
			
		||||
								success: (wxres) => {
 | 
			
		||||
									console.log(wxres);
 | 
			
		||||
									// console.log(wxres);
 | 
			
		||||
									uni.getUserInfo({
 | 
			
		||||
										provider: 'weixin',
 | 
			
		||||
										success: (data) => {
 | 
			
		||||
											console.log(data);
 | 
			
		||||
											// console.log(data);
 | 
			
		||||
											this.$u.api.wechatLogin({
 | 
			
		||||
												member_wxopenid: data.userInfo.openId,
 | 
			
		||||
												member_nickname: data.userInfo.nickName,
 | 
			
		||||
@ -260,11 +266,18 @@
 | 
			
		||||
												console.log(res);
 | 
			
		||||
												if (res.errCode == 0) {
 | 
			
		||||
													this.loginIn(res.data.token);
 | 
			
		||||
                                                    uni.setStorageSync('user_info',res.data);
 | 
			
		||||
                          uni.setStorageSync('user_info',res.data);
 | 
			
		||||
													this.show = false;
 | 
			
		||||
													uni.switchTab({
 | 
			
		||||
														url: "../../pages/index/index"
 | 
			
		||||
													})
 | 
			
		||||
                                                    console.log(res.data.member.member_mobilebind);
 | 
			
		||||
													if(res.data.member.member_mobilebind) {
 | 
			
		||||
														uni.switchTab({
 | 
			
		||||
																url: "/pages/index/index"
 | 
			
		||||
														});
 | 
			
		||||
													} else {
 | 
			
		||||
														uni.navigateTo({
 | 
			
		||||
															 url: '/pageA/bindinges/bindinges'
 | 
			
		||||
														});
 | 
			
		||||
													}
 | 
			
		||||
												}
 | 
			
		||||
											})
 | 
			
		||||
										}
 | 
			
		||||
@ -301,11 +314,11 @@
 | 
			
		||||
			tochange() {
 | 
			
		||||
 | 
			
		||||
			},
 | 
			
		||||
            goIndex() {
 | 
			
		||||
                uni.switchTab({
 | 
			
		||||
                    url: "/pages/index/index"
 | 
			
		||||
                })
 | 
			
		||||
            }
 | 
			
		||||
			goIndex() {
 | 
			
		||||
					uni.switchTab({
 | 
			
		||||
							url: "/pages/index/index"
 | 
			
		||||
					})
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		components: {
 | 
			
		||||
			identifying
 | 
			
		||||
 | 
			
		||||
@ -29,9 +29,9 @@ export default {
 | 
			
		||||
					document_code: 'agreement'
 | 
			
		||||
				}).then((res)=>{
 | 
			
		||||
					// console.log(res.data.document_title);
 | 
			
		||||
                    uni.setNavigationBarTitle({
 | 
			
		||||
                        title: res.data.document_title
 | 
			
		||||
                    })
 | 
			
		||||
					uni.setNavigationBarTitle({
 | 
			
		||||
							title: res.data.document_title
 | 
			
		||||
					})
 | 
			
		||||
					let data = common.unescapeHTML(res.data.document_content);
 | 
			
		||||
					this.document_content = data;
 | 
			
		||||
				})
 | 
			
		||||
@ -41,9 +41,9 @@ export default {
 | 
			
		||||
					document_code: 'privacy'
 | 
			
		||||
				}).then((res)=>{
 | 
			
		||||
					// console.log(res.data.document_title);
 | 
			
		||||
                    uni.setNavigationBarTitle({
 | 
			
		||||
                        title: res.data.document_title
 | 
			
		||||
                    })
 | 
			
		||||
					uni.setNavigationBarTitle({
 | 
			
		||||
							title: res.data.document_title
 | 
			
		||||
					})
 | 
			
		||||
					let data = common.unescapeHTML(res.data.document_content);
 | 
			
		||||
					this.document_content = data 
 | 
			
		||||
				})
 | 
			
		||||
@ -53,9 +53,9 @@ export default {
 | 
			
		||||
					document_code: 'use'
 | 
			
		||||
				}).then((res)=>{
 | 
			
		||||
					// console.log(res.data.document_title);
 | 
			
		||||
                    uni.setNavigationBarTitle({
 | 
			
		||||
                        title: res.data.document_title
 | 
			
		||||
                    })
 | 
			
		||||
					uni.setNavigationBarTitle({
 | 
			
		||||
							title: res.data.document_title
 | 
			
		||||
					})
 | 
			
		||||
					let data = common.unescapeHTML(res.data.document_content);
 | 
			
		||||
					this.document_content = data 
 | 
			
		||||
				})
 | 
			
		||||
@ -69,7 +69,6 @@ export default {
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
	.packlist{}
 | 
			
		||||
	.packlist > view{
 | 
			
		||||
		width: 90%;
 | 
			
		||||
		margin: 0 auto;
 | 
			
		||||
 | 
			
		||||
@ -1,43 +1,49 @@
 | 
			
		||||
<template>
 | 
			
		||||
    <view class="follow">
 | 
			
		||||
        <view class="sosuo" @click="searchValue">
 | 
			
		||||
            <image src="/static/image/common/10.png"></image>
 | 
			
		||||
            <text>输入达人名称</text>
 | 
			
		||||
        </view>
 | 
			
		||||
        <view class="list" style="margin-left:-20rpx">
 | 
			
		||||
            <darenItem style="margin-top:20rpx;margin-left:20rpx;" v-for="item in recommendList" :key="item.id" :info="item"  v-on:pChangeType="changeType"></darenItem>
 | 
			
		||||
        </view>
 | 
			
		||||
       <scroll-view scroll-y :style="{ height: viewHeight }" @scrolltolower="loadmore" class="container">
 | 
			
		||||
		    <view class="sosuo" @click="searchValue">
 | 
			
		||||
				<image src="/static/image/common/10.png"></image>
 | 
			
		||||
				<text>输入达人名称</text>
 | 
			
		||||
			</view>
 | 
			
		||||
			<view class="list" style="margin-left:-20rpx">
 | 
			
		||||
				<darenItem style="margin-top:20rpx;margin-left:20rpx;" v-for="item in recommendList" :key="item.id" :info="item"  v-on:pChangeType="changeType"></darenItem>
 | 
			
		||||
			</view>
 | 
			
		||||
			<u-loadmore :status="loadStatus" bgColor="#ECECEC" font-size="14" margin-top="40" margin-bottom="20" v-if="recommendList.length > pageSize" @loadmore="loadmore"></u-loadmore>
 | 
			
		||||
	   </scroll-view>
 | 
			
		||||
    </view>
 | 
			
		||||
</template>
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
.follow{
 | 
			
		||||
    background-color: #ECECEC;
 | 
			
		||||
    min-height: calc(100vh - var(--window-top));
 | 
			
		||||
    padding: 20rpx 30rpx;
 | 
			
		||||
    .sosuo{
 | 
			
		||||
        width: 100%;
 | 
			
		||||
        height: 60rpx;
 | 
			
		||||
        border-radius: 30rpx;
 | 
			
		||||
        background-color: #fff;
 | 
			
		||||
        display: flex;
 | 
			
		||||
        align-items: center;
 | 
			
		||||
        justify-content: center;
 | 
			
		||||
        >image{
 | 
			
		||||
            width: 29rpx;
 | 
			
		||||
            height: 29rpx;
 | 
			
		||||
        }
 | 
			
		||||
        >text{
 | 
			
		||||
            font-size: 24rpx;
 | 
			
		||||
            color: #999;
 | 
			
		||||
            margin-left: 15rpx;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    .list{
 | 
			
		||||
        display: flex;
 | 
			
		||||
        flex-wrap: wrap;
 | 
			
		||||
        width: calc(100% + 23rpx);
 | 
			
		||||
        margin-right: -23rpx;
 | 
			
		||||
    }
 | 
			
		||||
	.container {
 | 
			
		||||
		box-sizing: border-box;
 | 
			
		||||
		padding: 20rpx 30rpx;
 | 
			
		||||
		.sosuo{
 | 
			
		||||
			width: 100%;
 | 
			
		||||
			height: 60rpx;
 | 
			
		||||
			border-radius: 30rpx;
 | 
			
		||||
			background-color: #fff;
 | 
			
		||||
			display: flex;
 | 
			
		||||
			align-items: center;
 | 
			
		||||
			justify-content: center;
 | 
			
		||||
			>image{
 | 
			
		||||
				width: 29rpx;
 | 
			
		||||
				height: 29rpx;
 | 
			
		||||
			}
 | 
			
		||||
			>text{
 | 
			
		||||
				font-size: 24rpx;
 | 
			
		||||
				color: #999;
 | 
			
		||||
				margin-left: 15rpx;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		.list{
 | 
			
		||||
			display: flex;
 | 
			
		||||
			flex-wrap: wrap;
 | 
			
		||||
			width: calc(100% + 23rpx);
 | 
			
		||||
			margin-right: -23rpx;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
<script>
 | 
			
		||||
@ -50,22 +56,45 @@ export default {
 | 
			
		||||
    },
 | 
			
		||||
    data(){
 | 
			
		||||
        return{
 | 
			
		||||
			pageSize: 2,
 | 
			
		||||
			recommendList: [], // 推荐达人
 | 
			
		||||
			page: 1,
 | 
			
		||||
			loadStatus: 'loadmore',
 | 
			
		||||
			timer: true,
 | 
			
		||||
			viewHeight: '',
 | 
			
		||||
        }
 | 
			
		||||
	},
 | 
			
		||||
	onLoad() {
 | 
			
		||||
		this.setViewHeight();
 | 
			
		||||
	},
 | 
			
		||||
	onShow() {
 | 
			
		||||
		this.getRecommendList();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		getRecommendList() {
 | 
			
		||||
			this.$u.api.getRecommendList().then(res => {
 | 
			
		||||
				if(res.errCode == 0) {
 | 
			
		||||
					this.recommendList = res.data.list;
 | 
			
		||||
				}
 | 
			
		||||
		async getRecommendList({ load = 'reload' } = {}) {
 | 
			
		||||
			const res = await this.$u.api.getAllRecommendList({ page: this.page });
 | 
			
		||||
			this.timer = true;
 | 
			
		||||
			if(res.errCode == 0) {
 | 
			
		||||
				if(load == 'reload') this.recommendList = res.data.list;
 | 
			
		||||
				if(load == 'loadmore') this.recommendList.push(...res.data.list);
 | 
			
		||||
			}
 | 
			
		||||
			return res.data.list.length;
 | 
			
		||||
		},
 | 
			
		||||
		loadmore() {
 | 
			
		||||
			if(!this.timer) return false;
 | 
			
		||||
			this.timer = false;
 | 
			
		||||
			this.loadStatus = "loading";
 | 
			
		||||
			this.page++;
 | 
			
		||||
			this.getRecommendList({ load: "loadmore" }).then(length => {
 | 
			
		||||
				this.loadStatus = "nomore";
 | 
			
		||||
				if(length == 0) this.page--;
 | 
			
		||||
			}).catch(() => {
 | 
			
		||||
				this.loadStatus = "nomore";
 | 
			
		||||
				this.page--;
 | 
			
		||||
			})
 | 
			
		||||
		},
 | 
			
		||||
		changeType(member_id){
 | 
			
		||||
			console.log(member_id);
 | 
			
		||||
			// console.log(member_id);
 | 
			
		||||
			this.$emit("pChangeType")
 | 
			
		||||
			this.$u.api.attentionMember({
 | 
			
		||||
				member_id: member_id
 | 
			
		||||
@ -79,6 +108,10 @@ export default {
 | 
			
		||||
				url: '/pageB/search/index?type=2&curent=1'
 | 
			
		||||
			})
 | 
			
		||||
		},
 | 
			
		||||
		setViewHeight() {
 | 
			
		||||
			const res = uni.getSystemInfoSync();
 | 
			
		||||
			this.viewHeight = res.windowHeight + 'px';
 | 
			
		||||
		}
 | 
			
		||||
	},
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
@ -543,8 +543,8 @@ export default {
 | 
			
		||||
				reply_id: this.reply_id,
 | 
			
		||||
			}).then(res => {
 | 
			
		||||
				// console.log(res.data);
 | 
			
		||||
                this.send_value = "";
 | 
			
		||||
				if (res.errCode == 0) {
 | 
			
		||||
                    this.send_value = "";
 | 
			
		||||
                    this.comment_num = res.data.num;
 | 
			
		||||
                    // console.log(this.comment_num);
 | 
			
		||||
					this.is_edit = false;
 | 
			
		||||
 | 
			
		||||
@ -31,9 +31,9 @@
 | 
			
		||||
					<text>¥{{ goodsInfo.goods_price || '0.00' }}</text>
 | 
			
		||||
				</view>
 | 
			
		||||
				<view class="collect" @click="switchCollect(goodsInfo.is_collect)">
 | 
			
		||||
					<u-icon name="star" color="#474747" size="28" v-if="goodsInfo.is_collect == 0"></u-icon>
 | 
			
		||||
					<u-icon name="star-fill" color="#FF7807" size="28" v-else></u-icon>
 | 
			
		||||
					<text>{{ !goodsInfo.is_collect == 1 ? '收藏' : '已收藏' }}</text>
 | 
			
		||||
					<u-icon name="star-fill" color="#FF7807" size="28" v-if="goodsInfo.is_collect == 1"></u-icon>
 | 
			
		||||
					<u-icon name="star" color="#474747" size="28" v-else></u-icon>
 | 
			
		||||
					<text>{{ goodsInfo.is_collect == 1 ? '已收藏' : '收藏' }}</text>
 | 
			
		||||
				</view>
 | 
			
		||||
			</view>
 | 
			
		||||
        </view>
 | 
			
		||||
@ -638,7 +638,7 @@ export default {
 | 
			
		||||
                current: arr[index]
 | 
			
		||||
            })
 | 
			
		||||
		},
 | 
			
		||||
		switchCollect(status) {
 | 
			
		||||
		switchCollect(status = 0) {
 | 
			
		||||
			if(status == 1) {
 | 
			
		||||
				this.removeFavorite();
 | 
			
		||||
			} else {
 | 
			
		||||
@ -646,6 +646,13 @@ export default {
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		addFavoriteGoods() {
 | 
			
		||||
			// // 尝试登录
 | 
			
		||||
			// if (!this.$store.state.hasLogin) {
 | 
			
		||||
			// 	uni.navigateTo({
 | 
			
		||||
			// 		url: "pageA/login/login"
 | 
			
		||||
			// 	})
 | 
			
		||||
			// 	return false;
 | 
			
		||||
			// }
 | 
			
		||||
			this.$u.api.addFavoriteGoods({ fid: this.goodsInfo.goods_id }).then(res => {
 | 
			
		||||
				if(res.errCode == 0) {
 | 
			
		||||
					this.getGoodsDetails(this.id);
 | 
			
		||||
 | 
			
		||||
@ -266,8 +266,8 @@
 | 
			
		||||
                    success: (res) => {
 | 
			
		||||
                        console.log(res);
 | 
			
		||||
                        this.is_edit = false;
 | 
			
		||||
                        this.send_value = "";
 | 
			
		||||
                        if (res.data.errCode == 0) {
 | 
			
		||||
                            this.send_value = "";
 | 
			
		||||
                            this.comment_num = res.data.num;
 | 
			
		||||
                            let p_id = res.data.data.data.pid;
 | 
			
		||||
                            console.log(this.pid, this.reply_id, this.comment_id);
 | 
			
		||||
 | 
			
		||||
@ -170,9 +170,9 @@ export default {
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		getStoreInfo() {
 | 
			
		||||
			console.log(this.sid )
 | 
			
		||||
			// console.log(this.sid )
 | 
			
		||||
			this.$u.api.getStoreInfo({ id: this.sid }).then((res)=>{
 | 
			
		||||
				console.log(JSON.stringify(res))
 | 
			
		||||
				// console.log(JSON.stringify(res))
 | 
			
		||||
				this.info = res.data;
 | 
			
		||||
				uni.stopPullDownRefresh();
 | 
			
		||||
			})
 | 
			
		||||
@ -222,7 +222,7 @@ export default {
 | 
			
		||||
			const res = uni.getSystemInfoSync();
 | 
			
		||||
			this.scrollHeiht = res.windowHeight - (73 + 20 + 170) + 'px';
 | 
			
		||||
            this.paddingTop = res.windowWidth / 750 * (90 + 50) + 'px';
 | 
			
		||||
            console.log(this.paddingTop);
 | 
			
		||||
            // console.log(this.paddingTop);
 | 
			
		||||
		}
 | 
			
		||||
	},
 | 
			
		||||
	onLoad(option){
 | 
			
		||||
 | 
			
		||||
@ -1,544 +0,0 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<view class="content">
 | 
			
		||||
		<view class="content-box" @touchstart="touchstart" id="content-box" :class="{'content-showfn':showFunBtn}">
 | 
			
		||||
			<!-- 背景图- 定位方式 -->
 | 
			
		||||
			<image class="content-box-bg" :src="_user_info.chatBgImg" :style="{ height: imgHeight }"></image>
 | 
			
		||||
			<view class="content-box-loading" v-if="!loading"><u-loading mode="flower"></u-loading></view>
 | 
			
		||||
			<view class="message" v-for="(item, index) in messageList" :key="index" :id="`msg-${item.hasBeenSentId}`">
 | 
			
		||||
				<view class="message-item " :class="item.isItMe ? 'right' : 'left'">
 | 
			
		||||
					<image class="img" :src="item.fromUserHeadImg" mode="" @tap="linkToBusinessCard(item.fromUserId)"></image>
 | 
			
		||||
					<!-- contentType = 1 文本 -->
 | 
			
		||||
					<view class="content" v-if="item.contentType == 1">{{ item.content }}</view>
 | 
			
		||||
					<!-- contentType = 2 语音 -->
 | 
			
		||||
					<view
 | 
			
		||||
						class="content contentType2"
 | 
			
		||||
						:class="[{ 'content-type-right': item.isItMe }]"
 | 
			
		||||
						v-if="item.contentType == 2"
 | 
			
		||||
						@tap="handleAudio(item)"
 | 
			
		||||
						hover-class="contentType2-hover-class"
 | 
			
		||||
						:style="{width:`${130+(item.contentDuration*2)}rpx`}"
 | 
			
		||||
					>
 | 
			
		||||
						<view
 | 
			
		||||
							class="voice_icon"
 | 
			
		||||
							:class="[
 | 
			
		||||
								{ voice_icon_right: item.isItMe },
 | 
			
		||||
								{ voice_icon_left: !item.isItMe },
 | 
			
		||||
								{ voice_icon_right_an: item.anmitionPlay && item.isItMe },
 | 
			
		||||
								{ voice_icon_left_an: item.anmitionPlay && !item.isItMe }
 | 
			
		||||
							]"
 | 
			
		||||
						></view>
 | 
			
		||||
						<view class="">{{ item.contentDuration }}''</view>
 | 
			
		||||
					</view>
 | 
			
		||||
					<!-- contentType = 3 图片 -->
 | 
			
		||||
					<view 
 | 
			
		||||
						class="content contentType3" 	
 | 
			
		||||
						v-if="item.contentType == 3"
 | 
			
		||||
						@tap="viewImg([item.content])"
 | 
			
		||||
					>
 | 
			
		||||
						<image :src="item.content" class="img" mode="widthFix"></image>
 | 
			
		||||
					</view>
 | 
			
		||||
				</view>
 | 
			
		||||
			</view> 
 | 
			
		||||
		</view>
 | 
			
		||||
		
 | 
			
		||||
		<!-- 底部聊天输入框 -->
 | 
			
		||||
		<view class="input-box" :class="{ 'input-box-mpInputMargin': mpInputMargin }">
 | 
			
		||||
			<view class="input-box-flex">
 | 
			
		||||
				<!-- #ifndef H5 -->
 | 
			
		||||
				<image v-if="chatType === 'voice'" class="icon_img" :src="require('@/static/pageD/voice.png')"  @click="switchChatType('keyboard')"></image>
 | 
			
		||||
				<image v-if="chatType === 'keyboard'" class="icon_img" :src="require('@/static/pageD/keyboard.png')"  @click="switchChatType('voice')"></image>
 | 
			
		||||
				<!-- #endif -->
 | 
			
		||||
				<view class="input-box-flex-grow"> 
 | 
			
		||||
					<input
 | 
			
		||||
						v-if="chatType === 'voice'"
 | 
			
		||||
						type="text"
 | 
			
		||||
						class="content"
 | 
			
		||||
						id="input"
 | 
			
		||||
						v-model="formData.content"
 | 
			
		||||
						:hold-keyboard="true"
 | 
			
		||||
						:confirm-type="'send'"
 | 
			
		||||
						:confirm-hold="true"
 | 
			
		||||
						placeholder-style="color:#DDDDDD;"
 | 
			
		||||
						:cursor-spacing="10"
 | 
			
		||||
						@confirm="sendMsg(null)"
 | 
			
		||||
					/>
 | 
			
		||||
					<view
 | 
			
		||||
						class="voice_title"
 | 
			
		||||
						v-if="chatType === 'keyboard'"
 | 
			
		||||
						:style="{ background: recording ? '#c7c6c6' : '#FFFFFF' }"
 | 
			
		||||
						@touchstart.stop.prevent="startVoice"
 | 
			
		||||
						@touchmove.stop.prevent="moveVoice"
 | 
			
		||||
						@touchend.stop="endVoice"
 | 
			
		||||
						@touchcancel.stop="cancelVoice"
 | 
			
		||||
					>
 | 
			
		||||
						{{ voiceTitle }}
 | 
			
		||||
					</view>
 | 
			
		||||
				</view>
 | 
			
		||||
				
 | 
			
		||||
				<!-- 功能性按钮 -->
 | 
			
		||||
				<image class=" icon_btn_add" :src="require('@/static/pageD/add.png')" @tap="switchFun"></image>
 | 
			
		||||
				
 | 
			
		||||
				<!-- #ifdef H5 --> 
 | 
			
		||||
				<button class="btn" type="primary" size="mini" @touchend.prevent="sendMsg(null)">发送</button>
 | 
			
		||||
				<!-- #endif -->
 | 
			
		||||
			</view>
 | 
			
		||||
			
 | 
			
		||||
			<view class="fun-box" :class="{'show-fun-box':showFunBtn}">
 | 
			
		||||
				<u-grid :col="4"  hover-class="contentType2-hover-class" :border="false" @click="clickGrid">
 | 
			
		||||
					<u-grid-item v-for="(item, index) in funList" :index="index" :key="index" bg-color="#eaeaea">
 | 
			
		||||
						<u-icon :name="item.icon" :size="52"></u-icon>
 | 
			
		||||
						<view class="grid-text">{{ item.title }}</view>
 | 
			
		||||
					</u-grid-item>
 | 
			
		||||
				</u-grid>
 | 
			
		||||
			</view>
 | 
			
		||||
 | 
			
		||||
		</view>
 | 
			
		||||
		
 | 
			
		||||
		<!-- //语音动画 -->
 | 
			
		||||
		<view class="voice_an"  v-if="recording">
 | 
			
		||||
			<view class="voice_an_icon">
 | 
			
		||||
				<view id="one" class="wave"></view>
 | 
			
		||||
				<view id="two" class="wave"></view>
 | 
			
		||||
				<view id="three" class="wave"></view>
 | 
			
		||||
				<view id="four" class="wave"></view>
 | 
			
		||||
				<view id="five" class="wave"></view>
 | 
			
		||||
				<view id="six" class="wave"></view>
 | 
			
		||||
				<view id="seven" class="wave"></view>
 | 
			
		||||
			</view>
 | 
			
		||||
			<view class="text">{{voiceIconText}}</view>
 | 
			
		||||
		</view>
 | 
			
		||||
	</view>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
export default {
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			fromUserInfo: {},
 | 
			
		||||
			formData: {
 | 
			
		||||
				content: '',
 | 
			
		||||
				limit: 15,
 | 
			
		||||
				index: 1
 | 
			
		||||
			},
 | 
			
		||||
			messageList: [],
 | 
			
		||||
			loading: true, //标识是否正在获取数据
 | 
			
		||||
			imgHeight: '1000px',
 | 
			
		||||
			mpInputMargin: false, //适配微信小程序 底部输入框高度被顶起的问题
 | 
			
		||||
			chatType:"voice",  // 图标类型 'voice'语音 'keyboard'键盘
 | 
			
		||||
			voiceTitle: '按住 说话',
 | 
			
		||||
			Recorder: uni.getRecorderManager(),
 | 
			
		||||
			Audio: uni.createInnerAudioContext(),
 | 
			
		||||
			recording: false, //标识是否正在录音
 | 
			
		||||
			isStopVoice: false, //加锁 防止点击过快引起的当录音正在准备(还没有开始录音)的时候,却调用了stop方法但并不能阻止录音的问题
 | 
			
		||||
			voiceInterval:null,
 | 
			
		||||
			voiceTime:0, //总共录音时长
 | 
			
		||||
			canSend:true, //是否可以发送
 | 
			
		||||
			PointY:0, //坐标位置
 | 
			
		||||
			voiceIconText:"正在录音...",
 | 
			
		||||
			showFunBtn:false, //是否展示功能型按钮
 | 
			
		||||
			AudioExam:null, //正在播放音频的实例
 | 
			
		||||
			funList: [
 | 
			
		||||
				{ icon:"photo-fill",title:"照片",uploadType:["album"] },
 | 
			
		||||
				{ icon:"camera-fill",title:"拍摄",uploadType:["camera"] },
 | 
			
		||||
			],
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		//拼接消息 处理滚动
 | 
			
		||||
		async joinData() {
 | 
			
		||||
			if (!this.loading) {
 | 
			
		||||
				//如果没有获取数据 即loading为false时,return 避免用户重复上拉触发加载
 | 
			
		||||
				return;
 | 
			
		||||
			}
 | 
			
		||||
			this.loading = false;
 | 
			
		||||
			const data = await this.getMessageData();
 | 
			
		||||
			//获取节点信息
 | 
			
		||||
			const { index } = this.formData;
 | 
			
		||||
			const sel = `#msg-${index > 1 ? this.messageList[0].hasBeenSentId : data[data.length - 1].hasBeenSentId}`;
 | 
			
		||||
			this.messageList = [...data, ...this.messageList];
 | 
			
		||||
			//填充数据后,视图会自动滚动到最上面一层然后瞬间再跳回bindScroll的指定位置 ---体验不是很好,后期优化
 | 
			
		||||
			this.$nextTick(() => {
 | 
			
		||||
				this.bindScroll(sel);
 | 
			
		||||
				//如果还有数据
 | 
			
		||||
				if (this.formData.limit >= data.length) {
 | 
			
		||||
					this.formData.index++;
 | 
			
		||||
					setTimeout(() => {
 | 
			
		||||
						this.loading = true;
 | 
			
		||||
					}, 200);
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		//处理滚动
 | 
			
		||||
		bindScroll(sel, duration = 0) {
 | 
			
		||||
			const query = uni.createSelectorQuery().in(this);
 | 
			
		||||
			query
 | 
			
		||||
				.select(sel)
 | 
			
		||||
				.boundingClientRect(data => {
 | 
			
		||||
					uni.pageScrollTo({
 | 
			
		||||
						scrollTop: data && data.top - 40,
 | 
			
		||||
						duration
 | 
			
		||||
					});
 | 
			
		||||
				})
 | 
			
		||||
				.exec();
 | 
			
		||||
		},
 | 
			
		||||
		//获取消息
 | 
			
		||||
		getMessageData() {
 | 
			
		||||
			let getData = () => {
 | 
			
		||||
				let arr = [];
 | 
			
		||||
				let startIndex = (this.formData.index - 1) * this.formData.limit;
 | 
			
		||||
				let endIndex = startIndex + this.formData.limit;
 | 
			
		||||
				for (let i = startIndex; i < endIndex; i++) {
 | 
			
		||||
					const isItMe = Math.random() > 0.5 ? true : false;
 | 
			
		||||
					arr.unshift({
 | 
			
		||||
						hasBeenSentId: i, //已发送过去消息的id
 | 
			
		||||
						content: `很高兴认识你,这是第${i + 1}条消息。`,
 | 
			
		||||
						fromUserHeadImg: isItMe ? this._user_info.headImg : this.fromUserInfo.fromUserHeadImg, //用户头像
 | 
			
		||||
						fromUserId: isItMe ? this._user_info.id : this.fromUserInfo.fromUserId,
 | 
			
		||||
						isItMe, //true此条信息是我发送的 false别人发送的
 | 
			
		||||
						createTime: Date.now(),
 | 
			
		||||
						contentType: 1, // 1文字文本 2语音
 | 
			
		||||
						anmitionPlay: false //标识音频是否在播放
 | 
			
		||||
					});
 | 
			
		||||
				}
 | 
			
		||||
				return arr;
 | 
			
		||||
			};
 | 
			
		||||
			return new Promise((resolve, reject) => {
 | 
			
		||||
				const data = getData();
 | 
			
		||||
				setTimeout(() => {
 | 
			
		||||
					resolve(data);
 | 
			
		||||
				}, 500);
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		//切换语音或者键盘方式
 | 
			
		||||
		switchChatType(type) {
 | 
			
		||||
			this.chatType = type;
 | 
			
		||||
			this.showFunBtn =false;
 | 
			
		||||
		},
 | 
			
		||||
		//切换功能性按钮
 | 
			
		||||
		switchFun(){
 | 
			
		||||
			this.chatType = 'keyboard'
 | 
			
		||||
			this.showFunBtn = !this.showFunBtn;
 | 
			
		||||
			uni.hideKeyboard()
 | 
			
		||||
		},
 | 
			
		||||
		//发送消息
 | 
			
		||||
		sendMsg(data) {
 | 
			
		||||
			const params = {
 | 
			
		||||
				hasBeenSentId: Date.now(), //已发送过去消息的id
 | 
			
		||||
				content: this.formData.content,
 | 
			
		||||
				fromUserHeadImg: this._user_info.headImg, //用户头像
 | 
			
		||||
				fromUserId: this._user_info.id,
 | 
			
		||||
				isItMe: true, //true此条信息是我发送的  false别人发送的
 | 
			
		||||
				createTime: Date.now(),
 | 
			
		||||
				contentType: 1
 | 
			
		||||
			};
 | 
			
		||||
 | 
			
		||||
			if (data) {
 | 
			
		||||
				if(data.contentType == 2){
 | 
			
		||||
					//说明是发送语音
 | 
			
		||||
					params.content = data.content;
 | 
			
		||||
					params.contentType = data.contentType;
 | 
			
		||||
					params.contentDuration = data.contentDuration;
 | 
			
		||||
					params.anmitionPlay = false;
 | 
			
		||||
				}else if(data.contentType == 3){
 | 
			
		||||
					//发送图片
 | 
			
		||||
					params.content = data.content;
 | 
			
		||||
					params.contentType = data.contentType;
 | 
			
		||||
				}
 | 
			
		||||
			} else if (!this.$u.trim(this.formData.content)) {
 | 
			
		||||
				//验证输入框书否为空字符传
 | 
			
		||||
				return;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			this.messageList.push(params);
 | 
			
		||||
 | 
			
		||||
			this.$nextTick(() => {
 | 
			
		||||
				this.formData.content = '';
 | 
			
		||||
				// #ifdef MP-WEIXIN
 | 
			
		||||
					if(params.contentType == 1){
 | 
			
		||||
						uni.pageScrollTo({
 | 
			
		||||
							scrollTop: 99999,
 | 
			
		||||
							duration: 0, //小程序如果有滚动效果 input的焦点也会随着页面滚动...
 | 
			
		||||
						});
 | 
			
		||||
					}else{
 | 
			
		||||
						setTimeout(()=>{
 | 
			
		||||
							uni.pageScrollTo({
 | 
			
		||||
								scrollTop: 99999,
 | 
			
		||||
								duration: 0, //小程序如果有滚动效果 input的焦点也会随着页面滚动...
 | 
			
		||||
							});
 | 
			
		||||
						},150)
 | 
			
		||||
					}
 | 
			
		||||
				// #endif
 | 
			
		||||
					
 | 
			
		||||
				// #ifndef MP-WEIXIN
 | 
			
		||||
					uni.pageScrollTo({
 | 
			
		||||
						scrollTop: 99999,
 | 
			
		||||
						duration: 100
 | 
			
		||||
					});
 | 
			
		||||
				// #endif
 | 
			
		||||
				
 | 
			
		||||
				if(this.showFunBtn){
 | 
			
		||||
					this.showFunBtn = false;
 | 
			
		||||
				}
 | 
			
		||||
				
 | 
			
		||||
				// #ifdef MP-WEIXIN 
 | 
			
		||||
				if (params.contentType == 1) {
 | 
			
		||||
					this.mpInputMargin = true;
 | 
			
		||||
				} 
 | 
			
		||||
				// #endif
 | 
			
		||||
				//h5浏览器并没有很好的办法控制键盘一直处于唤起状态 而且会有样式性的问题
 | 
			
		||||
				// #ifdef H5
 | 
			
		||||
				uni.hideKeyboard();
 | 
			
		||||
				// #endif
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		//用户触摸屏幕的时候隐藏键盘
 | 
			
		||||
		touchstart() {
 | 
			
		||||
			uni.hideKeyboard();
 | 
			
		||||
		},
 | 
			
		||||
		// userid 用户id
 | 
			
		||||
		linkToBusinessCard(userId) {
 | 
			
		||||
			this.$u.route({
 | 
			
		||||
				url: 'pages/businessCard/businessCard',
 | 
			
		||||
				params: {
 | 
			
		||||
					userId
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		//准备开始录音
 | 
			
		||||
		startVoice(e) {
 | 
			
		||||
			if(!this.Audio.paused){
 | 
			
		||||
				//如果音频正在播放 先暂停。
 | 
			
		||||
				this.stopAudio(this.AudioExam)
 | 
			
		||||
			}
 | 
			
		||||
			this.recording = true;
 | 
			
		||||
			this.isStopVoice = false;
 | 
			
		||||
			this.canSend = true;
 | 
			
		||||
			this.voiceIconText = "正在录音..."
 | 
			
		||||
			this.PointY = e.touches[0].clientY;
 | 
			
		||||
			this.Recorder.start({
 | 
			
		||||
				format: 'mp3'
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		//录音已经开始
 | 
			
		||||
		beginVoice(){
 | 
			
		||||
			if (this.isStopVoice) {
 | 
			
		||||
				this.Recorder.stop();
 | 
			
		||||
				return;
 | 
			
		||||
			}
 | 
			
		||||
			this.voiceTitle = '松开 结束'
 | 
			
		||||
			this.voiceInterval =  setInterval(()=>{
 | 
			
		||||
				this.voiceTime ++;
 | 
			
		||||
			},1000)
 | 
			
		||||
		},
 | 
			
		||||
		//move 正在录音中
 | 
			
		||||
		moveVoice(e){
 | 
			
		||||
			const PointY = e.touches[0].clientY
 | 
			
		||||
			const slideY = this.PointY - PointY;
 | 
			
		||||
			if(slideY > uni.upx2px(120)){
 | 
			
		||||
				this.canSend = false;
 | 
			
		||||
				this.voiceIconText = '松开手指 取消发送 '
 | 
			
		||||
			}else if(slideY > uni.upx2px(60)){
 | 
			
		||||
				this.canSend = true;
 | 
			
		||||
				this.voiceIconText = '手指上滑 取消发送 '
 | 
			
		||||
			}else{
 | 
			
		||||
				this.voiceIconText = '正在录音... '
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		//结束录音
 | 
			
		||||
		endVoice() {
 | 
			
		||||
			this.isStopVoice = true; //加锁 确保已经结束录音并不会录制
 | 
			
		||||
			this.Recorder.stop();
 | 
			
		||||
			this.voiceTitle = '按住 说话'
 | 
			
		||||
		},
 | 
			
		||||
		//录音被打断
 | 
			
		||||
		cancelVoice(e){
 | 
			
		||||
			this.voiceTime = 0;
 | 
			
		||||
			this.voiceTitle = '按住 说话';
 | 
			
		||||
			this.canSend = false;
 | 
			
		||||
			this.Recorder.stop();
 | 
			
		||||
		},
 | 
			
		||||
		//处理录音文件
 | 
			
		||||
		handleRecorder({ tempFilePath,duration }) {
 | 
			
		||||
			let contentDuration;
 | 
			
		||||
			// #ifdef MP-WEIXIN
 | 
			
		||||
			this.voiceTime = 0;
 | 
			
		||||
			if (duration < 600) {
 | 
			
		||||
				this.voiceIconText="说话时间过短";
 | 
			
		||||
				setTimeout(()=>{
 | 
			
		||||
					this.recording = false;
 | 
			
		||||
				},200)
 | 
			
		||||
				return;
 | 
			
		||||
			} 
 | 
			
		||||
			contentDuration = duration/1000;
 | 
			
		||||
			// #endif
 | 
			
		||||
			
 | 
			
		||||
			// #ifdef APP-PLUS
 | 
			
		||||
			contentDuration = this.voiceTime +1;
 | 
			
		||||
			this.voiceTime = 0;
 | 
			
		||||
			if(contentDuration <= 0) {
 | 
			
		||||
				this.voiceIconText="说话时间过短";
 | 
			
		||||
				setTimeout(()=>{
 | 
			
		||||
					this.recording = false;
 | 
			
		||||
				},200)
 | 
			
		||||
				return;
 | 
			
		||||
			};
 | 
			
		||||
			// #endif
 | 
			
		||||
			
 | 
			
		||||
			this.recording = false;
 | 
			
		||||
			const params = {
 | 
			
		||||
				contentType: 2,
 | 
			
		||||
				content: tempFilePath,
 | 
			
		||||
				contentDuration: Math.ceil(contentDuration)
 | 
			
		||||
			};
 | 
			
		||||
			this.canSend && this.sendMsg(params);
 | 
			
		||||
		},
 | 
			
		||||
		//控制播放还是暂停音频文件
 | 
			
		||||
		handleAudio(item) {
 | 
			
		||||
			this.AudioExam = item;
 | 
			
		||||
			this.Audio.paused ? this.playAudio(item) : this.stopAudio(item);
 | 
			
		||||
		},
 | 
			
		||||
		//播放音频
 | 
			
		||||
		playAudio(item) {
 | 
			
		||||
			this.Audio.src = item.content;
 | 
			
		||||
			this.Audio.hasBeenSentId = item.hasBeenSentId;
 | 
			
		||||
			this.Audio.play();
 | 
			
		||||
			item.anmitionPlay = true;
 | 
			
		||||
		},
 | 
			
		||||
		//停止音频
 | 
			
		||||
		stopAudio(item) {
 | 
			
		||||
			item.anmitionPlay = false;
 | 
			
		||||
			this.Audio.src = '';
 | 
			
		||||
			this.Audio.stop();
 | 
			
		||||
		},
 | 
			
		||||
		//关闭动画
 | 
			
		||||
		closeAnmition() {
 | 
			
		||||
			const hasBeenSentId = this.Audio.hasBeenSentId;
 | 
			
		||||
			const item = this.messageList.find(it => it.hasBeenSentId == hasBeenSentId);
 | 
			
		||||
			item.anmitionPlay = false;
 | 
			
		||||
		},
 | 
			
		||||
		//点击宫格时触发
 | 
			
		||||
		clickGrid(index){
 | 
			
		||||
			if(index == 0){
 | 
			
		||||
				this.chooseImage(['album'])
 | 
			
		||||
			}else if(index == 1){
 | 
			
		||||
				this.chooseImage(['camera'])
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		//发送图片
 | 
			
		||||
		chooseImage(sourceType){
 | 
			
		||||
			uni.chooseImage({
 | 
			
		||||
				sourceType,
 | 
			
		||||
				sizeType:['compressed'], 
 | 
			
		||||
				success:res=>{ 
 | 
			
		||||
					this.showFunBtn = false;
 | 
			
		||||
					for(let i = 0;i<res.tempFilePaths.length;i++){
 | 
			
		||||
						const params = {
 | 
			
		||||
							contentType: 3,
 | 
			
		||||
							content: res.tempFilePaths[i],
 | 
			
		||||
						};
 | 
			
		||||
						this.sendMsg(params)
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			})
 | 
			
		||||
		},
 | 
			
		||||
		//查看大图
 | 
			
		||||
		viewImg(imgList){
 | 
			
		||||
			uni.previewImage({
 | 
			
		||||
				urls: imgList,
 | 
			
		||||
				// #ifndef MP-WEIXIN
 | 
			
		||||
				indicator: 'number'
 | 
			
		||||
				// #endif
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	onPageScroll(e) {
 | 
			
		||||
		if (e.scrollTop < 50) {
 | 
			
		||||
			this.joinData();
 | 
			
		||||
		}
 | 
			
		||||
	},
 | 
			
		||||
	onNavigationBarButtonTap({ index }) {
 | 
			
		||||
		if (index == 0) {
 | 
			
		||||
			//用户详情 设置
 | 
			
		||||
		} else if (index == 1) {
 | 
			
		||||
			//返回按钮
 | 
			
		||||
			this.$u.route({
 | 
			
		||||
				type: 'switchTab',
 | 
			
		||||
				url: 'pages/home/home'
 | 
			
		||||
			});
 | 
			
		||||
		}
 | 
			
		||||
	},
 | 
			
		||||
	//返回按钮事件
 | 
			
		||||
	onBackPress(e) {
 | 
			
		||||
		//以下内容对h5不生效
 | 
			
		||||
		//--所以如果用浏览器自带的返回按钮进行返回的时候页面不会重定向 正在寻找合适的解决方案
 | 
			
		||||
		this.$u.route({
 | 
			
		||||
			type: 'switchTab',
 | 
			
		||||
			url: 'pages/home/home'
 | 
			
		||||
		});
 | 
			
		||||
		return true;
 | 
			
		||||
	},
 | 
			
		||||
	onLoad(info) {
 | 
			
		||||
		// { messageId,fromUserName,fromUserHeadImg } = info
 | 
			
		||||
		const userInfo = this.firendList.filter(item => item.userId == info.fromUserId)[0];
 | 
			
		||||
		console.log(userInfo)
 | 
			
		||||
		this.fromUserInfo = {
 | 
			
		||||
			fromUserName: userInfo.userName,
 | 
			
		||||
			fromUserHeadImg: userInfo.headImg,
 | 
			
		||||
			fromUserId: 4,
 | 
			
		||||
			messageId: 2
 | 
			
		||||
		};
 | 
			
		||||
 | 
			
		||||
		//录音开始事件
 | 
			
		||||
		this.Recorder.onStart(e => {
 | 
			
		||||
			
 | 
			
		||||
			this.beginVoice();
 | 
			
		||||
		});
 | 
			
		||||
		//录音结束事件
 | 
			
		||||
		this.Recorder.onStop(res => {
 | 
			
		||||
			clearInterval(this.voiceInterval);
 | 
			
		||||
			this.handleRecorder(res);
 | 
			
		||||
		});
 | 
			
		||||
 | 
			
		||||
		//音频停止事件
 | 
			
		||||
		this.Audio.onStop(e => {
 | 
			
		||||
			this.closeAnmition();
 | 
			
		||||
		});
 | 
			
		||||
 | 
			
		||||
		//音频播放结束事件
 | 
			
		||||
		this.Audio.onEnded(e => {
 | 
			
		||||
			this.closeAnmition();
 | 
			
		||||
		});
 | 
			
		||||
	},
 | 
			
		||||
	onReady() {
 | 
			
		||||
		//自定义返回按钮 因为原生的返回按钮不可阻止默认事件
 | 
			
		||||
		// #ifdef H5
 | 
			
		||||
		const icon = document.getElementsByClassName('uni-page-head-btn')[0];
 | 
			
		||||
		icon.style.display = 'none';
 | 
			
		||||
		// #endif
 | 
			
		||||
 | 
			
		||||
		uni.setNavigationBarTitle({
 | 
			
		||||
			title: this.fromUserInfo.fromUserName
 | 
			
		||||
		});
 | 
			
		||||
		this.joinData();
 | 
			
		||||
		uni.getSystemInfo({
 | 
			
		||||
			success: res => {
 | 
			
		||||
				this.imgHeight = res.windowHeight + 'px';
 | 
			
		||||
			}
 | 
			
		||||
		});
 | 
			
		||||
		
 | 
			
		||||
		uni.onKeyboardHeightChange(res => {
 | 
			
		||||
			if (res.height == 0) {
 | 
			
		||||
				// #ifdef MP-WEIXIN
 | 
			
		||||
				this.mpInputMargin = false;
 | 
			
		||||
				// #endif
 | 
			
		||||
			}else{
 | 
			
		||||
				this.showFunBtn = false;
 | 
			
		||||
			}
 | 
			
		||||
		});
 | 
			
		||||
	}
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
 @import './index.scss'
 | 
			
		||||
</style>
 | 
			
		||||
@ -1,354 +0,0 @@
 | 
			
		||||
page {
 | 
			
		||||
	background-color: #f3f3f3;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.content {
 | 
			
		||||
	&-showfn{
 | 
			
		||||
		padding-bottom: 0rpx;
 | 
			
		||||
		padding-bottom: calc(420rpx + constant(safe-area-inset-bottom));
 | 
			
		||||
		padding-bottom: calc(420rpx + env(safe-area-inset-bottom) );
 | 
			
		||||
		/* #ifdef MP-WEIXIN */
 | 
			
		||||
		/* #endif */
 | 
			
		||||
	}
 | 
			
		||||
	&-box {
 | 
			
		||||
		width: 100%;
 | 
			
		||||
		height: auto;
 | 
			
		||||
		min-height: calc(100vh - env(safe-area-inset-top) - 200rpx);
 | 
			
		||||
		box-sizing: content-box;
 | 
			
		||||
		position: relative;
 | 
			
		||||
		padding-bottom: 120rpx;
 | 
			
		||||
		
 | 
			
		||||
		/* #ifdef APP-PLUS  */
 | 
			
		||||
		margin-bottom: 0rpx;
 | 
			
		||||
		margin-bottom: constant(safe-area-inset-bottom);
 | 
			
		||||
		margin-bottom: env(safe-area-inset-bottom);
 | 
			
		||||
		/* #endif */
 | 
			
		||||
		/* #ifdef MP-WEIXIN */
 | 
			
		||||
		padding-bottom: 0rpx;
 | 
			
		||||
		padding-bottom: calc(120rpx + constant(safe-area-inset-bottom));
 | 
			
		||||
		padding-bottom: calc(120rpx + env(safe-area-inset-bottom) );
 | 
			
		||||
		/* #endif */
 | 
			
		||||
	
 | 
			
		||||
		&-bg {
 | 
			
		||||
			width: 100%;
 | 
			
		||||
			position: fixed;
 | 
			
		||||
			/* #ifdef MP-WEIXIN */
 | 
			
		||||
			bottom: 0;
 | 
			
		||||
			bottom: constant(safe-area-inset-bottom);
 | 
			
		||||
			bottom: env(safe-area-inset-bottom);
 | 
			
		||||
			/* #endif */
 | 
			
		||||
			/* #ifndef MP-WEIXIN */
 | 
			
		||||
			top: 0;
 | 
			
		||||
			left: 0;
 | 
			
		||||
			/* #endif */
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		&-loading {
 | 
			
		||||
			text-align: center;
 | 
			
		||||
			padding: 20rpx 0;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		.message {
 | 
			
		||||
			padding: 13rpx 20rpx;
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		.message-item {
 | 
			
		||||
			display: flex;
 | 
			
		||||
			justify-content: flex-start;
 | 
			
		||||
			align-items: flex-start;
 | 
			
		||||
			align-content: flex-start;
 | 
			
		||||
			flex-wrap: nowrap;
 | 
			
		||||
			flex-direction: row;
 | 
			
		||||
 | 
			
		||||
			.img {
 | 
			
		||||
				width: 80rpx;
 | 
			
		||||
				height: 80rpx;
 | 
			
		||||
				border-radius: 5rpx;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			.content {
 | 
			
		||||
				padding: 20rpx;
 | 
			
		||||
				max-width: 500rpx;
 | 
			
		||||
				border-radius: 10rpx;
 | 
			
		||||
				font-size: 28rpx;
 | 
			
		||||
			}
 | 
			
		||||
			
 | 
			
		||||
			// 语音
 | 
			
		||||
			.contentType2 {
 | 
			
		||||
				display: flex;
 | 
			
		||||
				flex-direction: row;
 | 
			
		||||
				align-items: center;
 | 
			
		||||
				.voice_icon {
 | 
			
		||||
					height: 34rpx;
 | 
			
		||||
					width: 34rpx; 
 | 
			
		||||
					background-repeat: no-repeat;
 | 
			
		||||
					background-size: 100%;
 | 
			
		||||
				}
 | 
			
		||||
				.voice_icon_right {
 | 
			
		||||
					background-image: url(../../static/voice-left-3.png);
 | 
			
		||||
					margin-left: 10rpx;
 | 
			
		||||
				}
 | 
			
		||||
				.voice_icon_left {
 | 
			
		||||
					background-image: url(../../static/voice-right-3.png);
 | 
			
		||||
					margin-right: 10rpx;
 | 
			
		||||
				}
 | 
			
		||||
				.voice_icon_right_an {
 | 
			
		||||
					animation: voiceAn_right 1s linear alternate infinite;
 | 
			
		||||
				}
 | 
			
		||||
				.voice_icon_left_an {
 | 
			
		||||
					animation: voiceAn_left 1s linear alternate infinite;
 | 
			
		||||
				}
 | 
			
		||||
				@keyframes voiceAn_right {
 | 
			
		||||
					0% {
 | 
			
		||||
						background-image: url(../../static/voice-left-1.png);
 | 
			
		||||
					}
 | 
			
		||||
					50% {
 | 
			
		||||
						background-image: url(../../static/voice-left-2.png);
 | 
			
		||||
					}
 | 
			
		||||
					100% {
 | 
			
		||||
						background-image: url(../../static/voice-left-3.png);
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
				@keyframes voiceAn_left {
 | 
			
		||||
					0% {
 | 
			
		||||
						background-image: url(../../static/voice-right-1.png);
 | 
			
		||||
					}
 | 
			
		||||
					50% {
 | 
			
		||||
						background-image: url(../../static/voice-right-2.png);
 | 
			
		||||
					}
 | 
			
		||||
					100% {
 | 
			
		||||
						background-image: url(../../static/voice-right-3.png);
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			
 | 
			
		||||
			//图片
 | 
			
		||||
			.contentType3{
 | 
			
		||||
				padding: 0;
 | 
			
		||||
				border-radius: 2rpx;
 | 
			
		||||
				background-color: transparent !important;
 | 
			
		||||
				.img{
 | 
			
		||||
					width: 200rpx;
 | 
			
		||||
					height: auto;
 | 
			
		||||
					max-width: 300rpx;
 | 
			
		||||
					max-height: 400rpx;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			.contentType3::after{
 | 
			
		||||
				border: none !important;
 | 
			
		||||
				display: none !important;
 | 
			
		||||
			}
 | 
			
		||||
			.content-type-right {
 | 
			
		||||
				flex-direction: row-reverse;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			&.right {
 | 
			
		||||
				flex-direction: row-reverse;
 | 
			
		||||
 | 
			
		||||
				.content {
 | 
			
		||||
					background-color: $uni-color-success;
 | 
			
		||||
					margin-right: 28rpx;
 | 
			
		||||
					word-break: break-all;
 | 
			
		||||
					line-height: 36rpx;
 | 
			
		||||
					position: relative;
 | 
			
		||||
 | 
			
		||||
					&::after {
 | 
			
		||||
						content: '';
 | 
			
		||||
						display: block;
 | 
			
		||||
						width: 0;
 | 
			
		||||
						height: 0;
 | 
			
		||||
						border-top: 10rpx solid transparent;
 | 
			
		||||
						border-bottom: 10rpx solid transparent;
 | 
			
		||||
						border-left: 16rpx solid $uni-color-success;
 | 
			
		||||
						position: absolute;
 | 
			
		||||
						right: -16rpx;
 | 
			
		||||
						top: 30rpx;
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			&.left {
 | 
			
		||||
				.content {
 | 
			
		||||
					background-color: $uni-text-color-inverse;
 | 
			
		||||
					margin-left: 28rpx;
 | 
			
		||||
					word-break: break-all;
 | 
			
		||||
					line-height: 36rpx;
 | 
			
		||||
					position: relative;
 | 
			
		||||
 | 
			
		||||
					&::after {
 | 
			
		||||
						content: '';
 | 
			
		||||
						display: block;
 | 
			
		||||
						width: 0;
 | 
			
		||||
						height: 0;
 | 
			
		||||
						border-top: 10rpx solid transparent;
 | 
			
		||||
						border-bottom: 10rpx solid transparent;
 | 
			
		||||
						border-right: 16rpx solid $uni-text-color-inverse;
 | 
			
		||||
						position: absolute;
 | 
			
		||||
						left: -16rpx;
 | 
			
		||||
						top: 30rpx;
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	.input-box {
 | 
			
		||||
		position: fixed;
 | 
			
		||||
		bottom: 0;
 | 
			
		||||
		left: 0;
 | 
			
		||||
		width: 100%;
 | 
			
		||||
		box-sizing: content-box;
 | 
			
		||||
		z-index: 999;
 | 
			
		||||
		background-color: #eaeaea;
 | 
			
		||||
		
 | 
			
		||||
		/* #ifdef APP-PLUS */
 | 
			
		||||
		margin-bottom: 0rpx;
 | 
			
		||||
		margin-bottom: constant(safe-area-inset-bottom);
 | 
			
		||||
		margin-bottom: env(safe-area-inset-bottom);
 | 
			
		||||
		/* #endif */
 | 
			
		||||
		/* #ifdef MP-WEIXIN */
 | 
			
		||||
		padding-bottom: 0rpx;
 | 
			
		||||
		padding-bottom: constant(safe-area-inset-bottom);
 | 
			
		||||
		padding-bottom: env(safe-area-inset-bottom);
 | 
			
		||||
		/* #endif */
 | 
			
		||||
 | 
			
		||||
		&-flex {
 | 
			
		||||
			display: flex;
 | 
			
		||||
			justify-content: flex-start;
 | 
			
		||||
			align-items: center;
 | 
			
		||||
			flex-wrap: nowrap;
 | 
			
		||||
			flex-direction: row;
 | 
			
		||||
			padding: 20rpx;
 | 
			
		||||
			box-sizing: border-box;
 | 
			
		||||
			image{
 | 
			
		||||
				width: 56rpx;
 | 
			
		||||
				height: 56rpx;
 | 
			
		||||
			}
 | 
			
		||||
			.icon_img {
 | 
			
		||||
				margin-right: 20rpx;
 | 
			
		||||
			}
 | 
			
		||||
			.icon_btn_add{
 | 
			
		||||
				margin-left: 20rpx;
 | 
			
		||||
			}
 | 
			
		||||
			&-grow {
 | 
			
		||||
				flex-grow: 1;
 | 
			
		||||
 | 
			
		||||
				.content {
 | 
			
		||||
					box-sizing: border-box;
 | 
			
		||||
					background-color: #fff;
 | 
			
		||||
					height: 80rpx;
 | 
			
		||||
					padding: 0 20rpx;
 | 
			
		||||
					border-radius: 12rpx;
 | 
			
		||||
					font-size: 28rpx;
 | 
			
		||||
					caret-color: $uni-color-success;
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
				.voice_title {
 | 
			
		||||
					text-align: center;
 | 
			
		||||
					background-color: #ffffff;
 | 
			
		||||
					height: 80rpx;
 | 
			
		||||
					line-height: 80rpx;
 | 
			
		||||
					border-radius: 12rpx;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			.btn {
 | 
			
		||||
				margin-left: 20rpx;
 | 
			
		||||
				background-color: $u-type-success;
 | 
			
		||||
				border: none;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		.fun-box{
 | 
			
		||||
			opacity: 0;
 | 
			
		||||
			transition: all 0.1s ease-in-out;
 | 
			
		||||
			height: 0;
 | 
			
		||||
			.grid-text{
 | 
			
		||||
				padding-top: 10rpx;
 | 
			
		||||
				color: $uni-text-color-grey;
 | 
			
		||||
			}
 | 
			
		||||
			
 | 
			
		||||
		}
 | 
			
		||||
		.show-fun-box{
 | 
			
		||||
			opacity: 1;
 | 
			
		||||
			height: 300rpx;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	.input-box-mpInputMargin {
 | 
			
		||||
		/* #ifdef MP-WEIXIN */
 | 
			
		||||
		padding-bottom: 0rpx;
 | 
			
		||||
		/* #endif */
 | 
			
		||||
	}
 | 
			
		||||
	.voice_an{
 | 
			
		||||
		width: 300rpx;
 | 
			
		||||
		height: 300rpx;
 | 
			
		||||
		position: fixed;
 | 
			
		||||
		top: 50%;
 | 
			
		||||
		left: 50%;
 | 
			
		||||
		transform: translate(-50%,-55%);
 | 
			
		||||
		background-color: rgba(41,41,41,0.7);
 | 
			
		||||
		color: white;
 | 
			
		||||
		display: flex;
 | 
			
		||||
		flex-direction: column;
 | 
			
		||||
		align-items: center;
 | 
			
		||||
		text-align: center;
 | 
			
		||||
		border-radius: 10rpx;
 | 
			
		||||
		.text{
 | 
			
		||||
			padding-top: 30rpx;
 | 
			
		||||
		}
 | 
			
		||||
		@keyframes runVoice{
 | 
			
		||||
			0%{
 | 
			
		||||
				height: 10%;
 | 
			
		||||
			}
 | 
			
		||||
			20%{
 | 
			
		||||
				height: 50%;
 | 
			
		||||
			}
 | 
			
		||||
			50%{
 | 
			
		||||
				height: 100%;
 | 
			
		||||
			}
 | 
			
		||||
			80%{
 | 
			
		||||
				height: 50%;
 | 
			
		||||
			}
 | 
			
		||||
			100%{
 | 
			
		||||
				height: 0%;
 | 
			
		||||
			}
 | 
			
		||||
		}	
 | 
			
		||||
		.wave{
 | 
			
		||||
			width:6rpx;
 | 
			
		||||
			height: 100%;
 | 
			
		||||
			margin-left: 10rpx;
 | 
			
		||||
			border-radius: 50rpx;
 | 
			
		||||
			background-color: #999;
 | 
			
		||||
			vertical-align: middle;
 | 
			
		||||
			display: inline-block;
 | 
			
		||||
		}
 | 
			
		||||
		.voice_an_icon{
 | 
			
		||||
			width: 200rpx;
 | 
			
		||||
			height: 100rpx;
 | 
			
		||||
			line-height: 50rpx;
 | 
			
		||||
			margin: 50rpx 0;
 | 
			
		||||
		}
 | 
			
		||||
		.voice_an_icon #one{
 | 
			
		||||
			animation:runVoice 0.6s infinite 0.1s;
 | 
			
		||||
		}
 | 
			
		||||
		.voice_an_icon #two{
 | 
			
		||||
			animation:runVoice 0.6s infinite 0.3s;
 | 
			
		||||
		}
 | 
			
		||||
		.voice_an_icon #three{
 | 
			
		||||
			animation:runVoice 0.6s infinite 0.6s;
 | 
			
		||||
		}
 | 
			
		||||
		.voice_an_icon #four{
 | 
			
		||||
			animation:runVoice 0.6s infinite 0.1s;
 | 
			
		||||
		}
 | 
			
		||||
		.voice_an_icon #five{
 | 
			
		||||
			animation:runVoice 0.6s infinite 0.3s;
 | 
			
		||||
		}
 | 
			
		||||
		.voice_an_icon #six{
 | 
			
		||||
			animation:runVoice 0.6s infinite 0.6s;
 | 
			
		||||
		}
 | 
			
		||||
		.voice_an_icon #seven{
 | 
			
		||||
			animation:runVoice 0.6s infinite 0.1s;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
@ -1,259 +1,121 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<view class="concerns">
 | 
			
		||||
		<view>
 | 
			
		||||
			<u-tabs-swiper ref="uTabs" :list="list" :current="current" @change="tabsChange" :is-scroll="false"
 | 
			
		||||
			 swiperWidth="750" active-color="#FF780F"></u-tabs-swiper>
 | 
			
		||||
		<view class="tabs-top u-border-bottom">
 | 
			
		||||
			<u-tabs ref="uTabs" :show-bar="false" :list="list" font-size="32" :current="current" @change="tabsChange" :is-scroll="false"
 | 
			
		||||
			swiperWidth="750" active-color="#FF780F"></u-tabs>
 | 
			
		||||
		</view>
 | 
			
		||||
		<swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish"  style="width:750rpx" :style="{'height':height}">
 | 
			
		||||
			<swiper-item class="swiper-item" >
 | 
			
		||||
						
 | 
			
		||||
				<scroll-view scroll-y style="height: 100%;width: 100%;" class="store" @scrolltolower="shangjiaapi()">
 | 
			
		||||
					<view @touchmove.stop="">
 | 
			
		||||
						<u-swipe-action
 | 
			
		||||
							v-for="(item, index) in shangjia" :key="index" 
 | 
			
		||||
							:index='item.friend_tomid'
 | 
			
		||||
							:options="options"
 | 
			
		||||
							:show="item.show"
 | 
			
		||||
							@click="removeFavorite"
 | 
			
		||||
							@open="open"
 | 
			
		||||
						>
 | 
			
		||||
							<view class="item u-border-bottom" @click="toDetailsPage(item.friend_store_id)">
 | 
			
		||||
								<image :src="item.friend_tomavatar"></image>
 | 
			
		||||
								<!-- 此层wrap在此为必写的,否则可能会出现标题定位错误 -->
 | 
			
		||||
								<view class="title-wrap">
 | 
			
		||||
									<view class="item-name u-line-1">{{ item.friend_tomname }}</view>
 | 
			
		||||
									<view class="item-date">
 | 
			
		||||
										<image src="@/pageE/static/mine/26.png"></image>
 | 
			
		||||
										<view>{{ item.friend_tomavatar | date }}</view>
 | 
			
		||||
									</view>
 | 
			
		||||
								</view>
 | 
			
		||||
							</view>
 | 
			
		||||
						</u-swipe-action>
 | 
			
		||||
						<view style="height:20rpx"></view>
 | 
			
		||||
						<u-loadmore :status="sstatus" bg-color="#ECECEC" v-if="shangjia.length"  />
 | 
			
		||||
 | 
			
		||||
						</view>
 | 
			
		||||
					
 | 
			
		||||
					<u-empty mode="list" v-if="!shangjia.length" color="#000" img-width="200" font-size="30"></u-empty>
 | 
			
		||||
				</scroll-view>
 | 
			
		||||
			</swiper-item>
 | 
			
		||||
			<swiper-item class="swiper-item" >
 | 
			
		||||
				<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="darenapi()">
 | 
			
		||||
					<view class="concerns-container">
 | 
			
		||||
						<view v-for="(info, index) in daren" :key="index">
 | 
			
		||||
							<view class="daren-item">
 | 
			
		||||
								<image class="head" :src="info.friend_tomavatar" @click="viewDetails({ id: info.friend_tomid, type: info.role })"></image>
 | 
			
		||||
								<text class="name" @click="viewDetails({ id: info.friend_tomid, type: info.role })">{{ info.friend_tomname || '' }}</text>
 | 
			
		||||
								<view class="guanzhu" @click="changeType(info.friend_tomid)" v-if="info.friend_followstate == 1">取消关注</view>
 | 
			
		||||
							</view>
 | 
			
		||||
						</view>
 | 
			
		||||
						<u-loadmore :status="dstatus" bg-color="#ECECEC" v-if="daren.length" />
 | 
			
		||||
		<scroll-view v-if="current==0" scroll-y style="height: 100%;width: 100%;" class="store" @scrolltolower="onreachBottom">
 | 
			
		||||
			<storeViwe ref="store"></storeViwe>
 | 
			
		||||
		</scroll-view>
 | 
			
		||||
		<scroll-view v-else scroll-y style="height: 100%;width: 100%;" @scrolltolower="onreachBottom">
 | 
			
		||||
			<view class="concerns-container">
 | 
			
		||||
				<view v-for="(info, index) in daren" :key="index">
 | 
			
		||||
					<view class="daren-item">
 | 
			
		||||
						<image class="head" :src="info.friend_tomavatar" @click="toDetailsPage({ id: info.friend_tomid })"></image>
 | 
			
		||||
						<text class="name" @click="toDetailsPage({ id: info.friend_tomid })">{{ info.friend_tomname || '' }}</text>
 | 
			
		||||
						<view class="guanzhu" @click="changeType(info.friend_tomid)" v-if="info.friend_followstate == 1">取消关注</view>
 | 
			
		||||
					</view>
 | 
			
		||||
					<u-empty mode="list" v-if="!daren.length" color="#000" img-width="200" font-size="30"></u-empty>
 | 
			
		||||
				</scroll-view>
 | 
			
		||||
			</swiper-item>
 | 
			
		||||
		</swiper>
 | 
			
		||||
		
 | 
			
		||||
				</view>
 | 
			
		||||
				<u-loadmore :status="loadStatus" bg-color="#FFFFFF" v-if="daren.length > 9" @loadmore="loadmore" />
 | 
			
		||||
			</view>
 | 
			
		||||
			<u-empty mode="list" v-if="!daren.length" color="#000" img-width="200" font-size="30" margin-top="200"></u-empty>
 | 
			
		||||
		</scroll-view>
 | 
			
		||||
	</view>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import storeViwe from './storeConcerns'
 | 
			
		||||
export default {
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			list: [{name:"商家"},{name:"达人"}],
 | 
			
		||||
			current: 0, // tabs组件的current值,表示当前活动的tab选项
 | 
			
		||||
			swiperCurrent: 0, // swiper组件的current值,表示当前那个swiper-item是活动的
 | 
			
		||||
			daren:[],
 | 
			
		||||
			list: [{ name: "商家" }, { name: "达人" }],
 | 
			
		||||
			daren: [],
 | 
			
		||||
			shangjia:[],
 | 
			
		||||
			height:0,
 | 
			
		||||
			height: 0,
 | 
			
		||||
			show: false,
 | 
			
		||||
			options: [
 | 
			
		||||
				{
 | 
			
		||||
					text: '删除',
 | 
			
		||||
					style: {
 | 
			
		||||
						backgroundColor: '#FF3131'
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			],
 | 
			
		||||
			dpage:1,
 | 
			
		||||
			spage:1,
 | 
			
		||||
			dstatus: 'loadmore',
 | 
			
		||||
			sstatus: 'loadmore',
 | 
			
		||||
			current: 0,
 | 
			
		||||
			page: 1,
 | 
			
		||||
			loadStatus: 'loadmore',
 | 
			
		||||
			timer: true,
 | 
			
		||||
		}
 | 
			
		||||
	},
 | 
			
		||||
	components: {
 | 
			
		||||
		storeViwe,
 | 
			
		||||
	},
 | 
			
		||||
	onShow() {
 | 
			
		||||
		this.dstatus = "loadmore"
 | 
			
		||||
		this.sstatus = "loadmore"
 | 
			
		||||
		this.dpage = 1 
 | 
			
		||||
		this.spage = 1
 | 
			
		||||
		this.shangjiaapi();
 | 
			
		||||
		this.darenapi();
 | 
			
		||||
		this.loadStatus = "loadmore"
 | 
			
		||||
		this.page = 1
 | 
			
		||||
		this.getPeopleList();
 | 
			
		||||
	},
 | 
			
		||||
	onLoad(){
 | 
			
		||||
		let that = this
 | 
			
		||||
 | 
			
		||||
		uni.getSystemInfo({
 | 
			
		||||
			success(res){
 | 
			
		||||
				that.height = res.windowHeight - (res.windowWidth / 750 * 80) + 'px'
 | 
			
		||||
			}
 | 
			
		||||
		})
 | 
			
		||||
		this.setViewHeight();
 | 
			
		||||
	},
 | 
			
		||||
	// 下拉刷新
 | 
			
		||||
	
 | 
			
		||||
	methods: {
 | 
			
		||||
		setViewHeight() {
 | 
			
		||||
			const res = uni.getSystemInfoSync();
 | 
			
		||||
			this.height = res.windowHeight - (res.windowWidth / 750 * 80) + 'px';
 | 
			
		||||
		},
 | 
			
		||||
		// tabs通知swiper切换
 | 
			
		||||
		tabsChange(index) {
 | 
			
		||||
			this.swiperCurrent = index;
 | 
			
		||||
		},
 | 
			
		||||
		// swiper-item左右移动,通知tabs的滑块跟随移动
 | 
			
		||||
		transition(e) {
 | 
			
		||||
			let dx = e.detail.dx;
 | 
			
		||||
			this.$refs.uTabs.setDx(dx);
 | 
			
		||||
		},
 | 
			
		||||
		// 由于swiper的内部机制问题,快速切换swiper不会触发dx的连续变化,需要在结束时重置状态
 | 
			
		||||
		// swiper滑动结束,分别设置tabs和swiper的状态
 | 
			
		||||
		animationfinish(e) {
 | 
			
		||||
			let current = e.detail.current;
 | 
			
		||||
			this.$refs.uTabs.setFinishCurrent(current);
 | 
			
		||||
			this.swiperCurrent = current;
 | 
			
		||||
			this.current = current;
 | 
			
		||||
			this.current = index;
 | 
			
		||||
		},
 | 
			
		||||
		// scroll-view到底部加载更多
 | 
			
		||||
		onreachBottom() {
 | 
			
		||||
			
 | 
			
		||||
			if(this.current == 0) this.$refs.loadmore();
 | 
			
		||||
			else if(this.current == 1) this.loadmore();
 | 
			
		||||
		},
 | 
			
		||||
		shangjiaapi() {
 | 
			
		||||
			if(this.sstatus ==  "loading" || this.sstatus == 'nomore') return
 | 
			
		||||
			this.sstatus = "loading"
 | 
			
		||||
			this.$forceUpdate();
 | 
			
		||||
			this.$u.api.attentionMemberList({role:2,page:this.spage}).then(res => {
 | 
			
		||||
				console.log(res)
 | 
			
		||||
				if(res.errCode == 0) {
 | 
			
		||||
					this.spage > 1 ? this.shangjia.push(...res.data.data) : (this.shangjia = res.data.data);
 | 
			
		||||
					this.sstatus = "loadmore"
 | 
			
		||||
 | 
			
		||||
					if(res.data.data.length == 0){
 | 
			
		||||
						this.sstatus = 'nomore'
 | 
			
		||||
					}
 | 
			
		||||
					this.spage++
 | 
			
		||||
					this.$forceUpdate();
 | 
			
		||||
				}
 | 
			
		||||
		loadmore() {
 | 
			
		||||
			if(!this.timer) return false;
 | 
			
		||||
			this.timer = false;
 | 
			
		||||
			this.loadStatus = "loading";
 | 
			
		||||
			this.page++;
 | 
			
		||||
			this.getPeopleList({ load: 'loadmore' }).then(length => {
 | 
			
		||||
				this.loadStatus = "nomore";
 | 
			
		||||
				if(length == 0) this.page--;
 | 
			
		||||
			}).catch(() => {
 | 
			
		||||
				this.loadStatus = "nomore";
 | 
			
		||||
				this.page--;
 | 
			
		||||
			})
 | 
			
		||||
		},
 | 
			
		||||
		darenapi() {
 | 
			
		||||
			this.$u.api.attentionMemberList({role:3,page:this.dpage}).then(res => {
 | 
			
		||||
				if(this.dstatus ==  "loading" || this.dstatus == 'nomore') return
 | 
			
		||||
				this.dstatus = "loading"
 | 
			
		||||
			this.$forceUpdate();
 | 
			
		||||
 | 
			
		||||
				console.log(this.dstatus)
 | 
			
		||||
				console.log(res)
 | 
			
		||||
				if(res.errCode == 0) {
 | 
			
		||||
					this.dpage > 1 ? this.daren.push(...res.data.data) : (this.daren = res.data.data);
 | 
			
		||||
					this.dstatus = "loadmore"
 | 
			
		||||
 | 
			
		||||
					if(res.data.data.length == 0){
 | 
			
		||||
						this.dstatus = 'nomore'
 | 
			
		||||
					}
 | 
			
		||||
					this.dpage++
 | 
			
		||||
			this.$forceUpdate();
 | 
			
		||||
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
		async getPeopleList({ load = 'reload' } = {}) {
 | 
			
		||||
			const res = await this.$u.api.attentionMemberList({
 | 
			
		||||
				role: 3,
 | 
			
		||||
				page: this.page
 | 
			
		||||
			})
 | 
			
		||||
			this.timer = true;
 | 
			
		||||
			if(res.errCode == 0) {
 | 
			
		||||
				if(load == 'reload') this.daren = res.data.data;
 | 
			
		||||
				else if(load == 'loadmore') this.daren.push(...res.data.data);
 | 
			
		||||
			}
 | 
			
		||||
			return res.data.data.length;
 | 
			
		||||
		},
 | 
			
		||||
		viewDetails({ id, type }) {
 | 
			
		||||
			let src = type == 3 ? 'pageB/details/index' : 'pageC/merchant/index';
 | 
			
		||||
			this.$u.route(src, {
 | 
			
		||||
				id: id
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		// 取消关注
 | 
			
		||||
		changeType(id) {
 | 
			
		||||
			console.log(id);
 | 
			
		||||
			// console.log(id);
 | 
			
		||||
			this.$u.api.attentionMember({
 | 
			
		||||
				member_id: id
 | 
			
		||||
			}).then(res => {
 | 
			
		||||
				this.$u.toast(res.message);
 | 
			
		||||
				this.attentionMemberList();
 | 
			
		||||
			})
 | 
			
		||||
		},
 | 
			
		||||
		removeFavorite(id) {
 | 
			
		||||
			console.log(id)
 | 
			
		||||
			this.$u.api.attentionMemberRemove({
 | 
			
		||||
				id: id,
 | 
			
		||||
				type: 'store'
 | 
			
		||||
			}).then(res => {
 | 
			
		||||
				console.log(res)
 | 
			
		||||
				this.$u.toast(res.message);
 | 
			
		||||
				if(res.errCode == 0) {
 | 
			
		||||
					this.sstatus = "loadmore"
 | 
			
		||||
					this.spage = 1
 | 
			
		||||
					this.shangjiaapi();
 | 
			
		||||
				}
 | 
			
		||||
				this.getPeopleList();
 | 
			
		||||
			})
 | 
			
		||||
		},
 | 
			
		||||
		toDetailsPage(id) {
 | 
			
		||||
			this.$u.route('pageC/merchant/index', {
 | 
			
		||||
			this.$u.route('pageB/details/index', {
 | 
			
		||||
				id: id
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		open(index) {
 | 
			
		||||
			// 先将正在被操作的swipeAction标记为打开状态,否则由于props的特性限制,
 | 
			
		||||
			// 原本为'false',再次设置为'false'会无效
 | 
			
		||||
			this.shangjia[index].show = true;
 | 
			
		||||
			this.shangjia.map((val, idx) => {
 | 
			
		||||
				if(index != idx) this.list[idx].show = false;
 | 
			
		||||
			})
 | 
			
		||||
		}
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
.store {
 | 
			
		||||
	background-color: #ECECEC;
 | 
			
		||||
	.item {
 | 
			
		||||
		padding: 30rpx;
 | 
			
		||||
		display: flex;
 | 
			
		||||
		align-items: center;
 | 
			
		||||
		> image {
 | 
			
		||||
			width: 80rpx;
 | 
			
		||||
			height: 80rpx;
 | 
			
		||||
			border-radius: 50%;
 | 
			
		||||
			flex-shrink: 0;
 | 
			
		||||
			margin-right: 21rpx;
 | 
			
		||||
		}
 | 
			
		||||
		.title-wrap {
 | 
			
		||||
			flex: 1;
 | 
			
		||||
			display: flex;
 | 
			
		||||
			align-items: center;
 | 
			
		||||
			justify-content: space-between;
 | 
			
		||||
			.item-name {
 | 
			
		||||
				width: 260rpx;
 | 
			
		||||
				font-size: 30rpx;
 | 
			
		||||
				color: rgba(51,51,51,1);
 | 
			
		||||
			}
 | 
			
		||||
			.item-date {
 | 
			
		||||
				display: flex;
 | 
			
		||||
				align-items: center;
 | 
			
		||||
				> image {
 | 
			
		||||
					margin-right: 25rpx;
 | 
			
		||||
					width: 24rpx;
 | 
			
		||||
					height: 24rpx;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
.concerns {
 | 
			
		||||
	background-color: #ECECEC;
 | 
			
		||||
	background-color: #FFFFFF;
 | 
			
		||||
	.store {
 | 
			
		||||
		background-color: #FFFFFF;
 | 
			
		||||
	}
 | 
			
		||||
	.concerns-container {
 | 
			
		||||
		padding: 30rpx;
 | 
			
		||||
		display: flex;
 | 
			
		||||
		flex-wrap: wrap;
 | 
			
		||||
 | 
			
		||||
		// &:not(:nth-child(3n)) {
 | 
			
		||||
		// 	margin-right: 20rpx;
 | 
			
		||||
		// }
 | 
			
		||||
		margin-left: -20rpx;
 | 
			
		||||
		.daren-item{
 | 
			
		||||
			width: 215rpx;
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										176
									
								
								pageE/mine/storeConcerns.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										176
									
								
								pageE/mine/storeConcerns.vue
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,176 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<view class="collection-item">
 | 
			
		||||
		<u-swipe-action
 | 
			
		||||
			v-for="(item, index) in list" :key="index" 
 | 
			
		||||
			:index='index'
 | 
			
		||||
			:show="item.show"
 | 
			
		||||
			:options="options"
 | 
			
		||||
			@click="removeFavorite"
 | 
			
		||||
			@open="open"
 | 
			
		||||
		>
 | 
			
		||||
			<view class="item u-border-bottom" @click="viewStoreDetails(item)">
 | 
			
		||||
				<image :src="item.friend_tomavatar"></image>
 | 
			
		||||
				<!-- 此层wrap在此为必写的,否则可能会出现标题定位错误 -->
 | 
			
		||||
				<view class="title-wrap">
 | 
			
		||||
					<view class="item-top u-line-1">{{ item.friend_tomname }}</view>
 | 
			
		||||
					<view class="item-bottom">
 | 
			
		||||
						<view class="item-date">
 | 
			
		||||
							<image src="@/pageE/static/mine/26.png"></image>
 | 
			
		||||
							<view>{{ item.friend_tomavatar | date }}</view>
 | 
			
		||||
						</view>
 | 
			
		||||
					</view>
 | 
			
		||||
				</view>
 | 
			
		||||
			</view>
 | 
			
		||||
		</u-swipe-action>
 | 
			
		||||
		<u-empty mode="list" v-if="!list.length" color="#000" img-width="200" font-size="30" margin-top="200"></u-empty>
 | 
			
		||||
		<u-loadmore :status="loadStatus" bg-color="#FFFFFF" v-if="list.length > pageSize" @loadmore="loadmore" />
 | 
			
		||||
	</view>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
export default {
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			pageSize: 12,
 | 
			
		||||
			list: [],
 | 
			
		||||
			options: [
 | 
			
		||||
				{
 | 
			
		||||
					text: '删除',
 | 
			
		||||
					style: {
 | 
			
		||||
						backgroundColor: '#FF3131'
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			],
 | 
			
		||||
			page: 1,
 | 
			
		||||
			timer: true,
 | 
			
		||||
			loadStatus: 'loadmore',
 | 
			
		||||
		}
 | 
			
		||||
	},
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.getStoreList();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		viewStoreDetails(item) {
 | 
			
		||||
			if(this.closeAction()) return false;
 | 
			
		||||
			// console.log(this.list);
 | 
			
		||||
			const list = this.list.filter(item => {
 | 
			
		||||
				return item.show;
 | 
			
		||||
			})
 | 
			
		||||
			if(list.length) return false;
 | 
			
		||||
			this.$u.route({
 | 
			
		||||
				url: 'pageC/merchant/index',
 | 
			
		||||
				params: {
 | 
			
		||||
					id: item.friend_store_id,
 | 
			
		||||
				}
 | 
			
		||||
			})
 | 
			
		||||
		},
 | 
			
		||||
		async getStoreList({ load = 'reload' } = {}) {
 | 
			
		||||
			const res = await this.$u.api.attentionMemberList({
 | 
			
		||||
				role: 2,
 | 
			
		||||
				page: this.page
 | 
			
		||||
			})
 | 
			
		||||
			this.timer = true;
 | 
			
		||||
			if(res.errCode == 0) {
 | 
			
		||||
				if(load == 'reload') this.list = res.data.data;
 | 
			
		||||
				else if(load == 'loadmore') this.list.push(...res.data.data);
 | 
			
		||||
			}
 | 
			
		||||
			this.list.forEach(item => {
 | 
			
		||||
				Object.assign(item, { show: false });
 | 
			
		||||
			})
 | 
			
		||||
			// console.log(this.list);
 | 
			
		||||
			return res.data.data.length;
 | 
			
		||||
		},
 | 
			
		||||
		loadmore() {
 | 
			
		||||
			if(!this.timer) return false;
 | 
			
		||||
			this.timer = false;
 | 
			
		||||
			this.loadStatus = "loading";
 | 
			
		||||
			this.page++;
 | 
			
		||||
			let promise;
 | 
			
		||||
			promise = this.getStoreList({ load: 'loadmore' });
 | 
			
		||||
			promise.then(length => {
 | 
			
		||||
				this.loadStatus = "nomore";
 | 
			
		||||
				if(length == 0) this.page--;
 | 
			
		||||
			}).catch(() => {
 | 
			
		||||
				this.loadStatus = "nomore";
 | 
			
		||||
				this.page--;
 | 
			
		||||
			})
 | 
			
		||||
		},
 | 
			
		||||
		removeFavorite(index) {
 | 
			
		||||
			const id = this.list[index].friend_tomid;
 | 
			
		||||
			this.$u.api.attentionMemberRemove({
 | 
			
		||||
				id: id,
 | 
			
		||||
				type: 'store'
 | 
			
		||||
			}).then(res => {
 | 
			
		||||
				if(res.errCode == 0) {
 | 
			
		||||
					this.getStoreList();
 | 
			
		||||
				} else {
 | 
			
		||||
					this.$u.toast(res.message);
 | 
			
		||||
				}
 | 
			
		||||
			})
 | 
			
		||||
		},
 | 
			
		||||
		closeAction() {
 | 
			
		||||
			let status = false;
 | 
			
		||||
			this.list.map((val, idx) => {
 | 
			
		||||
				if(val.show) {
 | 
			
		||||
					status = true;
 | 
			
		||||
					this.$set(this.list[idx], 'show', false);
 | 
			
		||||
				};
 | 
			
		||||
			})
 | 
			
		||||
			this.$forceUpdate();
 | 
			
		||||
			return status;
 | 
			
		||||
		},
 | 
			
		||||
		open(index) {
 | 
			
		||||
			console.log(index);
 | 
			
		||||
			// 先将正在被操作的swipeAction标记为打开状态,否则由于props的特性限制,
 | 
			
		||||
			// 原本为'false',再次设置为'false'会无效
 | 
			
		||||
			this.list[index].show = true;
 | 
			
		||||
			this.list.map((val, idx) => {
 | 
			
		||||
				if(index != idx) this.list[idx].show = false;
 | 
			
		||||
			})
 | 
			
		||||
			this.$forceUpdate();
 | 
			
		||||
		}
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
.collection-item {
 | 
			
		||||
	background-color: #ffffff;
 | 
			
		||||
	.item {
 | 
			
		||||
		padding: 30rpx;
 | 
			
		||||
		display: flex;
 | 
			
		||||
		> image {
 | 
			
		||||
			width: 180rpx;
 | 
			
		||||
			height: 160rpx;
 | 
			
		||||
			border-radius: 10rpx;
 | 
			
		||||
			margin-right: 30rpx;
 | 
			
		||||
			flex-shrink: 0;
 | 
			
		||||
		}
 | 
			
		||||
		.title-wrap {
 | 
			
		||||
			flex: 1;
 | 
			
		||||
			.item-top {
 | 
			
		||||
				font-size: 30rpx;
 | 
			
		||||
				color: rgba(51,51,51,1);
 | 
			
		||||
				line-height: 44rpx;
 | 
			
		||||
				margin-bottom: 54rpx;
 | 
			
		||||
			}
 | 
			
		||||
			.item-bottom {
 | 
			
		||||
				display: flex;
 | 
			
		||||
				align-items: center;
 | 
			
		||||
				justify-content: space-between;
 | 
			
		||||
				.item-price {
 | 
			
		||||
					font-size: 30rpx;
 | 
			
		||||
					color: rgba(51,51,51,1);
 | 
			
		||||
				}
 | 
			
		||||
				.item-date {
 | 
			
		||||
					display: flex;
 | 
			
		||||
					align-items: center;
 | 
			
		||||
					> image {
 | 
			
		||||
						margin-right: 25rpx;
 | 
			
		||||
						width: 24rpx;
 | 
			
		||||
						height: 24rpx;
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
@ -1,11 +1,11 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<view class="setting">
 | 
			
		||||
		<view class="list-item">
 | 
			
		||||
		<!-- <view class="list-item">
 | 
			
		||||
			<view>消息提醒</view>
 | 
			
		||||
			<view>
 | 
			
		||||
				<u-switch v-model="checked" active-color="#FF770F" inactive-color="#A9A7A7" size="35"></u-switch>
 | 
			
		||||
			</view>
 | 
			
		||||
		</view>
 | 
			
		||||
		</view> -->
 | 
			
		||||
		<view v-for="(item, index) in settingList" :key="index" class="list-item" @click="toNextPage(item.link)">
 | 
			
		||||
			<view>{{ item.title }}</view>
 | 
			
		||||
			<image src="../static/mine/21.png"></image>
 | 
			
		||||
 | 
			
		||||
@ -5,17 +5,15 @@
 | 
			
		||||
			<view class="feedback-itme">
 | 
			
		||||
				<view class="manual">
 | 
			
		||||
					<view class="service-phone">拨打官方客服电话:400-100-100</view>
 | 
			
		||||
					<view class="manual-time">周一至周五08:0-18:00</view>
 | 
			
		||||
					<view class="manual-time">{{ wkTime }}</view>
 | 
			
		||||
				</view>
 | 
			
		||||
				<view class="suggestions">意见反馈</view>
 | 
			
		||||
				<view class="suggestions" @click="writeComments">意见反馈</view>
 | 
			
		||||
			</view>
 | 
			
		||||
		</view>
 | 
			
		||||
		<view class="feedback-box">
 | 
			
		||||
			<view class="feedback-title">常见服务</view>
 | 
			
		||||
			<view class="feedback-itme">
 | 
			
		||||
				<view class="u-line-2">【账号问题】登录时需要验证码,手机号使用不了怎么办?</view>
 | 
			
		||||
				<view class="u-line-2">【账号问题】登录时需提示您的密码不安全,请重置?</view>
 | 
			
		||||
				<view class="u-line-2">【账号问题】登录密码忘记了怎么办?</view>
 | 
			
		||||
				<view class="u-line-2" v-for="item in helpList" :key="item.id" @click="viewAnswer(item)">{{ item.question }}</view>
 | 
			
		||||
			</view>
 | 
			
		||||
		</view>
 | 
			
		||||
	</view>
 | 
			
		||||
@ -23,7 +21,32 @@
 | 
			
		||||
<script>
 | 
			
		||||
export default {
 | 
			
		||||
	data() {
 | 
			
		||||
		return {}
 | 
			
		||||
		return {
 | 
			
		||||
			helpList: [],
 | 
			
		||||
			wkTime: '',
 | 
			
		||||
			tel400: '',
 | 
			
		||||
		}
 | 
			
		||||
	},
 | 
			
		||||
	onLoad() {
 | 
			
		||||
		this.getHelpList();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		viewAnswer(item) {
 | 
			
		||||
			this.$store.commit('setQuestion', item);
 | 
			
		||||
			this.$u.route('pageE/setting/question');
 | 
			
		||||
		},
 | 
			
		||||
		getHelpList() {
 | 
			
		||||
			this.$u.api.getSettingHelpList().then(res => {
 | 
			
		||||
				this.helpList = res.data.QA;
 | 
			
		||||
				this.tel400 = res.data.tel400;
 | 
			
		||||
				this.wkTime = res.data.wkTime;
 | 
			
		||||
			})
 | 
			
		||||
		},
 | 
			
		||||
		writeComments() {
 | 
			
		||||
			uni.navigateTo({
 | 
			
		||||
				url: '/pageE/more/WriteComments'
 | 
			
		||||
			});
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										51
									
								
								pageE/setting/question.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										51
									
								
								pageE/setting/question.vue
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,51 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<view class="question">
 | 
			
		||||
		<view class="public-view quest">
 | 
			
		||||
			<view class="title qt">Q:</view>
 | 
			
		||||
			<view class="qa">{{ item.question }}</view>
 | 
			
		||||
		</view>
 | 
			
		||||
		<view class="public-view answer">
 | 
			
		||||
			<view class="title at">A:</view>
 | 
			
		||||
			<view>
 | 
			
		||||
				<rich-text :nodes="nodes"></rich-text>
 | 
			
		||||
			</view>
 | 
			
		||||
		</view>
 | 
			
		||||
	</view>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import common from '@/static/js/common.js'
 | 
			
		||||
export default {
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			item: {},
 | 
			
		||||
			nodes: ''
 | 
			
		||||
		}
 | 
			
		||||
	},
 | 
			
		||||
	onLoad() {
 | 
			
		||||
		this.item = this.$store.state.question;
 | 
			
		||||
		console.log(this.item);
 | 
			
		||||
		this.nodes = common.unescapeHTML(this.item.answer);
 | 
			
		||||
	}
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
.question {
 | 
			
		||||
	min-height: calc(100vh - var(--window-top));
 | 
			
		||||
	background: #FFFFFF;
 | 
			
		||||
	padding: 20rpx 30rpx;
 | 
			
		||||
	.public-view {
 | 
			
		||||
		display: flex;
 | 
			
		||||
		margin-bottom: 40rpx;
 | 
			
		||||
		.title {
 | 
			
		||||
			font-size: 36rpx;
 | 
			
		||||
			margin-right: 20rpx;
 | 
			
		||||
		}
 | 
			
		||||
		.at {
 | 
			
		||||
			color: #ff780f;
 | 
			
		||||
		}
 | 
			
		||||
		.qa {
 | 
			
		||||
			line-height: 36rpx;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										17
									
								
								pages.json
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								pages.json
									
									
									
									
									
								
							@ -845,7 +845,6 @@
 | 
			
		||||
				{
 | 
			
		||||
					"path": "mine/MineConcerns",
 | 
			
		||||
					"style": {
 | 
			
		||||
						"enablePullDownRefresh": true,
 | 
			
		||||
						"navigationBarTitleText": "我的关注",
 | 
			
		||||
						"app-plus": {
 | 
			
		||||
							"titleSize": "36px",
 | 
			
		||||
@ -861,10 +860,9 @@
 | 
			
		||||
					"style": {
 | 
			
		||||
						"navigationBarTitleText": "勋章介绍",
 | 
			
		||||
						"app-plus": {
 | 
			
		||||
							"type": "transparent",
 | 
			
		||||
							"titleSize": "36px",
 | 
			
		||||
							"titleNView": {
 | 
			
		||||
								"backgroundColor": "rgba(255,255,255,0)",
 | 
			
		||||
								"type": "transparent",
 | 
			
		||||
								"titleColor": "#ffffff"
 | 
			
		||||
							}
 | 
			
		||||
						}
 | 
			
		||||
@ -968,6 +966,19 @@
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					"path": "setting/question",
 | 
			
		||||
					"style": {
 | 
			
		||||
						"navigationBarTitleText": "常见问题",
 | 
			
		||||
						"app-plus": {
 | 
			
		||||
							"titleSize": "36px",
 | 
			
		||||
							"titleNView": {
 | 
			
		||||
								"titleColor": "#333333",
 | 
			
		||||
								"backgroundColor": "#FFFFFF"
 | 
			
		||||
							}
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					"path": "setting/ShieldUsers",
 | 
			
		||||
					"style": {
 | 
			
		||||
 | 
			
		||||
@ -222,7 +222,6 @@
 | 
			
		||||
	import zhiboItem from "@/components/index/zhibo-item/index"
 | 
			
		||||
	import indexad from "@/components/index/ad/index"
 | 
			
		||||
	import darenItem from "@/components/index/daren-item/index"
 | 
			
		||||
import chatVue from '../../pageD/chat/chat.vue'
 | 
			
		||||
 | 
			
		||||
	export default {
 | 
			
		||||
		name: "index",
 | 
			
		||||
@ -266,14 +265,14 @@ import chatVue from '../../pageD/chat/chat.vue'
 | 
			
		||||
		onShow() {
 | 
			
		||||
            this.page = 1;
 | 
			
		||||
            if (this.page != 1) {
 | 
			
		||||
                this.articleList = [];
 | 
			
		||||
            }
 | 
			
		||||
            this.getArticlelist();
 | 
			
		||||
            // if (this.hasLogin) {
 | 
			
		||||
            //     this.isNewmembervoucher();
 | 
			
		||||
            // }
 | 
			
		||||
		},
 | 
			
		||||
		async onLoad(){
 | 
			
		||||
            this.articleList = [];
 | 
			
		||||
            this.getArticlelist();
 | 
			
		||||
            this.getSwiper();
 | 
			
		||||
            // 优惠券
 | 
			
		||||
			if(this.$store.state.hasLogin){
 | 
			
		||||
@ -402,16 +401,18 @@ import chatVue from '../../pageD/chat/chat.vue'
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
			},
 | 
			
		||||
            // 发现别表
 | 
			
		||||
            // 发现列表
 | 
			
		||||
			getArticlelist() {
 | 
			
		||||
                uni.showLoading({
 | 
			
		||||
                    title: "loading..."
 | 
			
		||||
                })
 | 
			
		||||
                if (this.page > 1) {
 | 
			
		||||
                    uni.showLoading({
 | 
			
		||||
                        title: "loading..."
 | 
			
		||||
                    })
 | 
			
		||||
                }
 | 
			
		||||
				this.$u.api.getArticlelist({
 | 
			
		||||
					page: this.page,
 | 
			
		||||
					is_video_img: 0, // 查询视频1 图文2 都查0
 | 
			
		||||
				}).then(res => {
 | 
			
		||||
                    // uni.stopPullDownRefresh();
 | 
			
		||||
                    uni.stopPullDownRefresh();
 | 
			
		||||
                    this.status = "loading";
 | 
			
		||||
                    if (res.errCode == 0) {
 | 
			
		||||
                        uni.hideLoading();
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user