123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- Page({
- data: {
- addresses: [
- {
- address: '宁夏青铜峡市秦岭路846号'
- },
- {
- address: '浙江省永康市红旗桥湖滨大道124号'
- }
- ],
- souimg: '',
- shanchu: '',
- xiugaiimg: '',
- dingweiimg: '',
- },
- onLoad(options) {
- // const title = options.title ? decodeURIComponent(options.title) : '商品列表';
- // this.setData({ title });
- // wx.setNavigationBarTitle({ title });
- const fileIDs = [
- 'cloud://cloud1-6g98iw7i28b01747.636c-cloud1-6g98iw7i28b01747-1367995226/images/icon/sou.png',
- 'cloud://cloud1-6g98iw7i28b01747.636c-cloud1-6g98iw7i28b01747-1367995226/images/icon/shanchu.png',
- 'cloud://cloud1-6g98iw7i28b01747.636c-cloud1-6g98iw7i28b01747-1367995226/images/icon/xiugai.png',
- 'cloud://cloud1-6g98iw7i28b01747.636c-cloud1-6g98iw7i28b01747-1367995226/images/icon/dingwei.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({
- souimg: tempFilePaths[0],
- shanchu: tempFilePaths[1],
- xiugaiimg: tempFilePaths[2],
- dingweiimg: tempFilePaths[3],
- });
- }).catch(err => {
- console.error('有文件下载失败:', err);
- });
- },
- handleEdit(e) {
- const index = e.currentTarget.dataset.index;
- // 处理编辑逻辑
- },
- handleDelete(e) {
- const index = e.currentTarget.dataset.index;
- // 处理删除逻辑
- },
- handleAddAddress() {
- // 处理添加地址逻辑
- }
- });
|