Forráskód Böngészése

```
fix(config): 注释部分开发环境配置并启用新的IP地址

- 注释掉 'http://192.168.0.157:8080' 的配置
- 启用 'http://47.109.84.152:8081' 的配置
- 调整开发环境IP配置以适配新的服务地址

fix(my): 调整客服按钮样式并添加订单页面样式

- 为客服按钮添加 w80% 宽度类
- 添加 wd-cell__right 样式规则以设置固定宽度
- 统一客服按钮样式在各个页面中的表现

feat(order): 优化订单页面功能和样式调整

- 修改 usePagination 配置,将 immediate 设置为 false
- 添加 onShow 钩子,页面显示时刷新订单列表
- 将 refresh 方法替换为 reload 方法以正确更新数据
- 格式化代码缩进和换行,提升代码可读性
- 修复订单状态显示逻辑,添加倒计时功能
- 修复按钮点击事件冒泡问题,添加 @click.stop 修饰符
- 修复模板标签拼写错误 templpate -> template
- 添加倒计时样式定制

fix(commonTab): 调整客服按钮宽度和样式优化

- 为客服按钮添加 w90% 宽度类
- 添加 wd-cell__right 样式规则到相关组件

refactor(commonTab): 优化组件属性格式化

- 格式化 indexHome 组件属性换行
- 格式化 wd-tabbar 组件属性换行
- 提升代码可读性和维护性

fix(xsbOrder): 优化订单页面数据刷新机制

- 修改 usePagination 配置,将 immediate 设置为 false
- 添加 onShow 钩子,页面显示时刷新订单列表
- 将 refresh 方法替换为 reload 方法以正确更新数据
- 保持订单操作后数据同步的一致性
```

zhangtao 2 napja
szülő
commit
1f8caedf52

+ 2 - 2
src/config/index.ts

@@ -13,10 +13,10 @@ const mapEnvVersion = {
    */
   // develop: 'http://192.168.1.166:8080', // 张
   // develop: 'http://192.168.1.101:8080',
-  develop: 'http://192.168.0.157:8080',
+  // develop: 'http://192.168.0.157:8080',
   // develop: 'http://192.168.1.253:8080',
   // develop: 'http://192.168.1.89:8080', // 田
-  // develop: 'http://47.109.84.152:8081',
+  develop: 'http://47.109.84.152:8081',
   // develop: 'https://smqjh.api.zswlgz.com',
   /**
    * 体验版

+ 5 - 1
src/pages/my/index.vue

@@ -122,7 +122,7 @@ function handleGo(item: { name: string }) {
               <image :src="`${StaticUrl}/5.png`" class="h50rpx w50rpx" />
             </template>
             <template #title>
-              <button class="zbutton ml20rpx" open-type="contact">
+              <button class="zbutton ml20rpx w80%" open-type="contact">
                 联系平台客服
               </button>
             </template>
@@ -182,6 +182,10 @@ function handleGo(item: { name: string }) {
       overflow: hidden;
       border-radius: 12rpx;
     }
+    .wd-cell__right{
+      width: 60rpx !important;
+      flex: unset !important;
+    }
   }
 }
 </style>

+ 45 - 20
src/subPack-smqjh/order/index.vue

@@ -16,13 +16,15 @@ const subPackComfirm = ref()
 const navActiveTab = ref(0)
 const scrollViewId = ref()
 const orderStatusActive = ref('all')
-const { data: orderList, refresh, isLastPage, page, reload } = usePagination((pageNum, pageSize) => Apis.xsb.orderList({ data: {
-  businessType: 'XSB',
-  orderStatus: unref(orderStatusActive),
-  pageNum,
-  pageSize,
-} }), {
-  immediate: true,
+const { data: orderList, refresh, isLastPage, page, reload } = usePagination((pageNum, pageSize) => Apis.xsb.orderList({
+  data: {
+    businessType: 'XSB',
+    orderStatus: unref(orderStatusActive),
+    pageNum,
+    pageSize,
+  },
+}), {
+  immediate: false,
   pageNum: 1,
   pageSize: 10,
   initialData: [],
@@ -39,6 +41,9 @@ function handleChangeTypeNav(value: number) {
   nextTick(() => scrollViewId.value = value)
   reload()
 }
+onShow(() => {
+  refresh()
+})
 function handleChangeStatus(value: string) {
   orderStatusActive.value = value
   reload()
@@ -54,7 +59,7 @@ onReachBottom(() => {
 })
 async function handleCancel(order: Api.xsbOrderList) {
   await subPackOrder.value.handleCommonCancelOrder(order)
-  refresh()
+  reload()
 }
 async function handlePay(orderNumber: string) {
   const res = await subPackComfirm.value.handleCommonPayMent(orderNumber)
@@ -62,23 +67,26 @@ async function handlePay(orderNumber: string) {
     await subPackComfirm.value.getWxCommonPayment(res)
   }
   else {
-    refresh()
+    reload()
   }
 }
 async function handleSubmitOrder(order: Api.xsbOrderList) {
   await subPackOrder.value.handleCommonOrderReceive(order)
-  refresh()
+  reload()
 }
 </script>
 
 <template>
   <view class="page-smqjh">
     <view class="nav sticky top-0 z-10 bg-white px24rpx py18rpx">
-      <scroll-view scroll-x class="whitespace-nowrap" :scroll-into-view="`id-${scrollViewId}`" :scroll-into-view-offset="-150" scroll-with-animation enable-passive>
+      <scroll-view
+        scroll-x class="whitespace-nowrap" :scroll-into-view="`id-${scrollViewId}`"
+        :scroll-into-view-offset="-150" scroll-with-animation enable-passive
+      >
         <view class="flex items-center">
           <view
-            v-for="item in navTabTypeList"
-            :id="`id-${item.value}`" :key="item.value" class="mr64rpx flex flex-col items-center whitespace-nowrap text-32rpx"
+            v-for="item in navTabTypeList" :id="`id-${item.value}`" :key="item.value"
+            class="mr64rpx flex flex-col items-center whitespace-nowrap text-32rpx"
             :class="[navActiveTab == item.value ? 'font-semibold ' : 'text-#AAAAAA']"
             @click="handleChangeTypeNav(item.value)"
           >
@@ -102,7 +110,7 @@ async function handleSubmitOrder(order: Api.xsbOrderList) {
       </view>
     </view>
     <view class="px24rpx">
-      <view v-for="item in orderList" :key="item.orderNumber" class="mt20rpx rounded-16rpx bg-white p24rpx" @click="handleClick(item.orderNumber as string)">
+      <view v-for="item in orderList" :key="item.orderNumber" class="mt20rpx rounded-16rpx bg-white p24rpx">
         <view class="flex items-center justify-between">
           <view class="flex items-center">
             <image :src="`${StaticUrl}/order-icon.png`" class="h36rpx w36rpx" />
@@ -111,7 +119,14 @@ async function handleSubmitOrder(order: Api.xsbOrderList) {
             </view>
           </view>
           <view class="text-24rpx text-#FF4D3A">
-            {{ subPackOrder?.handleCommonOrderStatusText(item) }}
+            <template v-if="item.hbOrderStatus !== subPackOrder.OrderStatus.PaddingPay">
+              {{ subPackOrder?.handleCommonOrderStatusText(item) }}
+            </template>
+            <template v-else>
+              <view class="flex items-center">
+                待支付( 还剩 <wd-count-down :time="subPackOrder?.handleCommonOrderStatusText(item)" @finish="refresh" /> )
+              </view>
+            </template>
           </view>
         </view>
         <view class="my24rpx h2rpx w-full bg-#F0F0F0" />
@@ -130,7 +145,10 @@ async function handleSubmitOrder(order: Api.xsbOrderList) {
               2025-03-26 11:56:07
             </view>
           </view> -->
-          <view class="box-border h176rpx w-full flex items-center justify-between rounded-16rpx bg-#F9F9F9">
+          <view
+            class="box-border h176rpx w-full flex items-center justify-between rounded-16rpx bg-#F9F9F9"
+            @click="handleClick(item.orderNumber as string)"
+          >
             <view class="box-border h-full w480rpx py28rpx pl20rpx">
               <scroll-view scroll-x class="h-full w-full whitespace-nowrap">
                 <view class="flex items-center">
@@ -151,8 +169,8 @@ async function handleSubmitOrder(order: Api.xsbOrderList) {
           </view>
         </view>
         <view class="my24rpx flex items-center justify-end">
-          <templpate v-if="item.hbOrderStatus === subPackOrder?.OrderStatus.PaddingPay">
-            <wd-button size="small" plain type="info" @click="handleCancel">
+          <template v-if="item.hbOrderStatus === subPackOrder?.OrderStatus.PaddingPay">
+            <wd-button size="small" plain type="info" @click.stop="handleCancel">
               取消订单
             </wd-button>
             <view class="ml20rpx">
@@ -160,7 +178,7 @@ async function handleSubmitOrder(order: Api.xsbOrderList) {
                 付款
               </wd-button>
             </view>
-          </templpate>
+          </template>
           <template v-if="item.hbOrderStatus === subPackOrder?.OrderStatus.OrderArrived">
             <wd-button size="small" plain type="info" @click.stop="handleSubmitOrder(item)">
               确认收货
@@ -180,9 +198,16 @@ async function handleSubmitOrder(order: Api.xsbOrderList) {
     .wd-button.is-plain.is-error {
       color: #FF4D3A !important;
     }
-    .wd-tabs__nav-item-text{
+
+    .wd-tabs__nav-item-text {
       font-size: 28rpx !important;
     }
+
+    .wd-count-down {
+      color: #FF4D3A;
+      font-size: 700 !important;
+      line-height: unset !important;
+    }
   }
 
   .box-shadow {

+ 1 - 1
src/subPack-xsb/commonTab/components/my.vue

@@ -109,7 +109,7 @@ function handleGo(item: { name: string }) {
               <image :src="`${StaticUrl}/5.png`" class="h50rpx w50rpx" />
             </template>
             <template #title>
-              <button class="zbutton ml20rpx" open-type="contact">
+              <button class="zbutton ml20rpx w90%" open-type="contact">
                 联系平台客服
               </button>
             </template>

+ 10 - 14
src/subPack-xsb/commonTab/index.vue

@@ -128,27 +128,18 @@ function handleChange(name: string) {
 <template>
   <view class="page-xsb">
     <indexHome
-      v-if="tabbarName == 'xsb-home'" :category-list="commonCategoryData"
-      :swiper="swiperList"
-      :hot-text="hotText"
-      :recommend-text="recommendText"
-      :loading="loading"
-      :goods-list="goodsList"
-      :last-page="isLastPage"
-      :error="error"
-      @change-nav="handleChange('xsb-classfiy')"
+      v-if="tabbarName == 'xsb-home'" :category-list="commonCategoryData" :swiper="swiperList"
+      :hot-text="hotText" :recommend-text="recommendText" :loading="loading" :goods-list="goodsList"
+      :last-page="isLastPage" :error="error" @change-nav="handleChange('xsb-classfiy')"
       @scroll-bottom="handleScrollBottom"
     />
     <cart v-if="tabbarName == 'xsb-cart'" @change-tab="handleChange('xsb-home')" />
     <classfiy v-if="tabbarName == 'xsb-classfiy'" :category-list="commonCategoryData" :hot-text="hotText" />
     <my v-if="tabbarName == 'xsb-my'" />
     <wd-tabbar
-      v-model="tabbarName"
-      safe-area-inset-bottom placeholder fixed :bordered="false"
-      custom-class="custom-tab"
+      v-model="tabbarName" safe-area-inset-bottom placeholder fixed :bordered="false" custom-class="custom-tab"
       :custom-style="`box-shadow:${tabbarName == 'xsb-cart' || tabbarName == 'xsb-classfiy' ? '' : ' 0rpx -6rpx 12rpx 2rpx rgba(0, 0, 0, 0.09)'}`"
-      :z-index="99999"
-      @change="handleTabbarChange"
+      :z-index="99999" @change="handleTabbarChange"
     >
       <wd-tabbar-item
         v-for="(item, index) in tabbarItems" :key="index" :name="item.name"
@@ -194,6 +185,11 @@ function handleChange(name: string) {
         overflow: hidden;
         border-radius: 12rpx;
       }
+
+      .wd-cell__right {
+        width: 60rpx !important;
+        flex: unset !important;
+      }
     }
   }
 

+ 9 - 5
src/subPack-xsb/order/index.vue

@@ -22,7 +22,7 @@ const { data: orderList, refresh, isLastPage, page, reload } = usePagination((pa
   pageSize,
   dvyType: unref(navActiveTab) === 0 ? '' : unref(navActiveTab),
 } }), {
-  immediate: true,
+  immediate: false,
   pageNum: 1,
   pageSize: 10,
   initialData: [],
@@ -45,26 +45,30 @@ onReachBottom(() => {
     page.value++
   }
 })
+onShow(() => {
+  refresh()
+})
+
 async function handlePay(orderNumber: string) {
   const res = await handleCommonPayMent(orderNumber)
   if (res.payType !== 1) {
     await getWxCommonPayment(res)
   }
   else {
-    refresh()
+    reload()
   }
 }
 async function handleCancel(order: Api.xsbOrderList) {
   await handleCommonCancelOrder(order)
-  refresh()
+  reload()
 }
 async function handleDel(order: Api.xsbOrderList) {
   await handleCommonDeleteOrder(order)
-  refresh()
+  reload()
 }
 async function handleSubmitOrder(order: Api.xsbOrderList) {
   await handleCommonOrderReceive(order)
-  refresh()
+  reload()
 }
 </script>