wangguoyu 2 kuukautta sitten
vanhempi
commit
2390b2e7be
4 muutettua tiedostoa jossa 42 lisäystä ja 30 poistoa
  1. 1 1
      config.js
  2. 2 2
      pages/login/login.vue
  3. 17 14
      pages/pay/order.vue
  4. 22 13
      pages/pay/productDialog.vue

+ 1 - 1
config.js

@@ -8,7 +8,7 @@ export default   {
     // 应用名称
     name: "鹅状元",
     // 应用版本
-    version: "1.0.3",
+    version: "1.0.0",
     // 应用logo
     logo: "/static/logo.png",
     // 官方网站

+ 2 - 2
pages/login/login.vue

@@ -117,11 +117,11 @@
 				login(req).then(res => {
 					if (res.code == 0) {
 						cacheManager.set('auth', res.data)
-						if (res.data.subjectId ==0 &&res.data.levelId == 0) {
+						if (res.data.subjectId == 0  &&res.data.levelId == '') {
 							uni.redirectTo({
 								url: `/pages/selectGradesTerms/index`
 							})
-						} else {
+						} else { 
 							uni.redirectTo({
 								url: `/pages/study/index`
 							})

+ 17 - 14
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"
@@ -304,19 +304,23 @@
 	})
 
 	function goDao(data, index) {
-		console.log('data', data);
-		console.log('index', index);
 		if (data.type == 0 && data.levelList.length == 1) {
 			cacheManager.updateObject('auth', {
 				typeId: data.levelList[0].typeId,
 				levelId: data.levelList[0].levelId,
 				subjectId: data.levelList[0].subjectId,
-				currentZhang: 0
-			})
-			cacheManager.remove('zhangInfo')
-			uni.redirectTo({
-				url: `/pages/study/index`
 			})
+			if (data.levelList[0].subjectId == 2 && data.levelIdList[0].typeId == 1) {
+				cacheManager.remove('zhangInfo')
+				uni.redirectTo({
+					url: `/pages/selectVersion/selectVersion`
+				})
+			} else {
+				cacheManager.remove('zhangInfo')
+				uni.redirectTo({
+					url: `/pages/study/index`
+				})
+			}
 		}
 	}
 
@@ -348,7 +352,6 @@
 		console.log('data', data[0].cardId);
 		console.log('index', index);
 		console.log('orderId', orderId);
-		return
 		uni.showLoading({
 			title: '',
 			mask: true
@@ -478,7 +481,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 为应用内支付对象 
@@ -496,15 +499,15 @@
 											uni.hideLoading();
 
 											//	toast("苹果内购成功")
-									
+
 											applePaySuccess(e)
 											//e.payment.orderNo = that.orderNo
 											//支付成功回调,前端调用后台接口
 										},
 										fail: (e) => {
 											uni.hideLoading();
-												toast("失败或取消支付")
-										
+											toast("失败或取消支付")
+
 										},
 									})
 								},

+ 22 - 13
pages/pay/productDialog.vue

@@ -7,7 +7,8 @@
 				<icon class="dialog-close-btn" @click="detailCloseBtn"></icon>
 				<view class="product-body-box">
 					<!-- ↓需要换成从接口中取得 wgy -->
-					<view class="detail-item-box" @click="goDao(item,index)" v-for="(item,index) in productList " :key="index">
+					<view class="detail-item-box" @click="goDao(item,index)" v-for="(item,index) in productList "
+						:key="index">
 						<img :src="item.cover" class="mall-image mt-20" />
 						<view class="content-body-box">
 							<view class="content-name">
@@ -33,30 +34,38 @@
 	import {
 		ref
 	} from 'vue';
-		import cacheManager from '@/utils/cacheManager.js';
+	import cacheManager from '@/utils/cacheManager.js';
 	const $emit = defineEmits(['payBtn'])
 	const detailPopup = ref(null); // 索引
 	let productList = ref([])
 	// 打开弹窗
 	function detailShow(data) {
-	productList.value = data
-	detailPopup.value.open();
+		productList.value = data
+		detailPopup.value.open();
 
 	}
-	 function goDao(data,index){
-		 console.log('data',data);
-		 console.log('index',index);
+
+	function goDao(data, index) {
+		console.log('data', data);
+		console.log('index', index);
+
 		cacheManager.updateObject('auth', {
 			typeId: data.typeId,
 			levelId: data.levelId,
 			subjectId: data.subjectId,
-			currentZhang: 0
 		})
-		cacheManager.remove('zhangInfo')
-		uni.redirectTo({
-			url: `/pages/study/index`
-		})
-	 }
+		if (data.subjectId == 2 && data.typeId == 1) {
+			cacheManager.remove('zhangInfo')
+			uni.redirectTo({
+				url: `/pages/selectVersion/selectVersion`
+			})
+		} else {
+			cacheManager.remove('zhangInfo')
+			uni.redirectTo({
+				url: `/pages/study/index`
+			})
+		}
+	}
 	// 开启提分之旅按钮
 	function detailPayBtn() {
 		$emit('payBtn')