Commit 9615f61c authored by mengcuiguang's avatar mengcuiguang

添加金币弹窗

parent 61cc6aa2
...@@ -3,11 +3,25 @@ ...@@ -3,11 +3,25 @@
<uni-popup type="bottom" ref="select" :maskClick="false" :isMaskClick="false"> <uni-popup type="bottom" ref="select" :maskClick="false" :isMaskClick="false">
<view class="body"> <view class="body">
<scroll-view scroll-y style="height: 80%;"> <scroll-view scroll-y style="height: 80%;">
<view @click="handleClose" style="color: red;">关闭</view> <view style="display: flex;flex-direction: column;align-items: flex-end;">
<image @click="handleClose"
style="width: 30rpx;height: 30rpx;display: flex;align-items: right;margin: 15rpx;"
src="@/static/index/ic_quit_white.png"></image>
</view>
<view style="display: flex;flex-direction: column;align-items: center;margin-bottom: 20rpx;">
<view style="font-size: 30rpx;color: black;">超多精彩好剧一键解锁</view>
<view style="display: flex;flex-direction: row;margin-top: 10rpx;">
<view style="font-size: 24rpx;color: #644238;margin-top: 16rpx;">账户余额: </view>
<view style="font-size: 40rpx;color: red;font-weight: 777;">123</view>
<view style="font-size: 24rpx;color: #644238;margin-top: 16rpx;"> K币</view>
</view>
</view>
<view class="section"> <view class="section">
<view class="pack-box"> <view class="pack-box">
<view class="pack-item" :class="[{active: index==selectedIndex}]" <view class="pack-item" :class="[{active: index==selectedIndex}]"
v-for='(item, index) in vipList' :key='index' @click="choosePack(item, index)"> v-for='(item, index) in vipList' :key='index' @click="choosePack(item, index)">
<view style="display: flex;flex-direction: column;align-items: center;">
<view class="name row"> <view class="name row">
{{item.title}} {{item.title}}
</view> </view>
...@@ -17,11 +31,22 @@ ...@@ -17,11 +31,22 @@
<view class="origin row" v-if='item.oldPrice'> <view class="origin row" v-if='item.oldPrice'>
原价:{{item.oldPrice}} 原价:{{item.oldPrice}}
</view> </view>
</view>
<view class="cut-down" v-if='item.oldPrice-item.firstPayPrice>0'> <view class="cut-down" v-if='item.oldPrice-item.firstPayPrice>0'>
立省 {{item.oldPrice-item.firstPayPrice}} 立省 {{item.oldPrice-item.firstPayPrice}}
</view> </view>
<view v-if="index==selectedIndex" style="position: absolute;bottom: 0;right: 0;">
<image style="width: 24rpx;height: 24rpx;display: flex;align-items: right;"
src="@/static/index/ic_quit_white.png"></image>
</view>
</view>
</view> </view>
</view> </view>
<view style="display: flex;flex-direction: column;align-items: center;">
<view style="font-size: 24rpx;color: gray;margin-top: 16rpx;margin-bottom: 8rpx;">
订单中如有疑问,请在个人中心联系客服</view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
...@@ -48,6 +73,11 @@ ...@@ -48,6 +73,11 @@
}; };
}, },
methods: { methods: {
// 支付完成回调
paySuccess() {
this.$emit('paySuccess');
this.handleClose();
},
handleShow() { handleShow() {
this.$refs.select.open('bottom'); this.$refs.select.open('bottom');
...@@ -57,7 +87,10 @@ ...@@ -57,7 +87,10 @@
success: ({ success: ({
data data
}) => { }) => {
this.vipList = data.list this.vipList = data.list;
if (data.list != null) {
this.selectedIndex = data.list[0].activityType;
}
} }
}); });
}, },
...@@ -67,7 +100,8 @@ ...@@ -67,7 +100,8 @@
}, },
choosePack(item, index) { choosePack(item, index) {
this.selectedIndex = index; this.selectedIndex = index;
// this.handlePay();
this.handlePay();
}, },
handlePay() { handlePay() {
let that = this; let that = this;
...@@ -100,11 +134,7 @@ ...@@ -100,11 +134,7 @@
success(res) { success(res) {
message.notify('支付成功') message.notify('支付成功')
that.paySuccess();
// setTimeout(() => {
// navigateTo(`/pages/home`)
// }, 1000);
}, },
fail(res) { fail(res) {
message.notify('取消支付') message.notify('取消支付')
...@@ -159,7 +189,7 @@ ...@@ -159,7 +189,7 @@
.pack-item { .pack-item {
margin-bottom: 25rpx; margin-bottom: 25rpx;
margin-right: 20rpx; margin-right: 22rpx;
width: calc(44%); width: calc(44%);
height: 200rpx; height: 200rpx;
display: flex; display: flex;
...@@ -194,13 +224,11 @@ ...@@ -194,13 +224,11 @@
.origin { .origin {
font-size: 22rpx; font-size: 22rpx;
color: #333; color: #333;
text-decoration: line-through;
} }
.cut-down { .cut-down {
position: absolute; position: absolute;
top: 0; top: 0;
right: 0;
color: #fff; color: #fff;
background: #ff502f; background: #ff502f;
font-size: 22rpx; font-size: 22rpx;
......
...@@ -61,8 +61,7 @@ ...@@ -61,8 +61,7 @@
{{ versionName }} {{ versionName }}
</view> </view>
<coin-popup :show="showAnimate" @close="showAnimate = false"> <coin-popup :show="showAnimate" @close="showAnimate = false" @paySuccess="paySuccess">
</coin-popup> </coin-popup>
</view> </view>
...@@ -155,6 +154,9 @@ ...@@ -155,6 +154,9 @@
}) })
} }
}); });
},
paySuccess(){
} }
} }
}; };
......
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