99亚洲_成人性视频免费网站_av在线播放网址_免费成人在线网站_亚洲综合婷婷_亚洲一区二区国产

訂閱本欄目 RSS您所在的位置: 深山工作室 > uni-app > 正文

uni-app一個(gè)像商城分類中心一樣的聯(lián)動(dòng)側(cè)邊欄導(dǎo)航分類

2020/10/1 17:07:20 字體: 瀏覽 4946

<template>
<view>
<view class="ld">
<view class="left">
<scroll-view :scroll-y="true" :scroll-with-animation="true" :scroll-into-view="clickToId" :style="{ height: windowHeight }">
<view v-for="(item, index) in list" :key="index">
<view :class="['title', { active: index === currentNum }]" :id="'to' + index" @click="setId(index)">{{ item.title }}</view>
</view>
</scroll-view>
</view>
<view class="right">
<scroll-view :scroll-into-view="clickId" @scroll="scroll" :scroll-with-animation="true" :scroll-y="true" :style="{ height: windowHeight }">
<view v-for="(item, index) in list" :key="index">
<view class="title,right_title" :id="'po' + index">{{ item.title }}</view>
<view v-for="(it, idx) in item.list" :key="idx">
<text class="item">{{ it }}</text>
</view>
</view>
</scroll-view>
</view>
</view>
</view>
</template>

<script>
export default {
data() {
return {
list: [
{
title: '菜單1',
list: ['蓋飯1', '大白菜1', '土豆1', '西紅柿1', '辣椒1']
},
{
title: '菜單2',
list: ['蓋飯2', '大白菜2', '土豆2', '西紅柿2', '辣椒2']
},
{
title: '菜單3',
list: ['蓋飯3', '大白菜3', '土豆3', '西紅柿3', '辣椒3']
},
{
title: '菜單4',
list: ['蓋飯4', '大白菜4', '土豆4', '西紅柿4', '辣椒4']
},
{
title: '菜單5',
list: ['蓋飯5', '大白菜5', '土豆5', '西紅柿5', '辣椒5']
},
{
title: '菜單6',
list: ['蓋飯6', '大白菜6', '土豆6', '西紅柿6', '辣椒6']
},
{
title: '菜單7',
list: ['蓋飯7', '大白菜7', '土豆7', '西紅柿7', '辣椒7']
},
{
title: '菜單8',
list: ['蓋飯8', '大白菜8', '土豆8', '西紅柿8', '辣椒8']
},
{
title: '菜單9',
list: ['蓋飯9', '大白菜9', '土豆9', '西紅柿9', '辣椒9']
},
{
title: '菜單10',
list: ['蓋飯10', '大白菜10', '土豆10', '西紅柿10', '辣椒10']
},
{
title: '菜單11',
list: ['蓋飯11', '大白菜11', '土豆11', '西紅柿11', '辣椒11']
},
{
title: '菜單12',
list: ['蓋飯12', '大白菜12', '土豆12', '西紅柿12', '辣椒12']
},
{
title: '菜單13',
list: ['蓋飯13', '大白菜13', '土豆13', '西紅柿13', '辣椒13']
}
],
windowHeight: '0px',
clickId: '',
clickToId: '',
currentNum: 0,
topList: [],
isLeftClick: false
};
},
methods: {
setId(index) {
this.clickId = 'po' + index;
this.isLeftClick = true;
this.currentNum = index;
},
scroll(e) {
if (this.isLeftClick) {
this.isLeftClick = false;
return;
}
let scrollTop = e.target.scrollTop;
for (let i = 0; i < this.topList.length; i++) {
let h1 = this.topList[i];
let h2 = this.topList[i + 1];
if (scrollTop >= h1 && scrollTop < h2) {
this.currentNum = i;
this.clickToId = 'to' + i;
}
//解決滾動(dòng)到最后選項(xiàng)左側(cè)不會(huì)選中
let length = this.topList.length;
if (scrollTop >= this.topList[length - 1]) {
this.currentNum = length - 1;
this.clickToId = 'to' + length - 1;
}
}
},
getNodesInfo() {
//獲取節(jié)點(diǎn)為.right_title距離頂部的距離,返回值放在數(shù)組中
const query = uni.createSelectorQuery().in(this);
query
.selectAll('.right_title')
.boundingClientRect()
.exec(res => {
console.log(res);
let nodes = res[0];
let rel = [];
nodes.map(item => {
rel.push(item.top);
});
console.log(rel);
this.topList = rel;
});
}
},
onLoad() {
let _that = this;
uni.getSystemInfo({
success: function(res) {
_that.windowHeight = res.windowHeight + 'px';
}
});
this.getNodesInfo();
}
};
</script>

<style lang="less">
.ld {
display: flex;

.left {
width: 160upx;
border-right: 1upx solid red;

.title {
text-align: center;
height: 100upx;
line-height: 100upx;
color: #000000;
}
.active {
background-color: #dd524d;
color: #ffffff;
}
}

.right {
flex: 1;

.title {
color: #dd524d;
padding: 20upx;
font-weight: 700;
}

.item {
padding-left: 20upx;
display: inline-block;
height: 350upx;
}
}
}
</style>

相關(guān)閱讀
rs操作數(shù)據(jù)表記錄集對(duì)象的方法
長(zhǎng)城國(guó)際集團(tuán)有限公司
深山留言板5.0新版
IE 7.0 BETA3 瀏覽器綠色免安裝版下載
連云港旅游協(xié)會(huì)
利用CSS設(shè)置網(wǎng)頁(yè)滾動(dòng)條顏色
純asp根據(jù)當(dāng)前日期計(jì)算出相應(yīng)的星座
深山旅行社管理系統(tǒng)二次開(kāi)發(fā)是怎么收費(fèi)?
共有0條關(guān)于《uni-app一個(gè)像商城分類中心一樣的聯(lián)動(dòng)側(cè)邊欄導(dǎo)航分類》的評(píng)論
發(fā)表評(píng)論
正在加載評(píng)論......
返回頂部發(fā)表評(píng)論
呢 稱:
表 情:
內(nèi) 容:
評(píng)論內(nèi)容:不能超過(guò) 1000 字,需審核,請(qǐng)自覺(jué)遵守互聯(lián)網(wǎng)相關(guān)政策法規(guī)。
驗(yàn)證碼: 驗(yàn)證碼 
網(wǎng)友評(píng)論聲明,請(qǐng)自覺(jué)遵守互聯(lián)網(wǎng)相關(guān)政策法規(guī)。

您發(fā)布的評(píng)論即表示同意遵守以下條款:
一、不得利用本站危害國(guó)家安全、泄露國(guó)家秘密,不得侵犯國(guó)家、社會(huì)、集體和公民的合法權(quán)益;
二、不得發(fā)布國(guó)家法律、法規(guī)明令禁止的內(nèi)容;互相尊重,對(duì)自己在本站的言論和行為負(fù)責(zé);
三、本站對(duì)您所發(fā)布內(nèi)容擁有處置權(quán)。

更多信息>>欄目類別選擇
百度小程序開(kāi)發(fā)
微信小程序開(kāi)發(fā)
微信公眾號(hào)開(kāi)發(fā)
uni-app
asp函數(shù)庫(kù)
ASP
DIV+CSS
HTML
python
更多>>同類信息
uni-app開(kāi)發(fā)表單input組件的一些規(guī)則說(shuō)明自己預(yù)留使用
uni-app:使用uni.downloadFile下載word或pdf文件并保存到手機(jī)
小程序中利用addPhoneContact將聯(lián)系人的信息添加到手機(jī)通訊錄支持保存聯(lián)系人頭像
微信小程序打開(kāi)客服提示:該小程序提供的服務(wù)出現(xiàn)故障,請(qǐng)稍后重試
微信小程序客服會(huì)話只能過(guò)button讓用戶主動(dòng)觸發(fā)
uni-app開(kāi)發(fā)微信小程序使用button的open-type為contact調(diào)用微信客服不能用view或者js調(diào)用
更多>>最新添加文章
dw里面查找替換使用正則刪除sqlserver里面的CONSTRAINT
Android移動(dòng)端自動(dòng)化測(cè)試:使用UIAutomatorViewer與Selenium定位元素
抖音直播音掛載小雪花 懂車帝小程序
javascript獲取瀏覽器指紋可以用來(lái)做投票
火狐Mozilla Firefox出現(xiàn):無(wú)法載入您的Firefox配置文件 它可能已經(jīng)丟失 或是無(wú)法訪問(wèn) 問(wèn)題解決集合處理辦法
在Android、iOS、Windows、MacOS中微信小程序的文件存放路徑
python通過(guò)代碼修改pip下載源讓下載庫(kù)飛起
python里面requests.post返回的res.text還有其它的嗎
更多>>隨機(jī)抽取信息
點(diǎn)擊復(fù)選框自動(dòng)寫(xiě)入textarea,去掉自動(dòng)刪掉,適合做(網(wǎng)站來(lái)源,網(wǎng)站作者)
手動(dòng)調(diào)節(jié)背景色:背景色能用按鈕進(jìn)行手動(dòng)調(diào)節(jié)
利用javascript高亮關(guān)鍵詞并且加上鏈接系列 2
改進(jìn)了的,超強(qiáng)的title效果,看了之后,你肯定會(huì)喜歡。
ASP利用fso讀取文件夾里所有文件的名字
asp讀取QQ的rss之xml數(shù)據(jù)
主站蜘蛛池模板: 国产亚洲精品美女久久久久久久久久 | 久久久久久久久久亚洲 | 国产成人精品久久二区二区 | 理论电影在线 | 精品国产乱码一区二区三区 | 欧美午夜一区二区三区免费大片 | 中文字幕久久精品 | 一本一道久久精品综合 | www.97超碰.com| 蜜桃精品久久久久久久免费影院 | 在线视频亚洲 | 欧美free性丝袜xxxxhd | 99久色| 精品国产乱码久久久久久密桃99 | 一区二区三区视频在线观看 | 精品久久久久久久久久 | 2019中文字幕视频 | 久久久久国产精品免费免费搜索 | 日韩在线欧美 | 欧美日韩国产成人 | 国产99在线 | 亚洲 | 亚洲国产一级 | 日本久久成人 | 国产福利91精品一区二区 | 欧美区日韩区 | 国产黄免费在线观看 | 欧美狠狠操 | 亚洲乱码国产乱码精品精的特点 | 久久精品日韩 | 精品久久久一区 | 亚洲免费美女视频 | 久久久国产视频 | 在线精品日韩 | 在线观看a视频 | 天天精品 | 国产精品久久久久久久久久久久久久 | 日韩h视频 | 日日操夜夜操天天操 | 亚洲一区二区 | 国产乱码一区二区三区在线观看 | 久久人人爽人人爽人人片亚洲 |