Browse Source

fixed: bug修复;

pull/11/head
fox 1 day ago
parent
commit
24d9660bfd
7 changed files with 45 additions and 13 deletions
  1. +20
    -2
      components/couponList/couponList.vue
  2. +1
    -1
      components/couponPopup/couponPopup.vue
  3. +1
    -0
      mixins/list.js
  4. +8
    -5
      pages/index/category.vue
  5. +12
    -2
      pages_order/components/voucher/voucherCard.vue
  6. +1
    -1
      pages_order/order/createOrder.vue
  7. +2
    -2
      pages_order/order/verifyOrder.vue

+ 20
- 2
components/couponList/couponList.vue View File

@ -27,6 +27,12 @@
</template>
<script>
import dayjs from 'dayjs'
import isSameOrBefore from 'dayjs/plugin/isSameOrBefore'
dayjs.extend(isSameOrBefore)
export default {
name: 'CouponList',
props: {
@ -73,7 +79,11 @@
this.$emit('select', item)
},
isValid(obj) {
const { validDate } = obj
return dayjs().isSameOrBefore(dayjs(validDate), 'day')
},
//
getCouponList() {
let params = {
@ -91,7 +101,15 @@
this.$api('queryVouchersList', params, res => {
if (res.code == 200) {
this.couponList = res.result.records
this.couponList = res.result.records.map(item => {
let status = item.status
if (!this.isValid(item)) {
status = 2
}
return { ...item, status }
})
this.total = res.result.total
}
})


+ 1
- 1
components/couponPopup/couponPopup.vue View File

@ -7,7 +7,7 @@
>
<view class="couponPopup-wrapper">
<view class="main-container" @click="toCoupon">
<image style="width: 583rpx; height: 601rpx;" src="@/pages_order/static/home/coupon.png"></image>
<image style="width: 583rpx; height: 601rpx;" src="/pages_order/static/home/coupon.png"></image>
</view>
</view>
</uv-popup>


+ 1
- 0
mixins/list.js View File

@ -50,6 +50,7 @@ export default {
console.log(queryParams)
return new Promise((success, error) => {
if(!this.mixinsListApi){
uni.stopPullDownRefresh()
return console.error('mixinsListApi 缺失');
}
this.$api(this.mixinsListApi,


+ 8
- 5
pages/index/category.vue View File

@ -106,9 +106,6 @@
mixinsListApi() {
return this.queryParams.title ? 'queryProductList' : ''
}
},
onShow() {
},
onLoad() {
@ -118,10 +115,14 @@
if (search) {
this.queryParams.title = search
uni.setStorageSync('search', '')
this.getData()
} else {
this.initList()
}
this.initList()
},
onPullDownRefresh() {
!this.queryParams.title && this.initList()
},
methods: {
async fetchCategoryList() {
@ -144,6 +145,8 @@
this.categoryList.forEach(async (category) => {
category.childrens = await this.queryProductList(category.id)
})
uni.stopPullDownRefresh()
},
change(e) {
this.current = e


+ 12
- 2
pages_order/components/voucher/voucherCard.vue View File

@ -1,6 +1,6 @@
<template>
<view class="voucher">
<image class="voucher-bg" src="@/pages_order/static/voucher/voucher-bg.png" ></image>
<image class="voucher-bg" src="/pages_order/static/voucher/voucher-bg.png" ></image>
<view class="voucher-info">
<view class="voucher-row voucher-title">{{ data.vouchersId_dictText }}</view>
@ -10,7 +10,7 @@
</view>
<!-- status: 0-未使用 1-已使用 -->
<template v-if="!readonly && data.status == 0">
<template v-if="!readonly && data.status == 0 && isValid">
<button plain class="btn" @click="onClick">立即使用</button>
</template>
</view>
@ -18,6 +18,11 @@
<script>
import dayjs from 'dayjs'
import isSameOrBefore from 'dayjs/plugin/isSameOrBefore'
dayjs.extend(isSameOrBefore)
export default {
props: {
data: {
@ -40,6 +45,11 @@ export default {
return `${startTime}-${endTime}`
},
isValid() {
const { validDate } = this.data || {}
return dayjs().isSameOrBefore(dayjs(validDate), 'day')
},
},
methods: {
onClick() {


+ 1
- 1
pages_order/order/createOrder.vue View File

@ -30,7 +30,7 @@
<!-- 优惠券 -->
<view @click="openCoupon" class="card flex coupon">
<image class="icon" src="@/pages_order/static/createOrder/icon-coupon.png" mode="widthFix"></image>
<image class="icon" src="/pages_order/static/createOrder/icon-coupon.png" mode="widthFix"></image>
<!-- todo: check is selected coupon -->
<view class="label">优惠券<text v-if="selectedCoupon[0]" class="desc">{{ `满减券:${coupon.discountAmount}` }}</text></view>
<view v-if="selectedCoupon[0]">


+ 2
- 2
pages_order/order/verifyOrder.vue View File

@ -4,7 +4,7 @@
<navbar title="核销详情" leftClick @leftClick="$utils.navigateBack" color="#fff" />
<view class="flex page-header">
<image class="icon" src="@/pages_order/static/verifyOrder/icon-clock.png" mode="widthFix"></image>
<image class="icon" src="/pages_order/static/verifyOrder/icon-clock.png" mode="widthFix"></image>
<text>待核销</text>
</view>
@ -14,7 +14,7 @@
<view class="card rights" v-if="orderDetail.rights && orderDetail.rights.length">
<view class="flex rights-item" v-for="item in orderDetail.rights" :key="item">
<image class="rights-icon" src="@/pages_order/static/verifyOrder/icon-checked.png" mode="widthFix">
<image class="rights-icon" src="/pages_order/static/verifyOrder/icon-checked.png" mode="widthFix">
</image>
<text>{{ item }}</text>
</view>


Loading…
Cancel
Save