|
|
@@ -1690,6 +1690,71 @@ Page({ |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
uploadFile(e){ |
|
|
|
var that = this; |
|
|
|
wx.chooseMessageFile({ |
|
|
|
count: 1, |
|
|
|
type: 'file', |
|
|
|
success (res) { |
|
|
|
console.log(res); |
|
|
|
// tempFilePath可以作为 img 标签的 src 属性显示图片 |
|
|
|
const tempFilePaths = res.tempFiles |
|
|
|
wx.uploadFile({ |
|
|
|
url: API.URL_GET_UPLOADFILE, |
|
|
|
filePath: tempFilePaths[0].path, |
|
|
|
name: 'file', |
|
|
|
header: { |
|
|
|
"Content-Type": "multipart/form-data",//记得设置 |
|
|
|
"chartset":"utf-8", |
|
|
|
'Authorization':'Bearer '+getApp().globalData.userInfo.token |
|
|
|
}, |
|
|
|
formData:{ |
|
|
|
bankType:'2', |
|
|
|
accountType:'1', |
|
|
|
isPeers:'Y' |
|
|
|
}, |
|
|
|
success (response){ |
|
|
|
console.log(response); |
|
|
|
let list = JSON.parse(response.data); |
|
|
|
console.log(list); |
|
|
|
that.setData({ |
|
|
|
['form.transfers[0].payeeList']:list.rows |
|
|
|
}) |
|
|
|
}, |
|
|
|
fail(res){ |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
downLoad(){ |
|
|
|
wx.downloadFile({ |
|
|
|
url: API.URL_GET_DOWNFILE, //仅为示例,并非真实的资源 |
|
|
|
success (res) { |
|
|
|
console.log(res); |
|
|
|
// 只要服务器有响应数据,就会把响应内容写入文件并进入 success 回调,业务需要自行判断是否下载到了想要的内容 |
|
|
|
if (res.statusCode === 200) { |
|
|
|
var fs = wx.getFileSystemManager(); |
|
|
|
fs.saveFile({ |
|
|
|
tempFilePath:res.tempFilePath, |
|
|
|
success:function(response){ |
|
|
|
console.log(response); |
|
|
|
} |
|
|
|
}) |
|
|
|
// wx.saveFile({ |
|
|
|
// tempFilePath: res.tempFilePath, |
|
|
|
// success:function(response){ |
|
|
|
// console.log(response); |
|
|
|
// } |
|
|
|
// }) |
|
|
|
|
|
|
|
// wx.playVoice({ |
|
|
|
// filePath: res.tempFilePath |
|
|
|
// }) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 生命周期函数--监听页面隐藏 |
|
|
|
*/ |
|
|
|