Commit 0a251873 by 高淑倩

退款原因

parent a73c41ba
...@@ -15,9 +15,9 @@ wxService.page({ ...@@ -15,9 +15,9 @@ wxService.page({
reason: "", // 原因 reason: "", // 原因
skuList: [], skuList: [],
tradeId: 0, tradeId: 0,
proofImgUrls:[] //凭证 proofImgUrls: [] //凭证
}, },
refundMark: '', refundMark: '',
cartList: [], cartList: [],
curType: { // 当前选择原因 curType: { // 当前选择原因
value: 0, value: 0,
...@@ -47,7 +47,7 @@ wxService.page({ ...@@ -47,7 +47,7 @@ wxService.page({
}], }],
refundAmount: 0, refundAmount: 0,
checkedColor: 'rgb(203, 60, 60)', checkedColor: 'rgb(203, 60, 60)',
pics:[], pics: [],
id: '' id: ''
}, },
submitRefund() { submitRefund() {
...@@ -60,7 +60,7 @@ wxService.page({ ...@@ -60,7 +60,7 @@ wxService.page({
}) })
return false return false
} }
if (this.data.curType.value == 0) { if (this.data.curType.value == 0) {
wx.showToast({ wx.showToast({
title: '请选择退款原因', title: '请选择退款原因',
...@@ -68,7 +68,7 @@ wxService.page({ ...@@ -68,7 +68,7 @@ wxService.page({
}) })
return false return false
} }
console.log('selectGoods', selectGoods) console.log('selectGoods', selectGoods)
var refundCreateDto = this.data.refundCreateDto var refundCreateDto = this.data.refundCreateDto
...@@ -82,11 +82,11 @@ wxService.page({ ...@@ -82,11 +82,11 @@ wxService.page({
skuId: item.skuId skuId: item.skuId
} }
}) })
console.log('refundCreateDto', refundCreateDto) console.log('refundCreateDto', refundCreateDto)
this.handelRequestRefund(refundCreateDto) this.handelRequestRefund(refundCreateDto)
}, },
handelRequestRefund(params) { handelRequestRefund(params) {
...@@ -119,36 +119,39 @@ wxService.page({ ...@@ -119,36 +119,39 @@ wxService.page({
mask: true mask: true
}) })
const refundReason = {} const refundReason = {}
const { resonType }= this.data 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()
console.log('data', data) let newReasonList = []
// data.forEach((item,index)=>{ data.forEach((item, index) => {
// resonType.forEach(itemReson=> { let params = {
// itemReson.name = item.reason value: '',
// itemReson.value = item.index name: ''
// }) }
// }) params.name = item.reason
params.value = index
newReasonList.push(params)
})
this.setData({ this.setData({
//resonType resonType: newReasonList
}) })
} }
} }
}) })
}, },
// 上传图片 // 上传图片
_uploadImg(e){ _uploadImg(e) {
if (e.detail){ if (e.detail) {
this.data.refundCreateDto.proofImgUrls.push(e.detail) this.data.refundCreateDto.proofImgUrls.push(e.detail)
this.setData({ this.setData({
'refundCreateDto.proofImgUrls': this.data.refundCreateDto.proofImgUrls 'refundCreateDto.proofImgUrls': this.data.refundCreateDto.proofImgUrls
}) })
} }
}, },
checkPro(e) { checkPro(e) {
var index = e.currentTarget.dataset.index var index = e.currentTarget.dataset.index
const { cartList } = this.data const { cartList } = this.data
...@@ -190,7 +193,7 @@ wxService.page({ ...@@ -190,7 +193,7 @@ wxService.page({
cartList[index].count = proNum cartList[index].count = proNum
this.setData({ this.setData({
cartList: cartList cartList: cartList
}, ()=> { }, () => {
// this.getReturnPrice() // this.getReturnPrice()
// this.editOk(cartList[e]) //调用完成 // this.editOk(cartList[e]) //调用完成
}) })
...@@ -199,7 +202,7 @@ wxService.page({ ...@@ -199,7 +202,7 @@ wxService.page({
var index = e.currentTarget.dataset.index var index = e.currentTarget.dataset.index
var cartList = this.data.cartList var cartList = this.data.cartList
var proNum = cartList[index].count var proNum = cartList[index].count
console.log('增加数量',proNum) console.log('增加数量', proNum)
proNum++ proNum++
...@@ -207,16 +210,16 @@ wxService.page({ ...@@ -207,16 +210,16 @@ wxService.page({
this.setData({ this.setData({
cartList: cartList cartList: cartList
}, () => { }, () => {
}) })
}, },
inputNum: function (e) { // 输入数量 inputNum: function (e) { // 输入数量
var newNum = e.detail.value var newNum = e.detail.value
var order = this.data.cartList var order = this.data.cartList
var index = e.currentTarget.dataset.index var index = e.currentTarget.dataset.index
var refundNum = order[index].count var refundNum = order[index].count
console.log('inputNum', index, newNum, refundNum) console.log('inputNum', index, newNum, refundNum)
if (newNum === '' || newNum === '0') { if (newNum === '' || newNum === '0') {
...@@ -254,7 +257,6 @@ wxService.page({ ...@@ -254,7 +257,6 @@ wxService.page({
onShow: function () { onShow: function () {
const { params } = this.options const { params } = this.options
let detail = JSON.parse(params) let detail = JSON.parse(params)
console.log('detail', params, detail.id)
// item.checked // item.checked
detail.skuVOList.forEach(item => { detail.skuVOList.forEach(item => {
...@@ -265,7 +267,7 @@ wxService.page({ ...@@ -265,7 +267,7 @@ wxService.page({
cartList: detail.skuVOList, cartList: detail.skuVOList,
refundAmount: detail.payAmount, refundAmount: detail.payAmount,
'refundCreateDto.tradeId': detail.id 'refundCreateDto.tradeId': detail.id
},()=>{ }, () => {
// 退款原因列表 /refund/reason/buyer/sortAll // 退款原因列表 /refund/reason/buyer/sortAll
this.getReasonList() this.getReasonList()
}) })
......
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