增加申请售后接口

parent f965b713
...@@ -7,20 +7,14 @@ ...@@ -7,20 +7,14 @@
<text class="title">退款商品</text> <text class="title">退款商品</text>
</view> </view>
<view class="content-item"> <view class="content-item">
<view class="item-top"> <view class="item-top itemtop1" v-for="(item2, index) in orderDetail" :key="index">
<image <image class="item-img" mode="aspectFill" :src="fileDomain + item2.pic"></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-info"> <view class="item-info">
<text class="text1"> <text class="text1">
商品名称商品名称商品名称商品名 商品名称商品名称商品名称商品名 商品名称商品名称 {{ item2.prodName }}
</text>
<text class="num">x1</text>
<text class="text2">
商品简介商品简介商品简介商品简介 商品简介商品简介商品简介商品简介
</text> </text>
<text class="num">x{{ item2.prodCount }}</text>
<!-- <rich-text class="text2" :nodes="prodDetail.prod.content"></rich-text> -->
</view> </view>
</view> </view>
<view class="item-buttom1"> <view class="item-buttom1">
...@@ -50,26 +44,11 @@ ...@@ -50,26 +44,11 @@
<text class="icon1">*</text> <text class="icon1">*</text>
</text> </text>
<view class="rightbox"> <view class="rightbox">
<text v-if="selectType2">{{ salesList[selectType2].name }}</text> <text v-if="selectType2">{{ salesList[selectType2 - 1].name }}</text>
<text v-else>请选择售后类型</text> <text v-else>请选择售后类型</text>
<wd-icon name="arrow-right" size="22px"></wd-icon> <wd-icon name="arrow-right" size="22px"></wd-icon>
</view> </view>
</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"> <view class="content-between" @tap="showPop = true">
<text> <text>
售后原因 售后原因
...@@ -86,11 +65,8 @@ ...@@ -86,11 +65,8 @@
退款金额 退款金额
<text class="icon1">*</text> <text class="icon1">*</text>
</text> </text>
<text class="price2"> <text class="price2">{{ actualTotal }}</text>
<wd-input type="text" no-border custom-input-class="text-align:right" v-model="value" />
</text>
</view> </view>
<view class="tishi">可修改,最多商品¥198</view>
</view> </view>
<view class="content-box"> <view class="content-box">
<view class="content-item1"> <view class="content-item1">
...@@ -101,6 +77,7 @@ ...@@ -101,6 +77,7 @@
<textarea <textarea
placeholder="必填,请您详细填写申请说明" placeholder="必填,请您详细填写申请说明"
placeholder-style="font-size:28rpx;color:#000;" placeholder-style="font-size:28rpx;color:#000;"
v-model="otherReason"
></textarea> ></textarea>
</wd-cell-group> </wd-cell-group>
<view style="margin-top: 20rpx"> <view style="margin-top: 20rpx">
...@@ -132,14 +109,14 @@ ...@@ -132,14 +109,14 @@
<wd-icon name="close" size="20" color="#999" @tap="showGoodPop = false"></wd-icon> <wd-icon name="close" size="20" color="#999" @tap="showGoodPop = false"></wd-icon>
</view> </view>
<radio-group style="width: 100%" @change="radioChange1"> <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"> <view class="resaon-item">
<text>{{ item.name }}</text> <text>{{ item3.name }}</text>
<radio <radio
class="radio" class="radio"
color="#f62828" color="#f62828"
:value="item.id" :value="item3.id"
:checked="item.id == selectType1" :checked="item3.id == selectType1"
/> />
</view> </view>
</view> </view>
...@@ -161,14 +138,14 @@ ...@@ -161,14 +138,14 @@
<wd-icon name="close" size="20" color="#999" @tap="showSalePop = false"></wd-icon> <wd-icon name="close" size="20" color="#999" @tap="showSalePop = false"></wd-icon>
</view> </view>
<radio-group style="width: 100%" @change="radioChange2"> <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"> <view class="resaon-item">
<text>{{ item.name }}</text> <text>{{ item4.name }}</text>
<radio <radio
class="radio" class="radio"
color="#f62828" color="#f62828"
:value="item.id" :value="item4.id"
:checked="item.id == selectType2" :checked="item4.id == selectType2"
/> />
</view> </view>
</view> </view>
...@@ -213,7 +190,7 @@ import { applyForARefundApi, getOrderDetail } from '@/api/order'; ...@@ -213,7 +190,7 @@ import { applyForARefundApi, getOrderDetail } from '@/api/order';
import { getToken } from '@/utils/auth'; import { getToken } from '@/utils/auth';
const fileDomain = import.meta.env.VITE_APP_IMG_URL; const fileDomain = import.meta.env.VITE_APP_IMG_URL;
const token = getToken(); 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 action = ref(import.meta.env.VITE_APP_BASE_URL + '/sgyrdd/file/update');
const headers = ref(''); const headers = ref('');
...@@ -231,7 +208,8 @@ onLoad((options) => { ...@@ -231,7 +208,8 @@ onLoad((options) => {
const orderDetail = ref(); const orderDetail = ref();
const getDetail = async () => { const getDetail = async () => {
const res = await getOrderDetail({ orderNumber: orderNumber.value }); 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); ...@@ -254,20 +232,20 @@ const selectType = ref(null);
const goodsList = ref([ const goodsList = ref([
{ {
id: '0', id: '0',
name: '收到货', name: '收到货',
}, },
{ {
id: '1', id: '1',
name: '收到货', name: '收到货',
}, },
]); ]);
const salesList = ref([ const salesList = ref([
{ {
id: '0', id: '1',
name: '仅退款', name: '仅退款',
}, },
{ {
id: '1', id: '2',
name: '退货退款', name: '退货退款',
}, },
]); ]);
...@@ -313,6 +291,7 @@ function radioChange1(evt) { ...@@ -313,6 +291,7 @@ function radioChange1(evt) {
function radioChange2(evt) { function radioChange2(evt) {
const { value } = evt.detail; const { value } = evt.detail;
console.log(evt);
selectType2.value = value; selectType2.value = value;
} }
function radioChange(evt) { function radioChange(evt) {
...@@ -323,15 +302,27 @@ function radioChange(evt) { ...@@ -323,15 +302,27 @@ function radioChange(evt) {
* 提交申请 * 提交申请
*/ */
const submit = async () => { const submit = async () => {
if (!selectType1.value) {
return xma.showToast({
title: '请选择货物状态',
icon: 'none',
});
}
if (!selectType2.value) {
return xma.showToast({
title: '请选择售后类型',
icon: 'none',
});
}
if (!selectType.value) { if (!selectType.value) {
return xma.showToast({ return xma.showToast({
title: '请选择退款原因', title: '请选择退款原因',
icon: 'none', icon: 'none',
}); });
} }
if (selectType.value === '4' && !otherReason.value) { if (!otherReason.value) {
return xma.showToast({ return xma.showToast({
title: '请输入其他原因', title: '请输入申请说明',
icon: 'none', icon: 'none',
}); });
} }
...@@ -341,8 +332,10 @@ const submit = async () => { ...@@ -341,8 +332,10 @@ const submit = async () => {
}); });
await applyForARefundApi({ await applyForARefundApi({
orderNumber: orderNumber.value, orderNumber: orderNumber.value,
refundMemo: goodsStatus: selectType1.value,
selectType.value === '4' ? otherReason.value : reasonList.value[selectType.value].name, type: selectType2.value,
refundMemo: reasonList.value[selectType.value].name,
illustrate: otherReason.value,
imgs: processingImageAddresses(), imgs: processingImageAddresses(),
}); });
setTimeout(() => { setTimeout(() => {
...@@ -391,7 +384,7 @@ const chooseSalessReason = () => { ...@@ -391,7 +384,7 @@ const chooseSalessReason = () => {
icon: 'none', icon: 'none',
}); });
} }
showGoodPop.value = false; showSalePop.value = false;
}; };
/** /**
* 请选择退款原因 * 请选择退款原因
...@@ -411,12 +404,6 @@ const chooseReason = () => { ...@@ -411,12 +404,6 @@ const chooseReason = () => {
page { page {
background: #f3f3f3; background: #f3f3f3;
} }
:deep(.uni-input-input) {
text-align: right;
font-weight: 700;
font-size: 28rpx;
color: #fa5151;
}
:deep(uni-textarea) { :deep(uni-textarea) {
width: 100%; width: 100%;
background: #f0f0f0; background: #f0f0f0;
...@@ -463,7 +450,6 @@ page { ...@@ -463,7 +450,6 @@ page {
.item-top { .item-top {
display: flex; display: flex;
gap: 20rpx; gap: 20rpx;
.item-img { .item-img {
width: 216rpx; width: 216rpx;
height: 216rpx; height: 216rpx;
...@@ -506,6 +492,9 @@ page { ...@@ -506,6 +492,9 @@ page {
} }
} }
} }
.itemtop1 {
margin-top: 20rpx;
}
.item-buttom1 { .item-buttom1 {
margin-top: 42rpx; margin-top: 42rpx;
height: 37rpx; 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