|
@@ -2,21 +2,21 @@
|
|
|
<import name="wechat-page" src="../../components/wechat/index.ux"></import>
|
|
|
<template>
|
|
|
<div id="reader-content">
|
|
|
- <list class="reader-wrap" id='list'>
|
|
|
- <list-item type='title' class="reader-title">
|
|
|
+ <div class="reader-wrap" id='list'>
|
|
|
+ <div type='title' class="reader-title">
|
|
|
<text class="title">{{bookinfo.chapter_name}}</text>
|
|
|
<!-- <text class="add-shelf" @click="addShelf">加入书架</text> -->
|
|
|
- </list-item>
|
|
|
- <list-item type='content' class="reader-content">
|
|
|
+ </div>
|
|
|
+ <div type='content' class="reader-content">
|
|
|
<text class="chapter-text" for='content'>{{$item}}</text>
|
|
|
- </list-item>
|
|
|
- <list-item type='button' class="reader-operator">
|
|
|
+ </div>
|
|
|
+ <div type='button' class="reader-operator">
|
|
|
<text class="operator prev" @click="getPrevChapter">上一章</text>
|
|
|
<text class="operator catalog" @click="toCatalog">目录</text>
|
|
|
<text class="operator next" @click="getNextChapter">下一章</text>
|
|
|
- </list-item>
|
|
|
- </list>
|
|
|
- <short-page if="{{showShortPop}}"></short-page>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <short-page if="{{showShortPop}}" @addshort="shortEnd"></short-page>
|
|
|
<!-- <wechat-page></wechat-page> -->
|
|
|
</div>
|
|
|
|
|
@@ -40,7 +40,6 @@ export default {
|
|
|
onInit() {
|
|
|
this.getChapters(this.bid, this.chapter_id)
|
|
|
this.addShelf();
|
|
|
- this.$on('hasShort',this.changeShortCut);
|
|
|
},
|
|
|
onShow() {
|
|
|
it.getShortCut((value) => {
|
|
@@ -53,14 +52,14 @@ export default {
|
|
|
r.is_on ? '' : postUserShelfBooks({ bid: this.bid })
|
|
|
})
|
|
|
},
|
|
|
- changeShortCut(){
|
|
|
- this.showShortPop=false;
|
|
|
+ shortEnd(value) {
|
|
|
+ this.showShortPop = !value.detail.installed;
|
|
|
},
|
|
|
getChapters(bid, chapter_id) {
|
|
|
getChapters({ bid: bid, chapter_id: chapter_id }).then(r => {
|
|
|
this.content = r.chapter_content.trim().split(/\n/)
|
|
|
this.bookinfo = r
|
|
|
- this.$element('list').scrollTo({ index: 0 })
|
|
|
+ // this.$element('list').scrollTo({ index: 0 })
|
|
|
}).catch(e => {
|
|
|
console.log('e code')
|
|
|
console.log(e.data)
|
|
@@ -69,7 +68,7 @@ export default {
|
|
|
chapterOrders({ bid: bid, chapter_id: chapter_id }).then(r => {
|
|
|
this.content = r.chapter_content.trim().split(/\n/)
|
|
|
this.bookinfo = r
|
|
|
- this.$element('list').scrollTo({ index: 0 })
|
|
|
+ // this.$element('list').scrollTo({ index: 0 })
|
|
|
}).catch(f => {
|
|
|
console.log('f code')
|
|
|
console.log(f.data)
|
|
@@ -107,11 +106,34 @@ export default {
|
|
|
},
|
|
|
getPrevChapter() {
|
|
|
console.log("get prev chapter");
|
|
|
- this.getChapters(this.bookinfo.bid, this.bookinfo.prev_cid)
|
|
|
+ // this.getChapters(this.bookinfo.bid, this.bookinfo.prev_cid)
|
|
|
+ router.replace({
|
|
|
+ uri: "/views/Reader",
|
|
|
+ params: {
|
|
|
+ bid: this.bookinfo.bid,
|
|
|
+ chapter_id: this.bookinfo.prev_cid
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
getNextChapter() {
|
|
|
console.log("get next chapter");
|
|
|
- this.getChapters(this.bookinfo.bid, this.bookinfo.next_cid)
|
|
|
+ if (this.bookinfo.next_cid == 0) {
|
|
|
+ router.push({
|
|
|
+ uri: "/views/Raderover",
|
|
|
+ params: {
|
|
|
+ bid: this.bid
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // this.getChapters(this.bookinfo.bid, this.bookinfo.next_cid)
|
|
|
+ router.replace({
|
|
|
+ uri: "/views/Reader",
|
|
|
+ params: {
|
|
|
+ bid: this.bookinfo.bid,
|
|
|
+ chapter_id: this.bookinfo.next_cid
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
</script>
|