退款完善

This commit is contained in:
1154079537 2024-06-08 16:11:45 +08:00
parent 02b558210a
commit 6422b072fc
4 changed files with 436 additions and 267 deletions

View File

@ -3,7 +3,8 @@
<view class="address-popup">
<view class="head-title">提货点</view>
<view class="list-admin">
<up-search placeholder="请输入提货点名称" @search="searchKeyword" v-model="keyword" @custom="searchKeyword"></up-search>
<up-search placeholder="请输入提货点名称" @search="searchKeyword" v-model="keyword"
@custom="searchKeyword"></up-search>
</view>
<scroll-view style="height: 600rpx;padding-bottom: 20rpx;" scroll-y>
<view class="list-li border" v-for="(item,index) in list" :key="index" @click="addressType=item.mer_id">
@ -19,11 +20,13 @@
{{item.mer_address||''}}
</view>
<view style="color: #999;">
<text v-if="item.service_phone" @click.stop="onCall(item.service_phone)">{{item.mer_real_name||''}}
<text v-if="item.service_phone"
@click.stop="onCall(item.service_phone)">{{item.mer_real_name||''}}
{{ item.service_phone||'' }}</text>
</view>
<view class="check">
<image style="width: 36rpx;height: 36rpx" v-if="addressType==item.mer_id" src="@/static/icon/check.png">
<image style="width: 36rpx;height: 36rpx" v-if="addressType==item.mer_id"
src="@/static/icon/check.png">
</image>
<image style="width: 36rpx;height: 36rpx" v-else src="@/static/icon/n-check.png"></image>
</view>
@ -107,6 +110,7 @@
font-weight: bold;
text-align: center;
margin-bottom: 20rpx;
padding: 20rpx;
}
.list-admin {

View File

@ -5,30 +5,30 @@
<up-cell-group :border="false" class="cellGroup">
<up-cell title="退款原因" :value="refundForm.refund_message?refundForm.refund_message:'请选择'"
titleStyle="color:#444;font-size:30rpx;" isLink :required="true" @click="show = true"></up-cell>
<up-cell title="退款件数" :border="false">
<!-- <up-cell title="退款件数" :border="false">
<template #value>
<up-number-box v-model="refundForm.refund_num"></up-number-box>
</template>
</up-cell>
</up-cell> -->
</up-cell-group>
</view>
<!-- 商品信息 -->
<view class="afterSales-goods">
<view class="afterSales-goods-wrap">
<view class="afterSales-goods-wrap" v-for="(item,indx) in goodsList" :key="indx">
<view class="afterSales-goods-left">
<up-image width="140rpx" height="140rpx" border="8rpx"></up-image>
<up-image width="140rpx" height="140rpx" radius="8rpx" :src="item.image" />
</view>
<view class="afterSales-goods-right">
<view class="afterSales-goods-right-title">
<text class="goods_name">黄牛牛腩</text>
<text class="goods_name">{{item.store_name}}</text>
<text class="goods_price">
<text style='font-size: 24rpx;'></text>
<text style="font-size: 32rpx;">10</text>
<text style="font-size: 32rpx;">{{item.price}}</text>
</text>
</view>
<view class="afterSales-goods-right-info">
<text class="goods_desc">牛腩块</text>
<text class="goods_desc">{{item.unit}}</text>
<text class="goods_num">x5</text>
</view>
</view>
@ -53,11 +53,11 @@
<view class="afterSales-remark">
<view class="afterSales-remark-title">
<view class="afterSales-remark-title-txt">备注说明</view>
<view class="afterSales-remark-title-count">0/200</view>
<view class="afterSales-remark-title-count"></view>
</view>
<view class="afterSales-remark-textarea">
<up-textarea :count="true"></up-textarea>
<up-textarea :count="true" v-model="refundForm.mark"></up-textarea>
</view>
<view class="afterSales-remark-title">
@ -71,7 +71,7 @@
</view>
<!-- btn -->
<view class="afterSales-btn">
<view class="afterSales-btn" @click="onSubmitApply">
<view class="afterSales-btn-wrap">
<text>提交申请</text>
</view>
@ -107,7 +107,8 @@
} from "vue";
import {
orderListApi,
refundReasonListApi
refundReasonListApi,
applyRefundApi
} from "@/api/order.js";
import {
config
@ -128,10 +129,26 @@
refund_message: '', //退
refund_num: '', //退
id: '', //id
old_cart_id: '', //id
old_cart_id: [], //id
refund_type: '', //0 退 1 退退 2
refund_reason_wap_img: '',
mark: ''
});
const goodsList = ref([]);
onLoad(() => {
getRefundReasonData();
//
const eventChannel = instance.getOpenerEventChannel();
eventChannel.on('orderDetail', function(data) {
console.log(data);
refundForm.id = data.id;
refundForm.old_cart_id = data.old_cart_id;
refundForm.refund_type = data.refund_type;
goodsList.value = data.goodsList;
})
});
const shopInfo = ref(null);
//
const fileList1 = ref([]);
@ -175,6 +192,9 @@
},
success: (res) => {
setTimeout(() => {
if (typeof res.data == 'string') {
res.data = JSON.parse(res.data)
}
resolve(res.data.data);
}, 1000);
},
@ -182,23 +202,37 @@
});
};
onLoad(() => {
getRefundReasonData();
const eventChannel = instance.getOpenerEventChannel();
eventChannel.on('orderDetail', function(data) {
shopInfo.value = data;
refundForm.value.id = shopInfo.value.order_id;
refundForm.value.old_cart_id = shopInfo.value.cart_id;
})
});
// 退
// 退
const onSubmitReason = () => {
show.value = false;
refundForm.refund_message = refundType.value;
}
//
const onSubmitApply = () => {
if (!refundForm.refund_message) return uni.$u.toast('请选择退款原因');
let urls = [];
// refund_reason_wap_img
if (fileList1.value.length > 0) {
fileList1.value.map(i => {
console.log(i.url.uri);
urls.push(i.url.uri);
});
refundForm.refund_reason_wap_img = urls.join(',');
}
applyRefundApi(refundForm).then(res => {
if (res.code == 1) {
uni.$u.toast(res.msg);
uni.$u.sleep(1500).then(res => {
uni.navigateBack();
})
} else {
uni.$u.toast(res.msg);
}
})
}
//
const refundReasonList = ref([]);
const getRefundReasonData = () => {

View File

@ -415,7 +415,8 @@
//访
productLogApi({
product_id: item.product_id,
cate_id: item.cate_id
cate_id: item.cate_id,
store_id: uni.getStorageSync('STORE_INFO').id || ''
});
};

View File

@ -53,30 +53,52 @@
<view class="afterSales-type">
<view class="afterSales-type-title">售后类型</view>
<view class="afterSales-type-con">
<view class="afterSales-type-item">仅退款</view>
<view class="afterSales-type-item">退款退货</view>
<view class="afterSales-type-item">换货</view>
<view class="afterSales-type-item" :class="{'fuck-active':afterSalesType===0}"
@click="afterSalesType=0">仅退款</view>
<view class="afterSales-type-item" :class="{'fuck-active':afterSalesType==1}"
@click="afterSalesType=1">退款退货</view>
<view class="afterSales-type-item" :class="{'fuck-active':afterSalesType==2}"
@click="afterSalesType=2">换货</view>
</view>
<view class="afterSales-type-tip" v-if="afterSalesType===0">当前售后类型仅支持未备货商品</view>
<view class="afterSales-type-tip" v-if="afterSalesType==1">当前售后类型仅支持非生鲜类商品</view>
<view class="afterSales-type-tip" v-if="afterSalesType==2">当前售后类型仅支持选择单个商品</view>
</view>
<view class="scroll-wrap">
<scroll-view style="max-height: 50vh;padding-bottom: 20rpx;" scroll-y>
<block v-for="(item,index) in refundReasonList" :key="index">
<view class="row" @click="refundType = item.value">
<view class="content">
<view class="top"></view>
<view class="bottom u-line-2">{{item.value}}</view>
<block v-for="(item,index) in goodsList" :key="index">
<view class="goods">
<view class="goods-item">
<view class="goods-item-left">
<view class="goods-item-left-img">
<up-image width="164rpx" height="164rpx" :src="item.image" radius="8rpx" />
</view>
<image v-if="refundType==item.value" src="@/static/icon/check.png"></image>
<view class="goods-item-left-info">
<view class="goods_name">{{item.store_name}}</view>
<view class="goods_detail">
<view class="goods-detail_num">数量{{item.cart_num}}</view>
<view class="goods_detail_price">
<text class="symbol"></text>
<text class="numbers">{{item.price}}</text>
</view>
</view>
</view>
</view>
<view class="goods-item-right" @click="onChooseGoods(item)">
<image v-if="item.isSelected" src="@/static/icon/check.png"></image>
<image v-else src="@/static/icon/n-check.png"></image>
</view>
</view>
</view>
</block>
</scroll-view>
</view>
<view style="height: 120rpx;display: flex;justify-content: center;padding: 0 30rpx;align-items: center;"
@click="onPageToAfterSales">
<up-button color="#20B128" shape="circle" @click="onSubmitReason">提交</up-button>
</view>
</view>
</up-popup>
</template>
@ -188,18 +210,58 @@
})
}
const refundShow = ref(true);
// <!--sb-->
const refundShow = ref(false);
const goodsList = ref([]); //
const afterSalesType = ref(''); // 0 1 2
const orderId = ref('');
//
const applyAfterSales = (item) => {
refundShow.value = true;
goodsList.value = item.goods_list;
orderId.value = item.order_id;
}
//
const onPageToAfterSales = () => {
if (afterSalesType.value === '') return uni.$u.toast('请选择售后类型');
if (!goodsList.value || goodsList.value.length == 0) return uni.$u.toast('暂无可申请售后的商品');
let goods = goodsList.value.find(i => i.isSelected);
if (goods == undefined) return uni.$u.toast('请选择需要申请售后的商品');
let ids = [];
let goodsListSel = [];
goodsList.value.map(i => {
if (i.isSelected) {
ids.push(i.old_cart_id);
goodsListSel.push(i);
}
});
uni.navigateTo({
url: "/pages/afterSales/afterSales",
success(res) {
res.eventChannel.emit('orderDetail', item)
refundShow.value = false; // close modal
res.eventChannel.emit('orderDetail', {
id: orderId.value, //id
old_cart_id: ids,
refund_type: afterSalesType.value,
goodsList: goodsListSel
})
}
})
}
//
const onChooseGoods = (item) => {
if (item.hasOwnProperty('isSelected')) {
item.isSelected = !item.isSelected;
} else {
item.isSelected = true;
}
}
const rePay = (e) => {
rePaymentApi({
order_id: e.id,
@ -369,66 +431,134 @@
}
.address-popup {
padding: 30rpx;
// padding: 30rpx;
background-color: #F6F6F6;
.head-title {
font-weight: bold;
text-align: center;
margin-bottom: 20rpx;
padding: 20rpx;
}
.list-admin {
display: flex;
justify-content: space-between;
margin-bottom: 20rpx;
.afterSales-type {
margin: 0 20rpx 20rpx;
background: #FFFFFF;
border-radius: 16rpx;
padding: 20rpx;
box-sizing: border-box;
.admin-btn {
display: flex;
color: #20B128;
.afterSales-type-title {
font-size: 32rpx;
color: #444444;
margin-bottom: 28rpx;
}
.btn {
margin-left: 20rpx;
.afterSales-type-con {
display: flex;
align-items: center;
margin-bottom: 20rpx;
&:active {
color: rgba(#20B128, 0.8);
transition: background-color 0.5s;
animation: disappear 0.5s 0.5s forwards;
}
}
.afterSales-type-item {
width: 200rpx;
height: 70rpx;
line-height: 70rpx;
border-radius: 12rpx;
color: #777777;
border: 2rpx solid #D3D3D3;
font-size: 28rpx;
text-align: center;
&:not(:nth-last-child(1)) {
margin-right: 24rpx;
}
}
.row {
.fuck-active {
color: #FC452F;
border: 2rpx solid #FC452F;
font-weight: 600;
}
}
.afterSales-type-tip {
font-size: 20rpx;
color: #FC452F;
}
}
.scroll-wrap {
margin: 0 20rpx;
background: #FFFFFF;
border-radius: 16rpx;
padding: 20rpx 20rpx 1rpx;
box-sizing: border-box;
.goods {
.goods-item {
display: flex;
align-items: center;
justify-content: space-between;
padding-bottom: 20rpx;
border-bottom: 1rpx solid #f6f6f6;
margin-bottom: 20rpx;
margin-bottom: 30rpx;
&:last-child {
border-bottom: none;
margin-bottom: 0;
}
.content {
.top {
.goods-item-left {
display: flex;
align-items: center;
view {
.goods-item-left-img {
margin-right: 20rpx;
}
.goods-item-left-info {
display: flex;
flex-direction: column;
justify-content: space-between;
height: 164rpx;
.goods_name {
font-size: 28rpx;
color: #060606;
max-width: 400rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.bottom {}
.goods_detail {
display: flex;
align-items: center;
.goods-detail_num {
margin-right: 30rpx;
font-size: 28rpx;
color: #333333;
}
.goods_detail_price {
display: flex;
.symbol {
align-self: flex-end;
font-size: 22rpx;
color: #333333;
}
.numbers {
font-size: 32rpx;
color: #333333;
}
}
}
}
}
.goods-item-right {
image {
width: 40rpx;
height: 40rpx;
flex-shrink: 0;
width: 48rpx;
height: 48rpx;
}
}
}
}
}
}