珠宝小程序前端代码
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.

122 lines
2.6 KiB

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