Commit 5a8927e4 authored by jyx's avatar jyx

代码优化

parent bbcc2f19
...@@ -11,6 +11,9 @@ import { ...@@ -11,6 +11,9 @@ import {
readStorage, readStorage,
saveStorage saveStorage
} from "../utils/storageUtil.js"; } from "../utils/storageUtil.js";
import {
reLaunch
} from "../../utils/fun.js";
import User from "../models/User.js"; import User from "../models/User.js";
import { import {
isEmpty, isEmpty,
...@@ -245,10 +248,10 @@ function saveToken(token) { ...@@ -245,10 +248,10 @@ function saveToken(token) {
saveStorage(KEY_STORAGE_TOKEN, token); saveStorage(KEY_STORAGE_TOKEN, token);
} }
function readToken() { function readToken() {
if (!LOCAL_TOKEN) { if (!LOCAL_TOKEN) {
LOCAL_TOKEN = readStorage(KEY_STORAGE_TOKEN) LOCAL_TOKEN = readStorage(KEY_STORAGE_TOKEN)
} }
return LOCAL_TOKEN; return LOCAL_TOKEN;
} }
...@@ -312,10 +315,13 @@ function removeUserInfoChangeWatch(observer) { ...@@ -312,10 +315,13 @@ function removeUserInfoChangeWatch(observer) {
} }
// 展示登录弹窗 // 展示登录弹窗
function showLoginView() { function showLoginView() {
postNotification(KEY_NOTIFICATION_LOGIN_SHOW, {
show: true reLaunch(`loading`)
})
// postNotification(KEY_NOTIFICATION_LOGIN_SHOW, {
// show: true
// })
} }
module.exports = { module.exports = {
......
...@@ -12,7 +12,7 @@ import { ...@@ -12,7 +12,7 @@ import {
appendParam, appendParam,
} from "./util"; } from "./util";
import { import {
PAKEAGE_NAME, PAKEAGE_NAME,
VERSION_CODE VERSION_CODE
} from "../../utils/utils"; } from "../../utils/utils";
import { import {
...@@ -112,7 +112,7 @@ let apiRequest = function({ ...@@ -112,7 +112,7 @@ let apiRequest = function({
option.header = { option.header = {
pkgName: PAKEAGE_NAME, pkgName: PAKEAGE_NAME,
token: `${token}`, token: `${token}`,
version: VERSION_CODE, version: VERSION_CODE,
proChannel: uniChannel proChannel: uniChannel
} }
...@@ -254,7 +254,7 @@ function apiUPLOAD({ ...@@ -254,7 +254,7 @@ function apiUPLOAD({
option.url = `${option.url}?t=${new Date().getTime()}`; // 路径 option.url = `${option.url}?t=${new Date().getTime()}`; // 路径
option.header = { option.header = {
pkgName: PAKEAGE_NAME, pkgName: PAKEAGE_NAME,
version: VERSION_CODE, version: VERSION_CODE,
token: `${token}` token: `${token}`
} }
......
<template>
<view class="detail-content">
<template v-if='showVIPContent'>
<!-- <view class="content-paragraph" :style="[contentStyle]" v-for='(item, index) in contentSources'
:key='index'>
{{item}}
</view> -->
<yingbing-flip type="cover" :data="contentSources" style="height: 100vh;">
<!-- #ifndef MP -->
<template v-slot="{item, index}">
<!-- #endif -->
<!-- #ifdef MP -->
<template v-for="(item, index) in contentSources" :slot="index">
<!-- #endif -->
<view style="height: 100%">
<text style="font-size: 28rpx;color: #fff;">{{item}}</text>
</view>
</template>
</yingbing-flip>
</template>
<template v-else>
<yingbing-flip :data="preContentSources" style="height: 100vh;">
<!-- #ifndef MP -->
<template v-slot="{item, index}">
<!-- #endif -->
<!-- #ifdef MP -->
<template v-for="(item, index) in list" :slot="index">
<!-- #endif -->
<view style="height: 100%">
<text style="font-size: 50px;font-weight: bold;color: #fff;">{{item}}</text>
</view>
</template>
</yingbing-flip>
<!-- <view class="content-paragraph" :style="[contentStyle]" v-for='(item, index) in preContentSources'
:key="index">
{{item}}
</view> -->
<view class="limit-button-box" @click="tapLimitButton">
{{limitButtonTitle}}
</view>
</template>
</view>
</template>
<script>
import {
watchContentFormatChange,
removeContentFormatChangeWatch
} from "../services/index.js"
import {
showLoginView
} from "../../../../common/services/userServices.js"
import {
gotoVIPApplyPage
} from "../../../../common/services/page-route.js"
import User from "../../../../common/models/User.js";
const PRECENT_VALUE = 40;
export default {
props: {
userInfo: {
type: Object,
default: function() {
return null
}
},
detail: {
type: Object,
default: function() {
return {}
}
}
},
data: function() {
return {
user: null,
fontSize: `18px`,
}
},
mounted() {
watchContentFormatChange((data) => {
let result = data.getFormatValue();
if (this.fontSize != result.fontSize) {
this.fontSize = result.fontSize
}
}, this)
},
destroyed() {
removeContentFormatChangeWatch(this);
},
watch: {
userInfo: {
handler: function(n) {
if (n) {
this.user = new User(n)
} else {
this.user = null
}
},
deep: true,
immediate: true
}
},
computed: {
contentSources: function() {
return this.detail && this.detail.content ? this.detail.content : [];
},
preContentSources: function() {
let result = this.detail && this.detail.content ? [...this.detail.content] : [];
let length = result.length;
if (length >= 2) {
let precent = PRECENT_VALUE / 100;
let preLength = Math.floor(length * precent);
return result.splice(0, preLength);
} else {
return result;
}
},
limitButtonTitle: function() {
let result = `~剩余${100-PRECENT_VALUE}%内容`;
if (!this.user) {
result = `${result},点击登录后继续阅读`;
} else if (!this.user.isVip()) {
result = `${result}为会员章节内容,请前往购买会员`
}
result = `${result}~`;
return result;
},
contentStyle: function() {
return {
fontSize: this.fontSize
}
},
showVIPContent: function() {
return (this.user && this.user.isVip()) || this.detail.isUnlock
}
},
methods: {
tapLimitButton() {
if (!this.user) {
showLoginView()
} else if (!this.user.isVip()) {
let isIOS = wx.getSystemInfoSync().platform;
if (isIOS === 'ios') {
uni.showToast({
title: '暂不支持IOS系统',
icon: 'none'
})
return
}
gotoVIPApplyPage()
}
}
}
}
</script>
<style lang="scss" scoped>
.detail-content {
paading: 20rpx 30rpx;
margin: 20rpx 30rpx;
display: flex;
flex-direction: column;
.content-paragraph {
text-indent: 1em;
word-wrap: break-word;
word-break: break-all;
white-space: normal;
line-height: 1.5em;
margin-bottom: 1em;
color: #333;
}
.content-paragraph:last-child {
margin-bottom: 0;
}
.limit-button-box {
text-indent: 0;
height: 120rpx;
line-height: 120rpx;
text-align: center;
color: goldenrod;
font-size: 28rpx;
}
}
</style>
\ No newline at end of file
...@@ -2,10 +2,11 @@ ...@@ -2,10 +2,11 @@
<view :style="[bgStyle]"> <view :style="[bgStyle]">
<c-empty v-if='showEmpty'></c-empty> <c-empty v-if='showEmpty'></c-empty>
<template v-else> <template v-else>
<detail-content :detail='bookData' :userInfo='userInfo' @tabVip2="tapVipPop"></detail-content> <detail-content ref="content" :detail='bookData' @tabVip2="tapVipPop"
@changeCurrent="changeCurrent"></detail-content>
<detail-bottom :detail='bookData' :userInfo='userInfo' @tapBottomItem='tapBottomItem'></detail-bottom> <detail-bottom :detail='bookData' :userInfo='userInfo' @tapBottomItem='tapBottomItem'></detail-bottom>
<setting-pop :show='showSetting' @close='closePop'></setting-pop> <setting-pop :show='showSetting' @close='closePop'></setting-pop>
<catalogue-pop :detail='bookData' :show='showCatalogue' @close='closeCataPop' <catalogue-pop :detail='bookData' :show='showCatalogue' @close='closeCataPop' :current="current"
@tabVip='tapVipPop'></catalogue-pop> @tabVip='tapVipPop'></catalogue-pop>
<!-- <vip-pop v-if="bookData.isUnlock==0 && !isVip()" :show='showVip' @close='closeVipPop'></vip-pop> <!-- <vip-pop v-if="bookData.isUnlock==0 && !isVip()" :show='showVip' @close='closeVipPop'></vip-pop>
<bean-pop v-if="bookData.isUnlock==0 && userInfo.bookLegumes<bookData.bookLegumes" :show='showBean' <bean-pop v-if="bookData.isUnlock==0 && userInfo.bookLegumes<bookData.bookLegumes" :show='showBean'
...@@ -15,15 +16,6 @@ ...@@ -15,15 +16,6 @@
:vedioId="bookData.id" @paySuccess="paySuccess"> :vedioId="bookData.id" @paySuccess="paySuccess">
</coin-popup> </coin-popup>
</template> </template>
<!-- <c-login :isShareLink="true"></c-login> -->
<popup :show="showMoibleLogin" @close="showMoibleLogin=false">
<view>
<button open-type="getPhoneNumber" @getphonenumber="MygetPhonenumber">
<view>请先绑定手机号</view>
<view style="color:green;">去绑定</view>
</button>
</view>
</popup>
</view> </view>
</template> </template>
...@@ -34,8 +26,6 @@ ...@@ -34,8 +26,6 @@
import BookDetail from "./models/BookDetail.js"; import BookDetail from "./models/BookDetail.js";
import { import {
getBookDetailData, getBookDetailData,
watchContentFormatChange,
removeContentFormatChangeWatch,
addReadRecord addReadRecord
} from "./services/index.js" } from "./services/index.js"
import { import {
...@@ -90,7 +80,6 @@ ...@@ -90,7 +80,6 @@
return { return {
bookId: null, bookId: null,
bookData: null, bookData: null,
backgroundColor: "#fff",
showSetting: false, showSetting: false,
showCatalogue: false, showCatalogue: false,
showVip: false, showVip: false,
...@@ -99,8 +88,7 @@ ...@@ -99,8 +88,7 @@
userInfo: null, userInfo: null,
showVipOpen: 0, showVipOpen: 0,
showBeanOpen: 0, showBeanOpen: 0,
showMoibleLogin: false, current: 1
mobileLoginLock: false,
}; };
}, },
onLoad(options) { onLoad(options) {
...@@ -114,13 +102,6 @@ ...@@ -114,13 +102,6 @@
} }
}, },
onReady() { onReady() {
// 监听样式变动
watchContentFormatChange((data) => {
let result = data.getFormatValue();
if (this.backgroundColor != result.backgroundColor) {
this.backgroundColor = result.backgroundColor
}
}, this)
// 监听用户变动 // 监听用户变动
watchUserInfoChange((info) => { watchUserInfoChange((info) => {
this.userInfo = info.userInfo; this.userInfo = info.userInfo;
...@@ -128,12 +109,13 @@ ...@@ -128,12 +109,13 @@
if (info.userInfo && this.bookId) { if (info.userInfo && this.bookId) {
addReadRecord(this.bookId) addReadRecord(this.bookId)
} }
// // 用户变动,需要刷新数据 // // 用户变动,需要刷新数据
// this.$nextTick(() => { // this.$nextTick(() => {
// uni.startPullDownRefresh({}) // uni.startPullDownRefresh({})
// }) // })
}, this) }, this)
// 用户变动,需要刷新数据
this.$nextTick(() => { this.$nextTick(() => {
uni.startPullDownRefresh({}) uni.startPullDownRefresh({})
}) })
...@@ -160,7 +142,6 @@ ...@@ -160,7 +142,6 @@
// 停止记录阅读时长,部分情况下页面无法响应onHide事件 // 停止记录阅读时长,部分情况下页面无法响应onHide事件
endCountReadTime(); endCountReadTime();
// 移除监听 // 移除监听
removeContentFormatChangeWatch(this);
removeUserInfoChangeWatch(this); removeUserInfoChangeWatch(this);
// 取消绑定分享参数 // 取消绑定分享参数
...@@ -193,7 +174,6 @@ ...@@ -193,7 +174,6 @@
return { return {
minHeight: `${height}px`, minHeight: `${height}px`,
position: "relative", position: "relative",
background: this.backgroundColor
} }
} }
}, },
...@@ -209,39 +189,11 @@ ...@@ -209,39 +189,11 @@
} }
}, },
methods: { methods: {
async MygetPhonenumber(e) {
console.log(e.detail.code) // 动态令牌
console.log(e.detail.errMsg) // 回调信息(成功失败都会返回)
console.log(e.detail.errno) // 错误码(失败时返回)
if (e.detail.code == undefined || e.detail.code == '') {
uni.showModal({
title: "提示",
content: e.detail.errMsg
})
return
}
var params = {
userId: this.userInfo.userid,
code: e.detail.code,
}
postPhone(params, (success, result) => {
if (success) {
saveStorage("KEY_NEED_PHONE", false);
this.mobileLoginLock = false
this.tapPayPop()
} else {
uni.showModal({
title: "提示",
content: "网络错误!"
})
}
})
},
// 解锁回调 // 解锁回调
unlockBook() { paySuccess() {
this.$set(this.bookData, "isUnlock", true); this.$set(this.bookData, "isUnlock", 1);
this.$set(this.bookData, "freeNum", this.bookData.articleChapterList.length);
this.$refs.content.reloadChapterinfoData()
}, },
// 文章数据刷新 // 文章数据刷新
refreshBookData(bookId) { refreshBookData(bookId) {
...@@ -250,13 +202,15 @@ ...@@ -250,13 +202,15 @@
// this.showVipOpen = data.openVips // this.showVipOpen = data.openVips
// }) // })
getBookDetailData(bookId, (success, data) => { getBookDetailData(bookId, (success, data) => {
// setTimeout(() => {
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
if (success) { if (success) {
if (data.isUnlock) {
data.freeNum = data.articleChapterList.length
}
this.bookData = new BookDetail(data); this.bookData = new BookDetail(data);
console.log('bookData=' + JSON.stringify(this.bookData)); console.log('bookData=' + JSON.stringify(this.bookData));
} }
// }, 300)
}) })
}, },
// 点击底部按钮 // 点击底部按钮
...@@ -305,7 +259,6 @@ ...@@ -305,7 +259,6 @@
}, },
// 展示充值书豆弹框 // 展示充值书豆弹框
tapBeanPop() { tapBeanPop() {
this.showBean = true; this.showBean = true;
}, },
// 关闭设置弹窗 // 关闭设置弹窗
...@@ -319,9 +272,11 @@ ...@@ -319,9 +272,11 @@
// 关闭会员弹窗 // 关闭会员弹窗
closeVipPop(e) { closeVipPop(e) {
this.showVip = false; this.showVip = false;
setTimeout(() => { if (this.bookData.isUnlock == 0) {
this.showRecommend = true; setTimeout(() => {
}, 300); this.showRecommend = true;
}, 300);
}
}, },
// 关闭书豆弹窗 // 关闭书豆弹窗
closeBeanPop(e) { closeBeanPop(e) {
...@@ -334,6 +289,9 @@ ...@@ -334,6 +289,9 @@
closeRecommendPop(e) { closeRecommendPop(e) {
this.showRecommend = false; this.showRecommend = false;
}, },
changeCurrent(current) {
this.current = current
}
} }
} }
</script> </script>
......
...@@ -43,6 +43,10 @@ ...@@ -43,6 +43,10 @@
detail: { detail: {
type: Object, type: Object,
default: 0 default: 0
},
current: {
type: Number,
default: 0
} }
}, },
data: function() { data: function() {
...@@ -55,6 +59,11 @@ ...@@ -55,6 +59,11 @@
}, },
computed: {}, computed: {},
watch: { watch: {
current: function(n) {
if (n != this.currentCatalogue) {
this.changeCatalogue(n)
}
},
show: function(n) { show: function(n) {
this.showPop = n; this.showPop = n;
}, },
...@@ -71,8 +80,14 @@ ...@@ -71,8 +80,14 @@
this.initColorList(); this.initColorList();
this.currentContentFormat = readContentFormat() this.currentContentFormat = readContentFormat()
for (let i in this.currentContentFormat.catalogueList) { for (let i in this.currentContentFormat.catalogueList) {
if (this.currentContentFormat.catalogueList[i].id == this.detail.id) { if (this.currentContentFormat.catalogueList[i].id == this.detail.id) {
this.currentCatalogue = this.currentContentFormat.catalogueList[i].catalogue // 处理特殊情况,下标错误
let current_e = this.currentContentFormat.catalogueList[i].catalogue
if (!this.detail.isUnlock && current_e > this.detail.freeNum) {
this.currentCatalogue = this.detail.freeNum
return
}
this.currentCatalogue = current_e
} }
} }
}, },
...@@ -110,8 +125,8 @@ ...@@ -110,8 +125,8 @@
id: this.detail.id, id: this.detail.id,
catalogue: e catalogue: e
}) })
} }
this.currentCatalogue = e this.currentCatalogue = e
saveContentFormat(this.currentContentFormat); saveContentFormat(this.currentContentFormat);
......
<template> <template>
<view class="pages"> <view class="pages">
<yingbing-text-reader ref="reader" :total-chapter="detail.articleChapterList.length" preloadable selectable <yingbing-text-reader ref="reader" :total-chapter="detail.articleChapterList.length" :preloadable="isPreload"
:background="background" :fontSize="fontSize" :lineGap="30" :color="color" :page-type="pageType" :background="background" :fontSize="fontSize" :lineGap="30" :color="color" :page-type="pageType"
:loadPageNum="1" @back="handleBack" @change="handleChange" @loadmore="handleLoadmore"> bottomGap="60" :footerShow="false" :loadPageNum="2" @change="handleChange" @loadmore="handleLoadmore">
<template v-for="(item, index) in chapters" :slot="`vip:${item.index}`"> <template v-if="!detail.isUnlock" :slot="`vip:${catalogue}`">
<view class="slots">{{item.index}}章节付费阅读提示页</view> <view class="slots">
<view class="line-box">
<view class="line"></view>
<view class="text">全本订阅超优惠</view>
<view class="line"></view>
</view>
<view class="section">
<button class="btn2" :disabled="false" :loading="false" @click="tapVip">开通会员,免费阅读本书</button>
</view>
<view class="warn-box">
<view class="warn-p">
1.目前充值会员暂不支持退款,一经购买不可退换
</view>
<view class="warn-p">
2.未满18岁的未成年人需要在监护人主导,同意下进行相关付费操作
</view>
<view class="warn-p">
3.充值一般在5分钟内到账,如未到账请提供支付截图在"我的"页面联系客服
</view>
<view class="warn-p">
4.之前充值账户请登录后继续阅读
</view>
</view>
</view>
</template> </template>
<!-- <template v-for="(item, index) in chapters" :slot="`end:${item.index}`"> <!-- <template v-for="(item, index) in chapters" :slot="`end:${item.index}`">
...@@ -23,12 +48,6 @@ ...@@ -23,12 +48,6 @@
export default { export default {
props: { props: {
userInfo: {
type: Object,
default: function() {
return null
}
},
detail: { detail: {
type: Object, type: Object,
default: function() { default: function() {
...@@ -38,7 +57,6 @@ ...@@ -38,7 +57,6 @@
}, },
data() { data() {
return { return {
chapters: [],
pageType: 'real', pageType: 'real',
split: '', split: '',
background: '#fff', background: '#fff',
...@@ -46,13 +64,10 @@ ...@@ -46,13 +64,10 @@
fontSize: 18, fontSize: 18,
pageType: 'cover', pageType: 'cover',
catalogue: 1, catalogue: 1,
isFisrt: true isFisrt: true,
isPreload: false
} }
}, },
onReady() {
let total = this.detail.articleChapterList.length
for (let i = 0; i < total; i++) this.chapters.push(this.getChapter(i + 1))
},
destroyed() { destroyed() {
removeContentFormatChangeWatch(this); removeContentFormatChangeWatch(this);
}, },
...@@ -74,15 +89,31 @@ ...@@ -74,15 +89,31 @@
} }
} }
if (this.catalogue != resultCatalogue) { if (!this.detail.isUnlock && resultCatalogue > this.detail.freeNum) {
this.catalogue = resultCatalogue this.catalogue = 3
} else {
if (this.catalogue != resultCatalogue) {
this.catalogue = resultCatalogue
this.refreshChapterinfoData(this.catalogue)
}
}
if (this.isFisrt) {
this.isFisrt = false
this.isPreload = true
this.refreshChapterinfoData(this.catalogue) this.refreshChapterinfoData(this.catalogue)
} }
}, this) }, this)
}, },
methods: { methods: {
reloadChapterinfoData() {
this.isPreload = true
this.refreshChapterinfoData()
},
// 文章数据刷新 // 文章数据刷新
refreshChapterinfoData(chapterId) { refreshChapterinfoData(chapterId = this.catalogue) {
this.catalogue = chapterId
let id = this.detail.articleChapterList[chapterId - 1].id let id = this.detail.articleChapterList[chapterId - 1].id
getChapterinfoData(this.detail.id, id, (success, data) => { getChapterinfoData(this.detail.id, id, (success, data) => {
if (success) { if (success) {
...@@ -91,51 +122,46 @@ ...@@ -91,51 +122,46 @@
}) })
}, },
changeChapterinfo(chapterId, content) { changeChapterinfo(chapterId, content) {
this.catalogue = chapterId this.chapters = [this.getChapter(chapterId, content)]
// let mycontent = content.replace(/<(\/)?p>/g, '').replace(/<(\/)?sub>/g, '').replace(/<(\/)?pre>/g, '') this.$refs.reader.change({
// .replace(/<(\/)?code>/g, '') chapters: this.chapters,
title: this.detail.title,
if (this.isFisrt) { current: chapterId,
// for (let i = 0; i < this.chapters.length; i++) { start: 1
// this.chapters[chapterId - 1].content = content })
// }
this.chapters = [this.getChapter(chapterId, content)]
this.isFisrt = false
this.$refs.reader.init({
chapters: this.chapters,
title: this.detail.title,
current: chapterId,
start: 1
})
} else {
this.chapters.push(this.getChapter(chapterId, content))
// for (let i = 0; i < this.chapters.length; i++) {
// this.chapters[chapterId - 1].content = content
// }
this.$refs.reader.change({
chapters: this.chapters,
current: chapterId
})
}
}, },
handleChange(e) { handleChange(e) {
console.log('change', e); console.log('change', e);
if (this.catalogue != e.detail.index) {
this.catalogue = e.detail.index
if (this.detail.isUnlock) {
this.changeCurrent()
} else if (!this.detail.isUnlock && this.catalogue < this.detail.freeNum) {
this.changeCurrent()
}
}
}, },
handleLoadmore(current, callback) { handleLoadmore(current, callback) {
if (current > this.detail.freeNum || current > this.detail.articleChapterList.length) {
if (!this.detail.isUnlock && current == this.detail.freeNum + 1) {
callback('success', this.getChapter(current))
return
}
callback('fail')
return
}
let id = this.detail.articleChapterList[current - 1].id let id = this.detail.articleChapterList[current - 1].id
getChapterinfoData(this.detail.id, id, (success, data) => { getChapterinfoData(this.detail.id, id, (success, data) => {
if (success) { if (success) {
callback('success', this.getChapter(current, data.contentMd)) callback('success', this.getChapter(current, data.contentMd))
} else { return
if (current < this.detail.freeNum + 1) {
callback('success', this.getChapter(current, ""))
}
} }
callback('fail')
}) })
}, },
getChapter(index, content) { getChapter(index, content) {
const showVip = index > this.detail.freeNum const showVip = !this.detail.isUnlock && index > this.detail.freeNum
return { return {
title: '第' + index + '章', title: '第' + index + '章',
content: content, content: content,
...@@ -143,14 +169,24 @@ ...@@ -143,14 +169,24 @@
// backSlots: ['end'], // backSlots: ['end'],
index: index, index: index,
isStart: index == 1, isStart: index == 1,
isEnd: index == 10 isEnd: index == this.detail.articleChapterList.length
} }
} },
tapVip() {
setTimeout(() => {
this.$emit('tabVip2')
}, 200)
},
changeCurrent() {
setTimeout(() => {
this.$emit('changeCurrent', this.catalogue)
}, 200)
},
} }
} }
</script> </script>
<style> <style lang="scss">
.pages { .pages {
/* #ifdef APP-NVUE */ /* #ifdef APP-NVUE */
flex: 1; flex: 1;
...@@ -169,22 +205,63 @@ ...@@ -169,22 +205,63 @@
left: 0; left: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
color: blue;
/* #ifndef APP-NVUE */
display: flex; display: flex;
flex-direction: column; flex-direction: column;
/* #endif */
align-items: center; align-items: center;
justify-content: center; justify-content: center;
}
.btns { .section {
display: flex; width: 80%;
flex-direction: row; margin-top: 30rpx;
align-items: center; display: flex;
justify-content: space-between; flex-direction: column;
position: fixed;
left: 0; .btn2 {
right: 0; color: #DCBD3B;
border: #DCBD3B solid 1rpx;
width: 100%;
text-align: center;
border-radius: 80rpx;
height: 80rpx;
line-height: 80rpx;
}
}
.line-box {
width: 80%;
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items: center;
.line {
width: 30%;
background-color: lightgray;
height: 1rpx;
}
.text {
text-align: center;
width: 36%;
color: lightgray;
font-size: 26rpx;
}
}
.warn-box {
color: #956244;
font-size: 26rpx;
display: flex;
flex-direction: column;
padding: 30rpx;
.warn-p {
margin-bottom: 15rpx;
}
.warn-p:last-child {
margin-bottom: 0;
}
}
} }
</style> </style>
\ No newline at end of file
...@@ -44,6 +44,10 @@ ...@@ -44,6 +44,10 @@
openUrl openUrl
} from '@/utils/app+.js'; } from '@/utils/app+.js';
import {
gotoBookContentPage
} from '../../common/services/page-route.js';
const app = getApp(); const app = getApp();
export default { export default {
...@@ -76,15 +80,17 @@ ...@@ -76,15 +80,17 @@
}); });
}, },
handleInfo(item) { handleInfo(item) {
var bookId = item.id; gotoBookContentPage(item.id, item.shortis)
uni.navigateTo({
url: `/page-subs/sub_A/book-content/book-content`, // var bookId = item.id;
success: (res) => { // uni.navigateTo({
res.eventChannel.emit("openBookContentPage", { // url: `/page-subs/sub_A/book-content/book-content`,
bookId // success: (res) => {
}) // res.eventChannel.emit("openBookContentPage", {
} // bookId
}) // })
// }
// })
}, },
handleXing(item) { handleXing(item) {
var that = this; var that = this;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment