Commit 4e9ceea7 authored by 黄媛媛's avatar 黄媛媛

Merge branch 'master' of http://gitlab.oytour.com/viitto/mallapp

parents e98c19fd 7cdd630c
......@@ -120,7 +120,10 @@
},
{
"path": "examine"
}
},
{
"path": "buyVip/index"
}
]
},
......
<template>
<view class="vipMain" :style="{ height: contentHeight }">
<view class="vipContent" v-if="isShow" :style="{ backgroundImage: 'url(' + dataList.fxGradeCustom.BackImage + ')', backgroundSize: 'cover' }">
<view class="vipInner">
<view class="vip_yue">
<view class="vipIcon"><img :src="dataList.fxGradeCustom.VipICO" alt="" /></view>
<view>
<view class="vip_Month">
{{month}}个月
<text class="vip_yellow">{{dataList.fxGrade[0].BuyMoney}}</text>
</view>
</view>
</view>
<input type="button" class="my_VipBtn" @click="openImediate" value="立即开通" />
</view>
<view class="vip_activeRule" @click="showDialog = true">活动规则>></view>
</view>
<view class="agreementbox_t" v-if="showDialog == true">
<view class="agreement_b">
<view style="height: 40px;line-height: 40px;width:100%;text-align: center;position: relative;">
活动规则
<view class="buyVipClose" @click="showDialog=false">×</view>
</view>
<view style="width: 100%;height: 660rpx;padding: 20rpx;overflow:scroll;line-height:25px;">
<Text>
{{dataList.fxGradeCustom.BottomRule}}
</Text>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
pageTitle: 'vip购买',
contentHeight: 0,
mainColor: '',
secondary: '',
dataList: {},
showDialog: false,
month:0,
isShow:false
};
},
onLoad(option) {},
created() {
this.contentHeight = this.$utils.calcContentHeight(-40) + 'px';
this.mainColor = this.$uiConfig.mainColor;
this.secondary = this.$uiConfig.secondary;
this.init();
},
mounted() {
let currentPages = getCurrentPages();
let u = '/' + currentPages[currentPages.length - 1].route;
let pages = wx.getStorageSync('basedata') ? wx.getStorageSync('basedata').bar_title : [];
pages.forEach(x => {
if (x.value == u) {
this.pageTitle = x.new_name ? x.new_name : x.name;
}
});
uni.setNavigationBarTitle({
title: this.pageTitle
});
},
methods: {
//初始化信息
init() {
uni.showNavigationBarLoading();
this.request2(
{
url: '/api/AppletUser/GetUserVipSettings',
data: {}
},
res => {
this.isShow=true;
uni.hideNavigationBarLoading();
if (res.resultCode == 1) {
this.dataList = res.data;
if(this.dataList.fxGrade.length>0){
this.month=this.dataList.fxGrade[0].Year*12;
}
}
}
);
},
//点击立即开通
openImediate() {
var Myobj=this.dataList.fxGrade[0]
let msg = {
GradeId:Myobj.Id,
Money:Myobj.BuyMoney,
PayWay:1
};
this.request2(
{
url: '/api/WeChatPay/GetVIPBuyPayInfo',
data: msg
},
res => {
if (res.resultCode == 1) {
var payObj=JSON.parse(res.data);
wx.requestPayment(
{
'timeStamp': payObj.timeStamp,
'nonceStr': payObj.nonceStr,
'package': payObj.package,
'signType': payObj.signType,
'paySign': payObj.sign,
'success':function(res){},
'fail':function(res){},
'complete':function(res){}
}
)
}
}
);
}
}
};
</script>
<style>
.vipMain {
background: #f3f4f6;
}
.vipContent {
width: 100%;
height: 100%;
position: relative;
}
.vipInner {
width: 90%;
height: 140px;
position: absolute;
bottom: 80px;
left: 50%;
margin-left: -45%;
border-radius: 4px;
background-color: #cf65cd;
}
.vipMain .vip_yue {
width: 75%;
margin: 20px auto 10px;
vertical-align: top;
display: flex;
justify-content: space-around;
flex-wrap: nowrap;
color: #fff;
}
.vipMain .vipIcon {
width: 50px;
height: 50px;
}
.vipMain .vipIcon img {
width: 100%;
height: 100%;
}
.vipMain .vip_Month {
font-size: 26px;
color: #fff;
}
.vipMain .vip_yellow {
color: #fff100;
font-size: 36px;
margin:0 5px;
}
.vipMain .vip_lastDiv {
font-size: 12px;
color: #fff;
}
.vipMain .my_VipBtn {
width: 85%;
height: 40px;
border: none;
margin: auto;
background-color: #fff100;
color: #510a63;
text-align: center;
border-radius: 20px;
}
.vip_activeRule {
width: 100%;
position: absolute;
bottom: 30px;
text-align: center;
color: #dd6ada;
}
.vipMain .agreementbox_t {
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 999;
display: flex;
align-items: center;
justify-content: center;
background:rgba(0,0,0,0.6);
}
.vipMain .agreementbox_t .agreement_b {
width: 80%;
border-radius: 10px;
background: #fff;
display: flex;
flex-direction: column;
align-items: center;
overflow: hidden;
}
.vipMain .agreementbox_t .agreement_bottom {
width: 100%;
height: 50px;
display: flex;
align-items: center;
justify-content: center;
}
.vipMain .buyVipClose{
width:40px;
height:40px;
position: absolute;
right:7px;
top:0;
font-size:25px;
}
</style>
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