敢为人鲜小程序前端代码仓库
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.

117 lines
2.3 KiB

3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
  1. <template>
  2. <view class="page">
  3. <!-- 导航栏 -->
  4. <navbar title="商品列表" leftClick @leftClick="$utils.navigateBack" bgColor="#E3441A" color="#fff" />
  5. <!-- 搜索栏 -->
  6. <view class="search">
  7. <uv-search placeholder="搜你喜欢的产品" bgColor="#fff" @search="getData" @custom="getData"
  8. v-model="queryParams.title"></uv-search>
  9. </view>
  10. <!-- 分类商品列表 -->
  11. <view class="category">
  12. <uv-vtabs :list="category" keyName="title" @change="change">
  13. <view class="list">
  14. <uv-vtabs-item>
  15. <productItem v-for="(item, index) in list" :key="index" :item="item"
  16. @click="$utils.navigateTo('/pages_order/mine/moreCommodity')" />
  17. </uv-vtabs-item>
  18. </view>
  19. </uv-vtabs>
  20. </view>
  21. <!-- tabbar -->
  22. <tabber select="category" />
  23. </view>
  24. </template>
  25. <script>
  26. import productItem from '@/components/product/productItem.vue';
  27. import mixinsList from '@/mixins/list.js'
  28. import {
  29. mapState
  30. } from 'vuex'
  31. import tabber from '@/components/base/tabbar.vue'
  32. export default {
  33. mixins: [mixinsList],
  34. components: {
  35. productItem,
  36. tabber,
  37. },
  38. data() {
  39. return {
  40. mixinsListApi: 'getClassShopPageList',
  41. }
  42. },
  43. computed: {
  44. ...mapState(['category'])
  45. },
  46. onLoad({
  47. search
  48. }) {
  49. if (search) {
  50. this.queryParams.title = search
  51. }
  52. this.$store.commit('getCategoryList')
  53. if (this.category.length > 0) {
  54. this.queryParams.classId = this.category[0].id
  55. }
  56. },
  57. methods: {
  58. change(e) {
  59. this.queryParams.classId = this.category[e].id
  60. this.getData()
  61. },
  62. }
  63. }
  64. </script>
  65. <style scoped lang="scss">
  66. .page {
  67. /deep/ .uv-vtabs {
  68. height: calc(100vh - 470rpx) !important;
  69. }
  70. /deep/ .uv-vtabs__bar {
  71. height: calc(100vh - 470rpx) !important;
  72. }
  73. /deep/ .uv-vtabs__content {
  74. height: calc(100vh - 470rpx) !important;
  75. }
  76. .search {
  77. position: relative;
  78. background: #FFFFFF;
  79. margin: 20rpx;
  80. border-radius: 41rpx;
  81. padding: 10rpx 20rpx;
  82. display: flex;
  83. align-items: center;
  84. /deep/ .uv-search__action {
  85. background-color: $uni-color;
  86. color: #FFFFFF;
  87. padding: 10rpx 20rpx;
  88. border-radius: 30rpx;
  89. }
  90. }
  91. &::v-deep .uv-vtabs__content {
  92. background: transparent !important;
  93. }
  94. }
  95. .category {
  96. font-size: 30rpx;
  97. color: #333;
  98. .list {
  99. width: 100%;
  100. padding: 0rpx 20rpx;
  101. box-sizing: border-box;
  102. }
  103. }
  104. </style>