wangguoyu 1 week ago
parent
commit
8011ee2110
5 changed files with 63 additions and 63 deletions
  1. 2 2
      manifest.json
  2. 48 48
      pages/mall/detailDialog.vue
  3. 4 4
      pages/mall/mallPage.vue
  4. 2 2
      pages/my/index.vue
  5. 7 7
      pages/pay/order.vue

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
     "name" : "鹅状元",
     "appid" : "__UNI__CB9D85D",
     "description" : "",
-    "versionName" : "1.0.6",
-    "versionCode" : 23,
+    "versionName" : "1.0.7",
+    "versionCode" : 26,
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {

+ 48 - 48
pages/mall/detailDialog.vue

@@ -48,8 +48,8 @@
 					@click="switchPayWay">
 					<icon class="zfb-icon"></icon>支付宝
 				</view>
-				<view class="pay-status-box apple-status-box"  v-if="currentPlatform =='ios'">
-					<icon class="apple-icon"></icon>
+				<view class="pay-status-box apple-status-box" v-if="currentPlatform =='ios'">
+					<!-- <icon class="apple-icon"></icon> -->
 				</view>
 
 				<view v-if="currentPlatform =='android'" class="pay-btn" @touchstart="creatOrder">立即支付</view>
@@ -115,7 +115,7 @@
 	})
 	const isIOSorAndroid = () => {
 		const systemInfo = uni.getSystemInfoSync();
-		
+
 		console.log('systemInfo', systemInfo);
 
 		if (systemInfo.platform == 'ios') {
@@ -167,47 +167,47 @@
 			title: '',
 			mask: true
 		});
-	
-	const productMap = {
-		4: 'ezySxJstxL1', //计算特训 L1
-		6: 'ezySxTjmtL1',//图解母题 L1
-		7: 'ezySxJstxL2',//计算特训 L2
-		8: 'ezySxJstxL3',//计算特训 L3
-		9: 'ezySxJstxL4',//计算特训 L4
-		10: 'ezySxJstxL5',//计算特训 L5
-		11: 'ezySxJstxL6',//计算特训 L6
-		12: 'ezySxTjmtL2',//图解母题 L2
-		13: 'ezySxTjmtL3',//图解母题 L3
-		14: 'ezySxTjmtL4',//图解母题 L4
-		15: 'ezySxTjmtL5',//图解母题 L5
-		16: 'ezySxTjmtL6',//图解母题 L6
-		22: 'ezySxTjmtL1L6',//图解母题 L1-6
-		23: 'ezyYyZrpdL1',//自然拼读 L1
-		24: 'ezyYyZrpdL2',//自然拼读 L2
-		25: 'ezyYyZrpdL3',//自然拼读 L3
-		26: 'ezyYyZrpdL4',//自然拼读 L4
-		27: 'ezyYyZrpdL5',//自然拼读 L5
-		28: 'ezyYyZrpdL1L5',//自然拼读 L1-l5
-		29: ' ezySxJstxL1L6'//计算特训 L1-L6
-	};
-	const firstId = cardIds.length > 0 ? cardIds[0] : null;
-	if (firstId) {
-		productId.value = productMap[firstId]
-		console.log('productId.value',productId.value);
-	} else {
-		toast("无对应产品Id,请练习管理员")
-		uni.hideLoading();
-		return false
-	}
+
+		const productMap = {
+			4: 'ezySxJstxL1', //计算特训 L1
+			6: 'ezySxTjmtL1', //图解母题 L1
+			7: 'ezySxJstxL2', //计算特训 L2
+			8: 'ezySxJstxL3', //计算特训 L3
+			9: 'ezySxJstxL4', //计算特训 L4
+			10: 'ezySxJstxL5', //计算特训 L5
+			11: 'ezySxJstxL6', //计算特训 L6
+			12: 'ezySxTjmtL2', //图解母题 L2
+			13: 'ezySxTjmtL3', //图解母题 L3
+			14: 'ezySxTjmtL4', //图解母题 L4
+			15: 'ezySxTjmtL5', //图解母题 L5
+			16: 'ezySxTjmtL6', //图解母题 L6
+			22: 'ezySxTjmtL1L6', //图解母题 L1-6
+			23: 'ezyYyZrpdL1', //自然拼读 L1
+			24: 'ezyYyZrpdL2', //自然拼读 L2
+			25: 'ezyYyZrpdL3', //自然拼读 L3
+			26: 'ezyYyZrpdL4', //自然拼读 L4
+			27: 'ezyYyZrpdL5', //自然拼读 L5
+			28: 'ezyYyZrpdL1L5', //自然拼读 L1-l5
+			29: ' ezySxJstxL1L6' //计算特训 L1-L6
+		};
+		const firstId = cardIds.length > 0 ? cardIds[0] : null;
+		if (firstId) {
+			productId.value = productMap[firstId]
+			console.log('productId.value', productId.value);
+		} else {
+			toast("无对应产品Id,请练习管理员")
+			uni.hideLoading();
+			return false
+		}
 		let req = {
 			cardIds: cardIds
 		}
 		orderAdd(req).then(res => {
 			console.log('res', res);
 			if (res.code == 0) {
-			setTimeout(() => {
-				uni.hideLoading();
-			}, 1000)
+				setTimeout(() => {
+					uni.hideLoading();
+				}, 1000)
 				orderId.value = res.data.id
 				// 测试ios 1元
 				applePay()
@@ -245,14 +245,14 @@
 					id: orderId.value
 				}).then(res3 => {
 					console.log('res3', res3);
-					if (res3.code == 0&&res3.data.success) {
+					if (res3.code == 0 && res3.data.success) {
 						genggaiVip(res3.data)
 					} else {
 						setTimeout(() => {
 							orderCheck({
 								id: orderId.value
 							}).then(res4 => {
-								if (res4.code == 0&&res4.data.success) {
+								if (res4.code == 0 && res4.data.success) {
 									genggaiVip(res4.data)
 								} else {
 									toast(
@@ -277,7 +277,7 @@
 			} else {
 				iapChannel.finishTransaction(data.transactionIdentifier)
 				uni.hideLoading();
-				toast("苹果内购失败")
+				toast("失败")
 				console.log('orderPayApple失败');
 				return false
 			}
@@ -303,7 +303,7 @@
 						// 获取 id 为 'appleiap' 的 channel  
 						console.info("支付通道", iapChannel)
 						if (iapChannel.id === 'appleiap') { //开通了app应用内支付,在manifest.josn中设置,开通后需打自定议基座
-						
+
 							// ids 数组中的项为 App Store Connect 配置的内购买项目产品ID(productId)
 							var ids = [productId.value];
 							// iap 为应用内支付对象 
@@ -328,8 +328,8 @@
 										},
 										fail: (e) => {
 											uni.hideLoading();
-											toast("苹果内购失败")
-											console.info("苹果内购失败", e)
+											toast("失败或取消支付")
+										
 										},
 									})
 								},
@@ -394,7 +394,7 @@
 						id: orderId.value
 					}).then(res3 => {
 						console.log('res3', res3);
-						if (res3.code == 0&&res3.data.success) {
+						if (res3.code == 0 && res3.data.success) {
 
 							genggaiVip(res3.data)
 						} else {
@@ -402,7 +402,7 @@
 								orderCheck({
 									id: orderId.value
 								}).then(res4 => {
-									if (res4.code == 0&&res4.data.success) {
+									if (res4.code == 0 && res4.data.success) {
 										genggaiVip(res4.data)
 									} else {
 										toast(
@@ -462,7 +462,7 @@
 					orderCheck({
 						id: orderId.value
 					}).then(res3 => {
-						if (res3.code == 0&&res3.data.success) {
+						if (res3.code == 0 && res3.data.success) {
 							genggaiVip(res3.data)
 						} else {
 							setTimeout(() => {
@@ -470,7 +470,7 @@
 									id: orderId.value
 								}).then(res4 => {
 									if (res4.code ==
-										0&&res4.data.success) {
+										0 && res4.data.success) {
 										genggaiVip(res4.data)
 									} else {
 										toast(

+ 4 - 4
pages/mall/mallPage.vue

@@ -94,7 +94,7 @@
 				<icon class="zfb-icon"></icon>支付宝
 			</view>
 			<view class="pay-status-box apple-status-box" v-if="currentPlatform =='ios'">
-				<icon class="apple-icon"></icon>
+				<!-- <icon class="apple-icon"></icon> -->
 			</view>
 
 			<view v-if="currentPlatform =='android'" class="pay-btn" @touchstart="creatOrder">立即支付
@@ -395,7 +395,7 @@
 
 				iapChannel.finishTransaction(data.transactionIdentifier)
 				uni.hideLoading();
-				toast("苹果内购失败")
+				toast("失败")
 				console.log('orderPayApple失败');
 				return false
 			}
@@ -446,8 +446,8 @@
 										},
 										fail: (e) => {
 											uni.hideLoading();
-											toast("苹果内购失败")
-											console.info("苹果内购失败", e)
+											toast("失败或取消支付")
+											
 										},
 									})
 								},

+ 2 - 2
pages/my/index.vue

@@ -39,7 +39,7 @@
 				<icon class="list-icon cpsc-icon"></icon>
 				<text>产品商城</text>
 			</view>
-			<view v-if="appleCode&&currentPlatform=='ios'" class="list-row" @click="duihuamaDuihuan">
+			<view v-if="appleCode=='true'&&currentPlatform=='ios'" class="list-row" @click="duihuamaDuihuan">
 				<icon class="list-icon duihuanma-icon"></icon>
 				<text>兑换码</text>
 			</view>
@@ -403,7 +403,7 @@
 			// 游客
 			routerOpt = options;
 		} else {
-			appleCode.value = cacheManager.get("auth").appleCode
+			appleCode.value = cacheManager.get("auth").appleCode.toString()
 			isIOSorAndroid()
 		}
 	})

+ 7 - 7
pages/pay/order.vue

@@ -58,7 +58,7 @@
 											<icon class="zfb-icon"></icon>支付宝
 										</view>
 										<view class="pay-status-box apple-status-box" v-if="currentPlatform =='ios'">
-											<icon class="apple-icon"></icon>
+									<!-- 		<icon class="apple-icon"></icon> -->
 										</view>
 
 										<view v-if="currentPlatform =='android'" class="pay-btn"
@@ -125,7 +125,7 @@
 											<icon class="zfb-icon"></icon>支付宝
 										</view>
 										<view class="pay-status-box apple-status-box" v-if="currentPlatform =='ios'">
-											<icon class="apple-icon"></icon>
+										<!-- 	<icon class="apple-icon"></icon> -->
 										</view>
 
 										<view v-if="currentPlatform =='android'" class="pay-btn"
@@ -193,7 +193,7 @@
 											<icon class="zfb-icon"></icon>支付宝
 										</view>
 										<view class="pay-status-box apple-status-box" v-if="currentPlatform =='ios'">
-											<icon class="apple-icon"></icon>
+											<!-- <icon class="apple-icon"></icon> -->
 										</view>
 
 										<view v-if="currentPlatform =='android'" class="pay-btn"
@@ -452,7 +452,7 @@
 
 				iapChannel.finishTransaction(data.transactionIdentifier)
 				uni.hideLoading();
-				toast("苹果内购失败")
+				toast("失败")
 				console.log('orderPayApple失败');
 				return false
 			}
@@ -496,15 +496,15 @@
 											uni.hideLoading();
 
 											//	toast("苹果内购成功")
-											console.info("苹果内购成功", e)
+									
 											applePaySuccess(e)
 											//e.payment.orderNo = that.orderNo
 											//支付成功回调,前端调用后台接口
 										},
 										fail: (e) => {
 											uni.hideLoading();
-											toast("苹果内购失败")
-											console.info("苹果内购失败", e)
+												toast("失败或取消支付")
+										
 										},
 									})
 								},