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


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

@ -7,7 +7,7 @@
> >
<view class="couponPopup-wrapper"> <view class="couponPopup-wrapper">
<view class="main-container" @click="toCoupon"> <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>
</view> </view>
</uv-popup> </uv-popup>


+ 1
- 0
mixins/list.js View File

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


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

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


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

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


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

@ -30,7 +30,7 @@
<!-- 优惠券 --> <!-- 优惠券 -->
<view @click="openCoupon" class="card flex coupon"> <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 --> <!-- todo: check is selected coupon -->
<view class="label">优惠券<text v-if="selectedCoupon[0]" class="desc">{{ `满减券:${coupon.discountAmount}` }}</text></view> <view class="label">优惠券<text v-if="selectedCoupon[0]" class="desc">{{ `满减券:${coupon.discountAmount}` }}</text></view>
<view v-if="selectedCoupon[0]"> <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" /> <navbar title="核销详情" leftClick @leftClick="$utils.navigateBack" color="#fff" />
<view class="flex page-header"> <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> <text>待核销</text>
</view> </view>
@ -14,7 +14,7 @@
<view class="card rights" v-if="orderDetail.rights && orderDetail.rights.length"> <view class="card rights" v-if="orderDetail.rights && orderDetail.rights.length">
<view class="flex rights-item" v-for="item in orderDetail.rights" :key="item"> <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> </image>
<text>{{ item }}</text> <text>{{ item }}</text>
</view> </view>


Loading…
Cancel
Save