优化
This commit is contained in:
@@ -41,8 +41,7 @@
|
||||
<view class="time">
|
||||
<view class="row">
|
||||
<text class="t">
|
||||
有效期至:{{ dayjs(item.validStartTime || new Date()).format('YYYY.M.D') }} -
|
||||
{{ dayjs(item.validEndTime || new Date()).format('YYYY.M.D') }}
|
||||
有效期至:{{ dayjs(val.validStartTime).format('YYYY.M.D') }}-{{ dayjs(val.validEndTime).format('YYYY.M.D') }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -109,9 +108,20 @@ async function getCouponPopupAjax() {
|
||||
try {
|
||||
const res = await getCouponPopup({ getMode: props.getMode });
|
||||
if (res.length) {
|
||||
res.map((item) => {
|
||||
if (item.validType == 'fixed') {
|
||||
item.validStartTime = dayjs().add(item.daysToTakeEffect, 'day').format('YYYY-MM-DD HH:mm:ss');
|
||||
item.validEndTime = dayjs()
|
||||
.add(+item.daysToTakeEffect + +item.validDays, 'day')
|
||||
.format('YYYY-MM-DD HH:mm:ss');
|
||||
}
|
||||
});
|
||||
|
||||
console.log('res===', res);
|
||||
show.value = true;
|
||||
couponCount.value = res.length;
|
||||
couponList.value = _.chunk(res, 3);
|
||||
console.log('couponList.value===', couponList.value);
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
@@ -152,7 +162,6 @@ onMounted(() => {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding-top: 10vh;
|
||||
.content {
|
||||
width: 94vw;
|
||||
position: relative;
|
||||
@@ -209,6 +218,7 @@ onMounted(() => {
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
gap: 8upx;
|
||||
padding-right: 20upx;
|
||||
.name {
|
||||
font-size: 32upx;
|
||||
font-weight: bold;
|
||||
|
||||
@@ -126,10 +126,12 @@
|
||||
</view> -->
|
||||
</view>
|
||||
<indexs v-if="showindex == 'shopIndex'" :shopExtend="orderVIP.shopExtendList"></indexs>
|
||||
<!-- <CouponModal></CouponModal> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import CouponModal from '@/components/coupon-modal.vue';
|
||||
import { ref, computed, onMounted, reactive, onBeforeUnmount, watch, getCurrentInstance, nextTick } from 'vue';
|
||||
import { onLoad, onReady, onShow, onReachBottom, onPageScroll } from '@dcloudio/uni-app';
|
||||
// 获取全局属性
|
||||
|
||||
@@ -153,8 +153,13 @@ function showDetailHandle(item) {
|
||||
`其它说明:${item.ruleDetails || '无'}`
|
||||
];
|
||||
|
||||
if (item.type == 2 || item.type == 4) {
|
||||
selectListItemDetails.value.splice(2, 0, `使用规则:${item.useRule == 'price_asc' ? '从最低价开始抵扣' : '从最高价开始抵扣'}`);
|
||||
}
|
||||
|
||||
if (item.type == 3) {
|
||||
selectListItemDetails.value.unshift(`最高抵扣${item.discountAmount}元`);
|
||||
selectListItemDetails.value.unshift(`最高抵扣${item.maxDiscountAmount}元`);
|
||||
// selectListItemDetails.value.splice(3, 0, `使用规则:${item.useRule == 'price_asc' ? '从最低价开始抵扣' : '从最高价开始抵扣'}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user