Compare commits
8 Commits
4b8d27d912
...
b008e2766e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b008e2766e | ||
|
|
a94b70f442 | ||
|
|
571a5738ac | ||
|
|
b55b13596d | ||
|
|
e2b284f048 | ||
|
|
9fe388e5d8 | ||
|
|
f5c197620c | ||
|
|
3ed1cbed6d |
@ -213,17 +213,17 @@ export default {
|
||||
console.log(item.id);
|
||||
|
||||
// 根据条件判断是否可以售后
|
||||
// request(afterSaleApi.isAllow, "POST", {
|
||||
// order_id: item.id,
|
||||
// }).then((res) => {
|
||||
// if (res.data.is_allow_after_sales) {
|
||||
// this.afterSaleGoods = res.data.allow_items;
|
||||
// // this.selectedAsGood = item.commodity_order_item_list[0].id;
|
||||
// this.$refs.afterSalePopupRef.openAfterSalePopup();
|
||||
// } else {
|
||||
// this.noSalePopup = true
|
||||
// }
|
||||
// });
|
||||
request(afterSaleApi.isAllow, "POST", {
|
||||
order_id: item.id,
|
||||
}).then((res) => {
|
||||
if (res.data.is_allow_after_sales) {
|
||||
this.afterSaleGoods = res.data.allow_items;
|
||||
// this.selectedAsGood = item.commodity_order_item_list[0].id;
|
||||
this.$refs.afterSalePopupRef.openAfterSalePopup();
|
||||
} else {
|
||||
this.noSalePopup = true
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 处理退款提交事件
|
||||
@ -244,7 +244,9 @@ export default {
|
||||
change_goods_id: data.changeServiceId
|
||||
}
|
||||
request(afterSaleApi.afterSaleCreate, "POST", params).then((res) => {
|
||||
this.getOrderList();
|
||||
uni.showToast({ title: "申请售后成功", icon: "sucess" }), setTimeout(() => {
|
||||
this.getOrderList();
|
||||
}, 1000);
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
@ -432,13 +432,20 @@
|
||||
background: #F6F7FB;
|
||||
border-radius: 40rpx;
|
||||
padding: 10rpx 15rpx;
|
||||
white-space: nowrap;
|
||||
margin:20rpx 30rpx;
|
||||
word-wrap: break-word;
|
||||
word-break: break-all;
|
||||
max-width: calc(100% - 60rpx);
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.itemSize_active {
|
||||
background: #FF370B;
|
||||
color: #fff;
|
||||
word-wrap: break-word;
|
||||
word-break: break-all;
|
||||
max-width: calc(100% - 60rpx);
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.itemSize-img{
|
||||
|
||||
@ -369,7 +369,7 @@ export default {
|
||||
console.log('售后商品 - 选中的售后类型:', selectedType);
|
||||
console.log('选中的售后商品:', this.selectedAsGood);
|
||||
|
||||
this.merchantContact = `${this.orderItem.supplier_name} ${this.orderItem.supplier_phone}`;
|
||||
this.merchantContact = `${this.orderItem.supplier_name} ${this.orderItem.supplier_phone || ''}`;
|
||||
this.merchantAddress = this.orderItem.supplier_address;
|
||||
|
||||
this.afterSalePopup = false;
|
||||
@ -450,8 +450,8 @@ export default {
|
||||
res.change_goods_list.forEach(item => {
|
||||
item.commodity_pic = picUrl + item.commodity_pic;
|
||||
})
|
||||
this.changeGoodsList = res.change_goods_list;
|
||||
console.log("🚀 ~ changeGood ~ this.currentGG:", this.currentGG)
|
||||
// this.changeGoodsList = res.change_goods_list;
|
||||
this.changeGoodsList = res.change_goods_list.filter(item => item.id == this.selectedAsGood);
|
||||
if (!this.currentGG.goods_name) {
|
||||
this.currentGG = this.changeGoodsList.find(item => item.id == this.selectedAsGood);
|
||||
this.currentGGIndex = this.changeGoodsList.indexOf(this.currentGG);
|
||||
|
||||
@ -52,16 +52,6 @@ export default {
|
||||
const selectedText = this.applyRefundReasons[this.selectedReason];
|
||||
this.$emit('update:showPopup', false);
|
||||
this.$emit('refundConfirmed', { reason: selectedText });
|
||||
uni.showModal({
|
||||
title: '退款申请成功',
|
||||
content: '将在审核后完成退款',
|
||||
showCancel: false,
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
@ -165,37 +165,81 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
status: "",
|
||||
countdown: "9:59:59",
|
||||
countdown: "",
|
||||
orderInfo: {},
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
const item = JSON.parse(options?.item);
|
||||
this.orderInfo = item;
|
||||
// 启动倒计时
|
||||
item.order_status == "1" ? this.startCountdown() : "";
|
||||
this.status = JSON.stringify(item.order_status);
|
||||
this.orderInfo = item;
|
||||
},
|
||||
methods: {
|
||||
startCountdown() {
|
||||
// 倒计时模拟
|
||||
let seconds = 10 * 60; // 10分钟
|
||||
const timer = setInterval(() => {
|
||||
seconds--;
|
||||
// 检查订单信息中是否有时效时间戳
|
||||
if (!this.orderInfo.timeout_time_stamp) {
|
||||
console.error('订单时效时间戳不存在');
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取当前时间和订单超时时间
|
||||
const now = Math.floor(new Date().getTime() / 1000);
|
||||
const timeoutTime = this.orderInfo.timeout_time_stamp;
|
||||
|
||||
// 判断当前时间是否已超过超时时间
|
||||
if (now > timeoutTime) {
|
||||
// 已超过超时时间,直接取消订单
|
||||
this.handleOrderCancellation();
|
||||
return;
|
||||
}
|
||||
|
||||
// 计算剩余时间(秒)
|
||||
let remainingSeconds = timeoutTime - now;
|
||||
// 确保剩余时间不为负数
|
||||
remainingSeconds = Math.max(0, remainingSeconds);
|
||||
|
||||
// 更新倒计时显示的函数
|
||||
const updateCountdownDisplay = (seconds) => {
|
||||
const hours = Math.floor(seconds / 3600);
|
||||
const minutes = Math.floor((seconds % 3600) / 60);
|
||||
const secs = seconds % 60;
|
||||
this.countdown = `${hours}:${minutes.toString().padStart(2, "0")}:${secs
|
||||
.toString()
|
||||
.padStart(2, "0")}`;
|
||||
if (seconds <= 0) {
|
||||
this.countdown = `${hours}:${minutes.toString().padStart(2, "0")}:${secs.toString().padStart(2, "0")}`;
|
||||
};
|
||||
|
||||
// 立即更新一次显示
|
||||
updateCountdownDisplay(remainingSeconds);
|
||||
|
||||
// 设置定时器,每秒更新一次倒计时
|
||||
const timer = setInterval(() => {
|
||||
remainingSeconds--;
|
||||
|
||||
updateCountdownDisplay(remainingSeconds);
|
||||
|
||||
// 检查是否已经超时
|
||||
if (remainingSeconds <= 0) {
|
||||
clearInterval(timer);
|
||||
// 倒计时结束,处理订单
|
||||
uni.showToast({ title: "订单已取消", icon: "none" });
|
||||
setTimeout(() => uni.navigateBack(), 1500);
|
||||
// 倒计时结束,取消订单
|
||||
this.handleOrderCancellation();
|
||||
}
|
||||
}, 1000);
|
||||
},
|
||||
|
||||
// 处理订单取消
|
||||
handleOrderCancellation() {
|
||||
const params = {
|
||||
order_id: this.orderInfo.id,
|
||||
method: 1,
|
||||
cancel_reason: '倒计时结束取消',
|
||||
};
|
||||
request(afterSaleApi.cancelOrConfirm, "POST", params).then((res) => {
|
||||
uni.showToast({ title: "订单已取消", icon: "none" });
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 1500);
|
||||
});
|
||||
},
|
||||
cancelOrder() {
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
@ -217,7 +261,7 @@ export default {
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
// 申请退款
|
||||
applyRefund() {
|
||||
uni.showModal({
|
||||
@ -238,7 +282,7 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
// 确认收货
|
||||
confirmReceiving() {
|
||||
uni.showModal({
|
||||
@ -264,7 +308,7 @@ export default {
|
||||
// 创建转换后的商品数组
|
||||
const transformedItems = this.orderInfo.commodity_order_item_list.map(goods => ({
|
||||
isafterSale: true,
|
||||
orderId: item.id,
|
||||
orderId: this.orderInfo.id,
|
||||
commodity_goods_info: {
|
||||
commodity_brief: "",
|
||||
commodity_id: goods.goods_id,
|
||||
@ -298,8 +342,7 @@ export default {
|
||||
update_time: this.orderInfo.update_time,
|
||||
user_id: this.orderInfo.user_id
|
||||
}));
|
||||
|
||||
NavgateTo(`/packages/shop/groupPurchaseSubmit/index?shopCarList=${JSON.stringify(transformedItems)}`)
|
||||
NavgateTo(`/packages/shop/goodsSubmit/index?shopCarList=${JSON.stringify(transformedItems)}`)
|
||||
},
|
||||
checkLogistics() {
|
||||
NavgateTo(`/packages/myOrders/logistics/index`);
|
||||
@ -308,7 +351,7 @@ export default {
|
||||
orderEvaluate() {
|
||||
NavgateTo(`/packages/myOrders/orderEvaluate/index?item=${JSON.stringify(this.orderInfo)}`);
|
||||
},
|
||||
|
||||
|
||||
// 售后按钮
|
||||
afterSale() {
|
||||
NavgateTo(`/packages/myOrders/afterSale/index`);
|
||||
|
||||
@ -4,6 +4,35 @@ page {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: calc(100vh - 120rpx);
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.searchBox {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 20rpx;
|
||||
/* margin-top: 35rpx; */
|
||||
justify-content: space-between;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.searchBox_add {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-weight: 400;
|
||||
font-size: 30rpx;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.searchBox_add image {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
margin-right: 16rpx;
|
||||
}
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
@ -31,7 +60,7 @@ image {
|
||||
margin-top: 43rpx;
|
||||
}
|
||||
|
||||
.Msg2 div {
|
||||
.Msg2 view {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
@ -39,6 +68,7 @@ image {
|
||||
color: #222222;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
.Msg2 div span{
|
||||
|
||||
.Msg2 view span {
|
||||
color: #FF370B;
|
||||
}
|
||||
@ -1,17 +1,24 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<div class="sucessImg">
|
||||
<view class="container">
|
||||
<view class="searchBox" :style="{ height: localHeight + 'px', paddingTop: top + 'px' }">
|
||||
<view class="searchBox_add">
|
||||
<view class="searchBox_left">
|
||||
<u-icon bold color="#000" size="40" name="arrow-left" @click="back"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="sucessImg">
|
||||
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/enter_audit1.png" mode="aspectFill"></image>
|
||||
</div>
|
||||
</view>
|
||||
|
||||
<div class="Msg1">提交成功</div>
|
||||
<div class="Msg2">
|
||||
<div>入驻申请提交成功!</div>
|
||||
<div>
|
||||
<view class="Msg1">提交成功</view>
|
||||
<view class="Msg2">
|
||||
<view>入驻申请提交成功!</view>
|
||||
<view>
|
||||
请耐心等待工作人员处理
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -22,19 +29,27 @@ import {
|
||||
isPhone,
|
||||
picUrl,
|
||||
request,
|
||||
upload
|
||||
menuButtonInfo,
|
||||
upload,
|
||||
NavgateTo
|
||||
} from '../../../utils';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
picUrl,
|
||||
top: "",
|
||||
localHeight: "",
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
|
||||
back() {
|
||||
NavgateTo('/pages/index/index')
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
const meun = menuButtonInfo();
|
||||
this.top = meun.top;
|
||||
this.localHeight = meun.height;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -519,7 +519,8 @@
|
||||
"path": "sucess/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"navigationBarBackgroundColor": "#f6f7fb"
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarBackgroundColor": "#fff"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user