wangzhibo
6 天以前 7bd866831780abcf5a59c4cbb7d1be456eea7c99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<template>
    <div class="discount-item" v-if="scope.discountSource">
        <p class="t1">- {{ scope.discountPrice }}</p>
        <p class="t2">{{ doc }}</p>
    </div>
 
    <span v-else>-</span>
</template>
 
<script lang="ts" setup name="order-discount-item">
import { type PropType, computed } from "vue";
 
const props = defineProps({
    scope: {
        type: Object as PropType<Eps.OrderInfoEntity>,
        default: () => ({})
    }
});
 
const doc = computed(() => {
    const { info, type } = props.scope.discountSource || {};
 
    switch (type) {
        case 0:
            return `${info.title}(满 ${info.condition.fullAmount} 元减 ${info.amount} 元)`;
 
        default:
            return "";
    }
});
</script>
 
<style lang="scss" scoped>
.discount-item {
    text-align: left;
 
    .t1 {
        color: red;
    }
 
    .t2 {
        font-size: 12px;
    }
}
</style>