mirror of
https://gitee.com/myxzgzs/boyue-ui-admin-vue3
synced 2025-08-09 08:52:41 +08:00
【功能完善】MALL: 模板装修优惠券组件优惠券列表回显
This commit is contained in:
parent
391a1481c6
commit
5551c594ab
@ -68,7 +68,12 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
</ComponentContainerProperty>
|
</ComponentContainerProperty>
|
||||||
<!-- 优惠券选择 -->
|
<!-- 优惠券选择 -->
|
||||||
<CouponSelect ref="couponSelectDialog" v-model:multiple-selection="couponList" />
|
<CouponSelect
|
||||||
|
ref="couponSelectDialog"
|
||||||
|
v-model:multiple-selection="couponList"
|
||||||
|
:take-type="CouponTemplateTakeTypeEnum.USER.type"
|
||||||
|
@change="handleCouponSelect"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
@ -76,7 +81,7 @@ import { CouponCardProperty } from './config'
|
|||||||
import { useVModel } from '@vueuse/core'
|
import { useVModel } from '@vueuse/core'
|
||||||
import * as CouponTemplateApi from '@/api/mall/promotion/coupon/couponTemplate'
|
import * as CouponTemplateApi from '@/api/mall/promotion/coupon/couponTemplate'
|
||||||
import { floatToFixed2 } from '@/utils'
|
import { floatToFixed2 } from '@/utils'
|
||||||
import { PromotionDiscountTypeEnum } from '@/utils/constants'
|
import { CouponTemplateTakeTypeEnum, PromotionDiscountTypeEnum } from '@/utils/constants'
|
||||||
import CouponSelect from '@/views/mall/promotion/coupon/components/CouponSelect.vue'
|
import CouponSelect from '@/views/mall/promotion/coupon/components/CouponSelect.vue'
|
||||||
|
|
||||||
// 优惠券卡片属性面板
|
// 优惠券卡片属性面板
|
||||||
@ -93,10 +98,20 @@ const couponSelectDialog = ref()
|
|||||||
const handleAddCoupon = () => {
|
const handleAddCoupon = () => {
|
||||||
couponSelectDialog.value.open()
|
couponSelectDialog.value.open()
|
||||||
}
|
}
|
||||||
watch(
|
const handleCouponSelect = () => {
|
||||||
() => couponList.value,
|
|
||||||
() => {
|
|
||||||
formData.value.couponIds = couponList.value.map((coupon) => coupon.id)
|
formData.value.couponIds = couponList.value.map((coupon) => coupon.id)
|
||||||
|
}
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => formData.value.couponIds,
|
||||||
|
async () => {
|
||||||
|
if (formData.value.couponIds?.length > 0) {
|
||||||
|
couponList.value = await CouponTemplateApi.getCouponTemplateList(formData.value.couponIds)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
immediate: true,
|
||||||
|
deep: true
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user