商品详情:优惠劵信息的接入

This commit is contained in:
YunaiV
2023-12-16 19:16:21 +08:00
parent b422c7414f
commit 275e8a278f
4 changed files with 41 additions and 37 deletions
+10 -9
View File
@@ -1,3 +1,4 @@
<!-- 商品详情 - 优惠劵领取 -->
<template>
<su-popup
:show="show"
@@ -21,13 +22,11 @@
<template #default>
<button
class="ss-reset-button card-btn ss-flex ss-row-center ss-col-center"
:class="
item.get_status != 'can_get' && item.get_status != 'can_use' ? 'boder-btn' : ''
"
:class="!item.canTake ? 'boder-btn' : ''"
@click.stop="getBuy(item.id)"
:disabled="item.get_status != 'can_get' && item.get_status != 'can_use'"
:disabled="!item.canTake"
>
{{ item.get_status_text }}
{{ item.canTake ? '立即领取' : '已领取' }}
</button>
</template>
</s-coupon-list>
@@ -38,6 +37,7 @@
</template>
<script setup>
import { computed, reactive } from 'vue';
const props = defineProps({
modelValue: {
type: Object,
@@ -48,16 +48,17 @@
default: false,
},
});
const emits = defineEmits(['get', 'close']);
const state = reactive({
couponInfo: computed(() => props.modelValue),
currentValue: -1,
couponId: '',
couponInfo: computed(() => props.modelValue)
});
// 领取优惠劵
const getBuy = (id) => {
emits('get', id);
};
//立即领取
</script>
<style lang="scss" scoped>
.model-box {