书籍附加功能添加权限检查
This commit is contained in:
@@ -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){
|
||||
// 跳转到购买
|
||||
|
||||
Reference in New Issue
Block a user