From e042325822ddd556f36f58f8e4df81f6515a4111 Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期五, 25 四月 2025 10:40:19 +0800
Subject: [PATCH] #

---
 pages/common/modeSwitch.vue |   61 ++++++++++++++++++++++++++++--
 1 files changed, 57 insertions(+), 4 deletions(-)

diff --git a/pages/common/modeSwitch.vue b/pages/common/modeSwitch.vue
index fa9659f..20778cb 100644
--- a/pages/common/modeSwitch.vue
+++ b/pages/common/modeSwitch.vue
@@ -5,8 +5,7 @@
 		</view>
 		
 		<view class="buttom">
-			<button type="primary" size="mini">妯″紡鍒囨崲</button>
-			
+			<button type="primary" size="mini" @click="change()">妯″紡鍒囨崲</button>
 		</view>
 	</view>
 </template>
@@ -15,11 +14,65 @@
 	export default {
 		data() {
 			return {
-				modeText: '榛樿'
+				baseUrl: '',
+				token: '',
+				modeText: '榛樿',
+				sign: true,
 			}
 		},
+		onShow() {
+			this.baseUrl = uni.getStorageSync('baseUrl');
+			this.token = uni.getStorageSync('token');
+			this.getInfo()
+		},
 		methods: {
-			
+			getInfo() {
+				let _this = this
+				uni.request({
+					url: `${_this.baseUrl}/mobile/search/sign/auth/v2`,
+					data: {sign:false},
+					header: {
+						'token': uni.getStorageSync('token'),
+						'content-type': 'application/x-www-form-urlencoded'
+					},
+					method: 'POST',
+					success(res) {
+						console.log(res);
+						res = res.data
+						if (res.code === 200) {
+							if (res.data == 0) {
+								_this.modeText = "榛樿"
+							} else {
+								_this.modeText = "閫�搴�"
+							}
+							
+						}
+					}
+				})
+			},
+			change() {
+				let _this = this
+				uni.request({
+					url: `${_this.baseUrl}/mobile/search/sign/auth/v2`,
+					data: {sign:true},
+					header: {
+						'token': uni.getStorageSync('token'),
+						'content-type': 'application/x-www-form-urlencoded'
+					},
+					method: 'POST',
+					success(res) {
+						res = res.data
+						console.log(res);
+						if (res.code === 200) {
+							if (res.data == 0) {
+								_this.modeText = "榛樿"
+							} else {
+								_this.modeText = "閫�搴�"
+							}
+						}
+					}
+				})
+			}
 		}
 	}
 </script>

--
Gitblit v1.9.1