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