index.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <template>
  2. <div class="" :class="'terminal' + terminal">
  3. <view class="header">
  4. <view class="topBox">
  5. <image class="logo" src="@/static/assets/img/logo.png" mode="widthFix"></image>
  6. <view class="search-btn" @click="searchPro">
  7. <image class="search-icon" src="@/static/img/search.png" mode="widthFix"></image>
  8. </view>
  9. </view>
  10. <category-list @tabChange='tabChange'></category-list>
  11. </view>
  12. <canvas-page v-if="activeTab==0" :terminal="terminal" :typeId="1"></canvas-page>
  13. <category-show v-else :categoryid="categoryid"></category-show>
  14. </div>
  15. </template>
  16. <script>
  17. const API = require('../../../config/api')
  18. import CategoryList from "@/components/basics/categoryList.vue"
  19. import CategoryShow from "@/components/basics/categoryShow.vue"
  20. import canvasPage from '@/components/canvasShow/canvasShowPage.vue'
  21. export default {
  22. components: {
  23. CategoryList,
  24. CategoryShow,
  25. canvasPage
  26. },
  27. data() {
  28. return {
  29. terminal: API.terminal,
  30. activeTab: 0,
  31. categoryid: 0
  32. }
  33. },
  34. methods: {
  35. tabChange(index, id) {
  36. this.activeTab = index
  37. this.categoryid = id
  38. console.log(index, id)
  39. },
  40. // 查询产品
  41. searchPro(key, type) {
  42. uni.navigateTo({
  43. url: `/pages_category_page1/search/index/index`
  44. })
  45. }
  46. }
  47. };
  48. </script>
  49. <style lang="scss" scoped>
  50. .header {
  51. .topBox {
  52. padding-top: 90rpx;
  53. display: flex;
  54. align-items: center;
  55. justify-content: space-between;
  56. width: 100%;
  57. }
  58. .logo {
  59. width: 280rpx;
  60. height: 42rpx;
  61. // margin-left: 30rpx;
  62. }
  63. .search-btn {
  64. height: 66rpx;
  65. background: rgba(255, 255, 255, 1);
  66. border-radius: 33rpx;
  67. display: flex;
  68. flex-direction: row;
  69. align-items: center;
  70. margin-right: 30rpx;
  71. .search-icon {
  72. width: 60rpx;
  73. height: 60rpx;
  74. // margin-left: 33rpx;
  75. }
  76. .search-word {
  77. font-size: 26rpx;
  78. font-weight: 400;
  79. color: rgba(153, 153, 153, 1);
  80. margin-left: 10rpx;
  81. }
  82. }
  83. .tabs-nav-warp {
  84. margin-top: 20rpx;
  85. padding: 0 30rpx;
  86. }
  87. .tabs-nav {
  88. .ul {
  89. display: flex;
  90. .li {
  91. flex: 1 0 auto;
  92. margin-left: 36rpx;
  93. font-size: 30rpx;
  94. color: #999999;
  95. position: relative;
  96. padding-bottom: 18rpx;
  97. &:first-child {
  98. margin-left: 0;
  99. }
  100. &.on {
  101. &:after {
  102. content: '';
  103. width: 100%;
  104. height: 4rpx;
  105. background: #C5AA7B;
  106. position: absolute;
  107. left: 0;
  108. bottom: 0;
  109. }
  110. font-weight:bold;
  111. }
  112. }
  113. }
  114. }
  115. }
  116. .terminal1 {
  117. padding-top: 80upx;
  118. .header {
  119. .topBox {
  120. // justify-content: left;
  121. .search-btn {
  122. .search-icon {
  123. margin-left: 0rpx;
  124. }
  125. }
  126. }
  127. }
  128. }
  129. .topTitle {
  130. display: flex;
  131. justify-content: center;
  132. align-items: center;
  133. height: 100rpx;
  134. width: 100%;
  135. .topText {
  136. text-align: center;
  137. color: #000000;
  138. font-size: 38rpx;
  139. font-weight: bold;
  140. }
  141. }
  142. .terminal2 {}
  143. .terminal3 {}
  144. </style>