app-index-cat.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <template>
  2. <view class="app-index-cat">
  3. <view class="dir-left-nowrap cross-center cat-top">
  4. <view class="box-grow-1 main-center">
  5. <view class="cat-pic-url" v-if="catPicUrl">
  6. <app-image :img-src="catPicUrl" width="29rpx" height="31rpx"></app-image>
  7. </view>
  8. <view class="cat-pic-name">{{name}}</view>
  9. </view>
  10. <view class="dir-left-nowrap cross-center more" @click="jump">
  11. <view>更多</view>
  12. <image class="arrow-right" src="../../../static/image/icon/arrow-right.png"></image>
  13. </view>
  14. </view>
  15. <view class="list">
  16. <app-goods-list :list="list" :list-style="listStyle"></app-goods-list>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. import appGoodsList from '../../page-component/app-goods-list/app-goods-list.vue';
  22. import routeJump from '../../../core/routeJump.js';
  23. export default {
  24. name: "app-index-cat",
  25. components: {
  26. 'app-goods-list': appGoodsList,
  27. },
  28. props: {
  29. catPicUrl: String,
  30. name: String,
  31. listStyle: {
  32. type: String,
  33. default() {
  34. return 1;
  35. }
  36. },
  37. list: Array,
  38. catId: Number
  39. },
  40. methods: {
  41. jump() {
  42. routeJump({
  43. open_type: 'navigate',
  44. page_url: '/pages/goods/list',
  45. params: [
  46. {
  47. key: 'cat_id',
  48. value: this.catId
  49. }
  50. ]
  51. })
  52. }
  53. }
  54. }
  55. </script>
  56. <style scoped lang="scss">
  57. .app-index-cat {
  58. .cat-top {
  59. height: #{80rpx};
  60. padding: 0 #{24rpx};
  61. font-size: #{$uni-font-size-general-one};
  62. background-color: #ffffff;
  63. position: relative;
  64. .cat-pic-url {
  65. // width: #{40rpx};
  66. // height: #{40rpx};
  67. width: #{29rpx};
  68. height: #{34rpx};
  69. margin-right: #{10rpx};
  70. display: flex;
  71. align-items: flex-end;
  72. justify-content: center;
  73. }
  74. .more {
  75. font-size: $uni-font-size-general-two;
  76. color: $uni-general-color-two;
  77. position: absolute;
  78. right: #{24rpx};
  79. top: 0;
  80. z-index: 10;
  81. height: 100%;
  82. .arrow-right {
  83. width: #{12rpx};
  84. height: #{24rpx};
  85. display: block;
  86. margin-left: #{12rpx};
  87. }
  88. }
  89. }
  90. }
  91. .main-center{
  92. display: flex;
  93. justify-content: flex-start;
  94. align-items: center;
  95. .cat-pic-name{
  96. font-size:34upx;
  97. font-family:Source Han Sans CN;
  98. font-weight:500;
  99. color:rgba(61,61,61,1);
  100. }
  101. }
  102. </style>