fix: 分享链接增加customerId参数
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Agent
2026-03-29 07:18:52 +00:00
parent 7c25420c30
commit f0daec8c06
2 changed files with 9 additions and 6 deletions

View File

@@ -216,9 +216,10 @@ export default {
uni.showToast({ title: '打印功能开发中', icon: 'none' })
},
shareOrder() {
// 构建分享链接
// 构建分享链接包含订单号和客户ID
const baseUrl = getApp().globalData.h5BaseUrl || 'https://你的域名'
const shareUrl = `${baseUrl}/#/pages/share/order?orderNo=${this.order.orderNo}`
const customerId = this.order.customerId || ''
const shareUrl = `${baseUrl}/#/pages/share/order?orderNo=${this.order.orderNo}&customerId=${customerId}`
// 复制链接到剪贴板
uni.setClipboardData({

View File

@@ -102,15 +102,17 @@ export default {
loading: true,
error: '',
order: null,
orderNo: ''
orderNo: '',
customerId: ''
}
},
onLoad(options) {
if (options.orderNo) {
if (options.orderNo && options.customerId) {
this.orderNo = options.orderNo
this.customerId = options.customerId
this.loadOrder()
} else {
this.error = '订单号不能为空'
this.error = '参数不完整'
this.loading = false
}
},
@@ -118,7 +120,7 @@ export default {
async loadOrder() {
try {
const res = await uni.request({
url: `${getApp().globalData.apiBaseUrl}/public/orders/${this.orderNo}`,
url: `${getApp().globalData.apiBaseUrl}/public/orders/${this.orderNo}?customerId=${this.customerId}`,
method: 'GET'
})
this.loading = false