Browse Source

舌诊反复登录bug修复

XSLu08042 2 days ago
parent
commit
687c0242f5

+ 12 - 12
components/CustomCamera/WeChat/Layout.vue

@@ -38,19 +38,19 @@
 				isLogin: false
 			}
 		},
-		onShow() {
-			this.$isLogin().then(
-				res => {
-					if(res){
-						this.isLogin = true
-						this.getCount()
-					} else{
-						this.isLogin = false
-					}
-				}
-			);
-		},
 		methods: {
+			initShow() {
+				this.$isLogin().then(
+					res => {
+						if(res){
+							this.isLogin = true
+							this.getCount()
+						} else{
+							this.isLogin = false
+						}
+					}
+				);
+			},
 			switchCamera(){
 				if(!this.isLogin){
 					uni.navigateTo({

+ 4 - 1
components/CustomCamera/WeChat/index.vue

@@ -1,5 +1,5 @@
 <template>
-	<Layout @instruct="handleInstruct" @switchCamera="switchCamera()" @takePhoto="takePhoto" >
+	<Layout ref="Layout" @instruct="handleInstruct" @switchCamera="switchCamera()" @takePhoto="takePhoto" >
 		<camera class="camera"  mode="normal" :device-position="device" @error="error"
 			style="width: 100%; height: 100%;">
 			<cover-view class="cover-view">
@@ -63,6 +63,9 @@
 			// this.coverImage = '/static/images/portrait.jpg'
 		},
 		methods: {
+			initShow() {
+				this.$refs.Layout.initShow()
+			},
 			navTo() {
 				uni.navigateTo({
 					url: "/pages_user/tongue/ques"

+ 5 - 0
pages_user/tongue/index.vue

@@ -20,6 +20,11 @@
 		onLoad(options) {
 			this.coverImageType = options.coverImageType
 		},
+		onShow() {
+			this.$nextTick(()=>{
+				this.$refs.CustomCamera.initShow()
+			})
+		},
 		onShareAppMessage(res) {
 			return {
 				title: "AI舌诊",