完成复制订单编号
This commit is contained in:
parent
f767c7109b
commit
1f0de01c5b
@ -62,6 +62,11 @@ page{
|
||||
background: linear-gradient(to right, #ffe7e7, #ffffff);
|
||||
}
|
||||
|
||||
.copy-icon {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
}
|
||||
|
||||
.order-number {
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
|
||||
@ -12,6 +12,8 @@
|
||||
<view v-for="(order, index) in orders" :key="index" class="order-card">
|
||||
<view class="order-header">
|
||||
<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="{
|
||||
'pending': order.status == 1,
|
||||
'using': order.status == 2,
|
||||
@ -59,7 +61,7 @@
|
||||
</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="pay-button" @tap="goToPayment(order)">去支付</view>
|
||||
</view>
|
||||
@ -104,6 +106,24 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//订单编号复制
|
||||
copyOrderNo(order_sn) {
|
||||
uni.setClipboardData({
|
||||
data: order_sn,
|
||||
success: () => {
|
||||
uni.showToast({
|
||||
title: '复制成功',
|
||||
icon: 'success'
|
||||
});
|
||||
},
|
||||
fail: () => {
|
||||
uni.showToast({
|
||||
title: '复制失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
selectTab(index, item) {
|
||||
this.selectedTab = index;
|
||||
this.getOrderList()
|
||||
@ -114,7 +134,7 @@ export default {
|
||||
},
|
||||
// 去支付
|
||||
goToPayment(order) {
|
||||
NavgateTo('../parkOrderDetail/index');
|
||||
NavgateTo('../parkOrderDetail/index?item=' + JSON.stringify(order));
|
||||
},
|
||||
// 获取订单列表
|
||||
getOrderList() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user