Merge branch 'bookxiangqing'
This commit is contained in:
@@ -315,11 +315,13 @@
|
|||||||
methods: {
|
methods: {
|
||||||
// 根据bookid查询商品id
|
// 根据bookid查询商品id
|
||||||
getProid(){
|
getProid(){
|
||||||
|
console.log(this.bookid,'this.bookid传过来的值')
|
||||||
this.$http
|
this.$http
|
||||||
.post('book/shopproduct/bookinfo/' + this.bookid)
|
.post('book/shopproduct/bookinfo/' + this.bookid)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.shangIDNum = res.shopProduct.productId
|
this.shangIDNum = res.shopProduct.productId
|
||||||
|
console.log(this.shangIDNum,'this.shangIDNum')
|
||||||
// console.log(res,'详情res')
|
// console.log(res,'详情res')
|
||||||
this.getShangList(this.shangIDNum);
|
this.getShangList(this.shangIDNum);
|
||||||
this.getData()
|
this.getData()
|
||||||
|
|||||||
@@ -19,22 +19,7 @@
|
|||||||
<text style=" color:#a3a3a3;">今天已签到</text>
|
<text style=" color:#a3a3a3;">今天已签到</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<!-- <scroll-view class="scroll-view_H flexbox" scroll-x="true" @scroll="scroll" :scroll-left="scrollLeft">
|
|
||||||
<view class="" style="padding: 0 6rpx; display: inline-block; width: 20%; box-sizing: border-box; " v-for="(item,index) in 365">
|
|
||||||
<view
|
|
||||||
:class="['item', signList.indexOf(index+1) != -1 ? 'havSign' : '',
|
|
||||||
currentDay == index+1 && signList.indexOf(index+1) == -1 ? 'current' : '',
|
|
||||||
linshiDay == index+1 ? 'linshiDay':'']" @click="getInfo(index+1)">
|
|
||||||
<span class="day"><em>{{index+1}}</em> 天</span>
|
|
||||||
<u-icon v-if="signList.indexOf(index+1) != -1" name="checkbox-mark" color="#fff" size="28" style="margin: 0 auto; width: 28px; text-align: center;"></u-icon>
|
|
||||||
<span v-if="signList.indexOf(index+1) == -1 && currentDay > index+1" class="buka">未签</span>
|
|
||||||
<span v-if="currentDay < index+1" class="weidaka">未开始</span>
|
|
||||||
<span v-if="currentDay == index+1 && signList.indexOf(index+1) == -1" class="daka" @click="kuickSign()">签到</span>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</scroll-view> -->
|
|
||||||
<swiper class="swiper scroll-view_H" @animationfinish="animationfinish" @change="swiperChange" :current='currentIndex' :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval"
|
<swiper class="swiper scroll-view_H" @animationfinish="animationfinish" @change="swiperChange" :current='currentIndex' :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval"
|
||||||
:duration="duration">
|
:duration="duration">
|
||||||
<swiper-item v-for="(item,index) in dayList" :key="index" class="flexbox swiperPage">
|
<swiper-item v-for="(item,index) in dayList" :key="index" class="flexbox swiperPage">
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<view style="background-color: #fff;padding: 30rpx;">
|
<view style="background-color: #fff;padding: 30rpx;">
|
||||||
<z-nav-bar title="电子书详情"></z-nav-bar>
|
<z-nav-bar title="电子书详情"></z-nav-bar>
|
||||||
<view class="book_neir">
|
<view class="book_neir flexbox">
|
||||||
<img :src="bookMessage.images" class="bn_img">
|
<view class="bn_img">
|
||||||
<b class="leiXing" v-if="bookMessage.isVip==1" style="background: #c79119;">VIP</b>
|
<img :src="bookMessage.images" mode="scaleToFill">
|
||||||
<b class="leiXing" v-if="bookMessage.isVip==2" style="background: #c74119;">付费</b>
|
</view>
|
||||||
<view class="bn_nes">
|
<view class="bn_nes">
|
||||||
<view style="font-weight: bold;margin-bottom: 30rpx;">
|
<view style="font-weight: bold;margin-bottom: 30rpx;">
|
||||||
{{bookMessage.name}}
|
{{bookMessage.name}}
|
||||||
@@ -13,186 +13,94 @@
|
|||||||
<p @click="onAuCHJump(bookMessage.authorId,1)" style="margin-bottom: 20rpx;">
|
<p @click="onAuCHJump(bookMessage.authorId,1)" style="margin-bottom: 20rpx;">
|
||||||
{{bookMessage.authorName}} [著] >
|
{{bookMessage.authorName}} [著] >
|
||||||
</p>
|
</p>
|
||||||
<p @click="onAuCHJump(item.id,2)" v-for="item in this.bookMessage.publisherNIList">
|
<!-- <p @click="onAuCHJump(item.id,2)" v-for="item in this.bookMessage.publisherNIList">
|
||||||
{{item.title}} >
|
{{item.title}} >
|
||||||
</p>
|
</p> -->
|
||||||
|
</view>
|
||||||
|
<view class="tags">
|
||||||
|
<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>
|
||||||
|
|
||||||
|
<!-- 1:打卡,2不打卡 -->
|
||||||
|
<uni-tag @click="gotoclock()" v-if="bookMessage.clockIn == 1" class="tag" :inverted="true" text="签到" type="warning"></uni-tag>
|
||||||
|
</view>
|
||||||
|
<view class="buy" v-if="!bookMessage.isBuy">
|
||||||
|
<view class="btn" @click="goBuy">
|
||||||
|
立即购买
|
||||||
</view>
|
</view>
|
||||||
<view v-if="this.bookMessage.chapterNum!=null"
|
|
||||||
style="color: #cdcdcd;font-size: 20rpx;margin:20rpx 0 0 0;max-width: 400rpx;line-height: 36rpx;">
|
|
||||||
上次阅读到{{this.bookCatalogue[this.bookMessage.chapterNum-1].chapterName}}
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<br clear="both">
|
<br clear="both">
|
||||||
</view>
|
</view>
|
||||||
<view class="book_dredge" @click="onPageJump('../peanut/opeVip')" v-if="bookMessage.isVip!=0&&this.userMes.vip==0">
|
|
||||||
<image src="../../static/icon/mine_p.png" alt=""></image>
|
|
||||||
开通会员,免费读本书
|
|
||||||
<b>></b>
|
|
||||||
</view>
|
|
||||||
<view class="book_dredge book_vip" v-if="this.userMes.vip==1">
|
|
||||||
<image src="../../static/icon/mine_v.png" alt=""></image>
|
|
||||||
尊享会员权益中
|
|
||||||
</view>
|
|
||||||
<view class="book_tab">
|
<view class="book_tab">
|
||||||
<view>
|
<view class="head_line">
|
||||||
<u-tabs :list="tab_list" @click="tab_click" lineColor="#54a966 100% 100%"
|
<b></b>
|
||||||
:activeStyle="{color: '#303133',fontWeight: 'bold',transform: 'scale(1.1)'}"></u-tabs>
|
<text>简介</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="bt_cont">
|
<view class="bt_cont">
|
||||||
<view v-if="tab_muJian==0" class="bt_jian">
|
<view class="bt_jian" v-if="bookMessage.description != ''">
|
||||||
<text>
|
<text>
|
||||||
{{bookMessage.description}}
|
{{bookMessage.description}}
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="tab_muJian==1">
|
<u-divider v-else text="暂无简介信息"></u-divider>
|
||||||
<p style="text-align: right;color: #a5a5a5;margin-bottom: 10rpx;">
|
<view class="head_line" style="margin-bottom:30rpx;">
|
||||||
共{{bookCatalogue.length}}章</p>
|
<b></b>
|
||||||
<view class="bt_nulu" v-for='(item,index) in bookCatalogue'>
|
<text>精彩试听</text>
|
||||||
<!-- 最近阅读的 -->
|
|
||||||
<view @click="onBokReadJump(index)" v-if="bookMessage.isBuy==1" style="display: flex;justify-content: space-between;">
|
|
||||||
{{item.chapterName}}
|
|
||||||
<font v-if="bookMessage.chapterId==index">最近阅读</font>
|
|
||||||
</view>
|
</view>
|
||||||
<view v-if="bookMessage.isBuy==0">
|
<view class="playList" v-if="libLIst.length > 0">
|
||||||
<view @click="onBokReadJump(index)" v-if="index<bookMessage.freeChapterCount">
|
<view class="item" v-for="(item,index) in libLIst" :key="index" >
|
||||||
{{item.chapterName}}
|
<view >
|
||||||
<font v-if="bookMessage.chapterId==index">最近阅读</font>
|
<view v-if="3 > index"
|
||||||
</view>
|
:class="[freeChapterCount < index ? 'graytitle' : '',
|
||||||
<view v-if="index>=bookMessage.freeChapterCount" @click="collectFee()">
|
userInfo.playingInfo.bookid==item.bookid && userInfo.playingInfo.chapterId == item.chapterId ? 'playing' : '']" @click="listenOne(item, index)">
|
||||||
<!-- 不是会员显示锁 -->
|
<span :class="[freeChapterCount-1 < index ? 'graytitle' : '']">{{item.chapterName}}</span>
|
||||||
<font style=" color:#bfa853;margin-left: 20rpx;">
|
<uni-tag v-if="freeChapterCount-1 >= index" class="tag" size="small" :inverted="true" text="试听" type="success" />
|
||||||
<u-icon name="lock" color="#ccc" size="20" v-if="bookMessage.isBuy!==1"></u-icon>
|
<!-- <image class="playingFig" src="/static/playingGif.gif" mode="aspectFill"></image> -->
|
||||||
</font>
|
|
||||||
{{item.chapterName}}
|
|
||||||
</view>
|
|
||||||
<view
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view style="height: 60rpx;"></view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="book_caozuo">
|
|
||||||
<view v-if="this.bookMessage.flag" style="color: #aaa;">已加入书架</view>
|
|
||||||
<view v-if="!this.bookMessage.flag" @click="joInshelf">加入书架</view>
|
|
||||||
<view @click="onBokReadJump(0)" v-if="this.bookMessage.isBuy==1&&this.bookMessage.chapterId==null">开始阅读</view>
|
|
||||||
<view @click="onBokReadJump(bookMessage.chapterNum-1)" v-if="this.bookMessage.isBuy==1&&this.bookMessage.chapterId!=null">
|
|
||||||
继续阅读
|
|
||||||
</view>
|
|
||||||
<view @click="onBokReadJump(0)" v-if="this.bookMessage.isBuy==0&&this.bookMessage.chapterNum==null&&this.bookMessage.freeChapterCount!=0">开始试读</view>
|
|
||||||
<view @click="onBokReadJump(bookMessage.chapterNum-1)" v-if="this.bookMessage.isBuy==0&&this.bookMessage.chapterNum!=null&&this.bookMessage.freeChapterCount!=0">继续试读</view>
|
|
||||||
<view v-if="this.bookMessage.isBuy==0&&this.bookMessage.freeChapterCount==0">购买阅读</view>
|
|
||||||
<view @click="buyShowFun" v-if="bookMessage.isBuy==0" style="background-color: #d85f54;">立即购买</view>
|
|
||||||
<view v-if="bookMessage.isBuy==1&&bookMessage.isVip!=0" style="background-color: #bfa853;">已购买</view>
|
|
||||||
<view v-if="bookMessage.isVip==0">本书免费</view>
|
|
||||||
</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="info" v-if="item.content != ''" v-html="item.content">
|
||||||
|
|
||||||
<!-- 购买 -->
|
</view>
|
||||||
<u-popup :show="buyShow" :round="10" @close="buyShow=false" :closeable='true'>
|
<view class="more" @click.stop="toDetail(item)">立即查看</view>
|
||||||
<view class="tanchu">
|
</view>
|
||||||
<view class="by_title">购买</view>
|
<view class="moreBtn" @click="toMore(item)">
|
||||||
<view class="by_package">
|
<text>查看更多</text>
|
||||||
<view v-if="userMes.vip==0" :class="typeFen== 1?'Tab_by by_fen':'by_fen'" @click="chBuyType(1)">
|
|
||||||
<view class="biao">开通会员</view>
|
|
||||||
<view class="wenz">
|
|
||||||
连续包月
|
|
||||||
<text>节省{{bookMessage.salePrice}}疯币</text>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<br>
|
<u-divider v-else text="暂无书评数据"></u-divider>
|
||||||
<view :class="typeFen== 2?'Tab_by by_fen':'by_fen'" @click="chBuyType(2)">
|
|
||||||
<view class="biao" v-if="userMes.vip==0">直接购买</view>
|
|
||||||
<view class="biao" v-if="userMes.vip==1">会员权益购买</view>
|
|
||||||
<view class="benl">
|
|
||||||
<b v-if="useCouponAmount != ''">{{useCouponAmount}}</b>
|
|
||||||
<span v-else>
|
|
||||||
<b v-if="bookMessage.isSale==1">{{bookMessage.salePrice}}</b>
|
|
||||||
<b v-if="bookMessage.isSale==0||bookMessage.isSale==null">{{bookMessage.price}}</b></span>
|
|
||||||
疯币
|
|
||||||
<text>{{bookMessage.price}}疯币</text>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
|
||||||
<!-- 优惠券 ------------------------>
|
|
||||||
<view class="yq_youhui" @click="CyouhuiShow" style="margin-top:20px;">
|
|
||||||
<u-icon name="red-packet-fill" color="#e74141" size="18" class="yqLeft"></u-icon>
|
|
||||||
优惠券
|
|
||||||
<u-icon name="arrow-right" color="#aaa" size="18" class="yqRight"></u-icon>
|
|
||||||
<text class="dagnqian"
|
|
||||||
v-if="youhuiList.length>0&&youhuiContent.id==undefined">当前可选{{this.youhuiList.length}}张</text>
|
|
||||||
<text class="dagnqian" v-if="youhuiList.length==0&&youhuiContent.id==undefined"
|
|
||||||
style="background-color: #999;">暂无优惠券</text>
|
|
||||||
<text class="dagnqian" v-if="youhuiContent.id!=undefined">
|
|
||||||
- ¥{{youhuiContent.coupons.couponAmount}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view style="height: 1px;width: 100%;background-color: #eee;margin-top: 50rpx;"></view>
|
|
||||||
<view style="margin: 40rpx 10rpx 20rpx 10rpx;font-size: 30rpx;">
|
|
||||||
<view style="float: left;">余额</view>
|
|
||||||
<view style="float: right;color: #999;">
|
|
||||||
{{userMes.peanutCoin}} 疯币
|
|
||||||
<view class="chongBtn" @click="buPoint()">充值疯币</view>
|
|
||||||
</view>
|
|
||||||
<br clear="both">
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view style="color: #c3c3c3;font-size: 20rpx;margin: 30rpx 0;">支付成功后,立即解锁已购内容</view>
|
|
||||||
|
|
||||||
<view @click="buyVip()" v-if="typeFen== 1" class="by_btn">查看套餐开通VIP</view>
|
|
||||||
<view @click="buyMoneTip()" v-if="typeFen== 2" class="by_btn">购买本书</view>
|
|
||||||
</view>
|
|
||||||
</u-popup>
|
|
||||||
|
|
||||||
<u-modal :show="buysignShow" :content="buysignContent" :showCancelButton="true" @cancel="cancelMoney"
|
|
||||||
@confirm="buyMoney">
|
|
||||||
</u-modal>
|
|
||||||
|
|
||||||
<view>
|
<view>
|
||||||
<u-back-top :scroll-top="scrollTop" bottom="60" :customStyle='bgiStyle' :iconStyle="iconStyle"></u-back-top>
|
<u-back-top :scroll-top="scrollTop" bottom="60" :customStyle='bgiStyle' :iconStyle="iconStyle"></u-back-top>
|
||||||
</view>
|
</view>
|
||||||
<!-- 优惠券弹1出 -->
|
|
||||||
<u-popup :show="youhuiShow" :round="10" @close="hideyouhui">
|
|
||||||
<view class="tanchu">
|
|
||||||
<view class="dp_title">请选择优惠券</view>
|
|
||||||
<view style="max-height: 1000rpx;overflow-y: scroll;">
|
|
||||||
<span @click="clearYouhui" style="font-size: 14px; display:inline-block;border: 1px solid #c74119; border-radius: 5px; float: right; color:#c74119; padding: 5px; margin-bottom: 10px;">不使用优惠券</span>
|
|
||||||
<view :class="youhuiIndex === index ? 'youhuiItem youItem_style' : 'youhuiItem'"
|
|
||||||
v-for="(item,index) in youhuiList" :key="index" @click="choseYouhui(index)">
|
|
||||||
<view style="width: 25%;color:#fd6004;text-align: center;">
|
|
||||||
<text>¥</text>
|
|
||||||
<b style="font-size: 45rpx;">{{item.coupons.couponAmount}}</b>
|
|
||||||
<text
|
|
||||||
style="display: block;color: #666;font-size: 25rpx;margin-top: 10rpx;">满{{item.coupons.useLevel}}元可用</text>
|
|
||||||
</view>
|
</view>
|
||||||
<view style="width: 68%;padding-left: 5%;">
|
<music-play :playData="playData"></music-play>
|
||||||
<text>{{item.coupons.couponName}}</text>
|
|
||||||
<text
|
|
||||||
style="display: block;font-size: 20rpx;color: #999;margin-top: 10rpx;">到期时间:{{item.coupons.expirationDate}}</text>
|
|
||||||
</view>
|
|
||||||
<view style="width: 7%;">
|
|
||||||
<text
|
|
||||||
style="border: 1px solid #d9d9d9;width: 35rpx;height:35rpx;display:inline-block;border-radius: 30rpx;"
|
|
||||||
v-if="youhuiIndex !== index"></text>
|
|
||||||
<u-icon name="checkmark-circle-fill" color="#fd6004" size="20" v-if="youhuiIndex === index">
|
|
||||||
</u-icon>
|
|
||||||
</view>
|
|
||||||
<br clear="both">
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view style="font-size: 20rpx;color: #aaa;margin-top: 30rpx;">* 每笔订单只能使用一张优惠价</view>
|
|
||||||
</view>
|
|
||||||
</u-popup>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import musicPlay from '@/components/music.vue'
|
||||||
import $http from '@/config/requestConfig.js';
|
import $http from '@/config/requestConfig.js';
|
||||||
import {
|
import {
|
||||||
mapState
|
mapState,mapMutations
|
||||||
} from 'vuex';
|
} from 'vuex';
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
||||||
|
playData:{},
|
||||||
youhuiShow:false,
|
youhuiShow:false,
|
||||||
youhuiIndex:'',
|
youhuiIndex:'',
|
||||||
youhuiList:[], // 优惠券列表
|
youhuiList:[], // 优惠券列表
|
||||||
@@ -229,7 +137,11 @@
|
|||||||
typeFen: 1,
|
typeFen: 1,
|
||||||
buyShow: false,
|
buyShow: false,
|
||||||
buysignShow: false,
|
buysignShow: false,
|
||||||
buysignContent: ''
|
buysignContent: '',
|
||||||
|
libLIst:[],
|
||||||
|
freeChapterCount:0,
|
||||||
|
isBuy:false,
|
||||||
|
shupingList:[],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -249,24 +161,24 @@
|
|||||||
onShow() {
|
onShow() {
|
||||||
this.getData();
|
this.getData();
|
||||||
},
|
},
|
||||||
|
components: {
|
||||||
|
musicPlay
|
||||||
|
},
|
||||||
//方法
|
//方法
|
||||||
methods: {
|
methods: {
|
||||||
|
...mapMutations(['setUserInfo']),
|
||||||
getData() {
|
getData() {
|
||||||
// 获取电子书详情
|
// 获取电子书详情
|
||||||
this.$http
|
this.$http
|
||||||
.post('book/book/appinfo/' + this.bookId + '/' + this.userInfo.id)
|
.post('book/book/appinfo/' + this.bookId + '/' + this.userInfo.id)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
|
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
|
||||||
if (this.bookMessage.isSale == 1) {
|
this.isBuy = res.book.isBuy
|
||||||
this.buysignContent = '您确定要花费' + this.bookMessage.salePrice + '疯币购买' + this.bokMesDet
|
this.freeChapterCount = res.book.freeChapterCount
|
||||||
.bookName + '吗?'
|
|
||||||
} else {
|
|
||||||
this.buysignContent = '您确定要花费' + this.bookMessage.price + '疯币购买' + this.bokMesDet
|
|
||||||
.bookName + '吗?'
|
|
||||||
}
|
|
||||||
|
|
||||||
this.bokMesDet.userId = this.userInfo.id
|
this.bokMesDet.userId = this.userInfo.id
|
||||||
|
|
||||||
@@ -292,113 +204,99 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
// 获取电子目录
|
// 获取电子目录
|
||||||
|
this.getLibList()
|
||||||
|
// 获取
|
||||||
|
this.getComments()
|
||||||
|
|
||||||
|
},
|
||||||
|
// 去听书
|
||||||
|
gotoListen(){
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "../listen/listen?bookid="+ this.bookId
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 去打卡
|
||||||
|
gotoclock(){
|
||||||
|
this.onPageJump('../clock/clock?bookid='+ this.bookId)
|
||||||
|
},
|
||||||
|
// 查看本书更多书评
|
||||||
|
toMore(val){
|
||||||
|
console.log(val,'val')
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '../comments/comments?bookid='+ this.bookId,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 去购买
|
||||||
|
goBuy(){
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '../bookShop/settlementBook?type=2&list=' + this.bookId
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 获取书评
|
||||||
|
getComments(){
|
||||||
|
let data = {
|
||||||
|
'page': 1,
|
||||||
|
'limit': 3,
|
||||||
|
'bookid' : this.bookId
|
||||||
|
}
|
||||||
|
this.$http
|
||||||
|
.post('forum/articles/descupdatelist', data)
|
||||||
|
.then(res => {
|
||||||
|
console.log(res.page.list,'评论获取成功')
|
||||||
|
this.shupingList = res.page.list
|
||||||
|
}).catch((e)=>{
|
||||||
|
console.log(e,'e')
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 播放单个音频
|
||||||
|
listenOne(item,index){
|
||||||
|
console.log('点击了',index)
|
||||||
|
if(this.libLIst.length > 0){
|
||||||
|
this.setUserInfo({'playIndex': index})
|
||||||
|
this.$music.setList(this.libLIst,'autoPlay',index)
|
||||||
|
this.setUserInfo({'playVisible': true})
|
||||||
|
uni.setStorage({
|
||||||
|
key: 'playVisible',
|
||||||
|
data: true,
|
||||||
|
success: function () {
|
||||||
|
console.log('success');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 本地存储播放列表
|
||||||
|
uni.setStorage({
|
||||||
|
key: 'playData',
|
||||||
|
data: {'myList':this.libLIst},
|
||||||
|
success: function () {
|
||||||
|
console.log('success');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 系统暂存
|
||||||
|
this.setUserInfo({'myList':this.libLIst})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 获取章节列表
|
||||||
|
getLibList(){
|
||||||
this.$http
|
this.$http
|
||||||
.post('book/book/getBookCatalogue', {
|
.post('book/book/getBookCatalogue', {
|
||||||
'bookid': this.bookId
|
'userid': this.userInfo.id,
|
||||||
|
'bookid': this.bookId,
|
||||||
|
// 'id': this.playid
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.bookCatalogue = res.bookCatalogue
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 用户详情
|
|
||||||
if (this.userInfo.id != undefined) {
|
|
||||||
this.$http
|
|
||||||
.post('book/user/info/' + this.userInfo.id)
|
|
||||||
.then(res => {
|
|
||||||
this.userMes = res.user
|
|
||||||
if (this.userMes.vip != 0) {
|
|
||||||
this.typeFen = 2
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// 加入书架
|
|
||||||
joInshelf() {
|
|
||||||
const that = this;
|
|
||||||
$http.request({
|
|
||||||
url: "book/bookshelf/save",
|
|
||||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
|
||||||
data: that.bokMesDet,
|
|
||||||
header: { //默认 无 说明:请求头
|
|
||||||
'Content-Type': 'application/json'
|
|
||||||
},
|
|
||||||
}).then(function(res) {
|
|
||||||
if(res.code == 0){
|
if(res.code == 0){
|
||||||
uni.showToast({
|
console.log(res,999)
|
||||||
title: '加入书架成功'
|
if(res.BookCatalogue.length > 0){
|
||||||
|
this.libLIst = res.BookCatalogue
|
||||||
|
// this.fengImg = res.images
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).catch((e)=>{
|
||||||
|
console.log(e.msg)
|
||||||
})
|
})
|
||||||
that.bookMessage.flag = true
|
|
||||||
}
|
|
||||||
}).catch(function(error) {
|
|
||||||
//这里只会在接口是失败状态返回,不需要去处理错误提示
|
|
||||||
console.log(error);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 点击tab
|
|
||||||
tab_click(e) {
|
|
||||||
this.tab_muJian = e.index
|
|
||||||
},
|
|
||||||
CyouhuiShow(){
|
|
||||||
this.youhuiShow = true
|
|
||||||
this.getCourpe()
|
|
||||||
this.buyShow = false // 隐藏购买弹窗
|
|
||||||
},
|
|
||||||
buyShowFun(){
|
|
||||||
this.buyShow = true
|
|
||||||
this.getCourpe()
|
|
||||||
},
|
|
||||||
hideyouhui(){
|
|
||||||
this.youhuiShow = false,
|
|
||||||
this.buyShow = true // 隐藏购买弹窗
|
|
||||||
},
|
|
||||||
clearYouhui(){
|
|
||||||
this.youhuiContent = {}
|
|
||||||
this.youhuiIndex = ''
|
|
||||||
this.useCouponAmount = ''
|
|
||||||
this.getData()
|
|
||||||
this.youhuiShow = false
|
|
||||||
this.buyShow = true // 隐藏购买弹窗
|
|
||||||
//this.couponMz = 0
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
// 选择优惠券
|
|
||||||
choseYouhui(e) {
|
|
||||||
this.youhuiIndex = e
|
|
||||||
this.youhuiContent = this.youhuiList[this.youhuiIndex]
|
|
||||||
console.log(this.youhuiContent, 'youhuiContent')
|
|
||||||
//this.couponMz = this.youhuiContent.coupons.couponAmount
|
|
||||||
|
|
||||||
if (this.bookMessage.isSale == 0) {
|
|
||||||
this.useCouponAmount = this.bookMessage.price - this.youhuiContent.coupons.couponAmount
|
|
||||||
} else {
|
|
||||||
this.useCouponAmount = this.bookMessage.salePrice - this.youhuiContent.coupons.couponAmount
|
|
||||||
}
|
|
||||||
this.buysignContent = '您确定要花费' + this.useCouponAmount + '疯币购买' + this.bokMesDet.bookName + '吗?'
|
|
||||||
// this.getData()
|
|
||||||
this.youhuiShow = false
|
|
||||||
this.buyShow = true // 隐藏购买弹窗
|
|
||||||
|
|
||||||
},
|
|
||||||
// 获取优惠券列表
|
|
||||||
getCourpe() {
|
|
||||||
let bookJiage = 0
|
|
||||||
if (this.bookMessage.isSale == 0) {
|
|
||||||
bookJiage = this.bookMessage.price
|
|
||||||
} else {
|
|
||||||
bookJiage = this.bookMessage.salePrice
|
|
||||||
}
|
|
||||||
this.bookJiageA = bookJiage
|
|
||||||
this.$http
|
|
||||||
.post('book/couponhistory/appGetUserCoupon?userId=' + this.userInfo.id + '&amount=' + this.bookJiageA + '&type=1' )
|
|
||||||
.then(res => {
|
|
||||||
this.youhuiList = res.userCoupons
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 跳转
|
// 跳转
|
||||||
onPageJump(url) {
|
onPageJump(url) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
@@ -406,55 +304,13 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
// 电子书阅读跳转
|
// 书评详情
|
||||||
onBokReadJump(e) {
|
toDetail(val){
|
||||||
const that = this;
|
console.log(val,'val')
|
||||||
|
|
||||||
// 加入阅读记录
|
|
||||||
$http.request({
|
|
||||||
// 存数据
|
|
||||||
url: "book/bookbrowserecords/save",
|
|
||||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
|
||||||
data: that.bokMesDet,
|
|
||||||
header: { //默认 无 说明:请求头
|
|
||||||
'Content-Type': 'application/json'
|
|
||||||
},
|
|
||||||
}).then(function(res) {
|
|
||||||
if (res.code == 0) {
|
|
||||||
console.log(res,'========');
|
|
||||||
if (res.browseRecordsId) {
|
|
||||||
$http.request({
|
|
||||||
// 更新
|
|
||||||
url: "book/bookbrowserecords/update",
|
|
||||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
|
||||||
data: {
|
|
||||||
'bookShelfId': res.browseRecordsId
|
|
||||||
},
|
|
||||||
header: { //默认 无 说明:请求头
|
|
||||||
'Content-Type': 'application/json'
|
|
||||||
},
|
|
||||||
}).then(function(res) {
|
|
||||||
if (res.code == 0) {
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '../yRead/angbook?Id=' + that.bookId + '&cha=' + e
|
url:'../comments/commentsDetail?bookid='+val.bookid+'&bfa_id='+val.id
|
||||||
});
|
})
|
||||||
}
|
|
||||||
}).catch(function(error) {
|
|
||||||
//这里只会在接口是失败状态返回,不需要去处理错误提示
|
|
||||||
console.log(error);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '../yRead/angbook?Id=' + that.bookId + '&cha=' + e
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}).catch(function(error) {
|
|
||||||
//这里只会在接口是失败状态返回,不需要去处理错误提示
|
|
||||||
console.log(error);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 信息介绍跳转
|
// 信息介绍跳转
|
||||||
onAuCHJump(id, e) {
|
onAuCHJump(id, e) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
@@ -462,88 +318,8 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// 提示购买
|
|
||||||
collectFee() {
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '请购买本书'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
// 充值疯币
|
|
||||||
buPoint() {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '../peanut/reCharge'
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
// 选择vip还是直接购买
|
|
||||||
chBuyType(e) {
|
|
||||||
let that = this
|
|
||||||
that.typeFen = e
|
|
||||||
},
|
|
||||||
|
|
||||||
// 开通VIP
|
|
||||||
buyVip() {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '../peanut/opeVip'
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
// 购买本书
|
|
||||||
buyMoneTip() {
|
|
||||||
let bookJiage = 0
|
|
||||||
if (this.bookMessage.isSale == 0) {
|
|
||||||
bookJiage = this.bookMessage.price
|
|
||||||
} else {
|
|
||||||
bookJiage = this.bookMessage.salePrice
|
|
||||||
}
|
|
||||||
// this.bookJiageA = bookJiage
|
|
||||||
if (bookJiage > this.userMes.peanutCoin) {
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '余额不足,请充值'
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.buysignShow = true
|
|
||||||
this.buyShow = false
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
buyMoney() {
|
|
||||||
let couponId = ''
|
|
||||||
if(this.youhuiContent.coupons.id != 0){ // 使用了优惠券
|
|
||||||
couponId = this.youhuiContent.coupons.id
|
|
||||||
}else{ // 未使用
|
|
||||||
couponId = '0'
|
|
||||||
}
|
|
||||||
console.log(this.youhuiIndex, this.youhuiContent.coupons.id, couponId)
|
|
||||||
this.$http
|
|
||||||
.post('book/user/buyEbook?bookId=' + this.bokMesDet.bookId + '&userId=' + this.userInfo.id + '&couponId=' + couponId)
|
|
||||||
.then(res => {
|
|
||||||
if (res.code == 0) {
|
|
||||||
if (res.status == 'error') {
|
|
||||||
this.buysignShow = false
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: res.msg
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: '购买成功'
|
|
||||||
})
|
|
||||||
this.buyShow = false
|
|
||||||
this.buysignShow = false
|
|
||||||
this.getData();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
cancelMoney() {
|
|
||||||
this.buysignShow = false
|
|
||||||
this.buyShow = true
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -552,6 +328,54 @@
|
|||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import '@/style/mixin.scss';
|
@import '@/style/mixin.scss';
|
||||||
|
.playing{color: #1daa5c;}
|
||||||
|
.flexbox{display: flex;}
|
||||||
|
.tags{
|
||||||
|
|
||||||
|
}
|
||||||
|
.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;}
|
||||||
|
}
|
||||||
|
.shupingList{
|
||||||
|
h4{font-size: 36rpx;}
|
||||||
|
.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;
|
||||||
|
overflow-x: hidden; font-size: 36rpx;
|
||||||
|
text-overflow: ellipsis;}
|
||||||
|
.tag{margin-left: 20rpx;}
|
||||||
|
.head_line {
|
||||||
|
margin: 50rpx 0 0 0;
|
||||||
|
|
||||||
|
|
||||||
|
b {
|
||||||
|
display: inline-block;
|
||||||
|
width: 12rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
background-color: #54a966;
|
||||||
|
vertical-align: bottom;
|
||||||
|
margin: 0 20rpx 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
text {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
i {
|
||||||
|
float: right;
|
||||||
|
font-style: normal;
|
||||||
|
color: #8b8a91;
|
||||||
|
font-size: 24rpx;
|
||||||
|
margin: 5rpx 35rpx 0 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
.yq_youhui {
|
.yq_youhui {
|
||||||
.yqLeft {
|
.yqLeft {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
@@ -587,13 +411,15 @@
|
|||||||
|
|
||||||
|
|
||||||
.bn_img {
|
.bn_img {
|
||||||
float: left;
|
|
||||||
width: 250upx;
|
width: 250upx;
|
||||||
height: 320upx;
|
height: 320upx;
|
||||||
|
img{width: 250upx;
|
||||||
|
height: 320upx;}
|
||||||
}
|
}
|
||||||
|
|
||||||
.bn_nes {
|
.bn_nes {
|
||||||
float: left;
|
width: 100%;
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
margin-left: 40rpx;
|
margin-left: 40rpx;
|
||||||
|
|
||||||
@@ -653,8 +479,8 @@
|
|||||||
margin: 20rpx 0 0 0;
|
margin: 20rpx 0 0 0;
|
||||||
|
|
||||||
.bt_cont {
|
.bt_cont {
|
||||||
font-size: 26rpx;
|
font-size: 34rpx;
|
||||||
line-height: 42rpx;
|
line-height: 60rpx;
|
||||||
color: #666;
|
color: #666;
|
||||||
padding: 0 10rpx;
|
padding: 0 10rpx;
|
||||||
|
|
||||||
|
|||||||
@@ -159,9 +159,9 @@
|
|||||||
|
|
||||||
// 电子书内容跳转
|
// 电子书内容跳转
|
||||||
onBookJump(e) {
|
onBookJump(e) {
|
||||||
// uni.navigateTo({
|
uni.navigateTo({
|
||||||
// url: './bookContent?Id=' + e.id
|
url: './bookContent?Id=' + e.id
|
||||||
// });
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -191,7 +191,10 @@
|
|||||||
.post('book/book/appinfo/' + this.bookid + '/' + this.userInfo.id)
|
.post('book/book/appinfo/' + this.bookid + '/' + this.userInfo.id)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if(res.code == 0){
|
if(res.code == 0){
|
||||||
|
console.log(res,'res')
|
||||||
this.bookInfo = res.book
|
this.bookInfo = res.book
|
||||||
|
this.isBuy = res.book.isBuy
|
||||||
|
this.freeChapterCount = res.book.freeChapterCount
|
||||||
}else{
|
}else{
|
||||||
console.log(res.msg)
|
console.log(res.msg)
|
||||||
}
|
}
|
||||||
@@ -427,8 +430,6 @@
|
|||||||
if(res.BookCatalogue.length > 0){
|
if(res.BookCatalogue.length > 0){
|
||||||
this.libLIst = res.BookCatalogue
|
this.libLIst = res.BookCatalogue
|
||||||
// this.fengImg = res.images
|
// this.fengImg = res.images
|
||||||
this.isBuy = res.buy
|
|
||||||
this.freeChapterCount = res.freeChapterCount
|
|
||||||
}else{
|
}else{
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title:'暂无可听章节哦~',
|
title:'暂无可听章节哦~',
|
||||||
|
|||||||
@@ -115,78 +115,9 @@
|
|||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="home_xinshu" v-if="showEbook">
|
|
||||||
<view v-for="(item, index) in xinsList" @click="onBookJump(item)" v-if="index<3" class="hx_list">
|
|
||||||
<image :src="item.image"></image>
|
|
||||||
<view class="hx_title">{{item.bookName}}</view>
|
|
||||||
<view class="hx_author">{{item.authorName}} [著]</view>
|
|
||||||
<b v-if="item.isVip==1" style="background: #c79119;">VIP</b>
|
|
||||||
<b v-if="item.isVip==2" style="background: #c74119;">付费</b>
|
|
||||||
</view>
|
|
||||||
<br clear='both'>
|
|
||||||
<view v-for="(item, index) in xinsList" @click="onBookJump(item)" v-if="index>2&&index<6" class="hx_list">
|
|
||||||
<image :src="item.image"></image>
|
|
||||||
<view class="hx_title">{{item.bookName}}</view>
|
|
||||||
<view class="hx_author">{{item.authorName}} [著]</view>
|
|
||||||
<b v-if="item.isVip==1" style="background: #c79119;">VIP</b>
|
|
||||||
<b v-if="item.isVip==2" style="background: #c74119;">付费</b>
|
|
||||||
</view>
|
|
||||||
<br clear='both'>
|
|
||||||
</view>
|
|
||||||
<!--按类型 类型推荐 -->
|
|
||||||
<view class="tuijianView">
|
|
||||||
|
|
||||||
</view>
|
|
||||||
<!-- end -->
|
<!-- end -->
|
||||||
<view class="head_line" v-if="showEbook">
|
|
||||||
<b></b>
|
|
||||||
<text>限时特价</text>
|
|
||||||
<i @click="onBookMore('Sale')">查看更多 ></i>
|
|
||||||
</view>
|
|
||||||
<view class="home_limit" v-if="showEbook">
|
|
||||||
<u-scroll-list indicatorActiveColor="#27b386">
|
|
||||||
<view v-for="(item, index) in limiTist" :key="index" @click="onBookJump(item)" class="lt_list">
|
|
||||||
<image :src="item.image"></image>
|
|
||||||
<view class="lt_title">{{item.bookName}}</view>
|
|
||||||
<view class="lt_author">{{item.authorName}} [著]</view>
|
|
||||||
<view class="lt_yuan">{{item.price}}疯币</view>
|
|
||||||
<view class="lt_xian">{{item.salePrice}}疯币</view>
|
|
||||||
<b v-if="item.isVip==1" style="background: #c79119;">VIP</b>
|
|
||||||
<b v-if="item.isVip==2" style="background: #c74119;">付费</b>
|
|
||||||
</view>
|
|
||||||
</u-scroll-list>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
|
<view class="head_line" style="margin-bottom: 10px;">
|
||||||
|
|
||||||
<view class="head_line" v-if="showEbook">
|
|
||||||
<b></b>
|
|
||||||
<text>精选书单</text>
|
|
||||||
<i @click="onBookMore('Best')">查看更多 ></i>
|
|
||||||
</view>
|
|
||||||
<view class="home_jingxu" v-if="showEbook">
|
|
||||||
<view class="hj_hot" v-for="(item,index) in jingList" @click="onBookJump(item)">
|
|
||||||
<view>
|
|
||||||
<text class="bok_name">{{item.bookName}}</text>
|
|
||||||
<text style="margin-left: 50rpx;" v-if="item.authorName!=''">{{item.authorName}}</text>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view v-if="item.publisherName!=''">
|
|
||||||
<text>出版社:{{item.publisherName}}</text>
|
|
||||||
</view>
|
|
||||||
<view>
|
|
||||||
<text>{{item.introduce | ellipsis}}</text>
|
|
||||||
</view>
|
|
||||||
<image :src="item.image"></image>
|
|
||||||
<!-- <b v-if="item.isVip==0">免费</b> -->
|
|
||||||
<b v-if="item.isVip==1" style="background: #c79119;">VIP</b>
|
|
||||||
<b v-if="item.isVip==2" style="background: #c74119;">付费</b>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
|
|
||||||
<view class="head_line">
|
|
||||||
<b></b>
|
<b></b>
|
||||||
<text>精选商品</text>
|
<text>精选商品</text>
|
||||||
<!-- <i @click="onShopMore('Hot')">查看更多 ></i> -->
|
<!-- <i @click="onShopMore('Hot')">查看更多 ></i> -->
|
||||||
@@ -210,7 +141,13 @@
|
|||||||
</view>
|
</view>
|
||||||
<br clear="both">
|
<br clear="both">
|
||||||
</view>
|
</view>
|
||||||
|
<view v-if="status==0" style="text-align: center;">
|
||||||
|
<u-loading-icon style="display: inline-block;"></u-loading-icon>
|
||||||
|
<font style='vertical-align: super;margin-left: 10px;font-size: 26rpx;color: #909399;'>努力加载中</font>
|
||||||
|
</view>
|
||||||
|
<view v-if="status==1">
|
||||||
|
<u-divider text="全部加载完成"></u-divider>
|
||||||
|
</view>
|
||||||
|
|
||||||
<view>
|
<view>
|
||||||
<u-back-top :scroll-top="scrollTop" bottom="60" :customStyle='bgiStyle' :iconStyle="iconStyle"></u-back-top>
|
<u-back-top :scroll-top="scrollTop" bottom="60" :customStyle='bgiStyle' :iconStyle="iconStyle"></u-back-top>
|
||||||
@@ -228,7 +165,8 @@
|
|||||||
import repciptData from '@/static/json/repcipt.json'
|
import repciptData from '@/static/json/repcipt.json'
|
||||||
import $http from '@/config/requestConfig.js';
|
import $http from '@/config/requestConfig.js';
|
||||||
import {
|
import {
|
||||||
mapState,mapMutations
|
mapState,
|
||||||
|
mapMutations
|
||||||
} from 'vuex';
|
} from 'vuex';
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
@@ -238,6 +176,9 @@
|
|||||||
transaction: { // 成功回调
|
transaction: { // 成功回调
|
||||||
|
|
||||||
},
|
},
|
||||||
|
status: 3,
|
||||||
|
jPage: 1,
|
||||||
|
jTotal: 0,
|
||||||
scrollLeft: 0,
|
scrollLeft: 0,
|
||||||
maxTimes: 1, // 轮询最大次数
|
maxTimes: 1, // 轮询最大次数
|
||||||
ComplateRequestInterval: null, // 轮询定时器
|
ComplateRequestInterval: null, // 轮询定时器
|
||||||
@@ -279,6 +220,7 @@
|
|||||||
onShow() {
|
onShow() {
|
||||||
// 隐藏原生的tabbar
|
// 隐藏原生的tabbar
|
||||||
uni.hideTabBar();
|
uni.hideTabBar();
|
||||||
|
this.goodsList = []
|
||||||
this.getData();
|
this.getData();
|
||||||
|
|
||||||
|
|
||||||
@@ -289,12 +231,27 @@
|
|||||||
},
|
},
|
||||||
// 下拉刷新
|
// 下拉刷新
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
|
console.log('下拉刷新')
|
||||||
|
this.jPage = 1
|
||||||
|
this.goodsList = []
|
||||||
this.getData()
|
this.getData()
|
||||||
uni.stopPullDownRefresh()
|
uni.stopPullDownRefresh()
|
||||||
this.requestIapOrder()
|
this.requestIapOrder()
|
||||||
},
|
},
|
||||||
|
onHide() {
|
||||||
|
this.jPage = 1
|
||||||
|
this.goodsList = []
|
||||||
|
|
||||||
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
console.log('到底了')
|
||||||
|
// if (this.jPage + 1 <= this.jTotal) {
|
||||||
|
// this.jPage++
|
||||||
|
// this.getJBook()
|
||||||
|
// } else {
|
||||||
|
// this.status = 1
|
||||||
|
// }
|
||||||
|
},
|
||||||
filters: {
|
filters: {
|
||||||
// 控制字数
|
// 控制字数
|
||||||
ellipsis(value) {
|
ellipsis(value) {
|
||||||
@@ -317,7 +274,21 @@
|
|||||||
//方法
|
//方法
|
||||||
methods: {
|
methods: {
|
||||||
...mapMutations(['setUserInfo']),
|
...mapMutations(['setUserInfo']),
|
||||||
|
gotopingshu(val) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '../comments/comments?bookid=' + val.id,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 去打卡
|
||||||
|
gotoclock(item) {
|
||||||
|
this.onPageJump('../clock/clock?bookid=' + item.id)
|
||||||
|
},
|
||||||
|
// 去听书
|
||||||
|
gotoListen(item) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "../listen/listen?bookid=" + item.id
|
||||||
|
});
|
||||||
|
},
|
||||||
// 新书上市
|
// 新书上市
|
||||||
getNewBook() {
|
getNewBook() {
|
||||||
this.$http
|
this.$http
|
||||||
@@ -397,7 +368,9 @@
|
|||||||
console.log('关闭订单成功', index);
|
console.log('关闭订单成功', index);
|
||||||
|
|
||||||
if (index == this.ComplateRequestArr.length - 1) { // 最后一个支付订单
|
if (index == this.ComplateRequestArr.length - 1) { // 最后一个支付订单
|
||||||
this.setUserInfo({restoreFlag:false});
|
this.setUserInfo({
|
||||||
|
restoreFlag: false
|
||||||
|
});
|
||||||
// console.log(this.userInfo.restoreFlag,'this.ComplateRequestArr.length+++')
|
// console.log(this.userInfo.restoreFlag,'this.ComplateRequestArr.length+++')
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -511,17 +484,20 @@
|
|||||||
// this.seckillList = null
|
// this.seckillList = null
|
||||||
})
|
})
|
||||||
|
|
||||||
// 获取精选商品
|
// 获取精选图书
|
||||||
|
this.getJBook()
|
||||||
|
|
||||||
|
this.getNewBook()
|
||||||
|
},
|
||||||
|
// 获取精选图书
|
||||||
|
getJBook() {
|
||||||
this.$http
|
this.$http
|
||||||
.post('book/shopproduct/appGetList?limit=30&page=1&istop=1')
|
.post('book/shopproduct/appGetList?limit=30&page=1&istop=1')
|
||||||
.then(res => {
|
.then(res => {
|
||||||
console.log(res.page.list, '首页商品')
|
console.log(res.page.list, '首页商品')
|
||||||
this.goodsList = res.page.list
|
this.goodsList = res.page.list
|
||||||
})
|
})
|
||||||
|
|
||||||
this.getNewBook()
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 跳转
|
// 跳转
|
||||||
onPageJump(url) {
|
onPageJump(url) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
@@ -551,7 +527,7 @@
|
|||||||
// 电子书内容跳转
|
// 电子书内容跳转
|
||||||
onBookJump(e) {
|
onBookJump(e) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '../eBook/bookContent?Id=' + e.bookid
|
url: '../eBook/bookContent?Id=' + e.id
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 商品详情页
|
// 商品详情页
|
||||||
@@ -583,26 +559,62 @@
|
|||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import '@/style/mixin.scss';
|
@import '@/style/mixin.scss';
|
||||||
.newBook{margin-top: 20rpx;}
|
|
||||||
.scroll-view_H{background-color: #fff;white-space: nowrap;
|
.tags {
|
||||||
width: 100%; padding:10rpx ; }
|
uni-tag {
|
||||||
|
margin-right: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.newBook {
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.scroll-view_H {
|
.scroll-view_H {
|
||||||
.item { padding: 10rpx; overflow: hidden; display: inline-block;
|
background-color: #fff;
|
||||||
width: 180rpx !important; margin-right: 20rpx; border-radius: 10rpx;
|
white-space: nowrap;
|
||||||
|
width: 100%;
|
||||||
|
padding: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.scroll-view_H {
|
||||||
|
.item {
|
||||||
|
padding: 10rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
display: inline-block;
|
||||||
|
width: 180rpx !important;
|
||||||
|
margin-right: 20rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
|
||||||
.videoBox {
|
.videoBox {
|
||||||
image{display: block; width:150rpx;
|
image {
|
||||||
|
display: block;
|
||||||
|
width: 150rpx;
|
||||||
height: 170rpx;
|
height: 170rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.bookName{display: block; margin-top: 20rpx; color: #666; font-size: 24rpx; white-space: nowrap;
|
|
||||||
overflow-x: hidden; overflow: hidden;
|
.bookName {
|
||||||
text-overflow: ellipsis;}
|
display: block;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
color: #666;
|
||||||
|
font-size: 24rpx;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow-x: hidden;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// .item.active{margin-right: 20rpx; border: 1px solid #55aa00; border-radius: 10rpx;}
|
// .item.active{margin-right: 20rpx; border: 1px solid #55aa00; border-radius: 10rpx;}
|
||||||
}
|
}
|
||||||
.flexbox{display: flex;}
|
|
||||||
|
.flexbox {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
.head_line {
|
.head_line {
|
||||||
margin: 50rpx 0 0 0;
|
margin: 30rpx 0 0 0;
|
||||||
|
|
||||||
|
|
||||||
b {
|
b {
|
||||||
@@ -635,17 +647,26 @@
|
|||||||
background-size: cover;
|
background-size: cover;
|
||||||
padding: 20rpx;
|
padding: 20rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
// height: 400rpx; margin-bottom: 130rpx;
|
// height: 400rpx; margin-bottom: 130rpx;
|
||||||
.icon_hua_1 {
|
.icon_hua_1 {
|
||||||
// margin: 0 auto;
|
// margin: 0 auto;
|
||||||
width: 150rpx;
|
width: 150rpx;
|
||||||
height: 150rpx;
|
height: 150rpx;
|
||||||
}
|
}
|
||||||
.icon_hua{width: 150rpx; display: block;}
|
|
||||||
.search_box { margin-top: 20rpx; align-items: center;
|
.icon_hua {
|
||||||
|
width: 150rpx;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search_box {
|
||||||
|
margin-top: 20rpx;
|
||||||
|
align-items: center;
|
||||||
width: calc(100% - 300rpx);
|
width: calc(100% - 300rpx);
|
||||||
|
|
||||||
.search{height: 80upx;
|
.search {
|
||||||
|
height: 80upx;
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -654,8 +675,10 @@
|
|||||||
border-radius: 20upx;
|
border-radius: 20upx;
|
||||||
box-shadow: 0 0px 10px 1px #54a96633;
|
box-shadow: 0 0px 10px 1px #54a96633;
|
||||||
}
|
}
|
||||||
|
|
||||||
.prompt {
|
.prompt {
|
||||||
color: #838383; font-size: 24rpx;
|
color: #838383;
|
||||||
|
font-size: 24rpx;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -669,30 +692,40 @@
|
|||||||
margin-right: 20upx;
|
margin-right: 20upx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.searBtn {
|
.searBtn {
|
||||||
width: 80rpx; align-items: center;
|
width: 80rpx;
|
||||||
font-size: 30rpx; color: #fff;
|
align-items: center;
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: #fff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.home_nar { padding-bottom: 20rpx;
|
|
||||||
margin: 30rpx 20rpx; justify-content: space-between;
|
.home_nar {
|
||||||
|
padding-bottom: 20rpx;
|
||||||
|
margin: 30rpx 20rpx;
|
||||||
|
justify-content: space-between;
|
||||||
display: flex;
|
display: flex;
|
||||||
color: #333;
|
color: #333; margin-bottom: 0 !important;
|
||||||
|
|
||||||
// .dianzishu{ margin-right:10rpx;
|
// .dianzishu{ margin-right:10rpx;
|
||||||
// background-color:#f8d6f4 ; border: 2px solid #edcce9;
|
// background-color:#f8d6f4 ; border: 2px solid #edcce9;
|
||||||
// }
|
// }
|
||||||
// .chaoshi{background-color:#fff2d8 ; border: 2px solid #ede6d3; }
|
// .chaoshi{background-color:#fff2d8 ; border: 2px solid #ede6d3; }
|
||||||
// .shuping{ background-color: #d6ffda; border: 2px solid #bae9bf;}
|
// .shuping{ background-color: #d6ffda; border: 2px solid #bae9bf;}
|
||||||
// .shuguan{ background-color:#e3f9f9 ; border: 2px solid #d7eced; }
|
// .shuguan{ background-color:#e3f9f9 ; border: 2px solid #d7eced; }
|
||||||
.hn_cl_tit { padding-bottom: 10rpx;
|
.hn_cl_tit {
|
||||||
|
padding-bottom: 10rpx;
|
||||||
// width: 23%;
|
// width: 23%;
|
||||||
width: 31%;
|
width: 31%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
border-radius: 20rpx ; padding-top: 10rpx;
|
border-radius: 20rpx;
|
||||||
|
padding-top: 10rpx;
|
||||||
// line-height: 110upx;
|
// line-height: 110upx;
|
||||||
//display: flex;
|
//display: flex;
|
||||||
align-content: center;
|
align-content: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
image {
|
image {
|
||||||
width: 110upx;
|
width: 110upx;
|
||||||
height: 110upx;
|
height: 110upx;
|
||||||
@@ -700,7 +733,15 @@
|
|||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
// margin: 0 20rpx;
|
// margin: 0 20rpx;
|
||||||
}
|
}
|
||||||
text{ display:block; text-align: center; margin-top: 10px; font-size: 36rpx; color: #000; font-weight:blod;}
|
|
||||||
|
text {
|
||||||
|
display: block;
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 10px;
|
||||||
|
font-size: 36rpx;
|
||||||
|
color: #000;
|
||||||
|
font-weight: blod;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -992,12 +1033,17 @@
|
|||||||
.goodsPrice {
|
.goodsPrice {
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
margin: 5rpx 0 0 3rpx;
|
margin: 5rpx 0 0 3rpx;
|
||||||
display: flex; justify-content: space-between;
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
.price {
|
.price {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #bf0c0c;
|
color: #bf0c0c;
|
||||||
}
|
}
|
||||||
.Salesnum{color: #9b9b9b;}
|
|
||||||
|
.Salesnum {
|
||||||
|
color: #9b9b9b;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user