当前位置:网站首页>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>
边栏推荐
- Les canaux de culture intensive s'efforcent de développer Fu Xin et Wei Shi jiajie pour organiser une conférence de formation sur les nouveaux produits
- Junit单元测试框架详解
- Lean thinking: source, pillar, landing. I understand it after reading this article
- 音视频、编解码相关电子书、小工具,打包奉送!
- [English grammar] Unit1 articles, nouns, pronouns and numerals
- Ubuntu14 install MySQL and configure root account local and remote access
- 线程的并行、并发、生命周期
- OpenCV视频质量检测--清晰度检测
- Werewolf killing strategy: do you think I'm easy to cheat? Who do we believe!
- 测试自学人必看:软件测试如何找测试项目?
猜你喜欢
A brief understanding of white box encryption technology
Methods of finding various limits
ECS summer money saving secret, this time @ old users come and take it away
Dom4J解析XML、Xpath检索XML
Extensive reading of the paper [film: visual reasoning with a general condition layer]
线程的并行、并发、生命周期
Nacos configuration file publishing failed, please check whether the parameters are correct solution
Dom4j parsing XML, XPath retrieving XML
sql查询去重统计的方法总结
精耕渠道共谋发展 福昕携手伟仕佳杰开展新产品培训大会
随机推荐
uni-app微信小程序一键登录获取权限功能
从零开始学 MySQL —数据库和数据表操作
XML语法、约束
Junit单元测试框架详解
Methods of finding various limits
ffmpeg 音频相关命令
optaplanner学习笔记(一)案例Cloud balance
【Go ~ 0到1 】 第四天 6月30 defer,结构体,方法
Use the uni app demo provided by Huanxin to quickly realize one-on-one chat
Collation of open source protocols of open source frameworks commonly used in Web Development
OpenCV视频质量检测--清晰度检测
Extensive reading of the paper [film: visual reasoning with a general condition layer]
ffmpeg常用命令(二)
What must be done in graduation season before going to Shanhai
[English grammar] Unit1 articles, nouns, pronouns and numerals
狼人杀攻略:你当我好骗吗,我们相信谁!
Task: denial of service DOS
Summary of SQL query de duplication statistics methods
Boost the development of digital economy and consolidate the base of digital talents - the digital talent competition was successfully held in Kunming
[info() method in org.slf4j.logger]