Browse Source

fix(env): 更新开发环境 API 地址及修复界面细节

- 更新 .env.development 中 VITE_API_BASE_URL,切换至新的代理地址
- 修改 manifest 配置和 manifest.json,更新应用名称为“市民请集合”
- 修正 tabbar 组件中属性绑定的格式错误
- 活动中心页面调整领取按钮为固定底部布局,优化体验
- 活动列表页面新增无活动时的提示组件
- 订单页面简化头部样式,移除多余类名
- 支付完成后跳转订单页逻辑调整,使用路由和 tabbar 联动方式
- 优化优惠券页面:
  - 增加未生效状态及对应标签和映射
  - 优化标签布局,调整默认当前标签
  - 状态显示改为映射名称,提升可读性
  - 使用路由跳转替代原有跳转方式,改进页面导航逻辑
zhangtao 5 ngày trước cách đây
mục cha
commit
73543e17aa

+ 2 - 1
.env.development

@@ -6,7 +6,8 @@
 # VITE_API_BASE_URL=http://192.168.0.11: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://7a8e0952.r28.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
manifest.config.ts

@@ -1,7 +1,7 @@
 import { defineManifestConfig } from '@uni-helper/vite-plugin-uni-manifest'
 
 export default defineManifestConfig({
-  'name': 'wot-starter',
+  'name': '市民请集合',
   'appid': '__UNI__1208592',
   'description': '',
   'versionName': '1.0.0',

+ 1 - 1
src/layouts/tabbar.vue

@@ -41,7 +41,7 @@ export default {
   >
     <wd-tabbar-item
       v-for="(item, index) in tabbarList" :key="index" :name="item.name"
-      :value="getTabbarItemValue(item.name)" :title=" item.title"
+      :value="getTabbarItemValue(item.name)" :title="item.title"
     >
       <template #icon="{ active }">
         <image v-if="active" :src="item.icon1" class="h44rpx w44rpx" />

+ 1 - 1
src/manifest.json

@@ -1,5 +1,5 @@
 {
-  "name": "wot-starter",
+  "name": "市民请集合",
   "appid": "__UNI__1208592",
   "description": "",
   "versionName": "1.0.0",

+ 10 - 10
src/pages/activityCenter/index.vue

@@ -138,19 +138,19 @@ function handleClaim() {
 
     <!-- 底部占位 -->
     <view class="h200rpx" />
+    <FixedLayout>
+      <wd-button
+        block
+        size="large"
+        :disabled="couponInfo?.receiveSign || activityStatus !== '进行中'"
+        @click="handleClaim"
+      >
+        {{ couponInfo?.receiveSign ? '已领取' : '立即领取' }}
+      </wd-button>
+    </FixedLayout>
   </view>
 
   <!-- 底部固定按钮 -->
-  <FixedLayout>
-    <wd-button
-      block
-      size="large"
-      :disabled="couponInfo?.receiveSign || activityStatus !== '进行中'"
-      @click="handleClaim"
-    >
-      {{ couponInfo?.receiveSign ? '已领取' : '立即领取' }}
-    </wd-button>
-  </FixedLayout>
 </template>
 
 <style lang="scss" scoped>

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

@@ -103,6 +103,7 @@ onReachBottom(() => {
         </wd-button>
       </view>
     </view>
+    <StatusTip v-if="!data.length" tip="暂无活动" />
   </view>
 </template>
 

+ 1 - 1
src/pages/order/index.vue

@@ -138,7 +138,7 @@ watch(() => currentTab.value, () => {
         class="mb20rpx rounded-16rpx bg-white px24rpx py28rpx"
       >
         <!-- 头部:油站名称 + 状态 -->
-        <view class="flex items-center justify-between">
+        <view class="flex justify-between">
           <view class="text-30rpx font-semibold">
             {{ item.brandName ? `${item.brandName}·` : '' }}{{ item.storeName }}
           </view>

+ 2 - 6
src/pages/transition/index.vue

@@ -13,12 +13,8 @@ definePage({
 const loading = ref(true)
 
 onLoad((options: any) => {
-  console.log(options, 'transition=========================================')
-
   const payStatus = Number(options.payStatus)
   const outerOrderId = options.outerOrderId || ''
-  useGlobalToast().show(options)
-
   // 延迟跳转,显示 loading 效果
   setTimeout(() => {
     loading.value = false
@@ -31,8 +27,8 @@ onLoad((options: any) => {
       })
     }
     else {
-      // 支付失败或其他情况,跳转订单列表
-      uni.switchTab({ url: '/pages/order/index' })
+      router.pushTab({ name: 'order' })
+      useTabbar().setTabbarItemActive('order')
     }
   }, 3000)
 })

+ 20 - 11
src/pages/voucher/index.vue

@@ -1,5 +1,6 @@
 <script setup lang="ts">
 import type { AppMemberCouponVO } from '@/api/globals'
+import router from '@/router'
 
 definePage({
   name: 'voucher',
@@ -15,11 +16,20 @@ const StaticUrl = import.meta.env.VITE_STATIC_BASE_URL
 
 // Tab 列表
 const tabList = ref([
-  { label: '可用', value: 0, count: 0 },
-  { label: '已使用', value: 1, count: 0 },
-  { label: '已过期', value: 2, count: 0 },
+  { label: '可用', value: 2 },
+  { label: '已使用', value: 1 },
+  { label: '已过期', value: 5 },
+  { label: '未生效', value: 7 },
+])
+const currentTab = ref(2)
+
+// 状态映射
+const statusMap = new Map([
+  [2, '可用'],
+  [1, '已使用'],
+  [5, '已过期'],
+  [7, '未生效'],
 ])
-const currentTab = ref(0)
 
 // 分页请求
 const { data, send, isLastPage, page } = usePagination(
@@ -43,10 +53,9 @@ function handleTabChange(value: number) {
   send()
 }
 
-// 去使用
 function handleUse(_item: AppMemberCouponVO) {
-  // TODO: 跳转到使用页面
-  uni.switchTab({ url: '/pages/index/index' })
+  router.pushTab({ name: 'home' })
+  useTabbar().setTabbarItemActive('home')
 }
 
 // 取消订单(占位)
@@ -91,7 +100,7 @@ watch(() => currentTab.value, () => {
 <template>
   <view class="min-h-100vh bg-#f5f5f5">
     <!-- Tab 切换 -->
-    <view class="sticky top-0 z-10 flex items-center bg-white px24rpx">
+    <view class="sticky top-0 z-10 flex items-center justify-between bg-white px24rpx">
       <view
         v-for="item in tabList"
         :key="item.value"
@@ -122,7 +131,7 @@ watch(() => currentTab.value, () => {
             </view>
           </view>
           <!-- 待支付倒计时 -->
-          <view v-if="item.lockStatus === 1 && currentTab === 0" class="text-24rpx text-#1890ff">
+          <view v-if="item.lockStatus === 1 && currentTab === 2" class="text-24rpx text-#1890ff">
             待支付(<wd-count-down :time="getCountdownTime(item.orderCreateTime)" format="还剩mm:ss" />)
           </view>
         </view>
@@ -140,11 +149,11 @@ watch(() => currentTab.value, () => {
           </text>
         </view>
         <view class="mt12rpx text-26rpx text-#999">
-          状态:{{ item.useStatus === 0 ? '可用' : item.useStatus === 1 ? '已使用' : '已过期' }}
+          状态:{{ statusMap.get(item.useStatus as number) || '' }}
         </view>
 
         <!-- 操作按钮区域 -->
-        <view v-if="currentTab === 0" class="mt20rpx">
+        <view v-if="currentTab === 2" class="mt20rpx">
           <!-- 未被锁定 - 显示去使用 -->
           <view v-if="item.lockStatus !== 1" class="flex justify-end">
             <wd-button size="small" plain custom-class="use-btn" @click="handleUse(item)">