diff --git a/src/pages.json b/src/pages.json
index 91f7d32..57f2eae 100644
--- a/src/pages.json
+++ b/src/pages.json
@@ -101,6 +101,12 @@
"style": {
"navigationBarTitleText": "种类管理"
}
+ },
+ {
+ "path": "pages/share/order",
+ "style": {
+ "navigationBarTitleText": "订单详情"
+ }
}
],
"globalStyle": {
diff --git a/src/pages/order/detail.vue b/src/pages/order/detail.vue
index 1c72b74..1639d20 100644
--- a/src/pages/order/detail.vue
+++ b/src/pages/order/detail.vue
@@ -216,30 +216,23 @@ export default {
uni.showToast({ title: '打印功能开发中', icon: 'none' })
},
shareOrder() {
- // 构建分享内容
- let content = `【订单信息】\n`
- content += `订单号: ${this.order.orderNo}\n`
- content += `客户: ${this.order.customerName || '散客'}\n`
- content += `实付金额: ¥${this.order.actualAmount}\n`
- content += `支付方式: ${this.getPaymentMethod(this.order.paymentMethod)}\n`
- content += `\n【商品明细】\n`
- this.orderItems.forEach(item => {
- content += `${item.productName} x${item.quantity} ¥${item.price}\n`
- })
+ // 构建分享链接
+ const baseUrl = getApp().globalData.h5BaseUrl || 'https://你的域名'
+ const shareUrl = `${baseUrl}/#/pages/share/order?orderNo=${this.order.orderNo}`
- // 复制到剪贴板分享
+ // 复制链接到剪贴板
uni.setClipboardData({
- data: content,
+ data: shareUrl,
success: () => {
uni.showModal({
- title: '订单已复制',
- content: '订单信息已复制到剪贴板,可以粘贴分享给客户',
+ title: '分享链接已复制',
+ content: '订单分享链接已复制,可粘贴发送给客户',
showCancel: false,
confirmText: '知道了'
})
}
})
- }
+ },
}
}
diff --git a/src/pages/share/order.vue b/src/pages/share/order.vue
new file mode 100644
index 0000000..f140d7d
--- /dev/null
+++ b/src/pages/share/order.vue
@@ -0,0 +1,310 @@
+
+
+
+
+ 加载中...
+
+
+
+
+ ❌
+ {{ error }}
+
+
+
+
+
+
+
+
+
+ 客户信息
+
+
+ 客户姓名
+ {{ order.customerName }}
+
+
+ 联系电话
+ {{ order.customerPhone }}
+
+
+ 下单时间
+ {{ formatTime(order.createdAt) }}
+
+
+
+
+
+
+ 商品明细
+
+
+
+ {{ item.productName }}
+ {{ item.quantity }}
+ ¥{{ item.price }}
+ ¥{{ (item.price * item.quantity).toFixed(2) }}
+
+
+
+
+
+
+
+ 原价合计
+ ¥{{ order.totalAmount }}
+
+
+ 优惠金额
+ -¥{{ order.discountAmount }}
+
+
+ 实付金额
+ ¥{{ order.actualAmount }}
+
+
+ 支付方式
+ {{ order.paymentMethod }}
+
+
+ 备注
+ {{ order.remark }}
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file