|
@@ -25,9 +25,9 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="boxLine" v-for="(item,index) in categoryList[index1].sectionList[index2].itemList">
|
|
|
- <view class="boxLineTop">
|
|
|
+ <view class="boxLineTop xzstoreBox">
|
|
|
<view class="itemName">{{item.itemName}}</view>
|
|
|
- <view class="store" v-if="item.keyType==4" @click="pickerClick(item)">
|
|
|
+ <view class="store xzstore" v-if="item.keyType==4" @click="pickerClick(item)">
|
|
|
<picker @change="bindPickerChange($event)" :value="item.storeIndex" :item="item" :range="item.array">
|
|
|
<view class="pickerView" v-if="item.itemValue!==''">{{item.itemValue}} 分</view>
|
|
|
<view class="pickerView" v-else>请选择</view>
|
|
@@ -36,21 +36,28 @@
|
|
|
<image src="../../static/img/jiantou.png" mode="" class="storeJtimg"></image>
|
|
|
</view>
|
|
|
</view>
|
|
|
+
|
|
|
</view>
|
|
|
<view class="boxlinedescribe" v-if="item.describe">{{item.describe}}</view>
|
|
|
<view class="itemCklineBox" v-if="item.keyType==1">
|
|
|
<view class="itemCkline" :class="{itemckActive:name.check}" @click="itemXx(name,item.array)" v-for="(name,nameIndex) in item.array">{{name.name}}</view>
|
|
|
<!-- <view class="itemCkline itemckActive">张杰</view> -->
|
|
|
</view>
|
|
|
+ <view v-if="item.keyType==5" class="textareaBox">
|
|
|
+ <input placeholder-style="color:#CCCCCC" class="numbershuru" placeholder="请输入~" type="digit" pattern="number" v-model="item.itemValue"
|
|
|
+ @oninput="numberxz"
|
|
|
+ />
|
|
|
+ </view>
|
|
|
<view class="textareaBox" v-if="item.keyType==2">
|
|
|
<textarea placeholder-style="color:#CCCCCC" placeholder="请输入~" v-model="item.itemValue" class="textareaCont"/>
|
|
|
</view>
|
|
|
<view class="imgBox" v-if="item.keyType==3">
|
|
|
<view class="imgLine" v-for="(img,imgindex) in item.imgArr">
|
|
|
- <image @click="previewImage(img,item.imgArr)" :class="{img4:(imgindex+1)%4==0}" :src="img" mode="" class="itemImg"></image>
|
|
|
+ <image @click="previewImage(img.url,item.imgArr)" :class="{img4:(imgindex+1)%4==0}" :src="img.url" mode="" class="itemImg"></image>
|
|
|
<image src="../../static/img/icon_delpic@2x.png" mode="" class="delImg" @click="delimg(item,imgindex)"></image>
|
|
|
+ <textarea placeholder-style="color:#CCCCCC" v-model="img.textarea" placeholder="请输入备注" class="imgtextarea"/>
|
|
|
</view>
|
|
|
- <view class="imgLine" @click="uploadImg(item)">
|
|
|
+ <view class="imgLine2" @click="uploadImg(item)">
|
|
|
<image src="../../static/img/icon_addpic@2x.png" mode="" class="itemImg" style="margin-right: 0;"></image>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -121,7 +128,13 @@
|
|
|
})
|
|
|
item.array=arr
|
|
|
}else if(item.keyType==3){
|
|
|
- item.imgArr=[]
|
|
|
+ item.imgArr=[
|
|
|
+ /* {
|
|
|
+ url:'',
|
|
|
+ textarea:'',
|
|
|
+ } */
|
|
|
+ ];
|
|
|
+ //item.textarea='';
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -156,6 +169,27 @@
|
|
|
console.log(this.categoryList);
|
|
|
},
|
|
|
methods: {
|
|
|
+ numberxz(event){
|
|
|
+ console.log(event)
|
|
|
+ /* this.categoryList[this.index1].sectionList[this.index2].itemList[index].itemValue=2
|
|
|
+ console.log(this.categoryList[this.index1].sectionList[this.index2].itemList[index].itemValue)
|
|
|
+ this.categoryList.slice(0,1) */
|
|
|
+ /* this.$nextTick(() => {
|
|
|
+ this.categoryList[this.index1].sectionList[this.index2].itemList[index].itemValue=2
|
|
|
+ })
|
|
|
+ */
|
|
|
+ let i = event.target.value
|
|
|
+ return i.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')
|
|
|
+ /* let i = event.target.value
|
|
|
+ let num = i.charAt(i.length-1)
|
|
|
+ var reg=new RegExp("^[0-9]*$")
|
|
|
+ if(!reg.test(num)) {
|
|
|
+ return i.slice(0,-1)
|
|
|
+ } else {
|
|
|
+ return i
|
|
|
+ } */
|
|
|
+
|
|
|
+ },
|
|
|
previewImage(img,arr){
|
|
|
//var arr=[];
|
|
|
//arr.push(img)
|
|
@@ -213,7 +247,7 @@
|
|
|
var num=10-length;
|
|
|
uni.chooseImage({
|
|
|
sourceType: ['album','camera'],
|
|
|
- count:num,
|
|
|
+ count:1,
|
|
|
success: (chooseImageRes) => {
|
|
|
const tempFilePaths = chooseImageRes.tempFilePaths;
|
|
|
tempFilePaths.forEach(v=>{
|
|
@@ -225,9 +259,15 @@
|
|
|
'user': 'test'
|
|
|
},
|
|
|
success: (uploadFileRes) => {
|
|
|
- console.log(JSON.parse(uploadFileRes.data).data );
|
|
|
- console.log(item.imgArr)
|
|
|
- item.imgArr=item.imgArr.concat(JSON.parse(uploadFileRes.data).data) ;
|
|
|
+ console.log(JSON.parse(uploadFileRes.data).data[0] );
|
|
|
+
|
|
|
+ var i= {
|
|
|
+ url:JSON.parse(uploadFileRes.data).data[0],
|
|
|
+ textarea:'',
|
|
|
+ }
|
|
|
+ item.imgArr.push(i)
|
|
|
+ console.log(item.imgArr)
|
|
|
+ //item.imgArr=item.imgArr.concat() ;
|
|
|
that.categoryList.splice(1,0)
|
|
|
}
|
|
|
});
|
|
@@ -242,9 +282,21 @@
|
|
|
sub(){
|
|
|
console.log(this.categoryList);
|
|
|
var go=true;
|
|
|
+ var gonum=true;
|
|
|
+ var gonumTxt=''
|
|
|
+ //return false;
|
|
|
this.categoryList[this.index1].sectionList[this.index2].itemList.forEach(item=>{
|
|
|
if(item.keyType==3){
|
|
|
- item.itemValue=item.imgArr.join(',');
|
|
|
+ //item.itemValue=item.imgArr.join(',')//+'+'+item.;
|
|
|
+ item.itemValue='',
|
|
|
+ item.imgArr.forEach((img,imgIndex)=>{
|
|
|
+ if(item.imgArr.length-1 == imgIndex){
|
|
|
+ item.itemValue+=img.url+'+'+img.textarea
|
|
|
+ }else{
|
|
|
+ item.itemValue+=img.url+'+'+img.textarea+','
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
console.log(item.itemValue)
|
|
|
}else if(item.keyType==1){
|
|
|
var arr=[]
|
|
@@ -255,7 +307,21 @@
|
|
|
}
|
|
|
})
|
|
|
item.itemValue=arr.join(',');
|
|
|
+ }else if(item.keyType==5){
|
|
|
+ var num5=Number(item.itemValue)
|
|
|
+ if(num5){
|
|
|
+ console.log(typeof(num5))
|
|
|
+ if(typeof(num5)!='number'){
|
|
|
+ gonum=false;
|
|
|
+ gonumTxt=item.itemName
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ gonum=false;
|
|
|
+ gonumTxt=item.itemName
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
if(item.itemValue===0){
|
|
|
|
|
|
}else if(item.itemValue===''){
|
|
@@ -273,6 +339,14 @@
|
|
|
});
|
|
|
return false;
|
|
|
}
|
|
|
+ if(!gonum){
|
|
|
+ uni.showToast({
|
|
|
+ title:gonumTxt+'必须为数字',
|
|
|
+ icon:'none',
|
|
|
+ duration: 3000,
|
|
|
+ });
|
|
|
+ return false;
|
|
|
+ }
|
|
|
//return false;
|
|
|
this.categoryList[this.index1].sectionList[this.index2].check=true;
|
|
|
if(this.yuedu){
|
|
@@ -300,6 +374,11 @@
|
|
|
this.yueduData=res.data
|
|
|
})
|
|
|
}
|
|
|
+ },
|
|
|
+ filters:{
|
|
|
+ numInput(value){
|
|
|
+ console.log(value)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -310,6 +389,15 @@
|
|
|
min-height: 100vh;
|
|
|
|
|
|
}
|
|
|
+ .numbershuru{
|
|
|
+ background: #F4F5F7;
|
|
|
+ padding: 0rpx 20rpx;
|
|
|
+ border-radius: 10rpx;
|
|
|
+ font-size: 28rpx;
|
|
|
+ color: #3C3C3C;
|
|
|
+ line-height: 88rpx;
|
|
|
+ height: 88rpx;
|
|
|
+ }
|
|
|
/* #ifdef H5 */
|
|
|
.content{
|
|
|
background: #F4F5F7;
|
|
@@ -378,15 +466,14 @@
|
|
|
}
|
|
|
.imgBox{
|
|
|
/* padding-top: 10rpx; */
|
|
|
- display: flex;
|
|
|
- flex-wrap: wrap;
|
|
|
+ /* display: flex;
|
|
|
+ flex-wrap: wrap; */
|
|
|
|
|
|
}
|
|
|
.itemImg{
|
|
|
width:150rpx;
|
|
|
height: 150rpx;
|
|
|
- margin-right: 35rpx;
|
|
|
- margin-top: 30rpx;
|
|
|
+
|
|
|
}
|
|
|
.img4{
|
|
|
margin-right: 0;
|
|
@@ -395,11 +482,26 @@
|
|
|
width: 32rpx;
|
|
|
height: 32rpx;
|
|
|
position: absolute;
|
|
|
- left: 135rpx;
|
|
|
- top: 10rpx;
|
|
|
+ right:20rpx;
|
|
|
+ top: 20rpx;
|
|
|
+ z-index: 11;
|
|
|
}
|
|
|
.imgLine{
|
|
|
position: relative;
|
|
|
+ width: 662rpx;
|
|
|
+ height: 150rpx;
|
|
|
+ background: #F4F5F7;
|
|
|
+ border-radius: 10rpx;
|
|
|
+ padding: 20rpx;
|
|
|
+ margin-top: 20rpx;
|
|
|
+ display: flex;
|
|
|
+ }
|
|
|
+ .imgtextarea{
|
|
|
+ height: 120rpx;font-size: 28rpx;padding-left: 20rpx;
|
|
|
+ width:520rpx ;
|
|
|
+ }
|
|
|
+ .imgLine2{
|
|
|
+ padding-top: 20rpx;
|
|
|
}
|
|
|
.bottom{
|
|
|
width: 750rpx;
|
|
@@ -455,4 +557,11 @@
|
|
|
width: 500rpx;
|
|
|
text-align: right;
|
|
|
}
|
|
|
+ .xzstore{
|
|
|
+ position: absolute;
|
|
|
+ right: 0;
|
|
|
+ }
|
|
|
+ .xzstoreBox{
|
|
|
+ position: relative;
|
|
|
+ }
|
|
|
</style>
|