|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <scroll-view @touchmove.stop.prevent="() => {}" :scroll-y="true" :refresher-enabled="false" class="color-bg" :style="{'background-color': read_setting_data.readMode==config.read_config.readMode.Bright?config.read_config.colorList[read_setting_data.colorBgIndex]:DarkBg,'height':'100%' }">
|
|
|
+ <scroll-view :scroll-y="true" :refresher-enabled="false" class="color-bg" :style="{'background-color': read_setting_data.readMode==config.read_config.readMode.Bright?config.read_config.colorList[read_setting_data.colorBgIndex]:DarkBg,'height':'100%' }">
|
|
|
<readPage class="content" ref="readPages" @onTouchstart="onStartClickView"
|
|
|
@clickCatalog="onClickCatalog"
|
|
|
@clickPreChapter="onClickPreChapter"
|
|
@@ -112,26 +112,33 @@
|
|
|
|
|
|
|
|
|
function check_buy_status(){
|
|
|
+
|
|
|
let chapter = tools.getCurChapterData(cur_read_chapter_index.value,directoryList);
|
|
|
- if(!tools.getUserIsVIP()){ //判断是否是vip
|
|
|
- if(ReadSetting().getReadSetting().autoBuyNextChpater){ //判断是否是自动购买
|
|
|
- if(UserData().getData().coin>=chapter.coin){ //用户书币足够支付
|
|
|
- BuyBookChapter(chapter.id,chapter.coin)
|
|
|
+ if(chapter.pay_type == config.chapter_pay_type.SHOU_FEI){
|
|
|
+ if(!tools.getUserIsVIP()){ //判断是否是vip
|
|
|
+ if(ReadSetting().getReadSetting().autoBuyNextChpater){ //判断是否是自动购买
|
|
|
+ if(UserData().getData().coin>=chapter.coin){ //用户书币足够支付
|
|
|
+ check_book_chapter_is_buy(chapter.id,(isBuy)=>{
|
|
|
+ if(!isBuy){
|
|
|
+ BuyBookChapter(chapter.id,chapter.coin)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ check_book_chapter_is_buy(chapter.id)
|
|
|
+ }
|
|
|
}else{
|
|
|
check_book_chapter_is_buy(chapter.id)
|
|
|
}
|
|
|
}else{
|
|
|
- if(chapter.pay_type == config.chapter_pay_type.SHOU_FEI){
|
|
|
- check_book_chapter_is_buy(chapter.id)
|
|
|
- }
|
|
|
+ UnLockChapter()
|
|
|
}
|
|
|
- }else{
|
|
|
- UnLockChapter()
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
let showCode = ref(false)
|
|
|
- function check_book_chapter_is_buy(chapter_id:number){
|
|
|
+ function check_book_chapter_is_buy(chapter_id:number,cb:Function=null){
|
|
|
tools.check_book_chapter_is_buy(book_data.book_id,chapter_id,(isBuy)=>{
|
|
|
if(!isBuy){
|
|
|
console.log("check_book_chapter_is_buy1",isBuy)
|
|
@@ -141,6 +148,9 @@
|
|
|
}else{
|
|
|
UnLockChapter()
|
|
|
}
|
|
|
+ if(cb!=null){
|
|
|
+ cb(isBuy)
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
function down_dir_load(){
|
|
@@ -363,7 +373,7 @@
|
|
|
BuyBookChapter(chapter.id,chapter.coin)
|
|
|
}
|
|
|
|
|
|
- function onClickBuy(goods_id:number){
|
|
|
+ function onClickBuy(goods_id:number,isVip:boolean = true){
|
|
|
uni.showLoading({
|
|
|
title:'跳转支付...',
|
|
|
mask:true
|
|
@@ -375,6 +385,10 @@
|
|
|
SchedulingOrder(data.order_id,()=>{
|
|
|
UserData().update_user_info(()=>{
|
|
|
uni.hideLoading()
|
|
|
+ if(isVip){
|
|
|
+ UnLockChapter()
|
|
|
+ showRecharge.value = false
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
})
|
|
@@ -385,6 +399,7 @@
|
|
|
|
|
|
function BuyBookChapter(chapter_id:number,coin:number){
|
|
|
if(tools.getUserIsVIP()){
|
|
|
+ UnLockChapter()
|
|
|
return
|
|
|
}
|
|
|
if(UserData().getData().coin>=coin){
|
|
@@ -394,6 +409,7 @@
|
|
|
})
|
|
|
http.DynamicRequest(config.url_confg.Dynamic.buy_chapter,{'book_id':book_data.book_id,'chapter_id':chapter_id},(err,d)=>{
|
|
|
if(!err){
|
|
|
+ log.Debug(d)
|
|
|
if(d.code==config.url_confg.StatesCode.SUCCESS){
|
|
|
// d.content.includes(chapter_id)
|
|
|
UserData().update_user_info(()=>{
|
|
@@ -407,6 +423,8 @@
|
|
|
}else{
|
|
|
|
|
|
}
|
|
|
+ }else{
|
|
|
+ log.Error(err)
|
|
|
}
|
|
|
|
|
|
})
|
|
@@ -420,10 +438,8 @@
|
|
|
|
|
|
function SchedulingOrder(order_id:string,cb:Function){
|
|
|
let temp = setInterval(()=>{
|
|
|
- console.log("查询支付")
|
|
|
http.DynamicRequest(config.url_confg.Dynamic.recharge.order_info,{'order_id':order_id},(err,d)=>{
|
|
|
if(!err){
|
|
|
- console.log("查询支付info",d)
|
|
|
if(d.code == config.url_confg.StatesCode.SUCCESS){
|
|
|
let data:order_info_data = d.content
|
|
|
if(data.status==config.order_status.YI_JING_ZHI_FU){
|