沐梦. 9 цаг өмнө
parent
commit
d7ca690570

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
     "name" : "好萌友",
     "appid" : "__UNI__F19BBAD",
     "description" : "宠物服务商家端",
-    "versionName" : "1.2.7",
-    "versionCode" : 51,
+    "versionName" : "1.2.8",
+    "versionCode" : 52,
     "transformPx" : false,
     "app-plus" : {
         "privacy" : {

+ 26 - 0
pages/order/detail/index.vue

@@ -178,6 +178,9 @@
 
 				<!-- 服务进度 -->
 				<view class="tab-content" v-if="activeTab === 'progress'">
+					<view style="display: flex; justify-content: flex-end; margin-bottom: 20rpx;">
+						<button class="mini-btn" size="mini" type="primary" style="margin: 0; background-color: #409eff; border-color: #409eff;" @click="generateFulfillPath">生成履约路径</button>
+					</view>
 					<view class="empty-state"
 						v-if="['wait_dispatch', 'wait_accept'].includes(order.statusKey) || serviceTimeline.length === 0">
 						<uni-icons type="info" size="40" color="#ccc"></uni-icons>
@@ -333,6 +336,7 @@ import { getFulfiller } from '@/api/fulfiller/fulfiller'
 import { listSubOrderLog } from '@/api/order/subOrderLog'
 import { listComplaintByOrder } from '@/api/fulfiller/complaint'
 import { listSubOrderAppealByOrderId } from '@/api/order/subOrderAppeal'
+import { BASE_URL } from '@/utils/config'
 
 const activeTab = ref('base')
 const activeService = ref('transport')
@@ -796,6 +800,28 @@ const onComplaint = () => {
 		url: `/pages/my/complaint/submit/index?orderId=${order.id}&fulfillerId=${order.fulfiller}&orderCode=${order.code}`
 	})
 }
+
+const generateFulfillPath = () => {
+	if (!order.id) {
+		uni.showToast({ title: '订单ID不存在', icon: 'none' })
+		return
+	}
+	let path = ''
+	const ipPattern = /http:\/\/((\d{1,3}\.){3}\d{1,3}(:\d+)?)/;
+	const match = BASE_URL.match(ipPattern);
+	if (match) {
+		path = `http://${match[1]}/fulfillPath?orderId=${order.id}`
+	} else {
+		path = `https://www.hoomeng.pet/fulfillPath?orderId=${order.id}`
+	}
+	
+	uni.setClipboardData({
+		data: path,
+		success: () => {
+			uni.showToast({ title: '履约路径已复制到剪贴板', icon: 'none' })
+		}
+	})
+}
 </script>
 
 <style lang="scss" scoped>