苹果支付构建版本

This commit is contained in:
@fawn-nine
2023-04-17 15:31:40 +08:00
parent 88edd76561
commit 6dffef6f3f
9 changed files with 152 additions and 7153 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -20,7 +20,7 @@
<view class="inner-box" :style="{ height: `${innerHeight}px` }">
<view class="book-inner" id="preChapter"
: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>
@@ -33,7 +33,7 @@
<view class="inner-box" :style="{ height: `${innerHeight}px` }">
<view class="book-inner" id="curChapter"
: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>
</view>
</view>
@@ -48,7 +48,7 @@
<view id="nextChapter"
:style="{ fontSize: `${fontSize}px`, lineHeight: `${lineHeight * fontSize}px` }">
<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>
@@ -57,7 +57,7 @@
<!-- 垂直翻页 -->
<!-- @click="showMenu" -->
<!-- 横向翻页 -->
<view class="across" >
<!-- 阅读页结构和样式请和仅用于计算元素一致 -->
@@ -299,14 +299,14 @@
</view>
<view class="item">
<view class="item-name">排版</view>
<view class="type-setting" :class="{ active: lineHeight === 1 }" @click="changeLineHeight(1)">
<view class="line" :class="{ lineActive: lineHeight === 1 }" v-for="i in 5" :key="i"></view>
<view class="type-setting" :class="{ active: lineHeight === 4 }" @click="changeLineHeight(4)">
<view class="line" :class="{ lineActive: lineHeight === 4 }" v-for="i in 5" :key="i"></view>
</view>
<view class="type-setting" :class="{ active: lineHeight === 1.5 }" @click="changeLineHeight(1.5)">
<view class="line" :class="{ lineActive: lineHeight === 1.5 }" v-for="i in 4" :key="i"></view>
<view class="type-setting" :class="{ active: lineHeight === 5 }" @click="changeLineHeight(5)">
<view class="line" :class="{ lineActive: lineHeight === 5 }" v-for="i in 4" :key="i"></view>
</view>
<view class="type-setting" :class="{ active: lineHeight === 2 }" @click="changeLineHeight(2)">
<view class="line" :class="{ lineActive: lineHeight === 2 }" v-for="i in 3" :key="i"></view>
<view class="type-setting" :class="{ active: lineHeight === 6 }" @click="changeLineHeight(6)">
<view class="line" :class="{ lineActive: lineHeight === 6 }" v-for="i in 3" :key="i"></view>
</view>
</view>
<view class="item">
@@ -406,11 +406,12 @@
</view>
<view class="item">
<view class="item-name">排版</view>
<view class="type-setting" :class="{ active: lineHeight === 1 }"
<!-- 这个行高没有必要存在不符合阅读条件 -->
<!-- <view class="type-setting" :class="{ active: lineHeight === 1 }"
@click="changeLineHeight(1)">
<view class="line" :class="{ lineActive: lineHeight === 1 }" 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="line" :class="{ lineActive: lineHeight === 1.5 }" v-for="i in 4" :key="i">
@@ -628,7 +629,7 @@ import { nextTick } from "vue";
directoryShowBefore: false, // 目录渲染
turnPageTime: .5, //翻页动画时间
biaodian: ['', ':', '、', ';', '。', '.'], //匹配的标点
biaodian: ['', ':', '、', ';', '。', '.','','》','”',')','"'], //匹配的标点
maxFontSize: 30, //最大字体大小px
minFontSize: 14, //最小字体大小px
turnType: 4, //翻页方式
@@ -691,7 +692,7 @@ import { nextTick } from "vue";
'lineHeight':'',
'oldReadPage':0
},
setShow: false, // 设置显示?
setShow: true, // 设置显示?
clientlast: null, //开始位置
touchNum: 0, //点击次数
touchTime: null, //定时器清除
@@ -700,6 +701,7 @@ import { nextTick } from "vue";
musicIndexDom:0,
highlight: 'null',
musicPlaying:false,
page:0
},
readerSet:{
fontSize:'', // 字体大小,
@@ -782,8 +784,7 @@ import { nextTick } from "vue";
//记录位置
this.clientlast = e.changedTouches[0];
},
openEnd(e) {
openEnd(e) {
this.touchNum++
if (this.touchNum == 0) {} else {
if (this.touchNum > 1) {
@@ -867,7 +868,7 @@ import { nextTick } from "vue";
let screenHeight = res.screenHeight - res.statusBarHeight; //屏幕高度-状态栏高度
let screenWidth = res.screenWidth;
that.NumCol = Math.floor((screenHeight - 50) / (that.fontSize * that
.lineHeight)) - 1 //一屏总行 30为panding值
.lineHeight)) //一屏总行 30为panding值
console.log('一屏总行', that.NumCol)
that.colSize = Math.floor((screenWidth - 20) / that.fontSize) //一行最多排多少个字
await that.forGet(that.colSize - 1, that.NumCol)
@@ -1483,6 +1484,7 @@ import { nextTick } from "vue";
} else {
console.log('读取到的数据为空,进行赋值');
this.domList = data;
}
this.getNowReadIndex()
// this.$nextTick(()=>{
@@ -1503,7 +1505,7 @@ import { nextTick } from "vue";
}
// console.log(this.curChapter.totalPage, 'curChapter')
// 通过page 判断当前读到了哪里
// console.log(page+1, '当前页')
console.log(page, '当前页')
let nowRead = copyBookText[page][0].list
console.log(nowRead, '顶部第一句话')
@@ -1566,36 +1568,52 @@ import { nextTick } from "vue";
// 音频播放结束
this.music.onEnded(() => {
this.musicPlaying = false
if (this.domIndex == this.domList.length - 1) {
if (this.domIndex == this.verticalData.text.length - 1) {
console.log('全部音频播放完毕');
// this.musicPlaying = false
// this.musicItem.musicPlaying = false
// this.musicManuShow = true
//this.isAudioMenu = true
this.offAudio()
} else {
console.log('音频播放结束2');
console.log(this.domIndex,'------------')
this.addDomIndex()
}
}
});
},
// 加载下一条音频
addDomIndex() {
this.domIndex += 1
//console.log(this.domIndex, '下一条domIndex')
//console.log(this.curPage.text, '最大值')
setTimeout(() => {
this.createAudio()
let paragraphindex = 0
//if(this.domIndex > this.curPage.text[this.curPage.length -1].paragraph){
console.log(this.domIndex, '下一条domIndex')
// setTimeout(() => {
// console.log(this.curPage.text, '最大值')
this.createAudio()
let paragraphindex = 0
this.curPage.text.map((item, index) => {
if (index == this.curPage.text.length - 1) {
if (index == this.curPage.text.length - 1) {
paragraphindex = item.paragraph
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()
}
}, 1000)
// },5000)
},
// 暂停事件
@@ -2314,7 +2332,7 @@ import { nextTick } from "vue";
}
let cur = [].concat(this.curPage.pageTranslate)
let next = [].concat(this.nextPage.pageTranslate)
let next = [].concat(this.nextPage.pageTranslate)
this.goToPage(this.currentPage)
// 当前scrollTop的值
// this.scrollTop = Number(this.currentPage * (this.windowHeight - 100 ))
@@ -2536,8 +2554,7 @@ import { nextTick } from "vue";
goToPage(page) {
this.currentPage = page
this.showAnimation = false
console.log(page, '======>')
console.log(page, '======>')
// console.log(copyBookText[page],'当前页')
this.$nextTick(function() {
this.curPage = {
@@ -2555,9 +2572,9 @@ import { nextTick } from "vue";
}
})
// console.log(copyBookText[page][0],'顶部第一句话')
let nowRead = copyBookText[page][0]
let nowReadIndex = 0
this.domIndex = nowReadIndex
// let nowRead = copyBookText[page][0]
// let nowReadIndex = 0-----------------------
// this.domIndex = nowReadIndex
this.setStorage() // 设置缓存
if (this.currentPage === 0) {
if (this.preChapter.ready && this.preChapter.isCover) { //翻至封面了
@@ -2747,6 +2764,10 @@ import { nextTick } from "vue";
return
} else {
this.lineHeight = lineHeight;
uni.showToast({
title:lineHeight,
duration:2000
})
uni.setStorageSync('lineHeight', this.lineHeight)
this.calcHeight()
copyBookText = this.curChapter.text;
@@ -3110,10 +3131,15 @@ import { nextTick } from "vue";
this.goNextChapter()
}else if(options.chapterid == 'prev'){ // 上一章
this.goPreChapter()
}else{ // 单纯的跳页
this.page = options.curpage
this.goToPage(this.page)
}else if(options.curpage>0){
this.goNextPage()
}else if(options.curpage<0){
this.goPrePage()
}
// }else{ // 单纯的跳页
// this.page = options.curpage
// this.goToPage(this.page)
// }
},
showMenuCall(options){
this.setShow = true
@@ -3174,13 +3200,19 @@ import { nextTick } from "vue";
this.musicIndexDom = newVal.musicIndexDom
this.musicPlaying = newVal.musicPlaying
console.log(newVal,'听书配置项有变化')
let page = 1
page = $("#flipbook").turn('page')
// let page = 1
// page = $("#flipbook").turn('page')
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"})
}else{
}
else{
// 关闭听书
$("#flipbook .paragraph").css({color:"#333"})
}
@@ -3217,7 +3249,7 @@ import { nextTick } from "vue";
var classname = ''
var styleconteent = ''
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>"
}
var page1 = i+1
@@ -3254,7 +3286,7 @@ import { nextTick } from "vue";
// 不是第一页
$("#flipbook").turn("previous")
ownerInstance.callMethod('onViewClick', {
curpage: $("#flipbook").turn('page')-1,
curpage: -1,
chapterid : ''
})
}
@@ -3271,7 +3303,7 @@ import { nextTick } from "vue";
// 不是最后一页
$("#flipbook").turn("next")
ownerInstance.callMethod('onViewClick', {
curpage: $("#flipbook").turn('page')-1,
curpage: 1,
chapterid: '',
})

File diff suppressed because it is too large Load Diff