Przeglądaj źródła

feat(api): 新增优惠券及订单相关接口定义和类型声明

- 在环境配置中激活开发环境API基础URL配置
- 修改导航栏标题为“市民请集合”
- 新增接口定义:查询用户下单时使用优惠券列表接口
- 新增接口定义:订单及加油订单支付结果查询接口等多个订单相关接口
- 新增多种订单相关数据类型声明,包括订单项、虚拟订单、充电订单、大健康订单等
- 优化现有优惠券接口参数及响应类型,增加第三方ID等字段
- 补充接口请求参数和响应数据结构,完善类型安全保障
zhangtao 5 dni temu
rodzic
commit
ec64f90695

+ 2 - 2
.env.development

@@ -4,10 +4,10 @@
 # API 基础 URL - 开发环境
 # VITE_API_BASE_URL=http://192.168.0.19:8080
 # VITE_API_BASE_URL=http://192.168.0.11:8080
-# VITE_API_BASE_URL=http://192.168.1.166:8080
+VITE_API_BASE_URL=http://192.168.1.166:8080
 # VITE_API_BASE_URL=https://smqjh.api.zswlgz.com
 # VITE_API_BASE_URL=https://7a8e0952.r28.cpolar.top
-VITE_API_BASE_URL=https://52e7774d.r24.cpolar.top
+# VITE_API_BASE_URL=https://52e7774d.r24.cpolar.top
 
 # 静态资源基础 URL - 测试环境
 VITE_STATIC_BASE_URL=https://zswl-smqjh.oss-cn-chengdu.aliyuncs.com/static/static

+ 1 - 1
pages.json.ts

@@ -6,7 +6,7 @@ export default defineConfig({
     // 导航栏配置
     navigationBarBackgroundColor: '@navBgColor',
     navigationBarTextStyle: '@navTxtStyle',
-    navigationBarTitleText: 'Wot Starter',
+    navigationBarTitleText: '市民请集合',
 
     // 页面背景配置
     backgroundColor: '@bgColor',

+ 8 - 1
src/api/apiDefinitions.ts

@@ -20,6 +20,10 @@ export default {
   'app.get_smqjh_system_app_api_membercoupon_findbyid': ['GET', '/smqjh-system/app-api/memberCoupon/findById'],
   'app.get_app_api_membercoupon_page': ['GET', '/app-api/memberCoupon/page'],
   'app.get_app_api_membercoupon_findbyid': ['GET', '/app-api/memberCoupon/findById'],
+  'app.get_smqjh_system_app_api_membercoupon_findplaceorderlist': [
+    'GET',
+    '/smqjh-system/app-api/memberCoupon/findPlaceOrderList'
+  ],
   'app.get_app_api_membercoupon_findplaceorderlist': ['GET', '/app-api/memberCoupon/findPlaceOrderList'],
   'app.get_smqjh_system_app_api_coupon_page': ['GET', '/smqjh-system/app-api/coupon/page'],
   'app.get_smqjh_system_app_api_coupon_findbyid': ['GET', '/smqjh-system/app-api/coupon/findById'],
@@ -107,5 +111,8 @@ export default {
   'general.get_smqjh_oms_api_v1_oil_order_payresultinfo': ['GET', '/smqjh-oms/api/v1/oil/order/payResultInfo'],
   'general.get_api_v1_oil_order_payresultinfo': ['GET', '/api/v1/oil/order/payResultInfo'],
   'general.get_api_v1_oil_order_checkonpayorder': ['GET', '/api/v1/oil/order/checkOnPayOrder'],
-  'general.post_api_v1_oil_callback_third_party': ['POST', '/api/v1/oil/callback/third-party']
+  'general.post_api_v1_oil_callback_third_party': ['POST', '/api/v1/oil/callback/third-party'],
+  'general.get_api_v1_order_orderlist': ['GET', '/api/v1/order/orderList'],
+  'general.get_smqjh_oms_api_v1_order_orderinfo': ['GET', '/smqjh-oms/api/v1/order/orderInfo'],
+  'general.get_api_v1_order_orderinfo': ['GET', '/api/v1/order/orderInfo']
 };

Plik diff jest za duży
+ 1017 - 253
src/api/globals.d.ts


+ 19 - 1
src/pages.json

@@ -73,6 +73,15 @@
       },
       "layout": "tabbar"
     },
+    {
+      "path": "pages/orderDetail/index",
+      "name": "orderDetail",
+      "islogin": true,
+      "style": {
+        "navigationBarTitleText": "订单详情",
+        "navigationStyle": "custom"
+      }
+    },
     {
       "path": "pages/paySuccess/index",
       "name": "paySuccess",
@@ -109,12 +118,21 @@
         "navigationBarTitleText": "抵扣券",
         "navigationStyle": "custom"
       }
+    },
+    {
+      "path": "pages/voucherDetail/index",
+      "name": "voucherDetail",
+      "islogin": true,
+      "style": {
+        "navigationBarTitleText": "抵扣券详情",
+        "navigationStyle": "custom"
+      }
     }
   ],
   "globalStyle": {
     "navigationBarBackgroundColor": "@navBgColor",
     "navigationBarTextStyle": "@navTxtStyle",
-    "navigationBarTitleText": "Wot Starter",
+    "navigationBarTitleText": "市民请集合",
     "backgroundColor": "@bgColor",
     "backgroundTextStyle": "@bgTxtStyle",
     "backgroundColorTop": "@bgColorTop",

+ 7 - 0
src/pages/confirmOrder/index.vue

@@ -75,6 +75,13 @@ async function handleBlur() {
   } })
   ThreePrice.value = data
   console.log(data)
+  const res = await Apis.app.get_smqjh_system_app_api_membercoupon_findplaceorderlist({
+    params: {
+      storeId: storeDetail.value?.storeId,
+      orderAmount: Number(refuelMoney.value) * 100,
+    },
+  })
+  console.log(res)
 }
 async function goPay() {
   uni.showLoading({ mask: true })

+ 5 - 12
src/pages/order/index.vue

@@ -1,5 +1,6 @@
 <script setup lang="ts">
 import type { OmsOrderOilPageVO } from '@/api/globals'
+import router from '@/router'
 
 definePage({
   name: 'order',
@@ -18,7 +19,7 @@ const tabList = ref([
 const currentTab = ref(0)
 
 // 分页请求
-const { data, send, isLastPage, page } = usePagination(
+const { data, send, isLastPage, page, reload } = usePagination(
   (pageNum, pageSize) => Apis.general.post_smqjh_oms_api_v1_oil_order_findoilorderpage({
     data: { pageNum, pageSize, status: currentTab.value },
   }),
@@ -34,9 +35,8 @@ const { data, send, isLastPage, page } = usePagination(
 // 切换 Tab
 function handleTabChange(value: number) {
   currentTab.value = value
-  data.value = []
   page.value = 1
-  send()
+  reload()
 }
 
 // 订单状态映射
@@ -97,9 +97,7 @@ function handleInvoice(_item: OmsOrderOilPageVO) {
 }
 
 onShow(() => {
-  data.value = []
-  page.value = 1
-  send()
+  reload()
 })
 
 onReachBottom(() => {
@@ -107,12 +105,6 @@ onReachBottom(() => {
     page.value++
   }
 })
-
-watch(() => currentTab.value, () => {
-  data.value = []
-  page.value = 1
-  send()
-})
 </script>
 
 <template>
@@ -136,6 +128,7 @@ watch(() => currentTab.value, () => {
         v-for="item in data"
         :key="item.orderNumber"
         class="mb20rpx rounded-16rpx bg-white px24rpx py28rpx"
+        @click="router.push({ name: 'orderDetail', params: { orderNo: item.orderNumber as string } })"
       >
         <!-- 头部:油站名称 + 状态 -->
         <view class="flex justify-between">

+ 291 - 0
src/pages/orderDetail/index.vue

@@ -0,0 +1,291 @@
+<script setup lang="ts">
+import type { OmsOrder, OmsOrderOilVO } from '@/api/globals'
+import router from '@/router'
+
+definePage({
+  name: 'orderDetail',
+  islogin: true,
+  style: {
+    navigationBarTitleText: '订单详情',
+    navigationStyle: 'custom',
+  },
+})
+
+const orderNo = ref('')
+const orderInfo = ref<OmsOrder>()
+const oilInfo = computed<OmsOrderOilVO | undefined>(() => orderInfo.value?.omsOrderOilVO)
+
+// 状态映射
+const statusMap = new Map([
+  [1, '待支付'],
+  [2, '已支付'],
+  [6, '已退款'],
+  [9, '已取消'],
+])
+
+const { send } = useRequest(
+  (no: string) => Apis.general.get_smqjh_oms_api_v1_order_orderinfo({ params: { orderNo: no } }),
+  { immediate: false },
+).onSuccess((res) => {
+  orderInfo.value = res.data.data
+})
+
+onLoad((options: any) => {
+  orderNo.value = options.orderNo || ''
+  if (orderNo.value) {
+    send(orderNo.value)
+  }
+})
+
+// 计算支付倒计时
+function getCountdownTime(): number {
+  if (!orderInfo.value?.expireTime)
+    return 0
+  const expireTime = new Date(orderInfo.value.expireTime).getTime()
+  const remaining = expireTime - Date.now()
+  return remaining > 0 ? remaining : 0
+}
+
+// 复制订单号
+function handleCopy(text?: string) {
+  if (!text)
+    return
+  uni.setClipboardData({
+    data: text,
+    success: () => {
+      useGlobalToast().show('复制成功')
+    },
+  })
+}
+
+// 取消订单(占位)
+function handleCancelOrder() {
+  useGlobalToast().show('功能开发中')
+}
+
+// 立即支付(占位)
+function handlePay() {
+  useGlobalToast().show('功能开发中')
+}
+
+// 联系客服(占位)
+function handleContact() {
+  useGlobalToast().show('功能开发中')
+}
+
+// 跳转首页
+function handleGoHome() {
+  router.pushTab({ name: 'home' })
+  useTabbar().setTabbarItemActive('home')
+}
+</script>
+
+<template>
+  <view v-if="orderInfo && oilInfo" class="min-h-100vh bg-#f5f5f5 pb200rpx pt20rpx">
+    <!-- 订单状态头部 -->
+    <view class="mx24rpx rounded-16rpx bg-white px28rpx py32rpx">
+      <view class="mb16rpx text-32rpx font-semibold">
+        订单状态:{{ statusMap.get(orderInfo.oilOrderStatus as number) || '-' }}
+      </view>
+
+      <!-- 待支付 - 倒计时和按钮 -->
+      <template v-if="orderInfo.oilOrderStatus === 1">
+        <view class="mb20rpx flex items-center text-26rpx text-#FF4A39">
+          剩余支付时间:<wd-count-down :time="getCountdownTime()" format="mm分ss秒" />
+        </view>
+        <view class="flex items-center gap-24rpx">
+          <wd-button plain custom-class="flex-1 cancel-btn" @click="handleCancelOrder">
+            取消订单
+          </wd-button>
+          <wd-button custom-class="flex-1" @click="handlePay">
+            立即支付 ¥{{ oilInfo.realMoney }}
+          </wd-button>
+        </view>
+      </template>
+
+      <!-- 已支付 - 操作图标 -->
+      <template v-else-if="orderInfo.oilOrderStatus === 2">
+        <view class="flex items-center gap-48rpx">
+          <view class="flex flex-col items-center" @click="handleContact">
+            <wd-icon name="chat" size="48rpx" color="#333" />
+            <text class="mt8rpx text-24rpx">
+              联系客服
+            </text>
+          </view>
+        </view>
+      </template>
+
+      <!-- 已退款 - 联系客服 -->
+      <template v-else-if="orderInfo.oilOrderStatus === 6">
+        <view class="flex items-center gap-48rpx">
+          <view class="flex flex-col items-center" @click="handleContact">
+            <wd-icon name="chat" size="48rpx" color="#333" />
+            <text class="mt8rpx text-24rpx">
+              联系客服
+            </text>
+          </view>
+        </view>
+      </template>
+
+      <!-- 已取消 - 取消原因 -->
+      <template v-else-if="orderInfo.oilOrderStatus === 9">
+        <view class="text-26rpx text-#999">
+          取消原因:{{ orderInfo.cancelReason || '未按时支付' }}
+        </view>
+      </template>
+    </view>
+
+    <!-- 重要提示(已支付) -->
+    <view v-if="orderInfo.oilOrderStatus === 2" class="mx24rpx mt20rpx rounded-16rpx bg-white px28rpx py32rpx">
+      <view class="mb16rpx flex items-center text-26rpx text-#ff4d3a">
+        <wd-icon name="info-circle" size="28rpx" color="#ff4d3a" class="mr8rpx" />
+        重要提示
+      </view>
+      <view class="text-26rpx text-#666">
+        如需加油站线下开票,请向油站工作人员提供以下订单号:
+      </view>
+      <view class="mt12rpx flex items-center text-26rpx">
+        我方订单号:{{ orderInfo.orderNumber }}
+        <wd-icon name="content-copy" size="28rpx" color="#999" class="ml12rpx" @click="handleCopy(orderInfo?.orderNumber)" />
+      </view>
+    </view>
+
+    <!-- 退款信息(已退款) -->
+    <view v-if="orderInfo.oilOrderStatus === 6" class="mx24rpx mt20rpx rounded-16rpx bg-white px28rpx py32rpx">
+      <view class="mb20rpx text-30rpx font-semibold">
+        退款信息
+      </view>
+      <view class="text-26rpx text-#666 leading-48rpx">
+        <view>退款金额:¥{{ oilInfo.realMoney }}</view>
+        <view class="text-24rpx text-#999">
+          退还金额:¥{{ oilInfo.realMoney }} &nbsp; 退还积分:需联系客服处理
+        </view>
+        <view>退款时间:{{ oilInfo.refundTime || '-' }}</view>
+        <view>退款方式:原路返回</view>
+        <view>退款状态:退款成功</view>
+        <view>预计到账:1-3个工作日</view>
+      </view>
+    </view>
+
+    <!-- 订单编号 -->
+    <view class="mx24rpx mt20rpx rounded-16rpx bg-white px28rpx py32rpx">
+      <view class="mb20rpx text-30rpx font-semibold">
+        订单编号
+      </view>
+      <view class="text-26rpx text-#666 leading-48rpx">
+        <view>我方订单号:{{ orderInfo.orderNumber || '-' }}</view>
+        <view>小桔订单号:{{ oilInfo.xjOrderId || '-' }}</view>
+      </view>
+    </view>
+
+    <!-- 用户信息(已支付/已退款) -->
+    <view v-if="orderInfo.oilOrderStatus === 2 || orderInfo.oilOrderStatus === 6" class="mx24rpx mt20rpx rounded-16rpx bg-white px28rpx py32rpx">
+      <view class="mb20rpx text-30rpx font-semibold">
+        用户信息
+      </view>
+      <view class="text-26rpx text-#666 leading-48rpx">
+        <view>用户手机:{{ orderInfo.memberMobile || '-' }}</view>
+        <view>外部用户ID:{{ orderInfo.memberId || '-' }}</view>
+        <view>下单时间:{{ orderInfo.createTime || '-' }}</view>
+        <view>支付时间:{{ oilInfo.payTime || '-' }}</view>
+      </view>
+    </view>
+
+    <!-- 油站信息 -->
+    <view class="mx24rpx mt20rpx rounded-16rpx bg-white px28rpx py32rpx">
+      <view class="mb20rpx text-30rpx font-semibold">
+        油站信息
+      </view>
+      <view class="text-26rpx text-#666 leading-48rpx">
+        <view>油站名称:{{ oilInfo.brandName }}·{{ oilInfo.storeName }}</view>
+        <view>油站地址:{{ oilInfo.address || '-' }}</view>
+        <view>所在城市:{{ oilInfo.cityName || '-' }}</view>
+      </view>
+    </view>
+
+    <!-- 加油明细 -->
+    <view class="mx24rpx mt20rpx rounded-16rpx bg-white px28rpx py32rpx">
+      <view class="mb20rpx text-30rpx font-semibold">
+        加油明细
+      </view>
+      <view class="text-26rpx text-#666 leading-48rpx">
+        <view>油品名称:{{ oilInfo.itemName || '-' }}</view>
+        <view>枪号:{{ oilInfo.gunNo ? `${oilInfo.gunNo}号枪` : '-' }}</view>
+        <view>加油量:{{ oilInfo.quantity || '-' }}L</view>
+      </view>
+    </view>
+
+    <!-- 价格明细 -->
+    <view class="mx24rpx mt20rpx rounded-16rpx bg-white px28rpx py32rpx">
+      <view class="mb20rpx text-30rpx font-semibold">
+        价格明细
+      </view>
+      <view class="text-26rpx text-#666 leading-48rpx">
+        <view>门店价:¥{{ oilInfo.storePrice || '-' }}/L</view>
+        <view>平台价:¥{{ oilInfo.vipPrice || '-' }}/L</view>
+        <view>订单金额:¥{{ oilInfo.totalMoney }}</view>
+        <view>抵扣金额:-¥{{ oilInfo.promotionAmount }}</view>
+        <view>服务费:+¥{{ oilInfo.serviceFee }}</view>
+        <view v-if="orderInfo.oilOrderStatus === 6">
+          实付金额:¥{{ oilInfo.realMoney }}
+        </view>
+        <view v-else-if="orderInfo.oilOrderStatus === 9">
+          应付金额:¥{{ oilInfo.realMoney }}
+        </view>
+        <view v-else>
+          需付金额:¥{{ oilInfo.realMoney }}
+        </view>
+      </view>
+    </view>
+
+    <!-- 抵扣信息(已支付/已退款) -->
+    <view v-if="(orderInfo.oilOrderStatus === 2 || orderInfo.oilOrderStatus === 6) && oilInfo.allowanceId" class="mx24rpx mt20rpx rounded-16rpx bg-white px28rpx py32rpx">
+      <view class="mb20rpx text-30rpx font-semibold">
+        抵扣信息
+      </view>
+      <view class="text-26rpx text-#666 leading-48rpx">
+        <view>抵扣券:{{ oilInfo.allowanceId || '-' }}</view>
+        <view>优惠描述:{{ oilInfo.activityName || '-' }}</view>
+      </view>
+    </view>
+
+    <!-- 支付信息(已支付/已退款) -->
+    <view v-if="orderInfo.oilOrderStatus === 2 || orderInfo.oilOrderStatus === 6" class="mx24rpx mt20rpx rounded-16rpx bg-white px28rpx py32rpx">
+      <view class="mb20rpx text-30rpx font-semibold">
+        支付信息
+      </view>
+      <view class="text-26rpx text-#666 leading-48rpx">
+        <view>支付方式:微信支付</view>
+        <view>支付状态:成功</view>
+        <view>支付流水号:{{ orderInfo.transactionId || '-' }}</view>
+      </view>
+    </view>
+
+    <!-- 开票信息(已支付) -->
+    <view v-if="orderInfo.oilOrderStatus === 2" class="mx24rpx mt20rpx rounded-16rpx bg-white px28rpx py32rpx">
+      <view class="mb20rpx text-30rpx font-semibold">
+        开票信息
+      </view>
+      <view class="text-26rpx text-#666 leading-48rpx">
+        <view>开票方式:线上自助开票</view>
+      </view>
+    </view>
+
+    <!-- 底部按钮(已取消状态) -->
+    <FixedLayout v-if="orderInfo.oilOrderStatus === 9">
+      <wd-button block size="large" @click="handleGoHome">
+        再去逛逛
+      </wd-button>
+    </FixedLayout>
+  </view>
+</template>
+
+<style lang="scss" scoped>
+:deep(.cancel-btn) {
+  border-color: var(--them-color) !important;
+  color: var(--them-color) !important;
+}
+:deep(.wd-count-down){
+  color: #FF4A39 !important;
+}
+</style>

+ 1 - 0
src/pages/voucher/index.vue

@@ -118,6 +118,7 @@ watch(() => currentTab.value, () => {
         v-for="item in data"
         :key="item.id"
         class="mb20rpx rounded-16rpx bg-white px24rpx py28rpx"
+        @click="router.push({ name: 'voucherDetail', params: { id: item.id as string } })"
       >
         <!-- 券信息头部 -->
         <view class="flex items-center justify-between">

+ 272 - 0
src/pages/voucherDetail/index.vue

@@ -0,0 +1,272 @@
+<script setup lang="ts">
+import type { AppCouponDetailsVO } from '@/api/globals'
+import router from '@/router'
+
+definePage({
+  name: 'voucherDetail',
+  islogin: true,
+  style: {
+    navigationBarTitleText: '抵扣券详情',
+    navigationStyle: 'custom',
+  },
+})
+
+const StaticUrl = import.meta.env.VITE_STATIC_BASE_URL
+const couponId = ref('')
+const couponInfo = ref<AppCouponDetailsVO>()
+
+// 状态映射
+const statusMap = new Map([
+  [2, '可用'],
+  [1, '已使用'],
+  [5, '已过期'],
+  [7, '无效'],
+])
+
+const { send } = useRequest(
+  (id: string) => Apis.app.get_smqjh_system_app_api_membercoupon_findbyid({ params: { id } }),
+  { immediate: false },
+).onSuccess((res) => {
+  couponInfo.value = res.data.data
+})
+
+onLoad((options: any) => {
+  couponId.value = options.id || ''
+  if (couponId.value) {
+    send(couponId.value)
+  }
+})
+
+// 计算剩余天数
+const remainingDays = computed(() => {
+  if (!couponInfo.value?.expirationTime)
+    return ''
+  const expire = new Date(couponInfo.value.expirationTime).getTime()
+  const now = Date.now()
+  const diff = expire - now
+  if (diff <= 0)
+    return '已过期'
+  const days = Math.floor(diff / (1000 * 60 * 60 * 24))
+  const hours = Math.floor((diff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))
+  return `${days}天${hours}小时`
+})
+
+// 计算支付倒计时
+function getCountdownTime(orderCreateTime?: string): number {
+  if (!orderCreateTime)
+    return 0
+  const createTime = new Date(orderCreateTime).getTime()
+  const expireTime = createTime + 30 * 60 * 1000 // 30分钟
+  const remaining = expireTime - Date.now()
+  return remaining > 0 ? remaining : 0
+}
+
+// 去使用
+function handleUse() {
+  router.pushTab({ name: 'home' })
+  useTabbar().setTabbarItemActive('home')
+}
+
+// 查看订单详情
+function handleViewOrder() {
+  router.pushTab({ name: 'order' })
+  useTabbar().setTabbarItemActive('order')
+}
+
+// 取消订单(占位)
+function handleCancelOrder() {
+  useGlobalToast().show('功能开发中')
+}
+
+// 付款(占位)
+function handlePay() {
+  useGlobalToast().show('功能开发中')
+}
+
+// 联系客服(占位)
+function handleContact() {
+  useGlobalToast().show('功能开发中')
+}
+</script>
+
+<template>
+  <view v-if="couponInfo" class="min-h-100vh bg-#f5f5f5 pb200rpx pt20rpx">
+    <!-- 顶部券信息 -->
+    <view class="mx24rpx rounded-16rpx bg-white px28rpx py32rpx">
+      <view class="flex items-center">
+        <image :src="`${StaticUrl}/smqjh-reful-juan.png`" class="mr12rpx h32rpx w32rpx" />
+        <view class="text-30rpx font-semibold">
+          抵扣{{ couponInfo.discountMoney }}元(满{{ couponInfo.amountMoney }}可用)
+        </view>
+      </view>
+    </view>
+
+    <!-- 券信息卡片 -->
+    <view class="mx24rpx mt20rpx rounded-16rpx bg-white px28rpx py32rpx">
+      <view class="mb20rpx text-30rpx font-semibold">
+        券信息
+      </view>
+      <view class="text-26rpx text-#666 leading-48rpx">
+        <view>券ID:{{ couponInfo.allowanceId || couponInfo.id }}</view>
+        <view>批次号:{{ couponInfo.batchId || '-' }}</view>
+        <view>状态:{{ couponInfo.lockStatus === 1 ? '已冻结' : statusMap.get(couponInfo.useStatus as number) || '-' }}</view>
+        <view>面值:¥{{ couponInfo.discountMoney }}</view>
+      </view>
+    </view>
+
+    <!-- 有效期卡片 -->
+    <view class="mx24rpx mt20rpx rounded-16rpx bg-white px28rpx py32rpx">
+      <view class="mb20rpx text-30rpx font-semibold">
+        有效期
+      </view>
+      <view class="text-26rpx text-#666 leading-48rpx">
+        <view>开始:{{ couponInfo.getTime || '-' }}</view>
+        <view>结束:{{ couponInfo.expirationTime || '-' }}</view>
+        <view v-if="couponInfo.useStatus === 1">
+          使用:{{ couponInfo.orderPayTime || '-' }}
+        </view>
+        <view v-else>
+          剩余:{{ remainingDays }}
+        </view>
+      </view>
+    </view>
+
+    <!-- 使用记录(已使用状态) -->
+    <view v-if="couponInfo.useStatus === 1" class="mx24rpx mt20rpx rounded-16rpx bg-white px28rpx py32rpx">
+      <view class="mb20rpx text-30rpx font-semibold">
+        使用记录
+      </view>
+      <view class="text-26rpx text-#666 leading-48rpx">
+        <view>订单号:{{ couponInfo.orderNumber || '-' }}</view>
+        <view>油站:{{ couponInfo.storeName || '-' }}</view>
+        <view>油号:{{ couponInfo.itemName || '-' }}</view>
+        <view>枪号:{{ couponInfo.gunNo ? `${couponInfo.gunNo}号枪` : '-' }}</view>
+        <view>订单金额:¥{{ couponInfo.totalMoney ? (couponInfo.totalMoney / 100) : 0 }}</view>
+        <view>抵扣金额:¥{{ couponInfo.discountMoney }}</view>
+        <view>实付金额:¥{{ couponInfo.realMoney ? (couponInfo.realMoney / 100) : 0 }}</view>
+      </view>
+    </view>
+
+    <!-- 冻结信息(已冻结状态) -->
+    <view v-if="couponInfo.lockStatus === 1 && couponInfo.useStatus === 2" class="mx24rpx mt20rpx rounded-16rpx bg-white px28rpx py32rpx">
+      <view class="mb20rpx text-30rpx font-semibold">
+        冻结信息
+      </view>
+      <view class="mb16rpx flex items-center text-26rpx text-#ff4d3a">
+        <wd-icon name="info-circle" size="28rpx" color="#ff4d3a" class="mr8rpx" />
+        当前券被订单占用
+      </view>
+      <view class="text-26rpx text-#666 leading-48rpx">
+        <view>订单号:{{ couponInfo.orderNumber || '-' }}</view>
+        <view>下单时间:{{ couponInfo.orderCreateTime || '-' }}</view>
+        <view class="flex items-center">
+          支付剩余时间:<wd-count-down :time="getCountdownTime(couponInfo.orderCreateTime)" format="mm分ss秒" />
+        </view>
+        <view>订单金额:¥{{ couponInfo.totalMoney ? (couponInfo.totalMoney / 100) : 0 }}</view>
+        <view>抵扣金额:¥{{ couponInfo.discountMoney }}</view>
+      </view>
+    </view>
+
+    <!-- 无效原因(无效状态) -->
+    <view v-if="couponInfo.useStatus === 7" class="mx24rpx mt20rpx rounded-16rpx bg-white px28rpx py32rpx">
+      <view class="mb20rpx text-30rpx font-semibold">
+        无效原因
+      </view>
+      <view class="mb16rpx flex items-center text-26rpx text-#ff4d3a">
+        <wd-icon name="info-circle" size="28rpx" color="#ff4d3a" class="mr8rpx" />
+        此券无法使用
+      </view>
+      <view class="text-26rpx text-#666">
+        原因:油站已下线
+      </view>
+    </view>
+
+    <!-- 使用规则卡片 -->
+    <view class="mx24rpx mt20rpx rounded-16rpx bg-white px28rpx py32rpx">
+      <view class="mb20rpx text-30rpx font-semibold">
+        使用规则
+      </view>
+      <view class="text-26rpx text-#666 leading-44rpx">
+        <view>·订单满{{ couponInfo.amountMoney }}元可用</view>
+        <view>·抵扣金额:{{ couponInfo.discountMoney }}元</view>
+        <view>·每单限用1张,不与其他优惠同享</view>
+        <view>·使用全部合作油站</view>
+        <view>·不支持部分特殊油站</view>
+      </view>
+    </view>
+
+    <!-- 状态说明卡片 -->
+    <view class="mx24rpx mt20rpx rounded-16rpx bg-white px28rpx py32rpx">
+      <view class="mb20rpx text-30rpx font-semibold">
+        状态说明
+      </view>
+      <view class="text-26rpx text-#666">
+        <template v-if="couponInfo.lockStatus === 1 && couponInfo.useStatus === 2">
+          此券已被当前订单占用,如需使用其他抵扣券,请先取消订单或完成支付
+        </template>
+        <template v-else-if="couponInfo.useStatus === 2">
+          当前状态正常,可在下单时使用
+        </template>
+        <template v-else-if="couponInfo.useStatus === 1">
+          此抵扣券已使用,您可以在活动期间关注新抵扣券
+        </template>
+        <template v-else-if="couponInfo.useStatus === 7">
+          此抵扣券因合作变动无法使用,您可以联系客服处理。
+        </template>
+        <template v-else>
+          此券当前不可用
+        </template>
+      </view>
+    </view>
+
+    <!-- 底部按钮 -->
+    <FixedLayout>
+      <!-- 可用状态 -->
+      <wd-button
+        v-if="couponInfo.useStatus === 2 && couponInfo.lockStatus !== 1"
+        block
+        size="large"
+        @click="handleUse"
+      >
+        去使用
+      </wd-button>
+
+      <!-- 已使用状态 -->
+      <wd-button
+        v-else-if="couponInfo.useStatus === 1"
+        block
+        size="large"
+        @click="handleViewOrder"
+      >
+        查看订单详情
+      </wd-button>
+
+      <!-- 已冻结状态 -->
+      <view v-else-if="couponInfo.lockStatus === 1 && couponInfo.useStatus === 2" class="flex items-center gap-24rpx">
+        <wd-button plain block size="large" custom-class="flex-1 cancel-btn" @click="handleCancelOrder">
+          取消订单
+        </wd-button>
+        <wd-button block size="large" custom-class="flex-1" @click="handlePay">
+          付款
+        </wd-button>
+      </view>
+
+      <!-- 无效状态 -->
+      <wd-button
+        v-else-if="couponInfo.useStatus === 7"
+        block
+        size="large"
+        @click="handleContact"
+      >
+        联系客服
+      </wd-button>
+    </FixedLayout>
+  </view>
+</template>
+
+<style lang="scss" scoped>
+:deep(.cancel-btn) {
+  border-color: var(--them-color) !important;
+  color: var(--them-color) !important;
+}
+</style>

+ 3 - 1
src/uni-pages.d.ts

@@ -10,9 +10,11 @@ interface NavigateToOptions {
        "/pages/exchangeFail/index" |
        "/pages/exchangeSuccess/index" |
        "/pages/login/index" |
+       "/pages/orderDetail/index" |
        "/pages/paySuccess/index" |
        "/pages/refuelDetaile/index" |
-       "/pages/transition/index";
+       "/pages/transition/index" |
+       "/pages/voucherDetail/index";
 }
 
 interface RedirectToOptions extends NavigateToOptions {}

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików