|
@ -29,6 +29,18 @@ |
|
|
<u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon> |
|
|
<u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon> |
|
|
</view> |
|
|
</view> |
|
|
</u-form-item> |
|
|
</u-form-item> |
|
|
|
|
|
<view class="image"> |
|
|
|
|
|
<view class="image-list" v-if='imgList.length>0'> |
|
|
|
|
|
<view class="image-item" v-for="(item,index) in imgList" :key="index"> |
|
|
|
|
|
<image :src="item" mode=""></image> |
|
|
|
|
|
<u-icon name="close-circle-fill" color="red" class="close" size="36" @click="delImage(index)"> |
|
|
|
|
|
</u-icon> |
|
|
|
|
|
</view> |
|
|
|
|
|
</view> |
|
|
|
|
|
<view class="image-item image-item1" @click="chooseImage" v-if='imgList.length<3'> |
|
|
|
|
|
<image src="../../static/images/photo.png" mode=""></image> |
|
|
|
|
|
</view> |
|
|
|
|
|
</view> |
|
|
</u-form> |
|
|
</u-form> |
|
|
<view class="footer"> |
|
|
<view class="footer"> |
|
|
<view class="btns"> |
|
|
<view class="btns"> |
|
@ -46,6 +58,8 @@ |
|
|
import * as deviceApi from "@/api/device.js" |
|
|
import * as deviceApi from "@/api/device.js" |
|
|
import * as moldApi from "@/api/mold.js" |
|
|
import * as moldApi from "@/api/mold.js" |
|
|
import * as dictApi from "@/api/dict.js" |
|
|
import * as dictApi from "@/api/dict.js" |
|
|
|
|
|
import * as uploadApi from "@/api/upload.js" |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
@ -63,6 +77,7 @@ |
|
|
singleColumnShow: false, |
|
|
singleColumnShow: false, |
|
|
singleColumnDefaultValue: [], |
|
|
singleColumnDefaultValue: [], |
|
|
singleColumnList: [], |
|
|
singleColumnList: [], |
|
|
|
|
|
imgList: [] |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
@ -181,7 +196,34 @@ |
|
|
this.$emit('singleColumn', this.field, this.form[this.field]) |
|
|
this.$emit('singleColumn', this.field, this.form[this.field]) |
|
|
this.$forceUpdate() |
|
|
this.$forceUpdate() |
|
|
}, |
|
|
}, |
|
|
|
|
|
chooseImage() { |
|
|
|
|
|
uni.chooseImage({ |
|
|
|
|
|
count: 1, // 默认9 |
|
|
|
|
|
sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有 |
|
|
|
|
|
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有 |
|
|
|
|
|
success: (res) => { |
|
|
|
|
|
let filePath = res.tempFilePaths[0] |
|
|
|
|
|
this.$modal.loading() |
|
|
|
|
|
uploadApi.uploadFile({ |
|
|
|
|
|
filePath: filePath, |
|
|
|
|
|
name: 'file', |
|
|
|
|
|
formData: { |
|
|
|
|
|
'user': 'test' |
|
|
|
|
|
}, |
|
|
|
|
|
}).then(ret => { |
|
|
|
|
|
this.$modal.closeLoading() |
|
|
|
|
|
this.imgList.push(ret.data) |
|
|
|
|
|
console.log(ret) |
|
|
|
|
|
}).catch((err) => { |
|
|
|
|
|
this.$modal.closeLoading() |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
// 删除图片 |
|
|
|
|
|
delImage(index) { |
|
|
|
|
|
this.imgList.splice(index, 1) |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
async onLoad(option) { |
|
|
async onLoad(option) { |
|
|
if (option.type) this.type = option.type; |
|
|
if (option.type) this.type = option.type; |
|
@ -239,6 +281,7 @@ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.select { |
|
|
.select { |
|
|
display: flex; |
|
|
display: flex; |
|
|
align-items: center; |
|
|
align-items: center; |
|
@ -258,6 +301,7 @@ |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.footer { |
|
|
.footer { |
|
|
position: fixed; |
|
|
position: fixed; |
|
|
bottom: 0px; |
|
|
bottom: 0px; |
|
@ -302,4 +346,51 @@ |
|
|
text-align: center; |
|
|
text-align: center; |
|
|
font-size: 28rpx; |
|
|
font-size: 28rpx; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.image { |
|
|
|
|
|
padding: 0px 30rpx; |
|
|
|
|
|
padding-bottom: 30rpx; |
|
|
|
|
|
display: flex; |
|
|
|
|
|
align-items: center; |
|
|
|
|
|
|
|
|
|
|
|
flex-wrap: wrap; |
|
|
|
|
|
|
|
|
|
|
|
.image-list { |
|
|
|
|
|
display: flex; |
|
|
|
|
|
align-items: center; |
|
|
|
|
|
flex-wrap: wrap; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.image-item { |
|
|
|
|
|
width: 210rpx; |
|
|
|
|
|
height: 210rpx; |
|
|
|
|
|
margin-right: 20rpx; |
|
|
|
|
|
position: relative; |
|
|
|
|
|
border: 1px solid rgba(230, 230, 230, 0.5); |
|
|
|
|
|
margin-bottom: 20rpx; |
|
|
|
|
|
border-radius: 20rpx; |
|
|
|
|
|
overflow: hidden; |
|
|
|
|
|
|
|
|
|
|
|
image { |
|
|
|
|
|
width: 100%; |
|
|
|
|
|
height: 100%; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.close { |
|
|
|
|
|
position: absolute; |
|
|
|
|
|
right: 0px; |
|
|
|
|
|
top: 0px; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.image-item1 { |
|
|
|
|
|
border: none; |
|
|
|
|
|
margin-right: 0px; |
|
|
|
|
|
|
|
|
|
|
|
image { |
|
|
|
|
|
width: 100%; |
|
|
|
|
|
height: 100%; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
</style> |
|
|
</style> |