| | |
| | | class="adduser_list_item_ipt1_upload" |
| | | v-for="(item, i) in submitFileList" |
| | | :key="i" |
| | | ><image |
| | | > |
| | | <u-icon |
| | | class="close" |
| | | size="20" |
| | | name="close-circle-fill" |
| | | color="red" |
| | | @click="fileDel('submitFileList', i)" |
| | | ></u-icon> |
| | | <image |
| | | v-if="item.type == 0" |
| | | :src="item.fileurlFull" |
| | | mode="widthFix" |
| | |
| | | class="adduser_list_item_ipt1_upload" |
| | | v-for="(item, i) in dealBeforeFileList" |
| | | :key="i" |
| | | ><image |
| | | > |
| | | <u-icon |
| | | class="close" |
| | | size="20" |
| | | name="close-circle-fill" |
| | | color="red" |
| | | @click="fileDel('dealBeforeFileList', i)" |
| | | ></u-icon> |
| | | <image |
| | | v-if="item.type == 0" |
| | | :src="item.fileurlFull" |
| | | mode="widthFix" |
| | |
| | | class="adduser_list_item_ipt1_upload" |
| | | v-for="(item, i) in dealAfterFileList" |
| | | :key="i" |
| | | ><image |
| | | > |
| | | <u-icon |
| | | class="close" |
| | | size="20" |
| | | name="close-circle-fill" |
| | | color="red" |
| | | @click="fileDel('dealAfterFileList', i)" |
| | | ></u-icon> |
| | | <image |
| | | v-if="item.type == 0" |
| | | :src="item.fileurlFull" |
| | | mode="widthFix" |
| | |
| | | } |
| | | }) |
| | | }, |
| | | fileDel(str, i) { |
| | | this[str].splice(i, 1) |
| | | }, |
| | | uploadBeImage() { |
| | | this.showUploadBe = false |
| | | let token = uni.getStorageSync('token') || '' |
| | | uni.chooseImage({ |
| | | count: 1, |
| | | count: 4, |
| | | success: (chooseImageRes) => { |
| | | console.log('chooseImageRes.tempFilePaths', chooseImageRes.tempFilePaths) |
| | | uni.showLoading({ title: '上传中', mask: true }) |
| | | for (let i = 0; i < chooseImageRes.tempFilePaths.length; i++) { |
| | | const tempFilePaths = chooseImageRes.tempFilePaths |
| | | let imgs = tempFilePaths.map((value, index) => { |
| | | return { |
| | | name: 'file', |
| | | uri: value |
| | | } |
| | | }) |
| | | uni.uploadFile({ |
| | | url: `${uploadUrl}`, |
| | | filePath: chooseImageRes.tempFilePaths[i], |
| | | files: imgs, |
| | | name: 'file', |
| | | formData: { |
| | | folderCode: 'HIDDEN_DANGER_FILE' |
| | | folder: 'HIDDEN_DANGER_FILE' |
| | | }, |
| | | header: { |
| | | Dm_user_token: token |
| | | }, |
| | | success: (uploadFileRes) => { |
| | | let res = JSON.parse(uploadFileRes.data) |
| | | console.log('res', res) |
| | | let obj = { |
| | | type: '0' |
| | | } |
| | | obj.fileurl = res.data.halfPath |
| | | obj.fileurlFull = res.data.addr |
| | | this.dealBeforeFileList.push(obj) |
| | | }, |
| | | complete() { |
| | | if (i === chooseImageRes.tempFilePaths.length - 1) { |
| | | uni.hideLoading() |
| | | } |
| | | } |
| | | if (res.data && res.data.length > 0) { |
| | | res.data.forEach(i => { |
| | | i.type = 0 |
| | | i.fileurl = i.imgaddr |
| | | i.fileurlFull = i.url |
| | | this.dealBeforeFileList.push(i) |
| | | }) |
| | | } |
| | | }, |
| | | fail(err) { |
| | | console.log('err', err) |
| | | }, |
| | | complete() { |
| | | uni.hideLoading() |
| | | // if (i === chooseImageRes.tempFilePaths.length - 1) { |
| | | // uni.hideLoading() |
| | | // } |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | uploadBeVideo() { |
| | | this.showUploadBe = false |
| | | let that = this |
| | | let token = uni.getStorageSync('token') || '' |
| | | uni.chooseVideo({ |
| | | success: (chooseImageRes) => { |
| | | uni.showLoading({ title: '上传中', mask: true }) |
| | | uni.uploadFile({ |
| | | url: `${uploadUrl}`, |
| | | filePath: chooseImageRes.tempFilePath, |
| | | header: { |
| | | Dm_user_token: token |
| | | }, |
| | | name: 'file', |
| | | formData: { |
| | | folderCode: 'HIDDEN_DANGER_FILE' |
| | | folder: 'HIDDEN_DANGER_FILE' |
| | | }, |
| | | success: (uploadFileRes) => { |
| | | let res = JSON.parse(uploadFileRes.data) |
| | | console.log('res', res) |
| | | let obj = { |
| | | type: '1' |
| | | if (res.data && res.data.length > 0) { |
| | | res.data.forEach(i => { |
| | | i.type = 1 |
| | | i.fileurl = i.imgaddr |
| | | i.fileurlFull = i.url |
| | | this.dealBeforeFileList.push(i) |
| | | }) |
| | | } |
| | | obj.fileurl = res.data.halfPath |
| | | obj.fileurlFull = res.data.addr |
| | | this.dealBeforeFileList.push(obj) |
| | | }, |
| | | complete() { |
| | | uni.hideLoading() |
| | |
| | | }, |
| | | uploadAfImage() { |
| | | this.showUploadAf = false |
| | | let token = uni.getStorageSync('token') || '' |
| | | uni.chooseImage({ |
| | | count: 1, |
| | | count: 4, |
| | | success: (chooseImageRes) => { |
| | | console.log('chooseImageRes.tempFilePaths', chooseImageRes.tempFilePaths) |
| | | uni.showLoading({ title: '上传中', mask: true }) |
| | | for (let i = 0; i < chooseImageRes.tempFilePaths.length; i++) { |
| | | const tempFilePaths = chooseImageRes.tempFilePaths |
| | | let imgs = tempFilePaths.map((value, index) => { |
| | | return { |
| | | name: 'file', |
| | | uri: value |
| | | } |
| | | }) |
| | | uni.uploadFile({ |
| | | url: `${uploadUrl}`, |
| | | filePath: chooseImageRes.tempFilePaths[i], |
| | | files: imgs, |
| | | name: 'file', |
| | | formData: { |
| | | folderCode: 'HIDDEN_DANGER_FILE' |
| | | folder: 'HIDDEN_DANGER_FILE' |
| | | }, |
| | | header: { |
| | | Dm_user_token: token |
| | | }, |
| | | success: (uploadFileRes) => { |
| | | let res = JSON.parse(uploadFileRes.data) |
| | | console.log('res', res) |
| | | let obj = { |
| | | type: '0' |
| | | } |
| | | obj.fileurl = res.data.halfPath |
| | | obj.fileurlFull = res.data.addr |
| | | this.dealAfterFileList.push(obj) |
| | | }, |
| | | complete() { |
| | | if (i === chooseImageRes.tempFilePaths.length - 1) { |
| | | uni.hideLoading() |
| | | } |
| | | } |
| | | if (res.data && res.data.length > 0) { |
| | | res.data.forEach(i => { |
| | | i.type = 0 |
| | | i.fileurl = i.imgaddr |
| | | i.fileurlFull = i.url |
| | | this.dealAfterFileList.push(i) |
| | | }) |
| | | } |
| | | }, |
| | | fail(err) { |
| | | console.log('err', err) |
| | | }, |
| | | complete() { |
| | | uni.hideLoading() |
| | | // if (i === chooseImageRes.tempFilePaths.length - 1) { |
| | | // uni.hideLoading() |
| | | // } |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | uploadAfVideo() { |
| | | this.showUploadAf = false |
| | | let that = this |
| | | let token = uni.getStorageSync('token') || '' |
| | | uni.chooseVideo({ |
| | | success: (chooseImageRes) => { |
| | | uni.showLoading({ title: '上传中', mask: true }) |
| | | uni.uploadFile({ |
| | | url: `${uploadUrl}`, |
| | | filePath: chooseImageRes.tempFilePath, |
| | | header: { |
| | | Dm_user_token: token |
| | | }, |
| | | name: 'file', |
| | | formData: { |
| | | folderCode: 'HIDDEN_DANGER_FILE' |
| | | folder: 'HIDDEN_DANGER_FILE' |
| | | }, |
| | | success: (uploadFileRes) => { |
| | | let res = JSON.parse(uploadFileRes.data) |
| | | console.log('res', res) |
| | | let obj = { |
| | | type: '1' |
| | | if (res.data && res.data.length > 0) { |
| | | res.data.forEach(i => { |
| | | i.type = 1 |
| | | i.fileurl = i.imgaddr |
| | | i.fileurlFull = i.url |
| | | this.dealAfterFileList.push(i) |
| | | }) |
| | | } |
| | | obj.fileurl = res.data.halfPath |
| | | obj.fileurlFull = res.data.addr |
| | | this.dealAfterFileList.push(obj) |
| | | }, |
| | | complete() { |
| | | uni.hideLoading() |
| | |
| | | }, |
| | | uploadImage() { |
| | | this.showUpload = false |
| | | let token = uni.getStorageSync('token') || '' |
| | | uni.chooseImage({ |
| | | count: 1, |
| | | count: 4, |
| | | success: (chooseImageRes) => { |
| | | console.log('chooseImageRes.tempFilePaths', chooseImageRes.tempFilePaths) |
| | | uni.showLoading({ title: '上传中', mask: true }) |
| | | for (let i = 0; i < chooseImageRes.tempFilePaths.length; i++) { |
| | | const tempFilePaths = chooseImageRes.tempFilePaths |
| | | let imgs = tempFilePaths.map((value, index) => { |
| | | return { |
| | | name: 'file', |
| | | uri: value |
| | | } |
| | | }) |
| | | uni.uploadFile({ |
| | | url: `${uploadUrl}`, |
| | | filePath: chooseImageRes.tempFilePaths[i], |
| | | files: imgs, |
| | | name: 'file', |
| | | formData: { |
| | | folderCode: 'HIDDEN_DANGER_FILE' |
| | | folder: 'HIDDEN_DANGER_FILE' |
| | | }, |
| | | header: { |
| | | Dm_user_token: token |
| | | }, |
| | | success: (uploadFileRes) => { |
| | | let res = JSON.parse(uploadFileRes.data) |
| | | console.log('res', res) |
| | | let obj = { |
| | | type: '0' |
| | | } |
| | | obj.fileurl = res.data.halfPath |
| | | obj.fileurlFull = res.data.addr |
| | | this.submitFileList.push(obj) |
| | | }, |
| | | complete() { |
| | | if (i === chooseImageRes.tempFilePaths.length - 1) { |
| | | uni.hideLoading() |
| | | } |
| | | } |
| | | if (res.data && res.data.length > 0) { |
| | | res.data.forEach(i => { |
| | | i.type = 0 |
| | | i.fileurl = i.imgaddr |
| | | i.fileurlFull = i.url |
| | | this.submitFileList.push(i) |
| | | }) |
| | | } |
| | | }, |
| | | fail(err) { |
| | | console.log('err', err) |
| | | }, |
| | | complete() { |
| | | uni.hideLoading() |
| | | // if (i === chooseImageRes.tempFilePaths.length - 1) { |
| | | // uni.hideLoading() |
| | | // } |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | uploadVideo() { |
| | | this.showUpload = false |
| | | let that = this |
| | | let token = uni.getStorageSync('token') || '' |
| | | uni.chooseVideo({ |
| | | success: (chooseImageRes) => { |
| | | uni.showLoading({ title: '上传中', mask: true }) |
| | | uni.uploadFile({ |
| | | url: `${uploadUrl}`, |
| | | filePath: chooseImageRes.tempFilePath, |
| | | header: { |
| | | Dm_user_token: token |
| | | }, |
| | | name: 'file', |
| | | formData: { |
| | | folderCode: 'HIDDEN_DANGER_FILE' |
| | | folder: 'HIDDEN_DANGER_FILE' |
| | | }, |
| | | success: (uploadFileRes) => { |
| | | let res = JSON.parse(uploadFileRes.data) |
| | | console.log('res', res) |
| | | let obj = { |
| | | type: '1' |
| | | if (res.data && res.data.length > 0) { |
| | | res.data.forEach(i => { |
| | | i.type = 1 |
| | | i.fileurl = i.imgaddr |
| | | i.fileurlFull = i.url |
| | | this.submitFileList.push(i) |
| | | }) |
| | | } |
| | | obj.fileurl = res.data.halfPath |
| | | obj.fileurlFull = res.data.addr |
| | | this.submitFileList.push(obj) |
| | | }, |
| | | complete() { |
| | | uni.hideLoading() |
| | |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | overflow: hidden; |
| | | position: relative; |
| | | .close { |
| | | position: absolute; |
| | | right: -20rpx; |
| | | top: -20rpx; |
| | | z-index: 9999; |
| | | } |
| | | image { |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | video { |
| | | width: 100%; |
| | | max-height: 120rpx; |
| | | } |
| | | } |
| | | } |