wangguoyu 1 ay önce
ebeveyn
işleme
ac4f9202b3
1 değiştirilmiş dosya ile 25 ekleme ve 5 silme
  1. 25 5
      pages/my/index.vue

+ 25 - 5
pages/my/index.vue

@@ -35,7 +35,11 @@
 				<icon class="list-icon about-icon"></icon>
 				<text>关于我们</text>
 			</view>
-			<view v-if="loginFlag" class="list-row no-jt" @click="duihuamaDuihuan">
+			<view v-if="appleCode&&currentPlatform=='ios'" class="list-row no-jt" @click="duihuamaDuihuan">
+				<icon class="list-icon duihuanma-icon"></icon>
+				<text>兑换码</text>
+			</view>	
+			<view v-if="currentPlatform=='android'" class="list-row no-jt" @click="duihuamaDuihuan">
 				<icon class="list-icon duihuanma-icon"></icon>
 				<text>兑换码</text>
 			</view>
@@ -131,7 +135,9 @@
 		credit: '',
 		vipFlag: '',
 	});
-	let routerOpt = ref(false);
+	let routerOpt = ref(false);
+	let appleCode = ref(null);
+	let currentPlatform = ref(null);
 	const exitDialogRef = ref(null);
 	const youkeDialogRef = ref(null);
 	const zhuxiaoDialogRef = ref(null);
@@ -365,14 +371,28 @@
 			return false;
 		}
 	}
-
+	function isIOSorAndroid(){
+		const systemInfo = uni.getSystemInfoSync();
+		
+		console.log('systemInfo', systemInfo);
+		
+		if (systemInfo.platform == 'ios') {
+			return currentPlatform.value = 'ios'
+		} else {
+			return currentPlatform.value = 'android'
+		}
+	}
+	
 	onLoad((options) => {
 		if (!cacheManager.get('auth')) {
 			// 游客
 			routerOpt = options;
-		} else {}
+		} else {
+			appleCode.value = cacheManager.get("auth").appleCode
+			isIOSorAndroid()
+		}
 	})
-
+	
 	function checkWrong() {
 		if (loginFlag.value) {
 			const AuthCode = getUserIdentity();