新增退货流程
This commit is contained in:
82
pages/refund/aftersale/aftersale.js
Normal file
82
pages/refund/aftersale/aftersale.js
Normal file
@@ -0,0 +1,82 @@
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
order : null,
|
||||
title : [],
|
||||
imgs : null,
|
||||
titleVal: ''
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
wx.showLoading({
|
||||
title: '加载中...',
|
||||
mask : true
|
||||
})
|
||||
wx.$api.refund.refundPreposition(options.id).then(res => {
|
||||
let { title, order } = res.data;
|
||||
console.log(order)
|
||||
console.log(title)
|
||||
this.setData({
|
||||
title,
|
||||
order,
|
||||
titleVal: title[0]
|
||||
})
|
||||
wx.hideLoading()
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 选择退货理由
|
||||
*/
|
||||
onRadio(e){
|
||||
console.log(e.detail.value)
|
||||
},
|
||||
/**
|
||||
* 选择图片上传
|
||||
*/
|
||||
onUpd(){
|
||||
wx.chooseMedia({
|
||||
count : 1,
|
||||
mediaType : ['image'],
|
||||
success : path => {
|
||||
wx.$api.file.uploadImg(path.tempFiles[0].tempFilePath, {}).then(res => {
|
||||
this.setData({
|
||||
imgs: res
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 提交申请
|
||||
*/
|
||||
onSubmit(){
|
||||
let data = {
|
||||
title : this.data.titleVal,
|
||||
pictures : this.data.imgs != null ? this.data.imgs.path : ''
|
||||
}
|
||||
wx.showLoading({
|
||||
title: '加载中...',
|
||||
mask : true
|
||||
})
|
||||
wx.$api.refund.submitRefund(this.data.order.order_no, data).then(res => {
|
||||
wx.showModal({
|
||||
title : '提示',
|
||||
content : res.data,
|
||||
showCancel : false,
|
||||
confirmColor: '#da2b54',
|
||||
success : modalRes => {
|
||||
if(modalRes.confirm){
|
||||
wx.navigateBack()
|
||||
}
|
||||
wx.hideLoading()
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user