Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
9e98946c
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看板
提交
9e98946c
编写于
9月 23, 2023
作者:
DCloud-yyl
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
删除component/long-list页面
上级
0076bacc
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
0 addition
and
172 deletion
+0
-172
pages/component/long-list/detail/detail.uvue
pages/component/long-list/detail/detail.uvue
+0
-37
pages/component/long-list/long-list.uvue
pages/component/long-list/long-list.uvue
+0
-135
未找到文件。
pages/component/long-list/detail/detail.uvue
已删除
100644 → 0
浏览文件 @
0076bacc
<template>
<!-- #ifdef APP -->
<scroll-view style="flex: 1">
<!-- #endif -->
<view class="article-content">
<text>{{content}}</text>
</view>
<!-- #ifdef APP -->
</scroll-view>
<!-- #endif -->
</template>
<script>
export default {
data() {
return {
content: "",
}
},
onLoad(event) {
if(event != null){
this.content = event["content"] ?? "";
}
},
methods: {
}
}
</script>
<style>
.article-content {
padding: 0 30rpx;
overflow: hidden;
font-size: 30rpx;
margin-bottom: 30rpx;
}
</style>
\ No newline at end of file
pages/component/long-list/long-list.uvue
已删除
100644 → 0
浏览文件 @
0076bacc
<template>
<view style="width: 100%;height: 100%;">
<list-view class="uni-list" refresher-enabled=true @refresherrefresh="onRefresherrefresh"
:refresher-triggered="refresherTriggered" scroll-y = true>
<list-item v-for="(value, index) in listData" :key="index">
<view class="uni-list-cell" hover-class="uni-list-cell-hover" @click="goDetail(value)">
<view class="uni-media-list">
<image class="uni-media-list-logo" :src="value.img"></image>
<view class="uni-media-list-body">
<text class="uni-media-list-text-top">{{ value.title }}</text>
<view class="uni-media-list-text-bottom">
<text class="uni-media-list-text">{{ value.subTitle }}</text>
</view>
</view>
</view>
</view>
</list-item>
</list-view>
</view>
</template>
<script>
type Item = {
title: string
subTitle: string,
img: string,
detail: string,
}
export default {
data() {
return {
refresherTriggered: false,
listData: [] as Item[],
last_id: '',
pageVisible: false
};
},
onLoad() {
this.pageVisible = true;
this.getList();
},
onUnload() {
this.pageVisible = false;
},
methods: {
getList() {
const fileManager = uni.getFileSystemManager()
fileManager.readFile({
encoding:'utf-8',
filePath:'static/list-mock/mock.json',
success:function(result){
const content = result.data;
const items = [] as Item[];
const jsonArr = JSON.parse<Array<UTSJSONObject>>(content);
if(jsonArr != null){
jsonArr.forEach((json) => {
const title = json["title"] as string;
const subTitle = json["subTitle"] as string;
const img = json["img"] as string;
const detail = json["detail"] as string;
const item:Item = {
title,
subTitle,
img,
detail
}
items.push(item);
})
let temp = [] as Item[];
for(let i = 0; i < 100; i++){
temp = temp.concat(items);
}
this.listData = temp;
}
setTimeout(()=>{
this.refresherTriggered = false
},0);
},
complete:function(_){
}
} as ReadFileOptions)
},
goDetail(e: Item) {
uni.navigateTo({
url: '/pages/component/long-list/detail/detail?content=' + e.detail
});
},
onRefresherrefresh() {
if(this.pageVisible){
this.refresherTriggered = true
this.getList();
}
}
}
};
</script>
<style>
.uni-media-list {
padding: 22rpx 30rpx;
box-sizing: border-box;
display: flex;
width: 100%;
flex-direction: row;
}
.uni-media-list-logo {
width: 180rpx;
height: 140rpx;
}
.uni-media-list-body {
flex: 1;
padding-left: 15rpx;
}
.uni-media-list-text-top {
font-size: 28rpx;
lines:2;
overflow: hidden;
}
.uni-media-list-text-bottom {
display: flex;
margin-top: 10rpx;
}
.uni-media-list-text {
color: #9D9D9F;
font-size: 25rpx;
}
</style>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录