Commit 6d0199e6 authored by mengcuiguang's avatar mengcuiguang

修改vip弹窗,添加vip返回挽留

parent 7375eeb9
......@@ -92,7 +92,7 @@ let apiRequest = function({
option.data = data;
}
}
console.log('123')
// token处理
let token = readToken();
if (!checkTokenWhiteList(token, url, urlModule)) {
......@@ -123,7 +123,7 @@ let apiRequest = function({
...header
}
}
console.log('123')
printInfo("start Req", option);
let requestTask = uni.request({
...option,
......
This diff is collapsed.
......@@ -2,46 +2,42 @@
<view class="body">
<view v-if="showMask" class="show-mask flex-v" @click="showMask=false">
<view class="mt-30" style="width: 90%;text-align: right;">
<image style="width: 30rpx;height: 30rpx;padding:6rpx;
border-radius: 40rpx;border: 2px solid darkgray;" src="@/static/index/ic_quit_white.png" />
<image style="width: 30rpx;height: 30rpx;" src="@/static/index/ic_quit_white.png" mode="widthFix" />
</view>
<text class="mt-10" style="font-size: 46rpx;">如何继续使用?</text>
<text class="m-10">找到“河狸小故事”小程序</text>
<text class="m-10">找到“逸想小说阁”小程序</text>
<image class="mt-30" mode="widthFix" :src="maskImage1"></image>
<image :src="maskImage2" mode="widthFix"></image>
</view>
<view style="display: flex;flex-direction: row;align-items: center;margin: 20rpx;padding-left: 10rpx;">
<view class="avatar-root">
<image class="avatar" src="@/static/images/logo.png"></image>
<view style="padding-left: 30rpx;font-size: 22rpx;">
<view style="font-size: 34rpx;color: black;margin-bottom: 10rpx;">书友{{userBean.idcode}}</view>
<view v-if="isVip()"
style="color: #9B4029;border-radius: 20rpx;width:130rpx;text-align:center;background:linear-gradient(90deg,#F9BEA9,#FFDACA);">
<view class="icon-root">
<view class="idcode">书友{{userBean.idcode}}</view>
<view v-if="isVip()" class="icon-lable1">
普通用户
</view>
<view v-else
style="color: #392F2C;border-radius: 20rpx;width:130rpx;text-align:center;background:linear-gradient(90deg,#FAD198,#F7C98C);">
<view v-else class="icon-lable2">
畅读VIP</view>
</view>
</view>
<view class="vip-label">
<image style="width: 100%;position: absolute;z-index: 1;" mode="widthFix"
<image class="vip-bg" mode="widthFix"
src="https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg/img/bg_book_my.png"></image>
<view class="flex-v" style="z-index: 10;margin-left: 180rpx;">
<view style="font-size: 34rpx;color: #FFE5BA;">
<view class="vip-title">
{{ isVip() ? '开通VIP会员' : 'VIP会员'}}
</view>
<view v-if="isVip()" style="font-size: 28rpx;color: #ADABAA;margin-top: 12rpx;">
<view class="vip-hint1" v-if="isVip()">
开通会员享更多福利</view>
<view v-else style="font-size: 28rpx;color: #b5b5b5;margin-top: 12rpx;">
<view class="vip-hint2" v-else>
到期时间:{{userBean.expireTime*1000 | formatDate('yyyy-MM-dd')}}</view>
</view>
<view @click="handleCoinPay"
style="width: 160rpx;height: 60rpx;background:linear-gradient(90deg,#FAD198,#F7C98C);border-radius:30rpx;color: #4F301D;font-size: 30rpx;text-align: center;line-height: 60rpx;z-index: 10;margin-right: 20rpx;">
<view class="vip-btn" @click="handleCoinPay">
{{ isVip() ? '去开通' : '已开通'}}
</view>
</view>
......@@ -51,25 +47,13 @@
<image class="setting-img" src="@/static/setting/setting_wddd.png"></image>
我的订单
</view>
<view v-if="false" class="item" @click="handleDotRecord">
<image class="setting-img" src="@/static/images/logo.png"></image>
书豆记录
</view>
<view v-if="false" class="item" @click="handleUseDotRecord">
<image class="setting-img" src="@/static/images/logo.png"></image>
消费记录
</view>
<view class="item" @click="handleReadRecord">
<image class="setting-img" src="@/static/setting/setting_ydjl.png"></image>
阅读记录
</view>
<view v-if="false" class="item" @click="handleFind">
<image class="setting-img" src="@/static/images/logo.png"></image>
如何找到我
</view>
<view class="item" @click="handleUnsign">
<image class="setting-img" src="@/static/setting/setting_qxdy.png"></image>
取消订阅
如何找到我
</view>
<view class="item" @click="handlecdk">
<image class="setting-img" src="@/static/setting/setting_dhhy.png"></image>
......@@ -81,11 +65,10 @@
</view>
</view>
<!-- <view style="display: flex;justify-content: center;margin-top: 20rpx;font-size: 26rpx;color: gray;">
{{ versionName }}
</view> -->
<coin-popup :show="showAnimate" @close="showAnimate = false" @paySuccess="paySuccess">
<coin-popup :show="showAnimate" @close="coinClose($event)" @paySuccess="paySuccess">
</coin-popup>
<vipback-popup :show="showVipbackPop" :vipBean="backvipBean" @vipbackclose="vipbackClose()"
@vipbackpaySuccess="vipbackpaySuccess" />
<kefu-popup :show="showKefuPop" @close="showKefuPop = false" />
</view>
</template>
......@@ -97,7 +80,7 @@
import CoinPopup from "@/components/coin-popup/coin-popup.vue";
import KefuPopup from "@/components/kefu-popup/kefu-popup.vue";
import VipbackPopup from '@/components/vipback-popup/vipback-popup.vue';
import {
navigateTo,
message,
......@@ -114,17 +97,20 @@
name: 'index',
mixins: [common],
components: {
VipbackPopup,
CoinPopup,
KefuPopup
},
data() {
return {
showMask: false,
showVipbackPop: false,
showKefuPop: false,
maskImage1: 'https://mints-web.oss-cn-beijing.aliyuncs.com/images/bg_find1.png',
maskImage2: 'https://mints-web.oss-cn-beijing.aliyuncs.com/images/bg_find2.png',
statusBarHeight: app.globalData.statusBarHeight,
userBean: {},
backvipBean: null,
showAnimate: false,
versionName: '',
vipLabelBg: 'https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg/img/bg_book_my.png',
......@@ -177,8 +163,7 @@
navigateTo(`/pagesD/readerRecord/readerRecord`)
},
handleCoinPay() {
// this.showAnimate = true;
navigateTo(`/pagesA/vipPay/vipPay`)
this.showAnimate = true;
},
handlePayRecord() {
navigateTo(`/pagesD/payRecord/payRecord`)
......@@ -190,13 +175,7 @@
navigateTo(`/pagesA/cdkey/cdkey`)
},
handleUnsign() {
if (this.agreementDto) {
let params = JSON.stringify(this.agreementDto)
navigateTo(`/pagesA/unsign/unsign?params=` + params)
return
}
message.notify('您未订阅会员');
this.showMask = true
},
handlePhone() {
this.showKefuPop = true
......@@ -215,6 +194,39 @@
this.userBean = data;
}
});
},
coinClose(e) {
let item = e.detail.data;
if (item != null) {
this.backvipBean = item;
setTimeout(() => {
this.showVipbackPop = true;
}, 300);
} else {
this.showAnimate = false;
}
console.log('mymymymymy', item);
},
vipbackClose() {
this.showAnimate = false;
this.showVipbackPop = false;
},
vipbackpaySuccess(largeType) {
// largeType=vip 开通vip
// largeType=point 购买书豆
message.notify('支付成功');
this.post({
url: '/user/baseMsg',
showLoading: false,
success: ({
data
}) => {
this.userBean = data;
}
});
this.vipbackClose();
}
}
};
......@@ -238,7 +250,7 @@
position: relative;
display: flex;
justify-content: space-between;
margin: 60rpx 30rpx;
margin: 70rpx 30rpx;
align-items: center;
}
......@@ -286,4 +298,75 @@
width: 90%;
}
}
.avatar-root {
display: flex;
flex-direction: row;
align-items: center;
margin: 30rpx 20rpx;
padding-left: 10rpx;
}
.icon-root {
padding-left: 30rpx;
font-size: 22rpx;
}
.idcode {
font-size: 34rpx;
color: black;
margin-bottom: 10rpx;
}
.icon-lable1 {
color: #9B4029;
border-radius: 20rpx;
width: 130rpx;
text-align: center;
background: linear-gradient(90deg, #F9BEA9, #FFDACA);
}
.icon-lable2 {
color: #392F2C;
border-radius: 20rpx;
width: 130rpx;
text-align: center;
background: linear-gradient(90deg, #FAD198, #F7C98C);
}
.vip-bg {
width: 100%;
position: absolute;
z-index: 1;
}
.vip-title {
font-size: 34rpx;
color: #FFE5BA;
}
.vip-hint1 {
font-size: 28rpx;
color: #ADABAA;
margin-top: 12rpx;
}
.vip-hint2 {
font-size: 28rpx;
color: #b5b5b5;
margin-top: 12rpx;
}
.vip-btn {
width: 160rpx;
height: 60rpx;
background: linear-gradient(90deg, #FAD198, #F7C98C);
border-radius: 30rpx;
color: #4F301D;
font-size: 30rpx;
text-align: center;
line-height: 60rpx;
z-index: 10;
margin-right: 20rpx;
}
</style>
\ No newline at end of file
......@@ -4,10 +4,11 @@
<view class="container">
<image @click="onClose" style="width: 50rpx; height: 50rpx;margin-left:auto;margin-right: 30rpx;
margin-bottom: 30rpx;" src="https://mints-web.oss-cn-beijing.aliyuncs.com/images/ic_close_white.png"></image>
<view class="content">
<button class="button1" type="default" size="default"
@click="tapMakePhoneCall">客服电话:400-096-9950</button>
<!-- <button class="button2" open-type="im" data-im-id="93264117800">客服在线</button> -->
<text style="font-size: 40rpx;margin-bottom: 15rpx;">客服时间: 工作日9:00-18:00</text>
<text class="button1" @click="tapMakePhoneCall">客服电话</text>
<button class="button2" open-type="im" data-im-id="93264117800">在线客服</button>
</view>
</view>
</uni-popup>
......@@ -15,8 +16,6 @@
</template>
<script>
// import uniPopuo from 'uniPopuo'
export default {
name: 'kefuPopup',
props: {
......@@ -40,7 +39,7 @@
},
tapMakePhoneCall() {
let that = this
wx.makePhoneCall({
tt.makePhoneCall({
phoneNumber: "4000969950",
success(res) {
// 调用成功 makePhoneCall:ok
......
<template>
<uni-popup type="center" ref="vipback" :maskClick="false" :isMaskClick="false">
<view class="dialog">
<view class="dialog-container">
<view class="dialog-content">
<text style="font-size: 42rpx; color: #6C6A6A;">
{{vipBean.topTitle}}
</text>
<view style="display: flex;flex-direction: row;margin-top: 30rpx;">
<view style="font-size: 42rpx;color: #333232;margin-top: 18rpx;"></view>
<view style="font-size: 60rpx;color: #F32E2E;font-weight: 777;">{{vipBean.firstPayPrice}}</view>
<view style="font-size: 42rpx;color: #333232;margin-top: 18rpx;"></view>
</view>
<text style="margin-top: 30rpx; font-size: 38rpx; color: #F32E2E">
{{vipBean.remarks}}
</text>
<image @click="handlePay"
src="https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg/img/bg_book_vip_btn.png"
style="height: 112rpx;margin-top: 100rpx;" mode="heightFix"></image>
</view>
<image src="https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg/img/bg_book_vip_.png"
style="height: 624rpx;" mode="heightFix"></image>
</view>
<image @click="handleClose" style="width: 50rpx; height: 50rpx;margin:40rpx auto;"
src="@/static/video/close.png">
</image>
</view>
</uni-popup>
</template>
<script>
import common from '@/mixins/common';
import {
message
} from '@/utils/fun';
export default {
name: 'vipbackPopup',
mixins: [common],
props: {
show: {
type: Boolean,
default: false
},
vipBean: {
type: Object,
default: function() {
return {}
}
}
},
data() {
return {
os: 'android'
};
},
watch: {
show: {
handler: function(newVal, oldVal) {
if (newVal) {
this.showdialog();
}
},
immediate: true
}
},
methods: {
showdialog() {
this.$refs.vipback.open();
console.log('vipback-', this.vipBean);
if (tt.getSystemInfoSync().platform === 'ios') {
this.os = 'ios';
}
},
handlePay() {
if (this.os == 'ios') {
message.notify('iOS暂不支持购买');
return
}
let that = this;
// 抖音支付
this.post({
url: '/vip/getVipPayParams/douyin',
data: {
os: that.os,
pid: that.vipBean.pid
},
showLoading: true,
success: ({
data
}) => {
that.ttPrePay(data, that.vipBean.largeType);
}
});
},
ttPrePay(ttData, largeType) {
if (!tt.canIUse('requestOrder')) {
message.notify('请升级抖音APP版本.');
return
}
tt.showLoading({
title: '加载中...'
});
let that = this;
tt.requestOrder({
data: ttData.params.data,
byteAuthorization: ttData.params.byteAuthorization,
success(res) {
that.ttPay(largeType, res.orderId, ttData);
},
fail(res) {
tt.hideLoading();
console.log('ttPrePay', res.errMsg);
// message.notify(res.errMsg);
},
});
},
ttPay(largeType, oid, ttData) {
tt.hideLoading();
if (!tt.canIUse('getOrderPayment')) {
message.notify('请升级抖音APP版本!');
return
}
let that = this;
if (this.os == 'ios') {
if (!tt.canIUse('getOrderPayment.object.imId')) {
message.notify('请升级抖音APP版本~');
return
}
tt.getOrderPayment({
orderId: oid,
imId: ttData.imId,
success(res) {
that.queryOrderStatus(largeType, ttData.tidStr);
},
fail(res) {
console.log('ios pay', res.errMsg);
// message.notify(res.errMsg);
},
});
} else {
tt.getOrderPayment({
orderId: oid,
success(res) {
that.queryOrderStatus(largeType, ttData.tidStr);
},
fail(res) {
console.log('android pay', res.errMsg);
// message.notify(res.errMsg);
},
});
}
},
queryOrderStatus(largeType, tid) {
let that = this;
this.post({
data: {
tid: tid
},
url: '/vip/queryVipOrder',
showLoading: true,
success: ({
data
}) => {
that.vipbackpaySuccess(largeType);
}
});
},
vipbackpaySuccess(largeType) {
this.$emit('vipbackpaySuccess', largeType);
this.handleClose();
},
handleClose() {
this.$refs.vipback.close();
this.$emit('vipbackclose');
}
}
}
</script>
<style lang="less">
.dialog {
height: 100%;
display: flex;
flex-direction: column;
padding-bottom: 290rpx;
}
.dialog-container {
position: relative;
}
.dialog-content {
position: absolute;
top: 16%;
left: 50%;
width: 500rpx;
margin-left: -250rpx;
display: flex;
flex-direction: column;
align-items: center;
}
</style>
\ No newline at end of file
......@@ -14,9 +14,16 @@
<bean-pop v-if="bookData.isUnlock==0 && userInfo.bookLegumes<bookData.bookLegumes" :show='showBean'
@close='closeBeanPop'></bean-pop> -->
<recommend-pop :show='showRecommend' @close='closeRecommendPop' :bookId="bookId"></recommend-pop>
<coin-popup v-if="bookData.isUnlock==0 && !isVip()" :show="showVip" @close="closeVipPop"
<!-- <coin-popup v-if="bookData.isUnlock==0 && !isVip()" :show="showVip" @close="closeVipPop"
:vedioId="bookData.id" @paySuccess="paySuccess">
</coin-popup> -->
<coin-popup v-if="bookData.isUnlock==0 && !isVip()" :show="showVip" @close="coinClose($event)"
:vedioId="bookData.id" @paySuccess="paySuccess">
</coin-popup>
<vipback-popup :show="showVipbackPop" :vipBean="backvipBean" @vipbackclose="vipbackClose()"
@vipbackpaySuccess="vipbackpaySuccess" />
<kefu-popup :show="showKefuPop" @close="showKefuPop = false" />
</template>
<c-login :isShareLink="true"></c-login>
<popup :show="showMoibleLogin" @close="showMoibleLogin=false">
......@@ -53,6 +60,8 @@
import SettingPop from "./components/setting-pop.vue";
import VipPop from "./components/vip-pop.vue";
import BeanPop from "./components/bean-pop.vue";
import VipbackPopup from '@/components/vipback-popup/vipback-popup.vue';
import CoinPopup from "@/components/coin-popup/coin-popup.vue";
import RecommendPop from "./components/recommend-pop.vue";
import SystemInfoMixin from "../../../common/mixins/system-info-mixin.js";
import {
......@@ -86,6 +95,8 @@
VipPop,
BeanPop,
RecommendPop,
VipbackPopup,
CoinPopup,
},
data() {
return {
......@@ -101,6 +112,8 @@
showBeanOpen: 0,
showMoibleLogin: false,
mobileLoginLock: false,
showVipbackPop: false,
backvipBean: null,
};
},
onLoad(options) {
......@@ -346,6 +359,35 @@
// 点击封面,暂无
tapThumb(e) {
gotoBookCoverPage(this.bookData.id);
},
coinClose(e) {
let item = e.detail.data;
if (item != null) {
this.backvipBean = item;
setTimeout(() => {
this.showVipbackPop = true;
}, 300);
} else {
this.showVip = false;
setTimeout(() => {
this.showRecommend = true;
}, 300);
}
console.log('mymymymymy', item);
},
vipbackClose() {
this.showVip = false;
this.showVipbackPop = false;
setTimeout(() => {
this.showRecommend = true;
}, 300);
},
vipbackpaySuccess(largeType) {
this.$set(this.bookData, "isUnlock", true);
this.vipbackClose();
}
}
}
......
......@@ -14,16 +14,17 @@
"style": {
"navigationStyle": "default",
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "#000000"
"navigationBarTextStyle": "black"
}
},
// #endif
{
"path": "pages/home",
"style": {
"style": {
"navigationBarTitleText": "逸想小说阁",
"navigationStyle": "default",
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "#000000"
"navigationBarTextStyle": "black"
}
}, {
"path": "pages/brower/brower",
......
......@@ -18,6 +18,12 @@
</view>
</z-paging>
<view class="box-wrap" @click="handleKefu">
<image src="../../static/ic_service.png"></image>
<text>客服时间:</text>
<text>每天9:00-18:00</text>
</view>
<kefu-popup :show="showKefuPop" @close="showKefuPop = false" />
</view>
</template>
<script>
......@@ -28,7 +34,8 @@
mixins: [common],
data() {
return {
dataList: []
dataList: [],
showKefuPop: false
};
},
methods: {
......@@ -39,10 +46,10 @@
},
queryList(page, size) {
this.post({
url: '/vip/getOrderList',
data: {
page,
size
url: '/vip/getOrderList',
data: {
page,
size
},
showLoading: false,
success: ({
......@@ -51,6 +58,9 @@
this.$refs.paging.complete(data.list);
}
});
},
handleKefu() {
this.showKefuPop = true
}
}
};
......@@ -60,4 +70,23 @@
.body {
background-color: whitesmoke;
}
.box-wrap {
position: absolute;
bottom: 20%;
right: 6%;
z-index: 999;
display: flex;
flex-direction: column;
align-items: center;
image {
width: 100rpx;
height: 100rpx;
}
text {
color: #2c2c2c;
}
}
</style>
\ No newline at end of file
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