Przeglądaj źródła

fix(subPack-smqjh): 修复订单列表和订单渲染组件的兼容性及逻辑错误

- 修正模板标签拼写错误,将 templat 更正为 template
- 订单渲染组件根节点由 block 改为 view,提升结构语义
- 在微信小程序环境下引入物流插件,调用运单跟踪功能
- 优化支付逻辑,分别适配微信小程序和H5平台调用支付接口
- 清理 manifest.json 文件尾部多余空行
- 微信小程序环境下为订单详情页引入物流插件,提高功能完整性
zhangtao 1 dzień temu
rodzic
commit
92954d0bd3

+ 9 - 0
src/subPack-smqjh/components/xsb-orderList/xsb-orderList.vue

@@ -12,7 +12,9 @@ const _emit = defineEmits<{
 const NodeList = ref<Api.DeliveryNode[]>([])
 const showNode = ref(false)
 
+// #ifdef MP-WEIXIN
 const plugins = requirePlugin('logisticsPlugin')
+// #endif
 async function handleCancel(order: Api.xsbOrderList) {
   await useUserStore().handleCommonCancelOrder?.(order)
   _emit('refresh')
@@ -21,8 +23,13 @@ async function handleCancel(order: Api.xsbOrderList) {
 async function handlePay(orderNumber: string) {
   const res = await useUserStore().handleCommonPayMent?.(orderNumber)
   if (res?.payType !== 1 && res) {
+    // #ifdef MP-WEIXIN
     await useUserStore().getWxCommonPayment(res)
     _emit('refresh')
+    // #endif
+    // #ifdef H5
+    useUserStore().handleCommonWechatPay(orderNumber)
+    // #endif
   }
   else {
     _emit('refresh')
@@ -64,9 +71,11 @@ async function handleLogistics(_order: Api.xsbOrderList) {
       uni.hideLoading()
       const jsData = JSON.parse(res.data)
       if (jsData.errmsg === 'ok') {
+        // #ifdef MP-WEIXIN
         plugins.openWaybillTracking({
           waybillToken: jsData.waybill_token,
         })
+        // #endif
       }
     }
     catch {

+ 2 - 2
src/subPack-smqjh/order/components/OrderRenderer.vue

@@ -19,7 +19,7 @@ defineEmits<{
 </script>
 
 <template>
-  <block>
+  <view>
     <xsbList
       v-if="orderList.businessType === 'XSB' || orderList.businessType === 'all'" :order="orderList"
       @refresh="$emit('refresh')"
@@ -39,5 +39,5 @@ defineEmits<{
       v-else-if="orderList.businessType === 'JDMP' || orderList.businessType === 'all'" :order="orderList"
       @refresh="$emit('refresh')"
     />
-  </block>
+  </view>
 </template>

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

@@ -138,7 +138,7 @@ function handleRefresh() {
       </view>
     </view>
     <view class="p-24rpx">
-      <templat v-if="skelet">
+      <template v-if="skelet">
         <view v-for="item in 10" :key="item" class="mb20rpx rounded-16rpx bg-white p24rpx">
           <wd-skeleton
             animation="gradient"
@@ -178,7 +178,7 @@ function handleRefresh() {
             :row-col="[{ width: '100%', height: '60rpx' }]"
           />
         </view>
-      </templat>
+      </template>
       <view v-else>
         <template v-for="item in orderList" :key="item.orderNumber">
           <OrderRenderer

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

@@ -2,8 +2,9 @@
 import type { MapMarker, MapPolyline } from '@uni-helper/uni-types'
 import { StaticUrl } from '@/config'
 import router from '@/router'
-
+// #ifdef MP-WEIXIN
 const plugins = requirePlugin('logisticsPlugin')
+// #endif
 const { statusBarHeight, MenuButtonHeight } = storeToRefs(useSysStore())
 const { userInfo } = storeToRefs(useUserStore())
 definePage({