普兆健康管家前端代码仓库
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.

93 lines
1.9 KiB

  1. <template>
  2. <view style="padding: 0 32rpx;">
  3. <swiper
  4. class="swiper"
  5. :current="current"
  6. :autoplay="false"
  7. :display-multiple-items="2.09"
  8. @change="onChange"
  9. >
  10. <swiper-item v-for="item in list" :key="item.id" style="display: inline-block;">
  11. <view class="swiper-item">
  12. <productCard
  13. :data="item"
  14. cardStyle="width: 100%; height: 192px;"
  15. imgStyle="width: 100%; height: 110px;"
  16. ></productCard>
  17. </view>
  18. </swiper-item>
  19. <swiper-item style="display: inline-block;">
  20. <view class="swiper-item"></view>
  21. </swiper-item>
  22. <swiper-item style="display: inline-block;">
  23. <view class="swiper-item"></view>
  24. </swiper-item>
  25. </swiper>
  26. <indicator :current="current" :length="list.length" @click="current = $event"></indicator>
  27. </view>
  28. </template>
  29. <script>
  30. import productCard from '@/pages_order/product/productCard.vue'
  31. import indicator from '@/components/home/indicator.vue'
  32. export default {
  33. components: {
  34. productCard,
  35. indicator,
  36. },
  37. data() {
  38. return {
  39. current: 0,
  40. list: [],
  41. }
  42. },
  43. mounted() {
  44. this.list = [
  45. {
  46. id: '001',
  47. url: '',
  48. name: '心电图检查',
  49. price: 688.00,
  50. originalPrice: 1664,
  51. },
  52. {
  53. id: '002',
  54. url: '',
  55. name: '甲状腺功能检查',
  56. price: 688.00,
  57. originalPrice: 1664,
  58. },
  59. {
  60. id: '003',
  61. url: '',
  62. name: '心电图检查',
  63. price: 688.00,
  64. originalPrice: 1664,
  65. },
  66. ]
  67. },
  68. methods: {
  69. onChange(e) {
  70. this.current = e.detail.current
  71. }
  72. },
  73. }
  74. </script>
  75. <style scoped lang="scss">
  76. .swiper {
  77. width: 100vw;
  78. height: 194px;
  79. margin-bottom: 24rpx;
  80. &-item {
  81. width: 100%;
  82. height: 460rpx;
  83. padding-right: 32rpx;
  84. box-sizing: border-box;
  85. }
  86. }
  87. </style>