当前位置:网站首页>Uni app product classification
Uni app product classification
2022-07-01 19:36:00 【Black and white】
<template>
<view class="classify">
<!-- The classification part -->
<view class="cate-left">
<view :class="['cate-item',activeIndex==index?'active':'']" v-for="(item,index) in cateList" :key="index" @click="changeActive(index)">{
{item.classifyName}}</view>
</view>
<view class="cate-right">
<view class="cate-content" v-for="(it,id) in 30" :key="id" @click="getto(it)">
<image src="../../static/images/userinfo.jpg" mode=""></image>
<view class="cate-text"> good thing </view>
</view>
</view>
</view>
</template>
<script> export default {
data() {
return {
scrollTop: 0, // Initialized classification list cateList: [{
classifyName: ' Women's wear ', id: 1 }, {
classifyName: ' Wash and protect ', id: 2 }, {
classifyName: ' Underwear ', id: 3 }, {
classifyName: ' department ', id: 4 }, {
classifyName: ' Ornaments ', id: 5 }, {
classifyName: ' Maternal and infant ', id: 6 }, {
classifyName: ' Digital ', id: 7 }, {
classifyName: ' food ', id: 8 }, {
classifyName: ' Electrical appliances ', id: 9 }, {
classifyName: ' import ', id: 10 }, {
classifyName: ' mobile phone ', id: 11 }, {
classifyName: ' Home decoration ', id: 12 }, {
classifyName: ' Beauty makeup ', id: 13 }], // The index number of the currently clicked item activeIndex: 0, // Commodity information under classification goodList: [] }; }, methods: {
async getcateList() {
const res = await uni.$http.get('/classify') console.log(res) const {
data: {
classify, code } } = res if (code != 200) {
return uni.showToast({
title: ' Failed to load data ', duration: 1000, icon: 'none' }) } else {
this.cateList = classify // Get the goods under the first category this.goodList = classify[0].children } }, // Change the index number of the clicked item changeActive(i) {
this.activeIndex = i // Index number obtained this.goodList = this.cateList[i].children }, // Click the search box to jump to the search page getto(it) {
console.log(it,123) uni.navigateTo({
url: '/pages-zzfw/productDisplay-detail/productDisplay-detail' }) }, }, onLoad() {
// this.getcateList() } } </script>
<style lang="scss" scoped> .classify {
background-color: #fff; width: 100%; height: 100%; display: flex; justify-content: space-between; .cate-left {
width: 200rpx; height: 100vh; overflow: auto; background-color: #F6F6F6; .cate-item {
width: 100%; height: 100rpx; line-height: 100rpx; padding-left: 40rpx; box-sizing: border-box; } .active {
background-color: #FFFFFF; position: relative; padding-left: 40rpx; box-sizing: border-box; &::before {
content: ''; display: block; width: 5rpx; border-radius: 6rpx; height: 50rpx; background-color: #FC4353; position: absolute; left: 5rpx; top: 30rpx; } } } .cate-right {
width: 80%; height: 100vh; overflow: auto; .cate-content {
float: left; width: 28%; height: 185rpx; text-align: center; margin: 20rpx 0 0 15rpx; padding: 5rpx; background: #f1f1f1; border-radius: 20rpx; image {
width: 100rpx; height: 100rpx; } .cate-text {
font-size: 34rpx; } } } } </style>

边栏推荐
- GB28181之SIP协议
- 精耕渠道共谋发展 福昕携手伟仕佳杰开展新产品培训大会
- 事务隔离级别 gap锁 死锁
- 案例分享:QinQ基本组网配置
- pickle. Load error [attributeerror: can't get attribute 'volatile' on < module '\u main']
- axure不显示元件库
- [English grammar] Unit1 articles, nouns, pronouns and numerals
- 【Go ~ 0到1 】 第四天 6月30 defer,结构体,方法
- 音视频、编解码相关电子书、小工具,打包奉送!
- Contos 7 set up SFTP to create users, user groups, and delete users
猜你喜欢
使用环信提供的uni-app Demo,快速实现一对一单聊

sql查询去重统计的方法总结

任务:拒绝服务DoS

论文阅读【Learning to Discretely Compose Reasoning Module Networks for Video Captioning】
![Extensive reading of the paper [film: visual reasoning with a general condition layer]](/img/69/f4ba37a7eae34a7e698127c31b0161.png)
Extensive reading of the paper [film: visual reasoning with a general condition layer]

Introduction and installation of crunch, and making password dictionary with crunch

Introduction to relevant processes and functions of wechat official account development

What must be done in graduation season before going to Shanhai

寶,運維100+服務器很頭疼怎麼辦?用行雲管家!

wireshark报文分析tcp,ftp
随机推荐
[6.24-7.1] review of wonderful technical blog posts in the writing community
Lean thinking: source, pillar, landing. I understand it after reading this article
Dom4J解析XML、Xpath检索XML
Live HLS protocol
【英语语法】Unit1 冠词、名词、代词和数词
Solution and summary of Nacos startup failure
Learning records of building thingsboard, an Internet of things platform
MySQl的基本使用
实现一个Prometheus exporter
研究了11种实时聊天软件,我发现都具备这些功能…
[go ~ 0 to 1] day 5 July 1 type alias, custom type, interface, package and initialization function
Solidity - contract structure - error - ^0.8.4 NEW
论文阅读【Discriminative Latent Semantic Graph for Video Captioning】
Bao, que se passe - t - il si le serveur 100 + O & M a mal à la tête? Utilisez le majordome xingyun!
[pytorch record] distributed training dataparallel and distributeddataparallel of the model
【Go ~ 0到1 】 第五天 7月1 类型别名,自定义类型,接口,包与初始化函数
Basic knowledge of audio coding and decoding
ES6中的代理proxy
ECS summer money saving secret, this time @ old users come and take it away
【sql优化】with as 和 临时表的区别