Browse Source

售后申请部分改动

master
2021 4 years ago
parent
commit
66d9ba83d5
  1. 64
      api/aftersales.js
  2. 261
      pages/order/GoodsReturn/index.vue
  3. 15
      pages/order/OrderDetails/index.vue
  4. 89
      pages/order/ReturnList/index.vue
  5. 73
      pages/order/ReturnList/listItem.vue
  6. 2
      utils/request.js

64
api/aftersales.js

@ -0,0 +1,64 @@
import request from '@/utils/request'
// 提交售后
/**
*
订单号 orderCode;
服务类型 0仅退款1退货退款 serviceType;
申请原因 reasonForApplication;
申请说明 applicationInstructions;
申请说明图片 applicationDescriptionPicture;
商品数据 productParamList;
*/
export function submitAfterSealsOrder(data) {
return request.post(`/applyForAfterSales`, data, {
login: true
});
}
// 售后订单列表
export function getAfterSealsList (params) {
return request.get('/storeAfterSales/list', params, {
login: true,
});
}
// 售后详情
export function getAfterSalesDeatail(key) {
return request.get(`/applyForAfterSales/${key}`);
}
// 查询订单
export function getAfterSealsDetail (key, id) {
return request.get(`/api/store/detail/${key}/${id}`)
}
// 搜索
export function searchAfterSealsDetail (key) {
return request.get(`/api/store/detail/${key}`)
}
// 撤销售后订单
export function rebackAfterSeals (key, id) {
return request.get(`/api/revoke/revoke/${key}/${id}`)
}
// 获取物流信息
export function getExpressData () {
return request.get('/api/yxExpress')
}
// 添加快递单号
export function addExpressData (params) {
return request.post('/api/addLogisticsInformation', params, {
login: true
})
}
// 删除售后订单
export function deleteAfterSeals (params) {
return request.delete('/api/deleteAfterSalesOrder', params, {
login: true
})
}

261
pages/order/GoodsReturn/index.vue

@ -1,9 +1,10 @@
<!-- 售后提交 -->
<template>
<view class="apply-return">
<!-- 售后提交 -->
<!-- 申请售后 -->
<view class="container" v-if="selected">
<view class="goodsStyle acea-row row-between"
v-for="cart in orderInfo.cartInfo"
v-for="cart in selectProduct"
:key="cart.id"
>
<view class="pictrue">
@ -24,13 +25,13 @@
</view>
</view>
<view class="list">
<view class="item acea-row row-between-wrapper">
<view v-if="serviceType === 1" class="item acea-row row-between-wrapper">
<view>退货件数</view>
<view class="num">{{ orderInfo.totalNum }}</view>
<view class="num">{{ totalNum || 0 }}</view>
</view>
<view class="item acea-row row-between-wrapper">
<view>退款金额</view>
<view class="num">{{ orderInfo.payPrice }}</view>
<view class="num">{{ totalMoney || 0 }}</view>
</view>
<picker :value="reason" :range="reasonList" @change="changeReason">
<view class="item acea-row row-between-wrapper">
@ -41,34 +42,76 @@
</picker>
<view class="item textarea acea-row row-between">
<view>备注说明</view>
<textarea placeholder="填写备注信息,100字以内" class="num" v-model="refund_reason_wap_explain"></textarea>
<textarea class="num"
placeholder="填写备注信息,100字以内"
v-model="refund_reason_wap_explain"
></textarea>
</view>
</view>
<view class="returnBnt bg-color-red" @click="submit">申请退款</view>
<view v-if="serviceType === 0" class="returnBnt bg-color-red" @click="submit">申请退款</view>
<view v-if="serviceType === 1" class="returnBnt bg-color-red" @click="submit">申请退货</view>
</view>
<!-- 选择商品 -->
<view class="selectProduct">
<view class="goodsStyle acea-row row-between"
v-for="cart in orderInfo.cartInfo"
<view class="selectProduct" v-else>
<view class="selectContainer"
v-for="(cart, index) in selectProduct"
:key="cart.id"
>
<view class="checkbox-wrapper">
<checkbox-group @change="switchSelect(index)">
<label class="well-check">
<checkbox color="#eb3729" value :checked="cart.checked"></checkbox>
</label>
</checkbox-group>
</view>
<view class="pictrue">
<image :src="cart.productInfo.image" class="image" />
</view>
<view class="text acea-row row-between">
<view class="name line2">{{ cart.productInfo.storeName }}</view>
<view class="content">
<view class="title">{{ cart.productInfo.storeName || '' }}</view>
<view class="skus">
<view class="sku">
{{ cart.productInfo.attrInfo.sku || '' }}
</view>
<view class="num">x{{ cart.cartNum || 0 }}</view>
</view>
<view class="money">
<view>
{{
<view>
{{
cart.productInfo.attrInfo
? cart.productInfo.attrInfo.price
: cart.productInfo.price
}}
</view>
<view class="num">x{{ cart.cartNum }}</view>
</view>
</view>
</view>
<view class="choose">
<view class="checkTotal">
<checkbox-group @change="allChecked">
<label class="well-check">
<checkbox
color="#eb3729"
value="allSelect"
:checked="isAllSelect"
></checkbox>
<text class="checkAll">全选 ({{ cartCount || 0 }})</text>
</label>
</checkbox-group>
<view class="total">
<view class="proTotal">
{{ orderInfo.totalNum || 0 }}件商品
</view>
<view class="moneyTotal">
合计 {{ orderInfo.totalPrice || 0 }}
</view>
</view>
</view>
<view class="typeBtn">
<view class="button def" @click="chooseType(0)">仅退款</view>
<view class="button redBtn" @click="chooseType(1)">退货退款</view>
</view>
</view>
</view>
</view>
</template>
@ -79,6 +122,9 @@
getRefundReason,
postOrderRefund
} from "@/api/order";
import {
submitAfterSealsOrder
} from '@/api/aftersales.js';
import {
trim
} from "@/utils";
@ -98,13 +144,19 @@
Authorization: "Bearer " + this.$store.state.token
},
id: 0,
selected: true,
selected: false,
orderInfo: {},
rebackList: [],
reasonList: [],
reason: "",
refund_reason_wap_explain: "",
refund_reason_wap_img: []
refund_reason_wap_explain: '',
refund_reason_wap_img: [],
serviceType: null,
//
selectProduct: [],
totalNum: 0,
totalMoney: 0,
isAllSelect: false
};
},
mounted() {
@ -128,11 +180,29 @@
this.refund_reason_wap_img.push(res.data.url);
},
getOrderDetail() {
uni.showLoading({
title: '正在查询商品',
duration: 2000,
})
orderDetail(this.id)
.then(res => {
this.orderInfo = res.data;
this.selectProduct = res.data.cartInfo.map(item => {
item.checked = false
return item
})
if (res.data.cartInfo.length === 0) {
uni.showToast({
title: "订单无可售后商品",
icon: 'none',
duration: 2000
});
return
}
uni.hideLoading()
})
.catch(err => {
uni.hideLoading()
uni.showToast({
title: err.msg || err.response.data.msg|| err.response.data.message,
icon: 'none',
@ -145,10 +215,39 @@
this.reasonList = res.data;
});
},
// 退
switchSelect (index) {
let isAll = true
this.selectProduct[index].checked = !this.selectProduct[index].checked
this.selectProduct.forEach(item => {
if (!item.checked) {
isAll = false
}
})
this.isAllSelect = isAll
},
//
allChecked () {
this.isAllSelect = !this.isAllSelect
this.selectProduct.forEach(item => {
item.checked = this.isAllSelect
})
},
// 退
chooseType (val) {
this.selectProduct = this.selectProduct.map(item => {
if (item.checked) {
this.totalMoney += parseFloat(item.costPrice)
this.totalNum += 1
return item
}
}).filter(r => r)
this.selected = true;
this.serviceType = val;
},
submit() {
const refund_reason_wap_explain = trim(this.refund_reason_wap_explain),
text = this.reason;
if (!text) {
const refund_reason_wap_explain = trim(this.refund_reason_wap_explain);
if (!this.reason) {
uni.showToast({
title: "请选择退款原因",
icon: 'none',
@ -156,21 +255,27 @@
});
return
}
postOrderRefund({
text,
uni: this.orderInfo.orderId,
refund_reason_wap_img: this.refund_reason_wap_img.join(","),
refund_reason_wap_explain
})
.then(res => {
// this.listquery.productParamList.push({
// productId: item.productId
// })
submitAfterSealsOrder({
orderCode: this.orderInfo.orderId,
serviceType: this.serviceType,
reasonForApplication: this.reason,
applicationInstructions: refund_reason_wap_explain,
applicationDescriptionPicture: this.refund_reason_wap_img.join(","),
productParamList: []
}).then(res => {
if (res.status === 200) {
uni.showToast({
title: res.msg,
icon: "success",
duration: 2000
});
setTimeout(() => {
this.$yrouter.back();
}, 1500);
this.$yrouter.push({ path: '/pages/order/ReturnList/index' });
}, 1500)
}
})
.catch(err => {
uni.showToast({
@ -183,3 +288,99 @@
}
};
</script>
<style lang="scss" scoped>
.apply-return{
.selectProduct{
margin-bottom: 180rpx;
.selectContainer{
padding: 20rpx 32rpx;
background-color: #FFF;
display: flex;
align-items: center;
.pictrue{
.image{
width: 180rpx;
height: 180rpx;
}
}
.content{
width: 100%;
height: 100%;
margin-left: 16rpx;
font-size: 24rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
.title{
width: 100%;
height: 80rpx;
text-overflow: ellipsis;
font-size: 28rpx;
}
.skus{
display: flex;
justify-content: space-between;
color: #999999;
}
.money{
margin-top: 10rpx;
display: flex;
view{
color: #EB3729;
}
}
}
}
.choose{
width: 100%;
padding: 20rpx 30rpx;
background-color: #FFF;
position: fixed;
bottom: 0;
height: 180rpx;
.checkTotal{
height: 80rpx;
font-size: 28rpx;
border-bottom: 2rpx solid #F3F4F5;
display: flex;
justify-content: space-between;
align-items: center;
.total{
display: flex;
.proTotal{
color: #666;
}
.moneyTotal{
color: #333;
margin-left: 30rpx;
}
}
}
.typeBtn{
margin-top: 10rpx;
display: flex;
justify-content: flex-end;
align-items: center;
.button{
width: 160rpx;
height: 60rpx;
margin: 0 10rpx;
line-height: 60rpx;
text-align: center;
font-size: 24rpx;
border-radius: 180rpx;
}
.def{
color: #AAAAAA;
border: 2rpx solid #DDDDDD;
}
.redBtn{
color: #FFF;
background-color: #EB3729;
}
}
}
}
}
</style>

15
pages/order/OrderDetails/index.vue

@ -100,7 +100,10 @@
<view class="name">
{{ orderInfo.realName }}
<text class="phone">{{ orderInfo.userPhone }}</text>
<text @click="telPhone(orderInfo.userPhone)" class="iconfont icon-tonghua font-color-red"></text>
<text
@click="telPhone(orderInfo.userPhone)"
class="iconfont icon-tonghua font-color-red"
></text>
</view>
<view>{{ orderInfo.userAddress }}</view>
</view>
@ -118,7 +121,11 @@
<image :src="`${$VUE_APP_RESOURCES_URL}/images/line.jpg`" />
</view>
</template>
<OrderGoods :evaluate="status.type || 0" :isIntegral="isIntegral" :cartInfo="orderInfo.cartInfo || []"></OrderGoods>
<OrderGoods
:evaluate="status.type || 0"
:isIntegral="isIntegral"
:cartInfo="orderInfo.cartInfo || []"
></OrderGoods>
<view class="wrapper">
<view class="item acea-row row-between">
<view>订单编号</view>
@ -233,8 +240,8 @@
<view class="bnt cancel" @click="cancelOrder">取消订单</view>
<view class="bnt bg-color-red" @click="pay = true">立即付款</view>
</template>
<template v-if="status.type == 1">
<view class="bnt cancel" @click="goGoodsReturn(orderInfo)">申请退款</view>
<template v-if="orderInfo.refundStatus === 0 && orderInfo.paid === 1">
<view class="bnt cancel" @click="goGoodsReturn(orderInfo)">申请售后</view>
</template>
<!-- -->
<template v-if="orderInfo.shippingType == 1 && status.type == 2">

89
pages/order/ReturnList/index.vue

@ -1,9 +1,28 @@
<template>
<view class="return-list" ref="container">
<view class="goodWrapper" v-for="(order,orderListIndex) in orderList" :key="orderListIndex">
<!-- 分类查询 -->
<view class="nav">
<view class="item" :class="{ on: listQuery.type === 0 }" @click="changeType(0)">
<view>全部</view>
</view>
<view class="item" :class="{ on: listQuery.type === 1 }" @click="changeType(1)">
<view>售后中</view>
</view>
<view class="item" :class="{ on: listQuery.type === 2 }" @click="changeType(2)">
<view>已完成</view>
</view>
</view>
<!-- 商品列表 -->
<!-- <view class="list">
<ListItem />
</view> -->
<view class="goodWrapper"
v-for="(order,orderListIndex) in orderList"
:key="orderListIndex"
>
<view class="iconfont icon-tuikuanzhong powder" v-if="order._status._type === -1"></view>
<view class="iconfont icon-yituikuan" v-if="order._status._type === -2"></view>
<view class="orderNum">订单号{{ order.orderId }}</view>
<view class="orderNum">订单号{{ order.orderId || '' }}</view>
<view
class="item acea-row row-between-wrapper"
v-for="(cart,cartInfoIndex) in order.cartInfo"
@ -30,7 +49,7 @@
{{ order.cartInfo.length || 0 }}件商品总金额
<text
class="font-color-red price"
>{{ order.payPrice }}</text>
>{{ order.payPrice || 0 }}</text>
</view>
</view>
<view class="noCart" v-if="orderList.length === 0 && page > 1">
@ -44,22 +63,34 @@
<script>
import { getOrderList } from "@/api/order";
import { getAfterSealsList } from "@/api/aftersales.js";
import Loading from "@/components/Loading";
import ListItem from './listItem.vue'
export default {
name: "ReturnList",
components: {
Loading
Loading,
ListItem
},
data() {
return {
orderList: [],
listQuery: {
page: 1,
limit: 20,
type: 0
},
loading: false,
loaded: false
};
},
mounted() {
this.getOrderList();
},
onReachBottom() {
!this.loading && this.getOrderList();
},
methods: {
goGoodsCon(cart) {
this.$yrouter.push({
@ -78,23 +109,49 @@ export default {
const { page, limit } = this;
if (this.loading || this.loaded) return;
this.loading = true;
getOrderList({
page,
limit,
type: -3
}).then(res => {
// getOrderList({
// page,
// limit,
// type: -3
// }).then(res => {
// this.orderList = this.orderList.concat(res.data);
// this.loading = false;
// this.loaded = res.data.length < limit;
// this.page++;
// });
//
getAfterSealsList(this.listQuery).then(res => {
// console.log(res)
this.orderList = this.orderList.concat(res.data);
this.loading = false;
this.loaded = res.data.length < limit;
this.page++;
});
}
},
mounted() {
this.getOrderList();
})
},
onReachBottom() {
!this.loading && this.getOrderList();
changeType (type) {
this.listQuery.type = type
this.getOrderList()
}
}
};
</script>
<style scoped lang="scss">
.return-list{
.nav{
background-color: #FFF;
display: flex;
justify-content: space-around;
.item{
height: 80rpx;
line-height: 80rpx;
font-size: 14px;
font-family: PingFang SC;
color: #333333;
}
.on{
border-bottom: 6rpx solid #EB3729;
}
}
}
</style>

73
pages/order/ReturnList/listItem.vue

@ -0,0 +1,73 @@
<!-- 售后列表内容 -->
<template>
<view class="productItem">
<view class="title">
<view class="shopName">
{{ 'YSHOP商铺' }}
</view>
<view class="status">
<view>审核中</view>
</view>
</view>
<view class="content">
<image src="" mode=""></image>
<view class="info">
<view class="infoTitle">
工装裤男秋冬季韩版潮流潮牌ins直筒宽松阔腿休闲百搭加绒长裤子
</view>
<view class="infoSku">
<view class="sku">
黑色 XL
</view>
<view class="num">
x {{ 1 }}
</view>
</view>
<view class="infoMoney">
退款299.00
</view>
</view>
</view>
<view class="money">
</view>
<view class="btns">
</view>
</view>
</template>
<script>
</script>
<style lang="scss" scoped>
.productItem{
margin: 10rpx 0;
background-color: #FFF;
.title{
height: 80rpx;
padding: 0 30rpx;
color: #333;
font-size: 14px;
display: flex;
justify-content: space-between;
align-items: center;
}
.content{
padding: 20rpx 30rpx;
display: flex;
}
.money{
height: 80rpx;
padding: 0 30rpx;
display: flex;
justify-content: space-between;
}
.btns{
height: 50rpx;
padding: 0 30rpx;
display: flex;
justify-content: flex-end;
}
}
</style>

2
utils/request.js

@ -20,7 +20,7 @@ import cookie from '@/utils/store/cookie'
const fly = new Fly()
fly.config.baseURL = VUE_APP_API_URL
// 小程序请求域名
// 小程序测试请求域名
// #ifdef MP-WEIXIN
fly.config.baseURL = 'http://347i13244b.zicp.vip/api'
// #endif

Loading…
Cancel
Save