Commit e3a8160d by daqian

退款原因

parent e021da7a
......@@ -23,28 +23,8 @@ wxService.page({
value: 0,
name: '请选择'
},
resonType: [{ // 所有退货原因
value: 0,
name: '请选择'
}, {
value: 1,
name: '质量问题'
}, {
value: 2,
name: '大小尺码问题'
}, {
value: 3,
name: '不想要了'
}, {
value: 4,
name: '卖家发错漏发'
}, {
value: 5,
name: '拍错商品'
}, {
value: 6,
name: '商品实物与描述不同'
}],
// 所有退货原因
resonType: [],
refundAmount: 0,
checkedColor: 'rgb(203, 60, 60)',
pics: [],
......@@ -53,25 +33,20 @@ wxService.page({
},
submitRefund() {
var selectGoods = this.data.cartList.filter(item => item.checked)
// if (selectGoods.length == 0) {
// wx.showToast({
// title: '请选择退款商品',
// icon: 'none'
// })
// return false
// }
// if (this.data.curType.value == 0) {
// wx.showToast({
// title: '请选择退款原因',
// icon: 'none'
// })
// return false
// }
if (selectGoods.length == 0) {
wx.showToast({
title: '请选择退款商品',
icon: 'none'
})
return false
}
if (this.data.curType.value == 0) {
wx.showToast({
title: '请选择退款原因',
icon: 'none'
})
return false
}
let skulist = [];
selectGoods.forEach(item=>{
......@@ -84,21 +59,22 @@ wxService.page({
console.log('selectGoods', skulist)
this.reFundPreview({skuList:skulist})
// var refundCreateDto = this.data.refundCreateDto
// refundCreateDto.reason = this.data.curType.name // 退款原因
// refundCreateDto.skuList = selectGoods.map(function (item) {
// return {
// amount: item.amount,
// count: item.count,
// skuId: item.skuId
// }
// })
var refundCreateDto = this.data.refundCreateDto
refundCreateDto.reason = this.data.curType.name // 退款原因
refundCreateDto.skuList = selectGoods.map(function (item) {
return {
amount: item.amount,
count: item.count,
skuId: item.skuId
}
})
// console.log('refundCreateDto', refundCreateDto)
// this.handelRequestRefund(refundCreateDto)
// this.handelRequestRefund(refundCreateDto)
},
handelRequestRefund(params) {
......@@ -131,22 +107,20 @@ wxService.page({
mask: true
})
const refundReason = {}
const { resonType } = this.data
wxService.post('/sale/refund/reason/buyer/sortAll', refundReason).then(res => {
if (res) {
const { result, data } = res.data
if (result == 0) {
wx.hideLoading()
let newReasonList = []
data.forEach((item, index) => {
let params = {
value: '',
name: ''
}
params.name = item.reason
params.value = index
newReasonList.push(params)
})
let newReasonList = [];
data.forEach((item,index)=>{
const {reason} = item;
newReasonList.push({
name: reason,
value: index + 1
})
});
this.setData({
resonType: newReasonList
})
......
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