请问如何在小程序端删除一个商品数据的同时删除存在云存储中的对应的图片?


delete(e){
    wx.showModal({
      title: '提示',
      content: '是否确定要删除',
      success (res) {
        if (res.confirm == true) {
          wx.cloud.database().collection('merchandise')
          .doc(id)
          .remove()

          wx.cloud.deleteFile({
            fileList: this.data.goods.fileIDs
          })
          .then(res => {
            console.log(res.fileList)
          })
          .catch(error => {
          })

          .then(res=> {
            wx.switchTab({
              url: '/pages/home/home',
            })
            wx.showToast({
              title: '删除成功',
            })
            console.log('删除成功')
          })
          .catch(err=> {
            console.log('删除失败')
          })
        } 

        // 取消删除
        else if (res.cancel == true) {}
      }
    })
  },

集合叫merchandise,字段是fileIDs,存着每条数据的照片所对应的云存储路径。这个代码可以成功删除数据库集合里的数据,但是还是没有办法删除每一条数据对应的在云存储里的图片,求问应该怎么写,非常感谢!