完成复制订单编号

This commit is contained in:
赵毅 2025-09-13 10:32:48 +08:00
parent f767c7109b
commit 1f0de01c5b
2 changed files with 27 additions and 2 deletions

View File

@ -62,6 +62,11 @@ page{
background: linear-gradient(to right, #ffe7e7, #ffffff); background: linear-gradient(to right, #ffe7e7, #ffffff);
} }
.copy-icon {
width: 30rpx;
height: 30rpx;
}
.order-number { .order-number {
font-size: 26rpx; font-size: 26rpx;
color: #333; color: #333;

View File

@ -12,6 +12,8 @@
<view v-for="(order, index) in orders" :key="index" class="order-card"> <view v-for="(order, index) in orders" :key="index" class="order-card">
<view class="order-header"> <view class="order-header">
<text class="order-number">订单编号{{ order.order_sn }}</text> <text class="order-number">订单编号{{ order.order_sn }}</text>
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/myOrder/copy.png" class="copy-icon"
@click="copyOrderNo(order.order_sn)" />
<text class="order-status" :class="{ <text class="order-status" :class="{
'pending': order.status == 1, 'pending': order.status == 1,
'using': order.status == 2, 'using': order.status == 2,
@ -59,7 +61,7 @@
</view> </view>
<!-- 待支付订单显示操作按钮 --> <!-- 待支付订单显示操作按钮 -->
<view v-if="order.status === 'pending'" class="order-footer"> <view v-if="order.status == 1" class="order-footer">
<view class="cancel-button" @tap="cancelOrder(order)">取消订单</view> <view class="cancel-button" @tap="cancelOrder(order)">取消订单</view>
<view class="pay-button" @tap="goToPayment(order)">去支付</view> <view class="pay-button" @tap="goToPayment(order)">去支付</view>
</view> </view>
@ -104,6 +106,24 @@ export default {
} }
}, },
methods: { methods: {
//
copyOrderNo(order_sn) {
uni.setClipboardData({
data: order_sn,
success: () => {
uni.showToast({
title: '复制成功',
icon: 'success'
});
},
fail: () => {
uni.showToast({
title: '复制失败',
icon: 'none'
});
}
});
},
selectTab(index, item) { selectTab(index, item) {
this.selectedTab = index; this.selectedTab = index;
this.getOrderList() this.getOrderList()
@ -114,7 +134,7 @@ export default {
}, },
// //
goToPayment(order) { goToPayment(order) {
NavgateTo('../parkOrderDetail/index'); NavgateTo('../parkOrderDetail/index?item=' + JSON.stringify(order));
}, },
// //
getOrderList() { getOrderList() {