书籍附加功能添加权限检查
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){
|
||||
// 跳转到购买
|
||||
|
||||
@@ -102,10 +102,10 @@
|
||||
<view class="btns flexbox" @click.stop="toMore(item)">
|
||||
<view class="title">{{item.name}}</view>
|
||||
<view class="pianshuping">{{item.forumNum}}篇书评</view>
|
||||
</view>
|
||||
</view>
|
||||
<image class="feng" v-if="item.images" :src="item.images" mode="aspectFill" @click.stop="toMore(item)"></image>
|
||||
<view class="shupingList">
|
||||
<view class="description" v-for="(item1,index1) in item.forums" :key="index1" @click.stop="toDetail(item1)">{{item1.title}}</view>
|
||||
<view class="description" v-for="(item1,index1) in item.forums" :key="index1" @click.stop="toDetail1(item1)">{{item1.title}}</view>
|
||||
</view>
|
||||
<view class="btns flexbox" @click.stop="toMore(item)">
|
||||
<span class="left"></span>
|
||||
@@ -142,6 +142,9 @@ import { data } from 'jquery';
|
||||
import {
|
||||
mapState, mapMutations
|
||||
} from 'vuex';
|
||||
import {
|
||||
checkBookRight
|
||||
} from '@/config/utils';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -265,17 +268,54 @@ import { data } from 'jquery';
|
||||
},
|
||||
// 查看本书更多书评
|
||||
toMore(val){
|
||||
console.log(val,'val')
|
||||
uni.navigateTo({
|
||||
url: '../comments/comments?bookid='+val.id,
|
||||
});
|
||||
// console.log(val,'val')
|
||||
let data = {
|
||||
'userId': this.userInfo.id,
|
||||
'bookId': val.id
|
||||
}
|
||||
checkBookRight(data,res=>{
|
||||
console.log(res)
|
||||
if(res.success){
|
||||
uni.navigateTo({
|
||||
url: '../comments/comments?bookid='+val.id,
|
||||
});
|
||||
}else{
|
||||
uni.showToast({
|
||||
title:'购买本书后方可查看此内容!',
|
||||
icon:'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
// 书评详情
|
||||
toDetail(val){
|
||||
console.log(val,'val')
|
||||
uni.navigateTo({
|
||||
url:'../comments/commentsDetail?bookid='+val.bookid+'&bfa_id='+val.id
|
||||
// console.log(val,'val')
|
||||
uni.navigateTo({
|
||||
url:'../comments/commentsDetail?bookid='+val.bookid+'&bfa_id='+val.id
|
||||
})
|
||||
},
|
||||
// 判断健全
|
||||
toDetail1(val){
|
||||
// console.log(val,'val')
|
||||
let data = {
|
||||
'userId': this.userInfo.id,
|
||||
'bookId': val.bookid
|
||||
}
|
||||
checkBookRight(data,res=>{
|
||||
console.log(res)
|
||||
if(res.success){
|
||||
uni.navigateTo({
|
||||
url:'../comments/commentsDetail?bookid='+val.bookid+'&bfa_id='+val.id
|
||||
})
|
||||
}else{
|
||||
uni.showToast({
|
||||
title:'购买本书后方可查看此内容!',
|
||||
icon:'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
clickLike(item){
|
||||
this.$http
|
||||
|
||||
Reference in New Issue
Block a user