wangfukang 2 months ago
parent
commit
ae64e55532
  1. 193
      package3/shop/merchantRegister.vue

193
package3/shop/merchantRegister.vue

@ -46,15 +46,18 @@
</label>
</view>
</view>
<view class="value" style="height: 200rpx;">
<view class="name" style="flex: 1;line-height: 200rpx;">
<view class="value image-row">
<view class="name image-name">
门头图
</view>
<view class="text" style="width: 180rpx;padding-top: 10rpx;" @tap="pictureAdd('mentou')">
<view class="upload-img" v-if="formData.shopIcon ==''" style="background: rgba(247, 248, 248, 0.6);text-align: center;line-height: 180rpx;">
<uni-icons type="camera" size="28" color="#777"></uni-icons>
<view class="text single-upload">
<view class="image-card" @tap="pictureAdd('mentou')">
<view class="upload-img" v-if="formData.shopIcon ==''">
<uni-icons type="camera" size="28" color="#777"></uni-icons>
</view>
<img :src="formData.shopIcon" v-if="formData.shopIcon !=''" alt="" class="upload-img">
<view class="delete-img" v-if="formData.shopIcon !=''" @tap.stop="deleteImage('mentou')">×</view>
</view>
<img :src="formData.shopIcon" v-if="formData.shopIcon !=''" alt="" class="upload-img">
</view>
</view>
</view>
@ -120,23 +123,24 @@
</view>
</view>
<view class="content">
<view class="value id-card-row" style="height: 200rpx;">
<view class="name" style="flex: 1;line-height: 200rpx;">
<view class="value id-card-row image-row">
<view class="name image-name">
法人身份证正反面
</view>
<view class="text id-card-upload" style="width: 340rpx;display: flex;padding-top: 20rpx;">
<view>
<view class="upload-img" v-if="formData.zhengzhao ==''" @tap="pictureAdd('zheng')"
style="background: rgba(247, 248, 248, 0.6);text-align: center;line-height: 180rpx;">
<view class="text id-card-upload">
<view class="image-card" @tap="pictureAdd('zheng')">
<view class="upload-img" v-if="formData.zhengzhao ==''">
<uni-icons type="camera" size="28" color="#777"></uni-icons>
</view>
<img :src="formData.zhengzhao" v-if="formData.zhengzhao !=''" alt="" class="upload-img">
<view class="delete-img" v-if="formData.zhengzhao !=''" @tap.stop="deleteImage('zheng')">×</view>
</view>
<view>
<view class="upload-img" @tap="pictureAdd('fan')" v-if="formData.fanzhao ==''" style="background: rgba(247, 248, 248, 0.6);text-align: center;line-height: 180rpx;margin-left: 20rpx;">
<view class="image-card" @tap="pictureAdd('fan')">
<view class="upload-img" v-if="formData.fanzhao ==''">
<uni-icons type="camera" size="28" color="#777"></uni-icons>
</view>
<img :src="formData.fanzhao" v-if="formData.fanzhao !=''" alt="" class="upload-img" style="margin-left: 20rpx;">
<img :src="formData.fanzhao" v-if="formData.fanzhao !=''" alt="" class="upload-img">
<view class="delete-img" v-if="formData.fanzhao !=''" @tap.stop="deleteImage('fan')">×</view>
</view>
</view>
</view>
@ -158,29 +162,40 @@
</view>
</view>
<view class="content">
<view class="value" style="height: 200rpx;">
<view class="name" style="flex: 1;line-height: 200rpx;">
<view class="value image-row">
<view class="name image-name">
营业执照
</view>
<view class="text" style="width: 180rpx;padding-top: 10rpx;" @tap="pictureAdd('yingye')">
<view class="upload-img" v-if="formData.yingyezhizhao ==''" style="background: rgba(247, 248, 248, 0.6);text-align: center;line-height: 180rpx;">
<uni-icons type="camera" size="28" color="#777"></uni-icons>
<view class="text single-upload">
<view class="image-card" @tap="pictureAdd('yingye')">
<view class="upload-img" v-if="formData.yingyezhizhao ==''">
<uni-icons type="camera" size="28" color="#777"></uni-icons>
</view>
<img :src="formData.yingyezhizhao" v-if="formData.yingyezhizhao !=''" alt="" class="upload-img">
<view class="delete-img" v-if="formData.yingyezhizhao !=''" @tap.stop="deleteImage('yingye')">×</view>
</view>
<img :src="formData.yingyezhizhao" v-if="formData.yingyezhizhao !=''" alt="" class="upload-img">
</view>
</view>
</view>
<view class="content">
<view class="value" style="height: 200rpx;">
<view class="name" style="flex: 1;line-height: 200rpx;">
<view class="value image-row">
<view class="name image-name">
其他补充证照
</view>
<view class="text" @tap="pictureAdd('qita')" style="width: auto;display: flex;padding-top: 10rpx;position: relative;">
<view class="upload-img" style="background: rgba(247, 248, 248, 0.6);text-align: center;line-height: 180rpx;">
<uni-icons type="camera" size="28" color="#777"></uni-icons>
</view>
<img :src="formData.qita[0]" v-if="formData.qita.length>0" alt="" class="upload-img" style="margin-left: 20rpx;">
<view class="red-dot" v-if="formData.qita.length>0">{{formData.qita.length}}</view>
<view class="text supplement-upload">
<scroll-view class="supplement-scroll" :scroll-x="true">
<view class="supplement-list">
<view class="image-card supplement-card" v-if="formData.qita.length < 9" @tap="pictureAdd('qita')">
<view class="upload-img">
<uni-icons type="camera" size="28" color="#777"></uni-icons>
</view>
</view>
<view class="image-card supplement-card" v-for="(item, index) in formData.qita" :key="index" @tap="pictureAdd('qita', index)">
<img :src="item" alt="" class="upload-img">
<view class="delete-img" @tap.stop="deleteImage('qita', index)">×</view>
</view>
</view>
</scroll-view>
</view>
</view>
</view>
@ -408,10 +423,18 @@
}
});
},
pictureAdd(type) {
pictureAdd(type, index) {
let that = this
let count = type == 'qita' ? 9 - this.formData.qita.length : 1
if(type == 'qita' && index !== undefined) {
count = 1
}
if(type == 'qita' && count <= 0) {
this.tui.toast('最多上传9张补充证照')
return
}
uni.chooseMedia({
count: type == 'qita'?9:1,
count: count,
mediaType: ['image'],
sourceType: ['camera', 'album'],
success(res) {
@ -420,13 +443,13 @@
mask: true
})
for (let i = 0; i < res.tempFiles.length; i++) {
that.upLoadFile(res.tempFiles[i].tempFilePath,type)
that.upLoadFile(res.tempFiles[i].tempFilePath,type,index)
}
}
})
},
async upLoadFile(path,type) {
async upLoadFile(path,type,index) {
let that = this;
let hiver_token = uni.getStorageSync("hiver_token")
await uni.uploadFile({
@ -448,6 +471,8 @@
that.formData.yingyezhizhao = pathData.result
}else if(type == 'mentou'){
that.formData.shopIcon = pathData.result
}else if(index !== undefined){
that.formData.qita.splice(index, 1, pathData.result)
}else{
that.formData.qita.push(pathData.result)
}
@ -466,6 +491,20 @@
uni.hideLoading();
}, 1000)
},
deleteImage(type,index) {
if(type == 'zheng'){
this.formData.zhengzhao = ''
}else if(type == 'fan'){
this.formData.fanzhao = ''
}else if(type == 'yingye'){
this.formData.yingyezhizhao = ''
}else if(type == 'mentou'){
this.formData.shopIcon = ''
}else if(index !== undefined){
this.formData.qita.splice(index, 1)
}
this.$forceUpdate()
},
//
submit() {
let that = this;
@ -930,30 +969,98 @@
border: 1rpx dashed rgba(11, 155, 115, 0.26);
box-shadow: inset 0 0 0 1rpx rgba(255, 255, 255, 0.8);
object-fit: cover;
line-height: 180rpx;
text-align: center;
}
.id-card-upload .upload-img {
width: 160rpx;
height: 160rpx;
line-height: 160rpx !important;
.image-row {
height: 220rpx;
align-items: center;
}
.red-dot {
.image-name {
width: 240rpx;
flex: 0 0 240rpx;
line-height: 42rpx;
white-space: nowrap;
}
.single-upload {
flex: 0 0 180rpx;
display: flex;
justify-content: flex-end;
}
.image-card {
position: relative;
width: 180rpx;
height: 180rpx;
flex: 0 0 auto;
}
.delete-img {
position: absolute;
top: 4rpx;
right: -8rpx;
top: -12rpx;
right: -12rpx;
z-index: 2;
width: 42rpx;
height: 42rpx;
line-height: 42rpx;
line-height: 38rpx;
text-align: center;
border: 4rpx solid #fff;
border-radius: 50%;
background: #ff5b5b;
color: #fff;
font-size: 22rpx;
font-weight: 800;
font-size: 28rpx;
font-weight: 900;
box-sizing: border-box;
box-shadow: 0 6rpx 14rpx rgba(255, 91, 91, 0.3);
}
.id-card-upload {
flex: 0 0 340rpx;
display: flex;
justify-content: flex-end;
}
.id-card-upload .image-card {
width: 160rpx;
height: 160rpx;
}
.id-card-upload .image-card + .image-card {
margin-left: 20rpx;
}
.id-card-upload .upload-img {
width: 160rpx;
height: 160rpx;
line-height: 160rpx !important;
}
.supplement-upload {
min-width: 0;
}
.supplement-scroll {
width: 100%;
white-space: nowrap;
}
.supplement-list {
display: inline-flex;
align-items: center;
padding: 10rpx 0;
}
.supplement-card {
margin-left: 20rpx;
}
.supplement-card:first-child {
margin-left: 0;
}
button {
width: 100%;
height: 96rpx;

Loading…
Cancel
Save