Commit e3a8160d by daqian

退款原因

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