青蛙卖大米小程序2024-11-24
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.

78 lines
1.5 KiB

6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
  1. <template>
  2. <view class="page">
  3. <navbar title="商品列表" leftClick @leftClick="$utils.navigateBack" />
  4. <view class="category">
  5. <uv-vtabs
  6. :list="category"
  7. keyName="title"
  8. :barItemBadgeStyle="{right:'20px',top:'12px'}"
  9. @change="change">
  10. <uv-vtabs-item>
  11. <view class="list">
  12. <productItem
  13. v-for="(item, index) in list"
  14. :key="index"
  15. :item="item"
  16. @click="$utils.navigateTo('/pages_order/product/productDetail?id=' + item.id)"
  17. />
  18. </view>
  19. </uv-vtabs-item>
  20. </uv-vtabs>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import productItem from '@/components/product/productItem.vue';
  26. import mixinsList from '@/mixins/list.js'
  27. import { mapState } from 'vuex'
  28. export default {
  29. mixins : [mixinsList],
  30. components: {
  31. productItem,
  32. },
  33. data() {
  34. return {
  35. mixinsListApi : 'getClassShopPageList',
  36. }
  37. },
  38. computed: {
  39. ...mapState(['category'])
  40. },
  41. onLoad() {
  42. this.$store.commit('getCategoryList')
  43. if(this.category.length > 0){
  44. this.queryParams.classId = this.category[0].id
  45. }
  46. },
  47. methods: {
  48. change({index}) {
  49. this.queryParams.classId = this.category[index].id
  50. },
  51. }
  52. }
  53. </script>
  54. <style scoped lang="scss">
  55. .page{
  56. /deep/ .uv-vtabs{
  57. height: calc(100vh - 220rpx) !important;
  58. }
  59. /deep/ .uv-vtabs__bar{
  60. height: calc(100vh - 220rpx) !important;
  61. }
  62. /deep/ .uv-vtabs__content{
  63. height: calc(100vh - 220rpx) !important;
  64. }
  65. }
  66. .category {
  67. font-size: 30rpx;
  68. color: #333;
  69. .list{
  70. margin: 0 auto;
  71. width: 100%;
  72. }
  73. }
  74. </style>