Commit c850a310 authored by mengcuiguang's avatar mengcuiguang

代码优化

parent 406eecf3
......@@ -28,8 +28,10 @@
</view>
<view class="section">
<view class="pack-box">
<view class="pack-item" :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 class="pack-item"
: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 class="price row">
......@@ -40,7 +42,7 @@
{{item.title}}
</view>
<view class="origin row" v-if="item.remarks!=null">
<view class="origin row" v-if="item.remarks!=null&&item.remarks!=''">
{{item.remarks}}
</view>
</view>
......@@ -94,7 +96,7 @@
methods: {
// 支付完成回调
paySuccess(largeType) {
this.$emit('paySuccess',largeType);
this.$emit('paySuccess', largeType);
this.handleClose();
},
handleShow() {
......@@ -108,7 +110,13 @@
}) => {
this.vipList = data.list;
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 @@
success: ({
data
}) => {
that.wxPay(data,vipBean.largeType);
that.wxPay(data, vipBean.largeType);
}
});
},
wxPay(wxData,largeType) {
wxPay(wxData, largeType) {
let wxParams = wxData.params;
let that = this;
// 发起微信支付
......@@ -163,8 +171,7 @@
success(res) {
that.paySuccess(largeType);
},
fail(res) {
}
fail(res) {}
})
}
},
......
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