steps.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <template>
  2. <view>
  3. <cu-custom bgColor="bg-gradual-pink" :isBack="true"><block slot="backText">返回</block><block slot="content">步骤条</block></cu-custom>
  4. <view class="cu-bar bg-white solid-bottom">
  5. <view class="action">
  6. <text class="cuIcon-title text-orange"></text> 基本用法
  7. </view>
  8. <view class="action">
  9. <button class="cu-btn bg-green shadow" @tap="BasicsSteps">下一步</button>
  10. </view>
  11. </view>
  12. <view class="bg-white padding">
  13. <view class="cu-steps">
  14. <view class="cu-item" :class="index>basics?'':'text-red'" v-for="(item,index) in basicsList" :key="index">
  15. <text :class="'cuIcon-' + item.cuIcon"></text> {{item.name}}
  16. </view>
  17. </view>
  18. </view>
  19. <view class="bg-white padding margin-top-xs">
  20. <view class="cu-steps">
  21. <view class="cu-item" :class="index>basics?'':'text-orange'" v-for="(item,index) in basicsList" :key="index">
  22. <text :class="index>basics?'cuIcon-title':'cuIcon-' + item.cuIcon"></text> {{item.name}}
  23. </view>
  24. </view>
  25. </view>
  26. <view class="bg-white padding margin-top-xs">
  27. <view class="cu-steps steps-arrow">
  28. <view class="cu-item" :class="index>basics?'':'text-blue'" v-for="(item,index) in basicsList" :key="index">
  29. <text :class="'cuIcon-' + item.cuIcon"></text> {{item.name}}
  30. </view>
  31. </view>
  32. </view>
  33. <view class="cu-bar bg-white solid-bottom margin-top">
  34. <view class="action">
  35. <text class="cuIcon-title text-orange"></text> 数字完成
  36. </view>
  37. <view class="action">
  38. <button class="cu-btn bg-green shadow" @tap="NumSteps">下一步</button>
  39. </view>
  40. </view>
  41. <view class="bg-white padding">
  42. <view class="cu-steps">
  43. <view class="cu-item" :class="index>num?'':'text-blue'" v-for="(item,index) in numList" :key="index">
  44. <text class="num" :class="index==2?'err':''" :data-index="index + 1"></text> {{item.name}}
  45. </view>
  46. </view>
  47. </view>
  48. <view class="cu-bar bg-white solid-bottom margin-top">
  49. <view class="action">
  50. <text class="cuIcon-title text-orange"></text> 多级显示
  51. </view>
  52. <view class="action">
  53. <button class="cu-btn bg-green shadow" @tap="ScrollSteps">下一步</button>
  54. </view>
  55. </view>
  56. <scroll-view scroll-x class="bg-white padding response cu-steps steps-bottom" :scroll-into-view="'scroll-' + scroll"
  57. scroll-with-animation>
  58. <view class="cu-item padding-lr-xl" :class="index>scroll?'':'text-blue'" v-for="(item,index) in 10" :key="index" :id="'scroll-' + index">
  59. Level {{index + 1}} <text class="num" :data-index="index + 1"></text>
  60. </view>
  61. </scroll-view>
  62. </view>
  63. </template>
  64. <script>
  65. export default {
  66. data() {
  67. return {
  68. basicsList: [{
  69. cuIcon: 'usefullfill',
  70. name: '开始'
  71. }, {
  72. cuIcon: 'radioboxfill',
  73. name: '等待'
  74. }, {
  75. cuIcon: 'roundclosefill',
  76. name: '错误'
  77. }, {
  78. cuIcon: 'roundcheckfill',
  79. name: '完成'
  80. }, ],
  81. basics: 0,
  82. numList: [{
  83. name: '开始'
  84. }, {
  85. name: '等待'
  86. }, {
  87. name: '错误'
  88. }, {
  89. name: '完成'
  90. }, ],
  91. num: 0,
  92. scroll: 0
  93. };
  94. },
  95. methods: {
  96. BasicsSteps() {
  97. this.basics= this.basics == this.basicsList.length - 1 ? 0 : this.basics + 1
  98. },
  99. NumSteps() {
  100. this.num= this.num == this.numList.length - 1 ? 0 : this.num + 1
  101. },
  102. ScrollSteps() {
  103. this.scroll= this.scroll == 9 ? 0 : this.scroll + 1
  104. }
  105. }
  106. }
  107. </script>
  108. <style>
  109. </style>