Ver Fonte

Merge branch '2024鹅状元' of https://gogs.mtavip.com/wangguoyu/uniProject into 2024鹅状元

tanxue há 3 semanas atrás
pai
commit
2ebc882c13

+ 44 - 42
pages/mall/detailDialog.vue

@@ -10,7 +10,7 @@
 					<checkbox-group @change="handleCheckboxChange">
 						<view class="detail-item-box" v-for="item in localList" :key="item.id">
 							<checkbox :value="item.id.toString()" :checked="selectedIds.includes(item.id)"
-								class="detail-checkbox" color="transparent"/>
+								class="detail-checkbox" color="transparent" />
 							<img :src="item.cover" class="mall-image" />
 							<view class="content-body-box">
 								<view class="content-name">
@@ -26,7 +26,7 @@
 				</view>
 				<!-- 全选/取消全选 -->
 				<view class="select-all-box" @click="toggleSelectAll">
-					<checkbox :checked="isAllSelected" class="detail-checkbox" color="transparent"/>
+					<checkbox :checked="isAllSelected" class="detail-checkbox" color="transparent" />
 					<text>全选</text>
 				</view>
 			</view>
@@ -134,8 +134,10 @@
 		cacheManager.updateObject('auth', {
 			levelIdList: mergeList
 		})
-		toast("chenggong!!!! 之后跳转我的订单页面")
-
+		toast("支付成功")
+		uni.redirectTo({
+			url: '/pages/pay/order?status=2'
+		})
 		// if (formPage.value == 'my') {
 		// 	uni.redirectTo({
 		// 		url: '/pages/my/index'
@@ -214,38 +216,38 @@
 			if (res.code == 0 && res.data) {
 				iapChannel.finishTransaction(data.transactionIdentifier)
 				console.log('resiapChanneliapChanneliapChannel', res);
-				orderCheck({
-					id: orderId.value
-				}).then(res3 => {
-					console.log('res3', res3);
-					if (res3.code == 0) {
-						genggaiVip(res3.data)
-					} else {
-						setTimeout(() => {
-							orderCheck({
-								id: orderId.value
-							}).then(res4 => {
-								if (res4.code == 0) {
-									genggaiVip(res4.data)
-								} else {
-									toast(
-										"开通失败,请联系管理员!"
-									)
-									uni
-										.hideLoading();
-									return false
-								}
-							}).catch(() => {
-								uni.hideLoading();
-								toast("check接口报错")
-								return false
-							})
-						}, 5000)
-					}
-				}).catch(() => {
-					uni.hideLoading();
-					toast("check接口报错")
-					return false
+				orderCheck({
+					id: orderId.value
+				}).then(res3 => {
+					console.log('res3', res3);
+					if (res3.code == 0) {
+						genggaiVip(res3.data)
+					} else {
+						setTimeout(() => {
+							orderCheck({
+								id: orderId.value
+							}).then(res4 => {
+								if (res4.code == 0) {
+									genggaiVip(res4.data)
+								} else {
+									toast(
+										"开通失败,请联系管理员!"
+									)
+									uni
+										.hideLoading();
+									return false
+								}
+							}).catch(() => {
+								uni.hideLoading();
+								toast("check接口报错")
+								return false
+							})
+						}, 5000)
+					}
+				}).catch(() => {
+					uni.hideLoading();
+					toast("check接口报错")
+					return false
 				})
 			} else {
 				iapChannel.finishTransaction(data.transactionIdentifier)
@@ -339,9 +341,9 @@
 			id: orderId.value
 		}).then(res2 => {
 			uni.hideLoading();
-			console.log('res2', res2);
-			if(res2.code !=0){
-				return false
+			console.log('res2', res2);
+			if (res2.code != 0) {
+				return false
 			}
 			uni.requestPayment({
 				"provider": "wxpay",
@@ -417,9 +419,9 @@
 			id: orderId.value
 		}).then(res2 => {
 			console.log('res2', res2);
-			uni.hideLoading();
-			if(res2.code !=0){
-				return false
+			uni.hideLoading();
+			if (res2.code != 0) {
+				return false
 			}
 			uni.requestPayment({
 				"provider": "alipay",

+ 1 - 1
pages/mall/mallPage.vue

@@ -243,7 +243,7 @@
 		cacheManager.updateObject('auth', {
 			levelIdList: mergeList
 		})
-
+		toast("支付成功")
 		uni.redirectTo({
 			url: '/pages/pay/order?status=2'
 		})

+ 53 - 43
pages/my/index.vue

@@ -15,7 +15,7 @@
 			indicator-active-color="#83d9ff" v-if="bannerArr">
 			<!-- 1.数学 2.英语-->
 			<swiper-item v-for="(item, index) in bannerArr" :key="index" class="hyqy-box" @click="hyqyBtn(item)">
-				<img :src="item.addCover" class="hyqy-box-img"/>
+				<img :src="item.addCover" class="hyqy-box-img" />
 			</swiper-item>
 		</swiper>
 		<view class="my-list-box">
@@ -42,7 +42,7 @@
 			<view v-if="appleCode&&currentPlatform=='ios'" class="list-row no-jt" @click="duihuamaDuihuan">
 				<icon class="list-icon duihuanma-icon"></icon>
 				<text>兑换码</text>
-			</view>	
+			</view>
 			<view v-if="currentPlatform=='android'" class="list-row no-jt" @click="duihuamaDuihuan">
 				<icon class="list-icon duihuanma-icon"></icon>
 				<text>兑换码</text>
@@ -60,7 +60,8 @@
 				<text>退出登录</text>
 			</view>
 		</view>
-		<CustomTabBar :levelId="levelId" :currentTabNumber="3" :typeId="typeId" :subjectId="subjectId" :tipFlag="tipFlag">
+		<CustomTabBar :levelId="levelId" :currentTabNumber="3" :typeId="typeId" :subjectId="subjectId"
+			:tipFlag="tipFlag">
 		</CustomTabBar>
 		<tip-small-dialog ref="exitDialogRef" @confirm-btn="exitBtn" :content="tipContent"></tip-small-dialog>
 		<tip-big-dialog ref="youkeDialogRef" @confirm-btn="ykConfirm" :imgShow="true"></tip-big-dialog>
@@ -141,8 +142,8 @@
 		credit: '',
 		vipFlag: '',
 	});
-	let routerOpt = ref(false);
-	let appleCode = ref(null);
+	let routerOpt = ref(false);
+	let appleCode = ref(null);
 	let currentPlatform = ref(null);
 	const exitDialogRef = ref(null);
 	const youkeDialogRef = ref(null);
@@ -203,13 +204,22 @@
 			code: data
 		}
 		duihuanmaCode(req).then(res => {
-			toast('兑换成功')
-			cacheManager.updateVipStatus('auth', res.data)
-			uni.redirectTo({
-				url: '/pages/my/index'
-			})
+			if (res.code == 0) {
+				toast('兑换成功')
+				const localList = cacheManager.get('auth').levelIdList || []
+				const mergeList = [...new Set([...localList, ...res.data.levelIdList])]
+				cacheManager.updateObject('auth', {
+					levelIdList: mergeList
+				})
+				uni.redirectTo({
+					url: '/pages/my/index'
+				})
+			}else{
+				toast('兑换失败请重试或联系管理员')
+				return false
+			}
 		}).catch(err => {
-		
+
 		})
 	}
 
@@ -259,20 +269,20 @@
 			});
 		}
 	}
-	
+
 	// 产品商城
-	function cpscClick(){
-		
-		if (loginFlag.value) {
-		uni.redirectTo({
-			url: '/pages/mall/mallPage'
-		});
-		} else {
-			uni.redirectTo({
-				url: `/pages/mall/mallPage?levelId=${routerOpt.levelId}&typeId=${routerOpt.typeId}&subjectId=${routerOpt.subjectId}&tipFlag=${routerOpt.tipFlag}`
-			});
-		}
-	
+	function cpscClick() {
+
+		if (loginFlag.value) {
+			uni.redirectTo({
+				url: '/pages/mall/mallPage'
+			});
+		} else {
+			uni.redirectTo({
+				url: `/pages/mall/mallPage?levelId=${routerOpt.levelId}&typeId=${routerOpt.typeId}&subjectId=${routerOpt.subjectId}&tipFlag=${routerOpt.tipFlag}`
+			});
+		}
+
 	}
 
 	// 订单
@@ -296,13 +306,13 @@
 		getMyCardList();
 	}
 	// 登录人员的cardlist
-	function getMyCardList(){
+	function getMyCardList() {
 		myCardList({}).then(res => {
 			bannerArr.value = res.data;
 		})
 	}
 	// 游客的cardList
-	function getCommonCardList(){
+	function getCommonCardList() {
 		commonCardList({}).then(res => {
 			bannerArr.value = res.data;
 		})
@@ -332,7 +342,7 @@
 	// 点击card
 	function hyqyBtn(data) {
 		uni.redirectTo({
-			url: '/pages/mall/mallPage?cardId='+data.id+'&subjectId='+data.subjectId+'&from=myPage'
+			url: '/pages/mall/mallPage?cardId=' + data.id + '&subjectId=' + data.subjectId + '&from=myPage'
 		})
 	}
 
@@ -367,28 +377,28 @@
 		getMyInfo();
 	}
 
-	function isIOSorAndroid(){
-		const systemInfo = uni.getSystemInfoSync();
-		
-		console.log('systemInfo', systemInfo);
-		
-		if (systemInfo.platform == 'ios') {
-			return currentPlatform.value = 'ios'
-		} else {
-			return currentPlatform.value = 'android'
-		}
-	}
-	
+	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 {
-			appleCode.value = cacheManager.get("auth").appleCode
-			isIOSorAndroid()
+		} else {
+			appleCode.value = cacheManager.get("auth").appleCode
+			isIOSorAndroid()
 		}
 	})
-	
+
 	function checkWrong() {
 		if (loginFlag.value) {
 			const AuthCode = getUserIdentity();

+ 8 - 0
pages/study/lookShipin.vue

@@ -264,6 +264,10 @@
 				}
 			},
 			getLiveYk() {
+				if(!this.videoId){
+					toast("video缺失!")
+					return false
+				}
 				let req = {
 					videoId: this.videoId
 				}
@@ -272,6 +276,10 @@
 				})
 			},
 			getLive() {
+				if(!this.videoId){
+					toast("video缺失!")
+					return false
+				}
 				let req = {
 					videoId: this.videoId
 				}

+ 9 - 1
pages/study/lookShipinNew.vue

@@ -259,12 +259,16 @@
 					} else {
 						uni.redirectTo({
 							//url: '/pages/study/lookShipin?studyData=' + JSON.stringify(pageData)
-							url: '/pages/study/lookShipin?jieId=' + this.jieId
+							url: '/pages/study/lookShipinNew?jieId=' + this.jieId
 						})
 					}
 				}
 			},
 			getLiveYk() {
+				if(!this.videoId){
+					toast("video缺失!")
+					return false
+				}
 				let req = {
 					videoId: this.videoId
 				}
@@ -273,6 +277,10 @@
 				})
 			},
 			getLive() {
+				if(!this.videoId){
+					toast("video缺失!")
+					return false
+				}
 				let req = {
 					videoId: this.videoId
 				}