wangguoyu il y a 4 mois
Parent
commit
75dc85816a
1 fichiers modifiés avec 12 ajouts et 28 suppressions
  1. 12 28
      pages/pay/svip.vue

+ 12 - 28
pages/pay/svip.vue

@@ -65,16 +65,14 @@
 	} from '@dcloudio/uni-app';
 	import {
 		toast,
-		getUserIdentity,
-		hasUserIdentity
+		getUserIdentity
 	} from "@/utils/common";
 	let payType = ref('weixin')
 	let cardId = ref('')
 	let formPage = ref('')
 	const daoPokeRef = ref(null);
 	const daoPokeAllRef = ref(null);
-	const selectZhangId = ref(null);//来自岛目录选择的章Id,支付后需要修改章id缓存记录,方便返回时定位到选中章的岛
-	const isAlreadyVip = hasUserIdentity();
+	const isVip = getUserIdentity();
 	const svipArr = [{
 			iconPath: 'static/images/pay/svip-list-icon1.png',
 			title: '学习资源,随心畅学',
@@ -99,7 +97,6 @@
 	onLoad((options) => {
 		cardId.value = options.cardId
 		formPage.value = options.formPage
-		selectZhangId.value = options.selectZhangId||''
 	})
 
 	function radioChange(data) {
@@ -108,6 +105,8 @@
 
 	function creatOrder(data) {
 
+
+
 		let req = {
 			cardId: cardId.value
 		}
@@ -116,7 +115,7 @@
 			cacheManager.updateObject('auth', {
 				growthType: 1
 			})
-			if (isAlreadyVip != 'VIP') {
+			if (isVip != 'VIP') {
 				daoPokeRef.value.handleShow();
 			} else {
 				daoPokeAllRef.value.handleShow();
@@ -128,19 +127,7 @@
 					uni.redirectTo({
 						url: '/pages/my/index'
 					})
-				} else if (formPage.value =='studyWithCatalgue'&& selectZhangId.value ) {
-					// 来自目录并且支付成功有章Id,更新缓存然后返回新岛
-					if( cacheManager.get('auth')){
-						const zhangList = cacheManager.get('zhangInfo').zhangList;
-						cacheManager.updateObject('auth', {
-							currentZhang: zhangList.findIndex(citem => citem.zhangId == +selectZhangId.value),
-							zhangId: +selectZhangId.value
-						})
-					}
-					uni.redirectTo({
-						url: '/pages/study/index'
-					})
-				} else{
+				}else{
 					uni.redirectTo({
 						url: '/pages/study/index'
 					})
@@ -150,18 +137,15 @@
 	}
 
 	function goBack(data) {
-		
-		if (formPage.value == 'studyWithCatalgue' ) {
-			// 返回到需要展示弹窗 studyWithCatalgue=1
+		if(formPage.value =='my'){
+			uni.redirectTo({
+				url: '/pages/my/index'
+			})
+		}else{
 			uni.redirectTo({
-				url: '/pages/study/index?studyWithCatalgue=1'
+				url: '/pages/study/index'
 			})
-			return;
 		}
-		
-		uni.redirectTo({
-			url: '/pages/study/index'
-		})
 	}
 </script>