Commit 91253ede authored by mengcuiguang's avatar mengcuiguang

代码优化

parent 6401c10b
<template> <template>
<uni-popup type="bottom" ref="coinPop" :maskClick="false" :safe-area='false' :isMaskClick="false"> <uni-popup type="bottom" ref="coinPop" :maskClick="false" :safe-area='false' :isMaskClick="false">
<view style="position: relative;background-color: white;">
<view v-if="agreeFlag"
style="width: 100%;height: 100%;background-color: black;opacity: 0.8;display: flex;position: absolute;z-index: 100;color: white;flex-direction: column;align-items: center;padding:40rpx 0;">
<text style="font-size: 30rpx;">
付费须知 \n
1、会员属于虚拟商品,一经购买不可退换 \n
2、未满18岁的未成年人需要在监护人主导、同意下进行相关付费操作;\n
3、充值一般5分钟内到账,如未到账请在“我的”页面联系客服;
</text>
<image @click="agreeFlag=false" style="width: 30rpx;height: 30rpx;margin-top:150rpx;"
src="@/static/index/ic_quit_white.png"></image>
</view>
<view class="body" style="width: 100%;height: 100%;background-color: white;"> <view class="body" style="width: 100%;height: 100%;background-color: white;">
<scroll-view scroll-y> <scroll-view scroll-y>
<view style="display: flex;flex-direction: column;align-items: flex-end;margin-bottom: 10rpx;"> <view style="display: flex;flex-direction: column;align-items: flex-end;margin-bottom: 10rpx;">
<view style="display: flex;flex-direction: row;"> <view style="display: flex;flex-direction: row;">
<view @click="handleAgree" style="margin-top: 16rpx;margin-right: 16rpx;">付费须知></view>
<image @click="handleClose" <image @click="handleClose"
style="width: 40rpx;height: 40rpx;display: flex;align-items: right;margin-top: 20rpx;margin-right: 20rpx;margin-bottom: 10rpx;" style="width: 40rpx;height: 40rpx;display: flex;align-items: right;margin-top: 20rpx;margin-right: 20rpx;margin-bottom: 10rpx;"
src="@/static/index/ic_quit_white.png"></image> src="@/static/index/ic_quit_white.png"></image>
...@@ -56,12 +45,14 @@ ...@@ -56,12 +45,14 @@
</view> </view>
<view style="display: flex;flex-direction: column;align-items: center;"> <view style="display: flex;flex-direction: column;align-items: center;">
<view style="font-size: 24rpx;color: gray;margin-top: 16rpx;margin-bottom: 18rpx;"> <text style="font-size: 28rpx;color: gray;margin-left: 30rpx;margin-right: 30rpx;margin-bottom: 20rpx;">
订单中如有疑问,请在个人中心联系客服</view> 1、会员属于虚拟商品,一经购买不可退换;
2、未满18岁的未成年人需要在监护人主导、同意下进行相关付费操作;
3、充值一般5分钟内到账,如未到账请在“我的”页面联系客服;
</text>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
</view>
</uni-popup> </uni-popup>
</template> </template>
...@@ -78,6 +69,10 @@ ...@@ -78,6 +69,10 @@
type: Boolean, type: Boolean,
default: false default: false
}, },
vipPopRefresh: {
type: Boolean,
default: false
},
point: { point: {
type: [Number, String], type: [Number, String],
default: 0 default: 0
...@@ -87,6 +82,31 @@ ...@@ -87,6 +82,31 @@
default: 0 default: 0
} }
}, },
watch: {
vipPopRefresh: {
handler(newVal, oldVal) {
if (newVal) {
this.handleShow();
}
},
immediate: true
},
show: {
handler: function(newVal, oldVal) {
if (newVal) {
this.handleShow();
} else {
// 兼容vip界面返回弹窗
if (this.backvipBean != null) {
// 跳转了返回弹窗
this.$refs.coinPop.close('bottom');
}
}
},
immediate: true
}
},
data() { data() {
return { return {
vipList: [], vipList: [],
...@@ -136,6 +156,9 @@ ...@@ -136,6 +156,9 @@
this.selectedIndex = i; this.selectedIndex = i;
} }
// 筛选产品 // 筛选产品
if (this.vipPopRefresh) {
this.vipList.push(data.list[i]);
} else {
if (data.list[i].abtype == 1) { if (data.list[i].abtype == 1) {
// 返回弹窗产品 // 返回弹窗产品
this.backvipBean = data.list[i]; this.backvipBean = data.list[i];
...@@ -143,7 +166,7 @@ ...@@ -143,7 +166,7 @@
this.vipList.push(data.list[i]); this.vipList.push(data.list[i]);
} }
} }
}
} }
} }
}); });
...@@ -281,23 +304,6 @@ ...@@ -281,23 +304,6 @@
} }
}); });
} }
},
watch: {
show: {
handler: function(newVal, oldVal) {
if (newVal) {
this.handleShow();
} else {
// 兼容vip界面返回弹窗
if (this.backvipBean != null) {
// 跳转了返回弹窗
this.$refs.coinPop.close('bottom');
}
}
},
immediate: true
}
} }
}; };
</script> </script>
......
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
</view> </view>
</view> </view>
<coin-popup :show="showAnimate" @close="coinClose($event)" @paySuccess="paySuccess"> <coin-popup :show="showAnimate" @close="coinClose($event)" @paySuccess="paySuccess" :vipPopRefresh="vipPopRefresh">
</coin-popup> </coin-popup>
<vipback-popup :show="showVipbackPop" :vipBean="backvipBean" @vipbackclose="vipbackClose()" <vipback-popup :show="showVipbackPop" :vipBean="backvipBean" @vipbackclose="vipbackClose()"
@vipbackpaySuccess="vipbackpaySuccess" /> @vipbackpaySuccess="vipbackpaySuccess" />
...@@ -106,6 +106,7 @@ ...@@ -106,6 +106,7 @@
showMask: false, showMask: false,
showVipbackPop: false, showVipbackPop: false,
showKefuPop: false, showKefuPop: false,
vipPopRefresh: false,
maskImage1: 'https://mints-web.oss-cn-beijing.aliyuncs.com/images/bg_find1.png', 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', maskImage2: 'https://mints-web.oss-cn-beijing.aliyuncs.com/images/bg_find2.png',
statusBarHeight: app.globalData.statusBarHeight, statusBarHeight: app.globalData.statusBarHeight,
...@@ -181,6 +182,7 @@ ...@@ -181,6 +182,7 @@
this.showKefuPop = true this.showKefuPop = true
}, },
paySuccess(largeType) { paySuccess(largeType) {
this.vipPopRefresh=false;
this.showAnimate = false; this.showAnimate = false;
// largeType=vip 开通vip // largeType=vip 开通vip
// largeType=point 购买书豆 // largeType=point 购买书豆
...@@ -197,6 +199,7 @@ ...@@ -197,6 +199,7 @@
}); });
}, },
coinClose(e) { coinClose(e) {
this.vipPopRefresh=false;
let item = e.detail.data; let item = e.detail.data;
if (item != null) { if (item != null) {
...@@ -210,10 +213,11 @@ ...@@ -210,10 +213,11 @@
console.log('mymymymymy', item); console.log('mymymymymy', item);
}, },
vipbackClose() { vipbackClose() {
this.showAnimate = false;
this.showVipbackPop = false; this.showVipbackPop = false;
this.vipPopRefresh = true;
}, },
vipbackpaySuccess(largeType) { vipbackpaySuccess(largeType) {
this.vipPopRefresh=false;
this.showAnimate = false; this.showAnimate = false;
this.showVipbackPop = false; this.showVipbackPop = false;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<view class="content"> <view class="content">
<text style="font-size: 40rpx;margin-bottom: 15rpx;">客服时间: 工作日9:00-18:00</text> <text style="font-size: 40rpx;margin-bottom: 15rpx;">客服时间: 工作日9:00-18:00</text>
<text class="button1" @click="tapMakePhoneCall">客服电话</text> <text class="button1" @click="tapMakePhoneCall">客服电话</text>
<button class="button2" open-type="im" data-im-id="93264117800">在线客服</button> <button class="button2" open-type="im" data-im-id="86900363628">在线客服</button>
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
......
<template> <template>
<z-paging :style="[bgStyle]"> <z-paging :style="[bgStyle]">
<c-empty v-if='showEmpty'></c-empty> <template>
<template v-else> <detail-thumb :detail='bookData'></detail-thumb>
<detail-warn></detail-warn> <detail-content @tapVip='tapVipPop' :detail='bookData' :userInfo='userInfo'></detail-content>
<detail-thumb :detail='bookData' @tapThumb='tapThumb'></detail-thumb> <detail-new-buy v-if="bookData.isUnlock==0 && !isVip()"
<detail-content @tapVip='tapPayPop' :detail='bookData' :userInfo='userInfo'></detail-content> :detail='bookData' :userInfo='userInfo' @tapVip='tapVipPop'
<detail-new-buy v-if="bookData.isUnlock==0 && !isVip()" :showVipOpen="1" :showBeanOpen="0" ></detail-new-buy>
:detail='bookData' :userInfo='userInfo' @unlockBook='unlockBook' @tapVip='tapVipPop'
@tapBean='tapBeanPop'></detail-new-buy>
<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>
<recommend-pop :show='showRecommend' @close='closeRecommendPop' :bookId="bookId"></recommend-pop>
<coin-popup v-if="bookData.isUnlock==0 && !isVip()" :show="showVip" @close="coinClose($event)" <coin-popup v-if="bookData.isUnlock==0 && !isVip()" :show="showVip" @close="coinClose($event)"
:vedioId="bookData.id" @paySuccess="paySuccess"> :vedioId="bookData.id" @paySuccess="paySuccess" :vipPopRefresh="vipPopRefresh">
</coin-popup> </coin-popup>
<vipback-popup :show="showVipbackPop" :vipBean="backvipBean" @vipbackclose="vipbackClose()" <vipback-popup :show="showVipbackPop" :vipBean="backvipBean" @vipbackclose="vipbackClose()"
@vipbackpaySuccess="vipbackpaySuccess" /> @vipbackpaySuccess="vipbackpaySuccess" />
</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>
</z-paging> </z-paging>
</template> </template>
...@@ -43,50 +31,33 @@ ...@@ -43,50 +31,33 @@
import { import {
collectionBook collectionBook
} from "../../../common/services/index.js" } from "../../../common/services/index.js"
import DetailWarn from "./components/detail-warn.vue";
import DetailThumb from "./components/detail-thumb.vue"; import DetailThumb from "./components/detail-thumb.vue";
import DetailContent from "./components/detail-content.vue"; import DetailContent from "./components/detail-content.vue";
import DetailBottom from "./components/detail-bottom.vue";
import DetailNewBuy from "./components/detail-new-buy.vue"; import DetailNewBuy from "./components/detail-new-buy.vue";
import DetailBottom from "./components/detail-bottom.vue";
import config from "../../../config/index.js"; import config from "../../../config/index.js";
import SettingPop from "./components/setting-pop.vue"; 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 VipbackPopup from '@/components/vipback-popup/vipback-popup.vue';
import CoinPopup from "@/components/coin-popup/coin-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 SystemInfoMixin from "../../../common/mixins/system-info-mixin.js";
import {
gotoBookCoverPage
} from "../../../common/services/page-route.js"
import { import {
watchUserInfoChange, watchUserInfoChange,
removeUserInfoChangeWatch, removeUserInfoChangeWatch,
refreshUserInfo, refreshUserInfo
postPhone
} from "../../../common/services/userServices.js" } from "../../../common/services/userServices.js"
import { import {
noticeCollectionListChange, noticeCollectionListChange,
startCountReadTime, startCountReadTime,
endCountReadTime, endCountReadTime
getOpens
} from "../../../common/services/index.js" } from "../../../common/services/index.js"
import {
saveStorage,
readStorage
} from "../../../common/utils/storageUtil.js";
export default { export default {
mixins: [SystemInfoMixin], mixins: [SystemInfoMixin],
components: { components: {
DetailWarn,
DetailThumb, DetailThumb,
DetailContent, DetailContent,
DetailNewBuy,
DetailBottom, DetailBottom,
SettingPop, SettingPop,
VipPop, DetailNewBuy,
BeanPop,
RecommendPop,
VipbackPopup, VipbackPopup,
CoinPopup, CoinPopup,
}, },
...@@ -97,14 +68,10 @@ ...@@ -97,14 +68,10 @@
backgroundColor: "#fff", backgroundColor: "#fff",
showSetting: false, showSetting: false,
showVip: false, showVip: false,
showBean: false,
showRecommend: false,
userInfo: null, userInfo: null,
showVipOpen: 0, showVipOpen: 0,
showBeanOpen: 0,
showMoibleLogin: false,
mobileLoginLock: false,
showVipbackPop: false, showVipbackPop: false,
vipPopRefresh: false,
backvipBean: null, backvipBean: null,
}; };
}, },
...@@ -117,8 +84,6 @@ ...@@ -117,8 +84,6 @@
this.bookId = info.bookId; this.bookId = info.bookId;
}) })
} }
this.mobileLoginLock = readStorage("KEY_NEED_PHONE")
}, },
onReady() { onReady() {
// 监听样式变动 // 监听样式变动
...@@ -197,38 +162,6 @@ ...@@ -197,38 +162,6 @@
} }
}, },
methods: { methods: {
async MygetPhonenumber(e) {
console.log(e.detail.code) // 动态令牌
console.log(e.detail.errMsg) // 回调信息(成功失败都会返回)
console.log(e.detail.errno) // 错误码(失败时返回)
this.showMoibleLogin = false
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() { unlockBook() {
this.$set(this.bookData, "isUnlock", true); this.$set(this.bookData, "isUnlock", true);
...@@ -275,44 +208,17 @@ ...@@ -275,44 +208,17 @@
} }
return false; return false;
}, },
tapPayPop() {
if (this.showVipOpen != 1 && this.showBeanOpen == 1) {
this.tapBeanPop()
return
}
this.tapVipPop()
},
// 展示充值VIP弹框 // 展示充值VIP弹框
tapVipPop() { tapVipPop() {
// if (this.mobileLoginLock) {
// this.showMoibleLogin = true
// return
// }
this.showVip = true; this.showVip = true;
}, },
// 展示充值书豆弹框
tapBeanPop() {
if (this.mobileLoginLock) {
this.showMoibleLogin = true
return
}
this.showBean = true;
},
// 关闭设置弹窗 // 关闭设置弹窗
closePop(e) { closePop(e) {
this.showSetting = false; this.showSetting = false;
}, },
// 关闭推荐弹窗 // 价格弹窗
closeRecommendPop(e) {
this.showRecommend = false;
},
// 点击封面,暂无
tapThumb(e) {
gotoBookCoverPage(this.bookData.id);
},
coinClose(e) { coinClose(e) {
this.vipPopRefresh=false;
let item = e.detail.data; let item = e.detail.data;
if (item != null) { if (item != null) {
...@@ -322,22 +228,20 @@ ...@@ -322,22 +228,20 @@
}, 300); }, 300);
} else { } else {
this.showVip = false; this.showVip = false;
setTimeout(() => {
this.showRecommend = true;
}, 300);
} }
}, },
// 价格挽留弹窗
vipbackClose() { vipbackClose() {
this.showVip = false; this.vipPopRefresh=false;
// this.showVip = false;
this.showVipbackPop = false; this.showVipbackPop = false;
this.vipPopRefresh = true;
setTimeout(() => {
this.showRecommend = true;
}, 300);
}, },
// 价格挽留弹窗-支付成功回调
vipbackpaySuccess(largeType) { vipbackpaySuccess(largeType) {
this.vipbackClose(); this.vipPopRefresh=false;
this.showVip = false;
this.showVipbackPop = false;
this.$set(this.bookData, "isUnlock", true); this.$set(this.bookData, "isUnlock", true);
} }
......
<template> <template>
<view class="detail-buy"> <view class="detail-buy">
<view class="book-card"> <view class="book-card">
<view class="line-box">
<view class="line"></view> <view v-if="!isVip() " class="section" style="margin-top: 30rpx;">
<view class="text">全本订阅超优惠</view>
<view class="line"></view>
</view>
<view v-if="showBeanOpen==1" class="text-box">
<view class="text1">全本特价:</view>
<view class="text2">{{bookBeanCount}}</view>
<view class="text1">书豆</view>
</view>
<view v-if="showBeanOpen==1" class="text-box" style="margin-top: 20rpx;">
<view class="text1">账户余额:</view>
<view class="text2">{{bookAllBeanCount}}</view>
<view class="text1">书豆</view>
</view>
<view v-if="showBeanOpen==1" class="section" style="margin-top: 30rpx;">
<button class="btn1" :disabled="loading" :loading="loading" @click="tapBeanBtn">
{{bookBeanText}}
</button>
</view>
<view v-if="!isVip() && (showVipOpen==1)" class="section" style="margin-top: 30rpx;">
<button class="btn2" :disabled="loading" :loading="loading" @click="tapVip">开通会员,免费阅读本书</button> <button class="btn2" :disabled="loading" :loading="loading" @click="tapVip">开通会员,免费阅读本书</button>
</view> </view>
</view> </view>
......
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