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