Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
a4737498
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
5995
Star
90
Fork
162
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
18
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello uni-app x
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
18
Issue
18
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
a4737498
编写于
10月 31, 2023
作者:
shutao-dc
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
long-list2.nvue 添加 nested-scroll-child
上级
49d1183c
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
25 addition
and
9 deletion
+25
-9
pages/template/long-list/long-list-page.uvue
pages/template/long-list/long-list-page.uvue
+5
-1
pages/template/long-list2/long-list2.uvue
pages/template/long-list2/long-list2.uvue
+20
-8
未找到文件。
pages/template/long-list/long-list-page.uvue
浏览文件 @
a4737498
<template>
<template>
<list-view ref="listView" class="list" :rebound="false" :scroll-y="true" :custom-nested-scroll="true"
<list-view ref="listView"
:id=id
class="list" :rebound="false" :scroll-y="true" :custom-nested-scroll="true"
@scrolltolower="loadData(null)">
@scrolltolower="loadData(null)">
<list-item class="list-item" v-for="(item, _) in dataList" :key="item.plugin_id">
<list-item class="list-item" v-for="(item, _) in dataList" :key="item.plugin_id">
<view class="list-item-icon">
<view class="list-item-icon">
...
@@ -60,6 +60,10 @@
...
@@ -60,6 +60,10 @@
preload: {
preload: {
type: Boolean,
type: Boolean,
default: false
default: false
},
id: {
type: String,
default: ''
}
}
},
},
data() {
data() {
...
...
pages/template/long-list2/long-list2.uvue
浏览文件 @
a4737498
<template>
<template>
<scroll-view ref="pageScrollView" class="page" :scroll-y="true" :rebound="false"
<scroll-view ref="pageScrollView" class="page" :scroll-y="true" :rebound="false"
@startnestedscroll="onStartNestedScroll" @nestedprescroll="onNestedPreScroll">
@startnestedscroll="onStartNestedScroll" @nestedprescroll="onNestedPreScroll"
:nested-scroll-child="nestedScrollChildId"
>
<swiper ref="header" indicator-dots="true" circular="true">
<swiper ref="header" indicator-dots="true" circular="true">
<swiper-item v-for="i in 3" :item-id="i">
<swiper-item v-for="i in 3" :item-id="i">
<image src="/static/shuijiao.jpg" style="height: 240px;"></image>
<image src="/static/shuijiao.jpg" style="height: 240px;"></image>
...
@@ -20,7 +22,7 @@
...
@@ -20,7 +22,7 @@
<swiper ref="swiper" class="swiper-view" :current="swiperIndex" @transition="onSwiperTransition"
<swiper ref="swiper" class="swiper-view" :current="swiperIndex" @transition="onSwiperTransition"
@animationfinish="onSwiperAnimationfinish">
@animationfinish="onSwiperAnimationfinish">
<swiper-item class="swiper-item" v-for="(item, index) in swiperList" :key="index">
<swiper-item class="swiper-item" v-for="(item, index) in swiperList" :key="index">
<long-page ref="longPage" :type="item.type" :preload="item.preload"></long-page>
<long-page ref="longPage" :
id="item.id" :
type="item.type" :preload="item.preload"></long-page>
</swiper-item>
</swiper-item>
</swiper>
</swiper>
</view>
</view>
...
@@ -39,6 +41,7 @@
...
@@ -39,6 +41,7 @@
type SwiperViewItem = {
type SwiperViewItem = {
type : string,
type : string,
name : string,
name : string,
id: string,
preload : boolean,
preload : boolean,
}
}
...
@@ -64,19 +67,23 @@
...
@@ -64,19 +67,23 @@
{
{
type: 'UpdatedDate',
type: 'UpdatedDate',
name: '最新上架',
name: '最新上架',
id: "list-id-1",
preload: true
preload: true
} as SwiperViewItem,
} as SwiperViewItem,
{
{
type: 'FreeHot',
type: 'FreeHot',
name: '免费热榜'
name: '免费热榜',
id: "list-id-2"
} as SwiperViewItem,
} as SwiperViewItem,
{
{
type: 'PaymentHot',
type: 'PaymentHot',
name: '付费热榜'
name: '付费热榜',
id: "list-id-3"
} as SwiperViewItem,
} as SwiperViewItem,
{
{
type: 'HotList',
type: 'HotList',
name: '热门总榜'
name: '热门总榜',
id: "list-id-4"
} as SwiperViewItem
} as SwiperViewItem
] as SwiperViewItem[],
] as SwiperViewItem[],
swiperIndex: -1,
swiperIndex: -1,
...
@@ -86,7 +93,8 @@
...
@@ -86,7 +93,8 @@
$tabScrollView: null as null | Element,
$tabScrollView: null as null | Element,
$indicatorNode: null as null | Element,
$indicatorNode: null as null | Element,
$swiperWidth: 0,
$swiperWidth: 0,
$swiperTabsRect: [] as SwiperTabsItem[]
$swiperTabsRect: [] as SwiperTabsItem[],
nestedScrollChildId: ""
}
}
},
},
onReady() {
onReady() {
...
@@ -210,6 +218,10 @@
...
@@ -210,6 +218,10 @@
this.swiperList[index].preload = true;
this.swiperList[index].preload = true;
(this.$refs["longPage"]! as ComponentPublicInstance[])[index].$callMethod('loadData', null)
(this.$refs["longPage"]! as ComponentPublicInstance[])[index].$callMethod('loadData', null)
}
}
//swiper页面切换需要重新赋值嵌套滚动子元素的id
if (this.swiperList[index].id != null) {
this.nestedScrollChildId = this.swiperList[index].id
}
}
}
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录