✨ feat:新建收款完成100%
This commit is contained in:
@@ -148,8 +148,46 @@ export default () => {
|
||||
})
|
||||
}
|
||||
|
||||
// product 产品相关,图片、纹理图等 全平台
|
||||
// after-sale 售后(申请退货、退款)相关的、图片、视频 全平台
|
||||
// mall 电子商城相关的 全平台
|
||||
// logistics 物流(发货、提货)相关的、图片、视频 全平台
|
||||
/**
|
||||
* 上传聊天记录图片
|
||||
* @param cdn_upload_type 场景值
|
||||
* @param count // 1时返回一张图片信息, 大于1时返回图片数组
|
||||
* @returns
|
||||
*/
|
||||
const getChatPhoto = (cdn_upload_type: cdn_upload_type_Param, count: number = 1) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
let list: any[] = []
|
||||
Taro.chooseMessageFile({
|
||||
count: count,
|
||||
type: 'image',
|
||||
success: async function (res) {
|
||||
try {
|
||||
if (count > 1) {
|
||||
for (let i = 0; i < res.tempFiles.length; i++) {
|
||||
let data = await uploadCDNImg(res.tempFiles[i], cdn_upload_type, cdn_upload_type)
|
||||
list.push(data)
|
||||
}
|
||||
resolve(list)
|
||||
} else {
|
||||
//兼容以前上传一张的情况
|
||||
let data = await uploadCDNImg(res.tempFiles[0], cdn_upload_type, cdn_upload_type)
|
||||
resolve(data)
|
||||
}
|
||||
} catch (res) {
|
||||
reject(res)
|
||||
}
|
||||
},
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
return {
|
||||
uploadCDNImg,
|
||||
getWxPhoto,
|
||||
getChatPhoto
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user