|
@@ -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(
|