Commit 1395c2cd authored by 陈宗胤(贵阳日报)'s avatar 陈宗胤(贵阳日报)
parents 942f6224 e45ac04f
......@@ -402,6 +402,7 @@ const payNow = async (data) => {
openUrl(res.data.result);
xma.removeStorageSync('address');
} else {
xma.hideLoading();
groupBuyConfirmFn(prodIds.value, skuIds.value);
}
});
......@@ -412,6 +413,7 @@ const payNow = async (data) => {
openUrl(res.data.result);
xma.removeStorageSync('address');
} else {
xma.hideLoading();
sgyrddBasketConfirmFn(basketIds.value);
}
});
......
<template>
<Search title="售后详情" backgroundBox="white" :showTitle="true"></Search>
<view class="container">
<view class="container" v-if="orderDetail">
<view class="content">
<view class="headbox">
<view class="h-between">
<text>退款金额</text>
<text>198.00</text>
<text>{{ orderDetail.refundPrice }}</text>
</view>
<text class="detail">申请通过后退回原账户</text>
</view>
<view class="steps">
<wd-steps vertical>
<wd-step>
<wd-step v-for="(item, index) in handleLog" :key="index">
<template #icon>
<view class="dot-red">
<wd-icon name="check" size="22rpx" color="#fff"></wd-icon>
<wd-icon
:name="/拒绝|失败|撤销/.test(item.title) ? 'close' : 'check'"
size="22rpx"
color="#fff"
></wd-icon>
</view>
</template>
<template #title>
<view class="titlebox">
<text class="title">申请售后</text>
</view>
</template>
<template #description>
<view class="descbox">
<text class="desc">售后申请已提交</text>
<text class="desc">2024-08-14 14:47:30</text>
</view>
</template>
</wd-step>
<wd-step>
<template #icon>
<view class="dot-red">
<wd-icon name="check" size="22rpx" color="#fff"></wd-icon>
</view>
</template>
<template #title>
<view class="titlebox">
<text class="title t-red">请等待商家处理</text>
<view class="timebox">
<text class="title" :class="index == handleLog.length - 1 ? 't-red' : ''">
{{ item.title }}
</text>
<!-- <view class="timebox">
<text class="time">剩余:</text>
<wd-count-down :time="time" />
</view>
</view> -->
</view>
</template>
<template #description>
<view class="descbox">
<text class="desc">
您已成功发起售后申请,请耐心等待商家处理。
如果商家拒绝,您可以修改售后申请后再次发起,商家会 重新处理。
</text>
</view>
</template>
</wd-step>
<wd-step>
<template #icon>
<view class="dot-red">
<wd-icon name="check" size="22rpx" color="#fff"></wd-icon>
</view>
</template>
<template #title>
<view class="titlebox">
<text class="title">请输入退货商品运单编号</text>
</view>
</template>
<template #description>
<view class="inputbox">
<view
class="inputbox"
v-if="item.title == '请输入退货商品运单编号' && index == handleLog.length - 1"
>
<input
:value="logisticsTrackingNumber"
class="text"
type="text"
placeholder="请输入退货商品运单编号"
placeholder-style="font-size:24rpx;"
@input="onInput"
/>
<view class="btn">提交</view>
<view class="btn" @tap="submit">提交</view>
</view>
</template>
</wd-step>
<wd-step>
<template #icon>
<view class="dot-red">
<wd-icon name="close" size="22rpx" color="#fff"></wd-icon>
</view>
</template>
<template #title>
<view class="titlebox">
<text class="title">已取消</text>
</view>
</template>
<template #description>
<view class="descbox">
<text class="desc">2024-08-14 14:47:30</text>
<view class="descbox" v-else>
<text class="desc">{{ item.content }}</text>
<text class="desc">{{ item.time }}</text>
</view>
</template>
</wd-step>
......@@ -101,43 +58,130 @@
<view class="info">
<text class="title">售后信息</text>
<view class="infobox">
<image src="@/static/ticket/logo.png" mode="aspectFill" class="img"></image>
<view class="infobox" v-for="(item, index) in orderDetail.orderItems" :key="index">
<image :src="fileDomain + item.pic" mode="aspectFill" class="img"></image>
<view class="right">
<text>
商品名称商品名称商品名称商品名 商品名称商品名称商品名称商品名 商品名称商品名称
{{ item.prodName }}
</text>
<text class="num">x1</text>
<text class="num">x{{ item.prodCount }}</text>
</view>
</view>
<view class="reasonbox">
<view class="r-between">
<text class="title">申请时间:</text>
<text class="detail">2024-08-14 14:50:35</text>
<text class="detail">{{ orderDetail.applyTime }}</text>
</view>
<view class="r-between">
<text class="title">售后原因:</text>
<text class="detail">这是售后原因最多好像只有这么多字就得隐藏了</text>
<text class="detail">{{ orderDetail.refundMemo }}</text>
</view>
<view class="r-between">
<text class="title">订单号:</text>
<text class="detail">14171819161415723312454</text>
<text class="detail">{{ orderDetail.orderNumber.slice(6) }}</text>
</view>
</view>
</view>
<view style="height: 160rpx"></view>
</view>
<view class="footer">
<view class="btn">撤销申请</view>
<view class="btn-warning">修改申请</view>
<view class="footer" v-if="orderDetail.status === '1'">
<view class="btn" @tap="handleRevoke">撤销申请</view>
<!-- <view class="btn-warning">修改申请</view> -->
</view>
</view>
</template>
<script setup>
import { afterSale, fillGoodsInfo, revokeApplication } from '@/api/order';
import { debounce } from '@/utils/common';
const fileDomain = import.meta.env.VITE_APP_IMG_URL;
const time = ref(30 * 60 * 60 * 1000);
const orderNumber = ref('');
onLoad((options) => {
orderNumber.value = options.orderNumber;
getAterSaleDetail();
});
/**
* 获取订单详情
*/
const orderDetail = ref();
const handleLog = ref([]);
const getAterSaleDetail = async () => {
xma.showLoading({
title: '加载中...',
mask: true,
});
const res = await afterSale({ orderNumber: orderNumber.value });
orderDetail.value = res.data[0];
handleLog.value = res.data[0].handleLog.slice().reverse();
xma.hideLoading();
};
/**
* 撤销申请
* @param {*} afterSalesId
*/
const handleRevoke = () => {
xma.showModal({
title: '提示',
content: '确定要撤销吗?',
success: async (res) => {
if (res.confirm) {
xma.showLoading({
title: '加载中...',
mask: true,
});
await revokeApplication({ afterSalesId: orderDetail.value.afterSalesId });
xma.hideLoading();
xma.showToast({
title: '取消成功',
icon: 'success',
duration: 2000,
});
getAterSaleDetail();
}
},
});
};
const logisticsTrackingNumber = ref('');
const onInput = (e) => {
logisticsTrackingNumber.value = e.detail.value;
};
/**
* 提交物流单号
*/
const submit = debounce(async () => {
console.log(logisticsTrackingNumber.value);
if (!logisticsTrackingNumber.value) {
xma.showToast({
title: '请输入物流单号',
icon: 'none',
duration: 2000,
});
return;
}
const data = {
afterSalesId: orderDetail.value.afterSalesId, // 售后申请id
logisticsNumber: logisticsTrackingNumber.value, // 寄回物品物流单号
};
xma.showLoading({
title: '提交中...',
mask: true,
});
await fillGoodsInfo(data);
xma.hideLoading();
xma.showToast({
title: '提交成功',
icon: 'success',
duration: 2000,
});
getAterSaleDetail();
});
</script>
<style lang="scss" scoped>
......
......@@ -545,7 +545,7 @@ const anotherOrder = () => {
*/
const handleRefund = () => {
xma.navigateTo({
url: `/pages/order/refund?orderNumber=${orderNumber.value}`,
url: `/pages/assistingAgriculture/order/refund?orderNumber=${orderNumber.value}`,
});
};
......
......@@ -7,20 +7,14 @@
<text class="title">退款商品</text>
</view>
<view class="content-item">
<view class="item-top">
<image
class="item-img"
mode="aspectFill"
src="https://img2.baidu.com/it/u=1028011339,1319212411&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=313"
></image>
<view class="item-top itemtop1" v-for="(item2, index) in orderDetail" :key="index">
<image class="item-img" mode="aspectFill" :src="fileDomain + item2.pic"></image>
<view class="item-info">
<text class="text1">
商品名称商品名称商品名称商品名 商品名称商品名称商品名称商品名 商品名称商品名称
</text>
<text class="num">x1</text>
<text class="text2">
商品简介商品简介商品简介商品简介 商品简介商品简介商品简介商品简介
{{ item2.prodName }}
</text>
<text class="num">x{{ item2.prodCount }}</text>
<!-- <rich-text class="text2" :nodes="prodDetail.prod.content"></rich-text> -->
</view>
</view>
<view class="item-buttom1">
......@@ -50,26 +44,11 @@
<text class="icon1">*</text>
</text>
<view class="rightbox">
<text v-if="selectType2">{{ salesList[selectType2].name }}</text>
<text v-if="selectType2">{{ salesList[selectType2 - 1].name }}</text>
<text v-else>请选择售后类型</text>
<wd-icon name="arrow-right" size="22px"></wd-icon>
</view>
</view>
<!-- <view class="content-between">
<text>退款金额</text>
<text class="price">{{ orderDetail.baseOrder.actualTotal }}</text>
</view> -->
<!-- <view class="content-between">
<text>相关图片</text>
<wd-upload
:file-list="fileList"
image-mode="aspectFill"
:action="action"
@change="handleChange"
:header="headers"
accept="image"
></wd-upload>
</view> -->
<view class="content-between" @tap="showPop = true">
<text>
售后原因
......@@ -86,11 +65,8 @@
退款金额
<text class="icon1">*</text>
</text>
<text class="price2">
<wd-input type="text" no-border custom-input-class="text-align:right" v-model="value" />
</text>
<text class="price2">{{ actualTotal }}</text>
</view>
<view class="tishi">可修改,最多商品¥198</view>
</view>
<view class="content-box">
<view class="content-item1">
......@@ -101,6 +77,7 @@
<textarea
placeholder="必填,请您详细填写申请说明"
placeholder-style="font-size:28rpx;color:#000;"
v-model="otherReason"
></textarea>
</wd-cell-group>
<view style="margin-top: 20rpx">
......@@ -132,14 +109,14 @@
<wd-icon name="close" size="20" color="#999" @tap="showGoodPop = false"></wd-icon>
</view>
<radio-group style="width: 100%" @change="radioChange1">
<view class="resaon" v-for="(item, index) in goodsList" :key="index">
<view class="resaon" v-for="(item3, index) in goodsList" :key="index">
<view class="resaon-item">
<text>{{ item.name }}</text>
<text>{{ item3.name }}</text>
<radio
class="radio"
color="#f62828"
:value="item.id"
:checked="item.id == selectType1"
:value="item3.id"
:checked="item3.id == selectType1"
/>
</view>
</view>
......@@ -161,14 +138,14 @@
<wd-icon name="close" size="20" color="#999" @tap="showSalePop = false"></wd-icon>
</view>
<radio-group style="width: 100%" @change="radioChange2">
<view class="resaon" v-for="(item, index) in salesList" :key="index">
<view class="resaon" v-for="(item4, index) in salesList" :key="index">
<view class="resaon-item">
<text>{{ item.name }}</text>
<text>{{ item4.name }}</text>
<radio
class="radio"
color="#f62828"
:value="item.id"
:checked="item.id == selectType2"
:value="item4.id"
:checked="item4.id == selectType2"
/>
</view>
</view>
......@@ -213,7 +190,7 @@ import { applyForARefundApi, getOrderDetail } from '@/api/order';
import { getToken } from '@/utils/auth';
const fileDomain = import.meta.env.VITE_APP_IMG_URL;
const token = getToken();
const value = ref('198.00');
const actualTotal = ref(0);
// 上传图片地址
const action = ref(import.meta.env.VITE_APP_BASE_URL + '/sgyrdd/file/update');
const headers = ref('');
......@@ -231,7 +208,8 @@ onLoad((options) => {
const orderDetail = ref();
const getDetail = async () => {
const res = await getOrderDetail({ orderNumber: orderNumber.value });
orderDetail.value = res.data;
actualTotal.value = res.data.baseOrder.actualTotal;
orderDetail.value = res.data.orderItems;
};
/**
......@@ -254,20 +232,20 @@ const selectType = ref(null);
const goodsList = ref([
{
id: '0',
name: '收到货',
name: '收到货',
},
{
id: '1',
name: '收到货',
name: '收到货',
},
]);
const salesList = ref([
{
id: '0',
id: '1',
name: '仅退款',
},
{
id: '1',
id: '2',
name: '退货退款',
},
]);
......@@ -313,6 +291,7 @@ function radioChange1(evt) {
function radioChange2(evt) {
const { value } = evt.detail;
console.log(evt);
selectType2.value = value;
}
function radioChange(evt) {
......@@ -323,15 +302,27 @@ function radioChange(evt) {
* 提交申请
*/
const submit = async () => {
if (!selectType1.value) {
return xma.showToast({
title: '请选择货物状态',
icon: 'none',
});
}
if (!selectType2.value) {
return xma.showToast({
title: '请选择售后类型',
icon: 'none',
});
}
if (!selectType.value) {
return xma.showToast({
title: '请选择退款原因',
icon: 'none',
});
}
if (selectType.value === '4' && !otherReason.value) {
if (!otherReason.value) {
return xma.showToast({
title: '请输入其他原因',
title: '请输入申请说明',
icon: 'none',
});
}
......@@ -341,8 +332,10 @@ const submit = async () => {
});
await applyForARefundApi({
orderNumber: orderNumber.value,
refundMemo:
selectType.value === '4' ? otherReason.value : reasonList.value[selectType.value].name,
goodsStatus: selectType1.value,
type: selectType2.value,
refundMemo: reasonList.value[selectType.value].name,
illustrate: otherReason.value,
imgs: processingImageAddresses(),
});
setTimeout(() => {
......@@ -391,7 +384,7 @@ const chooseSalessReason = () => {
icon: 'none',
});
}
showGoodPop.value = false;
showSalePop.value = false;
};
/**
* 请选择退款原因
......@@ -411,12 +404,6 @@ const chooseReason = () => {
page {
background: #f3f3f3;
}
:deep(.uni-input-input) {
text-align: right;
font-weight: 700;
font-size: 28rpx;
color: #fa5151;
}
:deep(uni-textarea) {
width: 100%;
background: #f0f0f0;
......@@ -463,7 +450,6 @@ page {
.item-top {
display: flex;
gap: 20rpx;
.item-img {
width: 216rpx;
height: 216rpx;
......@@ -506,6 +492,9 @@ page {
}
}
}
.itemtop1 {
margin-top: 20rpx;
}
.item-buttom1 {
margin-top: 42rpx;
height: 37rpx;
......
......@@ -10,8 +10,8 @@ import { getTokenUser } from '../../api/index';
import { getToken } from '../../utils/auth';
onLoad(async (options) => {
await signIn();
// if (!getToken()) await signIn2();
// await signIn();
if (!getToken()) await signIn2();
const { type } = options;
switch (type) {
case '0':
......
......@@ -415,10 +415,11 @@ const anotherOrder = () => {
};
const toProdDetail = () => {
if (orderDetail.value.baseOrder.prodType === 5) return;
xma.navigateTo({
url: `/pages/assistingAgriculture/RouteDetails/RouteDetails?shopId=${orderDetail.value.baseOrder.shopId}&prodId=${orderDetail.value.orderItems[0].prodId}`,
});
if (orderDetail.value.baseOrder.prodType === 9) {
xma.navigateTo({
url: `/pages/assistingAgriculture/RouteDetails/RouteDetails?shopId=${orderDetail.value.baseOrder.shopId}&prodId=${orderDetail.value.orderItems[0].prodId}`,
});
}
};
</script>
......
......@@ -595,6 +595,12 @@ const handleRemark = (item) => {
* 售后详情
*/
const handleAfterSales = (item) => {
if (item.prodType === 7) {
xma.navigateTo({
url: `/pages/assistingAgriculture/order/afterSales?orderNumber=${item.orderNumber}`,
});
return;
}
xma.navigateTo({
url: `/pages/order/afterSales?orderNumber=${item.orderNumber}`,
});
......
......@@ -8,20 +8,16 @@
<text class="title">单号:{{ orderDetail.orderStore.orderNumber.slice(6) }}</text>
</view>
<view class="content-item">
<view class="item-top">
<image
class="item-img"
mode="aspectFill"
:src="fileDomain + orderDetail.orderItems[0].pic"
></image>
<view class="item-top" v-for="(item, index) in orderDetail.orderItems" :key="index">
<image class="item-img" mode="aspectFill" :src="fileDomain + item.pic"></image>
<view class="item-info">
<text>{{ orderDetail.orderItems[0].prodName }}</text>
<text>{{ orderDetail.orderItems[0].price }}</text>
<text>{{ item.prodName }}</text>
<text>{{ item.price }}</text>
</view>
</view>
<view class="item-buttom" style="padding-top: 60rpx">
<text></text>
<text class="num">{{ orderDetail.orderItems[0].prodCount }}</text>
<text class="num">{{ orderDetail.prodCount }}</text>
<text>件商品 实付款</text>
<text class="icon"></text>
<text class="price">{{ orderDetail.baseOrder.actualTotal }}</text>
......@@ -122,6 +118,11 @@ const orderDetail = ref();
const getDetail = async () => {
const res = await getOrderDetail({ orderNumber: orderNumber.value });
orderDetail.value = res.data;
// 计算购买件数
let count = 0;
orderDetail.value.orderItems.forEach((item) => {
count += item.prodCount;
});
};
/**
......@@ -257,6 +258,9 @@ page {
flex-direction: column;
.content-item {
display: flex;
flex-direction: column;
gap: 20rpx;
border-bottom: 1rpx solid #f3f3f3;
padding: 20rpx 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment