feat: 非取消订单增加分享功能,复制订单信息到剪贴板
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Agent
2026-03-29 07:05:24 +00:00
parent 4921ee8d97
commit eb2b16f84f

View File

@@ -94,6 +94,9 @@
<!-- 底部操作栏 -->
<view class="bottom-bar">
<button class="share-btn" v-if="order.status !== 2" @click="shareOrder">
分享订单
</button>
<button class="print-btn" v-if="order.status !== 2" @click="printOrder">
打印订单
</button>
@@ -211,7 +214,31 @@ export default {
},
printOrder() {
uni.showToast({ title: '打印功能开发中', icon: 'none' })
// TODO: 实现打印功能
},
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`
})
// 复制到剪贴板分享
uni.setClipboardData({
data: content,
success: () => {
uni.showModal({
title: '订单已复制',
content: '订单信息已复制到剪贴板,可以粘贴分享给客户',
showCancel: false,
confirmText: '知道了'
})
}
})
}
}
}
@@ -377,6 +404,17 @@ export default {
font-size: 28rpx;
}
.share-btn {
flex: 1;
height: 88rpx;
line-height: 88rpx;
background: linear-gradient(135deg, #52c41a 0%, #73d13d 100%);
color: #fff;
border: none;
border-radius: 44rpx;
font-size: 28rpx;
}
.action-btn {
flex: 1;
height: 88rpx;