| | |
| | | export default { |
| | | // BASE_URL: 'https://huacheng.psciio.com', |
| | | BASE_URL: 'http://192.168.110.188:6194', |
| | | BASE_URL: 'https://huacheng.psciio.com', |
| | | // BASE_URL: 'http://192.168.110.188:6194', |
| | | imageUrl: 'https://huacheng.psciio.com/api/huacheng-applets/common/uploadimages', |
| | | } |
| | |
| | | count: 1, //默认9 |
| | | sourceType: ['camera', 'album'], |
| | | success: (res) => { |
| | | console.log(res, 'res'); |
| | | uni.showLoading() |
| | | uni.uploadFile({ |
| | | url: config.imageUrl, |
| | |
| | | }) |
| | | }, |
| | | uploadImg(type) { |
| | | // if (!this.againCklicFlag) return |
| | | this.againCklicFlag = false |
| | | if (type == 1) { |
| | | uni.chooseImage({ |
| | | count: 1, |
| | | success: (chooseImageRes) => { |
| | | this.completionImages.push('loading') |
| | | this.againCklicFlag = true |
| | | let imgPathList = chooseImageRes.tempFilePaths; |
| | | if (imgPathList.length > 0) { |
| | | uni.uploadFile({ |
| | |
| | | this.localImageUrls.push(imgPathList[0]) |
| | | }) |
| | | } else { |
| | | this.againCklicFlag = true |
| | | this.completionImages = this.completionImages.filter( |
| | | item => item != 'loading') |
| | | uni.showToast({ |
| | |
| | | } |
| | | }, |
| | | fail: (err) => { |
| | | this.againCklicFlag = true |
| | | this.completionImages = this.completionImages.filter( |
| | | item => item != 'loading') |
| | | uni.showToast({ |
| | |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | } |
| | | }) |
| | | } else { |
| | | uni.chooseVideo({ |
| | | camera: 'back', |
| | | count: 1, //默认9 |
| | | success: (res) => { |
| | | this.completionVideos.push('loading') |
| | | this.againCklicFlag = true |
| | | const tempFilePath = res.tempFilePath; |
| | | uni.uploadFile({ |
| | | url: config.imageUrl, |
| | |
| | | .data) |
| | | }) |
| | | } else { |
| | | this.againCklicFlag = true |
| | | this.completionVideos = this.completionVideos.filter( |
| | | item => item != 'loading') |
| | | uni.showToast({ |
| | |
| | | } |
| | | }, |
| | | fail: (err) => { |
| | | this.againCklicFlag = true |
| | | this.completionVideos = this.completionVideos.filter( |
| | | item => item != 'loading') |
| | | uni.showToast({ |
| | |
| | | let token = uni.getStorageSync('token') |
| | | let header = { |
| | | 'content-type': type ? 'application/x-www-form-urlencoded;charset=UTF-8' : 'application/json', |
| | | 'Authorization': token, |
| | | 'Authorization': 'Bearer ' + token, |
| | | 'lang': uni.getStorageSync('locale') === 'zh-Hans' ? 'zh_CN' : 'zh-tw', |
| | | } |
| | | const requestTask = uni.request({ |