电子商城测试版v4

This commit is contained in:
2022-07-04 20:33:39 +08:00
parent 8ec073a085
commit 0a77473193
26 changed files with 419 additions and 81 deletions
+8 -5
View File
@@ -123,17 +123,20 @@ export default () => {
// mall 电子商城相关的 全平台
// logistics 物流(发货、提货)相关的、图片、视频 全平台
type cdn_upload_type_Param = 'product'|'after-sale'|'mall'|'logistics'
const getWxPhoto = (cdn_upload_type: cdn_upload_type_Param) => {
const getWxPhoto = (cdn_upload_type: cdn_upload_type_Param, count: number = 1) => {
return new Promise((resolve, reject) => {
let list:any[] = []
Taro.chooseImage({
count: 1,
count: count,
sizeType: ['original', 'compressed'],
sourceType: ['album', 'camera'],
success: async function (res) {
const file = res.tempFiles[0]
try {
let data = await uploadCDNImg(file, cdn_upload_type, cdn_upload_type)
resolve(data)
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)
} catch(res) {
reject(res)
}