普兆健康管家前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

188 lines
4.1 KiB

  1. <template>
  2. <view class="view">
  3. <view class="top">
  4. <view class="route">
  5. <image class="img" src="@/pages_order/static/index/health-records-route-bg.png" mode="widthFix"></image>
  6. </view>
  7. </view>
  8. <view class="bottom">
  9. <swiper
  10. class="swiper"
  11. :current="current"
  12. :autoplay="false"
  13. :display-multiple-items="2.5"
  14. @change="onChange"
  15. >
  16. <swiper-item v-for="(item, sIdx) in list" :key="item.id" style="display: inline-block;">
  17. <view class="swiper-item">
  18. <view class="swiper-item-content">
  19. <view class="card">
  20. <image class="img" :src="item.url" mode="widthFix"></image>
  21. <view class="title">{{ item.title }}</view>
  22. </view>
  23. <view class="desc">{{ `STEP ${sIdx + 1}` }}<br/>{{ item.desc }}</view>
  24. </view>
  25. </view>
  26. </swiper-item>
  27. <swiper-item style="display: inline-block;">
  28. <view class="swiper-item"></view>
  29. </swiper-item>
  30. <swiper-item style="display: inline-block;">
  31. <view class="swiper-item"></view>
  32. </swiper-item>
  33. </swiper>
  34. <view class="flex">
  35. <view class="indicator flex">
  36. <view
  37. v-for="(item, index) in list"
  38. :key="index"
  39. :class="['indicator-dot', index === current ? 'is-active' : '']"
  40. @click="current = index"
  41. ></view>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. </template>
  47. <script>
  48. import indicator from '@/components/home/indicator.vue'
  49. export default {
  50. components: {
  51. indicator,
  52. },
  53. props: {
  54. list: {
  55. type: Array,
  56. default() {
  57. return []
  58. }
  59. }
  60. },
  61. data() {
  62. return {
  63. current: 0,
  64. }
  65. },
  66. onLoad() {
  67. },
  68. methods: {
  69. onChange(e) {
  70. this.current = e.detail.current
  71. }
  72. },
  73. }
  74. </script>
  75. <style scoped lang="scss">
  76. .view {
  77. width: 100vw;
  78. }
  79. .top {
  80. width: 100%;
  81. padding: 80rpx 32rpx 30rpx 32rpx;
  82. box-sizing: border-box;
  83. .route {
  84. width: 100%;
  85. height: calc((100vw - 32rpx*2) * 314 / 343);
  86. border-radius: 64rpx;
  87. background-image: linear-gradient(#F3F3F3, #FAFAFF);
  88. box-shadow: -5rpx -5rpx 20rpx 0 #FFFFFF,
  89. 10rpx 10rpx 20rpx 0 #AAAACC80,
  90. 4rpx 4rpx 10rpx 0 #AAAACC40,
  91. -2rpx -2rpx 5rpx 0 #FFFFFF;
  92. .img {
  93. width: 100%;
  94. height: auto;
  95. }
  96. }
  97. }
  98. .bottom {
  99. width: 100%;
  100. }
  101. .swiper {
  102. width: 100%;
  103. height: 518rpx;
  104. padding-left: 22rpx;
  105. &-item {
  106. width: 310rpx;
  107. height: 518rpx;
  108. padding: 10rpx 30rpx 40rpx 10rpx;
  109. box-sizing: border-box;
  110. &-content {
  111. position: relative;
  112. width: 100%;
  113. height: 100%;
  114. box-sizing: border-box;
  115. .card {
  116. position: relative;
  117. width: 270rpx;
  118. height: 332rpx;
  119. border-radius: 32rpx;
  120. padding: 0;
  121. background-image: linear-gradient(45deg, #FAFAFF, #F3F3F3);
  122. box-shadow: -5rpx -5rpx 10rpx 0 #FFFFFF,
  123. 10rpx 10rpx 20rpx 0 #AAAACC80,
  124. 4rpx 4rpx 10rpx 0 #AAAACC40,
  125. -2rpx -2rpx 5rpx 0 #FFFFFF;
  126. .img {
  127. position: absolute;
  128. left: 0;
  129. bottom: 0;
  130. width: 100%;
  131. height: auto;
  132. }
  133. .title {
  134. position: absolute;
  135. top: 24rpx;
  136. width: 100%;
  137. text-align: center;
  138. font-weight: 200;
  139. font-size: 40rpx;
  140. line-height: 1.4;
  141. }
  142. }
  143. .desc {
  144. text-align: center;
  145. font-size: 24rpx;
  146. font-family: PingFang SC;
  147. font-weight: 300;
  148. line-height: 1.6;
  149. color: #252545;
  150. padding: 32rpx 0 40rpx 0;
  151. }
  152. }
  153. }
  154. }
  155. .indicator {
  156. display: inline-flex;
  157. width: auto;
  158. height: 12rpx;
  159. border-radius: 6rpx;
  160. background: #D9D9D9;
  161. &-dot {
  162. display: inline-block;
  163. width: 34rpx;
  164. height: 12rpx;
  165. border-radius: 6rpx;
  166. background: transparent;
  167. &.is-active {
  168. background-image: linear-gradient(to right, #4B348F, #845CFA);
  169. }
  170. }
  171. }
  172. </style>