storeDetail.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <template>
  2. <view class="">
  3. <view class="top-bg"></view>
  4. <view class="flex store">
  5. <image class="store-img" src="" mode=""></image>
  6. <view class="store-name">
  7. 侍草堂官方旗舰店侍草堂官方旗舰店侍
  8. </view>
  9. <view class="share">
  10. </view>
  11. </view>
  12. <view class="navbar">
  13. <view v-for="(item, index) in navList" :key="index" class="nav-item" :class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. data() {
  20. return {
  21. tabCurrentIndex: 0,
  22. navList: [
  23. {
  24. text: '商品'
  25. },
  26. {
  27. text: '生活号'
  28. }
  29. ]
  30. }
  31. },
  32. methods: {
  33. },
  34. onLoad() {
  35. },
  36. onShow() {
  37. }
  38. }
  39. </script>
  40. <style lang="scss">
  41. .top-bg {
  42. height: 130rpx;
  43. background-image: linear-gradient(to bottom, $base-color, #fff);
  44. // position: absolute;
  45. // top: 0;
  46. width: 100%;
  47. }
  48. .store {
  49. width: 706rpx;
  50. height: 170rpx;
  51. background: #FFFFFF;
  52. border-radius: 14rpx;
  53. margin: -100rpx auto 20rpx;
  54. padding: 30rpx;
  55. // * {
  56. // flex-shrink: 0;
  57. // }
  58. &-img {
  59. width: 92rpx;
  60. height: 92rpx;
  61. border-radius: 10rpx;
  62. flex-shrink: 0;
  63. }
  64. &-name {
  65. font-weight: bold;
  66. font-size: 26rpx;
  67. color: #343436;
  68. flex-grow: 1;
  69. padding: 0 17rpx;
  70. }
  71. .share {
  72. flex-shrink: 0;
  73. width: 103rpx;
  74. height: 47rpx;
  75. background: linear-gradient(89deg, #0EE48C, #00BE8C);
  76. border-radius: 10rpx;
  77. }
  78. }
  79. .navbar {
  80. margin-top: 20rpx;
  81. display: flex;
  82. height: 88rpx;
  83. padding: 0 5px;
  84. background: #fff;
  85. border-radius: 20rpx 20rpx 0 0;
  86. overflow: hidden;
  87. .nav-item {
  88. flex: 1;
  89. display: flex;
  90. justify-content: center;
  91. align-items: center;
  92. height: 100%;
  93. font-size: 15px;
  94. color: #999999;
  95. position: relative;
  96. .current {
  97. color: #000;
  98. &:after {
  99. content: '';
  100. position: absolute;
  101. left: 50%;
  102. bottom: 0;
  103. transform: translateX(-50%);
  104. width: 44px;
  105. height: 0;
  106. border-bottom: 2px solid $base-color;
  107. }
  108. }
  109. }
  110. }
  111. </style>