Browse Source

授权手机号

xhj 2 years ago
parent
commit
6a69134ec4

+ 37 - 0
components/update-userinfonew/index.css

@@ -0,0 +1,37 @@
+.ceng{position: fixed;top: 0;left: 0;right: 0;bottom: 0;background-color: rgba(0,0,0,.5);z-index: 99;}
+.update-pop{position: fixed;bottom: -100%;left: 0;right: 0;background-color: rgba(255,255,255,.9);border-radius: 20rpx 20rpx 0 0;z-index: 100;padding: 90rpx 60rpx 80rpx;transition: all .3s ease;}
+.project{font-size: 40rpx;color: #000;text-align: center;font-weight: bold;}
+.project image{width: 65rpx;height: 65rpx;margin-right: 15rpx;border-radius: 50%;}
+.project text{/* margin-left: 10rpx; */font-size: 30rpx;color: #666;display: block;margin-top: 20rpx;font-weight: normal;}
+.huoqu-text{font-size: 30rpx;color: #000;font-weight: bold;margin-top: 20rpx;}
+.update-form{margin: 35rpx 0 0;}
+.update-form .li{border-bottom: 1rpx solid #e9e9e9;padding: 15rpx 0;}
+.update-label{font-size: 30rpx;color: #333;margin-right: 20rpx;}
+.update-img{width: 180rpx;height: 180rpx;margin: -100rpx auto 0;}
+.update-avatar{width: 150rpx !important;height: 150rpx !important;justify-content: center;position: relative;margin: 0 auto !important;}
+.update-pic{width: 40rpx;height: 40rpx;border: 2rpx solid #fff;background-color: var(--mina);position: absolute;right: 0;bottom: 0;border-radius: 50%;justify-content: center;}
+.update-pic image{width: 25rpx;height: 25rpx;}
+.update-avatars{width: 150rpx;height: 150rpx;}
+.update-ipt{font-size: 30rpx;color: #333;font-weight: bold;padding: 25rpx 0;border-radius: 20rpx;text-align: center;background-color: #fff;margin-top: 50rpx;}
+.update-rico{width: 14rpx;height: 22rpx;}
+
+.update-tip{font-size: 34rpx;color: #333;text-align: center;padding: 0 30rpx;margin: 34rpx 0 0;font-weight: bold;}
+.update-tip view{font-size: 30rpx;color: #666;display: block;margin-top: 20rpx;font-weight: normal;}
+.update-btn{width: 100% !important;height: 80rpx !important;background: var(--mina);border-radius: 50rpx !important;font-size: 30rpx;color: #fff;margin: 40rpx auto 0 !important;text-align: center;line-height: 80rpx !important;justify-content: center;font-weight: bold;}
+.update-btn image{width: 30rpx;height: 41rpx;margin-right: 15rpx;}
+.update-close{width: 65rpx;height: 65rpx;position: absolute;left: 50%;transform: translateX(-50%);bottom: -110rpx;}
+.update-close1{position: absolute;top: 30rpx;right: 30rpx;padding: 10rpx;}
+.update-close1 image{width: 37rpx;height: 37rpx;}
+.update-placeholder{color: #999;}
+
+.update-btns{margin-top: 45rpx;justify-content: space-between;}
+.update-btn-jj{width: 320rpx;height: 80rpx;box-sizing: border-box;border: 2rpx solid #e5e5e5;font-size: 32rpx;color: #999;border-radius: 50rpx;text-align: center;line-height: 76rpx;}
+.update-btn-yx{width: 320rpx;height: 80rpx;background: var(--mina);border-radius: 50rpx;font-size: 32rpx;color: #fff;text-align: center;line-height: 80rpx;}
+
+.ment{font-size: 26rpx;color: #999;justify-content: center;margin-top: 50rpx;}
+.ment image{width: 34rpx;height: 34rpx;margin-right: 10rpx;}
+.xieyi{color: #00a3ff;}
+
+.pro-logo{width: 140rpx;height: 140rpx;border-radius: 30rpx;margin: 0 auto;}
+
+.zanbu{font-size: 30rpx;color: #999;margin-top: 30rpx;text-align: center;}

+ 199 - 0
components/update-userinfonew/index.vue

@@ -0,0 +1,199 @@
+<template>
+	<view>
+		<view class="ceng"></view>
+		<view class="update-pop" :style="'bottom:'+updateBottom">
+			<view class="update-close1" @click="closeUpdate(true)">
+				<image src="../../static/pages/images/close1.png"></image>
+			</view>
+			<block v-if="updateInfo">
+				<view class="project ddflex">
+					<!-- <image :src="config.CONFIG_PROJECT_LOGO" mode="aspectFill"></image> -->
+					<!-- {{config.CONFIG_PROJECT_TITLE}}<text>申请</text> -->
+					<view class="fflex">
+						<view>建议完善头像与昵称</view>
+						<text>便于更好地为您提供服务</text>
+					</view>
+				</view>
+				<!-- <view class="huoqu-text">获取你的昵称、头像</view> -->
+				<!-- <view class="update-tip">完善头像/昵称信息</view> -->
+				<view class="update-form">
+					<button open-type="chooseAvatar" hover-class="none" class="update-avatar ddflex fflex" @chooseavatar="uploadAvatar">
+						<image :src="avatar?avatar:'/static/images/update_userimg.png'" class="update-avatars" style="border-radius: 50%;"></image>
+						<view class="update-pic ddflex">
+							<image :src="'/static/images/upload_white.png'"></image>
+						</view>
+					</button>
+					<input type="nickname" v-model="nickName" placeholder="获取微信昵称" placeholder-class="update-placeholder" class="update-ipt fflex" @blur="getNickname" />
+				</view>
+				<view class="ment dflex">
+					<image :src="'../../static/pages/images/'+(isAgree?'gou_h.png':'gou.png')" @click="agree()"></image>
+					<view class="ddflex fflex">我已阅读并同意
+					<block v-if="config.CONFIG_PRIVACY_AGREEMENT">
+						<navigator :url="'/pages/web/web?url='+it.url" hover-class="none" class="xieyi" v-for="it,idx in JSON.parse(config.CONFIG_PRIVACY_AGREEMENT)"><block v-if="idx!=0">、</block>{{it.name}}</navigator>
+					</block>
+					</view>
+				</view>
+				<view class="update-btn" @click="updateInfos">保存并继续使用</view>
+				<!-- <view class="update-btns ddflex">
+					<view class="update-btn-jj" @click="closeUpdate()">拒绝</view>
+					<view class="update-btn-yx" @click="updateInfos()">允许</view>
+				</view> -->
+			</block>
+
+			<view class="bind-mobile" v-if="updateMobile && !updateInfo">
+				<image :src="config.CONFIG_PROJECT_LOGO" mode="aspectFill" class="pro-logo"></image>
+				<view class="update-tip">{{config.CONFIG_PROJECT_TITLE}}<view>更多服务,请{{isBind ? '绑定手机号':'授权登录'}}</view></view>
+				<view class="ment dflex">
+					<image :src="'../../static/pages/images/'+(isAgree?'gou_h.png':'gou.png')" @click="agree()"></image>
+					<view class="ddflex fflex">我已阅读并同意
+						<block v-if="config.CONFIG_PRIVACY_AGREEMENT">
+							<navigator :url="'/pages/web/web?url='+it.url" hover-class="none" class="xieyi" v-for="it,idx in JSON.parse(config.CONFIG_PRIVACY_AGREEMENT)"><block v-if="idx!=0">、</block>{{it.name}}</navigator>
+						</block>
+					</view>
+				</view>
+				<button class="update-btn ddflex" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" style="margin-top: 80rpx !important;" v-if="isAgree"><image src="/static/images/bind_m.png"></image>{{isBind ? '绑定手机号':'一键登录'}}</button>
+				<view class="update-btn ddflex" style="margin-top: 80rpx !important;" @click="checkAgree" v-else><image src="/static/images/bind_m.png"></image>{{isBind ? '绑定手机号':'一键登录'}}</view>
+				<view class="zanbu" @click="closeUpdate">暂不{{isBind ? '绑定':'登录'}}</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+const app = getApp();
+const req = require('../../utils/request.js');
+
+export default {
+	data() {
+		return {
+			config: '',
+			avatar: '',
+			nickName: '',
+			isAgree: false,
+			updateBottom: '-100%',
+			isBind:true
+		};
+	},
+
+	components: {},
+	props: {
+		updateInfo: {
+			type: Boolean,
+			default: false
+		},
+		updateMobile: {
+			type: Boolean,
+			default: false
+		},
+		isUpdate: {
+			type: Boolean,
+			default: false
+		}
+	},
+	watch: {},
+	created() {
+		console.log('----readymounted----');
+	},
+	async mounted() {
+		app.globalData.getCheckSessoin(json => {
+			this.sessionKey = json.session_key;
+		});
+		this.config = await req.getsysConfig()
+		// console.log('isUpdateInfo==',this.updateInfo)
+		// console.log('isUpdateMobile==',this.updateMobile)
+		this.updateBottom = '0'
+		// this.avatar = req.getStorage('userInfo').avatar;
+		// this.nickName = req.getStorage('userInfo').nickName;
+	},
+
+	methods: {
+		uploadAvatar(e) {
+			uni.showLoading({
+				title: '头像上传中'
+			});
+			req.uploadFile('/api/nocheck/upload', e.detail.avatarUrl, res => {
+				this.avatar = res.src;
+				this.confirm(false,false);
+				uni.hideLoading();
+			});
+		},
+
+		getNickname: function(e) {
+			this.nickName = e.detail.value;
+			if(e.detail.value) this.confirm(false,false);
+		},
+		agree(){
+			this.isAgree = !this.isAgree;
+		},
+		updateInfos() {
+			let that = this;
+			if(!this.isAgree) return req.msg('请先同意用户协议');
+			if (!this.avatar) return req.msg('请点击获取你的微信头像');
+			if (!this.nickName) return req.msg('请输入昵称');
+			// this.confirm(true,true);
+			that.closeUpdate();
+		},
+		confirm(isShow,isClose) {
+			let that = this;
+			let d = {};
+			if(that.avatar) d.avatar = that.avatar;
+			if(that.nickName) d.nickName = that.nickName;
+			req.postRequest('/api/user/save',d,res => {
+				let userInfo = req.getStorage('userInfo');
+				if(that.avatar) userInfo.avatar = that.avatar;
+				if(that.nickName) userInfo.nickName = that.nickName;
+				req.setStorage('userInfo', userInfo);
+				if(isClose){
+					this.closeUpdate();
+				}
+				req.removeStorage('isShowUpdateInfo')
+			},isShow);
+		},
+		getPhoneNumber(e) {
+			let that = this;
+			let sessionKey = this.sessionKey;
+			let _params = {
+				sessionKey: sessionKey,
+				iv: e.detail.iv,
+				encryptedData: e.detail.encryptedData
+			};
+			if (req.getStorage('pidCode')) {
+				_params.parentId = req.getStorage('pidCode');
+			}
+			if (e.detail.errMsg == 'getPhoneNumber:ok') {
+				req.postRequest('/api/weixin/mobile', _params, json => {
+					if (json.mobile) {
+						var userInfo = req.getStorage('userInfo');
+						userInfo.mobile = json.mobile;
+						req.setStorage('userInfo', userInfo);
+						that.closeUpdate();
+					}
+				});
+			} else {
+			}
+		},
+		closeUpdate(back) {
+			// if(back){
+			// 	uni.exitMiniProgram({
+			// 		success: function() {
+			// 			console.log('退出小程序成功');
+			// 		},
+			// 		fail: function(err) {
+			// 			console.log('退出小程序失败', err);
+			// 		}
+			// 	})
+			// }
+			this.updateBottom = '-100%'
+			this.$emit('closeUpdate');
+			if(this.isUpdate) this.$emit('updateMobileInfo')
+		},
+		checkAgree(){
+		    if(!this.isAgree) return req.msg('请先同意用户协议');
+		},
+	}
+};
+</script>
+
+<style>
+@import './index.css';
+</style>

+ 2 - 0
main.js

@@ -3,12 +3,14 @@ import App from './App';
 import contactButton from "@/components/contact-button/index";
 import updateUserinfo from '@/components/update-userinfo/index';
 import toUserinfo from '@/components/to-userinfo/index';
+import updateUserinfonew from '@/components/update-userinfonew/index';
 
 Vue.config.productionTip = false;
 
 Vue.component("contact-button", contactButton);
 Vue.component("update-userinfo", updateUserinfo);
 Vue.component("to-userinfo", toUserinfo);
+Vue.component("update-userinfonew", updateUserinfonew);
 
 
 Vue.mixin({

+ 48 - 12
match/activityDetail/activityDetail.vue

@@ -108,6 +108,9 @@
 			<view class="pop-btn" @click="jumpUrl('/match/sign/sign?id=' + detail.id + '&priceId=' + priceId)">马上报名</view>
 		</view>
 		<v-share :hide-toast="hideShare" :product="detail" :code-url="codeUrl" @onFather="click"></v-share>
+		
+		<update-userinfonew :update-info="isUpdateInfo" :update-mobile="isUpdateMobile" v-if="isShowUpdate" @closeUpdate="closeUpdate" @updateInfo="updateInfo" @updateMobile="updateMobile"></update-userinfonew>
+		
 	</view>
 </template>
 
@@ -138,9 +141,13 @@ export default {
 			price: 0,
 			hideShare: true,
 			codeUrl: '',
+			
+			isShowUpdate: false, //是否显示更新信息弹窗
+			isUpdateInfo: false,//更新用户信息
+			isUpdateMobile: false,//绑定手机号
 		};
 	},
-	onLoad(options) {
+	async onLoad(options) {
 		uni.showShareMenu({
 			withShareTicket: true,
 			menus: ['shareAppMessage', 'shareTimeline']
@@ -148,10 +155,20 @@ export default {
 		this.options = options;
 		if(options.shareId) req.setStorage('shareId',options.shareId)
 		// req.silenceLogin(options.userId, '');
+		// 朋友圈页面不调用登陆
+		if(!this.options.isSharePYQ){
+			await  req.silenceLogin(options.userId, '');
+			setTimeout(()=>{
+				this.getUpdate()
+			},500)
+		}
 	},
 	async onShow() {
-		this.isLogin = req.isAuth();
+		// this.isLogin = req.isAuth();
 		// await this.loadCodeParams();
+		if(!this.options.isSharePYQ){
+			await  req.silenceLogin(this.options.userId, '');
+		}
 		if(this.options.scene)
 			this.options.id = this.options.scene
 		await this.getConfig();
@@ -180,20 +197,12 @@ export default {
 		};
 	},
 	onShareTimeline() {
-		let query = {
-			id: this.detail.id
-		}
-		if(req.getStorage('userInfo')){
-			query.userId = req.getStorage('userInfo').id
-		}
-		if(req.getStorage('userInfo').userType==1){
-			url += '&shareId=' + req.getStorage('userInfo').saleNo
-		}
 		req.saveBehaviorNew(this.detail.id,2,6)
 		return {
 			title: this.detail.title,
 			imageUrl: this.detail.pic,
-			query: query
+			path: '/match/activityDetail/activityDetail',
+			query:'id=' + this.detail.id+'&isSharePYQ=' + true +'&isShare=' + true+(req.getStorage('userInfo').userType==1?('&shareId='+req.getStorage('userInfo').saleNo):'')
 		};
 	},
 	methods: {
@@ -443,6 +452,33 @@ export default {
 		monthDayDiff(date){
 			return util.monthDayDiff(date)
 		},
+		
+		closeUpdate(){
+			this.isShowUpdate = false
+		},
+		updateInfo(e){
+			this.isUpdateInfo = e;
+		},
+		updateMobile(e){
+			this.isUpdateMobile = e;
+		},
+		getUpdate() {
+			console.log('getUpdate')
+			let userInfos = req.getStorage('userInfo')
+			// if ((!userInfos.avatar || userInfos.avatar.indexOf('thirdwx.qlogo') > -1 || !userInfos.nickName || userInfos.nickName.indexOf('用户') > -1) ) {
+			// 	console.log('没有昵称')
+			// 	this.isShowUpdate = true;
+			// 	this.isUpdateInfo = true;
+			// 	return false;
+			// }
+			if(!userInfos.mobile){
+				console.log('没有手机号')
+				this.isShowUpdate = true
+				this.isUpdateMobile = true
+				return false;
+			}
+			return true;
+		},
 	}
 };
 </script>

+ 1 - 1
pages/found/found.css

@@ -6,7 +6,7 @@
 	right: 0;
 	left: 0;
 	background-color: #fff;
-	z-index: 101;
+	z-index: 98;
 }
 .search-box{
 	padding: 30rpx;

+ 36 - 2
pages/found/found.vue

@@ -52,6 +52,8 @@
 		</view>
 
 		<foot channel="found" :isUpdate="isUpdate"></foot>
+		
+		<update-userinfonew :update-info="isUpdateInfo" :update-mobile="isUpdateMobile" v-if="isShowUpdate" @closeUpdate="closeUpdate" @updateInfo="updateInfo" @updateMobile="updateMobile"></update-userinfonew>
 	</view>
 </template>
 
@@ -89,7 +91,11 @@
 				tbalCode:req.public.tbalCode,
 				lpalCode:req.public.lpalCode,
 				
-				recommendList:[]
+				recommendList:[],
+				
+				isShowUpdate: false, //是否显示更新信息弹窗
+				isUpdateInfo: false,//更新用户信息
+				isUpdateMobile: false,//绑定手机号
 			};
 		},
 
@@ -109,6 +115,7 @@
 			this.setData({
 				isUpdate: !this.isUpdate
 			});
+			this.getUpdate()
 		},
 
 		onReachBottom() {
@@ -259,7 +266,34 @@
 			formatTime(date){
 				date = new Date(date.replace(/-/g, '/'))
 				return util.formatTime(date).t3
-			}
+			},
+			
+			closeUpdate(){
+				this.isShowUpdate = false
+			},
+			updateInfo(e){
+				this.isUpdateInfo = e;
+			},
+			updateMobile(e){
+				this.isUpdateMobile = e;
+			},
+			getUpdate() {
+				console.log('getUpdate')
+				let userInfos = req.getStorage('userInfo')
+				// if ((!userInfos.avatar || userInfos.avatar.indexOf('thirdwx.qlogo') > -1 || !userInfos.nickName || userInfos.nickName.indexOf('用户') > -1) ) {
+				// 	console.log('没有昵称')
+				// 	this.isShowUpdate = true;
+				// 	this.isUpdateInfo = true;
+				// 	return false;
+				// }
+				if(!userInfos.mobile){
+					console.log('没有手机号')
+					this.isShowUpdate = true
+					this.isUpdateMobile = true
+					return false;
+				}
+				return true;
+			},
 
 		}
 	};

+ 26 - 8
pages/index/index.vue

@@ -310,8 +310,8 @@
 			</view>
 		</view>
 			
-		<to-userinfo v-if="isShowUpdate"></to-userinfo>
-		
+		<!-- <to-userinfo v-if="isShowUpdate" @closeUpdate="closeUpdate"></to-userinfo> -->
+		<update-userinfonew :update-info="isUpdateInfo" :update-mobile="isUpdateMobile" v-if="isShowUpdate" @closeUpdate="closeUpdate" @updateInfo="updateInfo" @updateMobile="updateMobile"></update-userinfonew>
 	</view>
 </template>
 
@@ -428,6 +428,8 @@
 				userInfo:{},
 				
 				isShowUpdate: false, //是否显示更新信息弹窗
+				isUpdateInfo: false,//更新用户信息
+				isUpdateMobile: false,//绑定手机号
 				
 				firstLoad:true,//第一次加载页面
 			};
@@ -511,9 +513,9 @@
 				
 				console.log('onShow',req.getStorage('userInfo'))
 				if (this.firstLoad==true) {
-					this.isShowUpdate = true;
 					req.saveBehaviorNew('',15,4)
 				}
+				this.getUpdate()
 				this.firstLoad = false
 			},500)
 			
@@ -1147,16 +1149,32 @@
 				this.hideAd();
 			},
 			
-			closeUpdate() {
-				this.isShowUpdate = false;
+			closeUpdate(){
+				this.isShowUpdate = false
 			},
-			updateInfo(e) {
+			updateInfo(e){
 				this.isUpdateInfo = e;
-				this.getMy();
 			},
-			updateMobile(e) {
+			updateMobile(e){
 				this.isUpdateMobile = e;
 			},
+			getUpdate() {
+				console.log('getUpdate')
+				let userInfos = req.getStorage('userInfo')
+				// if ((!userInfos.avatar || userInfos.avatar.indexOf('thirdwx.qlogo') > -1 || !userInfos.nickName || userInfos.nickName.indexOf('用户') > -1) ) {
+				// 	console.log('没有昵称')
+				// 	this.isShowUpdate = true;
+				// 	this.isUpdateInfo = true;
+				// 	return false;
+				// }
+				if(!userInfos.mobile){
+					console.log('没有手机号')
+					this.isShowUpdate = true
+					this.isUpdateMobile = true
+					return false;
+				}
+				return true;
+			},
 		},
 		mounted() {
 			const systemInfo = uni.getSystemInfoSync();

+ 36 - 1
pages/interactive/index.vue

@@ -346,6 +346,8 @@
 			</view>
 		</view>
 		<foot channel="interactive" :isUpdate="false"></foot>
+		
+		<update-userinfonew :update-info="isUpdateInfo" :update-mobile="isUpdateMobile" v-if="isShowUpdate" @closeUpdate="closeUpdate" @updateInfo="updateInfo" @updateMobile="updateMobile"></update-userinfonew>
 	</view>
 </template>
 
@@ -401,6 +403,10 @@
 				isFirst: true,
 				isRefresh: false,
 				cmsList: [], //官方动态
+				
+				isShowUpdate: false, //是否显示更新信息弹窗
+				isUpdateInfo: false,//更新用户信息
+				isUpdateMobile: false,//绑定手机号
 			}
 		},
 		onLoad(options) {
@@ -464,6 +470,7 @@
 					this.isRefresh = false;
 				}
 			}
+			this.getUpdate()
 		},
 		onHide() {
 			this.isShowbtn = false;
@@ -878,6 +885,33 @@
 			getDateTimeStamp(dateStr) {
 				return util.getDateDiff(Date.parse(dateStr.replace(/-/gi, "/")));
 			},
+			
+			closeUpdate(){
+				this.isShowUpdate = false
+			},
+			updateInfo(e){
+				this.isUpdateInfo = e;
+			},
+			updateMobile(e){
+				this.isUpdateMobile = e;
+			},
+			getUpdate() {
+				console.log('getUpdate')
+				let userInfos = req.getStorage('userInfo')
+				// if ((!userInfos.avatar || userInfos.avatar.indexOf('thirdwx.qlogo') > -1 || !userInfos.nickName || userInfos.nickName.indexOf('用户') > -1) ) {
+				// 	console.log('没有昵称')
+				// 	this.isShowUpdate = true;
+				// 	this.isUpdateInfo = true;
+				// 	return false;
+				// }
+				if(!userInfos.mobile){
+					console.log('没有手机号')
+					this.isShowUpdate = true
+					this.isUpdateMobile = true
+					return false;
+				}
+				return true;
+			},
 		},
 		created() {
 			const systemInfo = uni.getSystemInfoSync();
@@ -937,7 +971,8 @@
 					'userInfo').nickName) : '') + '为你推荐' + title,
 				query: path
 			};
-		}
+		},
+		
 	}
 </script>
 

+ 36 - 1
pages/matchList/index.vue

@@ -61,6 +61,8 @@
 		</view>
 		
 		<foot channel="match" :isUpdate="isUpdate"></foot>
+		
+		<update-userinfonew :update-info="isUpdateInfo" :update-mobile="isUpdateMobile" v-if="isShowUpdate" @closeUpdate="closeUpdate" @updateInfo="updateInfo" @updateMobile="updateMobile"></update-userinfonew>
 	</view>
 </template>
 
@@ -104,6 +106,11 @@ export default {
 				//分类导航
 				module_king_kong_district: 'king_kong_district', //金刚区
 			},
+			
+			
+			isShowUpdate: false, //是否显示更新信息弹窗
+			isUpdateInfo: false,//更新用户信息
+			isUpdateMobile: false,//绑定手机号
 		};
 	},
 	onLoad() {
@@ -116,6 +123,7 @@ export default {
 		this.getPageList(true);
 		if (this.isLogin) {
 			this.getuserVip();
+			this.getUpdate()
 		}
 	},
 	onReachBottom: function() {
@@ -255,7 +263,34 @@ export default {
 			uni.navigateTo({
 				url: '/match/activityDetail/activityDetail?id=' + item.id
 			});
-		}
+		},
+		
+		closeUpdate(){
+			this.isShowUpdate = false
+		},
+		updateInfo(e){
+			this.isUpdateInfo = e;
+		},
+		updateMobile(e){
+			this.isUpdateMobile = e;
+		},
+		getUpdate() {
+			console.log('getUpdate')
+			let userInfos = req.getStorage('userInfo')
+			// if ((!userInfos.avatar || userInfos.avatar.indexOf('thirdwx.qlogo') > -1 || !userInfos.nickName || userInfos.nickName.indexOf('用户') > -1) ) {
+			// 	console.log('没有昵称')
+			// 	this.isShowUpdate = true;
+			// 	this.isUpdateInfo = true;
+			// 	return false;
+			// }
+			if(!userInfos.mobile){
+				console.log('没有手机号')
+				this.isShowUpdate = true
+				this.isUpdateMobile = true
+				return false;
+			}
+			return true;
+		},
 	}
 };
 </script>

+ 28 - 7
pages/user/user.vue

@@ -207,7 +207,7 @@
 		<!-- <view class="placeholder-view" :style="'height:' + (bottomBlankHeignt + 115) + 'rpx'"></view> -->
 		<foot channel="user"></foot>
 		
-		<to-userinfo v-if="isShowUpdate"></to-userinfo>
+		<!-- <to-userinfo v-if="isShowUpdate"></to-userinfo> -->
 
 
 		<msgNumber bottom="230rpx"></msgNumber>
@@ -236,6 +236,10 @@
 		</view>
 
 		<bindJobnum v-if="isShowBind" @closeBind="closeBind()"></bindJobnum>
+		
+		<update-userinfonew :update-info="isUpdateInfo" :update-mobile="isUpdateMobile" v-if="isShowUpdate" @closeUpdate="closeUpdate" @updateInfo="updateInfo" @updateMobile="updateMobile"></update-userinfonew>
+		
+		
 	</view>
 </template>
 
@@ -286,6 +290,8 @@
 				userInfo: {},
 				userInfos: {},
 				isShowUpdate: false, //是否显示更新信息弹窗
+				isUpdateInfo: false,//更新用户信息
+				isUpdateMobile: false,//绑定手机号
 				recommendCard:'',
 				isShowCodePop:false,
 				isShowBind:false,
@@ -324,9 +330,9 @@
 			// #ifdef MP-WEIXIN
 			let userInfo = req.getStorage('userInfo');
 			if (req.isAuth()) {
-				setTimeout(res => {
-					this.isShowUpdate = true;
-				}, 500);
+				// setTimeout(res => {
+				// 	this.isShowUpdate = true;
+				// }, 500);
 			}
 			// #endif
 			req.saveBehaviorNew('',16,4)
@@ -342,9 +348,7 @@
 				this.noLogin = true;
 				
 				console.log("userInfo",userInfo)
-				if(this.isShowUpdate == true){
-					this.isShowUpdate = false;
-				}
+				this.getUpdate()
 				
 			} else {
 				this.noLogin = false;
@@ -445,6 +449,23 @@
 				this.isUpdateMobile = e;
 				this.getMy();
 			},
+			getUpdate() {
+				console.log('getUpdate')
+				let userInfos = req.getStorage('userInfo')
+				// if ((!userInfos.avatar || userInfos.avatar.indexOf('thirdwx.qlogo') > -1 || !userInfos.nickName || userInfos.nickName.indexOf('用户') > -1) ) {
+				// 	console.log('没有昵称')
+				// 	this.isShowUpdate = true;
+				// 	this.isUpdateInfo = true;
+				// 	return false;
+				// }
+				if(!userInfos.mobile){
+					console.log('没有手机号')
+					this.isShowUpdate = true
+					this.isUpdateMobile = true
+					return false;
+				}
+				return true;
+			},
 			closeBind(){
 				this.isShowBind = false;
 			},

BIN
static/images/bind_m.png


BIN
static/images/update_userimg.png


BIN
static/images/upload_white.png


+ 38 - 1
topic/content/content.vue

@@ -47,6 +47,8 @@
 		<view v-if="detaile&&detaile.contentType==3">
 			<web-view :src="webUrl" v-if="webUrl!==''"></web-view>
 		</view>
+		
+		<update-userinfonew :update-info="isUpdateInfo" :update-mobile="isUpdateMobile" v-if="isShowUpdate" @closeUpdate="closeUpdate" @updateInfo="updateInfo" @updateMobile="updateMobile"></update-userinfonew>
 	</view>
 </template>
 
@@ -79,7 +81,12 @@ export default {
 			
 			webUrl:'',
 			
-			tempFilePath:''
+			tempFilePath:'',
+			
+			
+			isShowUpdate: false, //是否显示更新信息弹窗
+			isUpdateInfo: false,//更新用户信息
+			isUpdateMobile: false,//绑定手机号
 		};
 	},
 
@@ -90,9 +97,13 @@ export default {
 		// 朋友圈页面不调用登陆
 		if(!this.query.isSharePYQ){
 			await  req.silenceLogin(options.userId, '');
+			setTimeout(()=>{
+				this.getUpdate()
+			},500)
 		}
 		setTimeout(()=>{
 			this.userInfo = req.getStorage('userInfo')
+			
 		},500)
 		uni.showShareMenu({
 			withShareTicket: true,
@@ -271,6 +282,32 @@ export default {
 				}
 			});
 		},
+		closeUpdate(){
+			this.isShowUpdate = false
+		},
+		updateInfo(e){
+			this.isUpdateInfo = e;
+		},
+		updateMobile(e){
+			this.isUpdateMobile = e;
+		},
+		getUpdate() {
+			console.log('getUpdate')
+			let userInfos = req.getStorage('userInfo')
+			// if ((!userInfos.avatar || userInfos.avatar.indexOf('thirdwx.qlogo') > -1 || !userInfos.nickName || userInfos.nickName.indexOf('用户') > -1) ) {
+			// 	console.log('没有昵称')
+			// 	this.isShowUpdate = true;
+			// 	this.isUpdateInfo = true;
+			// 	return false;
+			// }
+			if(!userInfos.mobile){
+				console.log('没有手机号')
+				this.isShowUpdate = true
+				this.isUpdateMobile = true
+				return false;
+			}
+			return true;
+		},
 	},
 	filters: {
 		/**