优化订单操作

This commit is contained in:
TOP糯米 2023-03-30 21:31:00 +08:00
parent 0c49d67d54
commit abd8ac4775
1 changed files with 33 additions and 16 deletions

View File

@ -15,16 +15,16 @@
</block>
<!-- /议价 -->
<block v-if="order.listType == 't2'">
<block v-if="order.state == 0">
<view class="btn" @click.stop="cancelOrder">
<text>取消订单</text>
</view>
</block>
<block v-if="order.state == 1">
<view class="btn" @click.stop="payOrder">
<text>立即支付</text>
</view>
</block>
<block v-if="order.state == 0 || order.state == 1">
<view class="btn" @click.stop="cancelOrder">
<text>取消订单</text>
</view>
</block>
</block>
<!-- 购买/议价公共操作 -->
<block v-if="order.listType == 't1' || order.listType == 't2'">
@ -54,9 +54,6 @@
</view>
</block>
<block v-if="order.state == 7">
<!-- <view class="btn" @click.stop="cancelRefund">
<text>取消申请</text>
</view> -->
<view class="btn normal">
<text>请等待审核</text>
</view>
@ -71,6 +68,11 @@
<text>查看未通过原因</text>
</view>
</block>
<block v-if="order.state == 6 || order.state == 8 || order.state == 9">
<!-- <view class="del" @click.stop="deleteOrder">
<text class="iconfont icon-shanchu"></text>
</view> -->
</block>
</block>
<!-- 货运 -->
<block v-if="order.listType == 't3'">
@ -79,16 +81,24 @@
<text>立即支付</text>
</view>
</block>
<block v-if="order.state == 1">
<block v-if="order.state == 0 || order.state == 1">
<view class="btn" @click.stop="cancelOrder">
<text>取消订单</text>
</view>
</block>
<block v-if="order.state == 2 || order.state == 3">
<block v-if="order.state == 2">
<view class="btn" @click.stop="finishOrder">
<text>确认完成</text>
</view>
</block>
<block v-if="order.state == 3">
<view class="btn normal">
<text>已完成</text>
</view>
<!-- <view class="del" @click.stop="deleteOrder">
<text class="iconfont icon-shanchu"></text>
</view> -->
</block>
</block>
</view>
</template>
@ -182,6 +192,19 @@ export default {
});
});
},
/**
* 删除订单
*/
deleteOrder() {
console.log(this.order.id);
let pages = getCurrentPages();
if (pages[pages.length - 1].route == "pages/order/detail") {
this.$store.commit("system/refreshOrder", true);
this.$utils.toPage("", "", "back");
} else {
this.$emit("refresh");
}
},
/**
* 评价
*/
@ -202,12 +225,6 @@ export default {
);
this.$utils.toPage("/pages/order/refund?list=" + this.order.listType + "&order=" + order);
},
/**
* 取消退款
*/
cancelRefund() {
this.$emit("cancelRefund");
},
/**
* 查看未通过原因
*/