Commit b1eda4b7 by zhangxw

自测修改

1 parent 6323ac5b
......@@ -4,22 +4,24 @@ Component({
* 组件的属性列表
*/
properties: {
show: Boolean,
connectionList: Array,
tabBarStyle: String,
selectedConnectionList: {
type: Array,
show: {
type: Boolean,
observer: function(n) {
let { connectionList } = this.data
if (n?.length) {
if (n) {
let { connectionList, selectedConnectionList } = this.data
connectionList.map(val => {
val.show = true
if (n.findIndex(item => item.merchantId == val.merchantId) > -1) val.checked = true
if (selectedConnectionList?.length && selectedConnectionList?.findIndex(item => item.merchantId == val.merchantId) > -1) val.checked = true
return val
})
this.setData({connectionList})
}
this.setData({connectionList})
}
},
connectionList: Array,
tabBarStyle: String,
selectedConnectionList: {
type: Array
}
},
......@@ -36,11 +38,12 @@ Component({
methods: {
select(e) {
let { item } = e.currentTarget.dataset
console.log(item)
let { connectionList } = this.data
// 不可操作选项
if (item.disabled) return
if (item?.disabled) return
connectionList.forEach(v => {
if (v.merchantId == item.merchantId) v.checked = !v.checked
if (v.merchantId == item?.merchantId) v.checked = !v.checked
})
this.setData({
connectionList
......
......@@ -38,7 +38,7 @@
<view
class="service-items text-hide"
data-index="{{index}}"
hidden="{{!item.show}}"
data-item="{{item}}"
bindtap="select">
<view class="item-radio">
<view wx:if="{{!item.checked}}" class="radio_class radio {{item.disabled?'disabled': ''}}"></view>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!