Commit dcbabe22 authored by 李俊赕's avatar 李俊赕

删除操作

parent 8e34738c
......@@ -5,7 +5,8 @@
<u-icon name="arrow-right" color="#666" size="28"></u-icon>
</view>
<view class="pics u-flex u-flex-wrap">
<u-image class="pic" v-for="item in 6" width="170rpx" height="170" src="'https://cdn.uviewui.com/uview/example/fade.jpg"></u-image>
<u-image class="pic" v-for="(item,index) in imgList" width="170rpx" height="170" :src="item.path"></u-image>
<!-- <u-image class="pic" v-for="item in 6" width="170rpx" height="170" src="'https://cdn.uviewui.com/uview/example/fade.jpg"></u-image> -->
</view>
<u-popup v-model="maskShow" mode="center" width="500">
<view class="upload-box u-p-30">
......@@ -51,37 +52,28 @@
// 弹窗展示
this.maskShow = true
},
chooseImage(){
},
uploadFile(type){
async uploadFile(type){
const self = this
if(type&&type==='photo'){
// 直接打开相册
this.chooseImage()
let config = {
options:{
consourceType:['album'],//['album', 'camera']
}
}
await this.chooseImage('qiniu',config)
self.setValue()
return
}
// 使用拍照工具拍摄
},
checkStatus(item){
if(!item){
return false
}
const dataValue = this.dataValue
let flag = Array.isArray(dataValue) && dataValue.indexOf(item)>-1
console.log(flag,'flag')
return flag
},
setValue(txt) {
const dataValue = this.dataValue || []
let idx = dataValue.indexOf(txt)
if (idx > -1) {
dataValue.splice(idx,1)
} else {
dataValue.push(txt)
}
this.dataValue = dataValue
this.valueChange(this.dataValue)
setValue() {
const dataValue = []
this.imgList.map(item=>{
dataValue.push(item.key)
})
this.valueChange(dataValue)
}
}
}
......
......@@ -31,7 +31,8 @@ export default {
/**
* 上传图片公用组件
* @param {Object} type 文件上传方式
* @param {Object} attr 文件属性:图片种类[category](身份证、证件、头像),其他
* @param {Object} attr 文件属性:图片种类[category](身份证、证件、头像);
* 图片上传其他配置[options】(如,选择图片或拍摄options.consourceType,['album', 'camera'];)其他
*/
async chooseImage(type, attr={}){
const self = this
......@@ -39,6 +40,7 @@ export default {
if(type==='qiniu'){
// 图片种类
let category = attr && attr.category || self.categories[0]
let config = attr && attr.options || {} // 图片上传参数配置
// 七牛上传
let options = {
onProgressUpdate(res){
......@@ -67,7 +69,8 @@ export default {
self.imgList = imgList
console.log(res,'res---onEachUpdate')
},
cardType: category
cardType: category,
...config
}
// 不需要进度条等可直接获取
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment