This commit is contained in:
唐明明
2023-02-13 11:58:29 +08:00
parent da7b903547
commit 8d8c14ec66
33 changed files with 879 additions and 90 deletions

View File

@@ -1,20 +1,25 @@
<template>
<view class="introduce" v-if='loaded'>
<image class="richTxt" :src="base.cover" mode="widthFix" />
<view class="nowbuy" @click="nowBuy" v-if="!is_recharge"> <view class="btn">{{base.price}} 立即购买 </view> </view>
<view class="nowbuy nonebuy" v-else> <view class="btn"> 已开通 </view> </view>
<view class="nowbuy" @click="nowBuy" v-if="!is_recharge">
<view class="btn">{{base.price}}立即购买</view>
</view>
<view class="nowbuy nonebuy" v-else>
<view class="btn">已购买</view>
</view>
</view>
</template>
<script>
import {
recharge,zyPay
} from '@/apis/interfaces/index.js'
import { recharge } from '@/apis/interfaces/index.js'
import { umsFree } from '@/apis/interfaces/pay.js'
export default {
data() {
return {
loaded:false,
base: '',
is_recharge: true,
identity : false,
loaded : false,
base : '',
is_recharge : true,
parent : false,
}
},
onLoad(e) {
@@ -23,6 +28,8 @@
methods:{
getInfo(){
recharge().then(res => {
this.parent = res.parent
this.identity = res.identity
this.base = res.base
this.is_recharge = res.is_recharge
this.loaded = true
@@ -36,24 +43,37 @@
})
},
nowBuy(){
zyPay(this.base.service_id).then(res => {
uni.showToast({
title: '支付成功',
icon: 'none',
mask: true,
duration: 2000
})
this.is_recharge = true
}).catch(err => {
console.log(err)
uni.showToast({
title: err.message,
icon: 'none',
mask: true,
duration: 2000
})
})
if(!this.parent){
uni.showModal({
title : '提示',
content : '暂无推荐人无法购买自由服务包',
cancelText : '取消',
confirmText : '确定',
showCancel : false,
})
return
}
if(!this.identity){
uni.showModal({
title : '提示',
content : '当前身份暂时无法购买自由服务包,请开通业务员后重试',
cancelText : '取消',
confirmText : '去开通',
success : res => {
if(res.confirm){
this.$Router.pushTab({name: 'Work'})
}
}
})
return
}
this.$Router.replace({
name : 'Pay',
params : {
paytype : 'free',
serviceId : this.base.service_id,
}
})
}
}
}

View File

@@ -83,12 +83,39 @@
</view>
</view>
</view>
<!-- 弹窗 -->
<u-popup :show="showAdImg" mode="center" bgColor="transparent">
<view class="ad-lay">
<view class="ad-down">
<u-count-down
ref="adCountDown"
:time="showAdTime"
:autoStart="false"
@change="timeData = $event"
@finish="showAdImg = false">
<view>
自动关闭<text>{{ timeData.seconds }}</text>S
</view>
</u-count-down>
</view>
<image class="ad-img" :src="layAdImg" mode="widthFix"></image>
<view class="ad-btn">
<u-icon
class="ad-btn-icon"
name="close-circle"
color="white"
size="36px"
@click="onRemoveAd"
></u-icon>
</view>
</view>
</u-popup>
</view>
</template>
<script>
import { region } from '@/apis/interfaces/address.js'
import { categories,jf,zf,index } from '@/apis/interfaces/index.js'
import { categories, jf, zf, index } from '@/apis/interfaces/index.js'
export default {
data() {
return {
@@ -104,6 +131,12 @@
jfList:[],
defaultViewId:'',
zfList:[],
// 首次进入弹窗
timeData : {},
first : 1,
showAdTime : 0,
showAdImg : true,
layAdImg : ''
}
},
onLoad() {
@@ -163,6 +196,15 @@
list.push(params)
})
this.notice = list
let { is_lay_ad, lay_ad_img, times } = res.layad
if(is_lay_ad) this.layAdImg = lay_ad_img
if(this.first === 1 && is_lay_ad){
this.showAdImg = true
this.showAdTime = times * 1000
this.$nextTick(() => {
this.$refs.adCountDown.start()
})
}
}).catch(err=>{
uni.showToast({
title:err.message,
@@ -217,7 +259,12 @@
}).then(res => {
console.log(res)
})
},
},
// 关闭弹窗广告
onRemoveAd(){
this.first = 0;
this.showAdImg = false;
}
}
}
</script>
@@ -227,6 +274,38 @@
background-color: white;
padding-top: 20rpx;
}
// ad弹窗广告
.ad-lay{
width: 70vw;
position: relative;
.ad-down{
position: absolute;
top: 20rpx;
right: 20rpx;
z-index: 1;
background: rgba(0, 0, 0, .5);
font-size: 20rpx;
padding: 10rpx 20rpx;
line-height: 30rpx;
border-radius: 24rpx;
color: white;
.ad-down-u{
display: inline-block;
line-height: 30rpx;
}
}
.ad-img{
width: 70vw;
border-radius: 20rpx;
}
.ad-btn{
text-align: center;
margin-top: 30rpx;
.ad-btn-icon{
display: inline-block;
}
}
}
// 轮播图
.banner{
position: relative;