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

91 lines
1.6 KiB

<template>
<view class="page">
<navbar title="商品列表" leftClick @leftClick="$utils.navigateBack" />
<view class="category">
<uv-vtabs
:chain="chain"
:list="category"
height="1000px"
:barItemBadgeStyle="{right:'20px',top:'12px'}"
@change="change">
<uv-vtabs-item>
<view class="list">
<productItem
v-for="(item, index) in 10"
:key="index"
:item="item"
@click="$utils.navigateTo('/pages_order/product/productDetail?id=123')"
/>
</view>
</uv-vtabs-item>
</uv-vtabs>
</view>
</view>
</template>
<script>
import productItem from '@/components/product/productItem.vue';
import mixinsList from '@/mixins/list.js'
export default {
mixins : [mixinsList],
components: {
productItem,
},
data() {
return {
category: [
{
name : '桌布'
},
{
name : '桌布'
},
{
name : '桌布'
},
],
value: 0
}
},
computed: {
list2() {
const _list = this.list[this.value]?.childrens;
return _list ? _list : [];
}
},
onReady() {
},
methods: {
change(index) {
console.log('选项改变:', index)
this.value = index;
}
}
}
</script>
<style scoped lang="scss">
.page{
/deep/ .uv-vtabs{
height: calc(100vh - 220rpx) !important;
}
/deep/ .uv-vtabs__bar{
height: calc(100vh - 220rpx) !important;
}
/deep/ .uv-vtabs__content{
height: calc(100vh - 220rpx) !important;
}
}
.category {
font-size: 30rpx;
color: #333;
.list{
margin: 0 auto;
width: 100%;
}
}
</style>