123456789101112131415161718192021222324252627282930313233343536 |
- // subpackages/orderdetails/orderdetails.js
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- dingwei: '',
- fuzhi: '',
- yesbaoguo: '',
- },
- onLoad() {
- const fileIDs = [
- 'cloud://cloud1-6g98iw7i28b01747.636c-cloud1-6g98iw7i28b01747-1367995226/images/icon/dingwei.png',
- 'cloud://cloud1-6g98iw7i28b01747.636c-cloud1-6g98iw7i28b01747-1367995226/images/icon/fuzhi.png',
- 'cloud://cloud1-6g98iw7i28b01747.636c-cloud1-6g98iw7i28b01747-1367995226/images/icon/yesbaoguo.png'
- ];
-
- // 并发下载多个 fileID
- Promise.all(
- fileIDs.map(fileID => wx.cloud.downloadFile({ fileID }))
- ).then(results => {
- // 每个 result 对应一个下载结果
- const tempFilePaths = results.map(r => r.tempFilePath);
- console.log('全部下载成功:', tempFilePaths);
- this.setData({
- dingwei: tempFilePaths[0],
- fuzhi: tempFilePaths[1],
- yesbaoguo: tempFilePaths[2],
- });
- }).catch(err => {
- console.error('有文件下载失败:', err);
- });
- },
- })
|