feat:售后&订单加删除
This commit is contained in:
@@ -165,3 +165,12 @@ export function cancelOrder(data) {
|
|||||||
data,
|
data,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 删除订单
|
||||||
|
export function deleteOrderQuery(data) {
|
||||||
|
return request({
|
||||||
|
url: "/order/deleteOrder",
|
||||||
|
method: "post",
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -60,10 +60,20 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="content_item_yd" v-if="pItem.expressNo && pItem.expressData">
|
<view class="content_item_yd" v-if="pItem.expressNo && pItem.expressData">
|
||||||
<view class="express-view text-overflow1" v-if="Array.isArray(pItem.expressData?.logisticsTraceDetailList)">
|
<view class="express-view text-overflow1" v-if="
|
||||||
|
Array.isArray(pItem.expressData?.logisticsTraceDetailList)
|
||||||
|
">
|
||||||
<u-icon name="email" color="#333" size="20"></u-icon>
|
<u-icon name="email" color="#333" size="20"></u-icon>
|
||||||
<text class="text-24 text-zu1 text-space" style="margin-left:10rpx;">{{pItem.expressData.logisticsStatusDesc}}</text>
|
<text class="text-24 text-zu1 text-space" style="margin-left: 10rpx">{{
|
||||||
<text class="text-24 text-fu text-space text-overflow1" style="margin-left:10rpx;">{{Array.isArray(pItem.expressData?.logisticsTraceDetailList) ? pItem.expressData?.logisticsTraceDetailList[pItem.expressData.logisticsTraceDetailList.length - 1].desc : ''}}</text>
|
pItem.expressData.logisticsStatusDesc }}</text>
|
||||||
|
<text class="text-24 text-fu text-space text-overflow1" style="margin-left: 10rpx">{{
|
||||||
|
Array.isArray(pItem.expressData?.logisticsTraceDetailList)
|
||||||
|
? pItem.expressData?.logisticsTraceDetailList[
|
||||||
|
pItem.expressData.logisticsTraceDetailList.length -
|
||||||
|
1
|
||||||
|
].desc
|
||||||
|
: ""
|
||||||
|
}}</text>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view style="margin-left: 10rpx">
|
<!-- <view style="margin-left: 10rpx">
|
||||||
<up-image src="/static/common/copy.png" width="14" height="14" bgColor="#f1f6ff00"
|
<up-image src="/static/common/copy.png" width="14" height="14" bgColor="#f1f6ff00"
|
||||||
@@ -90,7 +100,7 @@
|
|||||||
<view class="operate_comm operate_but_2" v-if="item.status === ORDER_TYPE.NOT_RECEIVE"
|
<view class="operate_comm operate_but_2" v-if="item.status === ORDER_TYPE.NOT_RECEIVE"
|
||||||
@click="confirmReceiptOk(item)">确认收货</view>
|
@click="confirmReceiptOk(item)">确认收货</view>
|
||||||
|
|
||||||
<view class="operate_comm operate_but_1" style="borderColor: #7732FF;" v-if="form.type == 3"
|
<view class="operate_comm operate_but_1" style="bordercolor: #7732ff" v-if="form.type == 3"
|
||||||
@click="onExpress(item.id, item.items.expressNo)">
|
@click="onExpress(item.id, item.items.expressNo)">
|
||||||
<text class="text-zi">查看物流</text>
|
<text class="text-zi">查看物流</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -113,7 +123,9 @@
|
|||||||
? 'operate_but_3'
|
? 'operate_but_3'
|
||||||
: 'operate_but_1',
|
: 'operate_but_1',
|
||||||
]" v-if="!item.isAfter && form.type !== MINE_ORDER_TYPE.AFTER_SALE" @click="onSaleAfter(item)">
|
]" v-if="!item.isAfter && form.type !== MINE_ORDER_TYPE.AFTER_SALE" @click="onSaleAfter(item)">
|
||||||
{{ form.type === MINE_ORDER_TYPE.UNPAID ? "取消支付" : "售后" }}
|
{{
|
||||||
|
form.type === MINE_ORDER_TYPE.UNPAID ? "取消支付" : "去售后"
|
||||||
|
}}
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="operate_comm operate_but_1" v-if="form.type === MINE_ORDER_TYPE.AFTER_SALE"
|
<view class="operate_comm operate_but_1" v-if="form.type === MINE_ORDER_TYPE.AFTER_SALE"
|
||||||
@@ -121,7 +133,12 @@
|
|||||||
售后详情
|
售后详情
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="operate_comm operate_but_1" v-if="item.status === ORDER_TYPE.AFTER_SALE">查看售后</view> -->
|
<!-- <view class="operate_comm operate_but_1" v-if="item.status === ORDER_TYPE.AFTER_SALE">查看售后</view> -->
|
||||||
<!-- <view class="operate_comm operate_but_1" v-if="[ORDER_TYPE.COMPLETED].includes(item.status)">删除记录</view> -->
|
<view class="operate_comm operate_but_1 operate_comm_delete" v-if="
|
||||||
|
[
|
||||||
|
MINE_ORDER_TYPE.SUCCEED,
|
||||||
|
MINE_ORDER_TYPE.AFTER_SALE,
|
||||||
|
].includes(form.type)
|
||||||
|
" @click="deleteOrder(item)">删除</view>
|
||||||
<!-- <view class="operate_comm operate_but_3" v-if="[ORDER_TYPE.COMPLETED,ORDER_TYPE.CANCELED].includes(item.status)">再次购买</view> -->
|
<!-- <view class="operate_comm operate_but_3" v-if="[ORDER_TYPE.COMPLETED,ORDER_TYPE.CANCELED].includes(item.status)">再次购买</view> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -244,9 +261,11 @@
|
|||||||
confirmColor="#7934F6" title="提示" content="签署合同需要进行实名认证,请先完成实名认证"></u-modal>
|
confirmColor="#7934F6" title="提示" content="签署合同需要进行实名认证,请先完成实名认证"></u-modal>
|
||||||
|
|
||||||
<DownPopup :show="downShow" @ok="onSignContract" @cancel="onCancel" />
|
<DownPopup :show="downShow" @ok="onSignContract" @cancel="onCancel" />
|
||||||
|
<u-modal :show="deleteShow" title="提示" showCancelButton @cancel="deleteShow = false" @confirm="againDeleteOrder"
|
||||||
|
content="确定删除吗?"></u-modal>
|
||||||
|
|
||||||
<u-modal class="sure_pay" :show="surePayShow" title="提示" showCancelButton @cancel="surePayShow = false" @confirm="cancelPay" confirmColor="#7934F6"
|
<u-modal class="sure_pay" :show="surePayShow" title="提示" showCancelButton @cancel="surePayShow = false"
|
||||||
content="确定取消支付吗?"></u-modal>
|
@confirm="cancelPay" confirmColor="#7934F6" content="确定取消支付吗?"></u-modal>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -268,7 +287,8 @@ import {
|
|||||||
getMiniProgramSignUrl,
|
getMiniProgramSignUrl,
|
||||||
afterSaleDetail,
|
afterSaleDetail,
|
||||||
cancelOrder,
|
cancelOrder,
|
||||||
orderLogistics
|
orderLogistics,
|
||||||
|
deleteOrderQuery
|
||||||
} from "@/api/order.js";
|
} from "@/api/order.js";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import { formatDate1, copyData } from "@/utils/index.js";
|
import { formatDate1, copyData } from "@/utils/index.js";
|
||||||
@@ -354,15 +374,16 @@ export default {
|
|||||||
search: "",
|
search: "",
|
||||||
activeIndex: 0,
|
activeIndex: 0,
|
||||||
aftterSalesProduct: {}, //售后商品信息
|
aftterSalesProduct: {}, //售后商品信息
|
||||||
|
deleteShow: false,
|
||||||
|
deleteInfo: {}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
const type = options.type;
|
const type = options.type;
|
||||||
this.form.type =
|
this.form.type = type ? parseInt(type, 10) : MINE_ORDER_TYPE.UNPAID;
|
||||||
type ? parseInt(type, 10) : MINE_ORDER_TYPE.UNPAID;
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.loadData();
|
this.loadData();
|
||||||
})
|
});
|
||||||
// 待收货判断是否签署
|
// 待收货判断是否签署
|
||||||
if (
|
if (
|
||||||
this.form.type === MINE_ORDER_TYPE.NOT_RECEIVE ||
|
this.form.type === MINE_ORDER_TYPE.NOT_RECEIVE ||
|
||||||
@@ -378,11 +399,11 @@ export default {
|
|||||||
formatDate1,
|
formatDate1,
|
||||||
copyData,
|
copyData,
|
||||||
onExpress(itemId) {
|
onExpress(itemId) {
|
||||||
console.log('onExpress',itemId)
|
console.log("onExpress", itemId);
|
||||||
// let expressId =
|
// let expressId =
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:`/pages/rwa_package/setting/express?id=${itemId}`
|
url: `/pages/rwa_package/setting/express?id=${itemId}`,
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
onNextRefund() {
|
onNextRefund() {
|
||||||
this.salesServer = 2;
|
this.salesServer = 2;
|
||||||
@@ -390,16 +411,15 @@ export default {
|
|||||||
this.aftterSalesProduct = {
|
this.aftterSalesProduct = {
|
||||||
...this.aftterSalesProduct,
|
...this.aftterSalesProduct,
|
||||||
...{ afterReason: this.cancelForm.afterReason },
|
...{ afterReason: this.cancelForm.afterReason },
|
||||||
|
};
|
||||||
}
|
|
||||||
},
|
},
|
||||||
onSaleAfterTab() {
|
onSaleAfterTab() {
|
||||||
this.checkType({ id: MINE_ORDER_TYPE.AFTER_SALE, title: "售后" });
|
this.checkType({ id: MINE_ORDER_TYPE.AFTER_SALE, title: "售后" });
|
||||||
},
|
},
|
||||||
onKefu() {
|
onKefu() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:'/pages/rwa_package/setting/kefu?type=5261'
|
url: "/pages/rwa_package/setting/kefu?type=5261",
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
// 售后
|
// 售后
|
||||||
onSaleAfter(item) {
|
onSaleAfter(item) {
|
||||||
@@ -409,7 +429,6 @@ export default {
|
|||||||
// 取消支付
|
// 取消支付
|
||||||
this.cancelPayParams = { orderId: item.id };
|
this.cancelPayParams = { orderId: item.id };
|
||||||
this.surePayShow = true;
|
this.surePayShow = true;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// 未售后
|
// 未售后
|
||||||
this.cancelForm.afterReason = "";
|
this.cancelForm.afterReason = "";
|
||||||
@@ -418,7 +437,8 @@ export default {
|
|||||||
this.aftterSalesProduct = item;
|
this.aftterSalesProduct = item;
|
||||||
this.afterShow = true;
|
this.afterShow = true;
|
||||||
this.aftterSalesProduct.status = 9;
|
this.aftterSalesProduct.status = 9;
|
||||||
this.aftterSalesProduct.afterType = this.form.type == MINE_ORDER_TYPE.UNSHIPPED ? 1 : 2;
|
this.aftterSalesProduct.afterType =
|
||||||
|
this.form.type == MINE_ORDER_TYPE.UNSHIPPED ? 1 : 2;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 售后订单详情
|
// 售后订单详情
|
||||||
@@ -453,9 +473,42 @@ export default {
|
|||||||
this.afterShow = false;
|
this.afterShow = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 删除
|
||||||
|
deleteOrder(item) {
|
||||||
|
console.log("删除", item);
|
||||||
|
this.deleteShow = true;
|
||||||
|
this.deleteInfo = item;
|
||||||
|
},
|
||||||
|
async againDeleteOrder() {
|
||||||
|
let params;
|
||||||
|
if (this.deleteInfo.status === 4) {
|
||||||
|
params = {
|
||||||
|
orderId: this.deleteInfo.id,
|
||||||
|
type: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.deleteInfo.status === 7) {
|
||||||
|
params = {
|
||||||
|
orderId: this.deleteInfo.afterId,
|
||||||
|
type: 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log("删除-1", params);
|
||||||
|
const res = await deleteOrderQuery(params);
|
||||||
|
if (res.bizcode == 100) {
|
||||||
|
this.$refs.uToastRef.show({
|
||||||
|
type: "success",
|
||||||
|
message: "删除成功",
|
||||||
|
});
|
||||||
|
this.deleteShow = false;
|
||||||
|
this.form.page = 1;
|
||||||
|
this.orderList = [];
|
||||||
|
this.loadData();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// 取消支付
|
// 取消支付
|
||||||
cancelPay() {
|
cancelPay() {
|
||||||
|
|
||||||
cancelOrder(this.cancelPayParams).then((res) => {
|
cancelOrder(this.cancelPayParams).then((res) => {
|
||||||
if (res.bizcode == 100) {
|
if (res.bizcode == 100) {
|
||||||
this.$refs.uToastRef.show({
|
this.$refs.uToastRef.show({
|
||||||
@@ -566,11 +619,13 @@ export default {
|
|||||||
this.form.page++; // 页码加1
|
this.form.page++; // 页码加1
|
||||||
console.log("this.orderList", this.orderList);
|
console.log("this.orderList", this.orderList);
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("加载数据失败:", error);
|
console.error("加载数据失败:", error);
|
||||||
} finally {
|
} finally {
|
||||||
console.log("this.orderList1111",JSON.parse(JSON.stringify(this.orderList)));
|
console.log(
|
||||||
|
"this.orderList1111",
|
||||||
|
JSON.parse(JSON.stringify(this.orderList))
|
||||||
|
);
|
||||||
this.$forceUpdate();
|
this.$forceUpdate();
|
||||||
this.loading = false; // 设置加载状态为false
|
this.loading = false; // 设置加载状态为false
|
||||||
}
|
}
|
||||||
@@ -590,7 +645,10 @@ export default {
|
|||||||
for (let i = 0; i < data.data.entitys.length; i++) {
|
for (let i = 0; i < data.data.entitys.length; i++) {
|
||||||
for (let j = 0; j < data.data.entitys[i].items.length; j++) {
|
for (let j = 0; j < data.data.entitys[i].items.length; j++) {
|
||||||
if (data.data.entitys[i].items[j].expressNo) {
|
if (data.data.entitys[i].items[j].expressNo) {
|
||||||
data.data.entitys[i].items[j].expressData = await this.getOrderLogistics(data.data.entitys[i].items[j].expressNo);
|
data.data.entitys[i].items[j].expressData =
|
||||||
|
await this.getOrderLogistics(
|
||||||
|
data.data.entitys[i].items[j].expressNo
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -606,12 +664,12 @@ export default {
|
|||||||
|
|
||||||
return data.data;
|
return data.data;
|
||||||
} else {
|
} else {
|
||||||
return '';
|
return "";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async getOrderLogistics(id) {
|
async getOrderLogistics(id) {
|
||||||
const params = {
|
const params = {
|
||||||
mailNo:id
|
mailNo: id,
|
||||||
};
|
};
|
||||||
|
|
||||||
const data = await orderLogistics(params);
|
const data = await orderLogistics(params);
|
||||||
@@ -620,7 +678,6 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
// 当滚动到底部时触发的方法
|
// 当滚动到底部时触发的方法
|
||||||
loadMore() {
|
loadMore() {
|
||||||
@@ -784,6 +841,7 @@ export default {
|
|||||||
border-radius: 4rpx;
|
border-radius: 4rpx;
|
||||||
line-height: 1.6;
|
line-height: 1.6;
|
||||||
}
|
}
|
||||||
|
|
||||||
.after-sales-popup {
|
.after-sales-popup {
|
||||||
height: 400px !important;
|
height: 400px !important;
|
||||||
|
|
||||||
@@ -1101,6 +1159,11 @@ export default {
|
|||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.operate_comm_delete {
|
||||||
|
color: #f24a00;
|
||||||
|
border: 1rpx solid #f24a00;
|
||||||
|
}
|
||||||
|
|
||||||
.sure_pay {
|
.sure_pay {
|
||||||
::v-deep(.u-modal__content__text) {
|
::v-deep(.u-modal__content__text) {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|||||||
Reference in New Issue
Block a user