<template>
|
|
<view class="page">
|
|
<navbar title="商品列表" leftClick @leftClick="$utils.navigateBack" />
|
|
|
|
<view class="category">
|
|
<uv-vtabs
|
|
:list="category"
|
|
keyName="title"
|
|
:barItemBadgeStyle="{right:'20px',top:'12px'}"
|
|
@change="change">
|
|
<uv-vtabs-item>
|
|
<view class="list">
|
|
<productItem
|
|
v-for="(item, index) in list"
|
|
:key="index"
|
|
:item="item"
|
|
@click="$utils.navigateTo('/pages_order/product/productDetail?id=' + item.id)"
|
|
/>
|
|
</view>
|
|
</uv-vtabs-item>
|
|
</uv-vtabs>
|
|
</view>
|
|
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import productItem from '@/components/product/productItem.vue';
|
|
import mixinsList from '@/mixins/list.js'
|
|
import { mapState } from 'vuex'
|
|
export default {
|
|
mixins : [mixinsList],
|
|
components: {
|
|
productItem,
|
|
},
|
|
data() {
|
|
return {
|
|
mixinsListApi : 'getClassShopPageList',
|
|
}
|
|
},
|
|
computed: {
|
|
...mapState(['category'])
|
|
},
|
|
onLoad() {
|
|
this.$store.commit('getCategoryList')
|
|
if(this.category.length > 0){
|
|
this.queryParams.classId = this.category[0].id
|
|
}
|
|
},
|
|
methods: {
|
|
change(e) {
|
|
this.queryParams.classId = this.category[e].id
|
|
this.getData()
|
|
},
|
|
}
|
|
}
|
|
</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>
|