Browse Source

perf: 新增退出、优化收藏提示

lizhaocai 1 month ago
parent
commit
fed8775ca9
40 changed files with 457 additions and 290 deletions
  1. 1 1
      App.vue
  2. 1 1
      circlePages/addShare.vue
  3. 1 1
      minePages/set.vue
  4. 27 14
      pages/comm/comm.vue
  5. 30 15
      pages/home/home.vue
  6. 22 17
      pages/index/autoLogin.vue
  7. 19 13
      pages/index/detail/detail.vue
  8. 39 3
      pages/index/index.vue
  9. 95 8
      pages/login/login.vue
  10. 43 171
      pages/login/loginByCode.vue
  11. 26 3
      pages/mine/coll.vue
  12. 116 10
      pages/mine/mine.vue
  13. 1 1
      tuniao-ui/components/tn-badge/tn-badge.vue
  14. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/circlePages/addShare.js.map
  15. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/common/main.js.map
  16. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/common/vendor.js.map
  17. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/minePages/set.js.map
  18. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/comm/comm.js.map
  19. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/home/home.js.map
  20. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/index/index.js.map
  21. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/login/login.js.map
  22. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/mine/coll.js.map
  23. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/mine/mine.js.map
  24. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/mine/share.js.map
  25. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/tuniao-ui/components/tn-badge/tn-badge.js.map
  26. 1 1
      unpackage/dist/dev/mp-weixin/circlePages/addShare.js
  27. 1 1
      unpackage/dist/dev/mp-weixin/common/main.js
  28. 1 1
      unpackage/dist/dev/mp-weixin/common/vendor.js
  29. 1 1
      unpackage/dist/dev/mp-weixin/minePages/set.wxml
  30. 1 1
      unpackage/dist/dev/mp-weixin/pages/comm/comm.js
  31. 1 1
      unpackage/dist/dev/mp-weixin/pages/comm/comm.wxml
  32. 1 1
      unpackage/dist/dev/mp-weixin/pages/home/home.js
  33. 1 1
      unpackage/dist/dev/mp-weixin/pages/index/index.js
  34. 1 1
      unpackage/dist/dev/mp-weixin/pages/login/login.js
  35. 1 1
      unpackage/dist/dev/mp-weixin/pages/mine/coll.js
  36. 1 1
      unpackage/dist/dev/mp-weixin/pages/mine/coll.wxml
  37. 1 1
      unpackage/dist/dev/mp-weixin/pages/mine/mine.js
  38. 1 1
      unpackage/dist/dev/mp-weixin/pages/mine/mine.wxml
  39. 1 1
      unpackage/dist/dev/mp-weixin/tuniao-ui/components/tn-badge/tn-badge.wxss
  40. 10 6
      utils/request.js

+ 1 - 1
App.vue

@@ -45,7 +45,7 @@
 			      updateManager.onUpdateReady(() => {
 			        uni.showModal({
 			          title: '更新提示',
-			          content: '新版本已经准备就绪,是否需要重新启动应用?',
+			          content: '新版本已经准备好,是否重启应用?',
 			          success: (res) => {
 			            if (res.confirm) {
 			              uni.clearStorageSync() // 更新完成后刷新storage的数据

+ 1 - 1
circlePages/addShare.vue

@@ -800,7 +800,7 @@
 						company: that.selectValue=='公司'?this.org.name:'',
 						subject: that.selectValue=='公司'?'1':'2',
 						jobTitle: this.formInfo.jobTitle,
-						contactPerson: this.formInfo.contactPerson,
+						contactPerson: that.selectValue=='公司'?this.formInfo.contactPerson:(this.formInfo.userRealName||this.formInfo.contactNickName),
 						contactMethod: this.formInfo.contactMethod,
 						contactNickName: this.formInfo.contactNickName,
 						content: that.content,

+ 1 - 1
minePages/set.vue

@@ -48,7 +48,7 @@
 	  				 <uni-easyinput type="text" :clearable="false" v-model="userInfo.userRealName" placeholder="请输入姓名" />
 	  			</uni-forms-item>
 				<uni-forms-item label="联系方式" name="contactMethod">
-					 <uni-easyinput type="text" v-model="userInfo.contactMethod" placeholder="请输入手机号码/邮箱/微信" />
+					 <uni-easyinput type="text" v-model="userInfo.contactMethod" :clearable="false" placeholder="请输入手机号码/邮箱/微信" />
 				</uni-forms-item>
 				<uni-forms-item label="手机号" name="phone">
 					 <uni-easyinput type="text" disabled  v-model="userInfo.userName" placeholder=" " />

+ 27 - 14
pages/comm/comm.vue

@@ -182,7 +182,7 @@
     border-top-right-radius: 0;"
 													v-if="!showContact">
 													<button @click="linkTel()" style="border-radius:30px;color:#fff;background-color: #1d60b1;"><text
-															class="tn-icon-service" style="margin-right: 12px;"></text> 联系方</button>
+															class="tn-icon-service" style="margin-right: 12px;"></text> 联系方</button>
 													<!-- <view>联系我们帮助对接</view> -->
 													<button v-if="!collStatus" @click="addColl"
 														style="margin-top:10px;border-radius:30px;" type="default" plain="true"><text
@@ -196,7 +196,7 @@
 															class="tn-icon-send" style="margin-right: 12px;"></text>
 														转&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;发</button>
 												</view>
-												<view class="content bg-content" style="padding: 50px 36px;padding-bottom: 32px;font-size: 16px;width: calc(100vw - 52px);line-height: 24px;"
+												<view class="content bg-content" style="padding: 50px 36px;padding-bottom: 32px;font-size: 16px;width: calc(100vw - 52px);line-height: 24px; border-radius: 16px;border-top-right-radius: 0;"
 													v-if="showContact">
 													<view><text style="font-size: 20px;font-weight: bold;" v-if="curContact.company">{{curContact.company}}</text></view>
 													<view style="margin-top:20px;
@@ -400,7 +400,8 @@
 			addButton() {
 				if (!uni.getStorageSync('userNo')) {
 					uni.showToast({
-						title: '请登录'
+						title: '请登录',
+						icon:'none'
 					})
 					uni.navigateTo({
 						url: '/pages/login/login'
@@ -615,6 +616,7 @@
 					this.curItem = item;
 				}else{
 					this.curItem = {}
+					this.showSheet = false;
 					return false;
 				}
 				this.collStatus = false;
@@ -641,7 +643,8 @@
 
 				if (!uni.getStorageSync('userNo')) {
 					uni.showToast({
-						title: '请登录'
+						title: '请登录',
+						icon:'none'
 					})
 					uni.navigateTo({
 						url: '/pages/login/login'
@@ -676,7 +679,8 @@
 			addColl() {
 				if (!uni.getStorageSync('userNo')) {
 					uni.showToast({
-						title: '请登录'
+						title: '请登录',
+						icon:'none'
 					})
 					uni.navigateTo({
 						url: '/pages/login/login'
@@ -692,15 +696,17 @@
 				});
 				request.post('/slbCollect/add', params).then(res => {
 					if (res.success) {
-						that.$refs.toast.show({
+						that.showSheet = false;
+						that.curItem = {};
+						uni.showToast({
 						  title: '信息已收藏,请在我的收藏里查看阅读',
-						  image: '',
+						  icon: 'none',
 						  duration: 2000
 						})
-						that.showSheet = false;
 					} else {
 						uni.showToast({
-							title: res.msg
+							title: res.msg,
+							icon:'none'
 						})
 					}
 				})
@@ -712,15 +718,17 @@
 					id: that.collId
 				}).then(res => {
 					if (res.success) {
-						that.$refs.toast.show({
+						that.showSheet = false;
+						that.curItem = {};
+						uni.showToast({
 						  title: '此供应信息将不会保存在我的收藏里',
-						  image: '',
+						  icon: 'none',
 						  duration: 2000
 						})
-						that.showSheet = false;
 					} else {
 						uni.showToast({
-							title: res.msg
+							title: res.msg,
+							icon:'none'
 						})
 					}
 				})
@@ -751,7 +759,12 @@
 				this.searchProdValue2 = '';
 				uni.removeStorageSync('searchProdValue2');
 				this.fetchData();
-			}
+			},
+			showTel(tel){
+				uni.makePhoneCall({
+				  phoneNumber: tel,
+				});
+			},
 		}
 	}
 </script>

+ 30 - 15
pages/home/home.vue

@@ -361,6 +361,7 @@
 					this.curItem = item;
 				}else{
 					this.curItem = {}
+					this.showSheet = false;
 					return false;
 				}
 				
@@ -389,7 +390,8 @@
 
 				if (!uni.getStorageSync('userNo')) {
 					uni.showToast({
-						title: '请登录'
+						title: '请登录',
+						icon:'none'
 					})
 					uni.navigateTo({
 						url: '/pages/login/login'
@@ -425,7 +427,8 @@
 			addColl() {
 				if (!uni.getStorageSync('userNo')) {
 					uni.showToast({
-						title: '请登录'
+						title: '请登录',
+						icon:'none'
 					})
 					uni.navigateTo({
 						url: '/pages/login/login'
@@ -439,17 +442,23 @@
 					bisType: '1',
 					userNo: uni.getStorageSync('userNo'),
 				});
+				
 				request.post('/slbCollect/add', params).then(res => {
 					if (res.success) {
-						that.$refs.toast.show({
-						  title: '信息已收藏,请在我的收藏里查看阅读',
-						  image: '',
-						  duration: 2000
-						})
+						 
+						that.curItem = {}
 						that.showSheet = false;
+						 
+						 uni.showToast({
+						   title: '信息已收藏,请在我的收藏里查看阅读',
+						   icon:'none',
+						   duration: 2000
+						 });
+							 
 					} else {
 						uni.showToast({
-							title: res.msg
+							title: res.msg,
+							icon:'none'
 						})
 					}
 				})
@@ -457,19 +466,25 @@
 			},
 			delColl() {
 				let that = this;
+				
 				request.post('/slbCollect/del', {
 					id: that.collId
 				}).then(res => {
 					if (res.success) {
-						that.$refs.toast.show({
-						  title: '此需求信息将不会保存在我的收藏里',
-						  image: '',
-						  duration: 2000
-						})
-						that.showSheet = false;
+						that.curItem = {}
+						that.showSheet = false; 
+						
+						 
+							 wx.showToast({
+							   title: '此需求信息将不会保存在我的收藏里',
+							   icon:'none',
+							   duration: 2000
+							 });
+							  
 					} else {
 						uni.showToast({
-							title: res.msg
+							title: res.msg,
+							icon:'none'
 						})
 					}
 				})

+ 22 - 17
pages/index/autoLogin.vue

@@ -19,23 +19,7 @@
 		},
 		created() {			 
 			let that = this;
-			uni.login({
-				success(res) {
-					 that.loginByCode(res.code);
-				},
-				fail(res) {
-					//登录失效,
-					// uni.hideLoading();
-					// uni.redirectTo({
-					// 	url:'/pages/index/index'
-					// })
-				}
-			});
-		
-		},
-		methods: {
-			reLogin(){
-				let that = this;
+			if(!uni.getStorageSync('loginOut')){
 				uni.login({
 					success(res) {
 						 that.loginByCode(res.code);
@@ -48,6 +32,27 @@
 						// })
 					}
 				});
+			}
+			
+		
+		},
+		methods: {
+			reLogin(){
+				let that = this;
+				if(!uni.getStorageSync('loginOut')){
+					uni.login({
+						success(res) {
+							 that.loginByCode(res.code);
+						},
+						fail(res) {
+							//登录失效,
+							// uni.hideLoading();
+							// uni.redirectTo({
+							// 	url:'/pages/index/index'
+							// })
+						}
+					});
+				}
 			},
 			loginByCode(frontId) {
 				const that = this;

+ 19 - 13
pages/index/detail/detail.vue

@@ -352,7 +352,8 @@
 			
 				if (!uni.getStorageSync('userNo')) {
 					uni.showToast({
-						title: '请登录'
+						title: '请登录',
+						icon:'none'
 					})
 					uni.navigateTo({
 						url: '/pages/login/login'
@@ -388,7 +389,8 @@
 			addColl() {
 				if (!uni.getStorageSync('userNo')) {
 					uni.showToast({
-						title: '请登录'
+						title: '请登录',
+						icon:'none'
 					})
 					uni.navigateTo({
 						url: '/pages/login/login'
@@ -404,16 +406,16 @@
 				});
 				request.post('/slbCollect/add', params).then(res => {
 					if (res.success) {
-						that.$refs.toast.show({
+						that.showSheet = false;
+						uni.showToast({
 						  title: '信息已收藏,请在我的收藏里查看阅读',
-						  image: '',
+						  icon: 'none',
 						  duration: 2000
 						})
-						 
-						that.showSheet = false;
 					} else {
 						uni.showToast({
-							title: res.msg
+							title: res.msg,
+							icon:'none'
 						})
 					}
 				})
@@ -425,17 +427,16 @@
 					id: that.collId
 				}).then(res => {
 					if (res.success) {
-						
-						that.$refs.toast.show({
+						that.showSheet = false;
+						uni.showToast({
 						  title: '此'+(that.isNeed==1?'需求':'供应')+'信息将不会保存在我的收藏里',
-						  image: '',
+						  icon: 'none',
 						  duration: 2000
 						})
-						 
-						that.showSheet = false;
 					} else {
 						uni.showToast({
-							title: res.msg
+							title: res.msg,
+							icon:'none'
 						})
 					}
 				})
@@ -496,6 +497,11 @@
 							 
 				})
 			},
+			showTel(tel){
+				uni.makePhoneCall({
+				  phoneNumber: tel,
+				});
+			},
 		},
 		onLoad(props) {
 			 this.bisNo = props.id;

+ 39 - 3
pages/index/index.vue

@@ -148,7 +148,7 @@
 		},
 		onShow(options){
 			if (this.currentIndex === 3&&this.$refs.mine) {
-				this.$refs.mine.getContentRectInfo();
+				this.$refs.mine.fetchData();
 			}
 			if (this.currentIndex === 1&&this.$refs.comm) {
 				this.$refs.comm.fetchData();
@@ -160,13 +160,46 @@
 				//5*60s过期
 				if(new Date().getTime()-uni.getStorageSync('lastTime')>5*60*1000||!uni.getStorageSync('userNo')){
 					uni.setStorageSync('lastTime',new Date().getTime());
-					if(this.$refs.authRef){
-						this.$refs.authRef.reLogin();
+					if(this.$refs.authRef&&!uni.getStorageSync('loginOut')){
+						// this.$refs.authRef.reLogin();
 					}
 				}
 			}else{
 				uni.setStorageSync('lastTime',new Date().getTime())
 			}
+			
+			if (wx.canIUse('getUpdateManager')) {
+			  const updateManager = wx.getUpdateManager();
+			  updateManager && updateManager.onCheckForUpdate((res) => {
+			    if (res.hasUpdate) {
+			      updateManager.onUpdateReady(() => {
+			        uni.showModal({
+			          title: '更新提示',
+			          content: '新版本已经准备好,是否重启应用?',
+			          success: (res) => {
+			            if (res.confirm) {
+			              uni.clearStorageSync() // 更新完成后刷新storage的数据
+			              updateManager.applyUpdate()
+			            }
+			          }
+			        })
+			      })
+			
+			      updateManager.onUpdateFailed(() => {
+			    //     uni.showModal({
+			    //       title: '已有新版本上线',
+			    //       content: '小程序自动更新失败,请删除该小程序后重新搜索打开哟~~~',
+			    // showCancel: false
+			    //     })
+					uni.reLaunch({
+						url:'/pages/index/index'
+					})
+			      })
+			    } else {
+			      //没有更新
+			    }
+			  })
+			}
 		},
 		methods: {
 			// 切换导航
@@ -323,6 +356,9 @@
 				if (this.currentIndex === 2&&this.$refs.discovery) {
 					this.$refs.discovery.fetchData();
 				}
+				if (this.currentIndex === 3&&this.$refs.mine) {
+					this.$refs.mine.fetchData();
+				}
 			},
 			// 获取canvas实例和ctx画笔
 			  getMyCanvasAndCtx(id) {

+ 95 - 8
pages/login/login.vue

@@ -62,6 +62,8 @@
 				openId: '',
 				unionid: '',
 				canSave:true,
+				phoneNum:'',
+				tryTime:0
 			}
 		},
 		onLoad() {
@@ -78,7 +80,16 @@
 		},
 		methods: {
 			goBack() {
-				uni.navigateBack();
+				const pages = getCurrentPages()
+				// 有可返回的页面则直接返回,uni.navigateBack 默认返回失败之后会自动刷新页面 ,无法继续返回
+				if (pages.length > 1) {
+					uni.navigateBack()
+					return;
+				}else{
+					uni.navigateTo({
+						url: '/pages/index/index'
+					})
+				}
 			},
 			showToast() {
 				uni.showToast({
@@ -160,7 +171,7 @@
 				this.getLxSessionKey();
 				setTimeout(() => {
 					this._getPhoneNumber(e)
-				}, 1000)
+				}, 500)
 
 			},
 
@@ -176,8 +187,8 @@
 					wx.getUserInfo({
 						success: function(res) {
 							console.error(res);
-							res.encryptedData = encodeURIComponent(e.detail.encryptedData);
-							res.iv = encodeURIComponent(e.detail.iv);
+							res.encryptedData = encodeURIComponent(encodeURIComponent(e.detail.encryptedData));
+							res.iv = encodeURIComponent(encodeURIComponent(e.detail.iv));
 							res.lxSessionKey = that.lxSessionKey;
 							that.getPhone(res)
 						}
@@ -206,7 +217,10 @@
 				).then(res => {
 					console.error(res);
 					if (res&&res.success) {
-						this.ZhuceByPhone(res.resultMap.waUserPhoneInfo.phoneNumber);
+						//
+						that.phoneNum = res.resultMap.waUserPhoneInfo.phoneNumber;
+						that.loginFirst();
+						// this.ZhuceByPhone(res.resultMap.waUserPhoneInfo.phoneNumber);
 					} else {
 						uni.showToast({
 							title: res.msg,
@@ -253,6 +267,24 @@
 
 				console.warn(res);
 			},
+			//退出登录时,先自动登录一次,看用户绑定过没有,没有才去注册.
+			loginFirst(){
+				let that = this;
+				uni.showToast({
+					title: '请稍后',
+					icon: 'none'
+				})
+				that.canSave = false;
+				uni.login({
+					success(res) {
+						that.loginByCodeOnce(res.code);
+					},
+					fail(res) {
+				
+						uni.hideLoading();
+					}
+				});
+			},
 			loginAgain() {
 				let that = this;
 				uni.login({
@@ -265,7 +297,7 @@
 					}
 				});
 			},
-			loginByCode(frontId) {
+			loginByCodeOnce(frontId) {
 				const that = this;
 				uni.setStorageSync('loginStatus', 'false');
 				wx.getUserInfo({
@@ -287,6 +319,47 @@
 								uni.setStorageSync('loginStatus', 'true');
 								uni.setStorageSync('userMap', JSON.stringify(res2.resultMap));
 								uni.setStorageSync('userNo', res2.resultMap.accountName);
+								uni.removeStorageSync('loginOut');
+								that.getUserInfo();
+							} else {
+								//
+								
+								that.ZhuceByPhone(that.phoneNum)
+								// that.canSave = true;
+								
+								//登录失败,
+			
+			
+							}
+							console.error(res2);
+						});
+			
+			
+					}
+				})
+			},
+			loginByCode(frontId) {
+				const that = this;
+				uni.setStorageSync('loginStatus', 'false');
+				wx.getUserInfo({
+					success: function(res) {
+						console.error(res);
+						request.post("/slbMpAutoLogin", {
+							code: frontId,
+							appType: 'ma',
+							encryptedData: res.encryptedData,
+							iv: res.iv
+						}, {
+							login: false,
+							warn: false,
+							loading: false
+						}).then(res2 => {
+							if (res2.success) {
+								//登录成功
+								uni.setStorageSync('loginStatus', 'true');
+								uni.setStorageSync('userMap', JSON.stringify(res2.resultMap));
+								uni.setStorageSync('userNo', res2.resultMap.accountName);
+								uni.removeStorageSync('loginOut');
 								that.getUserInfo();
 								
 							} else {
@@ -314,11 +387,25 @@
 
 				}).then(res => {
 					that.canSave = true;
-					if (res.success) {
+					if (res&&res.success) {
+						that.tryTime = 0;
 						that.personInfo = res.resultMap.userInfo || {};
 						uni.setStorageSync('userInfo', JSON.stringify(res.resultMap.userInfo));
-						uni.navigateBack();
+						that.goBack();
+					}else{
+						that.tryTime++;
+						if(that.tryTime<5){
+							setTimeout(()=>{
+								that.loginAgain()
+							},500)
+						}else{
+							uni.showToast({
+								title: '登录超时,请再试一次',
+								icon: 'none'
+							})
+						}
 					}
+					// uni.navigateBack();
 					console.warn(res);
 				})
 

+ 43 - 171
pages/login/loginByCode.vue

@@ -55,8 +55,7 @@
 		</view>
 
 		<view class="" hover-class="button-hover" style="margin-top: 24px;" v-if="agreeValue">
-			<button :disabled="!canSave" style="border-radius: 50rpx;width: 100%;background-color: #1d60b1;" type="primary" @click="saveForm"
-				@getphonenumber="getPhoneNumber">登录</button>
+			<button :disabled="!canSave" style="border-radius: 50rpx;width: 100%;background-color: #1d60b1;" type="primary" @click="saveForm">登录</button>
 		</view>
 		<view class=""  hover-class="button-hover" style="margin-top: 24px;" v-if="!agreeValue">
 			<button :disabled="!canSave" style="border-radius: 50rpx;width: 100%;background-color: #1d60b1;" type="primary" @click="showToast">登录</button>
@@ -89,11 +88,11 @@
 				unionid: '',
 				canSave:true,
 				seconds:0,
+				tryTime:0
 			}
 		},
 		onLoad() {
 
-			// this.getLxSessionKey()
 		},
 		onShow(){
 			if(uni.getStorageSync('agreeInfo')){
@@ -106,7 +105,16 @@
 		},
 		methods: {
 			goBack() {
-				uni.navigateBack();
+				const pages = getCurrentPages()
+				// 有可返回的页面则直接返回,uni.navigateBack 默认返回失败之后会自动刷新页面 ,无法继续返回
+				if (pages.length > 1) {
+					uni.navigateBack()
+					return;
+				}else{
+					uni.navigateTo({
+						url: '/pages/index/index'
+					})
+				}
 			},
 			getCode(){
 				if(!this.baseFormData.userName){
@@ -120,14 +128,14 @@
 				if(this.seconds>0){
 					return false;
 				}else{
-					if(!this.agreeValue){
-						uni.showToast({
-							title: '请先阅读并同意协议',
-							icon: 'none'
-						})
-						wx.vibrateShort();
-						return false;
-					}
+					// if(!this.agreeValue){
+					// 	uni.showToast({
+					// 		title: '请先阅读并同意协议',
+					// 		icon: 'none'
+					// 	})
+					// 	wx.vibrateShort();
+					// 	return false;
+					// }
 					this.seconds = 60;
 					this.getCodeByPhone();
 					 
@@ -210,6 +218,7 @@
 						 uni.setStorageSync('loginStatus', 'true');
 						 uni.setStorageSync('userMap', JSON.stringify(res.resultMap));
 						 uni.setStorageSync('userNo', res.resultMap.accountName);
+						 uni.removeStorageSync('loginOut');
 						 that.getUserInfo();
 					}else{
 						uni.showToast({
@@ -245,162 +254,7 @@
 					url:'/pages/login/login'
 				})
 			},
-			change(e) {
-				this.value = e.detail.data.length == 0 ? [] : [0];
-				console.warn(this.value);
-				console.log('e:', e);
-			},
-			getLxSessionKey() {
-				const that = this;
-				uni.login({
-					success(res) {
-						console.error(res);
-						that.getOpenId(res.code);
-					},
-					fail(res) {
-						console.error(res);
-						uni.hideLoading();
-					}
-				});
-			},
-			getOpenId(code) {
-				const that = this;
-				request.post('/wxma/code2Session', {
-					code: code,
-					platType: "slb",
-					mpType: "engineer",
-				}).then(res => {
-					console.error(res);
-					if (res.success) {
-						that.lxSessionKey = res.resultMap.lxSessionKey;
-						that.openId = res.resultMap.openId;
-						that.unionid = res.resultMap.unionid;
-					}
-
-				})
-
-			},
-			getPhoneNumber(e) {
-				if (!e.detail.errMsg || e.detail.errMsg != "getPhoneNumber:ok") {
-					// wx.showModal({
-					// 	title: '提示',
-					// 	content: e.detail.errMsg,
-					// 	showCancel: false
-					// })
-					console.error(e)
-					return;
-				}
-				this.getLxSessionKey();
-				setTimeout(() => {
-					this._getPhoneNumber(e)
-				}, 1000)
-
-			},
-
-
-
-
-			_getPhoneNumber(e) {
-				console.warn(e);
-				let that = this;
-
-
-				if (e.detail.errMsg === 'getPhoneNumber:ok') {
-					wx.getUserInfo({
-						success: function(res) {
-							console.error(res);
-							res.encryptedData = encodeURIComponent(e.detail.encryptedData);
-							res.iv = e.detail.iv;
-							res.lxSessionKey = that.lxSessionKey;
-							that.getPhone(res)
-
-
-						}
-					})
-				} else {
-					uni.showToast({
-						icon: 'none',
-						title: e.detail.code ? '获取成功' : '拒绝了使用微信手机号'
-					});
-				}
-
-
-				// if (res.code == 0) {
-				// 	uni.showToast({
-				// 		title: '绑定成功',
-				// 		icon: 'success',
-				// 		duration: 2000
-				// 	})
-				// 	this.$u.vuex('mobile', res.data)
-				// 	this.form.mobile = res.data
-				// } else {
-				// 	uni.showModal({
-				// 		title: '提示',
-				// 		content: res.msg,
-				// 		showCancel: false
-				// 	})
-				// }
-			},
-
-			getPhone(prarms) {
-				let newParams = {};
-				newParams.signature = prarms.signature;
-				newParams.rawData = prarms.rawData;
-				newParams.encryptedData = prarms.encryptedData;
-				newParams.iv = prarms.iv;
-				newParams.lxSessionKey = prarms.lxSessionKey;
-
-				let that = this;
-
-				request.post('/wxma/getWaUserPhone',
-					newParams
-
-				).then(res => {
-					console.error(res);
-					if (res.success) {
-						this.ZhuceByPhone(res.resultMap.waUserPhoneInfo.phoneNumber);
-					} else {
-						uni.showToast({
-							title: res.msg,
-							icon: 'none'
-						})
-					}
-				});
-			},
-			async ZhuceByPhone(phone) {
-				const that = this;
-				let params = {
-					phone: phone,
-					openid: that.openId,
-					unionid: that.unionid,
-
-				};
-				that.canSave = false;
-				const res = await request.post('/wxma/register',
-					params, {
-						header: {
-							'content-type': 'application/x-www-form-urlencoded',
-							platType: "slb",
-							mpType: "engineer",
-						}
-					}
-				);
-
-				if (res.success) {
-					//当前页直接登录
-					// uni.navigateTo({
-					//     url:'/pages/index/auth'
-					// })
-					this.loginAgain();
-				} else {
-					uni.showToast({
-						title: res.msg,
-						icon: 'none'
-					})
-				}
-
-				console.warn(res);
-			},
+ 
 			loginAgain() {
 				let that = this;
 				uni.login({
@@ -460,12 +314,30 @@
 
 				}).then(res => {
 					that.canSave = true;
-					if (res.success) {
+					if (res&&res.success) {
+						that.tryTime = 0;
 						that.personInfo = res.resultMap.userInfo || {};
 						uni.setStorageSync('userInfo', JSON.stringify(res.resultMap.userInfo));
-						uni.navigateBack();
+						that.goBack();
+					}else{
+						that.tryTime++;
+						if(that.tryTime<5){
+							setTimeout(()=>{
+								that.loginAgain()
+							},500)
+						}else{
+							uni.showToast({
+								title: '登录超时,请再试一次',
+								icon: 'none'
+							})
+						}
 					}
-					console.warn(res);
+					// if (res.success) {
+					// 	that.personInfo = res.resultMap.userInfo || {};
+					// 	uni.setStorageSync('userInfo', JSON.stringify(res.resultMap.userInfo));
+					// }
+					// uni.navigateBack();
+					// console.warn(res);
 				})
 
 			},

+ 26 - 3
pages/mine/coll.vue

@@ -186,7 +186,7 @@ aspectFill		:src="image_item.ftpUrl" mode="aspectFill" @click="showImg(item.imgL
 															class="tn-icon-send" style="margin-right: 12px;"></text>
 														转&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;发</button>
 												</view>
-												<view class="content bg-content" style="padding: 50px 36px;padding-bottom: 32px;font-size: 16px;width: calc(100vw - 52px);line-height: 24px;"
+												<view class="content bg-content" style="padding: 50px 36px;padding-bottom: 32px;font-size: 16px;width: calc(100vw - 52px);line-height: 24px;border-radius: 16px;border-top-right-radius: 0;"
 													v-if="showContact">
 													<view><text style="font-size: 20px;font-weight: bold;" v-if="curContact.company">{{curContact.company}}</text></view>
 																	<view style="margin-top:20px;
@@ -315,11 +315,27 @@ import {
 
 		},
 		onShow() {
+			if(!uni.getStorageSync('userNo')){
+				//去登录
+				uni.navigateTo({
+				  url: '/pages/login/login',
+				});
+				return false;
+			}
 			this.loadData();
 		},
 		methods: {
 			goBack() {
-				uni.navigateBack();
+				const pages = getCurrentPages()
+				// 有可返回的页面则直接返回,uni.navigateBack 默认返回失败之后会自动刷新页面 ,无法继续返回
+				if (pages.length > 1) {
+					uni.navigateBack()
+					return;
+				}else{
+					uni.navigateTo({
+						url: '/pages/index/index'
+					})
+				}
 			},
 			change(index) {
 				this.current = index;
@@ -339,7 +355,7 @@ import {
 
 				}).then(res => {
 					let newList = res.list || [];
-					if (res.success) {
+					if (res&&res.success) {
 						let cList = [];
 						for (let i = 0; i < newList.length; i++) {
 							if (newList[i].fkBisMap) {
@@ -357,6 +373,12 @@ import {
 						}
 						that.content = cList;
 					}
+					if(res._redirect){
+						uni.navigateTo({
+						  url: '/pages/login/login',
+						});
+						return false;
+					}
 
 					if (newList.length == 0) {
 						that.showEmpty = true;
@@ -455,6 +477,7 @@ import {
 					this.curItem = item;
 				}else{
 					this.curItem = {}
+					this.showSheet = false;
 					return false;
 				}
 				

+ 116 - 10
pages/mine/mine.vue

@@ -125,8 +125,17 @@
       <view class="tn-flex tn-flex-row-between tn-bg-white about-shadow tn-margin-top-xl">
         <view class="tn-padding-sm tn-margin-xs" @click="tn('/pages/mine/need')">
           <view class="tn-flex tn-flex-direction-column tn-flex-row-center tn-flex-col-center tn-margin-left">
-            <view class="icon15__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-shadow-blur" style="background-color: #F3F2F7;color: #7C8191;">
-              <view class="tn-icon-like"></view>
+            <view class="icon15__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-shadow-blur" style="background-color: #F3F2F7;color: #7C8191;position: relative;">
+              <!-- <tn-badge absolute="true" v-if="needNum>0">
+				<span style="color: #fff;font-size: 11px;
+						background: #E83A30;
+						width: 20px;
+						height: 20px;
+						text-align: center;
+						border-radius: 20px;
+						line-height: 20px;">{{needNum}}</span>
+			  </tn-badge> -->
+			  <view class="tn-icon-like"></view>
             </view>  
             <view class="tn-text-center">
               <text class="tn-text-ellipsis">我的需求</text>
@@ -135,8 +144,17 @@
         </view>
         <view class="tn-padding-sm tn-margin-xs" @click="tn('/pages/mine/share')">
           <view class="tn-flex tn-flex-direction-column tn-flex-row-center tn-flex-col-center">
-            <view class="icon15__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-shadow-blur" style="background-color: #F3F2F7;color: #7C8191;">
-              <view class="tn-icon-share-triangle"></view>
+            <view class="icon15__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-shadow-blur" style="background-color: #F3F2F7;color: #7C8191;position: relative;">
+              <!-- <tn-badge absolute="true" v-if="shareNum>0">
+				<span style="color: #fff;font-size: 11px;
+						background: #E83A30;
+						width: 20px;
+						height: 20px;
+						text-align: center;
+						border-radius: 20px;
+						line-height: 20px;">{{shareNum}}</span>
+              </tn-badge> -->
+			  <view class="tn-icon-share-triangle"></view>
             </view>  
             <view class="tn-text-center">
               <text class="tn-text-ellipsis">我的供应</text>
@@ -221,7 +239,7 @@
 		  <view class="tn-flex tn-flex-col-center">
 		    <view
 		      class="icon1__item--icon tn-flex tn-flex-row-center tn-flex-col-center" style="color: #7C8191;">
-		      <view class="tn-icon-logout"></view>
+		      <view class="tn-icon-my-reduce"></view>
 		    </view>
 		    <view class="tn-margin-left-sm tn-flex-1">注销账户</view>
 		    <view class="tn-color-gray tn-icon-right"></view>
@@ -229,6 +247,21 @@
 		</tn-list-cell>
 		 
       </view>
+	  
+	  <view class="about-shadow tn-margin-top-lg tn-margin-bottom-lg tn-padding-top-sm tn-padding-bottom-sm"  v-if="!showLogin">
+	    
+	  		<tn-list-cell :hover="true" :unlined="true" :radius="true" :fontSize="30" @click="showLogout()">
+	  		  <view class="tn-flex tn-flex-col-center">
+	  		    <view
+	  		      class="icon1__item--icon tn-flex tn-flex-row-center tn-flex-col-center" style="color: #7C8191;">
+	  		      <view class="tn-icon-logout"></view>
+	  		    </view>
+	  		    <view class="tn-margin-left-sm tn-flex-1">退出登录</view>
+	  		    <view class="tn-color-gray tn-icon-right"></view>
+	  		  </view>
+	  		</tn-list-cell>
+	  		 
+	  </view>
 
     </view>
 	<uni-popup ref="alertDialog" type="dialog">
@@ -251,7 +284,9 @@
       return {
 		  personInfo: uni.getStorageSync('userInfo')?JSON.parse(uni.getStorageSync('userInfo')):{},
 		  showLogin: false,
-		  msgType:''
+		  msgType:'',
+		  shareNum:0,
+		  needNum:0
       }
     },
 	onReady() {
@@ -259,16 +294,33 @@
 	  this.$nextTick(() => {
 		  if(!uni.getStorageSync('userNo')){
 		  	this.showLogin = true;
+			return false;
+		  }
+		  if(!uni.getStorageSync('loginOut')){
+			this.getContentRectInfo()
+			// this.loadNum();
+			// this.loadNum2();
 		  }
-	    this.getContentRectInfo()
 	  })
 	  
 	},
 	 
     methods: {
+		fetchData(){
+			if(!uni.getStorageSync('userNo')){
+				this.showLogin = true;
+				return false;
+			}
+			if(!uni.getStorageSync('loginOut')){
+				this.getContentRectInfo()
+				// this.loadNum();
+				// this.loadNum2();
+			}
+		},
        // 获取内容容器的信息
        getContentRectInfo() {
        		  let that = this;
+			  
        		  request.post('/slbWxma/getPersonlInfo', {
        		  	 
        		  }).then(res => {
@@ -282,7 +334,29 @@
        		  })
           
        },
-
+	   loadNum(){
+		   let that = this;
+		   
+		   request.post('/slbResourceDemand/show/my', {
+		   	 
+		   }).then(res => {
+			  if(res&&res.resultMap){
+				   that.needNum = res.resultMap.passNum||0
+			  }
+		   })
+	   },
+	   loadNum2(){
+	   		   let that = this;
+	   		   
+	   		   request.post('/slbResourceShare/show/my', {
+	   		   	 
+	   		   }).then(res => {
+	   			  if(res&&res.resultMap){
+	   				   that.shareNum = res.resultMap.passNum||0
+	   			  }
+	   		   })
+	   },
+	  
 
       // 跳转
       tn(e) {
@@ -355,9 +429,32 @@
 				}
 		 		
 		 	}
-		 })
+		 })		 
+	  },
+	  showLogout(){
+		 let that = this;
 		 
-					 
+		 uniShowModal('确定退出登录吗?', '', {
+			showCancel: true,
+		 	success: (res) => {
+				console.error(res);
+				if(res.confirm){
+					 uni.setStorageSync('loginStatus', 'false');
+					 uni.setStorageSync('loginOut', 'true');
+					 uni.removeStorageSync('userMap');
+					 uni.removeStorageSync('userNo');
+					 uni.removeStorageSync('userInfo');
+					 that.showLogin = true;
+					 that.shareNum = 0;
+					 that.needNum = 0;
+					 that.personInfo = {};
+					 // uni.reLaunch({
+					 // 	url:'/pages/index/index'
+					 // })
+				}
+		 		
+		 	}
+		 })		 
 	  },
 	  //注销
 	  logOff(){
@@ -366,6 +463,15 @@
 			  userNo: uni.getStorageSync('userNo'),
 		  }).then(res => {
 		  	if (res&&res.success) {
+				 uni.setStorageSync('loginStatus', 'false');
+				 uni.setStorageSync('loginOut', 'true');
+				 uni.removeStorageSync('userMap');
+				 uni.removeStorageSync('userNo');
+				 uni.removeStorageSync('userInfo');
+				 that.showLogin = true;
+				
+				 that.personInfo = {};
+				 
 		  		 uni.showToast({
 		  		 	title: '注销成功',
 		  		 	icon: 'none'

+ 1 - 1
tuniao-ui/components/tn-badge/tn-badge.vue

@@ -152,7 +152,7 @@
     background-color: #FFFFFF;
     // color: #FFFFFF;
     border-radius: 100rpx;
-    padding: 4rpx 8rpx;
+    padding: 4rpx 12rpx;
     line-height: initial;
     
     &--dot {

File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/circlePages/addShare.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/common/main.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/common/vendor.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/minePages/set.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/comm/comm.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/home/home.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/index/index.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/login/login.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/mine/coll.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/mine/mine.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/mine/share.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/tuniao-ui/components/tn-badge/tn-badge.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/mp-weixin/circlePages/addShare.js


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/mp-weixin/common/main.js


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/mp-weixin/common/vendor.js


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/mp-weixin/minePages/set.wxml


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/comm/comm.js


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/comm/comm.wxml


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/home/home.js


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/index/index.js


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/login/login.js


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/mine/coll.js


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/mine/coll.wxml


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/mine/mine.js


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/mine/mine.wxml


+ 1 - 1
unpackage/dist/dev/mp-weixin/tuniao-ui/components/tn-badge/tn-badge.wxss

@@ -15,7 +15,7 @@
   font-size: 20rpx;
   background-color: #FFFFFF;
   border-radius: 100rpx;
-  padding: 4rpx 8rpx;
+  padding: 4rpx 12rpx;
   line-height: initial;
 }
 .tn-badge--dot.data-v-494ae17c {

+ 10 - 6
utils/request.js

@@ -95,8 +95,12 @@ function baseRequest(config, options) {
 			try{
 			  
 			  var cookie = res.header["set-cookie"]||res.header["Set-Cookie"];
-			  let frontlixiangsid = getCookie(cookie,"frontlixiangsid")||res.resultMap.frontlixiangsid;
-			   console.log('cookie',frontlixiangsid);
+			  let frontId = res.data.resultMap?(res.data.resultMap.frontlixiangsid||''):'';
+			  let frontlixiangsid = getCookie(cookie,"frontlixiangsid")||frontId;
+			  
+			   if(frontlixiangsid=='deleteMe'&&frontId){
+				   frontlixiangsid = frontId;
+			   }
 			 if(frontlixiangsid&&frontlixiangsid!='deleteMe'){
 				 // uni.setStorageSync('frontlixiangsid',frontlixiangsid)
 						  store.state.token = frontlixiangsid;
@@ -244,11 +248,11 @@ const loadingStatus = (loading, type) => {
 	if (loading) {
 		if (type) {
 			// loadingToast('正在请求中');
-			setTimeout(function () {
-			   uniHideLoading();
-			}, 5000);//防水异常加载不关闭影响操作
+			// setTimeout(function () {
+			//    uniHideLoading();
+			// }, 5000);//防水异常加载不关闭影响操作
 		} else {
-			uniHideLoading();
+			// uniHideLoading();
 		}
 	} else {
 		return