书籍附加功能添加权限检查

This commit is contained in:
@fawn-nine
2023-11-27 17:28:46 +08:00
parent f53a3b1b62
commit 815554aa18
6 changed files with 495 additions and 210 deletions

View File

@@ -139,6 +139,9 @@ import { data } from 'jquery';
import {
mapState
} from 'vuex';
import {
checkBookRight
} from '@/config/utils';
export default {
data() {
return {
@@ -218,9 +221,24 @@ import { data } from 'jquery';
}
if(e==2){
// 跳转到读书打卡
uni.navigateTo({
url: '../clock/clock?bookid='+ productInfo.id
let data = {
'userId': this.userInfo.id,
'bookId': productInfo.id
}
checkBookRight(data,res=>{
console.log(res)
if(res.success){
uni.navigateTo({
url: '../clock/clock?bookid='+ productInfo.id
})
}else{
uni.showToast({
title:'购买本书后方可参与打卡!',
icon:'none'
})
}
})
}
if(e==3){
// 跳转到购买