【功能优化】商城:价格计算时,返回可用 + 不可用的优惠劵

This commit is contained in:
YunaiV
2024-09-07 12:06:10 +08:00
parent 735dc8c373
commit 9b6d1a9a97
4 changed files with 61 additions and 74 deletions
@@ -37,30 +37,22 @@
<view class="ss-flex ss-row-between ss-m-t-16">
<view
class="sellby-text"
:class=" isDisable ? 'disabled-color' : 'subtitle-color'"
:class="isDisable ? 'disabled-color' : 'subtitle-color'"
v-if="data.validityType === 2"
>
有效期领取后 {{ data.fixedEndTerm }} 天内可用
</view>
<view
class="sellby-text"
:class=" isDisable ? 'disabled-color' : 'subtitle-color'"
v-else
>
<view class="sellby-text" :class="isDisable ? 'disabled-color' : 'subtitle-color'" v-else>
有效期: {{ sheep.$helper.timeFormat(data.validStartTime, 'yyyy-mm-dd') }}
{{ sheep.$helper.timeFormat(data.validEndTime, 'yyyy-mm-dd') }}
</view>
<view
class="value-enough"
:class="isDisable ? 'disabled-color' : 'subtitle-color'"
>
<view class="value-enough" :class="isDisable ? 'disabled-color' : 'subtitle-color'">
{{ fen2yuan(data.usePrice) }} 可用
</view>
</view>
</view>
</view>
<!-- TODO 芋艿可优化增加优惠劵的描述 -->
<view class="desc ss-flex ss-row-between">
<view>
<view class="desc-title">{{ data.description }}</view>
@@ -76,12 +68,10 @@
</template>
<script setup>
import { computed, reactive } from 'vue';
import { computed } from 'vue';
import { fen2yuan } from '../../hooks/useGoods';
import sheep from '../../index';
const state = reactive({});
const isDisable = computed(() => {
if (props.type === 'coupon') {
return false;
@@ -202,4 +192,4 @@
.price-text {
color: #ff0000;
}
</style>
</style>