Commit a51857c2 authored by jyx's avatar jyx

微信官方阅读器

parent a779a283
......@@ -16,10 +16,10 @@
<view v-if="agreementDto != null" @click="handleUnsign"
style="margin-top: 12rpx;margin-left: 10rpx;">自动续费管理></view>
<view style="margin-top: 12rpx;margin-left: auto;display: flex;flex-direction: row;">
<view style="margin-top: 15rpx;margin-left: auto;display: flex;flex-direction: row;">
<view @click="handleAgree" style="margin-right: 10rpx;">付费须知></view>
<image @click="handleClickClose"
style="width: 30rpx;height: 30rpx;display: flex;align-items: right;margin-top: 20rpx;margin-left: auto;margin-right: 20rpx;margin-bottom: 10rpx;"
<image @click="handleClose"
style="width: 30rpx;height: 30rpx;display: flex;align-items: right;margin-top: 13rpx;margin-left: 10rpx;margin-right: 20rpx;margin-bottom: 10rpx;"
src="@/static/index/ic_quit_white.png"></image>
</view>
......@@ -81,7 +81,7 @@
import {
apiPOST
} from "../common/utils/apiRequest.js"
} from "@/common/utils/apiRequest.js"
export default {
data() {
......@@ -89,7 +89,7 @@
vipList: [],
selectedIndex: 0,
agreeFlag: false,
agreeText: "付费须知\n\n1、看点和会员属于虚拟商品,一经购买不可退换\n\n2、未满18岁的未成年人需要在监护人主导、同意下进行相关付费操作;\n\n3、充值看点一般5分钟内到账,如未到账请在“我的”页面联系客服;"
agreeText: "付费须知\n\n1、看点和会员属于虚拟商品,一经购买不可退换\n\n2、未满18岁的未成年人需要在监护人主导、同意下进行相关付费操作;\n\n3、充值看点一般5分钟内到账,如未到账请在“我的”页面联系客服;",
userBean: {},
agreementDto: null,
hintText: '',
......@@ -126,58 +126,76 @@
methods: {
// 支付完成回调
paySuccess(largeType) {
this.$emit('paySuccess', largeType);
this.handleClose();
this.unlockSerial()
},
unlock() {
// 取出对应的阅读器实例
const novelManager = novelPlugin.getNovelManager(this.properties.novelManagerId)
// 告诉阅读器这一章已解锁
// 解锁剧集
unlockSerial() {
let that = this
const novelManager = novelPlugin.getNovelManager(this.novelManagerId)
apiPOST({
url: '/book/info',
data: {
wxId: that.bookId,
reader: true
},
callback: (success, data) => {
if (success) {
novelManager.paymentCompleted()
that.$nextTick(() => {
novelManager.setContents({
contents: data.wechatRecord.wxChapter
})
})
that.handleClose()
}
}
})
},
handleShow() {
let that = this;
if (wx.getSystemInfoSync().platform === 'ios') {
this.os = 'ios';
}
this.post({
// const novelManager = novelPlugin.getNovelManager(this.novelManagerId)
// novelManager.setChargeWay({
// globalConfig: {
// mode: 1,
// buttonText: '解锁全部',
// tip: '开通会员后可继续阅读',
// },
// })
let that = this;
apiPOST({
url: '/vip/getVipProducts/cyc',
data: {
bookId: that.vedioId
},
showLoading: false,
success: ({
data
}) => {
this.vipList = data.list;
callback: (success, data) => {
if (success) {
that.vipList = data.list;
if (data.list != null) {
this.hintText = this.vipList[0].trailRemark;
that.hintText = that.vipList[0].trailRemark;
for (let i = 0; i < data.list.length; i++) {
if (data.list[i].activityType == 1) {
this.selectedIndex = i;
that.selectedIndex = i;
break;
}
}
}
}
}
});
this.post({
apiPOST({
url: '/vip/getOrderList',
showLoading: false,
success: ({
data
}) => {
callback: (success, data) => {
if (success) {
console.log("agreement=", data.agreement);
if (data.agreement == undefined) {
this.agreementDto = null;
} else {
this.agreementDto = data.agreement;
}
}
}
});
},
......@@ -190,12 +208,9 @@
handleAgree() {
this.agreeFlag = true
},
handleClickClose() {
this.$emit('clickClose');
this.$emit('close');
},
handleClose() {
this.$emit('close');
const novelManager = novelPlugin.getNovelManager(this.novelManagerId)
novelManager.closeChargeDialog()
},
choosePack(item, index) {
this.selectedIndex = index;
......@@ -213,16 +228,14 @@
if (this.os == 'ios') {
message.notify('暂不支持ios系统~');
} else {
this.post({
apiPOST({
url: '/vip/getVipPayParams/wechat',
data: {
pid: vipBean.pid,
payChannel: 'WEIXIN'
},
showLoading: true,
success: ({
data
}) => {
callback: (success, data) => {
if (success) {
if (vipBean.firstPayPrice == 0) {
//签约
that.wxSign(data, vipBean.largeType);
......@@ -230,7 +243,7 @@
//普通支付
that.wxPay(data, vipBean.largeType);
}
}
}
});
}
......@@ -278,28 +291,17 @@
},
queryOrderStatus(largeType, tid) {
let that = this;
this.post({
apiPOST({
url: '/vip/queryVipOrder',
data: {
tid: tid
tid
},
url: '/vip/queryVipOrder',
showLoading: true,
success: ({
data
}) => {
callback: (success, data) => {
if (success) {
that.paySuccess(largeType);
}
});
}
},
watch: {
show: {
handler: function(newVal, oldVal) {
if (newVal) {
this.handleShow();
}
},
immediate: true
});
}
}
};
......
......@@ -13,6 +13,11 @@ import './filters'
plus.screen.lockOrientation('portrait-primary');
// #endif
// #ifdef MP-WEIXIN
import chargedialog from './components/charge-dialog/charge-dialog.vue'
Vue.component('charge-dialog', chargedialog)
// #endif
// let v = new vconsole();
// #ifndef VUE3
import Vue from 'vue'
......
......@@ -13,8 +13,9 @@ function navigateToNovel(wxId, customId) {
const proto = {
_onNovelLoad(data) {
const novelManager = novelPlugin.getNovelManager(data.id)
// this.nm = novelManager
const nm = novelPlugin.getNovelManager(data.id)
this.nm = nm
this.myId = data.id
novelPlugin.setLoggerConfig({
info: true,
......@@ -24,21 +25,21 @@ const proto = {
error: true,
})
const customId = novelManager.getCustomServerParams()
const customId = nm.getCustomServerParams()
this.getContent(customId).then(res => {
novelManager.setContents({
nm.setContents({
contents: res.chapter
})
})
// 调整分享参数
novelManager.setShareParams({
nm.setShareParams({
title: 'xxx',
imageUrl: 'xxx'
})
novelManager.onUserTriggerEvent((obj) => {
nm.onUserTriggerEvent((obj) => {
console.log('onUserTriggerEvent----->' + obj.event_id)
//开始阅读书籍时
......@@ -97,18 +98,8 @@ const proto = {
url: '/book/addReadRecord',
data: {
articleId
},
success: (res) => {
console.log('ssssssss')
},
fail: (res) => {
console.log('eeeeeee')
}
})
},
// 解锁剧集
unlockSerial() {
}
}
......
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