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

90 lines
1.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
  1. <template>
  2. <view class="page">
  3. <navbar title="商品列表" leftClick @leftClick="$utils.navigateBack" />
  4. <view class="category">
  5. <uv-vtabs
  6. :chain="chain"
  7. :list="category"
  8. height="1000px"
  9. :barItemBadgeStyle="{right:'20px',top:'12px'}"
  10. @change="change">
  11. <uv-vtabs-item>
  12. <view class="list">
  13. <productItem
  14. v-for="(item, index) in 10"
  15. :key="index"
  16. :item="item"
  17. @click="$utils.navigateTo('/pages_order/product/productDetail?id=123')"
  18. />
  19. </view>
  20. </uv-vtabs-item>
  21. </uv-vtabs>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. import productItem from '@/components/product/productItem.vue';
  27. import mixinsList from '@/mixins/list.js'
  28. export default {
  29. mixins : [mixinsList],
  30. components: {
  31. productItem,
  32. },
  33. data() {
  34. return {
  35. category: [
  36. {
  37. name : '桌布'
  38. },
  39. {
  40. name : '桌布'
  41. },
  42. {
  43. name : '桌布'
  44. },
  45. ],
  46. value: 0
  47. }
  48. },
  49. computed: {
  50. list2() {
  51. const _list = this.list[this.value]?.childrens;
  52. return _list ? _list : [];
  53. }
  54. },
  55. onReady() {
  56. },
  57. methods: {
  58. change(index) {
  59. console.log('选项改变:', index)
  60. this.value = index;
  61. }
  62. }
  63. }
  64. </script>
  65. <style scoped lang="scss">
  66. .page{
  67. /deep/ .uv-vtabs{
  68. height: calc(100vh - 220rpx) !important;
  69. }
  70. /deep/ .uv-vtabs__bar{
  71. height: calc(100vh - 220rpx) !important;
  72. }
  73. /deep/ .uv-vtabs__content{
  74. height: calc(100vh - 220rpx) !important;
  75. }
  76. }
  77. .category {
  78. font-size: 30rpx;
  79. color: #333;
  80. .list{
  81. margin: 0 auto;
  82. width: 100%;
  83. }
  84. }
  85. </style>