diff --git a/locale/en.json b/locale/en.json index afcee3f..46be2bf 100644 --- a/locale/en.json +++ b/locale/en.json @@ -234,7 +234,9 @@ "certificate": "My certificate", "iHufen": "My lake", "hufenRecord": "Lake division record", - "hufen": "Hufen" + "hufen": "Hufen", + "backEnd" : "Back-end recharge", + "cannotView" : "The recharge in the background cannot be viewed" }, "book": { "title": "My Books", diff --git a/locale/zh-Hans.json b/locale/zh-Hans.json index 89f6836..d49a7ae 100644 --- a/locale/zh-Hans.json +++ b/locale/zh-Hans.json @@ -235,7 +235,9 @@ "certificate": "我的证书", "iHufen": "我的湖分", "hufenRecord": "湖分记录", - "hufen": "湖分" + "hufen": "湖分", + "backEnd" : "后台充值", + "cannotView" : "后台充值无法查看" }, "book": { "title": "我的书单", diff --git a/pages/course/index.vue b/pages/course/index.vue index 76dc6cc..fcd6b67 100644 --- a/pages/course/index.vue +++ b/pages/course/index.vue @@ -459,7 +459,12 @@ const requestAll = async () => { onMounted(() => { // 重置分类索引 currentIndex.value = 0 - + if(!uni.getStorageSync('state') && !uni.getStorageSync('token')) { + uni.navigateTo({ + url: '/pages/login/login' + }); + } + if(uni.getStorageSync('state')) uni.removeStorageSync('state') // 请求所有数据 requestAll() }) diff --git a/pages/login/login.vue b/pages/login/login.vue index d02c9a4..a10b9d9 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -401,6 +401,7 @@ const yszc = () => { * 页面跳转 */ const onPageSwitch = (url: string) => { + uni.setStorageSync('state', 'true'); uni.switchTab({ url: url, }) @@ -446,7 +447,6 @@ const getOS = () =>{ const oprateOs = uni.getSystemInfoSync().platform console.log(oprateOs, 'oprateOs'); isAndorid.value = oprateOs === "android" ? true : false - console.log(isAndorid.value); } onMounted(() => { diff --git a/pages/user/points/index.vue b/pages/user/points/index.vue index 4870704..73b957e 100644 --- a/pages/user/points/index.vue +++ b/pages/user/points/index.vue @@ -12,11 +12,11 @@ {{$t('order.pointsRecord')}} - {{item.remark.slice(0, (item.remark.indexOf(',')))}}{{item.relationId ? item.remark.slice(0, (item.remark.indexOf(','))) : $t('user.backEnd')}}{{item.actType === 1 ? '' : '+'}}{{item.changeAmount}} {{item.createTime}} - {{item.remark.slice((item.remark.indexOf(','))+1)}}{{item.remark.slice((item.remark.indexOf(','))+1)}} @@ -69,10 +69,14 @@ * 跳转订单详情 */ const toDetails = (order: IOrder) => { - console.log(order.relationId, "order"); - uni.navigateTo({ - url: '/pages/user/order/details?orderId=' + order.relationId - }) + if (order.relationId) { + uni.navigateTo({ + url: '/pages/user/order/details?orderId=' + order.relationId + }) + } else { + uni.showToast({ title: t('user.cannotView'), icon: 'none' }); + } + } diff --git a/pages/user/virtual/index.vue b/pages/user/virtual/index.vue index 2e1cf01..3cbc5bb 100644 --- a/pages/user/virtual/index.vue +++ b/pages/user/virtual/index.vue @@ -19,7 +19,7 @@ :class="item.orderType !== '充值' ? 'text1' : 'text2'">{{item.orderType !== '充值' ? '' : '+'}}{{item.changeAmount}} {{item.productName}} - {{$t('user.orderSn')}}:{{item.payNo}}{{$t('user.orderSn')}}:{{item.payNo}} {{item.createTime}} @@ -75,10 +75,14 @@ * 跳转订单详情 */ const toDetails = (order: IOrder) => { - console.log(order.relationId, "order"); - uni.navigateTo({ - url: '/pages/user/order/details?orderId=' + order.relationId - }) + if (order.relationId) { + uni.navigateTo({ + url: '/pages/user/order/details?orderId=' + order.relationId + }) + } else { + uni.showToast({ title: t('user.cannotView'), icon: 'none' }); + } + }