首页 > 其他 > 详细

提交图片

时间:2018-09-26 21:09:51      阅读:176      评论:0      收藏:0      [点我收藏+]
/**
* 提交表单 提请支付
*/
submit: function(e) {
console.log(e)
let value = e.detail.value;
/**
* 判断每个input是否为空
*/
if (value.a_money == ‘‘) {
wx.showToast({
title: ‘装修金额不能为空‘,
icon: ‘none‘,
})
return false;
}
console.log("that.data.array[value.st].ct_id", that.data.array[value.st].ct_id)
let data = {
ct_id: that.data.array[value.st].ct_id, //业主id
com_id: that.data.com_id, //装修公司id
a_money: value.a_money, //申请金额
a_note: value.a_note, //进度说明
"cmd": "apply_company",
}
console.log(data)
wx.uploadFile({
url: app.globalData.api + ‘api.php‘,
filePath: that.data.submit_image_array[0],
name: ‘a_pic‘,
formData: data,
// method: "post",
// header: {
// "Content-Type": "application/x-www-form-urlencoded"
// },
success: function(res) {

console.log(res)
let data = JSON.parse(res.data)
console.log(data)
if (data.flag == 1) {
wx.showToast({
title: ‘提请支付成功!‘
})
} else {
wx.showToast({
title: ‘提请支付失败!‘,
icon: ‘none‘
})
}
},
fail: function(res) {
wx.showToast({
title: ‘请检查网络设置!‘,
icon: ‘none‘
})
},
complete: function(res) {
wx.hideLoading();
}
})

},

提交图片

原文:https://www.cnblogs.com/xiaoruaning/p/9709598.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!