Commit 07c68452 by LJM

小程序--收货登记、异常收货登记--照片数量限制

parent b9f45f95
...@@ -166,6 +166,7 @@ ...@@ -166,6 +166,7 @@
.upload-list { .upload-list {
padding-bottom: 48rpx; padding-bottom: 48rpx;
border-bottom: 1px solid #e6edf0; border-bottom: 1px solid #e6edf0;
flex-wrap: wrap;
.default { .default {
width: 144rpx; width: 144rpx;
height: 144rpx; height: 144rpx;
...@@ -178,8 +179,8 @@ ...@@ -178,8 +179,8 @@
} }
.pic-box { .pic-box {
position: relative; position: relative;
flex: 0 0 25%; margin-right: 24rpx;
margin-right: 10rpx; margin-bottom: 20rpx;
&:nth-of-type(4n) { &:nth-of-type(4n) {
margin-right: 0; margin-right: 0;
} }
......
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
<view class="upload-box"> <view class="upload-box">
<view class="title row bothSide verCenter"> <view class="title row bothSide verCenter">
<text class="tt-l">收货图片上传(选填)</text> <text class="tt-l">收货图片上传(选填)</text>
<text class="tt-r">{{ form.check_in_pic.length }}/4</text> <text class="tt-r">{{ form.check_in_pic.length }}/10</text>
</view> </view>
<view class="upload-list row verCenter"> <view class="upload-list row verCenter">
<template v-if="form.check_in_pic.length > 0"> <template v-if="form.check_in_pic.length > 0">
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
<view class="delete row rowCenter verCenter" @click="deletePic(index)"><text class="iconfont icon-shanchu"></text></view> <view class="delete row rowCenter verCenter" @click="deletePic(index)"><text class="iconfont icon-shanchu"></text></view>
</view> </view>
</template> </template>
<view class="default row rowCenter verCenter" @click="chooseImageChange()" v-if="form.check_in_pic.length < 4"><text class="iconfont icon-xingzhuangjiehe"></text></view> <view class="default row rowCenter verCenter" @click="chooseImageChange()" v-if="form.check_in_pic.length < 10"><text class="iconfont icon-xingzhuangjiehe"></text></view>
</view> </view>
<view class="textarea-box"> <view class="textarea-box">
<textarea @input="inputChange()" maxlength="200" placeholder="请输入收货备注" placeholder-style="color:#6E767A;" v-model="form.check_in_remark"></textarea> <textarea @input="inputChange()" maxlength="200" placeholder="请输入收货备注" placeholder-style="color:#6E767A;" v-model="form.check_in_remark"></textarea>
...@@ -218,7 +218,7 @@ ...@@ -218,7 +218,7 @@
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
uni.chooseMedia({ uni.chooseMedia({
count: 4, count: 10,
mediaType: ['image'], mediaType: ['image'],
sizeType: ['original', 'compressed'], sizeType: ['original', 'compressed'],
sourceType: ['album', 'camera'], sourceType: ['album', 'camera'],
...@@ -228,10 +228,10 @@ ...@@ -228,10 +228,10 @@
}); });
const tempFilePaths = chooseImageRes.tempFiles; const tempFilePaths = chooseImageRes.tempFiles;
let maxNum = tempFilePaths.length * 1 + self.form.check_in_pic.length * 1; let maxNum = tempFilePaths.length * 1 + self.form.check_in_pic.length * 1;
if (maxNum > 4) { if (maxNum > 10) {
uni.hideLoading(); uni.hideLoading();
uni.showToast({ uni.showToast({
title: '图片不超过4张' title: '图片不超过10张'
}); });
return false; return false;
} }
...@@ -268,7 +268,7 @@ ...@@ -268,7 +268,7 @@
// #ifdef APP-PLUS // #ifdef APP-PLUS
uni.chooseImage({ uni.chooseImage({
count: 4, count: 10,
sizeType: ['original', 'compressed'], sizeType: ['original', 'compressed'],
sourceType: ['album', 'camera'], sourceType: ['album', 'camera'],
success: chooseImageRes => { success: chooseImageRes => {
...@@ -277,10 +277,10 @@ ...@@ -277,10 +277,10 @@
}); });
const tempFilePaths = chooseImageRes.tempFilePaths; const tempFilePaths = chooseImageRes.tempFilePaths;
let maxNum = tempFilePaths.length * 1 + self.form.check_in_pic.length * 1; let maxNum = tempFilePaths.length * 1 + self.form.check_in_pic.length * 1;
if (maxNum > 4) { if (maxNum > 10) {
uni.hideLoading(); uni.hideLoading();
uni.showToast({ uni.showToast({
title: '图片不超过4张' title: '图片不超过10张'
}); });
return false; return false;
} }
......
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 sign in to comment