feat:售后

This commit is contained in:
2025-09-03 22:22:25 +08:00
parent 40e5e0ff8d
commit a2f9293e43
6 changed files with 153 additions and 76 deletions
+9
View File
@@ -139,3 +139,12 @@ export function returnGoodsFeedback(data) {
data, data,
}); });
} }
// 查询快递公司
export function getExpressCompany() {
return request({
url: "/common/getExpress",
method: "get",
});
}
+1
View File
@@ -447,6 +447,7 @@ export default {
const params = { const params = {
type, type,
page: 1, page: 1,
isRecomm:true,
pageSize: type === SEARCH_TYPE.SOMETHING ? 4 : 3, pageSize: type === SEARCH_TYPE.SOMETHING ? 4 : 3,
} }
const resp = await searchList(params); const resp = await searchList(params);
@@ -42,6 +42,10 @@
<view class="list_left">邮寄地址</view> <view class="list_left">邮寄地址</view>
<view>{{ address || "--" }}</view> <view>{{ address || "--" }}</view>
</view> </view>
<view class="card_list" @click="onSelectExpress">
<view class="list_left">选择快递名称</view>
<view>{{ cancelForm.expressName || "--" }}</view>
</view>
<view class="card_list"> <view class="card_list">
<view class="list_left">填快递单号</view> <view class="list_left">填快递单号</view>
<input <input
@@ -52,16 +56,6 @@
v-model="cancelForm.expressNo" v-model="cancelForm.expressNo"
/> />
</view> </view>
<view class="card_list">
<view class="list_left">填快递名称</view>
<input
class="input-express"
type="text"
:disabled="status != 2"
placeholder="请填写快递名称"
v-model="cancelForm.expressName"
/>
</view>
</view> </view>
<view <view
v-if="buttonLabel" v-if="buttonLabel"
@@ -71,16 +65,27 @@
bottom_box_disabled: bottom_box_disabled:
status == 2 && (!cancelForm.expressNo || !cancelForm.expressName), status == 2 && (!cancelForm.expressNo || !cancelForm.expressName),
}, },
{ bottom_box_quash: status == 1 }, { bottom_box_quash: status == 1 || status == 3},
]" ]"
> >
<view class="button operate_but_2" @click="submit" <view class="button operate_but_2" @click="submit">
> {{ buttonLabel }}</view {{ buttonLabel }}</view
> >
</view> </view>
</view> </view>
</view>
<up-toast ref="uToastRef"></up-toast> <up-toast ref="uToastRef"></up-toast>
<up-picker
:show="expressShow"
:columns="[expressList]"
keyName="name"
valueName="id"
itemHeight="34"
@confirm="onExpressConfirm"
@cancel="expressShow = false"
@close="expressShow = false"
></up-picker>
</view>
</template> </template>
<script> <script>
import salesStatus from "../components/salesStatus.vue"; import salesStatus from "../components/salesStatus.vue";
@@ -88,6 +93,7 @@ import {
afterSaleApply, afterSaleApply,
cancelAfterSale, cancelAfterSale,
returnGoodsFeedback, returnGoodsFeedback,
getExpressCompany,
} from "@/api/order.js"; } from "@/api/order.js";
import { RETURN_REASON } from "@/pages/mine_package/mine_order/emun/index.js"; import { RETURN_REASON } from "@/pages/mine_package/mine_order/emun/index.js";
export default { export default {
@@ -104,7 +110,14 @@ export default {
}, },
data() { data() {
return {}; return {
expressList: [],
expressShow: false,
};
},
created() {
this.onGetExpressCompany();
}, },
methods: { methods: {
submit() { submit() {
@@ -113,7 +126,7 @@ export default {
this.onAfterSaleApply(); this.onAfterSaleApply();
} }
//已售后-- 撤销申请 //已售后-- 撤销申请
if (this.status == 1) { if (this.status == 1 || this.status == 3) {
this.onCancelApply(); this.onCancelApply();
} }
if (this.status == 2) { if (this.status == 2) {
@@ -179,9 +192,9 @@ export default {
// 寄回商品 // 寄回商品
async onReturnGoods() { async onReturnGoods() {
const params = { const params = {
afterId: this.product.afterId, id: this.product.afterId,
expressNo: this.cancelForm.expressNo, expressNo: this.cancelForm.expressNo,
expressName: this.cancelForm.expressName, expressId: this.cancelForm.expressId,
}; };
console.log("寄回商品", params); console.log("寄回商品", params);
const { bizcode } = await returnGoodsFeedback(params); const { bizcode } = await returnGoodsFeedback(params);
@@ -197,15 +210,38 @@ export default {
onClose(item = false) { onClose(item = false) {
this.$emit("close", item); this.$emit("close", item);
}, },
// 快递公司
async onGetExpressCompany() {
const res = await getExpressCompany();
console.log("快递公司", res.data);
this.expressList = res.data;
},
// 方法
onExpressConfirm(item) {
console.log(item);
const val = item.value[0];
this.cancelForm.expressName = val.name;
this.cancelForm.expressId = val.id;
this.expressShow = false;
},
onSelectExpress() {
if (this.status == 2) {
this.expressShow = true;
}
},
}, },
computed: { computed: {
status() { status() {
// 未售后 -- 提交申请 console.log(
if (this.product.afterType == 0) { "未售后-开始售后---",
this.product.status,
this.product.afterType
);
// 未售后-开始售后
if (this.product.status == 9) {
return 0; return 0;
} }
// 已售后 // 已售后 --提交申请
if (this.product.afterType > 0) {
if (this.product.status == 0) { if (this.product.status == 0) {
return 1; return 1;
} }
@@ -225,7 +261,6 @@ export default {
if (this.product.status == 7) { if (this.product.status == 7) {
return 5; return 5;
} }
}
}, },
/* 根据订单状态按钮显示不同文案 */ /* 根据订单状态按钮显示不同文案 */
buttonLabel() { buttonLabel() {
@@ -236,7 +271,7 @@ export default {
} else if (this.status == 2) { } else if (this.status == 2) {
return "确定退货/退款"; return "确定退货/退款";
} else if (this.status == 3) { } else if (this.status == 3) {
return "确定退货/退款"; return "撤销申请";
} else if (this.status == 4) { } else if (this.status == 4) {
return "重新发起"; return "重新发起";
} else if (this.status == 5) { } else if (this.status == 5) {
@@ -250,7 +285,7 @@ export default {
} else if (this.status == 2) { } else if (this.status == 2) {
return "请按照以下地址寄回商品"; return "请按照以下地址寄回商品";
} else if (this.status == 3) { } else if (this.status == 3) {
return "请按照以下地址寄回商品"; return "退款/退货处理中";
} else if (this.status == 4) { } else if (this.status == 4) {
return "您发起的退货/退款申请,未通过"; return "您发起的退货/退款申请,未通过";
} else if (this.status == 5) { } else if (this.status == 5) {
@@ -264,7 +299,7 @@ export default {
} else if (this.status == 2) { } else if (this.status == 2) {
return "退款申请通过"; return "退款申请通过";
} else if (this.status == 3) { } else if (this.status == 3) {
return "退款申请通过"; return "您已成功发起退货/退款申请,请耐心等待处";
} else if (this.status == 4) { } else if (this.status == 4) {
return "退款申请失败"; return "退款申请失败";
} else if (this.status == 5) { } else if (this.status == 5) {
+57 -24
View File
@@ -64,7 +64,14 @@
{{ getValue(ORDER_STATUS, item.status) }} {{ getValue(ORDER_STATUS, item.status) }}
</view> </view>
<!-- 待付款 --> <!-- 待付款 -->
<view v-else class="order_item_header_right order_right_due">
<view
v-if="
form.type !== MINE_ORDER_TYPE.AFTER_SALE &&
item.status === ORDER_TYPE.UNPAID
"
class="order_item_header_right order_right_due"
>
<view class="order_right_due_msg">等待付款</view> <view class="order_right_due_msg">等待付款</view>
<view class="order_right_due_time" <view class="order_right_due_time"
>{{ formatDate1(item.expireTime) }}前</view >{{ formatDate1(item.expireTime) }}前</view
@@ -137,7 +144,10 @@
<!-- <view class="operate_comm operate_but_1" v-if="item.status === ORDER_TYPE.UNSHIPPED" @click="checkCancel(true)">取消订单</view> --> <!-- <view class="operate_comm operate_but_1" v-if="item.status === ORDER_TYPE.UNSHIPPED" @click="checkCancel(true)">取消订单</view> -->
<view <view
class="operate_comm operate_but_2" class="operate_comm operate_but_2"
v-if="item.status === ORDER_TYPE.UNPAID" v-if="
item.status === ORDER_TYPE.UNPAID &&
form.type !== MINE_ORDER_TYPE.AFTER_SALE
"
@click="jumpOrderInfo(item)" @click="jumpOrderInfo(item)"
>去付款</view >去付款</view
> >
@@ -160,17 +170,30 @@
>去签署</view >去签署</view
> >
<!-- <view class="operate_comm operate_but_3" v-if="item.status === ORDER_TYPE.UNSHIPPED">提醒发货</view> --> <!-- <view class="operate_comm operate_but_3" v-if="item.status === ORDER_TYPE.UNSHIPPED">提醒发货</view> -->
<view <view
class="operate_comm operate_but_1" class="operate_comm operate_but_1"
v-if=" v-if="item.isAfter && form.type !== MINE_ORDER_TYPE.AFTER_SALE"
[ORDER_TYPE.NOT_RECEIVE, ORDER_TYPE.UNSHIPPED].includes( @click="onSaleAfterTab"
item.status >
) 查看售后
" </view>
<view
class="operate_comm operate_but_1"
v-if="!item.isAfter && form.type !== MINE_ORDER_TYPE.AFTER_SALE"
@click="onSaleAfter(item)" @click="onSaleAfter(item)"
> >
售后 售后
</view> </view>
<view
class="operate_comm operate_but_1"
v-if="form.type === MINE_ORDER_TYPE.AFTER_SALE"
@click="onAfterSaleDetail(item)"
>
售后详情
</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" v-if="[ORDER_TYPE.COMPLETED].includes(item.status)">删除记录</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> -->
@@ -432,10 +455,10 @@ export default {
id: MINE_ORDER_TYPE.SUCCEED, id: MINE_ORDER_TYPE.SUCCEED,
title: "已完成", title: "已完成",
}, },
// { {
// id:MINE_ORDER_TYPE.AFTER_SALE, id: MINE_ORDER_TYPE.AFTER_SALE,
// title:"售后", title: "售后",
// }, },
], ],
form: { form: {
page: 1, page: 1,
@@ -482,33 +505,40 @@ export default {
getValue, getValue,
formatDate1, formatDate1,
copyData, copyData,
onNextRefund() { onNextRefund() {
this.salesServer = 2; this.salesServer = 2;
if (this.aftterSalesProduct.afterType == 0) {
this.aftterSalesProduct = { this.aftterSalesProduct = {
...this.aftterSalesProduct, ...this.aftterSalesProduct,
...{ afterReason: this.cancelForm.afterReason }, ...{ afterReason: this.cancelForm.afterReason },
};
} }
}, },
onSaleAfterTab() {
this.checkType({ id: MINE_ORDER_TYPE.AFTER_SALE, title: "售后" });
},
// 售后 // 售后
onSaleAfter(item) { onSaleAfter(item) {
console.log("售后---1", item); console.log("售后---1", item, this.form.type);
// 未售后 // 未售后
if (item.afterType == 0) {
this.cancelForm.afterReason = ""; this.cancelForm.afterReason = "";
this.salesServer = 1; this.salesServer = 1;
this.activeIndex = 0; this.activeIndex = 0;
this.aftterSalesProduct = item; this.aftterSalesProduct = item;
this.afterShow = true; this.afterShow = true;
} this.aftterSalesProduct.status = 9;
// 已开始售后 this.aftterSalesProduct.afterType = this.form.type - 1;
if (item.afterType > 0) {
this.onAfterSaleDetail(item);
}
}, },
// 售后订单详情 // 售后订单详情
async onAfterSaleDetail(item) { async onAfterSaleDetail(item) {
if(item.status === 8){
this.$refs.uToastRef.show({
type: "success",
message: "订单已作废",
});
return;
}
const { bizcode, data } = await afterSaleDetail({ id: item.afterId }); const { bizcode, data } = await afterSaleDetail({ id: item.afterId });
if (bizcode == 100) { if (bizcode == 100) {
this.aftterSalesProduct = { ...data, ...{ afterId: item.afterId } }; this.aftterSalesProduct = { ...data, ...{ afterId: item.afterId } };
@@ -579,11 +609,12 @@ export default {
) { ) {
this.checkSigned(); this.checkSigned();
} }
if (item.id !== MINE_ORDER_TYPE.AFTER_SALE) { // if (item.id !== MINE_ORDER_TYPE.AFTER_SALE) {
// this.loadData();
// } else {
// this.openShow = true; // 未开发的弹框
// }
this.loadData(); this.loadData();
} else {
this.openShow = true; // 未开发的弹框
}
}, },
jumpOrderInfo(item) { jumpOrderInfo(item) {
uni.navigateTo({ uni.navigateTo({
@@ -800,6 +831,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.after-sales-popup { .after-sales-popup {
height: 400px !important; height: 400px !important;
.after-sales-title { .after-sales-title {
font-size: 28rpx; font-size: 28rpx;
color: #71737c; color: #71737c;
@@ -1034,6 +1066,7 @@ export default {
background: transparent; background: transparent;
z-index: 100; z-index: 100;
box-shadow: 0rpx -4rpx 12rpx 0rpx rgba(0, 0, 0, 0.06); box-shadow: 0rpx -4rpx 12rpx 0rpx rgba(0, 0, 0, 0.06);
.cancel_show_button { .cancel_show_button {
position: initial; position: initial;
width: 94%; width: 94%;
-1
View File
@@ -1,4 +1,3 @@
// export const BASE_URL="https://frontend.jdns360.com/api"; // 正式环境 // export const BASE_URL="https://frontend.jdns360.com/api"; // 正式环境
// export const BASE_URL="http://cl55un59859.vicp.fun:24346"; // 测试环境 // export const BASE_URL="http://cl55un59859.vicp.fun:24346"; // 测试环境
+1 -1
View File
@@ -266,7 +266,7 @@ export const BALANCE_TYPE = [
export const CERT_OPTION = [ export const CERT_OPTION = [
{ {
key: 1, key: 1,
value: "居民身份证" name: "居民身份证"
} }
// , { // , {
// key: 2, // key: 2,