Commit c850a310 authored by mengcuiguang's avatar mengcuiguang

代码优化

parent 406eecf3
...@@ -28,8 +28,10 @@ ...@@ -28,8 +28,10 @@
</view> </view>
<view class="section"> <view class="section">
<view class="pack-box"> <view class="pack-box">
<view class="pack-item" :style="item.largeType !=='vip' ?'background: #f5f5f5;':'background: #f4c98b;'" :class="[{active: index==selectedIndex}]" <view class="pack-item"
v-for='(item, index) in vipList' :key='index' @click="choosePack(item, index)"> :style="item.largeType !=='vip' ?'background: #f5f5f5;':'background: #f4c98b;'"
:class="[{active: index==selectedIndex}]" v-for='(item, index) in vipList' :key='index'
@click="choosePack(item, index)">
<view style="display: flex;flex-direction: column;align-items: center;"> <view style="display: flex;flex-direction: column;align-items: center;">
<view class="price row"> <view class="price row">
...@@ -40,7 +42,7 @@ ...@@ -40,7 +42,7 @@
{{item.title}} {{item.title}}
</view> </view>
<view class="origin row" v-if="item.remarks!=null"> <view class="origin row" v-if="item.remarks!=null&&item.remarks!=''">
{{item.remarks}} {{item.remarks}}
</view> </view>
</view> </view>
...@@ -94,7 +96,7 @@ ...@@ -94,7 +96,7 @@
methods: { methods: {
// 支付完成回调 // 支付完成回调
paySuccess(largeType) { paySuccess(largeType) {
this.$emit('paySuccess',largeType); this.$emit('paySuccess', largeType);
this.handleClose(); this.handleClose();
}, },
handleShow() { handleShow() {
...@@ -108,7 +110,13 @@ ...@@ -108,7 +110,13 @@
}) => { }) => {
this.vipList = data.list; this.vipList = data.list;
if (data.list != null) { if (data.list != null) {
this.selectedIndex = data.list[0].activityType; // this.selectedIndex = data.list[0].activityType;
for (let i = 0; i < data.list.length; i++) {
if (data.list[i].activityType == 1) {
this.selectedIndex = i;
break;
}
}
} }
} }
}); });
...@@ -146,11 +154,11 @@ ...@@ -146,11 +154,11 @@
success: ({ success: ({
data data
}) => { }) => {
that.wxPay(data,vipBean.largeType); that.wxPay(data, vipBean.largeType);
} }
}); });
}, },
wxPay(wxData,largeType) { wxPay(wxData, largeType) {
let wxParams = wxData.params; let wxParams = wxData.params;
let that = this; let that = this;
// 发起微信支付 // 发起微信支付
...@@ -163,8 +171,7 @@ ...@@ -163,8 +171,7 @@
success(res) { success(res) {
that.paySuccess(largeType); that.paySuccess(largeType);
}, },
fail(res) { fail(res) {}
}
}) })
} }
}, },
...@@ -242,17 +249,17 @@ ...@@ -242,17 +249,17 @@
font-weight: 700; font-weight: 700;
} }
.origin { .origin {
color: #5A3C0F; color: #5A3C0F;
// background: #5a1505; // background: #5a1505;
background-image: linear-gradient(90deg, #F3DEBE, #EAC180); background-image: linear-gradient(90deg, #F3DEBE, #EAC180);
font-size: 22rpx; font-size: 22rpx;
border-radius: 20rpx; border-radius: 20rpx;
height: 30rpx; height: 30rpx;
line-height: 30rpx; line-height: 30rpx;
padding-top: 4rpx; padding-top: 4rpx;
padding-bottom: 3rpx; padding-bottom: 3rpx;
padding-left: 16rpx; padding-left: 16rpx;
padding-right: 16rpx; padding-right: 16rpx;
} }
......
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