You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

351 lines
8.2 KiB

<template>
<view>
3 years ago
<view class="top-box">
<view class="index-top">
<image src="../../static/img/my/vip.png"></image>
<view class="txt-box">
<view class="s-txt">充值会员,优惠享受不停</view>
<view class="b-txt">原价39.99限时特价<text style="font-size: 46rpx;">{{money}}</text></view>
</view>
3 years ago
</view>
<view class="isvip-box" v-if="userInfo.member == 1">
<view>有效期至{{userInfo.endTime.split(' ')[0]}}</view>
<view class="renew-btn" @click="btns()">立即续费</view>
</view>
3 years ago
</view>
3 years ago
<view class="plusVip" v-if="userInfo.member == 0">
3 years ago
<view style="display: flex;align-items: center;flex: 1;">
<view style="margin-left: 44px;font-size: 16px;
font-family: PingFang SC;font-weight: 500;color: #FFFFFF;">Plus会员卡</view>
<view style="margin-left: 4px;color: #FFE5C1;font-size: 24px;">{{money}}</view>
<view style="font-size: 16px;
font-family: PingFang SC;font-weight: 500;
color: #FFFFFF;"></view>
</view>
3 years ago
<view class="kaitong" @click="btns()">立即开通</view>
3 years ago
</view>
<view style="display: flex;justify-content: center;margin-top: 10px;">
<image src="../../static/img/my/tequan.png" style="width: 25.09px;height: 15.94px;"></image>
</view>
<view style="display: flex;justify-content: center;">
3 years ago
<view class="title-box">
<!-- <u-divider border-color="#E8CD9C"></u-divider> -->
<view class="title">会员特权</view>
<!-- <u-divider color="#E8CD9C" border-color="#E8CD9C">会员特权</u-divider> -->
<!-- <u-divider border-color="#E8CD9C"></u-divider> -->
</view>
</view>
3 years ago
<view style="margin-top: 10px;margin: 0 10px;">
<u-grid :col="2" :border="false">
<u-grid-item>
<view class="grid-text">
<view class="text">
<view class="title">最高优惠</view>
</view>
<view class="content">
<view>可享受美食优惠</view>
<view >会员专属价格</view>
</view>
</view>
3 years ago
</u-grid-item>
<u-grid-item>
<view class="grid-text">
<view class="text">
<view class="title">最高优惠</view>
</view>
<view class="content">
<view>可享受美食优惠</view>
<view >会员专属价格</view>
</view>
</view>
3 years ago
</u-grid-item>
<u-grid-item>
<view class="grid-text">
<view class="text">
<view class="title">最高优惠</view>
</view>
<view class="content">
<view>可享受美食优惠</view>
<view >会员专属价格</view>
</view>
</view>
3 years ago
</u-grid-item>
<u-grid-item>
<view class="grid-text">
<view class="text">
<view class="title">最高优惠</view>
</view>
<view class="content">
<view>可享受美食优惠</view>
<view >会员专属价格</view>
</view>
</view>
</u-grid-item>
</u-grid>
</view>
3 years ago
</view>
</view>
</template>
<script>
export default {
data() {
return {
3 years ago
userInfo: {},
avatar: '',
nickName: '',
3 years ago
money: 9.9,
member: 9,
oldmoney: 0
};
},
onLoad() {
let nickName = this.$queue.getData('nickName');
if (nickName && nickName !== 'undefined') {
this.nickName = nickName;
} else {
this.nickName = '';
}
let avatar = this.$queue.getData('avatar');
if (avatar && avatar !== 'undefined') {
this.avatar = avatar;
} else {
this.avatar = '/static/img/logo.png';
}
let that = this;
that.$Request.getT('/common/type/115').then(res => {
if (res.code == 0) {
if (res.data && res.data.value) {
this.money = res.data.value;
}
}
});
that.$Request.getT('/common/type/137').then(res => {
if (res.code == 0) {
if (res.data && res.data.value) {
this.oldmoney = res.data.value;
}
}
});
},
onShow() {
this.getUserInfo();
},
methods: {
getUserInfo() {
let userId = this.$queue.getData('userId');
this.$Request.postT("/app/selectUserById?userId=" + userId).then(res => {
if (res.code === 0) {
3 years ago
this.userInfo = res.data
this.member = res.data.member ? res.data.member : 0;
this.nickName = res.data.nickName ? res.data.nickName : res.data.phone;
this.avatar = res.data.imageUrl ? res.data.imageUrl :
this.$queue.setData("avatar", res.data.imageUrl ? res.data.imageUrl :
'/static/img/logo.png');
this.$queue.setData('member', res.data.member);
this.$queue.setData("nickName", res.data.nickName ? res.data.nickName : res.data.phone);
this.$queue.setData("mobile", res.data.phone);
this.$queue.setData("invitationCode", res.data.invitationCode);
this.$queue.setData("relation_id", res.data.relationId);
this.$queue.setData("relation", res.data.invitationCode);
this.$queue.setData("grade", res.data.grade);
this.$queue.setData("isInvitation", res.data.isInvitation);
this.$queue.setData("gender", parseInt(res.data.gender));
this.$queue.setData("sex", res.data.sex);
} else {
3 years ago
// this.goLogin();
}
});
},
goLogin() {
uni.navigateTo({
url: '/pages/public/login'
});
},
btns() {
let token = this.$queue.getData('token');
if (token) {
let userId = this.$queue.getData('userId');
uni.showLoading({
title: '支付中'
});
this.$Request.postT('/api/order/wxPayMember?userId=' + userId).then(res => {
uni.requestPayment({
provider: 'wxpay',
timeStamp: res.timestamp,
nonceStr: res.noncestr,
package: res.package,
signType: res.signType,
paySign: res.sign,
success: function(res) {
uni.showLoading({
title: '支付成功'
});
uni.hideLoading();
setTimeout(() => {
uni.navigateBack();
}, 1000);
},
fail: function(err) {
uni.hideLoading();
this.$queue.showToast('支付失败');
}
});
})
} else {
this.goLogin();
}
},
}
}
</script>
<style lang="scss">
page {
width: 100%;
3 years ago
background-color: #FFFFFF;
}
3 years ago
.top-box{
padding: 0 32rpx;
}
3 years ago
.index-top{
width: 100%;
3 years ago
height: 396rpx;
position: relative;
3 years ago
z-index: 3;
image{
width: 100%;
3 years ago
height: 100%;
position: absolute;
top: 0;
left: 0;
}
3 years ago
.txt-box{
width: 100%;
3 years ago
text-align: center;
position: absolute;
bottom: 48rpx;
.s-txt{
color: #FCD4B4;
font-size: 24rpx;
3 years ago
margin-bottom: 20rpx;
}
3 years ago
.b-txt{
color: #FCD4B4;
font-size:34rpx;
font-weight: 500;
line-height: 44rpx;
}
}
}
3 years ago
.isvip-box{
width: 686rpx;
height: 128rpx;
background: linear-gradient(180deg, #F9D68A 0%, #FFC448 100%);
border-bottom-left-radius: 30rpx;
border-bottom-right-radius: 30rpx;
font-size: 24rpx;
color: #5D5A5B;
display: flex;
justify-content: space-between;
padding: 62rpx 32rpx 0;
position: relative;
top: -40rpx;
.renew-btn{
width: 158rpx;
height: 48rpx;
line-height: 48rpx;
text-align: center;
font-size: 24rpx;
color: #F9D68A;
background: #5D5A5B;
border-radius: 40rpx;
}
}
3 years ago
.plusVip {
3 years ago
width: 686rpx;
height: 80rpx;
3 years ago
background: #5D5A5B;
3 years ago
border-radius: 40rpx;
margin: 26rpx auto;
3 years ago
display: flex;
}
3 years ago
.kaitong {
3 years ago
width: 98*2rpx;
3 years ago
background: linear-gradient(180deg, #FF7A77 0%, #F8504C 100%);
3 years ago
border-radius: 20*2rpx;
display: flex;
align-items: center;
3 years ago
justify-content: center;
3 years ago
font-size: 18*2rpx;
3 years ago
font-weight: 500;
color: #FFFFFF;
}
3 years ago
.lines view {
3 years ago
width: 60rpx;
3 years ago
height: 1px;
background-color: #F3E6CD;
3 years ago
margin-bottom: 20rpx;
}
3 years ago
.grid-text {
width: 120px;
height: 120px;
border: 1px solid #E8CD9C;
border-radius: 50%;
opacity: 1;
.text{
margin-top: 20px;
margin-left: 30px;
.title{
font-size: 14px;
font-weight: 500;
color: #C7904E;
}
3 years ago
}
3 years ago
.content{
font-size: 12px;
font-family: PingFang SC;
font-weight: 400;
color: #CCCCCC;
margin-left: 20px;
margin-top: 10px;
}
3 years ago
}
3 years ago
.title-box{
width: 100%;
3 years ago
.title{
width: 262rpx;
height: 22rpx;
background: url(../../static/img/my/title-bg.png);
background-size: 100% 100%;
line-height: 22rpx;
text-align: center;
margin: 10rpx auto;
color: #E8CD9C;
font-size: 28rpx;
}
}
</style>