| | |
| | | export default { |
| | | // BASE_URL: 'https://huacheng.psciio.com', |
| | | BASE_URL: 'http://192.168.110.188:6194', |
| | | BASE_URL: 'https://3z8tsrt8s2uq.ngrok.xiaomiqiu123.top', |
| | | imageUrl: 'https://huacheng.psciio.com/api/huacheng-applets/common/uploadimages', |
| | | } |
| | |
| | | problemType: '', |
| | | name: '', |
| | | contactNumber: '', |
| | | location: '', |
| | | detailedAddress: '', |
| | | descriptionTitle: '', |
| | | descriptionContent: '', |
| | | videoContent: [], |
| | | latitude: '', |
| | | longitude: '', |
| | | latitude: '30.5061493', |
| | | longitude: '105.574542', |
| | | location: '测试地址', |
| | | images: [], |
| | | videos: [], |
| | | voiceFile: '',//语音文件多个逗号拼接 |
| | |
| | | }, |
| | | submitVoiceInput(e) { |
| | | console.log('eeeeeeeeeeeeeeeeeee', e) |
| | | this.videoContent.push({ url: e.url, data: e.data, playing: false }); |
| | | this.videoContent.push({ |
| | | url: e.url, |
| | | data: e.data, |
| | | playing: false |
| | | }); |
| | | this.voiceInputShow = false; |
| | | }, |
| | | previewImage(index) { |
| | |
| | | const uploadPromises = this.videoContent.map(item => { |
| | | return new Promise((resolve, reject) => { |
| | | console.log('item.data', item.data) |
| | | // uni.chooseAudio({ |
| | | // success: (res)=> { |
| | | // console.log(res.tempFilePaths[0]); |
| | | // uni.uploadFile({ |
| | | // url: config.imageUrl, |
| | | // filePath: res.tempFilePaths[0], // 使用 Blob 数据 |
| | | // name: 'file', |
| | | // header: { |
| | | // // 'Content-Type': 'multipart/form-data', |
| | | // 'Authorization': uni.getStorageSync('token') |
| | | // }, |
| | | // success: (uploadFileRes) => { |
| | | // const response = JSON.parse(uploadFileRes.data); |
| | | // if (response.code === 200) { |
| | | // resolve(response.data); |
| | | // } else { |
| | | // reject(new Error('上传失败')); |
| | | // } |
| | | // }, |
| | | // fail: (error) => { |
| | | // reject(error); |
| | | // } |
| | | // }); |
| | | // } |
| | | // }); |
| | | uni.uploadFile({ |
| | | url: config.imageUrl, |
| | | file: item.data, |
| | | file: item.data, // 使用 Blob 数据 |
| | | name: 'file', |
| | | // fileType: 'audio/mpeg', |
| | | // filePath: item.url, |
| | | // name: 'file', |
| | | header: { |
| | | 'Content-Type': 'multipart/form-data', |
| | | 'Authorization': uni.getStorageSync('token') |
| | | // 'Content-Type': 'multipart/form-data', |
| | | 'Authorization': 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOjE4OTU1MjI1Nzk1MDcwODEyMTgsInR5cGUiOjEsImV4cCI6MTc0Nzk4MzIyMiwiY3JlYXRlZCI6MTc0NjY4NzIyMjAxMX0.pmUfTkxkbBirDMbnMR1IaLsbSiiwHc366_yyAetCzTOWYxTNgmQlmvw26_W62NHLOebB_ZAEgZsPvkJcaLOoPg' |
| | | }, |
| | | success: (uploadFileRes) => { |
| | | const response = JSON.parse(uploadFileRes.data); |
| | |
| | | return new Promise(function(resolve, reject) { |
| | | let token = uni.getStorageSync('token') |
| | | token = |
| | | 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOjE4OTU1MjI1Nzk1MDcwODEyMTgsInR5cGUiOjEsImV4cCI6MTc0Nzk4MzIyMiwiY3JlYXRlZCI6MTc0NjY4NzIyMjAxMX0.pmUfTkxkbBirDMbnMR1IaLsbSiiwHc366_yyAetCzTOWYxTNgmQlmvw26_W62NHLOebB_ZAEgZsPvkJcaLOoPg' |
| | | 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOjE4OTI0MjE4MjgwODU4Mzc4MjYsInR5cGUiOjEsImV4cCI6MTc0OTAxMjMwMSwiY3JlYXRlZCI6MTc0NzcxNjMwMTM0OH0.8C2x0xHFW45XbehroA1uWziKsUdVHFck8VpIOVkS_s0KvAeTbFG7nIeEQEjGq0a8bn6kHIF3q58mJi4H34Q0Cg' |
| | | uni.setStorageSync('token', token) |
| | | let header = { |
| | | 'content-type': type ? 'application/x-www-form-urlencoded;charset=UTF-8' : 'application/json', |