Browse Source

修改bug

wangxy 4 days ago
parent
commit
c8a42dc1a0
1 changed files with 28 additions and 0 deletions
  1. 28 0
      pages/Login/clientIndex.vue

+ 28 - 0
pages/Login/clientIndex.vue

@@ -10,6 +10,11 @@
 				<button class="wechat-auth-btn" open-type="getPhoneNumber" @getphonenumber="onWechatAuth">
 					微信一键登录
 				</button>
+
+        <button @click="handleChangeFangshi">
+          切换微信一键登录
+        </button>
+
 			</view>
 		<!-- 	<view @click="ceshi" class="auth-tips">欢迎使用小程序12312312312312</view> -->
 		</view>
@@ -163,6 +168,29 @@
 			cacheManager.set('projectImg', res.data)
 		});
 	}
+
+  function handleChangeFangshi() {
+    let str = ``;
+    if (id.value) {
+      str = str+`id=${id.value}`
+    }
+    if ( id.value && fromPage.value ) {
+      str = str +`&from=${fromPage.value}`
+    } else if (!id.value && fromPage.value) {
+      str = str + `from=${fromPage.value}`
+    }
+
+    if (str) {
+      uni.redirectTo({
+        url: `/pages/Login/test?${str}`
+      })
+    } else {
+      uni.redirectTo({
+        url: `/pages/Login/test`
+      })
+    }
+  }
+
 </script>
 
 <style scoped>