| | |
| | | <view class="at-icon at-icon-chevron-right"></view> |
| | | </AtInput> |
| | | </view> |
| | | <AtRange |
| | | :min="range[0]" |
| | | :max="range[1]" |
| | | :value="[0, itemRes.formData[itemRes.name]]" |
| | | :onChange="evt => evt && itemRes.onChange(evt[1])" |
| | | /> |
| | | <AtFloatLayout |
| | | :isOpened="opened" |
| | | :onClose="evt => handleClose()" |
| | |
| | | <script> |
| | | import Taro from '@tarojs/taro'; |
| | | import { $ } from '@tarojs/extend'; |
| | | import { AtInput, AtFloatLayout, AtButton, AtRange } from 'taro-ui-vue'; |
| | | import { AtInput, AtFloatLayout, AtButton } from 'taro-ui-vue'; |
| | | import './cNumberValve.scss'; |
| | | |
| | | export default { |
| | |
| | | AtInput, |
| | | AtFloatLayout, |
| | | AtButton, |
| | | AtRange, |
| | | }, |
| | | props: { |
| | | // 表单数据资源(表单组件内部机制专用) |
| | |
| | | this.updateRect(); |
| | | let currentNext = 0; |
| | | if (type === 'left') { |
| | | currentNext = this.current - this.step; |
| | | const gap = this.current % this.step; |
| | | if (gap === 0) { |
| | | currentNext = this.current - this.step; |
| | | } else { |
| | | currentNext = this.current - gap; |
| | | } |
| | | } else if (type === 'right') { |
| | | currentNext = this.current + this.step; |
| | | const gap = this.current % this.step; |
| | | if (gap === 0) { |
| | | currentNext = this.current + this.step; |
| | | } else { |
| | | currentNext = this.current + (this.step - gap); |
| | | } |
| | | } else if (type === 'change') { |
| | | currentNext = value; |
| | | } |
| | | // 范围限制 |
| | | currentNext = Math.max(currentNext, this.range[0]); |
| | | currentNext = Math.min(currentNext, this.range[1]); |
| | | // 设置 |
| | | const sliderLeft = Math.round( |
| | | ((currentNext - this.range[0]) / (this.range[1] - this.range[0])) * 100 |
| | | ); |