苹果支付构建版本
This commit is contained in:
@@ -17,14 +17,14 @@
|
|||||||
<!-- 二级分类、商品 -->
|
<!-- 二级分类、商品 -->
|
||||||
<view class="twoBox" style="">
|
<view class="twoBox" style="">
|
||||||
<!-- <u-sticky> -->
|
<!-- <u-sticky> -->
|
||||||
<u-tabs :list="towLevel" :inactiveStyle="{fontSize:'28rpx'}" lineWidth="40" @click="getCategoryList"
|
<u-tabs v-if="utabs" :list="towLevel" :current = "0" :inactiveStyle="{fontSize:'28rpx'}" lineWidth="40" @click="getCategoryList"
|
||||||
:activeStyle="{transform: 'scale(1.01)'}"></u-tabs>
|
:activeStyle="{transform: 'scale(1.01)'}"></u-tabs>
|
||||||
<!-- </u-sticky> -->
|
<!-- </u-sticky> -->
|
||||||
</view>
|
</view>
|
||||||
<view class="classfyBody">
|
<view class="classfyBody">
|
||||||
<!-- 二级分类、商品 -->
|
<!-- 二级分类、商品 -->
|
||||||
<view class="towLevel" v-if="towLevel.length > 0">
|
<view class="towLevel" v-if="towLevel.length > 0">
|
||||||
<view class="towLevelContent" v-if="commodityList.length > 0">
|
<view class="towLevelContent" v-if="commodityList && commodityList.length > 0">
|
||||||
<view class="commodityItem" v-for="(item,index) in commodityList" :key="index"
|
<view class="commodityItem" v-for="(item,index) in commodityList" :key="index"
|
||||||
@click.stop="toDetail(item.productId)">
|
@click.stop="toDetail(item.productId)">
|
||||||
<view class="box">
|
<view class="box">
|
||||||
@@ -59,6 +59,9 @@
|
|||||||
暂无分类
|
暂无分类
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view>
|
||||||
|
<u-back-top :scroll-top="scrollTop" bottom="60" :customStyle='bgiStyle' :iconStyle="iconStyle"></u-back-top>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -72,9 +75,20 @@
|
|||||||
return {
|
return {
|
||||||
highlight: '', // 高亮下标
|
highlight: '', // 高亮下标
|
||||||
current: 0,
|
current: 0,
|
||||||
|
twocurrent:0,
|
||||||
oneLevel: [],
|
oneLevel: [],
|
||||||
towLevel: [],
|
towLevel: [],
|
||||||
commodityList: [] // 商品列表
|
commodityList: [] ,// 商品列表
|
||||||
|
utabs:false,
|
||||||
|
bgiStyle: {
|
||||||
|
background: '#2ab58833'
|
||||||
|
},
|
||||||
|
iconStyle: {
|
||||||
|
fontSize: '40rpx',
|
||||||
|
fontWeight: 'bold',
|
||||||
|
color: '#54a966',
|
||||||
|
},
|
||||||
|
scrollTop: 0,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// contentButtonClick(e) {
|
// contentButtonClick(e) {
|
||||||
@@ -96,8 +110,16 @@
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['userInfo']),
|
...mapState(['userInfo']),
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
setTimeout(() => { // 解决vant-tab组件官方问题:底部条位置错误
|
||||||
|
this.utabs = true
|
||||||
|
}, 200)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
onPageScroll(e) {
|
||||||
|
this.scrollTop = e.scrollTop;
|
||||||
|
},
|
||||||
// 跳转
|
// 跳转
|
||||||
onPageJump(url) {
|
onPageJump(url) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
@@ -116,6 +138,9 @@
|
|||||||
},
|
},
|
||||||
// 点击一级分类
|
// 点击一级分类
|
||||||
getTowLevel(e) {
|
getTowLevel(e) {
|
||||||
|
this.utabs = false
|
||||||
|
// this.twocurrent = 0;
|
||||||
|
uni.showLoading()
|
||||||
this.$http
|
this.$http
|
||||||
.post(`book/shopcategory/getTwoLevel?catId=${e.catId}`)
|
.post(`book/shopcategory/getTwoLevel?catId=${e.catId}`)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
@@ -133,7 +158,9 @@
|
|||||||
// console.log(this.towLevel, 'towLevel')
|
// console.log(this.towLevel, 'towLevel')
|
||||||
this.getCategoryList(res.list[0])
|
this.getCategoryList(res.list[0])
|
||||||
}
|
}
|
||||||
|
uni.hideLoading()
|
||||||
|
this.utabs = true
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -141,7 +168,7 @@
|
|||||||
getCategoryList(e) {
|
getCategoryList(e) {
|
||||||
// console.log(e)
|
// console.log(e)
|
||||||
// return false
|
// return false
|
||||||
// this.highlight = index
|
// this.highlight = index
|
||||||
this.$http
|
this.$http
|
||||||
.post('book/shopproduct/appGetCategoryList', {
|
.post('book/shopproduct/appGetCategoryList', {
|
||||||
'catId': e.catId
|
'catId': e.catId
|
||||||
@@ -237,7 +264,12 @@
|
|||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `./commodityDetail?id=${id}`
|
url: `./commodityDetail?id=${id}`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
onPullDownRefresh(){
|
||||||
|
// console.log('refresh');
|
||||||
|
this.commodityList = []
|
||||||
|
this.getOneLevel()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -335,7 +367,9 @@
|
|||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
padding: 10rpx 20rpx;
|
padding: 10rpx 20rpx;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
align-items: stretch;
|
||||||
|
// align-content:center;
|
||||||
|
align-content:start;
|
||||||
.commodityItem {
|
.commodityItem {
|
||||||
width: 50%;
|
width: 50%;
|
||||||
// background-color: #fff;
|
// background-color: #fff;
|
||||||
|
|||||||
@@ -28,9 +28,11 @@
|
|||||||
<!-- 详情 + 评价1 -->
|
<!-- 详情 + 评价1 -->
|
||||||
<view class="bookInfo">
|
<view class="bookInfo">
|
||||||
<u-row customStyle="margin-bottom: 10px">
|
<u-row customStyle="margin-bottom: 10px">
|
||||||
<u-col span="6"><span>书名:{{productInfo.productName}}</span></u-col>
|
<u-col ><span>书名:{{productInfo.productName}}</span></u-col>
|
||||||
<u-col span="6" v-if="productInfo.author"><span>作者:{{productInfo.author}}</span></u-col>
|
</u-row>
|
||||||
</u-row>
|
<u-row customStyle="margin-bottom: 10px">
|
||||||
|
<u-col v-if="productInfo.author"><span>作者:{{productInfo.author}}</span></u-col>
|
||||||
|
</u-row>
|
||||||
<u-row>
|
<u-row>
|
||||||
|
|
||||||
<u-col span="6" v-if="productInfo.publisher"><span>出版社:{{productInfo.publisher}}</span></u-col>
|
<u-col span="6" v-if="productInfo.publisher"><span>出版社:{{productInfo.publisher}}</span></u-col>
|
||||||
|
|||||||
@@ -345,7 +345,7 @@
|
|||||||
position: fixed;
|
position: fixed;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
top: 130upx;
|
top: 150rpx;
|
||||||
|
|
||||||
.top-left {
|
.top-left {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|||||||
@@ -9,23 +9,23 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="home_nar">
|
<view class="home_nar">
|
||||||
<view class="hn_cl_tit" @click="onPageJump('../eBook/bookList')">
|
<view class="hn_cl_tit dianzishu" @click="onPageJump('../eBook/bookList')">
|
||||||
<image src="../../static/icon/home_bar_1.png" mode="aspectFit"></image>
|
<image src="../../static/icon/home_bar_1.png" mode="aspectFit"></image>
|
||||||
电子书
|
<text>电子书</text>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="hn_cl_tit" @click="onPageJump('../bookShop/bookShopIndex')"> -->
|
<!-- <view class="hn_cl_tit" @click="onPageJump('../bookShop/bookShopIndex')"> -->
|
||||||
<view class="hn_cl_tit" @click="onPageJump('../bookShop/classify')">
|
<view class="hn_cl_tit chaoshi" @click="onPageJump('../bookShop/classify')">
|
||||||
<image src="../../static/icon/home_bar_2.png" mode="aspectFit"></image>
|
<image src="../../static/icon/home_bar_2.png" mode="aspectFit"></image>
|
||||||
健康超市
|
<text>健康超市</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="hn_cl_tit" @click="onGoing()">
|
<!-- <view class="hn_cl_tit" @click="onGoing()">
|
||||||
<image src="../../static/icon/home_bar_3.png" mode="aspectFit"></image>
|
<image src="../../static/icon/home_bar_3.png" mode="aspectFit"></image>
|
||||||
讲书
|
讲书
|
||||||
</view>
|
</view>
|
||||||
<view class="hn_cl_tit" @click="onGoing()">
|
<view class="hn_cl_tit" @click="onGoing()">
|
||||||
<image src="../../static/icon/home_bar_4.png" mode="aspectFit"></image>
|
<image src="../../static/icon/home_bar_4.png" mode="aspectFit"></image>
|
||||||
论文集
|
论文集
|
||||||
</view>
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="home_lunbo">
|
<view class="home_lunbo">
|
||||||
@@ -416,18 +416,27 @@
|
|||||||
margin: 60rpx 50rpx 0 50rpx;
|
margin: 60rpx 50rpx 0 50rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
color: #333;
|
color: #333;
|
||||||
|
.dianzishu{ margin-right:10rpx;
|
||||||
|
background-color: #d6ffda; border: 2px solid #bae9bf;
|
||||||
|
}
|
||||||
|
.chaoshi{background-color:#fff2d8 ; margin-left:10rpx; border: 2px solid #ede6d3; }
|
||||||
.hn_cl_tit {
|
.hn_cl_tit {
|
||||||
width: 25%;
|
width: 50%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
border-radius: 20rpx ; padding-top: 10rpx;
|
||||||
|
// line-height: 110upx;
|
||||||
|
display: flex;
|
||||||
|
align-content: center;
|
||||||
|
justify-content: center;
|
||||||
image {
|
image {
|
||||||
|
|
||||||
width: 110upx;
|
width: 110upx;
|
||||||
height: 110upx;
|
height: 110upx;
|
||||||
margin: 0 auto;
|
display: inline-block;
|
||||||
|
// margin: 0 auto;
|
||||||
// margin: 0 20rpx;
|
// margin: 0 20rpx;
|
||||||
}
|
}
|
||||||
|
text{height: 100upx; display:inline-block; line-height: 100upx; font-size: 34rpx;}
|
||||||
}
|
}
|
||||||
|
|
||||||
.hn_cl_tit:nth-child(1),
|
.hn_cl_tit:nth-child(1),
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
<view class="cf_radio">
|
<view class="cf_radio">
|
||||||
<u-radio-group v-model="payType">
|
<u-radio-group v-model="payType">
|
||||||
<!-- #ifdef MP-WEIXIN -->
|
<!-- #ifdef APP-ANDROID -->
|
||||||
<view style="width: 100%;" >
|
<view style="width: 100%;" >
|
||||||
<view v-for="(item, index) in paylist" @click="choseType(item.id)"
|
<view v-for="(item, index) in paylist" @click="choseType(item.id)"
|
||||||
:class="payType == item.id?'Tab_xf cf_xuanx':'cf_xuanx'">
|
:class="payType == item.id?'Tab_xf cf_xuanx':'cf_xuanx'">
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
<view>* 我已阅读并同意<span class="highlight" @click="showXieyi">《增值服务协议》</span></view>
|
<view>* 我已阅读并同意<span class="highlight" @click="showXieyi">《增值服务协议》</span></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="char_btn">
|
<view class="char_btn">
|
||||||
<!-- #ifdef MP-WEIXIN -->
|
<!-- #ifdef APP-ANDROID -->
|
||||||
<view @click="kaiChar">立即充值</view>
|
<view @click="kaiChar">立即充值</view>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- #ifdef APP-IOS -->
|
<!-- #ifdef APP-IOS -->
|
||||||
@@ -124,7 +124,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
iosPaylist: [{
|
iosPaylist: [{
|
||||||
title: 'IOS支付',
|
title: 'apple pay支付',
|
||||||
id: 3,
|
id: 3,
|
||||||
img: '../../static/icon/pay_2.png'
|
img: '../../static/icon/pay_2.png'
|
||||||
}],
|
}],
|
||||||
@@ -191,6 +191,7 @@
|
|||||||
mask: true
|
mask: true
|
||||||
})
|
})
|
||||||
const that = this
|
const that = this
|
||||||
|
console.log(that.stepsCj.priceTypeId,88888888)
|
||||||
// ['xxxxx'] 是平台申请拿到的内购商品的id
|
// ['xxxxx'] 是平台申请拿到的内购商品的id
|
||||||
that.iapChannel.requestOrder(that.stepsCj.priceTypeId, function(event) {
|
that.iapChannel.requestOrder(that.stepsCj.priceTypeId, function(event) {
|
||||||
// uni.hideLoading()
|
// uni.hideLoading()
|
||||||
|
|||||||
@@ -98,7 +98,7 @@
|
|||||||
</z-popup>
|
</z-popup>
|
||||||
|
|
||||||
<!-- #ifdef APP-PLUS -->
|
<!-- #ifdef APP-PLUS -->
|
||||||
<view class="third_party_login_box" v-if="isIos && system >= 13">
|
<!-- <view class="third_party_login_box" v-if="isIos && system >= 13">
|
||||||
<view class="third_party_title"><text>第三方登录</text></view>
|
<view class="third_party_title"><text>第三方登录</text></view>
|
||||||
<view class="third_party_content">
|
<view class="third_party_content">
|
||||||
<image src="../../static/icon/ic_login_weixin.png" v-if="isWeixin" @click="onWxAppLogin"
|
<image src="../../static/icon/ic_login_weixin.png" v-if="isWeixin" @click="onWxAppLogin"
|
||||||
@@ -106,7 +106,7 @@
|
|||||||
<image src="../../static/icon/ic_login_ios.png" v-if="isIos && system >= 13" @click="onAppleLogin"
|
<image src="../../static/icon/ic_login_ios.png" v-if="isIos && system >= 13" @click="onAppleLogin"
|
||||||
mode="aspectFit"></image>
|
mode="aspectFit"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -20,7 +20,7 @@
|
|||||||
<view class="inner-box" :style="{ height: `${innerHeight}px` }">
|
<view class="inner-box" :style="{ height: `${innerHeight}px` }">
|
||||||
<view class="book-inner" id="preChapter"
|
<view class="book-inner" id="preChapter"
|
||||||
:style="{ fontSize: `${fontSize}px`, lineHeight: `${lineHeight * fontSize}px` }">
|
:style="{ fontSize: `${fontSize}px`, lineHeight: `${lineHeight * fontSize}px` }">
|
||||||
<p v-for="(item, index) in preChapter.text" :key="index" v-html="item.picAndWord"></p>
|
<p v-for="(item, index) in preChapter.text" :key="index" v-html="item.content"></p>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
<view class="inner-box" :style="{ height: `${innerHeight}px` }">
|
<view class="inner-box" :style="{ height: `${innerHeight}px` }">
|
||||||
<view class="book-inner" id="curChapter"
|
<view class="book-inner" id="curChapter"
|
||||||
:style="{ fontSize: `${fontSize}px`, lineHeight: `${lineHeight * fontSize}px` }">
|
:style="{ fontSize: `${fontSize}px`, lineHeight: `${lineHeight * fontSize}px` }">
|
||||||
<p v-for="(item, index) in curChapter.text" :key="index" v-html="item.picAndWord">
|
<p v-for="(item, index) in curChapter.text" :key="index" v-html="item.content">
|
||||||
</p>
|
</p>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
<view id="nextChapter"
|
<view id="nextChapter"
|
||||||
:style="{ fontSize: `${fontSize}px`, lineHeight: `${lineHeight * fontSize}px` }">
|
:style="{ fontSize: `${fontSize}px`, lineHeight: `${lineHeight * fontSize}px` }">
|
||||||
<p class="book-inner" v-for="(item, index) in nextChapter.text" :key="index"
|
<p class="book-inner" v-for="(item, index) in nextChapter.text" :key="index"
|
||||||
v-html="item.picAndWord"></p>
|
v-html="item.content"></p>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
|
|
||||||
<!-- 垂直翻页 -->
|
<!-- 垂直翻页 -->
|
||||||
<!-- @click="showMenu" -->
|
<!-- @click="showMenu" -->
|
||||||
|
|
||||||
<!-- 横向翻页 -->
|
<!-- 横向翻页 -->
|
||||||
<view class="across" >
|
<view class="across" >
|
||||||
<!-- 阅读页(结构和样式请和仅用于计算元素一致) -->
|
<!-- 阅读页(结构和样式请和仅用于计算元素一致) -->
|
||||||
@@ -299,14 +299,14 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<view class="item-name">排版</view>
|
<view class="item-name">排版</view>
|
||||||
<view class="type-setting" :class="{ active: lineHeight === 1 }" @click="changeLineHeight(1)">
|
<view class="type-setting" :class="{ active: lineHeight === 4 }" @click="changeLineHeight(4)">
|
||||||
<view class="line" :class="{ lineActive: lineHeight === 1 }" v-for="i in 5" :key="i"></view>
|
<view class="line" :class="{ lineActive: lineHeight === 4 }" v-for="i in 5" :key="i"></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="type-setting" :class="{ active: lineHeight === 1.5 }" @click="changeLineHeight(1.5)">
|
<view class="type-setting" :class="{ active: lineHeight === 5 }" @click="changeLineHeight(5)">
|
||||||
<view class="line" :class="{ lineActive: lineHeight === 1.5 }" v-for="i in 4" :key="i"></view>
|
<view class="line" :class="{ lineActive: lineHeight === 5 }" v-for="i in 4" :key="i"></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="type-setting" :class="{ active: lineHeight === 2 }" @click="changeLineHeight(2)">
|
<view class="type-setting" :class="{ active: lineHeight === 6 }" @click="changeLineHeight(6)">
|
||||||
<view class="line" :class="{ lineActive: lineHeight === 2 }" v-for="i in 3" :key="i"></view>
|
<view class="line" :class="{ lineActive: lineHeight === 6 }" v-for="i in 3" :key="i"></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item">
|
<view class="item">
|
||||||
@@ -406,11 +406,12 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<view class="item-name">排版</view>
|
<view class="item-name">排版</view>
|
||||||
<view class="type-setting" :class="{ active: lineHeight === 1 }"
|
<!-- 这个行高没有必要存在,不符合阅读条件 -->
|
||||||
|
<!-- <view class="type-setting" :class="{ active: lineHeight === 1 }"
|
||||||
@click="changeLineHeight(1)">
|
@click="changeLineHeight(1)">
|
||||||
<view class="line" :class="{ lineActive: lineHeight === 1 }" v-for="i in 5" :key="i">
|
<view class="line" :class="{ lineActive: lineHeight === 1 }" v-for="i in 5" :key="i">
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
<view class="type-setting" :class="{ active: lineHeight === 1.5 }"
|
<view class="type-setting" :class="{ active: lineHeight === 1.5 }"
|
||||||
@click="changeLineHeight(1.5)">
|
@click="changeLineHeight(1.5)">
|
||||||
<view class="line" :class="{ lineActive: lineHeight === 1.5 }" v-for="i in 4" :key="i">
|
<view class="line" :class="{ lineActive: lineHeight === 1.5 }" v-for="i in 4" :key="i">
|
||||||
@@ -628,7 +629,7 @@ import { nextTick } from "vue";
|
|||||||
directoryShowBefore: false, // 目录渲染
|
directoryShowBefore: false, // 目录渲染
|
||||||
turnPageTime: .5, //翻页动画时间
|
turnPageTime: .5, //翻页动画时间
|
||||||
|
|
||||||
biaodian: [',', ':', '、', ';', '。', '.'], //匹配的标点
|
biaodian: [',', ':', '、', ';', '。', '.','?','》','”',')','"'], //匹配的标点
|
||||||
maxFontSize: 30, //最大字体大小,px
|
maxFontSize: 30, //最大字体大小,px
|
||||||
minFontSize: 14, //最小字体大小,px
|
minFontSize: 14, //最小字体大小,px
|
||||||
turnType: 4, //翻页方式
|
turnType: 4, //翻页方式
|
||||||
@@ -691,7 +692,7 @@ import { nextTick } from "vue";
|
|||||||
'lineHeight':'',
|
'lineHeight':'',
|
||||||
'oldReadPage':0
|
'oldReadPage':0
|
||||||
},
|
},
|
||||||
setShow: false, // 设置显示?
|
setShow: true, // 设置显示?
|
||||||
clientlast: null, //开始位置
|
clientlast: null, //开始位置
|
||||||
touchNum: 0, //点击次数
|
touchNum: 0, //点击次数
|
||||||
touchTime: null, //定时器清除
|
touchTime: null, //定时器清除
|
||||||
@@ -700,6 +701,7 @@ import { nextTick } from "vue";
|
|||||||
musicIndexDom:0,
|
musicIndexDom:0,
|
||||||
highlight: 'null',
|
highlight: 'null',
|
||||||
musicPlaying:false,
|
musicPlaying:false,
|
||||||
|
page:0
|
||||||
},
|
},
|
||||||
readerSet:{
|
readerSet:{
|
||||||
fontSize:'', // 字体大小,
|
fontSize:'', // 字体大小,
|
||||||
@@ -782,8 +784,7 @@ import { nextTick } from "vue";
|
|||||||
//记录位置
|
//记录位置
|
||||||
this.clientlast = e.changedTouches[0];
|
this.clientlast = e.changedTouches[0];
|
||||||
},
|
},
|
||||||
openEnd(e) {
|
openEnd(e) {
|
||||||
|
|
||||||
this.touchNum++
|
this.touchNum++
|
||||||
if (this.touchNum == 0) {} else {
|
if (this.touchNum == 0) {} else {
|
||||||
if (this.touchNum > 1) {
|
if (this.touchNum > 1) {
|
||||||
@@ -867,7 +868,7 @@ import { nextTick } from "vue";
|
|||||||
let screenHeight = res.screenHeight - res.statusBarHeight; //屏幕高度-状态栏高度
|
let screenHeight = res.screenHeight - res.statusBarHeight; //屏幕高度-状态栏高度
|
||||||
let screenWidth = res.screenWidth;
|
let screenWidth = res.screenWidth;
|
||||||
that.NumCol = Math.floor((screenHeight - 50) / (that.fontSize * that
|
that.NumCol = Math.floor((screenHeight - 50) / (that.fontSize * that
|
||||||
.lineHeight)) - 1 //一屏总行 30为panding值
|
.lineHeight)) //一屏总行 30为panding值
|
||||||
console.log('一屏总行', that.NumCol)
|
console.log('一屏总行', that.NumCol)
|
||||||
that.colSize = Math.floor((screenWidth - 20) / that.fontSize) //一行最多排多少个字
|
that.colSize = Math.floor((screenWidth - 20) / that.fontSize) //一行最多排多少个字
|
||||||
await that.forGet(that.colSize - 1, that.NumCol)
|
await that.forGet(that.colSize - 1, that.NumCol)
|
||||||
@@ -1483,6 +1484,7 @@ import { nextTick } from "vue";
|
|||||||
} else {
|
} else {
|
||||||
console.log('读取到的数据为空,进行赋值');
|
console.log('读取到的数据为空,进行赋值');
|
||||||
this.domList = data;
|
this.domList = data;
|
||||||
|
|
||||||
}
|
}
|
||||||
this.getNowReadIndex()
|
this.getNowReadIndex()
|
||||||
// this.$nextTick(()=>{
|
// this.$nextTick(()=>{
|
||||||
@@ -1503,7 +1505,7 @@ import { nextTick } from "vue";
|
|||||||
}
|
}
|
||||||
// console.log(this.curChapter.totalPage, 'curChapter')
|
// console.log(this.curChapter.totalPage, 'curChapter')
|
||||||
// 通过page 判断当前读到了哪里
|
// 通过page 判断当前读到了哪里
|
||||||
// console.log(page+1, '当前页')
|
console.log(page, '当前页')
|
||||||
|
|
||||||
let nowRead = copyBookText[page][0].list
|
let nowRead = copyBookText[page][0].list
|
||||||
console.log(nowRead, '顶部第一句话')
|
console.log(nowRead, '顶部第一句话')
|
||||||
@@ -1566,36 +1568,52 @@ import { nextTick } from "vue";
|
|||||||
// 音频播放结束
|
// 音频播放结束
|
||||||
this.music.onEnded(() => {
|
this.music.onEnded(() => {
|
||||||
this.musicPlaying = false
|
this.musicPlaying = false
|
||||||
if (this.domIndex == this.domList.length - 1) {
|
if (this.domIndex == this.verticalData.text.length - 1) {
|
||||||
console.log('全部音频播放完毕');
|
console.log('全部音频播放完毕');
|
||||||
|
// this.musicPlaying = false
|
||||||
|
// this.musicItem.musicPlaying = false
|
||||||
|
// this.musicManuShow = true
|
||||||
|
//this.isAudioMenu = true
|
||||||
|
this.offAudio()
|
||||||
} else {
|
} else {
|
||||||
console.log('音频播放结束2');
|
console.log('音频播放结束2');
|
||||||
|
console.log(this.domIndex,'------------')
|
||||||
this.addDomIndex()
|
this.addDomIndex()
|
||||||
}
|
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 加载下一条音频
|
// 加载下一条音频
|
||||||
addDomIndex() {
|
addDomIndex() {
|
||||||
|
|
||||||
this.domIndex += 1
|
this.domIndex += 1
|
||||||
//console.log(this.domIndex, '下一条domIndex')
|
console.log(this.domIndex, '下一条domIndex')
|
||||||
//console.log(this.curPage.text, '最大值')
|
|
||||||
setTimeout(() => {
|
// setTimeout(() => {
|
||||||
this.createAudio()
|
// console.log(this.curPage.text, '最大值')
|
||||||
let paragraphindex = 0
|
this.createAudio()
|
||||||
//if(this.domIndex > this.curPage.text[this.curPage.length -1].paragraph){
|
|
||||||
|
let paragraphindex = 0
|
||||||
this.curPage.text.map((item, index) => {
|
this.curPage.text.map((item, index) => {
|
||||||
if (index == this.curPage.text.length - 1) {
|
if (index == this.curPage.text.length - 1) {
|
||||||
paragraphindex = item.paragraph
|
paragraphindex = item.paragraph
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
//return
|
//return
|
||||||
if (this.domIndex > paragraphindex) {
|
if (this.domIndex > this.curPage.text[this.curPage.text.length - 1].paragraph) { // 是否跨页 是的话就翻页
|
||||||
|
// console.log(this.curPage.text[this.curPage.text.length - 1].paragraph,'该翻页了')
|
||||||
|
// this.musicItem.page = this.currentPage + 1
|
||||||
|
|
||||||
|
this.musicItem ={
|
||||||
|
page:this.currentPage + 1,
|
||||||
|
musicIndexDom: this.domIndex
|
||||||
|
}
|
||||||
this.goNextPage()
|
this.goNextPage()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
// },5000)
|
||||||
}, 1000)
|
|
||||||
|
|
||||||
},
|
},
|
||||||
// 暂停事件
|
// 暂停事件
|
||||||
@@ -2314,7 +2332,7 @@ import { nextTick } from "vue";
|
|||||||
|
|
||||||
}
|
}
|
||||||
let cur = [].concat(this.curPage.pageTranslate)
|
let cur = [].concat(this.curPage.pageTranslate)
|
||||||
let next = [].concat(this.nextPage.pageTranslate)
|
let next = [].concat(this.nextPage.pageTranslate)
|
||||||
this.goToPage(this.currentPage)
|
this.goToPage(this.currentPage)
|
||||||
// 当前scrollTop的值
|
// 当前scrollTop的值
|
||||||
// this.scrollTop = Number(this.currentPage * (this.windowHeight - 100 ))
|
// this.scrollTop = Number(this.currentPage * (this.windowHeight - 100 ))
|
||||||
@@ -2536,8 +2554,7 @@ import { nextTick } from "vue";
|
|||||||
goToPage(page) {
|
goToPage(page) {
|
||||||
this.currentPage = page
|
this.currentPage = page
|
||||||
this.showAnimation = false
|
this.showAnimation = false
|
||||||
console.log(page, '======>')
|
console.log(page, '======>')
|
||||||
|
|
||||||
// console.log(copyBookText[page],'当前页')
|
// console.log(copyBookText[page],'当前页')
|
||||||
this.$nextTick(function() {
|
this.$nextTick(function() {
|
||||||
this.curPage = {
|
this.curPage = {
|
||||||
@@ -2555,9 +2572,9 @@ import { nextTick } from "vue";
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
// console.log(copyBookText[page][0],'顶部第一句话')
|
// console.log(copyBookText[page][0],'顶部第一句话')
|
||||||
let nowRead = copyBookText[page][0]
|
// let nowRead = copyBookText[page][0]
|
||||||
let nowReadIndex = 0
|
// let nowReadIndex = 0-----------------------
|
||||||
this.domIndex = nowReadIndex
|
// this.domIndex = nowReadIndex
|
||||||
this.setStorage() // 设置缓存
|
this.setStorage() // 设置缓存
|
||||||
if (this.currentPage === 0) {
|
if (this.currentPage === 0) {
|
||||||
if (this.preChapter.ready && this.preChapter.isCover) { //翻至封面了
|
if (this.preChapter.ready && this.preChapter.isCover) { //翻至封面了
|
||||||
@@ -2747,6 +2764,10 @@ import { nextTick } from "vue";
|
|||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
this.lineHeight = lineHeight;
|
this.lineHeight = lineHeight;
|
||||||
|
uni.showToast({
|
||||||
|
title:lineHeight,
|
||||||
|
duration:2000
|
||||||
|
})
|
||||||
uni.setStorageSync('lineHeight', this.lineHeight)
|
uni.setStorageSync('lineHeight', this.lineHeight)
|
||||||
this.calcHeight()
|
this.calcHeight()
|
||||||
copyBookText = this.curChapter.text;
|
copyBookText = this.curChapter.text;
|
||||||
@@ -3110,10 +3131,15 @@ import { nextTick } from "vue";
|
|||||||
this.goNextChapter()
|
this.goNextChapter()
|
||||||
}else if(options.chapterid == 'prev'){ // 上一章
|
}else if(options.chapterid == 'prev'){ // 上一章
|
||||||
this.goPreChapter()
|
this.goPreChapter()
|
||||||
}else{ // 单纯的跳页
|
}else if(options.curpage>0){
|
||||||
this.page = options.curpage
|
this.goNextPage()
|
||||||
this.goToPage(this.page)
|
}else if(options.curpage<0){
|
||||||
|
this.goPrePage()
|
||||||
}
|
}
|
||||||
|
// }else{ // 单纯的跳页
|
||||||
|
// this.page = options.curpage
|
||||||
|
// this.goToPage(this.page)
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
showMenuCall(options){
|
showMenuCall(options){
|
||||||
this.setShow = true
|
this.setShow = true
|
||||||
@@ -3174,13 +3200,19 @@ import { nextTick } from "vue";
|
|||||||
this.musicIndexDom = newVal.musicIndexDom
|
this.musicIndexDom = newVal.musicIndexDom
|
||||||
this.musicPlaying = newVal.musicPlaying
|
this.musicPlaying = newVal.musicPlaying
|
||||||
console.log(newVal,'听书配置项有变化')
|
console.log(newVal,'听书配置项有变化')
|
||||||
let page = 1
|
// let page = 1
|
||||||
page = $("#flipbook").turn('page')
|
// page = $("#flipbook").turn('page')
|
||||||
if(newVal.musicPlaying){
|
if(newVal.musicPlaying){
|
||||||
// 开启听书
|
// 开启听书
|
||||||
|
if(newVal.page > 0){ // 翻页
|
||||||
|
console.log('翻页翻页', newVal.page+2)
|
||||||
|
$("#flipbook").turn('page', newVal.page+2)
|
||||||
|
}
|
||||||
|
$("#flipbook .paragraph").css({color:"#333"})
|
||||||
$("#flipbook .paragraph"+newVal.musicIndexDom).css({color:"#e5d6a0"})
|
$("#flipbook .paragraph"+newVal.musicIndexDom).css({color:"#e5d6a0"})
|
||||||
|
|
||||||
}else{
|
}
|
||||||
|
else{
|
||||||
// 关闭听书
|
// 关闭听书
|
||||||
$("#flipbook .paragraph").css({color:"#333"})
|
$("#flipbook .paragraph").css({color:"#333"})
|
||||||
}
|
}
|
||||||
@@ -3217,7 +3249,7 @@ import { nextTick } from "vue";
|
|||||||
var classname = ''
|
var classname = ''
|
||||||
var styleconteent = ''
|
var styleconteent = ''
|
||||||
newVal.SimulationText[i][j].class == 'jushou' ? classname = 'shouhang' : ''
|
newVal.SimulationText[i][j].class == 'jushou' ? classname = 'shouhang' : ''
|
||||||
newVal.SimulationText[i][j].class == 'jushou' ? styleconteent = `"text-indent:2em ;font-size:${newVal.fontSize}px; color: #5d5d5d"` : styleconteent = "'font-size:"+newVal.fontSize+"px ; line-height:"+newVal.lineHeight*newVal.fontSize+"px; color: #5d5d5d'"
|
newVal.SimulationText[i][j].class == 'jushou' ? styleconteent = "';text-indent:2em ;font-size:"+newVal.fontSize+"px; color: #5d5d5d; line-height:"+newVal.lineHeight*newVal.fontSize+"px;'": styleconteent = "'font-size:"+newVal.fontSize+"px ; line-height:"+newVal.lineHeight*newVal.fontSize+"px; color: #5d5d5d; text-align:justify'"
|
||||||
conntentHtml += "<p class='paragraph " + classname + " paragraph" + newVal.SimulationText[i][j].paragraph +"' style="+styleconteent+">" + newVal.SimulationText[i][j].list + "</p>"
|
conntentHtml += "<p class='paragraph " + classname + " paragraph" + newVal.SimulationText[i][j].paragraph +"' style="+styleconteent+">" + newVal.SimulationText[i][j].list + "</p>"
|
||||||
}
|
}
|
||||||
var page1 = i+1
|
var page1 = i+1
|
||||||
@@ -3254,7 +3286,7 @@ import { nextTick } from "vue";
|
|||||||
// 不是第一页
|
// 不是第一页
|
||||||
$("#flipbook").turn("previous")
|
$("#flipbook").turn("previous")
|
||||||
ownerInstance.callMethod('onViewClick', {
|
ownerInstance.callMethod('onViewClick', {
|
||||||
curpage: $("#flipbook").turn('page')-1,
|
curpage: -1,
|
||||||
chapterid : ''
|
chapterid : ''
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -3271,7 +3303,7 @@ import { nextTick } from "vue";
|
|||||||
// 不是最后一页
|
// 不是最后一页
|
||||||
$("#flipbook").turn("next")
|
$("#flipbook").turn("next")
|
||||||
ownerInstance.callMethod('onViewClick', {
|
ownerInstance.callMethod('onViewClick', {
|
||||||
curpage: $("#flipbook").turn('page')-1,
|
curpage: 1,
|
||||||
chapterid: '',
|
chapterid: '',
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user