剪板流程
This commit is contained in:
@@ -4,6 +4,7 @@ import { GetWxUserInfoApi, GetAdminUserInfoApi, GetPhoneNumberApi } from "@/api/
|
||||
import useLoginRequest from "./useLoginRequest"
|
||||
import { SHARE_SCENE } from "@/common/enum"
|
||||
import { GetShortCodeApi } from "@/api/share"
|
||||
import { alert } from "@/common/common"
|
||||
|
||||
export default () => {
|
||||
const {setUserInfo, setAdminUserInfo, setSortCode, userInfo} = useUserInfo()
|
||||
|
||||
@@ -114,8 +114,39 @@ export default () => {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传手机图片
|
||||
* @param cdn_upload_type //CDN 文件上传场景值
|
||||
*/
|
||||
// product 产品相关,图片、纹理图等 全平台
|
||||
// after-sale 售后(申请退货、退款)相关的、图片、视频 全平台
|
||||
// mall 电子商城相关的 全平台
|
||||
// logistics 物流(发货、提货)相关的、图片、视频 全平台
|
||||
type cdn_upload_type_Param = 'product'|'after-sale'|'mall'|'logistics'
|
||||
const getWxPhoto = (cdn_upload_type: cdn_upload_type_Param) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
Taro.chooseImage({
|
||||
count: 1, // 默认9
|
||||
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)
|
||||
} catch(res) {
|
||||
reject(res)
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
return {
|
||||
uploadCDNImg
|
||||
uploadCDNImg,
|
||||
getWxPhoto
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user