优化订单详情页面的部分逻辑
This commit is contained in:
parent
a64939a86a
commit
81298faedc
@ -39,9 +39,9 @@
|
|||||||
<!-- 订单金额 -->
|
<!-- 订单金额 -->
|
||||||
<view class="amount-section">
|
<view class="amount-section">
|
||||||
<view v-if="status !== '退款中'">
|
<view v-if="status !== '退款中'">
|
||||||
<view class="total-amount">¥{{ orderInfo.payment_amount }}</view>
|
<view class="total-amount">¥{{ orderInfo.total_amount }}</view>
|
||||||
<view class="original-price">商品下单应付
|
<view class="original-price">商品下单应付
|
||||||
<text> ¥{{ orderInfo.payment_amount }}</text>
|
<text> ¥{{ orderInfo.total_amount }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="goods-item" v-for="(item, index) in orderInfo.commodity_order_item_list" :key="index">
|
<view class="goods-item" v-for="(item, index) in orderInfo.commodity_order_item_list" :key="index">
|
||||||
@ -134,7 +134,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="bottom-buttons" v-if="status === '3'">
|
<view class="bottom-buttons" v-if="status === '3'">
|
||||||
<!-- <button class="yfd-btn" @click="cancelOrder">运费单</button> -->
|
<!-- <button class="yfd-btn" @click="cancelOrder">运费单</button> -->
|
||||||
<button class="cancel-btn" @click="cancelOrder">取消订单</button>
|
<button class="cancel-btn" @click="applyRefund">申请退款</button>
|
||||||
<!-- <button class="pay-btn" @click="gotoPayment">立即支付</button> -->
|
<!-- <button class="pay-btn" @click="gotoPayment">立即支付</button> -->
|
||||||
</view>
|
</view>
|
||||||
<view class="bottom-buttons" v-if="status === '4'">
|
<view class="bottom-buttons" v-if="status === '4'">
|
||||||
@ -143,14 +143,14 @@
|
|||||||
<button class="pay-btn" @click="gotoPayment">立即支付</button>
|
<button class="pay-btn" @click="gotoPayment">立即支付</button>
|
||||||
</view>
|
</view>
|
||||||
<view class="bottom-buttons" v-if="status === '5'">
|
<view class="bottom-buttons" v-if="status === '5'">
|
||||||
<button class="cancel-btn" @click="orderEvaluate">服务评价</button>
|
<!-- <button class="cancel-btn" @click="orderEvaluate">服务评价</button> -->
|
||||||
<!-- <button class="yfd-btn" @click="cancelOrder">运费单</button> -->
|
<!-- <button class="yfd-btn" @click="cancelOrder">运费单</button> -->
|
||||||
<button class="pay-btn" @click="gotoPayment">立即支付</button>
|
<button class="pay-btn" @click="gotoPayment">立即支付</button>
|
||||||
</view>
|
</view>
|
||||||
<view class="bottom-buttons" v-if="status === '6'">
|
<view class="bottom-buttons" v-if="status === '6'">
|
||||||
<!-- <button class="yfd-btn" @click="cancelOrder">运费单</button> -->
|
<!-- <button class="yfd-btn" @click="cancelOrder">运费单</button> -->
|
||||||
<!-- <button class="cancel-btn" @click="cancelOrder">服务评价</button> -->
|
<!-- <button class="cancel-btn" @click="cancelOrder">服务评价</button> -->
|
||||||
<button class="pay-btn" @click="gotoPayment">再来一单</button>
|
<!-- <button class="pay-btn" @click="gotoPayment">再来一单</button> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -158,7 +158,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { picUrl, NavgateTo } from "../../../utils";
|
import { picUrl, NavgateTo, request } from "../../../utils";
|
||||||
|
import { apiArr as afterSaleApi } from "../../../api/afterSale";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
@ -201,9 +202,66 @@ export default {
|
|||||||
content: "确定要取消订单吗?",
|
content: "确定要取消订单吗?",
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
// 调用取消订单API
|
const params = {
|
||||||
uni.showToast({ title: "订单已取消", icon: "none" });
|
order_id: this.orderInfo.id,
|
||||||
setTimeout(() => uni.navigateBack(), 1500);
|
method: 1,
|
||||||
|
cancel_reason: '用户主动取消',
|
||||||
|
}
|
||||||
|
request(afterSaleApi.cancelOrConfirm, "POST", params).then((res) => {
|
||||||
|
uni.showToast({ title: "订单已取消", icon: "none" });
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateBack();
|
||||||
|
}, 1500);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 申请退款
|
||||||
|
applyRefund() {
|
||||||
|
uni.showModal({
|
||||||
|
title: "申请退款",
|
||||||
|
content: "确定要申请退款吗?",
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
const params = {
|
||||||
|
nick_name: uni.getStorageSync("nickName"),
|
||||||
|
order_id: this.orderInfo.id,
|
||||||
|
goods_ids: this.orderInfo.commodity_order_item_list.map(item => item.goods_id),
|
||||||
|
after_sales_type: 1,
|
||||||
|
after_sales_reason: '用户申请退款',
|
||||||
|
refund_amount: this.orderInfo.total_amount,
|
||||||
|
order_status: 3
|
||||||
|
}
|
||||||
|
request(afterSaleApi.afterSaleCreate, "POST", params).then((res) => {
|
||||||
|
uni.showToast({ title: "退款申请已提交", icon: "none" });
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateBack();
|
||||||
|
}, 1500);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 确认收货
|
||||||
|
confirmReceiving() {
|
||||||
|
uni.showModal({
|
||||||
|
title: "确认收货",
|
||||||
|
content: "确认收货后订单状态将变为【已完成】,如有售后需求可正常申请退款/售后,确定要确认收货吗?",
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
const params = {
|
||||||
|
order_id: this.orderInfo.id,
|
||||||
|
method: 2,
|
||||||
|
}
|
||||||
|
request(afterSaleApi.cancelOrConfirm, "POST", params).then((res) => {
|
||||||
|
uni.showToast({ title: "已确认收货", icon: "none" });
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateBack();
|
||||||
|
}, 1500);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user