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

79 lines
1.5 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
  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(e) {
  49. this.queryParams.classId = this.category[e].id
  50. this.getData()
  51. },
  52. }
  53. }
  54. </script>
  55. <style scoped lang="scss">
  56. .page{
  57. /deep/ .uv-vtabs{
  58. height: calc(100vh - 220rpx) !important;
  59. }
  60. /deep/ .uv-vtabs__bar{
  61. height: calc(100vh - 220rpx) !important;
  62. }
  63. /deep/ .uv-vtabs__content{
  64. height: calc(100vh - 220rpx) !important;
  65. }
  66. }
  67. .category {
  68. font-size: 30rpx;
  69. color: #333;
  70. .list{
  71. margin: 0 auto;
  72. width: 100%;
  73. }
  74. }
  75. </style>