|
|
@ -30,24 +30,17 @@ |
|
|
|
|
|
|
|
<view class="title">{{ i18n.IDcard }}</view> |
|
|
|
|
|
|
|
|
|
|
|
<!-- <u-form-item :border-bottom="false"> |
|
|
|
<view class="imageList"> |
|
|
|
<view class="upload" @click="uploadImg" :key="index"> |
|
|
|
<image class="add" src="/static/home/icon-ADD-18.png" mode=""></image> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="" v-for="item,index in imgJson"> |
|
|
|
<image class="add" :src="baseURL+item" mode="" ></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</u-form-item> --> |
|
|
|
|
|
|
|
<u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple |
|
|
|
:maxCount="1"> |
|
|
|
|
|
|
|
<image class="add" src="/static/home/id.png" mode="aspectFit" v-if="!bankInfo.certImg"></image> |
|
|
|
|
|
|
|
<image :src="baseURL+bankInfo.certImg" |
|
|
|
mode="" style="width: 160rpx;height: 160rpx;" v-if="bankInfo.certImg"></image> |
|
|
|
mode="" class="add" v-if="bankInfo.certImg"></image> |
|
|
|
</u-upload> |
|
|
|
<view class=""> |
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="inputBody"> |
|
|
@ -159,6 +152,10 @@ |
|
|
|
|
|
|
|
// 新增图片 |
|
|
|
async afterRead(event) { |
|
|
|
uni.showLoading({ |
|
|
|
title: this.$t("withdrawal").shang, |
|
|
|
mask: true, |
|
|
|
}) |
|
|
|
// 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式 |
|
|
|
let lists = [].concat(event.file) |
|
|
|
console.log(event) |
|
|
@ -166,8 +163,8 @@ |
|
|
|
lists.map((item) => { |
|
|
|
this[`fileList${event.name}`].push({ |
|
|
|
...item, |
|
|
|
status: 'uploading', |
|
|
|
message: '上传中' |
|
|
|
// status: 'uploading', |
|
|
|
// message: '上传中' |
|
|
|
}) |
|
|
|
}) |
|
|
|
for (let i = 0; i < lists.length; i++) { |
|
|
@ -195,11 +192,13 @@ |
|
|
|
api.uploadImg({ |
|
|
|
img: res |
|
|
|
}).then(res => { |
|
|
|
uni.hideLoading() |
|
|
|
this.bankInfo.certImg=res |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch(error => { |
|
|
|
uni.hideLoading() |
|
|
|
console.error(error) |
|
|
|
}) |
|
|
|
|
|
|
@ -242,60 +241,7 @@ |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 上传图片 |
|
|
|
uploadImg() { |
|
|
|
uni.chooseImage({ |
|
|
|
success: async (chooseImageRes) => { |
|
|
|
console.log(111) |
|
|
|
// chooseImageRes: '上传的图片列表', 小程序只支持一次一次选择一个 |
|
|
|
const tempFiles = chooseImageRes.tempFiles; |
|
|
|
const tempFilePaths = tempFiles[0].path; |
|
|
|
const FilePaths = tempFiles[0]; |
|
|
|
let resSize = tempFiles[0].size; |
|
|
|
console.log(tempFiles) |
|
|
|
console.log(FilePaths) |
|
|
|
let base = await this.getBase64(FilePaths) |
|
|
|
|
|
|
|
console.log(base) |
|
|
|
base = base.replace('data:image/png;base64,', '') |
|
|
|
console.log(base) |
|
|
|
// if (resSize > 10485760) { |
|
|
|
// uni.showToast({ |
|
|
|
// title: "上传图片大小不能超过10MB", |
|
|
|
// icon: 'error' |
|
|
|
// }); |
|
|
|
// return |
|
|
|
// } |
|
|
|
|
|
|
|
uni.showLoading({ |
|
|
|
title: '正在上传图片', |
|
|
|
mask: true |
|
|
|
}) |
|
|
|
api.uploadImg({ |
|
|
|
img: base |
|
|
|
}).then(res => { |
|
|
|
this.imgJson.push(res) |
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
fail: (res) => { |
|
|
|
uni.hideLoading() |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
//放大浏览图片 |
|
|
|
previewImg(currentIndex) { |
|
|
|
let urls = [] |
|
|
|
if (this.imgJson != '') { |
|
|
|
urls.push(this.imgJson.url) |
|
|
|
} |
|
|
|
uni.previewImage({ |
|
|
|
current: currentIndex, //传的值可以是索引,也可以是图片连接 |
|
|
|
urls, //需要显示的全部图片链接 |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 获取银行卡信息 |
|
|
@ -339,47 +285,21 @@ |
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|
.imageList { |
|
|
|
margin-top: 30rpx; |
|
|
|
display: flex; |
|
|
|
|
|
|
|
.image-item { |
|
|
|
position: relative; |
|
|
|
margin-right: 26rpx; |
|
|
|
|
|
|
|
image { |
|
|
|
width: 100rpx; |
|
|
|
height: 100rpx; |
|
|
|
border-radius: 8rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.del { |
|
|
|
position: absolute; |
|
|
|
right: -10rpx; |
|
|
|
top: -10rpx; |
|
|
|
width: 36rpx; |
|
|
|
height: 36rpx; |
|
|
|
} |
|
|
|
/deep/ .uicon-camera-fill{ |
|
|
|
display:none !important; |
|
|
|
} |
|
|
|
|
|
|
|
.upload { |
|
|
|
background-color: #323045; |
|
|
|
border-radius: 8rpx; |
|
|
|
width: 100rpx; |
|
|
|
height: 100rpx; |
|
|
|
text-align: center; |
|
|
|
line-height: 110rpx; |
|
|
|
|
|
|
|
/deep/ .u-upload{ |
|
|
|
position:relative; |
|
|
|
.add{ |
|
|
|
width: 36rpx; |
|
|
|
height: 36rpx; |
|
|
|
} |
|
|
|
width: 620rpx !important; |
|
|
|
height: 360rpx !important; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/deep/ .u-upload__wrap__preview__image { |
|
|
|
width: 160rpx !important; |
|
|
|
height: 160rpx !important; |
|
|
|
width: 620rpx !important; |
|
|
|
height: 360rpx !important; |
|
|
|
} |
|
|
|
|
|
|
|
/deep/ .u-icon__icon { |
|
|
@ -387,8 +307,8 @@ |
|
|
|
} |
|
|
|
|
|
|
|
/deep/ .u-upload__button { |
|
|
|
width: 160rpx !important; |
|
|
|
height: 160rpx !important; |
|
|
|
width: 620rpx !important; |
|
|
|
height: 360rpx !important; |
|
|
|
background-color: #323045 !important; |
|
|
|
} |
|
|
|
|
|
|
|