Răsfoiți Sursa

feat(afterSales): 增加退货物流信息提交功能

- 在apiDefinitions.ts中新增提交退货物流的接口定义
- 在afterSalesDetail页新增物流方式选择及快递单号输入功能
- 实现退货物流信息的提交与回显逻辑
- 优化afterSales页面的退货商品选择逻辑,禁用不可退货商品选择
- 调整积分页面,新增积分有效期弹窗展示
- 配置文件调整测试代理地址,修改部分接口调用配置
- 页面样式微调,修复样式冲突和组件禁用状态控制
- 优化页面参数打印与路由跳转样式配置
zouzexu 2 zile în urmă
părinte
comite
39e8aa5044

+ 1 - 0
src/api/apiDefinitions.ts

@@ -69,6 +69,7 @@ export default {
   'xsb.refundList':['POST', '/smqjh-oms/app-api/v1/refund/findList'],
   'xsb.refundCancel':['GET', '/smqjh-oms/app-api/v1/refund/cancel'],
   'xsb.refundDetails':['GET', '/smqjh-oms/app-api/v1/refund/findByDetails'],
+  'xsb.submitRefundLogistics':['POST', '/smqjh-oms/app-api/v1/refund/saveRefundAddress'],
   'xsb.popupConfig':['GET', '/smqjh-system/app-api/v1/appAdvertInfo/popupConfig'],
   'xsb.memberCouponPage':['GET', '/smqjh-system/app-api/memberCoupon/getPageList'],
   'xsb.orderCoupons':['GET', '/smqjh-oms/api/v1/order/orderCoupons'],

+ 14 - 0
src/api/globals.d.ts

@@ -326,6 +326,20 @@ declare global {
       >(
         config: Config
       ): Alova2Method<apiResData<Api.xsbOmsOrderItem[]>, 'xsb.findByOrderNumber', Config>;
+      submitRefundLogistics<
+        Config extends Alova2MethodConfig<apiResData<any>> & {
+          data: {
+            /** 退款订单编号 */
+            refundNumber: string;
+            /** 退货方式 0-快递寄送 1-自己配送 */
+            refundLogisticsType: number;
+            /** 快递单号 */
+            trackingNumber?: string;
+          };
+        }
+      >(
+        config: Config
+      ): Alova2Method<apiResData<any>, 'xsb.submitRefundLogistics', Config>;
       deliveryNode<
         Config extends Alova2MethodConfig<apiResData<Api.DeliveryNode[]>> & {
           data: {

+ 2 - 2
src/config/index.ts

@@ -11,10 +11,10 @@ const mapEnvVersion = {
   // develop: 'http://192.168.0.11:8081', // 王
   // develop: 'http://192.168.1.21:8080', // 田
   // develop: 'http://74949mkfh190.vicp.fun', // 付
-  // develop: 'http://47.109.84.152:8081', // 测试代理
+  develop: 'http://47.109.84.152:8081', // 测试代理
   // develop: 'https://5ed0f7cc.r9.vip.cpolar.cn',
   // develop: 'https://25740642.r3.cpolar.top',
-  develop: 'https://smqjh.api.zswlgz.com',
+  // develop: 'https://smqjh.api.zswlgz.com',
   /**
    * 体验版
    */

+ 4 - 2
src/pages.json

@@ -39,7 +39,8 @@
       "name": "smqjh-login",
       "islogin": false,
       "style": {
-        "navigationBarTitleText": "市民请集合"
+        "navigationBarTitleText": "市民请集合",
+        "navigationStyle": "custom"
       }
     },
     {
@@ -278,7 +279,8 @@
           "name": "smqjh-threePay",
           "islogin": false,
           "style": {
-            "navigationBarTitleText": "支付"
+            "navigationBarTitleText": "支付",
+            "navigationStyle": "custom"
           }
         },
         {

+ 1 - 0
src/subPack-attractions/attractionsReservation/attractionsReservation.vue

@@ -16,6 +16,7 @@ const selectDate = ref('')
 const isSingle = ref()
 const price = ref(0)
 onLoad((options: any) => {
+  console.log('====页面携带参数====', options)
   productNo.value = Number(options.productNo) || 0
   productName.value = options.productName || ''
   selectDate.value = options.selectDate || ''

+ 9 - 8
src/subPack-common/afterSales/index.vue

@@ -98,7 +98,8 @@ function handleSelectReson() {
 
 function handleSelectGoods() {
   console.log(orderList.value, 'orderList', selectGoods.value)
-  if (selectGoods.value.length === orderList.value.length) {
+  const refundableCount = orderList.value.filter(it => it.prodCount! > 0).length
+  if (selectGoods.value.length === refundableCount) {
     isSeletAllGoods.value = true
   }
   else {
@@ -109,7 +110,7 @@ function handleSelectGoods() {
 function handleChangeAll() {
   console.log(isSeletAllGoods.value, 'isSeletAllGoods')
   if (isSeletAllGoods.value) {
-    selectGoods.value = orderList.value.map(it => it.skuId) as number[]
+    selectGoods.value = orderList.value.filter(it => it.prodCount! > 0).map(it => it.skuId) as number[]
   }
   else {
     selectGoods.value = []
@@ -167,18 +168,18 @@ function handleChangeMoney() {
               </view>
             </view>
           </wd-radio>
-          <!-- <view class="mt24rpx">
+          <view class="mt24rpx">
             <wd-radio :value="2">
               <view>
                 <view class="text-left text-28rpx font-semibold">
                   我要退货退款
                 </view>
                 <view class="mt16rpx text-24rpx text-#AAAAAA">
-                  已收到货,需要退还已收到的商品
+                  已收到货,与商家协商后退货退款
                 </view>
               </view>
             </wd-radio>
-          </view> -->
+          </view>
         </wd-radio-group>
       </view>
       <view class="mt20rpx rounded-16rpx bg-white px24rpx py28rpx">
@@ -200,8 +201,8 @@ function handleChangeMoney() {
           <CollapsePanel :line-height="150">
             <wd-checkbox-group v-model="selectGoods" @change="handleSelectGoods">
               <template v-for="item in orderList" :key="item.skuId">
-                <view class="flex items-center justify-between">
-                  <wd-checkbox :model-value="item.skuId" />
+                <view class="flex items-center justify-between" :class="{ 'opacity-50': item.prodCount === 0 }">
+                  <wd-checkbox :model-value="item.skuId" :disabled="item.prodCount === 0" />
                   <view class="box-border w-full flex items-center">
                     <image :src="item.pic" class="h120rpx w120rpx flex-shrink-0" />
                     <view class="ml20rpx box-border flex-1">
@@ -221,7 +222,7 @@ function handleChangeMoney() {
                           单价:¥{{ item.price }}
                         </view>
                         <view>
-                          <wd-input-number v-model="item.num" :max="item.prodCount" :min="1" @change="handleChangeMoney" />
+                          <wd-input-number v-model="item.num" :max="item.prodCount" :min="1" :disabled="item.prodCount === 0" @change="handleChangeMoney" />
                         </view>
                       </view>
                     </view>

+ 125 - 77
src/subPack-common/afterSalesDetail/index.vue

@@ -20,6 +20,19 @@ onLoad((options: any) => {
   refundNumber.value = options.refundNumber
   getDetail(options.refundNumber)
 })
+const columns = ref(['快递寄送', '自行配送'])
+const value = ref('')
+const trackingNumber = ref('')
+const submitLoading = ref(false)
+
+const logisticsTypeMap: Record<number, string> = { 0: '快递寄送', 1: '自行配送' }
+const isLogisticsSubmitted = computed(() =>
+  refundOrderInfo.value?.refundGoodsType != null && !!refundOrderInfo.value?.trackingNumber,
+)
+
+function handleConfirm({ value: selectedValue }: { value: string }) {
+  value.value = selectedValue
+}
 async function getDetail(refundNumber: string) {
   const res = await api.xsb.refundDetails({ data: { refundNumber } })
   refundOrderInfo.value = res.data
@@ -40,86 +53,35 @@ function handleGOCoupon() {
   }
   router.push({ name: 'xsb-coupon', params: { couponId: refundOrderInfo.value?.couponBaseInfoDTO?.allowanceId, activeTab: refundOrderInfo.value?.isAll ? '0' : '1' } })
 }
+async function handleSubmitLogistics() {
+  if (!value.value) {
+    return useGlobalToast().show('请选择退货方式')
+  }
+  const refundLogisticsType = value.value === '快递寄送' ? 0 : 1
+  if (refundLogisticsType === 0 && !trackingNumber.value.trim()) {
+    return useGlobalToast().show('请输入快递单号')
+  }
+  submitLoading.value = true
+  try {
+    await api.xsb.submitRefundLogistics({
+      data: {
+        refundNumber: refundNumber.value,
+        refundLogisticsType,
+        trackingNumber: trackingNumber.value.trim(),
+      },
+    })
+    useGlobalToast().show('提交成功')
+    getDetail(refundNumber.value)
+  }
+  finally {
+    submitLoading.value = false
+  }
+}
 </script>
 
 <template>
   <page-meta :page-style="showTime ? 'overflow: hidden;' : '' " />
   <view v-if="refundOrderInfo" class="page-xsb px24rpx pt20rpx">
-    <!-- <view class="mb24rpx rounded-16rpx bg-white p24rpx">
-      <view class="text-32rpx text-#222 font-semibold">
-        待填写配送信息
-      </view>
-      <view class="mt20rpx text-24rpx text-#AAAAAA">
-        申请已通过,请在47时59分内,填写配送信息并支付配送费
-      </view>
-    </view> -->
-    <!-- <view class="mb24rpx rounded-16rpx bg-white p24rpx">
-      <view class="text-32rpx text-#222 font-semibold">
-        配送信息
-      </view>
-      <view class="mt24rpx flex items-center justify-between" @click="showTime = true">
-        <view class="text-28rpx">
-          <text class="text-#FF4D3A">
-            *
-          </text>
-          <text class="text-#222">
-            取件时间
-          </text>
-        </view>
-        <view class="flex items-center text-#AAAAAA">
-          请选择时间 <wd-icon name="chevron-right" size="22px" />
-        </view>
-      </view>
-      <view class="mt24rpx flex items-center justify-between">
-        <view class="text-28rpx">
-          <text class="text-#FF4D3A">
-            *
-          </text>
-          <text class="text-#222">
-            取件地址
-          </text>
-        </view>
-        <view class="flex items-center text-#222">
-          富力中心A座3401
-        </view>
-      </view>
-      <view class="mt24rpx flex items-center justify-between">
-        <view />
-        <view class="flex items-center text-#222">
-          杨先生 189****4678
-        </view>
-      </view>
-      <view class="mt24rpx flex items-center justify-between">
-        <view class="text-28rpx">
-          <text class="text-#FF4D3A">
-            *
-          </text>
-          <text class="text-#222">
-            退货方式
-          </text>
-        </view>
-        <view class="flex items-center text-#222">
-          上门取件
-        </view>
-      </view>
-      <view class="mt24rpx h2rpx w-full bg-#F0F0F0" />
-      <view class="mt28rpx text-28rpx text-#222 font-semibold">
-        请支付配送费 <text class="text-32rpx text-#FF4D3A">
-          ¥12
-        </text>
-      </view>
-      <view class="mt24rpx text-24rpx text-#AAAAAA">
-        <view> 1.因个人原因退货,需客户承担商品返还商家的运费</view>
-        <view class="mt20rpx">
-          2.请确保商品不影响二次销售,否则商家会拒绝收货
-        </view>
-      </view>
-      <view class="mt24rpx w-full">
-        <wd-button block>
-          立即支付
-        </wd-button>
-      </view>
-    </view> -->
     <view v-if="refundOrderInfo.omsOrderRefundRecords" class="rounded-16rpx bg-white p24rpx">
       <view class="text-32rpx text-#222 font-semibold">
         {{ refundOrderInfo.omsOrderRefundRecords[0].auditStatusDescribe }}
@@ -171,6 +133,87 @@ function handleGOCoupon() {
         </view>
       </view> -->
     </view>
+    <view v-if="refundOrderInfo.refundType === 2 && (isLogisticsSubmitted || refundOrderInfo.returnMoneySts === refundStatus.PendingReturn)" class="mt20rpx rounded-16rpx bg-white p24rpx">
+      <template v-if="isLogisticsSubmitted">
+        <view>
+          <view class="mt-20rpx text-28rpx font-semibold">
+            配送信息
+          </view>
+          <view class="mt-20rpx flex items-center">
+            <view class="text-28rpx">
+              退货方式:
+            </view>
+            <view class="text-28rpx text-#AAA">
+              {{ logisticsTypeMap[refundOrderInfo.refundGoodsType!] }}
+            </view>
+          </view>
+          <view v-if="refundOrderInfo.refundGoodsType === 0" class="mt-20rpx flex items-center">
+            <view class="text-28rpx">
+              快递单号:
+            </view>
+            <view class="text-28rpx text-#AAA">
+              {{ refundOrderInfo.trackingNumber }}
+            </view>
+          </view>
+        </view>
+      </template>
+      <template v-else>
+        <view class="text-28rpx font-semibold">
+          商家收货信息
+        </view>
+        <view class="flex items-center justify-between">
+          <view class="text-24rpx">
+            <view class="mt-20rpx flex items-center">
+              <view>收货人:</view>
+              <view class="text-#AAA">
+                {{ refundOrderInfo.shopLiaison }}
+              </view>
+            </view>
+            <view class="mt-20rpx flex items-center">
+              <view>联系电话:</view>
+              <view class="text-#AAA">
+                {{ refundOrderInfo.shopPhone }}
+              </view>
+            </view>
+            <view class="mt-20rpx flex">
+              <view class="flex-shrink-0">
+                收货地址:
+              </view>
+              <view class="text-#AAA">
+                {{ refundOrderInfo.shopAddress }}
+              </view>
+            </view>
+          </view>
+          <view @click="copyToClipboard(`收货人:${refundOrderInfo.shopLiaison}\n联系电话:${refundOrderInfo.shopPhone}\n收货地址:${refundOrderInfo.shopAddress}`)">
+            <wd-icon name="file-copy" size="22px" />
+          </view>
+        </view>
+        <view class="mt24rpx h2rpx w-full bg-#F0F0F0" />
+        <view>
+          <view class="mt-20rpx text-28rpx font-semibold">
+            配送信息
+          </view>
+          <wd-picker v-model="value" :columns="columns" label="退货方式:" clearable align-right @confirm="handleConfirm" />
+          <view v-if="value === '快递寄送'" class="flex items-center border-b-[#F0F0F0]">
+            <view class="text-28rpx">
+              快递单号:
+            </view>
+            <wd-input v-model="trackingNumber" no-border placeholder="请输入快递单号" />
+          </view>
+        </view>
+        <view class="mt-20rpx text-24rpx">
+          1.退货产生的运费请与商家自行协商
+        </view>
+        <view class="mt-12rpx text-24rpx">
+          2.请确保商品不影响二次销售,否则商家会拒绝收货
+        </view>
+        <view class="mt-20rpx flex items-center justify-center">
+          <wd-button class="h-80rpx w-full" :loading="submitLoading" @click="handleSubmitLogistics">
+            提交
+          </wd-button>
+        </view>
+      </template>
+    </view>
     <view class="mt20rpx rounded-16rpx bg-white p24rpx">
       <view class="text-28rpx font-semibold">
         优惠券处理
@@ -466,6 +509,11 @@ function handleGOCoupon() {
   </view>
 </template>
 
-<style scoped>
-
+<style scoped lang="scss">
+:deep(.wd-picker) {
+  .wd-cell {
+    padding-left: 0 !important;
+    padding-right: 0 !important;
+  }
+}
 </style>

+ 45 - 3
src/subPack-common/integral/index.vue

@@ -10,6 +10,7 @@ definePage({
   },
 })
 const navTabTypeList = ref<Api.sysDict[]>([])
+const showPointsPopup = ref(false)
 const { data: info } = useRequest(() =>
   Apis.xsb.findUserPoints({}),
 )
@@ -41,12 +42,12 @@ getNavList()
           {{ info?.data?.pointsTotal || 0 }}
         </view>
       </view>
-      <view class="flex flex-col items-center justify-center">
+      <view class="flex flex-col items-center justify-center" @click="showPointsPopup = true">
         <view class="text-28rpx text-[#AAAAAA]">
           当前可用积分
         </view>
         <view class="text-36rpx text-[#222] font-semibold">
-          {{ info?.data?.availablePointsTotal || 0 }}
+          {{ info?.data?.availablePointsTotal || 0 }}
         </view>
       </view>
       <view class="flex flex-col items-center justify-center">
@@ -69,8 +70,9 @@ getNavList()
     <view class="px-24rpx py-20rpx">
       可用积分记录
     </view>
+
     <scroll-view scroll-y class="view" @scrolltolower="handleScrollBottom">
-      <view v-for="item, index in pointList" :key="item.pointsId" class="bg-white p-24rpx">
+      <view v-for="(item, index) in pointList" :key="item.pointsId" class="bg-white p-24rpx">
         <view class="flex items-center justify-between text-32rpx font-semibold">
           <view class="text-[#222]">
             {{ item.businessTypeName || '未知状态' }}
@@ -87,6 +89,46 @@ getNavList()
       </view>
       <StatusTip v-if="!pointList.length" tip="暂无内容" />
     </scroll-view>
+    <Zpopup v-model="showPointsPopup" :showfooter="false" bg="#fff">
+      <view class="px-32rpx pb-40rpx pt-40rpx">
+        <view class="mb-32rpx text-center text-32rpx font-bold">
+          积分有限期
+        </view>
+        <view class="mb-24rpx flex items-center justify-between">
+          <view class="text-28rpx text-[#222] font-bold">
+            当前可用积分
+          </view>
+          <view class="text-36rpx text-[#222] font-bold">
+            {{ info?.data?.availablePointsTotal || 0 }}
+          </view>
+        </view>
+        <view class="mb-16rpx flex items-center justify-between">
+          <view class="text-24rpx text-[#999]">
+            有效期至:2026-07-06 23:59:59
+          </view>
+          <view class="text-24rpx text-[#222]">
+            2000
+          </view>
+        </view>
+        <view class="mb-32rpx flex items-center justify-between">
+          <view class="text-24rpx text-[#999]">
+            有效期至:2026-07-06 23:59:59
+          </view>
+          <view class="text-24rpx text-[#222]">
+            700
+          </view>
+        </view>
+        <view class="mb-32rpx h-2rpx w-full bg-[#F0F0F0]" />
+        <view class="mb-16rpx text-28rpx text-[#222] font-bold">
+          说明:
+        </view>
+        <view class="text-24rpx text-[#999] leading-40rpx">
+          <view>1.请在积分有效期内使用,逾期自动作废;</view>
+          <view>2.使用时,系统会优先使用快过期的积分;</view>
+          <view>3.如若交易在使用的积分有效期之外发生退款,该部分积分也为过期。</view>
+        </view>
+      </view>
+    </Zpopup>
   </view>
 </template>