|
|
@@ -62,7 +62,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="padding flex sub-bottom" style="justify-content: space-around;">
|
|
|
- <button class="cu-btn round line-gray shadow" @click="$Router.push({ name: 'settings' })"
|
|
|
+ <button class="cu-btn round line-gray shadow" @click="back()"
|
|
|
style="width: 205rpx;">取消</button>
|
|
|
<button style="width:443rpx;background: linear-gradient( 90deg, #77B6FF 0%, #449AFF 100%);border-radius:53rpx ;"
|
|
|
class="cu-btn bg-blue round " @click="sumbit">提交审核</button>
|
|
|
@@ -121,6 +121,9 @@
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ back() {
|
|
|
+ uni.navigateBack()
|
|
|
+ },
|
|
|
addImage() {
|
|
|
// 将图片地址添加到图片数组
|
|
|
this.list.push('http://web.shmily.ren/shmily-drag-image/static/4.jpg')
|
|
|
@@ -173,35 +176,44 @@
|
|
|
})
|
|
|
},
|
|
|
ChooseImage() {
|
|
|
+ const remain = 20 - this.form.photo.length
|
|
|
+ if (remain <= 0) {
|
|
|
+ uni.showToast({ title: '最多20张图', icon: 'none' })
|
|
|
+ return
|
|
|
+ }
|
|
|
uni.chooseImage({
|
|
|
- // count: 4, //默认9
|
|
|
+ count: remain,
|
|
|
sizeType: ['compressed'],
|
|
|
sourceType: ['album'], //从相册选择
|
|
|
success: (res) => {
|
|
|
if (res) {
|
|
|
console.log('上传图片', res)
|
|
|
// this[type + 'Img'] = chooseImageRes.tempFilePaths[0];
|
|
|
- uni.uploadFile({
|
|
|
- url: configService.apiUrl + '/sys/common/upload',
|
|
|
- filePath: res.tempFilePaths[0],
|
|
|
- name: "file",
|
|
|
- formData: {
|
|
|
- 'biz': 'temp',
|
|
|
- },
|
|
|
- success: (files) => {
|
|
|
- let data = JSON.parse(files.data);
|
|
|
- if (data.success) {
|
|
|
- if (this.form.photo.length != 0) {
|
|
|
- // this.photoList = this.photoList.concat(res.tempFilePaths)
|
|
|
- this.form.photo.push(configService.apiUrl + '/' + data.message)
|
|
|
-
|
|
|
- } else {
|
|
|
- // this.photoList =res.tempFilePaths
|
|
|
- this.form.photo = [configService.apiUrl + '/' + data.message]
|
|
|
+ if(res.tempFilePaths && res.tempFilePaths.length > 0) {
|
|
|
+ res.tempFilePaths.forEach(item => {
|
|
|
+ uni.uploadFile({
|
|
|
+ url: configService.apiUrl + '/sys/common/upload',
|
|
|
+ filePath: item,
|
|
|
+ name: "file",
|
|
|
+ formData: {
|
|
|
+ 'biz': 'temp',
|
|
|
+ },
|
|
|
+ success: (files) => {
|
|
|
+ let data = JSON.parse(files.data);
|
|
|
+ if (data.success) {
|
|
|
+ if (this.form.photo.length != 0) {
|
|
|
+ // this.photoList = this.photoList.concat(res.tempFilePaths)
|
|
|
+ this.form.photo.push(configService.apiUrl + '/' + data.message)
|
|
|
+
|
|
|
+ } else {
|
|
|
+ // this.photoList =res.tempFilePaths
|
|
|
+ this.form.photo = [configService.apiUrl + '/' + data.message]
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|