Selaa lähdekoodia

feat(api): 添加订单售后状态字段

添加 refundStatus 字段用于标识售后状态,
2 表示退款已完成,便于前端控制申请售后按钮显示逻辑

fix(config): 更新开发环境API地址

将开发环境API地址从测试服务器切换到正式域名

refactor(index): 移除首页测试组件代码

移除首页中用于测试的酒店民宿、商品展示等临时组件代码

feat(after-sales): 完善售后流程跳转功能

- 引入路由模块实现页面跳转
- 修改退款申请接口返回类型为Promise<string>
- 修复接口响应数据解析问题,使用res.data获取正确数据
- 提交售后申请后跳转到售后详情页面并传递退款单号参数

refactor(after-sales-detail): 使用统一联系商家组件

替换原生contact按钮为Zcontact组件,保持界面一致性

fix(order): 优化售后申请条件判断

添加refundStatus !== 2 的条件判断,避免已退款完成的订单
重复显示申请售后按钮
zhangtao 3 päivää sitten
vanhempi
commit
7a9c7a2633

+ 5 - 0
src/api/api.type.d.ts

@@ -538,6 +538,11 @@ namespace Api {
     [property: string]: any
   }
   interface xsbOrderList {
+    /**
+     * 售后状态
+     * 2退款已完成
+     */
+    refundStatus?: number
     /**
      * 物流公司名称
      */

+ 2 - 2
src/config/index.ts

@@ -7,8 +7,8 @@ const mapEnvVersion = {
   // 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: 'https://smqjh.api.zswlgz.com',
+  // develop: 'http://47.109.84.152:8081',
+  develop: 'https://smqjh.api.zswlgz.com',
   /**
    * 体验版
    */

+ 0 - 149
src/pages/index/index.vue

@@ -238,155 +238,6 @@ function handleGo() {
                     </view>
                   </view>
                 </view>
-                <!-- <view class="overflow-hidden rounded-16rpx bg-white pb16rpx">
-                <view class="relative h344rpx">
-                  <image :src="`${VITE_OSS_BASE_URL}2025/11/8177f50dc5f040188dbd40149831273a.png`" class="h344rpx w344rpx" />
-                  <view class="absolute bottom-0 left-0 flex items-center text-22rpx">
-                    <view class="rounded-tl-8rpx bg-#FCD22B pl4rpx pr8rpx">
-                      酒店民宿
-                    </view>
-                    <view class="rounded-tr-8rpx bg-[rgba(0,0,0,0.5)] pl8rpx pr4rpx text-white">
-                      距您5km
-                    </view>
-                  </view>
-                </view>
-                <view class="mt16rpx pl20rpx pr6rpx">
-                  <view class="flex">
-                    <view class="h32rpx flex items-center rounded-8rpx bg-#FF4D3A px12rpx text-24rpx text-white">
-                      <image :src="`${VITE_OSS_BASE_URL}2025/11/3437d2a44ffe4238b827c5472019d323.png`" class="mr8rpx h18rpx w20rpx" /> 直播中
-                    </view>
-                    <view class="ml8rpx text-28rpx font-semibold">
-                      长白山雪景温
-                    </view>
-                  </view>
-                  <view class="ml12rpx text-28rpx font-semibold">
-                    泉度假酒店
-                  </view>
-                  <view class="mt20rpx flex items-end text-#FF4D3A">
-                    <view class="text-24rpx">
-                      ¥
-                    </view>
-                    <view class="text-36rpx line-height-[36rpx]">
-                      398
-                    </view>
-                    <view class="text-24rpx">
-                      元
-                    </view>
-                  </view>
-                </view>
-              </view>
-              <view class="overflow-hidden rounded-16rpx bg-white pb16rpx">
-                <view class="relative h344rpx">
-                  <image :src="`${VITE_OSS_BASE_URL}2025/11/04433c8d7186465d929a03d89a652caa.png`" class="h344rpx w344rpx" />
-                  <view class="absolute bottom-0 left-0 flex items-center text-22rpx">
-                    <view class="rounded-tl-8rpx bg-#006CE8 pl4rpx pr8rpx text-white">
-                      星闪豹
-                    </view>
-                    <view class="rounded-tr-8rpx bg-[rgba(0,0,0,0.5)] pl8rpx pr4rpx text-white">
-                      48分钟
-                    </view>
-                  </view>
-                </view>
-                <view class="mt16rpx pl20rpx pr6rpx">
-                  <view class="flex items-center">
-                    <view class="text-28rpx font-semibold">
-                      海湾高盐特大白虾200g
-                    </view>
-                  </view>
-                  <view class="mt20rpx flex items-center">
-                    <view class="flex items-end text-#FF4D3A">
-                      <view class="text-24rpx">
-                        ¥
-                      </view>
-                      <view class="text-36rpx line-height-[36rpx]">
-                        29
-                      </view>
-                      <view class="text-24rpx">
-                        元
-                      </view>
-                      <view class="ml10rpx text-24rpx text-#aaa line-through">
-                        ¥39
-                      </view>
-                    </view>
-                  </view>
-                </view>
-              </view>
-              <view class="overflow-hidden rounded-16rpx bg-white pb16rpx">
-                <view class="relative h344rpx">
-                  <image :src="`${VITE_OSS_BASE_URL}2025/11/4e2d6f2096a643f18fb9d11dee764509.png`" class="h344rpx w344rpx" />
-                  <view class="absolute bottom-0 left-0 flex items-center text-22rpx">
-                    <view class="rounded-tl-8rpx bg-#FF4D3A pl4rpx pr8rpx text-white">
-                      电影演出
-                    </view>
-                    <view class="rounded-tr-8rpx bg-[rgba(0,0,0,0.5)] pl8rpx pr4rpx text-white">
-                      评分8.9 1w+人想看
-                    </view>
-                  </view>
-                </view>
-                <view class="mt16rpx pl20rpx pr6rpx">
-                  <view class="flex items-center">
-                    <view class="rounded-8rpx bg-#FF4D3A px12rpx text-24rpx text-white">
-                      折扣大促
-                    </view>
-                    <view class="ml12rpx text-28rpx font-semibold">
-                      疯狂动物城2
-                    </view>
-                  </view>
-                  <view class="mt20rpx flex items-center">
-                    <view class="flex items-end text-#FF4D3A">
-                      <view class="text-24rpx">
-                        ¥
-                      </view>
-                      <view class="text-36rpx line-height-[36rpx]">
-                        19.9
-                      </view>
-                      <view class="text-24rpx">
-                        元
-                      </view>
-                      <view class="ml8rpx text-24rpx text-#aaa">
-                        起
-                      </view>
-                    </view>
-                  </view>
-                  <view class="mt16rpx text-24rpx text-#aaa">
-                    电影演出上新榜No.1
-                  </view>
-                </view>
-              </view>
-              <view class="overflow-hidden rounded-16rpx bg-white pb16rpx">
-                <view class="relative h344rpx">
-                  <image :src="`${VITE_OSS_BASE_URL}2025/11/52624954555942dbbbe8dabf872c29c4.png`" class="h344rpx w344rpx" />
-                  <view class="absolute bottom-0 left-0 flex items-center text-22rpx">
-                    <view class="rounded-tl-8rpx bg-#02ECFD pl4rpx pr8rpx">
-                      大牌点餐
-                    </view>
-                    <view class="rounded-tr-8rpx bg-[rgba(0,0,0,0.5)] pl8rpx pr4rpx text-white">
-                      距您1.2km
-                    </view>
-                  </view>
-                </view>
-                <view class="mt16rpx pl20rpx pr6rpx">
-                  <view class="flex items-center">
-                    <view class="truncate rounded-8rpx bg-#FF4D3A px12rpx text-nowrap text-24rpx text-white">
-                      折扣大促
-                    </view>
-                    <view class="ml12rpx truncate text-nowrap text-28rpx font-semibold">
-                      大堡口福三件套
-                    </view>
-                  </view>
-                  <view class="mt20rpx flex items-end text-#FF4D3A">
-                    <view class="text-24rpx">
-                      ¥
-                    </view>
-                    <view class="text-36rpx line-height-[36rpx]">
-                      22
-                    </view>
-                    <view class="text-24rpx">
-                      元
-                    </view>
-                  </view>
-                </view>
-              </view> -->
               </grid-view>
             </scroll-view>
           </view>

+ 6 - 3
src/subPack-common/afterSales/index.vue

@@ -1,4 +1,6 @@
 <script setup lang="ts">
+import router from '@/router'
+
 definePage({
   name: 'common-afterSales',
   islogin: true,
@@ -50,7 +52,8 @@ async function handleSubmit() {
   }
   isSubmit.value = true
   try {
-    await cathcApplRefund()
+    const res = await cathcApplRefund()
+    router.push({ name: 'common-afterSalesDetail', params: { refundNumber: res } })
     isSubmit.value = false
   }
   catch (e) {
@@ -60,7 +63,7 @@ async function handleSubmit() {
   // router.push({ name: 'common-afterSalesDetail' })
 }
 
-function cathcApplRefund() {
+function cathcApplRefund(): Promise<string> {
   uni.showLoading({ mask: true })
   return new Promise((resolve, reject) => {
     const filerData = orderList.value.filter(it => selectGoods.value.includes(Number(it.skuId)))
@@ -80,7 +83,7 @@ function cathcApplRefund() {
           }
         }),
       },
-    }).then((res) => { resolve(res) }).catch((err) => {
+    }).then((res) => { resolve(res.data) }).catch((err) => {
       reject(err)
     }).finally(() => { uni.hideLoading() })
   })

+ 3 - 3
src/subPack-common/afterSalesDetail/index.vue

@@ -150,11 +150,11 @@ async function handleCancel() {
         </view>
         <view class="contact relative flex flex-col items-center">
           <image :src="`${StaticUrl}/orderDetaile-wx.png`" class="h40rpx w40rpx" />
-          <button open-type="contact" class="zbutton mt40rpx">
-            <view class="text-28rpx">
+          <Zcontact>
+            <view class="mt40rpx text-28rpx">
               联系商家
             </view>
-          </button>
+          </Zcontact>
         </view>
       </view>
     </view>

+ 1 - 1
src/subPack-smqjh/order/index.vue

@@ -216,7 +216,7 @@ async function handleAfterSale(item: Api.xsbOrderList) {
               </wd-button>
             </view>
           </template>
-          <template v-if="[subPackOrder?.OrderStatus.OrderCompleted, subPackOrder?.OrderStatus.OrderWaitDelivery, subPackOrder?.OrderStatus.OrderAccepted].includes(item.hbOrderStatus) ">
+          <template v-if="item.refundStatus != 2 && [subPackOrder?.OrderStatus.OrderCompleted, subPackOrder?.OrderStatus.OrderWaitDelivery, subPackOrder?.OrderStatus.OrderAccepted].includes(item.hbOrderStatus) ">
             <view class="mr20rpx">
               <wd-button size="small" plain type="info" @click.stop="handleAfterSale(item)">
                 申请售后

+ 1 - 1
src/subPack-xsb/order/index.vue

@@ -199,7 +199,7 @@ async function handleAfterSale(item: Api.xsbOrderList) {
               </wd-button>
             </view>
           </template>
-          <template v-if="[OrderStatus.OrderCompleted, OrderStatus.OrderWaitDelivery, OrderStatus.OrderAccepted].includes(item.hbOrderStatus) ">
+          <template v-if="item.refundStatus != 2 && [OrderStatus.OrderCompleted, OrderStatus.OrderWaitDelivery, OrderStatus.OrderAccepted].includes(item.hbOrderStatus) ">
             <view class="mr20rpx">
               <wd-button size="small" plain type="info" @click.stop="handleAfterSale(item)">
                 申请售后