|
@@ -1,15 +1,35 @@
|
|
<import name="short-page" src="../../components/short/index.ux"></import>
|
|
<import name="short-page" src="../../components/short/index.ux"></import>
|
|
<import name="wechat-page" src="../../components/wechat/index.ux"></import>
|
|
<import name="wechat-page" src="../../components/wechat/index.ux"></import>
|
|
<template>
|
|
<template>
|
|
- <div id="reader-content">
|
|
|
|
|
|
+ <div id="reader-content" >
|
|
<stack>
|
|
<stack>
|
|
- <div class="reader-wrap" id='list'>
|
|
|
|
|
|
+ <div class="reader-wrap" id='list' style="background-color:{{currentColor.color}}">
|
|
<div class="reader-title">
|
|
<div class="reader-title">
|
|
<text class="title">{{bookinfo.chapter_name}}</text>
|
|
<text class="title">{{bookinfo.chapter_name}}</text>
|
|
<!-- <text class="add-shelf" @click="addShelf">加入书架</text> -->
|
|
<!-- <text class="add-shelf" @click="addShelf">加入书架</text> -->
|
|
</div>
|
|
</div>
|
|
- <div class="reader-content">
|
|
|
|
- <text class="chapter-text" for='content'>{{$item}}</text>
|
|
|
|
|
|
+ <div class="reader-content" @click="showMore">
|
|
|
|
+ <text class="chapter-text" for='content' style="color:{{currentColor.fontColor}};font-size:{{`${readFontSize}px`}}">{{$item}}</text>
|
|
|
|
+ <div class="bottom-setting" style="background-color:{{currentColor.btColor}}" show={{showSetting}} @click="stopPop">
|
|
|
|
+ <div class="item-content">
|
|
|
|
+ <text class="label-min" style="color:{{isNight?'#666':'#1A1A1A'}}">A</text>
|
|
|
|
+ <slider class="slider" min="30" max="48" step="2" value="{{readFontSize}}" onchange="changeFontSize" style="blockColor: #fff"></slider>
|
|
|
|
+ <text class="label-max" style="color:{{isNight?'#666':'#1A1A1A'}}">A</text>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="item-color">
|
|
|
|
+ <text class="colori" for="colorList" onclick="changeColor($item,undefined)" style="border-color:{{currentColor.color==$item.color? currentBorder: $item.borderColor}};background-color:{{$item.color}};"></text>
|
|
|
|
+ <text class="color-icon {{ isNight }}" onclick="changeColor(nightColor,isNight)" ></text>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="item-page">
|
|
|
|
+ <text @click="getPrevChapter" style="color:{{isNight?'#666':'#1A1A1A'}}">上一章</text>
|
|
|
|
+ <text @click="toCatalog" style="color:{{isNight?'#666':'#1A1A1A'}}">目录</text>
|
|
|
|
+ <text @click="getNextChapter" style="color:{{isNight?'#666':'#1A1A1A'}}">下一章</text>
|
|
|
|
+ </div>
|
|
|
|
+ <div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="setting-top" style="background-color:{{currentColor.color}}" show={{showSetting}}>
|
|
|
|
+ <text>{{bookinfo.chapter_name}}</text>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
<div class="reader-operator">
|
|
<div class="reader-operator">
|
|
<text class="operator prev" @click="getPrevChapter">上一章</text>
|
|
<text class="operator prev" @click="getPrevChapter">上一章</text>
|
|
@@ -49,7 +69,25 @@ export default {
|
|
private: {
|
|
private: {
|
|
bookinfo: {},
|
|
bookinfo: {},
|
|
content: [],
|
|
content: [],
|
|
- showShortPop: false
|
|
|
|
|
|
+ showShortPop: false,
|
|
|
|
+ readFontSize: 38,
|
|
|
|
+ isNight:'sun',
|
|
|
|
+ showSetting:false,
|
|
|
|
+ colorList:[
|
|
|
|
+ {color:'#E6E6E6',borderColor:'#CCC',btColor:'#F2F2F2',isIcon:false},
|
|
|
|
+ {color:'#EED9BB',borderColor:'#C6A473',btColor:'#FFFBE8',isIcon:false},
|
|
|
|
+ {color:'#B3E2CB',borderColor:'#68AA8A',btColor:'#D5F2D8',isIcon:false},
|
|
|
|
+ {color:'#B3D0E2',borderColor:'#6090AE',btColor:'#E8F6FF',isIcon:false},
|
|
|
|
+ ],
|
|
|
|
+ currentBorder:'#EE6159',
|
|
|
|
+ nightColor:{
|
|
|
|
+ fontColor:'#666',
|
|
|
|
+ btColor:'#333',
|
|
|
|
+ color:'#1a1a1a'
|
|
|
|
+ },
|
|
|
|
+ currentColor:{
|
|
|
|
+ color:'#E6E6E6',btColor:'#F2F2F2',fontColor:'#1a1a1a'
|
|
|
|
+ }
|
|
},
|
|
},
|
|
async onInit() {
|
|
async onInit() {
|
|
if(this.send_order_id){
|
|
if(this.send_order_id){
|
|
@@ -60,12 +98,62 @@ export default {
|
|
console.log("send_order_id", this.send_order_id);
|
|
console.log("send_order_id", this.send_order_id);
|
|
console.log("storage send_order_id", s); */
|
|
console.log("storage send_order_id", s); */
|
|
await this.getChapters(this.bid, this.chapter_id);
|
|
await this.getChapters(this.bid, this.chapter_id);
|
|
- // await this.addShelf();
|
|
|
|
|
|
+ let setting = (await storage.get({ key: "readSetting" })).data;
|
|
|
|
+ if(setting){
|
|
|
|
+ let sets = JSON.parse(setting)
|
|
|
|
+ this.currentColor = sets;
|
|
|
|
+ this.isNight = sets.isNight;
|
|
|
|
+ }
|
|
|
|
+ let font = (await storage.get({ key: "readFont" })).data;
|
|
|
|
+ if(font){
|
|
|
|
+ this.readFontSize = font;
|
|
|
|
+ }
|
|
},
|
|
},
|
|
- onShow() {
|
|
|
|
|
|
+ async onShow() {
|
|
|
|
+
|
|
it.getShortCut((value) => {
|
|
it.getShortCut((value) => {
|
|
|
|
+ this.showSetting = value;
|
|
this.showShortPop = !value;
|
|
this.showShortPop = !value;
|
|
})
|
|
})
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ stopPop(evt){
|
|
|
|
+ evt.stopPropagation();
|
|
|
|
+ return;
|
|
|
|
+ },
|
|
|
|
+ showMore(){
|
|
|
|
+ this.showSetting = !this.showSetting;
|
|
|
|
+ if(this.showSetting){
|
|
|
|
+ this.showShortPop = false;
|
|
|
|
+ }else{
|
|
|
|
+ this.showShortPop = true;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ async changeFontSize(evt){
|
|
|
|
+ this.readFontSize= evt.progress;
|
|
|
|
+ await storage.set({ key: "readFont", value: this.readFontSize });
|
|
|
|
+ },
|
|
|
|
+ async changeColor(item,type){
|
|
|
|
+ if(type){
|
|
|
|
+ if(type=='sun'){
|
|
|
|
+ this.isNight='night';
|
|
|
|
+ this.currentColor = this.nightColor;
|
|
|
|
+ await storage.set({ key: "readSetting", value: JSON.stringify({...this.nightColor,isNight:'night'}) });
|
|
|
|
+ }else{
|
|
|
|
+ this.isNight='sun';
|
|
|
|
+ this.currentColor = {color:'#E6E6E6',borderColor:'#CCC',btColor:'#F2F2F2',isIcon:false};
|
|
|
|
+ await storage.set({ key: "readSetting", value: JSON.stringify({...this.currentColor,isNight:'sun'}) });
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ this.isNight='sun';
|
|
|
|
+ this.currentColor = {
|
|
|
|
+ color:item.color,
|
|
|
|
+ btColor:item.btColor,
|
|
|
|
+ fontColor:'#1a1a1a'
|
|
|
|
+ }
|
|
|
|
+ await storage.set({ key: "readSetting", value: JSON.stringify({...this.currentColor,isNight:'sun'}) });
|
|
|
|
+ }
|
|
},
|
|
},
|
|
addShelf() {
|
|
addShelf() {
|
|
console.log("add shelf");
|
|
console.log("add shelf");
|
|
@@ -99,7 +187,7 @@ export default {
|
|
console.log('f code')
|
|
console.log('f code')
|
|
console.log(f.data)
|
|
console.log(f.data)
|
|
this.showtoast = false
|
|
this.showtoast = false
|
|
- if (f.data.code == '10014' || f.data.code == '10015') {
|
|
|
|
|
|
+ if (f.data.code == '10014' || f.data.code == '10015' || f.data.code == '10016') {
|
|
this.getChapters(bid, this.canReadecid)
|
|
this.getChapters(bid, this.canReadecid)
|
|
router.push({
|
|
router.push({
|
|
uri: "/views/Pay",
|
|
uri: "/views/Pay",
|
|
@@ -125,7 +213,8 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- toCatalog() {
|
|
|
|
|
|
+ toCatalog(evt) {
|
|
|
|
+ evt.stopPropagation();
|
|
router.push({
|
|
router.push({
|
|
uri: "/views/Catalog",
|
|
uri: "/views/Catalog",
|
|
params: {
|
|
params: {
|
|
@@ -134,7 +223,8 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- getPrevChapter() {
|
|
|
|
|
|
+ getPrevChapter(evt) {
|
|
|
|
+ evt.stopPropagation();
|
|
console.log("get prev chapter");
|
|
console.log("get prev chapter");
|
|
if (this.bookinfo.prev_cid == 0) {
|
|
if (this.bookinfo.prev_cid == 0) {
|
|
return prompt.showToast({ message: '已经是第一章啦' });
|
|
return prompt.showToast({ message: '已经是第一章啦' });
|
|
@@ -148,7 +238,8 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- getNextChapter() {
|
|
|
|
|
|
+ getNextChapter(evt) {
|
|
|
|
+ evt.stopPropagation();
|
|
console.log("get next chapter");
|
|
console.log("get next chapter");
|
|
if (this.bookinfo.next_cid == 0) {
|
|
if (this.bookinfo.next_cid == 0) {
|
|
router.push({
|
|
router.push({
|