This commit is contained in:
zjf committed 2026-05-28 23:05:10 +08:00
commit f29b997cdb
2 files changed
+35 -17

No files matched your search

+4 -4
View File
@@ -25,17 +25,17 @@ VITE_OAUTH2_APP_CLIENT='mini:mini'
# VITE_ZZD_CORP_ID=
# --------------------------- 开发环境 api地址 ----------------------------------
VITE_APP_DEV_SERVICE = https://stgl.pj.gov.cn/api # 域名线上
# VITE_APP_DEV_SERVICE = https://stgl.pj.gov.cn/api # 域名线上
#VITE_APP_DEV_SERVICE = http://59.202.170.152:81/api # 信创线上
# VITE_APP_DEV_SERVICE = https://dzc-test-1.fy.takin.cc # 邓-本地
# VITE_APP_DEV_SERVICE = http://127.0.0.1:9999 # 邓-本地
VITE_APP_DEV_SERVICE = http://127.0.0.1:9999 # 邓-本地
# VITE_APP_DEV_SERVICE = http://123.157.250.162:8089/api # 测试线上
# --------------------------- 开发环境 图片访问基础地址 ---------------------------
VITE_IMAGE_DEV_PATH = https://stgl.pj.gov.cn/api # 域名线上
# VITE_IMAGE_DEV_PATH = https://stgl.pj.gov.cn/api # 域名线上
#VITE_IMAGE_DEV_PATH = http://59.202.170.152:81/api # 信创线上
#VITE_IMAGE_DEV_PATH = https://dzc-test-1.fy.takin.cc # 邓-本地
# VITE_IMAGE_DEV_PATH = http://127.0.0.1:9999
VITE_IMAGE_DEV_PATH = http://127.0.0.1:9999
# VITE_IMAGE_DEV_PATH = http://123.157.250.162:8089/api # 测试线上
# --------------------------- 生产环境 api地址 ----------------------------------
+31 -13
View File
@@ -1,8 +1,8 @@
<script setup lang="ts">
import { reactive, ref, computed } from "vue"
import { onLoad, onShow } from "@dcloudio/uni-app"
import { computed } from "vue"
import dayjs from "dayjs"
import { hooks, router } from "@/sheep"
import { hooks } from "@/sheep"
import { serviceEnum } from "@@/constant"
const { actCouponTypeEnum } = serviceEnum
@@ -14,13 +14,27 @@ const props = withDefaults(defineProps<{ mode?: 'list' | 'select', detail: any }
detail: {},
})
const doVisibleQrcode = () => {
emit("doVisibleQrcode", { type: 'ACT_COUPON', detail: props.detail })
}
const doUse = () => {
emit("doUse", { type: 'ACT_COUPON', detail: props.detail })
}
const doVisibleQrcode = () => {
emit("doVisibleQrcode", { type: "ACT_COUPON", detail: props.detail })
}
const timeStatus = computed(() => {
const startTime = props.detail?.startTime
const endTime = props.detail?.endTime
if (!startTime || !endTime) return "active"
const start = dayjs(startTime)
const end = dayjs(endTime)
if (!start.isValid() || !end.isValid()) return "active"
const now = dayjs()
if (now.isBefore(start)) return "not_started"
if (now.isAfter(end)) return "expired"
return "active"
})
</script>
<template>
@@ -72,14 +86,18 @@ const doUse = () => {
<!-- 右侧按钮 -->
<view class="flex-row-center">
<view v-if="mode == 'list'" class="coupon-right">
<view v-if="detail.status == 1">
<view v-if="detail.couponType == '4'" class="action-btn" @tap="doVisibleQrcode">核销码</view>
<view v-else class="action-btn" @tap="doUse">去使用</view>
<view v-if="detail.status == 1" class="flex-col items-center">
<view v-if="timeStatus === 'active'">
<view v-if="detail.couponType == '4'" class="action-btn" @tap="doVisibleQrcode">核销码</view>
<view v-else class="action-btn" @tap="doUse">去使用</view>
</view>
<view v-else-if="timeStatus === 'not_started'" class="action-btn disabled">未到期</view>
<view v-else class="action-btn disabled">已过期</view>
</view>
<view v-if="detail.status == 2" class="action-btn disabled">已使用</view>
<view v-if="detail.status == 3" class="action-btn disabled">已过期</view>
</view>
<view v-else-if="mode == 'select'">
<view v-else-if="mode == 'select'" class="coupon-right">
<view class="action-btn">使用</view>
</view>
</view>
@@ -212,7 +230,7 @@ const doUse = () => {
/* 右侧按钮区 */
.coupon-right {
width: 140rpx;
width: 160rpx;
display: flex;
align-items: center;
justify-content: center;
@@ -224,7 +242,7 @@ const doUse = () => {
.action-btn {
background: #0094ff;
color: #fff;
font-size: 26rpx;
font-size: 22rpx;
padding: 10rpx 24rpx;
border-radius: 30rpx;
font-weight: 500;