|
@@ -52,34 +52,22 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<tip-big-dialog ref="youkeDialogRef" @confirm-btn="ykConfirm" :imgShow="true"></tip-big-dialog>
|
|
|
+ <tip-small-dialog ref="goPayDialogRef" @confirm-btn="goPayPage" :content="tipContent"></tip-small-dialog>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
- import {
|
|
|
- reactive,
|
|
|
- ref,
|
|
|
- nextTick
|
|
|
- } from "vue";
|
|
|
- import {
|
|
|
- toast,
|
|
|
- getDataFromStr
|
|
|
- } from "@/utils/common";
|
|
|
- import {
|
|
|
- onLoad
|
|
|
- } from "@dcloudio/uni-app";
|
|
|
- import {
|
|
|
- getWordZhangList,
|
|
|
- getWordZhangListYK,
|
|
|
- } from "@/api/word.js";
|
|
|
+ import {reactive,ref,nextTick} from "vue";
|
|
|
+ import {toast,getDataFromStr} from "@/utils/common";
|
|
|
+ import {onLoad} from "@dcloudio/uni-app";
|
|
|
+ import {getWordZhangList,getWordZhangListYK,} from "@/api/word.js";
|
|
|
import cacheManager from '@/utils/cacheManager.js';
|
|
|
import tipBigDialog from '@/components/dialog/tipBigDialog.vue';
|
|
|
- import {
|
|
|
- useSwiper
|
|
|
- } from "@/utils/useSwiper";
|
|
|
-
|
|
|
+ import {useSwiper} from "@/utils/useSwiper";
|
|
|
+ import tipSmallDialog from '@/components/dialog/tipSmallDialog.vue'
|
|
|
|
|
|
|
|
|
+ const goPayDialogRef = ref(null);
|
|
|
const listData = reactive({
|
|
|
jieNumberList: [], //节名称
|
|
|
title: '', // 版本+年级+学期
|
|
@@ -95,15 +83,23 @@
|
|
|
levelId: null,
|
|
|
zhangId: null,
|
|
|
})
|
|
|
+ const tipContent = '是否前往开通付费?';
|
|
|
|
|
|
const {
|
|
|
swiperData,
|
|
|
handleTouchStart,
|
|
|
handleTouchEnd,
|
|
|
- userCode
|
|
|
+ userCode
|
|
|
} = useSwiper(listData, (userCode) => {
|
|
|
console.log('userCode',userCode)
|
|
|
-
|
|
|
+ // 非VIP
|
|
|
+ if (userCode.value == 'Not-Vip') {
|
|
|
+ goPayDialogRef.value.handleShow();
|
|
|
+ }else if(userCode.value == 'Visitor'){
|
|
|
+ // 游客
|
|
|
+ youkeDialogRef.value.handleShow();
|
|
|
+ }
|
|
|
+
|
|
|
});
|
|
|
|
|
|
onLoad((options) => {
|
|
@@ -120,7 +116,6 @@
|
|
|
[info.levelId, info.zhangId] = getDataFromStr(cacheManager.get('auth').levelId)
|
|
|
// 非游客
|
|
|
wordJieId = routerOpt.jieId
|
|
|
- console.log(wordJieId,'routerOpt.jieId');
|
|
|
getWordListData();
|
|
|
}
|
|
|
});
|
|
@@ -133,12 +128,12 @@
|
|
|
});
|
|
|
swiperData.isAllowed = false; // 重置状态
|
|
|
}
|
|
|
- if (userCode.value == 'VIP') {
|
|
|
- listData.activeIndex = e.detail.current;
|
|
|
- // unit滚动到指定位置
|
|
|
- handleTitleClick(listData.jieNumberList[listData.activeIndex])
|
|
|
- }
|
|
|
- findWordLeft(listData.activeIndex)
|
|
|
+ if (userCode.value == 'VIP') {
|
|
|
+ console.log('VIPVIPVIP');
|
|
|
+ listData.activeIndex = e.detail.current;
|
|
|
+ handleTitleClick(listData.jieNumberList[listData.activeIndex])
|
|
|
+ }
|
|
|
+ findWordLeft(listData.activeIndex)
|
|
|
}
|
|
|
|
|
|
|
|
@@ -174,7 +169,6 @@
|
|
|
}
|
|
|
|
|
|
function handleTitleClick(item) {
|
|
|
- console.log(item,'item');
|
|
|
if (!cacheManager.get('auth')) {
|
|
|
youkeDialogRef.value.handleShow();
|
|
|
} else {
|
|
@@ -195,13 +189,11 @@
|
|
|
|
|
|
// 获取滚动距离
|
|
|
function findWordLeft(data) {
|
|
|
- console.log('data',data);
|
|
|
- wordLeft.value = data * 40;
|
|
|
+ wordLeft.value = data * 80;
|
|
|
return wordLeft.value;
|
|
|
}
|
|
|
|
|
|
function getWordListData() {
|
|
|
- console.log('wordJieId.value',wordJieId.value);
|
|
|
const opt = {
|
|
|
levelId: info.levelId,
|
|
|
zhangId: info.zhangId,
|
|
@@ -261,4 +253,17 @@
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ // 去支付
|
|
|
+ function goPayPage() {
|
|
|
+ let zhangInfoLocal = cacheManager.get('zhangInfo')
|
|
|
+ if (!zhangInfoLocal.cardId) {
|
|
|
+ toast("cardId 丢失请重新选择学科LevelId");
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ uni.redirectTo({
|
|
|
+ url: '/pages/mall/mallPage?cardId=' + zhangInfoLocal.cardId + '&from=daoPage' + '&subjectId=' +
|
|
|
+ zhangInfoLocal.subjectId
|
|
|
+ })
|
|
|
+ }
|
|
|
</script>
|