|
@@ -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&¤tPlatform=='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();
|