增加申请售后接口

parent f965b713
......@@ -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;
......
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