my-custom-step.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <!-- 步骤条 -->
  3. <view>
  4. <view class="text-11px text-white text-left" style="width: 100%;margin-left: 40rpx;">调整速度</view>
  5. <view class="my-cu-steps">
  6. <view class="my-cu-item" :class="index>basics?'':'make-text-r-blue'" v-for="(item,index) in basicsList" :key="index">
  7. <view style="position: relative;" @tap="_customSetBasics(index)">
  8. <view style="position: absolute; top:0;bottom:0;right: 0;left: 0; margin: auto; width: 10px;height: 10px; border-radius: 45px; background-color: #FFFFFF;"></view>
  9. <text :class="'cuIcon-' + item.cuIcon"></text>
  10. </view>
  11. <view style="color: #FFFFFF;">{{item.name}}</view>
  12. </view>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. data() {
  19. return {
  20. //步骤点
  21. basicsList: [{
  22. cuIcon: 'radioboxfill',
  23. name: '0'
  24. }, {
  25. cuIcon: 'radioboxfill',
  26. name: '1'
  27. }, {
  28. cuIcon: 'radioboxfill',
  29. name: '2'
  30. }, {
  31. cuIcon: 'radioboxfill',
  32. name: '3'
  33. }, {
  34. cuIcon: 'radioboxfill',
  35. name: '4'
  36. }, {
  37. cuIcon: 'radioboxfill',
  38. name: '5'
  39. }, {
  40. cuIcon: 'radioboxfill',
  41. name: '6'
  42. }],
  43. basics: 0,
  44. }
  45. },
  46. methods:{
  47. //操作心电图
  48. _customSetBasics(index) {
  49. // if (!this.bElectRun) return;
  50. this.basics = index;
  51. // this.electro.duration = 2000 - (this.basics + 1) * 150;
  52. // this.$refs.electRef.changeDuration(this.electro.duration);
  53. // callback
  54. this.$emit('onCustomSetBasics',{basics:this.basics});
  55. },
  56. onChangeBasicsFromDirection(data){
  57. let _bRight = data.bRight;
  58. if (_bRight) {
  59. this.basics = this.basics == this.basicsList.length - 1 ? 0 : this.basics + 1;
  60. } else {
  61. this.basics = this.basics == 0 ? 6 : this.basics - 1;
  62. }
  63. this.$emit('onCustomSetBasics',{basics:this.basics});
  64. }
  65. }
  66. }
  67. </script>
  68. <style>
  69. </style>