Browse Source

fix: 优化238

ldong 6 months ago
parent
commit
c2c3b1166a

+ 5 - 0
mixin/questionMixin.js

@@ -350,6 +350,11 @@ export default {
                 }
             }
         },
+		handleGoLogin(){
+			uni.navigateTo({
+			  url:'/pages/login?from=tologin'
+			})
+		},
         //申请权限
         async handleGoApply(){
             await this.checkUserIsBind()

+ 6 - 2
pages-report/chapterDetail.vue

@@ -9,13 +9,17 @@ export default {
   data() {
     return {
       url:'',
-      msgObj:{}
+      msgObj:{},
+	  options:{}
     };
   },
   onLoad(options) {
-    this.init(options)
+	this.options=options
     wx.setVisualEffectOnCapture({visualEffect:'hidden'})
   },
+  onShow(){
+	 this.init(this.options) 
+  },
   onUnload(){
     wx.setVisualEffectOnCapture({visualEffect:'none'})
   },

+ 6 - 2
pages-report/reportDetail.vue

@@ -9,13 +9,17 @@ export default {
     data () {
         return {
             url:'',
-            msgObj:{}
+            msgObj:{},
+			options:{}
         }
     },
     onLoad(options) {
-        this.init(options)
+        this.options=options
         wx.setVisualEffectOnCapture({visualEffect:'hidden'})
     },
+	onShow(){
+		this.init(this.options)
+	},
     onUnload(){
         wx.setVisualEffectOnCapture({visualEffect:'none'})
     },

+ 12 - 4
pages/login.vue

@@ -83,6 +83,7 @@ import { telVerify, emailVerify } from '@/utils/common'
 export default {
     data() {
         return {
+			fromType:'',//小程序登录跳转前类型
             active: "手机号",
             telAreaList: [], //手机号区号
             telAreaIndex: 0, //选择手机号区号第几个
@@ -93,8 +94,11 @@ export default {
             countDownTime: 60 * 1000,//倒计时60秒
         };
     },
-    onLoad(){
+    onLoad(options){
         this.getPhoneAreaNumList()
+		if(options.from){
+			this.fromType=options.from
+		}
     },
     onShow(){
         uni.hideHomeButton({
@@ -213,9 +217,13 @@ export default {
 
             const res = await apiUserLogin(params)
             if (res.code === 200) {
-                uni.switchTab({
-                    url: '/pages/report/report'
-                })
+				if(this.fromType){
+					uni.navigateBack()
+				}else{
+					uni.switchTab({
+						url: '/pages/report/report'
+					})
+				}
                 this.$store.dispatch('getUserInfo')
                 this.$store.dispatch('getTabBar')
             }

+ 16 - 7
pages/question/question.vue

@@ -115,13 +115,19 @@
 		<template v-else>
 			<view class="noAuth-wrap">
 				<image class="img" :src="globalImgUrls.activityNoAuth" mode="widthFix"></image>
-				<view class="auth-text">您暂无权限查看问答社区</view>
-				<view class="auth-text" v-if="noAuthInfo.type==='contact'">若想查看可以联系对口销售</view>
-				<view class="auth-text" v-else>若想查看可以申请开通</view>
-				<view class="auth-text" v-if="noAuthInfo.type==='contact'">
-				{{noAuthInfo.name||''}}:<text @click="handleCallPhone(noAuthInfo.mobile+'')">{{noAuthInfo.mobile||''}}</text>
-				</view>
-				<view class="global-btn-yellow-change btn" @click="handleGoApply" v-else>立即申请</view>
+				<template v-if="momentUser&&momentUser.is_bind==0">
+					<view class="auth-text">您尚未登录,请登录后查看更多信息</view>
+					<view class="global-btn-yellow-change btn" @click="handleGoLogin">立即登录</view>
+				</template>
+				<template v-else>
+					<view class="auth-text" style="margin-bottom:15px">您暂无权限查看问答社区</view>
+					<view class="auth-text" style="margin-bottom:15px" v-if="noAuthInfo.type==='contact'">若想查看可以联系对口销售</view>
+					<view class="auth-text" style="margin-bottom:15px" v-else>若想查看可以申请开通</view>
+					<view class="auth-text" v-if="noAuthInfo.type==='contact'">
+					{{noAuthInfo.name||''}}:<text @click="handleCallPhone(noAuthInfo.mobile+'')">{{noAuthInfo.mobile||''}}</text>
+					</view>
+					<view class="global-btn-yellow-change btn" @click="handleGoApply" v-else>立即申请</view>
+				</template>
 			</view>
 		</template>
 		<!-- 弹窗 -->
@@ -260,6 +266,9 @@ export default {
 		}
 	},
 	computed:{
+		momentUser() {
+		  return this.$store.state.user.userInfo;
+		},
 		showAudioPop(){//是否显示音频弹窗
             return this.$store.state.audio.show
         },

+ 24 - 8
pages/roadShow/video/components/noAuth.vue

@@ -1,13 +1,19 @@
 <template>
   <view class="voice-no-auth">
         <image class="img" :src="globalImgUrls.activityNoAuth" mode="widthFix"></image>
-		<view style="margin-bottom:15px">您暂无权限查看线上路演</view>
-		<view v-if="info.type==='contact'" style="margin-bottom:15px">若想查看可以联系对口销售</view>
-		<view v-else style="margin-bottom:15px">若想查看可以申请开通</view>
-		<view v-if="info.type==='contact'">
-			{{info.name||''}}:<text @click="handleCall" style="color:#E3B377">{{info.mobile||''}}</text>
-		</view>
-		<view class="global-btn-yellow-change btn" @click="handleApply" v-else style="margin-top:30px">立即申请</view>
+		<template v-if="userInfo&&userInfo.is_bind==0">
+			<view style="margin-bottom:15px">您尚未登录,请登录后查看更多信息</view>
+			<view class="global-btn-yellow-change btn" @click="handleGoLogin">立即登录</view>
+		</template>
+		<template v-else>
+			<view style="margin-bottom:15px">您暂无权限查看线上路演</view>
+			<view v-if="info.type==='contact'" style="margin-bottom:15px">若想查看可以联系对口销售</view>
+			<view v-else style="margin-bottom:15px">若想查看可以申请开通</view>
+			<view v-if="info.type==='contact'">
+				{{info.name||''}}:<text @click="handleCall" style="color:#E3B377">{{info.mobile||''}}</text>
+			</view>
+			<view class="global-btn-yellow-change btn" @click="handleApply" v-else style="margin-top:30px">立即申请</view>
+		</template>
   </view>
 </template>
 
@@ -22,7 +28,11 @@ export default {
             this.handleAutoApply()
         }
     },
-    
+	computed: {
+		userInfo() {
+		  return this.$store.state.user.userInfo;
+		}
+	},
     methods: {
         handleCall(){
 
@@ -49,6 +59,12 @@ export default {
                 }
             }
         },
+		
+		handleGoLogin(){
+			uni.navigateTo({
+			  url:'/pages/login?from=tologin'
+			})
+		},
 
         async handleApply(){
             await this.checkUserIsBind()

+ 2 - 0
pages/roadShow/video/list.vue

@@ -161,6 +161,8 @@ export default {
         }
     },
     onLoad(options){
+		
+		console.log(this.$store)
         this.init(options)
         this.getPermissionList()
     },

+ 24 - 8
pages/voice/components/noAuth.vue

@@ -1,13 +1,19 @@
 <template>
   <view class="voice-no-auth">
         <image class="img" :src="globalImgUrls.activityNoAuth" mode="widthFix"></image>
-		<view style="margin-bottom:15px">您暂无权限查看语音播报</view>
-		<view v-if="info.type==='contact'" style="margin-bottom:15px">若想查看可以联系对口销售</view>
-		<view v-else style="margin-bottom:15px">若想查看可以申请开通</view>
-		<view v-if="info.type==='contact'">
-			{{info.name||''}}:<text @click="handleCall" style="color:#E3B377">{{info.mobile||''}}</text>
-		</view>
-		<view class="global-btn-yellow-change btn" @click="handleApply" v-else style="margin-top:30px">立即申请</view>
+		<template v-if="userInfo&&userInfo.is_bind==0">
+			<view style="margin-bottom:15px">您尚未登录,请登录后查看更多信息</view>
+			<view class="global-btn-yellow-change btn" @click="handleGoLogin">立即登录</view>
+		</template>
+		<template v-else>
+			<view style="margin-bottom:15px">您暂无权限查看语音播报</view>
+			<view v-if="info.type==='contact'" style="margin-bottom:15px">若想查看可以联系对口销售</view>
+			<view v-else style="margin-bottom:15px">若想查看可以申请开通</view>
+			<view v-if="info.type==='contact'">
+				{{info.name||''}}:<text @click="handleCall" style="color:#E3B377">{{info.mobile||''}}</text>
+			</view>
+			<view class="global-btn-yellow-change btn" @click="handleApply" v-else style="margin-top:30px">立即申请</view>
+		</template>
   </view>
 </template>
 
@@ -22,7 +28,11 @@ export default {
             this.handleAutoApply()
         }
     },
-    
+    computed: {
+    	userInfo() {
+    	  return this.$store.state.user.userInfo;
+    	}
+    },
     methods: {
         handleCall(){
 
@@ -49,6 +59,12 @@ export default {
                 }
             }
         },
+		
+		handleGoLogin(){
+			uni.navigateTo({
+			  url:'/pages/login?from=tologin'
+			})
+		},
 
         async handleApply(){
             await this.checkUserIsBind()

+ 1 - 1
utils/config.js

@@ -8,7 +8,7 @@ let pcBaseUrl=''//pc页面根路径
 if(env.envVersion==='develop'){//开发
     baseApiUrl='http://8.136.199.33:8612/api'
     h5BaseUrl='https://xcxh5test.hzinsights.com/xcx_h5'
-	// h5BaseUrl='http://192.168.77.5:3000/xcx_h5'
+	// h5BaseUrl='http://192.168.77.18:3000/xcx_h5'
     pcBaseUrl='https://ybpctest.hzinsights.com'
 }else if(env.envVersion==='trial'){//体验版
     baseApiUrl='https://ybpctest.hzinsights.com/api'