3 files added
4 files modified
| | |
| | | } |
| | | .c-switch-radio-item { |
| | | display: inline-block; |
| | | padding-left: 18px; |
| | | padding-left: 24px; |
| | | } |
| | | .c-switch-radio-icon { |
| | | @include flexbox(inline, center center); |
| | |
| | | padding-right: 0; |
| | | .c-switch-radio-item { |
| | | padding-left: 0; |
| | | padding-right: 22px; |
| | | padding-right: 24px; |
| | | } |
| | | } |
| | | } |
| | |
| | | :value="filterRes[item.name]" |
| | | :onChange="evt=>handleItemChange(item.name, evt)" |
| | | /> |
| | | <CFilterSwitchRadio |
| | | v-if="item.type==='switchRadio'" |
| | | type="item" |
| | | :label="item.label" |
| | | :value="filterRes[item.name]" |
| | | :onChange="evt=>handleItemChange(item.name, evt)" |
| | | /> |
| | | </view> |
| | | </scroll-view> |
| | | <view class="c-filter-drawer-btn"> |
| | |
| | | import { CDrawer } from '@components/layout/drawer'; |
| | | import CFilterSelect from './CFilterSelect'; |
| | | import CFilterDateRange from './CFilterDateRange'; |
| | | import CFilterSwitchRadio from './CFilterSwitchRadio'; |
| | | import './cFilter.scss'; |
| | | |
| | | export default { |
| | |
| | | AtButton, |
| | | CFilterSelect, |
| | | CFilterDateRange, |
| | | CFilterSwitchRadio, |
| | | CDrawer, |
| | | }, |
| | | props: { |
| | |
| | | |
| | | <script> |
| | | import Taro from '@tarojs/taro'; |
| | | import './cFilterSelect.scss'; |
| | | |
| | | export default { |
| | | name: 'CFilterSelect', |
New file |
| | |
| | | /** |
| | | * CFilterSwitchRadio - 筛选项目,单选 |
| | | * @author Tevin |
| | | */ |
| | | |
| | | <template> |
| | | <view |
| | | class="c-filter-switch-radio" |
| | | :class="'type-'+type" |
| | | > |
| | | <view |
| | | class="label" |
| | | v-if="type==='item'" |
| | | >{{label}}</view> |
| | | <CSwitchRadio |
| | | :itemRes="{ |
| | | label: type==='bar' ? label : '', |
| | | name: switchName, |
| | | formData: switchData, |
| | | onChange: evt => handleChange(evt), |
| | | }" |
| | | checkAlign="left" |
| | | checkedLabel="在线" |
| | | uncheckedLabel="离线" |
| | | /> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import Taro from '@tarojs/taro'; |
| | | import { CSwitchRadio } from '@components/forms/switch'; |
| | | import './cFilterSwitchRadio.scss'; |
| | | |
| | | export default { |
| | | name: 'CFilterRadio', |
| | | components: { |
| | | CSwitchRadio, |
| | | }, |
| | | props: { |
| | | type: String, |
| | | label: String, |
| | | value: Boolean, |
| | | onChange: Function, |
| | | }, |
| | | data() { |
| | | return { |
| | | switchName: 'radio', |
| | | switchData: { |
| | | radio: '', |
| | | }, |
| | | }; |
| | | }, |
| | | computed: {}, |
| | | watch: { |
| | | value(newVal, oldVal) { |
| | | this.switchData.radio = newVal; |
| | | }, |
| | | }, |
| | | methods: { |
| | | handleChange(value) { |
| | | this.onChange(value); |
| | | }, |
| | | }, |
| | | mounted() { |
| | | this.switchData.radio = this.value; |
| | | }, |
| | | }; |
| | | </script> |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .c-filter-select { |
| | | .content { |
| | | @include flexbox(flex, flex-start center); |
| | | white-space: nowrap; |
| | | .empty, |
| | | .value { |
| | | display: inline-block; |
| | | vertical-align: middle; |
| | | @include ellipsis(); |
| | | } |
| | | .empty { |
| | | color: #ccc; |
| | | } |
| | | .filled { |
| | | color: #6190e8; |
| | | } |
| | | .at-icon { |
| | | text-align: center; |
| | | color: #666; |
| | | } |
| | | } |
| | | &.type-bar { |
| | | .content { |
| | | height: 86px; |
| | | .label { |
| | | padding-right: 12px; |
| | | color: #666; |
| | | } |
| | | .filled { |
| | | letter-spacing: -2px; |
| | | } |
| | | .at-icon { |
| | | padding-left: 4px; |
| | | vertical-align: middle; |
| | | } |
| | | } |
| | | } |
| | | &.type-item { |
| | | .label { |
| | | color: #666; |
| | | line-height: 40px; |
| | | } |
| | | .content { |
| | | .empty, |
| | | .filled { |
| | | flex: 6; |
| | | } |
| | | .at-icon { |
| | | flex: 1; |
| | | } |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | /** |
| | | * filter select |
| | | * @author Tevin |
| | | */ |
| | | |
| | | @import "../../common/sassMixin"; |
| | | |
| | | .c-filter-select { |
| | | .content { |
| | | @include flexbox(flex, flex-start center); |
| | | white-space: nowrap; |
| | | .empty, |
| | | .value { |
| | | display: inline-block; |
| | | vertical-align: middle; |
| | | @include ellipsis(); |
| | | } |
| | | .empty { |
| | | color: #ccc; |
| | | } |
| | | .filled { |
| | | color: #6190e8; |
| | | } |
| | | .at-icon { |
| | | text-align: center; |
| | | color: #666; |
| | | } |
| | | } |
| | | &.type-bar { |
| | | .content { |
| | | height: 86px; |
| | | .label { |
| | | padding-right: 12px; |
| | | color: #666; |
| | | } |
| | | .filled { |
| | | letter-spacing: -2px; |
| | | } |
| | | .at-icon { |
| | | padding-left: 4px; |
| | | vertical-align: middle; |
| | | } |
| | | } |
| | | } |
| | | &.type-item { |
| | | .label { |
| | | color: #666; |
| | | line-height: 40px; |
| | | } |
| | | .content { |
| | | .empty, |
| | | .filled { |
| | | flex: 6; |
| | | } |
| | | .at-icon { |
| | | flex: 1; |
| | | } |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | /** |
| | | * CFilterSwitchRadio |
| | | * @author Tevin |
| | | */ |
| | | |
| | | @import "../../common/sassMixin"; |
| | | |
| | | .c-filter-switch-radio { |
| | | .label { |
| | | color: #666; |
| | | line-height: 40px; |
| | | } |
| | | &.type-item { |
| | | .c-switch-radio { |
| | | .at-switch { |
| | | display: none; |
| | | } |
| | | .c-switch-radio-group { |
| | | position: sticky; |
| | | padding: 0; |
| | | transform: none; |
| | | } |
| | | } |
| | | } |
| | | } |