zhengkaixin 6 meses atrás
pai
commit
b77675437e

+ 2 - 13
apis/utils/init.js

@@ -140,19 +140,8 @@ var app = {
 					carhelp.setOpenId(response.data.openid)
 					openId = response.data.openid;
 					carhelp.set("xpgj_wx_user_info",response.data)
-					if(bl&&uid){
-						API_WeiXin.saveWechatInfo({
-							openId:openId,
-							 unionId:uid
-						}).then(response => {
-							
-							 location.reload();
-						}).catch(error => {
-							console.log(error);
-						});
-					}else{
-						 location.reload();
-					}
+					
+					 location.reload();
 					
 				}).catch(error => {
 					console.log(error);

+ 10 - 7
uni_modules/uview-ui/components/u-navbar/u-navbar.vue

@@ -252,13 +252,16 @@
 				}
 			},
 			goBack() {
-				const jpuid = getUrlParam('unionid');
-				if(jpuid){
-					//window.location.href=process.car.BACK_URL
-					//document.referrer
-					
-					window.history.back()
-					//'https://xpgj.hbjp.com.cn/prod/jp-property-platform/index/#/master/'
+				
+				 if ('prodv4'==process.car.NODE_ENV) {
+				
+					if (typeof this.customBack === 'function') {
+						// 在微信,支付宝等环境(H5正常),会导致父组件定义的customBack()函数体中的this变成子组件的this
+						// 通过bind()方法,绑定父组件的this,让this.customBack()的this为父组件的上下文
+						this.customBack.bind(this.$u.$parent.call(this))();
+					} else {
+						window.history.back()
+					}
 				}else{
 					// 如果自定义了点击返回按钮的函数,则执行,否则执行返回逻辑
 					if (typeof this.customBack === 'function') {