更新
This commit is contained in:
parent
4d258a0c2e
commit
0141fcc6b2
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="">
|
<view class="">
|
||||||
<block v-for="(item, index) in info">
|
<!-- <block v-for="(item, index) in info">
|
||||||
<block v-if="item.type==1">
|
<block v-if="item.type==1">
|
||||||
<view class="type_name">无门槛实物通用红包<text class="n_count">(2张)</text></view>
|
<view class="type_name">无门槛实物通用红包<text class="n_count">(2张)</text></view>
|
||||||
<view class="r_list" v-for="(e, i) in item.list">
|
<view class="r_list" v-for="(e, i) in item.list">
|
||||||
@ -44,10 +44,33 @@
|
|||||||
<view class="n_tips">本单不可用原因:未在平台指定店铺使用</view>
|
<view class="n_tips">本单不可用原因:未在平台指定店铺使用</view>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
</block>
|
</block> -->
|
||||||
|
|
||||||
|
<view style="height: 30rpx;"></view>
|
||||||
|
<view class="r_list" v-for="(item, i) in list" :key="i">
|
||||||
|
<view class="r_item" @click="change(item)">
|
||||||
|
<image class="r_bg" src="/static/active/red_packet.webp"></image>
|
||||||
|
<view class="r_body">
|
||||||
|
<view class="r_count">
|
||||||
|
<view class="rc_count">
|
||||||
|
<text class="rc_icon">¥</text>{{item.coupon_price}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="r_content">
|
||||||
|
<view class="r_name">{{item.coupon_title}}</view>
|
||||||
|
<view>{{item.describe}}</view>
|
||||||
|
<view>有效期至 {{item.end_time}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="r_icon">
|
||||||
|
<u-icon v-if="changeRed&&changeRed.uid==item.uid" name="checkmark-circle-fill" color="#FFF3CC" size="56rpx"></u-icon>
|
||||||
|
<u-icon v-else name="checkmark-circle" color="#FFF3CC" size="56rpx"></u-icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<view class="footer">
|
<view class="footer">
|
||||||
<view>已选 {{ changeRed.id!=-1?1:0 }} 张, 可减 <text class="red_i">¥</text> <text class="red_c">50</text></view>
|
<view>已选 {{ changeRed?1:0 }} 张, 可减 <text class="red_i">¥</text> <text class="red_c">0</text></view>
|
||||||
<view class="btn" @click="comfirm">确定</view>
|
<view class="btn" @click="comfirm">确定</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -74,35 +97,27 @@
|
|||||||
list: [1]
|
list: [1]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
changeRed: {
|
list: [],
|
||||||
type: -1,
|
changeRed: null,
|
||||||
id: -1,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
const eventChannel = this.getOpenerEventChannel();
|
const eventChannel = this.getOpenerEventChannel();
|
||||||
// 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
|
// 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
|
||||||
eventChannel.on('changeRedPacketInfo', (data) => {
|
eventChannel.on('changeRedPacketInfo', (data) => {
|
||||||
console.log(data)
|
console.log(data);
|
||||||
|
this.list = data;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
onShow() {},
|
onShow() {},
|
||||||
methods: {
|
methods: {
|
||||||
change(e, i) {
|
change(e, i) {
|
||||||
console.log(e, i);
|
console.log(e, i);
|
||||||
if(this.changeRed.type==e&&this.changeRed.id==i){
|
if(this.changeRed&&this.changeRed.uid==e.uid)this.changeRed = null;
|
||||||
this.changeRed = {
|
else this.changeRed = e;
|
||||||
type: -1,
|
|
||||||
id: -1
|
|
||||||
}
|
|
||||||
}else this.changeRed = {
|
|
||||||
type: e,
|
|
||||||
id: i
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
comfirm(){
|
comfirm(){
|
||||||
uni.$emit('changeRedPacket', { id: 1 });
|
uni.$emit('changeRedPacket', this.changeRed.uid);
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -677,6 +677,7 @@
|
|||||||
interest_rate: '', //利率
|
interest_rate: '', //利率
|
||||||
settle_cycle: '', // 周期
|
settle_cycle: '', // 周期
|
||||||
type_id: '', //店铺类型
|
type_id: '', //店铺类型
|
||||||
|
consumption_id: '', //红包id
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -1045,6 +1046,7 @@
|
|||||||
cart_id: that.cartId.split(","),
|
cart_id: that.cartId.split(","),
|
||||||
address_id: address_id,
|
address_id: address_id,
|
||||||
takes: that.take,
|
takes: that.take,
|
||||||
|
consumption_id: this.consumption_id,
|
||||||
use_coupon: that.subCoupon,
|
use_coupon: that.subCoupon,
|
||||||
use_integral: that.use_integral,
|
use_integral: that.use_integral,
|
||||||
product_type: that.product_type,
|
product_type: that.product_type,
|
||||||
@ -1206,6 +1208,7 @@
|
|||||||
res.eventChannel.emit('changeRedPacketInfo', this.platformConsumption)
|
res.eventChannel.emit('changeRedPacketInfo', this.platformConsumption)
|
||||||
uni.$once('changeRedPacket', (data)=>{
|
uni.$once('changeRedPacket', (data)=>{
|
||||||
console.log('选择红包', data);
|
console.log('选择红包', data);
|
||||||
|
this.consumption_id = data;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user