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

119 lines
2.5 KiB

  1. <template>
  2. <view>
  3. <view class="tabs">
  4. <uv-tabs
  5. :list="tabs"
  6. :activeStyle="{
  7. 'font-family': 'PingFang SC',
  8. 'font-weight': 600,
  9. 'font-size': '28rpx',
  10. 'line-height': 1.5,
  11. 'color': '#FFFFFF',
  12. 'background-color': '#252545',
  13. 'border-radius': '32rpx',
  14. 'padding': '9rpx 40rpx',
  15. }"
  16. :inactiveStyle="{
  17. 'font-family': 'PingFang SC',
  18. 'font-weight': 400,
  19. 'font-size': '28rpx',
  20. 'line-height': 1.5,
  21. 'color': '#252545',
  22. 'background-color': '#E5E4EB',
  23. 'border-radius': '32rpx',
  24. 'padding': '9rpx 40rpx',
  25. }"
  26. lineWidth="0"
  27. lineHeight="0"
  28. @change="onChange"
  29. ></uv-tabs>
  30. </view>
  31. <view class="content">
  32. <view v-for="item in list" :key="item.id">
  33. <productCard
  34. :data="item"
  35. cardStyle="width: 100%; height: 210px;"
  36. imgStyle="width: 100%; height: 110px;"
  37. ></productCard>
  38. </view>
  39. </view>
  40. </view>
  41. </template>
  42. <script>
  43. import productCard from '@/pages_order/product/productCard.vue'
  44. export default {
  45. components: {
  46. productCard,
  47. },
  48. data() {
  49. return {
  50. tabs: [],
  51. current: 0,
  52. list: [],
  53. }
  54. },
  55. mounted() {
  56. this.tabs = [
  57. { name: '生理' },
  58. { name: '心理' },
  59. ]
  60. this.list = [
  61. {
  62. id: '001',
  63. url: '',
  64. name: '情绪管理课程',
  65. sales: 24770,
  66. price: 688.00,
  67. originalPrice: 1664,
  68. },
  69. {
  70. id: '002',
  71. url: '',
  72. name: '我认知与成长课程',
  73. sales: 24770,
  74. price: 688.00,
  75. originalPrice: 1664,
  76. },
  77. {
  78. id: '003',
  79. url: '',
  80. name: '情绪管理课程',
  81. sales: 24770,
  82. price: 688.00,
  83. originalPrice: 1664,
  84. },
  85. {
  86. id: '004',
  87. url: '',
  88. name: '我认知与成长课程',
  89. sales: 24770,
  90. price: 688.00,
  91. originalPrice: 1664,
  92. },
  93. ]
  94. },
  95. methods: {
  96. onChange(e) {
  97. console.log('current', e.index)
  98. this.current = e.index
  99. // todo
  100. },
  101. },
  102. }
  103. </script>
  104. <style scoped lang="scss">
  105. .tabs {
  106. margin: 0 5px;
  107. }
  108. .content {
  109. padding: 16rpx 32rpx 24rpx 32rpx;
  110. display: grid;
  111. grid-template-columns: repeat(2, 1fr);
  112. gap: 32rpx;
  113. }
  114. </style>