Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
9846133f
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看板
提交
9846133f
编写于
11月 03, 2023
作者:
DCloud_Heavensoft
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update template.uvue
上级
228cce67
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
204 addition
and
198 deletion
+204
-198
pages/tabBar/template.uvue
pages/tabBar/template.uvue
+204
-198
未找到文件。
pages/tabBar/template.uvue
浏览文件 @
9846133f
<template>
<!-- #ifdef APP -->
<scroll-view style="flex: 1">
<!-- #endif -->
<view class="uni-container">
<view class="uni-header-logo">
<image class="uni-header-image" src="/static/templateIndex.png"></image>
</view>
<view class="uni-text-box">
<text class="hello-text">以下是部分模板示例,更多模板见插件市场:</text>
<u-link
href="https://ext.dcloud.net.cn"
:text="'https://ext.dcloud.net.cn'"
:inWhiteList="true"
></u-link>
</view>
<view class="uni-panel" v-for="(item, index) in list" :key="item.id">
<view
class="uni-panel-h"
:class="item.open ? 'uni-panel-h-on' : ''"
@click="triggerCollapse(index, item)"
>
<text
class="uni-panel-text"
:class="item.enable == false ? 'text-disabled' : ''"
>{{ item.name }}</text
>
<image
:src="
item.pages.length > 0
? item.open
? arrowUpIcon
: arrowDownIcon
: arrowRightIcon
"
class="uni-icon"
>
</image>
</view>
<view class="uni-panel-c" v-if="item.open">
<view
<template>
<!-- #ifdef APP -->
<scroll-view style="flex: 1">
<!-- #endif -->
<view class="uni-container">
<view class="uni-header-logo">
<image class="uni-header-image" src="/static/templateIndex.png"></image>
</view>
<view class="uni-text-box">
<text class="hello-text">以下是部分模板示例,更多模板见插件市场:</text>
<u-link
href="https://ext.dcloud.net.cn"
:text="'https://ext.dcloud.net.cn'"
:inWhiteList="true"
></u-link>
</view>
<view class="uni-panel" v-for="(item, index) in list" :key="item.id">
<view
class="uni-panel-h"
:class="item.open ? 'uni-panel-h-on' : ''"
@click="triggerCollapse(index, item)"
>
<text
class="uni-panel-text"
:class="item.enable == false ? 'text-disabled' : ''"
>{{ item.name }}</text
>
<image
:src="
item.pages.length > 0
? item.open
? arrowUpIcon
: arrowDownIcon
: arrowRightIcon
"
class="uni-icon"
>
</image>
</view>
<view class="uni-panel-c" v-if="item.open">
<view
class="uni-navigate-item"
:hover-class="page.enable == false?'':'is--active'"
v-for="(page, key) in item.pages"
:key="key"
@click="goDetailPage(page)"
>
<text
class="uni-navigate-text"
:class="page.enable == false ? 'text-disabled' : ''"
>{{ page.name }}</text
>
<image :src="arrowRightIcon" class="uni-icon"></image>
</view>
</view>
</view>
</view>
<!-- #ifdef APP -->
</scroll-view>
<!-- #endif -->
</template>
<script lang="uts">
type Page = {
name: string
enable?: boolean
url: string
}
type ListItem = {
id: string
name: string
open: boolean
pages: Page[]
url?: string
enable?: boolean
}
export default {
data() {
return {
list: [
{
id: 'long-list',
url: 'long-list',
name: '左右滑动长列表',
open: false,
enable: true,
:hover-class="page.enable == false?'':'is--active'"
v-for="(page, key) in item.pages"
:key="key"
@click="goDetailPage(page)"
>
<text
class="uni-navigate-text"
:class="page.enable == false ? 'text-disabled' : ''"
>{{ page.name }}</text
>
<image :src="arrowRightIcon" class="uni-icon"></image>
</view>
</view>
</view>
</view>
<!-- #ifdef APP -->
</scroll-view>
<!-- #endif -->
</template>
<script lang="uts">
type Page = {
name: string
enable?: boolean
url: string
}
type ListItem = {
id: string
name: string
open: boolean
pages: Page[]
url?: string
enable?: boolean
}
export default {
data() {
return {
list: [
{
id: 'long-list',
url: 'long-list',
name: '左右滑动长列表',
open: false,
enable: true,
pages: [
{
name: '顶部搜索框随时下移长列表',
...
...
@@ -94,7 +94,7 @@ export default {
name: '顶部banner长列表',
url:'long-list2'
},
] as Page[],
] as Page[],
},
{
id: 'list-news',
...
...
@@ -102,19 +102,19 @@ export default {
name: '列表到详情',
open: false,
pages: [] as Page[],
},
{
id: 'scroll-fold-nav',
url: 'scroll-fold-nav',
name: '随滚动折叠的导航栏',
open: false,
pages: [] as Page[],
},
{
id: 'swiper-list',
url: 'swiper-list',
name: 'swiper-list',
open: false,
},
{
id: 'scroll-fold-nav',
url: 'scroll-fold-nav',
name: '随滚动折叠的导航栏',
open: false,
pages: [] as Page[],
},
{
id: 'swiper-list',
url: 'swiper-list',
name: 'swiper-list',
open: false,
pages: [
{
name: '下划线样式',
...
...
@@ -124,50 +124,50 @@ export default {
name: '字体放大样式',
url:'swiper-list2'
},
] as Page[],
] as Page[],
},
{
id: 'custom-refresher',
url: 'custom-refresher',
name: '自定义下拉刷新',
open: false,
pages: [] as Page[],
},
{
id: 'pull-zoom-image',
url: 'pull-zoom-image',
name: '下拉缩放顶部封面图',
open: false,
pages: [] as Page[],
},
{
id: 'custom-refresher',
url: 'custom-refresher',
name: '自定义下拉刷新',
open: false,
pages: [] as Page[],
},
{
id: 'pull-zoom-image',
url: 'pull-zoom-image',
name: '下拉缩放顶部封面图',
open: false,
pages: [] as Page[],
},
{
id: 'swiper-vertical-video',
url: 'swiper-vertical-video',
name: '竖滑视频',
open: false,
pages: [] as Page[],
},
{
id: 'scroll-sticky',
url: 'scroll-sticky',
name: 'scroll-view自定义滚动吸顶',
open: false,
pages: [] as Page[],
},
// {
// id: 'half-screen',
// url: 'half-screen',
// name: '半屏弹窗',
{
id: 'swiper-vertical-video',
url: 'swiper-vertical-video',
name: '竖滑视频',
open: false,
pages: [] as Page[],
},
{
id: 'scroll-sticky',
url: 'scroll-sticky',
name: 'scroll-view自定义滚动吸顶',
open: false,
pages: [] as Page[],
},
// {
// id: 'half-screen',
// url: 'half-screen',
// name: '半屏弹窗',
// open: false,
// enable: false,
// pages: [] as Page[],
// },
{
id: 'drop-card',
url: 'drop-card',
name: '划走式卡片',
open: false,
pages: [] as Page[],
// enable: false,
// pages: [] as Page[],
// },
{
id: 'drop-card',
url: 'drop-card',
name: '划走式卡片',
open: false,
pages: [] as Page[],
},
{
id: 'navbar-lite',
...
...
@@ -183,59 +183,65 @@ export default {
open: false,
enable: true,
pages: [] as Page[],
},
{
id: 'calendar',
url: 'calendar',
name: '日历',
open: false,
pages: [] as Page[],
},
] as ListItem[],
arrowUpIcon: '/static/icons/arrow-up.png',
arrowDownIcon: '/static/icons/arrow-down.png',
arrowRightIcon: '/static/icons/arrow-right.png',
}
},
methods: {
triggerCollapse(index: number, item: ListItem) {
if (item.pages.length == 0) {
const page: Page = {
name: item.name,
enable: item.enable,
url: item.url!,
}
this.goDetailPage(page)
return
}
for (var i = 0; i < this.list.length; ++i) {
if (index == i) {
this.list[i].open = !this.list[i].open
} else {
this.list[i].open = false
}
}
},
goDetailPage(e: Page) {
if (e.enable == false) {
uni.showToast({
icon: 'none',
title: '暂不支持',
})
return
}
const url =
e.url.indexOf('platform') > -1
? e.url
: `/pages/template/${e.url}/${e.url}`
uni.navigateTo({
url,
})
},
},
}
</script>
<style>
@import '../../common/uni-uvue.css';
</style>
},
{
id: 'calendar',
url: 'calendar',
name: '日历',
open: false,
pages: [] as Page[],
},{
id: 'schema',
url: 'schema',
name: '打开外部链接',
open: false,
pages: [] as Page[],
},
] as ListItem[],
arrowUpIcon: '/static/icons/arrow-up.png',
arrowDownIcon: '/static/icons/arrow-down.png',
arrowRightIcon: '/static/icons/arrow-right.png',
}
},
methods: {
triggerCollapse(index: number, item: ListItem) {
if (item.pages.length == 0) {
const page: Page = {
name: item.name,
enable: item.enable,
url: item.url!,
}
this.goDetailPage(page)
return
}
for (var i = 0; i < this.list.length; ++i) {
if (index == i) {
this.list[i].open = !this.list[i].open
} else {
this.list[i].open = false
}
}
},
goDetailPage(e: Page) {
if (e.enable == false) {
uni.showToast({
icon: 'none',
title: '暂不支持',
})
return
}
const url =
e.url.indexOf('platform') > -1
? e.url
: `/pages/template/${e.url}/${e.url}`
uni.navigateTo({
url,
})
},
},
}
</script>
<style>
@import '../../common/uni-uvue.css';
</style>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录