当前位置:网站首页>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>

边栏推荐
- Write it down once Net travel management background CPU Explosion Analysis
- 直播HLS协议
- ECS summer money saving secret, this time @ old users come and take it away
- ffmpeg 音频相关命令
- Lean thinking: source, pillar, landing. I understand it after reading this article
- Detailed explanation of JUnit unit test framework
- ES6中的代理proxy
- [go ~ 0 to 1] day 5 July 1 type alias, custom type, interface, package and initialization function
- [English grammar] Unit1 articles, nouns, pronouns and numerals
- 【无标题】
猜你喜欢

MySQl的基本使用

EasyGBS主子码流都为H.265时,切换出现花屏如何解决?

云服务器ECS夏日省钱秘籍,这次@老用户快来领走

正则表达式=Regex=regular expression

【To .NET】C#集合类源码解析

Bao, what if the O & M 100+ server is a headache? Use Xingyun housekeeper!

Helium transmission line of lake shore cryostat

论文泛读【FiLM: Visual Reasoning with a General Conditioning Layer】

Witness the times! "The future of Renji collaboration has come" 2022 Hongji ecological partnership conference opens live broadcast reservation

音视频、编解码相关电子书、小工具,打包奉送!
随机推荐
Solidity - 算术运算的截断模式(unchecked)与检查模式(checked)- 0.8.0新特性
OpenCV视频质量诊断----视频遮挡诊断
Chinese and English instructions human soluble advanced glycation end products receptor (sRAGE) ELISA Kit
大厂音视频职位面试题目--今日头条
Download (export) PDF template file (such as approval form), and report error: invalid nested tag * * * found, expected closing tag***
Ffmpeg common commands (2)
【森城市】GIS数据漫谈(一)
pickle. Load error [attributeerror: can't get attribute 'volatile' on < module '\u main']
Opencv video quality detection -- sharpness detection
Basic knowledge of audio coding and decoding
【无标题】
学习笔记【gumbel softmax】
ddr4测试-2
Nat penetration of gb28181
wireshark报文分析tcp,ftp
Ffmpeg error code
uni-app微信小程序一键登录获取权限功能
求各种极限的方法
XML语法、约束
DTD modeling