客户标签添加单选模式
This commit is contained in:
@@ -416,6 +416,18 @@ Page({
|
||||
})
|
||||
});
|
||||
},
|
||||
|
||||
//单选
|
||||
radioPicker(e){
|
||||
let taglList = this.data.taglList
|
||||
taglList[e.currentTarget.dataset.i].list.forEach(item => {
|
||||
item.checked=false
|
||||
})
|
||||
taglList[e.currentTarget.dataset.i].list[e.currentTarget.dataset.j].checked=true
|
||||
this.setData({
|
||||
taglList,
|
||||
})
|
||||
},
|
||||
|
||||
//多选
|
||||
checkPicker(e){
|
||||
|
||||
@@ -106,7 +106,12 @@
|
||||
<block wx:for='{{taglList}}' wx:for-item='list' wx:for-index='i' wx:key='i'>
|
||||
<view class="relative mt40">
|
||||
<view class="font-28">{{list.name}}</view>
|
||||
<view class="fn-clear">
|
||||
<view class="fn-clear" wx:if="{{list.type=='radio'}}">
|
||||
<block wx:for='{{list.list}}' wx:for-item='option' wx:for-index='j' wx:key='j'>
|
||||
<view class="inline-block space-nowrap mt20 mr20 pt15 pb15 pl30 pr30 font-22 ulib-r10 {{option.checked?'bg-36afa2 color-fff':'bg-f6 color-666'}}" bindtap="radioPicker" data-i="{{i}}" data-j="{{j}}">{{option.name}}</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="fn-clear" wx:if="{{list.type=='checkbox'}}">
|
||||
<block wx:for='{{list.list}}' wx:for-item='option' wx:for-index='j' wx:key='j'>
|
||||
<view class="inline-block space-nowrap mt20 mr20 pt15 pb15 pl30 pr30 font-22 ulib-r10 {{option.checked?'bg-36afa2 color-fff':'bg-f6 color-666'}}" bindtap="checkPicker" data-i="{{i}}" data-j="{{j}}">{{option.name}}</view>
|
||||
</block>
|
||||
|
||||
@@ -552,6 +552,18 @@ Page({
|
||||
})
|
||||
});
|
||||
},
|
||||
|
||||
//单选
|
||||
radioPicker(e){
|
||||
let taglList = this.data.taglList
|
||||
taglList[e.currentTarget.dataset.i].list.forEach(item => {
|
||||
item.checked=false
|
||||
})
|
||||
taglList[e.currentTarget.dataset.i].list[e.currentTarget.dataset.j].checked=true
|
||||
this.setData({
|
||||
taglList,
|
||||
})
|
||||
},
|
||||
|
||||
//多选
|
||||
checkPicker(e){
|
||||
|
||||
@@ -87,7 +87,12 @@
|
||||
<block wx:for='{{taglList}}' wx:for-item='list' wx:for-index='i' wx:key='i'>
|
||||
<view class="relative mt40">
|
||||
<view class="font-28">{{list.name}}</view>
|
||||
<view class="fn-clear">
|
||||
<view class="fn-clear" wx:if="{{list.type=='radio'}}">
|
||||
<block wx:for='{{list.list}}' wx:for-item='option' wx:for-index='j' wx:key='j'>
|
||||
<view class="inline-block space-nowrap mt20 mr20 pt15 pb15 pl30 pr30 font-22 ulib-r10 {{option.checked?'bg-36afa2 color-fff':'bg-f6 color-666'}}" bindtap="radioPicker" data-i="{{i}}" data-j="{{j}}">{{option.name}}</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="fn-clear" wx:if="{{list.type=='checkbox'}}">
|
||||
<block wx:for='{{list.list}}' wx:for-item='option' wx:for-index='j' wx:key='j'>
|
||||
<view class="inline-block space-nowrap mt20 mr20 pt15 pb15 pl30 pr30 font-22 ulib-r10 {{option.checked?'bg-36afa2 color-fff':'bg-f6 color-666'}}" bindtap="checkPicker" data-i="{{i}}" data-j="{{j}}">{{option.name}}</view>
|
||||
</block>
|
||||
|
||||
Reference in New Issue
Block a user