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

删除操作

parent 8e34738c
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
<u-icon name="arrow-right" color="#666" size="28"></u-icon> <u-icon name="arrow-right" color="#666" size="28"></u-icon>
</view> </view>
<view class="pics u-flex u-flex-wrap"> <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> </view>
<u-popup v-model="maskShow" mode="center" width="500"> <u-popup v-model="maskShow" mode="center" width="500">
<view class="upload-box u-p-30"> <view class="upload-box u-p-30">
...@@ -51,37 +52,28 @@ ...@@ -51,37 +52,28 @@
// 弹窗展示 // 弹窗展示
this.maskShow = true this.maskShow = true
}, },
chooseImage(){ async uploadFile(type){
const self = this
},
uploadFile(type){
if(type&&type==='photo'){ if(type&&type==='photo'){
// 直接打开相册 // 直接打开相册
this.chooseImage() let config = {
options:{
consourceType:['album'],//['album', 'camera']
}
}
await this.chooseImage('qiniu',config)
self.setValue()
return return
} }
// 使用拍照工具拍摄 // 使用拍照工具拍摄
}, },
checkStatus(item){ setValue() {
if(!item){ const dataValue = []
return false this.imgList.map(item=>{
} dataValue.push(item.key)
const dataValue = this.dataValue })
let flag = Array.isArray(dataValue) && dataValue.indexOf(item)>-1 this.valueChange(dataValue)
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)
} }
} }
} }
......
...@@ -31,7 +31,8 @@ export default { ...@@ -31,7 +31,8 @@ export default {
/** /**
* 上传图片公用组件 * 上传图片公用组件
* @param {Object} type 文件上传方式 * @param {Object} type 文件上传方式
* @param {Object} attr 文件属性:图片种类[category](身份证、证件、头像),其他 * @param {Object} attr 文件属性:图片种类[category](身份证、证件、头像);
* 图片上传其他配置[options】(如,选择图片或拍摄options.consourceType,['album', 'camera'];)其他
*/ */
async chooseImage(type, attr={}){ async chooseImage(type, attr={}){
const self = this const self = this
...@@ -39,6 +40,7 @@ export default { ...@@ -39,6 +40,7 @@ export default {
if(type==='qiniu'){ if(type==='qiniu'){
// 图片种类 // 图片种类
let category = attr && attr.category || self.categories[0] let category = attr && attr.category || self.categories[0]
let config = attr && attr.options || {} // 图片上传参数配置
// 七牛上传 // 七牛上传
let options = { let options = {
onProgressUpdate(res){ onProgressUpdate(res){
...@@ -67,7 +69,8 @@ export default { ...@@ -67,7 +69,8 @@ export default {
self.imgList = imgList self.imgList = imgList
console.log(res,'res---onEachUpdate') 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