|
|
@ -26,10 +26,8 @@ |
|
|
|
<view class="openvip">{{numInfo.vipType}}</view> |
|
|
|
|
|
|
|
<view class="options"> |
|
|
|
<view |
|
|
|
@click="vipId = item.id" |
|
|
|
:class="{option : true, act : vipId == item.id}" |
|
|
|
v-for="(item,index) in list" :key="index"> |
|
|
|
<view @click="vipId = item.id" :class="{option : true, act : vipId == item.id}" v-for="(item,index) in list" |
|
|
|
:key="index"> |
|
|
|
<view style="font-weight: 600;">{{ item.name }}</view> |
|
|
|
<view style="color: #FF2E2E;"> |
|
|
|
<text style="font-size: 20rpx;">¥</text> |
|
|
@ -42,8 +40,7 @@ |
|
|
|
<view class="block" v-if="vip.id"> |
|
|
|
<view class="privilege">{{ vip.name }}</view> |
|
|
|
<view class="cells"> |
|
|
|
<view class="cell" |
|
|
|
v-for="(item, index) in vip.keys"> |
|
|
|
<view class="cell" v-for="(item, index) in vip.keys"> |
|
|
|
<image src="../static/mine/characteristic.png" mode="aspectFill" /> |
|
|
|
<view class="text"> |
|
|
|
<view>{{ item[0] }}</view> |
|
|
@ -86,15 +83,17 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import mixinList from '@/mixins/list.js' |
|
|
|
import { mapState } from 'vuex' |
|
|
|
import { |
|
|
|
mapState |
|
|
|
} from 'vuex' |
|
|
|
export default { |
|
|
|
mixins : [mixinList], |
|
|
|
mixins: [mixinList], |
|
|
|
data() { |
|
|
|
return { |
|
|
|
radiovalue: false, |
|
|
|
mixinsListApi : 'commonQueryVipType', |
|
|
|
vipId : '', |
|
|
|
numInfo:{} |
|
|
|
mixinsListApi: 'commonQueryVipType', |
|
|
|
vipId: '', |
|
|
|
numInfo: {} |
|
|
|
} |
|
|
|
}, |
|
|
|
onShow() { |
|
|
@ -107,26 +106,26 @@ |
|
|
|
return '/static/image/center/headImage.png' |
|
|
|
}, |
|
|
|
//获取个人中心基础信息的接口 |
|
|
|
getUserCenterData(){ |
|
|
|
this.$api('getUserCenterData',{}, res =>{ |
|
|
|
if(res.code == 200){ |
|
|
|
getUserCenterData() { |
|
|
|
this.$api('getUserCenterData', {}, res => { |
|
|
|
if (res.code == 200) { |
|
|
|
this.numInfo = res.result |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
vip(){ |
|
|
|
vip() { |
|
|
|
let vip = {} |
|
|
|
this.list.forEach(n => { |
|
|
|
if(n.id == this.vipId){ |
|
|
|
|
|
|
|
if (n.id == this.vipId) { |
|
|
|
|
|
|
|
let keys = n.perquisite.split('##') |
|
|
|
|
|
|
|
|
|
|
|
keys.forEach((s, i) => { |
|
|
|
keys[i] = s.split('$$') |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
n.keys = keys |
|
|
|
|
|
|
|
|
|
|
|
vip = n |
|
|
|
} |
|
|
|
}) |
|
|
@ -134,13 +133,35 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
submit(id){ |
|
|
|
console.log("当前标识:"+id) |
|
|
|
this.$api('addVIP',{id:id}, res =>{ |
|
|
|
console.log(res) |
|
|
|
submit(id) { |
|
|
|
console.log("当前标识:" + id) |
|
|
|
this.$api('addVIP', { |
|
|
|
id: id |
|
|
|
}, res => { |
|
|
|
uni.requestPayment({ |
|
|
|
provider: 'wxpay', // 服务提提供商 |
|
|
|
timeStamp: res.result.timeStamp, // 时间戳 |
|
|
|
nonceStr: res.result.nonceStr, // 随机字符串 |
|
|
|
package: res.result.packageValue, |
|
|
|
signType: res.result.signType, // 签名算法 |
|
|
|
paySign: res.result.paySign, // 签名 |
|
|
|
success: function(res) { |
|
|
|
console.log('支付成功', res); |
|
|
|
self.$refs.confirmationPopupUpload.open() |
|
|
|
// self.$refs.confirmationPopup.close() |
|
|
|
}, |
|
|
|
fail: function(err) { |
|
|
|
console.log('支付失败', err); |
|
|
|
self.$refs.confirmationPopup.close() |
|
|
|
uni.showToast({ |
|
|
|
icon: 'none', |
|
|
|
title: "支付失败" |
|
|
|
}) |
|
|
|
} |
|
|
|
}); |
|
|
|
}) |
|
|
|
}, |
|
|
|
getDataThen(list){ |
|
|
|
getDataThen(list) { |
|
|
|
this.vipId = list[0] && list[0].id |
|
|
|
}, |
|
|
|
}, |
|
|
@ -209,6 +230,7 @@ |
|
|
|
.options { |
|
|
|
display: flex; |
|
|
|
flex-wrap: wrap; |
|
|
|
|
|
|
|
.option { |
|
|
|
display: flex; |
|
|
|
justify-content: center; |
|
|
@ -220,12 +242,14 @@ |
|
|
|
border-radius: 16rpx; |
|
|
|
box-sizing: border-box; |
|
|
|
margin: 12rpx; |
|
|
|
|
|
|
|
view { |
|
|
|
margin-top: 15rpx; |
|
|
|
font-size: 28rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
.act{ |
|
|
|
|
|
|
|
.act { |
|
|
|
border: 4rpx solid $uni-color; |
|
|
|
box-shadow: 0 0 10rpx 10rpx rgba($uni-color, 0.2); |
|
|
|
} |
|
|
@ -248,6 +272,7 @@ |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
margin: 20rpx 0; |
|
|
|
|
|
|
|
.text { |
|
|
|
margin-left: 20rpx; |
|
|
|
color: #707070; |
|
|
@ -284,7 +309,7 @@ |
|
|
|
justify-content: center; |
|
|
|
align-items: center; |
|
|
|
padding: 8rpx 0; |
|
|
|
box-shadow: 0 -2rpx 6rpx 0 #d9d9d9 ; |
|
|
|
box-shadow: 0 -2rpx 6rpx 0 #d9d9d9; |
|
|
|
|
|
|
|
.box { |
|
|
|
display: flex; |
|
|
@ -296,15 +321,16 @@ |
|
|
|
view:nth-child(1) { |
|
|
|
color: #999999; |
|
|
|
} |
|
|
|
|
|
|
|
view:nth-child(2) { |
|
|
|
padding: 25rpx 60rpx; |
|
|
|
color: #FFFFFF; |
|
|
|
background-color: #3796F8; |
|
|
|
border-radius: 12rpx; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
view:nth-child(1) { |
|
|
|
view:nth-child(1) { |
|
|
|
color: #999999; |
|
|
|
} |
|
|
|
} |
|
|
|