Эх сурвалжийг харах

```
feat: 新增充电功能子包并完善售后流程

- 新增 src/subPack-charge 子包,包含搜索组件和首页
- 添加充电功能导航入口,修改首页网格布局逻辑
- 完善售后流程,添加退款状态字段和相关业务逻辑
- 配置物流插件和支付功能优化
- 调整开发环境API地址配置

BREAKING CHANGE: 售后流程跳转方式发生改变,需重新测试
```

wenjie 2 долоо хоног өмнө
parent
commit
a97e61f19b

+ 4 - 1
pages.config.ts

@@ -1,7 +1,9 @@
 import { defineUniPages } from '@uni-helper/vite-plugin-uni-pages'
 
 export default defineUniPages({
-  pages: [],
+  pages: [
+
+  ],
   globalStyle: {
     // 导航栏配置
     navigationBarBackgroundColor: '@navBgColor',
@@ -22,6 +24,7 @@ export default defineUniPages({
     animationType: 'pop-in',
     animationDuration: 300,
   },
+
   tabBar: {
     custom: true,
     // #ifdef MP-ALIPAY

+ 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',
   /**
    * 体验版
    */

+ 22 - 0
src/pages.json

@@ -148,6 +148,12 @@
           "style": {
             "navigationBarTitleText": "订单详情",
             "navigationStyle": "custom"
+          },
+          "plugins": {
+            "logisticsPlugin": {
+              "version": "2.1.12",
+              "provider": "wx9ad912bf20548d92"
+            }
           }
         },
         {
@@ -306,6 +312,22 @@
           }
         }
       ]
+    },
+    {
+      "root": "subPack-charge",
+      "pages": [
+        {
+          "path": "index/index",
+          "type": "page",
+          "name": "charge-index",
+          "islogin": false,
+          "style": {
+            "navigationStyle": "custom",
+            "navigationBarTitleText": "",
+            "backgroundColorBottom": "#fff"
+          }
+        }
+      ]
     }
   ]
 }

+ 2 - 151
src/pages/index/index.vue

@@ -55,7 +55,7 @@ onReachBottom(() => {
 const navList = computed(() => {
   const list = [
     { icon: `${StaticUrl}/xsb.png`, title: '星闪豹', name: 'xsb-homeTabbar', show: true },
-    { icon: `${StaticUrl}/smqjh-index-cd.png`, title: '充电', name: '', show: !isOnlineAudit.value },
+    { icon: `${StaticUrl}/smqjh-index-cd.png`, title: '充电', name: 'charge-index', show: true }, // !isOnlineAudit.value
     { icon: `${StaticUrl}/smqjh-sp.png`, title: '电影演出', name: '', show: !isOnlineAudit.value },
     { icon: `${StaticUrl}/smqjh-vip.png`, title: '视频权益', name: '', show: !isOnlineAudit.value },
     { icon: `${StaticUrl}/smqjh-diancan.png`, title: '大牌点餐', name: '', show: !isOnlineAudit.value },
@@ -159,7 +159,7 @@ function handleGo() {
                 <view class="relative h120rpx w120rpx">
                   <image :src="item.icon" class="h120rpx w120rpx" />
                   <view
-                    v-if="item.title != '星闪豹'"
+                    v-if="item.name == ''"
                     class="linebg absolute left-0 top-0 h-full w-full flex items-center justify-center rounded-32rpx text-24rpx text-white font-semibold"
                   >
                     敬请期待
@@ -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>

+ 52 - 0
src/subPack-charge/components/search.vue

@@ -0,0 +1,52 @@
+<script lang="ts" setup>
+import { ref } from 'vue'
+import { StaticUrl } from '@/config'
+// 如果需要从外部传入动态文本,可以使用 props
+defineProps<{
+  initialMapModeText?: string
+}>()
+// 如果需要从外部传入点击事件处理方法,也可以定义 emit
+defineEmits<{
+  (e: 'mapModeClick'): void
+}>()
+// 定义动态文本
+const mapModeText = ref('地图模式')
+// 定义点击事件处理方法
+function onMapModeClick() {
+  // 在这里添加点击逻辑
+  console.log('地图模式被点击')
+  // 示例:切换显示文本
+  // mapModeText.value = mapModeText.value === '地图模式' ? '列表模式' : '地图模式'
+}
+</script>
+
+<template>
+  <view class="flex items-center justify-between">
+    <view class="search-box flex items-center">
+      <view class="mr-16rpx flex items-center">
+        <image :src="`${StaticUrl}/location-black.png`" class="h33.8rpx min-w28.97rpx w28.97rpx" />
+        <text class="ml-1">
+          贵阳
+        </text>
+      </view>
+      <view class="h-36rpx border-2rpx border-#AAAAAA border-solid" />
+      <view class="ml-16rpx text-#AAAAAA">
+        请输入目的地/电站名
+      </view>
+    </view>
+    <view class="search-box flex items-center gap-20rpx" @click="onMapModeClick">
+      <image :src="`${StaticUrl}/charge-map.png`" class="h-40rpx w-40rpx" mode="" />
+      <text>
+        {{ mapModeText }}
+      </text>
+    </view>
+  </view>
+</template>
+
+<style scoped lang="scss">
+.search-box{
+background: rgba(255, 255, 255, 0.7);
+border-radius: 16rpx;
+padding: 10rpx 20rpx;
+}
+</style>

+ 52 - 0
src/subPack-charge/index/index.vue

@@ -0,0 +1,52 @@
+<script setup lang="ts">
+import charge from '../components/search.vue'
+import router from '@/router'
+import { StaticUrl } from '@/config'
+
+const { statusBarHeight, MenuButtonHeight, opcity, userInfo } = storeToRefs(useSysStore())
+definePage({
+  name: 'charge-index',
+  islogin: false,
+  style: {
+    navigationStyle: 'custom',
+    navigationBarTitleText: '',
+    backgroundColorBottom: '#fff',
+  },
+})
+</script>
+
+<template>
+  <view class="min-h-screen from-[#E2FF91] to-[rgba(158,214,5,0)] bg-gradient-to-b">
+    <wd-navbar
+      title="" :custom-style="`background-color: rgba(226, 255, 145, ${opcity})`" :bordered="false" :z-index="99"
+      safe-area-inset-top left-arrow fixed @click-left="router.back()"
+    >
+      <template #left>
+        <view class="flex items-center">
+          <wd-icon name="arrow-left" size="22px" color="#000" />
+          <view class="relative z-10 h62rpx w-full w180rpx opacity-100">
+            <image class="absolute left-0 top-0 h62rpx w180rpx" :src="`${StaticUrl}/charge-logo.png`" />
+          </view>
+        </view>
+      </template>
+    </wd-navbar>
+    <view :style="{ paddingTop: `${(Number(statusBarHeight) || 44) + MenuButtonHeight + 12}px` }" class="px24rpx">
+      <charge />
+      <view>
+        <view>
+          <image
+            class="h-100rpx w-100rpx"
+            :src="`${userInfo && userInfo?.avatarUrl ? userInfo.avatarUrl : `${StaticUrl}/charge-default-avatar.png`}`"
+          />
+          <view>
+            <view>游客</view>
+            <view>授权登录</view>
+          </view>
+        </view>
+      </view>
+    </view>
+  </view>
+</template>
+
+<style scoped lang="scss">
+</style>

+ 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() })
   })

+ 9 - 5
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>
@@ -214,12 +214,16 @@ async function handleCancel() {
               <view class="text-24rpx text-#AAAAAA">
                 单价:¥{{ item.skuPrice }}
               </view>
+              <view class="text-24rpx text-#AAAAAA">
+                数量:{{ item.productCount }}
+              </view>
             </view>
           </view>
           <view class="mt24rpx h2rpx w-full bg-#F0F0F0" />
         </view>
       </CollapsePanel>
-
+    </view>
+    <view class="mt20rpx rounded-16rpx bg-white p24rpx">
       <view class="mt24rpx flex items-center justify-between">
         <view class="text-28rpx">
           商品金额
@@ -233,7 +237,7 @@ async function handleCancel() {
           配送费({{ refundOrderInfo.omsOrderVo.dvyType == 1 ? '快递' : '即时配送' }})
         </view>
         <view class="text-#FF4A39 font-semibold">
-          ¥{{ refundOrderInfo.omsOrderVo.freightAmount }}
+          ¥{{ refundOrderInfo.freightAmount }}
         </view>
       </view>
       <view class="mt24rpx flex items-center justify-between">

+ 1 - 1
src/subPack-common/afterSalesList/index.vue

@@ -65,7 +65,7 @@ async function handleCancel(item: Api.AppRefundOrderListVo) {
               ¥{{ item.refundProdMoney }}
             </view>
             <view class="text-center text-28rpx text-#AAAAAA">
-              共{{ item.refundProdList?.length }}件
+              共{{ item.refundProdNumber }}件
             </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)">
                 申请售后

+ 9 - 1
src/subPack-xsb/commonTab/components/classfiy.vue

@@ -182,6 +182,7 @@ async function handleSubCart(event: WechatMiniprogram.TouchEvent, item: Api.xsbC
         await useSmqjhCartStore().addCart(item.skuList[0].skuId, -1, Number(item.shopId), 'XSB')
         await getCartCategorList()
         setProductNum()
+        totalProduct.value = undefined
       },
     })
   }
@@ -540,7 +541,14 @@ function handlePay() {
                     </view>
                   </view>
                 </view>
-              </view>
+                <view v-if="!item.skuList.some((it) => it.saleStatus)" class="absolute left-0 top-0 z-1 h-full w-full flex items-center bg-[rgba(255,255,255,.6)]">
+                  <view class="h172rpx w172rpx flex items-center justify-center">
+                    <view class="h36rpx w112rpx flex items-center justify-center rounded-16rpx bg-[rgba(0,0,0,.6)] text-28rpx text-white">
+                      不可售
+                    </view>
+                  </view>
+                </view>
+              </view>.
             </view>
             <wd-status-tip v-else image="content" tip="暂无内容" />
             <view v-if="goodsLoading == 'finished' || isTopLoading" class="h-40vh" />

+ 5 - 0
src/subPack-xsb/components/goodsItem/index.vue

@@ -47,6 +47,11 @@ defineProps<{ itemGoods: Api.xsbCategoryProductList }>()
         商品已售罄
       </view>
     </view>
+    <view v-if="!itemGoods.skuList.some((it) => it.saleStatus)" class="mask absolute left-0 top-0 z-1 h-full w-full flex items-center justify-center">
+      <view class="h156rpx w156rpx flex items-center justify-center rounded-full bg-[rgba(0,0,0,.6)] text-28rpx text-white">
+        商品不可售
+      </view>
+    </view>
   </view>
 </template>
 

+ 1 - 2
src/subPack-xsb/confirmOrder/index.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { clearCart, getOrderPayMent, getWxCommonPayment, handleCommonPayMent, payError, paySuccess } from '../utils/confirm-order'
+import { clearCart, getOrderPayMent, getWxCommonPayment, handleCommonPayMent, paySuccess } from '../utils/confirm-order'
 import router from '@/router'
 
 definePage({
@@ -80,7 +80,6 @@ async function handlePay() {
     }
   }
   catch {
-    await payError()
     isPay.value = false
   }
 }

+ 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)">
                 申请售后

+ 8 - 0
src/subPack-xsb/orderDetaile/index.vue

@@ -15,6 +15,14 @@ definePage({
     navigationBarTitleText: '订单详情',
     navigationStyle: 'custom',
   },
+
+  plugins: {
+    logisticsPlugin: {
+      version: '2.1.12',
+      provider: 'wx9ad912bf20548d92',
+    },
+  },
+
 })
 const collapse = ref(true)
 const orderInfo = ref<Api.xsbOrderList>()

+ 5 - 0
src/subPack-xsb/search/index.vue

@@ -170,6 +170,11 @@ function handleSearchText(text: string) {
             商品已售罄
           </view>
         </view>
+        <view v-if="!item.skuList.some((it) => it.saleStatus)" class="absolute left-0 top-0 z10 h-full w-full flex items-center justify-center bg-[rgba(255,255,255,0.6)]">
+          <view class="flex items-center justify-center rounded-16rpx bg-[rgba(0,0,0,.6)] p8rpx text-28rpx text-white">
+            商品不可售
+          </view>
+        </view>
       </view>
       <wd-loadmore v-if="data.length" :state="state" :loading-props="{ color: '#9ED605', size: 20 }" />
       <wd-status-tip v-if="!data.length" image="search" tip="当前搜索无结果" />

+ 1 - 0
vite.config.ts

@@ -28,6 +28,7 @@ export default async () => {
           'src/subPack-common',
           'src/subPack-smqjh',
           'src/subPack-film',
+          'src/subPack-charge',
         ],
         /**
          * 排除的页面,相对于 dir 和 subPackages