steps.nvue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <template>
  2. <view>
  3. <uni-section title="基本用法" type="line"></uni-section>
  4. <view class="example-body">
  5. <uni-steps :options="list1" active-color="#007AFF" :active="active" />
  6. </view>
  7. <uni-section title="纵向排列" type="line"></uni-section>
  8. <view class="example-body">
  9. <uni-steps :options="list2" active-color="#007AFF" :active="active" direction="column" />
  10. </view>
  11. <view class="word-btn" hover-class="word-btn--hover" :hover-start-time="20" :hover-stay-time="70" @click="change"><text class="word-btn-white">改变状态</text></view>
  12. </view>
  13. </template>
  14. <script>
  15. export default {
  16. components: {},
  17. data() {
  18. return {
  19. active: 1,
  20. list1: [{
  21. title: '事件一'
  22. }, {
  23. title: '事件二'
  24. }, {
  25. title: '事件三'
  26. }, {
  27. title: '事件四'
  28. }],
  29. list2: [{
  30. title: '买家下单',
  31. desc: '2018-11-11'
  32. }, {
  33. title: '卖家发货',
  34. desc: '2018-11-12'
  35. }, {
  36. title: '买家签收',
  37. desc: '2018-11-13'
  38. }, {
  39. title: '交易完成',
  40. desc: '2018-11-14'
  41. }]
  42. }
  43. },
  44. methods: {
  45. change() {
  46. if (this.active < this.list1.length - 1) {
  47. this.active += 1
  48. } else {
  49. this.active = 0
  50. }
  51. }
  52. }
  53. }
  54. </script>
  55. <style>
  56. @charset "UTF-8";
  57. /* 头条小程序组件内不能引入字体 */
  58. /* #ifdef MP-TOUTIAO */
  59. @font-face {
  60. font-family: uniicons;
  61. font-weight: normal;
  62. font-style: normal;
  63. src: url("~@/static/uni.ttf") format("truetype");
  64. }
  65. /* #endif */
  66. /* #ifndef APP-NVUE */
  67. page {
  68. display: flex;
  69. flex-direction: column;
  70. box-sizing: border-box;
  71. background-color: #efeff4;
  72. min-height: 100%;
  73. height: auto;
  74. }
  75. view {
  76. font-size: 14px;
  77. line-height: inherit;
  78. }
  79. .example {
  80. padding: 0 15px 15px;
  81. }
  82. .example-info {
  83. padding: 15px;
  84. color: #3b4144;
  85. background: #ffffff;
  86. }
  87. .example-body {
  88. /* #ifndef APP-NVUE */
  89. display: flex;
  90. /* #endif */
  91. flex-direction: row;
  92. flex-wrap: wrap;
  93. justify-content: center;
  94. padding: 0;
  95. font-size: 14px;
  96. background-color: #ffffff;
  97. }
  98. /* #endif */
  99. .example {
  100. padding: 0 15px;
  101. }
  102. .example-info {
  103. /* #ifndef APP-NVUE */
  104. display: block;
  105. /* #endif */
  106. padding: 15px;
  107. color: #3b4144;
  108. background-color: #ffffff;
  109. font-size: 14px;
  110. line-height: 20px;
  111. }
  112. .example-info-text {
  113. font-size: 14px;
  114. line-height: 20px;
  115. color: #3b4144;
  116. }
  117. .example-body {
  118. flex-direction: column;
  119. padding: 15px;
  120. background-color: #ffffff;
  121. }
  122. .word-btn-white {
  123. font-size: 18px;
  124. color: #FFFFFF;
  125. }
  126. .word-btn {
  127. /* #ifndef APP-NVUE */
  128. display: flex;
  129. /* #endif */
  130. flex-direction: row;
  131. align-items: center;
  132. justify-content: center;
  133. border-radius: 6px;
  134. height: 48px;
  135. margin: 15px;
  136. background-color: #007AFF;
  137. }
  138. .word-btn--hover {
  139. background-color: #4ca2ff;
  140. }
  141. .status-btn {
  142. /* #ifndef APP-NVUE */
  143. display: flex;
  144. /* #endif */
  145. flex-direction: row;
  146. align-items: center;
  147. justify-content: center;
  148. height: 92rpx;
  149. margin: 30rpx;
  150. background-color: #007AFF;
  151. }
  152. .example-body {
  153. /* #ifndef APP-NVUE */
  154. display: block;
  155. /* #endif */
  156. padding: 15px;
  157. flex-direction: row;
  158. }
  159. </style>