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

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

@@ -235,6 +235,32 @@ export const getLatLon = function(tip) {
}); });
} }
// 查看是否有某本书的权限
export const checkBookRight = function(data,callback) {
console.log('接受的值', data)
$http.request({
url: "/book/user/checkUserBook",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data:data,
header: { //默认 无 说明请求头1
'Content-Type': 'application/json'
},
}).then(res => {
// console.log(res,'checkBookRight')
if(res.code === 0){
callback && callback({
success: true,
data: '有权限'
});
}
}).catch(e => {
callback && callback({
success: false,
data: '无权限'
});
})
}
// 单独微信支付 // 单独微信支付
export const setWXPay = function(payInfo, callback) { export const setWXPay = function(payInfo, callback) {
$http.request({ $http.request({

View File

@@ -139,6 +139,9 @@ import { data } from 'jquery';
import { import {
mapState mapState
} from 'vuex'; } from 'vuex';
import {
checkBookRight
} from '@/config/utils';
export default { export default {
data() { data() {
return { return {
@@ -218,9 +221,24 @@ import { data } from 'jquery';
} }
if(e==2){ if(e==2){
// 跳转到读书打卡 // 跳转到读书打卡
uni.navigateTo({ let data = {
url: '../clock/clock?bookid='+ productInfo.id '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){ if(e==3){
// 跳转到购买 // 跳转到购买

View File

@@ -105,7 +105,7 @@
</view> </view>
<image class="feng" v-if="item.images" :src="item.images" mode="aspectFill" @click.stop="toMore(item)"></image> <image class="feng" v-if="item.images" :src="item.images" mode="aspectFill" @click.stop="toMore(item)"></image>
<view class="shupingList"> <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>
<view class="btns flexbox" @click.stop="toMore(item)"> <view class="btns flexbox" @click.stop="toMore(item)">
<span class="left"></span> <span class="left"></span>
@@ -142,6 +142,9 @@ import { data } from 'jquery';
import { import {
mapState, mapMutations mapState, mapMutations
} from 'vuex'; } from 'vuex';
import {
checkBookRight
} from '@/config/utils';
export default { export default {
data() { data() {
return { return {
@@ -265,17 +268,54 @@ import { data } from 'jquery';
}, },
// 查看本书更多书评 // 查看本书更多书评
toMore(val){ toMore(val){
console.log(val,'val') // console.log(val,'val')
uni.navigateTo({ let data = {
url: '../comments/comments?bookid='+val.id, '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){ toDetail(val){
console.log(val,'val') // console.log(val,'val')
uni.navigateTo({ uni.navigateTo({
url:'../comments/commentsDetail?bookid='+val.bookid+'&bfa_id='+val.id 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){ clickLike(item){
this.$http this.$http

View File

@@ -20,10 +20,13 @@
</view> </view>
<view class="tags"> <view class="tags">
<uni-tag class="tag" @click="toMore()" :inverted="true" text="书评" type="success"></uni-tag> <uni-tag class="tag" @click="toMore()" :inverted="true" text="书评" type="success"></uni-tag>
<uni-tag @click="gotoListen()" class="tag" v-if="bookMessage.canListen" :inverted="true" text="听书" type="primary"></uni-tag> <uni-tag @click="gotoListen()" class="tag" v-if="bookMessage.canListen" :inverted="true" text="听书"
type="primary"></uni-tag>
<!-- 1:打卡2不打卡 --> <!-- 1:打卡2不打卡 -->
<uni-tag @click="gotoclock()" v-if="bookMessage.clockIn == 1" class="tag" :inverted="true" text="打卡" type="warning"></uni-tag> <uni-tag @click="gotoclock()" v-if="bookMessage.clockIn == 1" class="tag" :inverted="true" text="打卡"
<uni-tag @click="goJiangShu()" v-if="bookMessage.teachIn == 1" class="tag" :inverted="true" text="讲书" type="error"></uni-tag> type="warning"></uni-tag>
<uni-tag @click="goJiangShu()" v-if="bookMessage.teachIn == 1" class="tag" :inverted="true"
text="讲书" type="error"></uni-tag>
</view> </view>
<view class="buy" v-if="!bookMessage.isBuy"> <view class="buy" v-if="!bookMessage.isBuy">
<view class="btn" @click="goBuy"> <view class="btn" @click="goBuy">
@@ -43,52 +46,54 @@
<text> <text>
{{bookMessage.description}} {{bookMessage.description}}
</text> </text>
</view> </view>
<u-divider v-else text="暂无简介信息"></u-divider> <u-divider v-else text="暂无简介信息"></u-divider>
<view class="head_line" style="margin-bottom:30rpx;"> <view class="head_line" style="margin-bottom:30rpx;">
<b></b> <b></b>
<text>精彩试听</text> <text>精彩试听</text>
</view> </view>
<view class="playList" v-if="libLIst.length > 0"> <view class="playList" v-if="libLIst.length > 0">
<view class="item" v-for="(item,index) in libLIst" :key="index" > <view class="item" v-for="(item,index) in libLIst" :key="index">
<view > <view>
<view v-if="item.isFree == 1" <view v-if="item.isFree == 1" :class="[]" @click="listenOne(item, index)">
:class="[]" @click="listenOne(item, index)">
<span :class="[userInfo.playingInfo.bookId==item.bookId && userInfo.playingInfo.id == item.id ? 'playing' : '','graytitle']">{{item.chapter}}</span>&nbsp;&nbsp; <span
<uni-tag v-if="item.isFree == 1" class="tag" size="small" :inverted="true" text="试听" type="success" /> :class="[userInfo.playingInfo.bookId==item.bookId && userInfo.playingInfo.id == item.id ? 'playing' : '','graytitle']">{{item.chapter}}</span>&nbsp;&nbsp;
<!-- <image class="playingFig" src="/static/playingGif.gif" mode="aspectFill"></image> --> <uni-tag v-if="item.isFree == 1" class="tag" size="small" :inverted="true" text="试听"
type="success" />
<!-- <image class="playingFig" src="/static/playingGif.gif" mode="aspectFill"></image> -->
</view>
</view> </view>
</view> </view>
</view> <view class="" style="text-align: center;" @click="gotoListen">
<view class="" style="text-align: center;" @click="gotoListen"> <text style="font-size: 28rpx; color:#27b386">查看完整目录</text>
<text style="font-size: 28rpx; color:#27b386">查看完整目录</text>
</view>
</view>
<u-divider v-else text="暂无试听数据"></u-divider>
<view class="head_line" style="margin-bottom:30rpx;">
<b></b>
<text>热门书评</text>
</view>
<view class="list shupingList" v-if="shupingList.length > 0">
<view class="item" @click.stop="toDetail(item)" v-for="item in shupingList" :key="item.id">
<h4>{{item.title}}</h4>
<view class="" v-if="item.content && item.content != '' ">
<view class="info" v-html="item.content">
</view>
</view> </view>
<view class="more" @click.stop="toDetail(item)">立即查看</view>
</view> </view>
<view class="moreBtn" @click="toMore(item)"> <u-divider v-else text="暂无试听数据"></u-divider>
<text>查看更多</text>
<view class="head_line" style="margin-bottom:30rpx;">
<b></b>
<text>热门书评</text>
</view> </view>
<view class="list shupingList" v-if="shupingList.length > 0">
<view class="item" @click.stop="toDetail(item)" v-for="item in shupingList" :key="item.id">
<h4>{{item.title}}</h4>
<view class="" v-if="item.content && item.content != '' ">
<view class="info" v-html="item.content">
</view>
</view>
<view class="more" @click.stop="toDetail(item)">立即查看</view>
</view>
<view class="moreBtn" @click="toMore(item)">
<text>查看更多</text>
</view>
</view>
<u-divider v-else text="暂无书评数据"></u-divider>
</view>
<view>
<u-back-top :scroll-top="scrollTop" bottom="60" :customStyle='bgiStyle'
:iconStyle="iconStyle"></u-back-top>
</view> </view>
<u-divider v-else text="暂无书评数据"></u-divider>
</view>
<view>
<u-back-top :scroll-top="scrollTop" bottom="60" :customStyle='bgiStyle' :iconStyle="iconStyle"></u-back-top>
</view>
</view> </view>
<music-play :playData="playData"></music-play> <music-play :playData="playData"></music-play>
@@ -96,25 +101,29 @@
</template> </template>
<script> <script>
import musicPlay from '@/components/music.vue' import musicPlay from '@/components/music.vue'
import $http from '@/config/requestConfig.js'; import $http from '@/config/requestConfig.js';
import { import {
mapState,mapMutations mapState,
mapMutations
} from 'vuex'; } from 'vuex';
import {
checkBookRight
} from '@/config/utils';
export default { export default {
data() { data() {
return { return {
playData:{}, playData: {},
youhuiShow:false, youhuiShow: false,
youhuiIndex:'', youhuiIndex: '',
youhuiList:[], // 优惠券列表 youhuiList: [], // 优惠券列表
couponMz: 0, // 优惠券钱数 couponMz: 0, // 优惠券钱数
useCouponAmount: '' , // 使用的优惠券金额 useCouponAmount: '', // 使用的优惠券金额
bookJiageA: 0, bookJiageA: 0,
youhuiContent: { youhuiContent: {
coupons:{ coupons: {
id:'0' id: '0'
} }
}, },
scrollTop: 0, scrollTop: 0,
@@ -129,7 +138,9 @@
bookId: '', bookId: '',
bookMessage: { bookMessage: {
flag: false, flag: false,
author:{authorName:''} author: {
authorName: ''
}
}, },
bookCatalogue: [], bookCatalogue: [],
@@ -145,10 +156,10 @@
buyShow: false, buyShow: false,
buysignShow: false, buysignShow: false,
buysignContent: '', buysignContent: '',
libLIst:[], libLIst: [],
freeChapterCount:0, freeChapterCount: 0,
isBuy:false, isBuy: false,
shupingList:[], shupingList: [],
}; };
}, },
@@ -185,11 +196,11 @@
'userId': this.userInfo.id 'userId': this.userInfo.id
}) })
.then(res => { .then(res => {
console.log('书详细',res.book) console.log('书详细', res.book)
this.bookMessage = res.book this.bookMessage = res.book
this.bokMesDet.bookId = res.book.id this.bokMesDet.bookId = res.book.id
this.bokMesDet.bookName = res.book.name, this.bokMesDet.bookName = res.book.name,
this.bokMesDet.images = res.book.images this.bokMesDet.images = res.book.images
this.isBuy = res.book.isBuy this.isBuy = res.book.isBuy
this.freeChapterCount = res.book.freeChapterCount this.freeChapterCount = res.book.freeChapterCount
this.bokMesDet.userId = this.userInfo.id this.bokMesDet.userId = this.userInfo.id
@@ -222,79 +233,132 @@
}, },
// 去讲书 // 去讲书
goJiangShu(){ goJiangShu() {
uni.navigateTo({ let data = {
url: '../talkBook/talkBookML?bookid='+ this.bookId 'userId': this.userInfo.id,
}); 'bookId': this.bookId
}
checkBookRight(data,res=>{
console.log(res)
if(res.success){
uni.navigateTo({
url: '../talkBook/talkBookML?bookid=' + this.bookId
});
}else{
uni.showToast({
title:'购买本书后方可查看此内容!',
icon:'none'
})
}
})
}, },
// 去听书 // 去听书
gotoListen(){ gotoListen() {
uni.navigateTo({ uni.navigateTo({
url: "../listen/listen?bookid="+ this.bookId url: "../listen/listen?bookid=" + this.bookId
}); });
}, },
// 去打卡 // 去打卡
gotoclock(){ gotoclock() {
this.onPageJump('../clock/clock?bookid='+ this.bookId) let data = {
'userId': this.userInfo.id,
'bookId': this.bookId
}
checkBookRight(data,res=>{
console.log(res)
if(res.success){
this.onPageJump('../clock/clock?bookid=' + this.bookId)
}else{
uni.showToast({
title:'购买本书后方可参与打卡!',
icon:'none'
})
}
})
}, },
// 查看本书更多书评 // 查看本书更多书评
toMore(val){ toMore(val) {
console.log(val,'val') // console.log(val, 'val')
uni.navigateTo({ let data = {
url: '../comments/comments?bookid='+ this.bookId, 'userId': this.userInfo.id,
}); 'bookId': this.bookId
}
checkBookRight(data,res=>{
console.log(res)
if(res.success){
uni.navigateTo({
url: '../comments/comments?bookid=' + this.bookId,
});
}else{
uni.showToast({
title:'购买本书后方可查看此内容!',
icon:'none'
})
}
})
}, },
// 去购买 // 去购买
goBuy(){ goBuy() {
uni.navigateTo({ uni.navigateTo({
url: '../bookShop/commodityDetail?id=' + this.bookMessage.productId url: '../bookShop/commodityDetail?id=' + this.bookMessage.productId
}); });
}, },
// 获取书评 // 获取书评
getComments(){ getComments() {
let data = { let data = {
'page': 1, 'page': 1,
'limit': 3, 'limit': 3,
'bookid' : this.bookId 'bookid': this.bookId
} }
this.$http this.$http
.post('forum/articles/descupdatelist', data) .post('forum/articles/descupdatelist', data)
.then(res => { .then(res => {
console.log(res.page.list,'评论获取成功') console.log(res.page.list, '评论获取成功')
this.shupingList = res.page.list this.shupingList = res.page.list
}).catch((e)=>{ }).catch((e) => {
console.log(e,'e') console.log(e, 'e')
}) })
}, },
// 播放单个音频 // 播放单个音频
listenOne(item,index){ listenOne(item, index) {
console.log('点击了',index) console.log('点击了', index)
if(this.libLIst.length > 0){ if (this.libLIst.length > 0) {
this.setUserInfo({'playIndex': index}) this.setUserInfo({
this.$music.setList(this.libLIst,'autoPlay',index) 'playIndex': index
this.setUserInfo({'playVisible': true}) })
this.$music.setList(this.libLIst, 'autoPlay', index)
this.setUserInfo({
'playVisible': true
})
uni.setStorage({ uni.setStorage({
key: 'playVisible', key: 'playVisible',
data: true, data: true,
success: function () { success: function() {
console.log('success'); console.log('success');
} }
}); });
// 本地存储播放列表 // 本地存储播放列表
uni.setStorage({ uni.setStorage({
key: 'playData', key: 'playData',
data: {'myList':this.libLIst}, data: {
success: function () { 'myList': this.libLIst
console.log('success'); },
} success: function() {
}); console.log('success');
// 系统暂存 }
this.setUserInfo({'myList':this.libLIst}) });
} // 系统暂存
this.setUserInfo({
'myList': this.libLIst
})
}
}, },
// 获取章节列表 // 获取章节列表
getLibList(){ getLibList() {
this.$http this.$http
.post('book/book/getBookCatalogue', { .post('book/book/getBookCatalogue', {
'userId': this.userInfo.id, 'userId': this.userInfo.id,
@@ -302,20 +366,20 @@
// 'id': this.playid // 'id': this.playid
}) })
.then(res => { .then(res => {
if(res.code == 0){ if (res.code == 0) {
console.log(res,999) console.log(res, 999)
if(res.BookCatalogue.length > 0){ if (res.BookCatalogue.length > 0) {
res.BookCatalogue.map( item => { res.BookCatalogue.map(item => {
if(item.isFree == 1){ if (item.isFree == 1) {
this.libLIst.push(item) this.libLIst.push(item)
} }
}) })
console.log('改变后的试听目录',this.libLIst) console.log('改变后的试听目录', this.libLIst)
//this.libLIst = res.BookCatalogue //this.libLIst = res.BookCatalogue
// this.fengImg = res.images // this.fengImg = res.images
} }
} }
}).catch((e)=>{ }).catch((e) => {
console.log(e.msg) console.log(e.msg)
}) })
}, },
@@ -329,10 +393,10 @@
}, },
// 书评详情 // 书评详情
toDetail(val){ toDetail(val) {
console.log(val,'val') console.log(val, 'val')
uni.navigateTo({ uni.navigateTo({
url:'../comments/commentsDetail?bookid='+val.bookid+'&bfa_id='+val.id url: '../comments/commentsDetail?bookid=' + val.bookid + '&bfa_id=' + val.id
}) })
}, },
// 信息介绍跳转 // 信息介绍跳转
@@ -352,31 +416,99 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '@/style/mixin.scss'; @import '@/style/mixin.scss';
.playing{color: #1daa5c !important;}
.graytitle{color: #666;} .playing {
.flexbox{display: flex;} color: #1daa5c !important;
.tags{ }
.tag{
margin-left: 0; margin-right: 10rpx; .graytitle {
color: #666;
}
.flexbox {
display: flex;
}
.tags {
.tag {
margin-left: 0;
margin-right: 10rpx;
} }
} }
.moreBtn{text-align: center; margin-top: 20rpx;
text{padding: 6rpx 20rpx; border: 1px solid #27b386; color: #27b386; border-radius: 10rpx;} .moreBtn {
text-align: center;
margin-top: 20rpx;
text {
padding: 6rpx 20rpx;
border: 1px solid #27b386;
color: #27b386;
border-radius: 10rpx;
}
} }
.buy{ text-align: right;
.btn{display: inline-block; padding: 6rpx 8rpx; font-size: 36rpx; color: #d75f54; border: 1px solid #d75f54; border-radius: 10rpx;} .buy {
text-align: right;
.btn {
display: inline-block;
padding: 6rpx 8rpx;
font-size: 36rpx;
color: #d75f54;
border: 1px solid #d75f54;
border-radius: 10rpx;
}
} }
.shupingList{
h4{font-size: 36rpx;} .shupingList {
.item{padding: 30rpx 20rpx; padding-bottom: 60rpx; border-bottom: 20rpx solid #eee; border-radius: 46rpx;} h4 {
.more{display: inline-block; margin-top: 20rpx; padding: 3rpx 5rpx; color: #27b386; border: 1px solid #27b386; border-radius:8rpx;} font-size: 36rpx;
.info{line-height:40rpx ; font-size: 26rpx; margin-top: 20rpx; height: 80rpx; overflow: hidden; } }
.item {
padding: 30rpx 20rpx;
padding-bottom: 60rpx;
border-bottom: 20rpx solid #eee;
border-radius: 46rpx;
}
.more {
display: inline-block;
margin-top: 20rpx;
padding: 3rpx 5rpx;
color: #27b386;
border: 1px solid #27b386;
border-radius: 8rpx;
}
.info {
line-height: 40rpx;
font-size: 26rpx;
margin-top: 20rpx;
height: 80rpx;
overflow: hidden;
}
} }
.playList{padding: 20rpx; color: #666; }
.playList .item{display: block;line-height:60rpx; white-space: nowrap; .playList {
overflow-x: hidden; font-size: 36rpx; padding: 20rpx;
text-overflow: ellipsis;} color: #666;
.tag{margin-left: 20rpx;} }
.playList .item {
display: block;
line-height: 60rpx;
white-space: nowrap;
overflow-x: hidden;
font-size: 36rpx;
text-overflow: ellipsis;
}
.tag {
margin-left: 20rpx;
}
.head_line { .head_line {
margin: 50rpx 0 0 0; margin: 50rpx 0 0 0;
@@ -403,35 +535,38 @@
margin: 5rpx 35rpx 0 0; margin: 5rpx 35rpx 0 0;
} }
} }
.yq_youhui {
.yqLeft {
display: inline-block;
margin-right: 10rpx;
}
.yqRight { .yq_youhui {
float: right; .yqLeft {
} display: inline-block;
margin-right: 10rpx;
.dagnqian {
float: right;
font-size: 22rpx;
background-color: #dd1919;
color: #fff;
border-radius: 20rpx;
padding: 5rpx 10rpx;
}
} }
.yq_yunfei {
.yqLeft {
display: inline-block;
margin-right: 10rpx;
}
text { .yqRight {
float: right; float: right;
}
} }
.dagnqian {
float: right;
font-size: 22rpx;
background-color: #dd1919;
color: #fff;
border-radius: 20rpx;
padding: 5rpx 10rpx;
}
}
.yq_yunfei {
.yqLeft {
display: inline-block;
margin-right: 10rpx;
}
text {
float: right;
}
}
.book_neir { .book_neir {
margin: 20rpx 0 0 0; margin: 20rpx 0 0 0;
position: relative; position: relative;
@@ -441,8 +576,11 @@
width: 250upx; width: 250upx;
height: 320upx; height: 320upx;
img{width: 250upx;
height: 320upx;} img {
width: 250upx;
height: 320upx;
}
} }
.bn_nes { .bn_nes {
@@ -494,7 +632,7 @@
} }
} }
.book_vip{ .book_vip {
background: url('../../static/icon/mine_card.png') top center no-repeat; background: url('../../static/icon/mine_card.png') top center no-repeat;
color: #87510d; color: #87510d;
font-weight: bold; font-weight: bold;
@@ -633,6 +771,7 @@
display: inline-block; display: inline-block;
} }
} }
.youhuiItem { .youhuiItem {
border: 1px solid #d9d9d9; border: 1px solid #d9d9d9;
border-radius: 10rpx; border-radius: 10rpx;

View File

@@ -110,6 +110,9 @@
import { import {
mapState,mapMutations mapState,mapMutations
} from 'vuex'; } from 'vuex';
import {
checkBookRight
} from '@/config/utils';
export default { export default {
components: { components: {
// cxAdudioPlay, // cxAdudioPlay,
@@ -218,10 +221,23 @@
// }, // },
// 查看本书更多书评 // 查看本书更多书评
toMore(val){ toMore(val){
console.log(val,'val') let data = {
uni.navigateTo({ 'userId': this.userInfo.id,
url: '../comments/comments?bookid='+ this.bookid, 'bookId': this.bookid
}); }
checkBookRight(data,res=>{
// console.log(res)
if(res.success){
uni.navigateTo({
url: '../comments/comments?bookid='+ this.bookid,
});
}else{
uni.showToast({
title:'购买本书后方可查看此内容!',
icon:'none'
})
}
})
}, },
// 去听书 // 去听书
gotoListen(){ gotoListen(){
@@ -231,15 +247,43 @@
}, },
// 去讲书 // 去讲书
goJiangShu(){ goJiangShu(){
uni.navigateTo({ let data = {
url: '../talkBook/talkBookDetail?bookId='+ this.bookid 'userId': this.userInfo.id,
}); 'bookId': this.bookid
}
checkBookRight(data,res=>{
console.log(res)
if(res.success){
uni.navigateTo({
url: '../talkBook/talkBookML?bookid=' + this.bookid
});
}else{
uni.showToast({
title:'购买本书后方可查看此内容!',
icon:'none'
})
}
})
}, },
// 去打卡 // 去打卡
gotoclock(){ gotoclock(){
uni.navigateTo({ let data = {
url: '../clock/clock?bookid='+ this.bookid, 'userId': this.userInfo.id,
}); 'bookId': this.bookid
}
checkBookRight(data,res=>{
console.log(res)
if(res.success){
uni.navigateTo({
url: '../clock/clock?bookid='+ this.bookid,
});
}else{
uni.showToast({
title:'购买本书后方可参与打卡!',
icon:'none'
})
}
})
}, },
getBookInfo(){ getBookInfo(){
// 获取书本基本信息 // 获取书本基本信息

View File

@@ -86,6 +86,9 @@
mapState, mapState,
mapMutations mapMutations
} from 'vuex'; } from 'vuex';
import {
checkBookRight
} from '@/config/utils';
export default { export default {
components: { components: {
// cxAdudioPlay, // cxAdudioPlay,
@@ -157,10 +160,25 @@
// 查看本书更多书评 // 查看本书更多书评
toMore(val) { toMore(val) {
console.log(val, 'val') // console.log(val, 'val')
uni.navigateTo({ let data = {
url: '../comments/comments?bookid=' + this.bookid, 'userId': this.userInfo.id,
}); 'bookId': this.bookid
}
checkBookRight(data,res=>{
console.log(res)
if(res.success){
uni.navigateTo({
url: '../comments/comments?bookid=' + this.bookid,
});
}else{
uni.showToast({
title:'购买本书后方可查看此内容!',
icon:'none'
})
}
})
}, },
// 去打卡 // 去打卡
gotoclock() { gotoclock() {