订单结算修改,增加限时折扣
This commit is contained in:
56
components/goods-price.vue
Normal file
56
components/goods-price.vue
Normal file
@@ -0,0 +1,56 @@
|
||||
<template>
|
||||
<text v-if="limitDiscount && limitDiscount.id" class="limit-price">
|
||||
{{ returnPrice() }}
|
||||
</text>
|
||||
<text v-else>
|
||||
<text v-if="shopInfo.isMemberPrice == 1 && shopUserInfo.isVip == 1" class="memberPrice">
|
||||
{{ cart.memberPrice || cart.salePrice }}
|
||||
</text>
|
||||
<text v-else class="salePrice">{{ cart.salePrice }}</text>
|
||||
</text>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import BigNumber from "bignumber.js";
|
||||
import * as orderUtils from "@/utils/order-utils.js";
|
||||
|
||||
|
||||
function returnPrice(){
|
||||
return orderUtils.returnPrice({
|
||||
goods:props.cart,
|
||||
shopInfo:props.shopInfo,
|
||||
limitTimeDiscountRes:props.limitDiscount,
|
||||
shopUserInfo:props.shopUserInfo,
|
||||
idKey:props.idKey
|
||||
})
|
||||
}
|
||||
|
||||
const props = defineProps({
|
||||
//购物车
|
||||
cart: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
idKey:{
|
||||
type: String,
|
||||
default: 'id',
|
||||
},
|
||||
//限时折扣
|
||||
limitDiscount: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
//店铺用户信息
|
||||
shopUserInfo: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
//店铺信息
|
||||
shopInfo: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
Reference in New Issue
Block a user