From 6dffef6f3f3341141116f6d83963e83fe7326bbe Mon Sep 17 00:00:00 2001 From: "@fawn-nine" <1271023382@qq.com> Date: Mon, 17 Apr 2023 15:31:40 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8B=B9=E6=9E=9C=E6=94=AF=E4=BB=98=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/bookShop/classify.vue | 48 +- pages/bookShop/commodityDetail.vue | 8 +- pages/peanut/bookshelf.vue | 2 +- pages/peanut/home.vue | 33 +- pages/peanut/reCharge.vue | 7 +- pages/user/login.vue | 4 +- pages/yRead/angbook - 阅读器修改前).vue | 3258 -------------- pages/yRead/angbook.vue | 124 +- pages/yRead/angbook可用.vue | 3821 ----------------- 9 files changed, 152 insertions(+), 7153 deletions(-) delete mode 100644 pages/yRead/angbook - 阅读器修改前).vue delete mode 100644 pages/yRead/angbook可用.vue diff --git a/pages/bookShop/classify.vue b/pages/bookShop/classify.vue index e5b165b..7f5eb1b 100644 --- a/pages/bookShop/classify.vue +++ b/pages/bookShop/classify.vue @@ -17,14 +17,14 @@ - - + @@ -59,6 +59,9 @@ 暂无分类 + + + @@ -72,9 +75,20 @@ return { highlight: '', // 高亮下标 current: 0, + twocurrent:0, oneLevel: [], towLevel: [], - commodityList: [] // 商品列表 + commodityList: [] ,// 商品列表 + utabs:false, + bgiStyle: { + background: '#2ab58833' + }, + iconStyle: { + fontSize: '40rpx', + fontWeight: 'bold', + color: '#54a966', + }, + scrollTop: 0, } }, // contentButtonClick(e) { @@ -96,8 +110,16 @@ }, computed: { ...mapState(['userInfo']), + }, + mounted () { + setTimeout(() => { // 解决vant-tab组件官方问题:底部条位置错误 + this.utabs = true + }, 200) }, methods: { + onPageScroll(e) { + this.scrollTop = e.scrollTop; + }, // 跳转 onPageJump(url) { uni.navigateTo({ @@ -116,6 +138,9 @@ }, // 点击一级分类 getTowLevel(e) { + this.utabs = false + // this.twocurrent = 0; + uni.showLoading() this.$http .post(`book/shopcategory/getTwoLevel?catId=${e.catId}`) .then(res => { @@ -133,7 +158,9 @@ // console.log(this.towLevel, 'towLevel') this.getCategoryList(res.list[0]) } - + uni.hideLoading() + this.utabs = true + uni.stopPullDownRefresh(); }) }, @@ -141,7 +168,7 @@ getCategoryList(e) { // console.log(e) // return false - // this.highlight = index + // this.highlight = index this.$http .post('book/shopproduct/appGetCategoryList', { 'catId': e.catId @@ -237,7 +264,12 @@ uni.navigateTo({ url: `./commodityDetail?id=${id}` }) - } + } + }, + onPullDownRefresh(){ + // console.log('refresh'); + this.commodityList = [] + this.getOneLevel() } } @@ -335,7 +367,9 @@ flex-wrap: wrap; padding: 10rpx 20rpx; width: 100%; - + align-items: stretch; + // align-content:center; + align-content:start; .commodityItem { width: 50%; // background-color: #fff; diff --git a/pages/bookShop/commodityDetail.vue b/pages/bookShop/commodityDetail.vue index d9c78d1..830f843 100644 --- a/pages/bookShop/commodityDetail.vue +++ b/pages/bookShop/commodityDetail.vue @@ -28,9 +28,11 @@ - 书名:{{productInfo.productName}} - 作者:{{productInfo.author}} - + 书名:{{productInfo.productName}} + + + 作者:{{productInfo.author}} + 出版社:{{productInfo.publisher}} diff --git a/pages/peanut/bookshelf.vue b/pages/peanut/bookshelf.vue index 0f9a2d1..2c34f14 100644 --- a/pages/peanut/bookshelf.vue +++ b/pages/peanut/bookshelf.vue @@ -345,7 +345,7 @@ position: fixed; width: 100%; z-index: 100; - top: 130upx; + top: 150rpx; .top-left { flex: 1; diff --git a/pages/peanut/home.vue b/pages/peanut/home.vue index a8ddca7..3edbef8 100644 --- a/pages/peanut/home.vue +++ b/pages/peanut/home.vue @@ -9,23 +9,23 @@ - + - 电子书 + 电子书 - + - 健康超市 + 健康超市 - + @@ -416,18 +416,27 @@ margin: 60rpx 50rpx 0 50rpx; display: flex; 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 { - width: 25%; - text-align: center; - - + width: 50%; + text-align: center; + border-radius: 20rpx ; padding-top: 10rpx; + // line-height: 110upx; + display: flex; + align-content: center; + justify-content: center; image { + width: 110upx; height: 110upx; - margin: 0 auto; + display: inline-block; + // margin: 0 auto; // margin: 0 20rpx; } + text{height: 100upx; display:inline-block; line-height: 100upx; font-size: 34rpx;} } .hn_cl_tit:nth-child(1), diff --git a/pages/peanut/reCharge.vue b/pages/peanut/reCharge.vue index 5f325d7..d1af8d6 100644 --- a/pages/peanut/reCharge.vue +++ b/pages/peanut/reCharge.vue @@ -20,7 +20,7 @@ - + @@ -57,7 +57,7 @@ * 我已阅读并同意《增值服务协议》 - + 立即充值 @@ -124,7 +124,7 @@ } ], iosPaylist: [{ - title: 'IOS支付', + title: 'apple pay支付', id: 3, img: '../../static/icon/pay_2.png' }], @@ -191,6 +191,7 @@ mask: true }) const that = this + console.log(that.stepsCj.priceTypeId,88888888) // ['xxxxx'] 是平台申请拿到的内购商品的id that.iapChannel.requestOrder(that.stepsCj.priceTypeId, function(event) { // uni.hideLoading() diff --git a/pages/user/login.vue b/pages/user/login.vue index bfe1649..0580a94 100644 --- a/pages/user/login.vue +++ b/pages/user/login.vue @@ -98,7 +98,7 @@ - diff --git a/pages/yRead/angbook - 阅读器修改前).vue b/pages/yRead/angbook - 阅读器修改前).vue deleted file mode 100644 index f36305b..0000000 --- a/pages/yRead/angbook - 阅读器修改前).vue +++ /dev/null @@ -1,3258 +0,0 @@ - - - - - - - diff --git a/pages/yRead/angbook.vue b/pages/yRead/angbook.vue index bda21c5..79ab24a 100644 --- a/pages/yRead/angbook.vue +++ b/pages/yRead/angbook.vue @@ -20,7 +20,7 @@ -

+

@@ -33,7 +33,7 @@ -

+

@@ -48,7 +48,7 @@

+ v-html="item.content">

@@ -57,7 +57,7 @@ - + @@ -299,14 +299,14 @@ 排版 - - + + - - + + - - + + @@ -406,11 +406,12 @@ 排版 - + @@ -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 += "

" + newVal.SimulationText[i][j].list + "

" } 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: '', }) diff --git a/pages/yRead/angbook可用.vue b/pages/yRead/angbook可用.vue deleted file mode 100644 index 4023c7e..0000000 --- a/pages/yRead/angbook可用.vue +++ /dev/null @@ -1,3821 +0,0 @@ - - - - - - - -