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
@@ -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) {