Browse Source

结构物、点位选项

master
巴林闲侠 2 years ago
parent
commit
1357f4a3df
  1. 33
      weapp/package/troubleshooting/index.js
  2. 32
      weapp/package/troubleshooting/index.wxml
  3. 6
      weapp/package/troubleshooting/index.wxss

33
weapp/package/troubleshooting/index.js

@ -7,6 +7,12 @@ Page({
data: {
// hidden: true,
currentTab: '0',
// 筛选选择
structList: ['a', 'b', 'c'],
structResult: ['a', 'b'],
pointList: ['a', 'b', 'c'],
pointResult: ['a', 'b'],
},
// 顶部tab切换
@ -26,6 +32,33 @@ Page({
}
},
// 筛选选择
onStructChange (event) {
this.setData({
structResult: event.detail,
});
},
structToggle (event) {
const { index } = event.currentTarget.dataset;
const checkbox = this.selectComponent(`.checkboxes-struct-${index}`);
checkbox.toggle();
},
onPointChange (event) {
this.setData({
pointResult: event.detail,
});
},
pointToggle (event) {
const { index } = event.currentTarget.dataset;
const checkbox = this.selectComponent(`.checkboxes-point-${index}`);
checkbox.toggle();
},
noop () { },
/**
* 生命周期函数--监听页面加载
*/

32
weapp/package/troubleshooting/index.wxml

@ -10,13 +10,41 @@
</view>
</view>
<view>
s
<van-dropdown-menu>
<van-dropdown-item title="{{ '结构物' }}">
<view style="max-height:60%">
<van-checkbox-group value="{{ structResult }}" bind:change="onStructChange">
<van-cell-group>
<van-cell wx:for="{{ structList }}" wx:key="index" title="复选框 {{ item }}" value-class="value-class" clickable data-index="{{ index }}" bind:click="structToggle">
<van-checkbox catch:tap="noop" class="checkboxes-struct-{{ index }}" name="{{ item }}" />
</van-cell>
</van-cell-group>
</van-checkbox-group>
</view>
</van-dropdown-item>
<van-dropdown-item title="{{ '点位' }}">
<view style="max-height:60%">
<van-checkbox-group value="{{ pointResult }}" bind:change="onPointChange">
<van-cell-group>
<van-cell wx:for="{{ pointList }}" wx:key="index" title="复选框 {{ item }}" value-class="value-class" clickable data-index="{{ index }}" bind:click="pointToggle">
<van-checkbox catch:tap="noop" class="checkboxes-point-{{ index }}" name="{{ item }}" />
</van-cell>
</van-cell-group>
</van-checkbox-group>
</view>
</van-dropdown-item>
<van-dropdown-item title="{{ '时间' }}">
<view style="max-height:60%">
<van-datetime-picker type="datetime" show-toolbar="{{false}}" type="date" value="{{ currentDate }}" bind:input="onInput"/>
</view>
</van-dropdown-item>
</van-dropdown-menu>
</view>
<view style="height:100vh - 98rpx; padding-top:24rpx; overflow:auto">
<van-cell-group inset class="mission-card">
<view class="mission-card-title">
<span>asd</span>
<van-button type="primary">按钮</van-button>
<van-button type="info" round bind:tap="pickerShow">按钮</van-button>
</view>
<van-field value="输入框已禁用" label="点位名称" readonly border="{{ false }}" />
<van-field value="输入框已禁用" label="异常等级" readonly border="{{ false }}" />

6
weapp/package/troubleshooting/index.wxss

@ -46,8 +46,12 @@
.mission-card-title {
background-color: #fff;
overflow: auto;
padding: 24rpx 12rpx;
padding: 24rpx 16px;
display: flex;
justify-content: space-between;
align-items: center
}
.value-class {
flex: none !important;
}
Loading…
Cancel
Save