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

193
package3/shop/merchantRegister.vue

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

Loading…
Cancel
Save