Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
469322d8
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
6005
Star
91
Fork
164
代码
文件
提交
分支
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看板
提交
469322d8
编写于
11月 26, 2023
作者:
W
wanganxp
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add文本分享示例
上级
8659bafa
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
362 addition
and
341 deletion
+362
-341
pages.json
pages.json
+137
-137
pages/tabBar/template.uvue
pages/tabBar/template.uvue
+192
-204
pages/template/share/share.uvue
pages/template/share/share.uvue
+33
-0
未找到文件。
pages.json
浏览文件 @
469322d8
...
@@ -1022,58 +1022,58 @@
...
@@ -1022,58 +1022,58 @@
}
}
},
},
{
{
"path"
:
"pages/API/element-takesnapshot/element-takesnapshot"
,
"path"
:
"pages/API/element-takesnapshot/element-takesnapshot"
,
"style"
:
"style"
:
{
{
"navigationBarTitleText"
:
"takeSnapshot"
,
"navigationBarTitleText"
:
"takeSnapshot"
,
"enablePullDownRefresh"
:
false
"enablePullDownRefresh"
:
false
}
}
},
},
{
{
"path"
:
"pages/API/element-draw/element-draw"
,
"path"
:
"pages/API/element-draw/element-draw"
,
"style"
:
"style"
:
{
{
"navigationBarTitleText"
:
"getDrawableContext"
,
"navigationBarTitleText"
:
"getDrawableContext"
,
"enablePullDownRefresh"
:
false
"enablePullDownRefresh"
:
false
}
}
},
},
{
{
"path"
:
"pages/component/general-event/transition-event"
,
"path"
:
"pages/component/general-event/transition-event"
,
"style"
:
"style"
:
{
{
"navigationBarTitleText"
:
"transitionend事件"
,
"navigationBarTitleText"
:
"transitionend事件"
,
"enablePullDownRefresh"
:
false
"enablePullDownRefresh"
:
false
}
}
},
},
{
{
"path"
:
"pages/API/install-apk/install-apk"
,
"path"
:
"pages/API/install-apk/install-apk"
,
"style"
:
"style"
:
{
{
"navigationBarTitleText"
:
"install-apk"
,
"navigationBarTitleText"
:
"install-apk"
,
"enablePullDownRefresh"
:
false
"enablePullDownRefresh"
:
false
}
}
},
},
{
{
"path"
:
"pages/template/schema/schema"
,
"path"
:
"pages/template/schema/schema"
,
"style"
:
"style"
:
{
{
"navigationBarTitleText"
:
"打开schema示例"
"navigationBarTitleText"
:
"打开schema示例"
}
}
},
},
{
{
"path"
:
"pages/component/sticky-section/sticky-section"
,
"path"
:
"pages/component/sticky-section/sticky-section"
,
"style"
:
"style"
:
{
{
"navigationBarTitleText"
:
"sticky-section"
,
"navigationBarTitleText"
:
"sticky-section"
,
"enablePullDownRefresh"
:
false
"enablePullDownRefresh"
:
false
}
}
},
},
{
{
"path"
:
"pages/component/list-view/list-view-multiplex"
,
"path"
:
"pages/component/list-view/list-view-multiplex"
,
"style"
:
"style"
:
{
"navigationBarTitleText"
:
"list-view-multiplex"
,
"enablePullDownRefresh"
:
false
}
},
{
{
"navigationBarTitleText"
:
"list-view-multiplex"
,
"path"
:
"pages/template/share/share"
,
"enablePullDownRefresh"
:
false
"style"
:
{
"navigationBarTitleText"
:
"分享"
,
"enablePullDownRefresh"
:
false
}
}
}
}
...
...
pages/tabBar/template.uvue
浏览文件 @
469322d8
...
@@ -8,48 +8,24 @@
...
@@ -8,48 +8,24 @@
</view>
</view>
<view class="uni-text-box">
<view class="uni-text-box">
<text class="hello-text">以下是部分模板示例,更多模板见插件市场:</text>
<text class="hello-text">以下是部分模板示例,更多模板见插件市场:</text>
<u-link
<u-link href="https://ext.dcloud.net.cn" :text="'https://ext.dcloud.net.cn'" :inWhiteList="true"></u-link>
href="https://ext.dcloud.net.cn"
:text="'https://ext.dcloud.net.cn'"
:inWhiteList="true"
></u-link>
</view>
</view>
<view class="uni-panel" v-for="(item, index) in list" :key="item.id">
<view class="uni-panel" v-for="(item, index) in list" :key="item.id">
<view
<view class="uni-panel-h" :class="item.open ? 'uni-panel-h-on' : ''" @click="triggerCollapse(index, item)">
class="uni-panel-h"
<text class="uni-panel-text" :class="item.enable == false ? 'text-disabled' : ''">{{ item.name }}</text>
:class="item.open ? 'uni-panel-h-on' : ''"
<image :src="
@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.pages.length > 0
? item.open
? item.open
? arrowUpIcon
? arrowUpIcon
: arrowDownIcon
: arrowDownIcon
: arrowRightIcon
: arrowRightIcon
"
" class="uni-icon">
class="uni-icon"
>
</image>
</image>
</view>
</view>
<view class="uni-panel-c" v-if="item.open">
<view class="uni-panel-c" v-if="item.open">
<view
<view class="uni-navigate-item" :hover-class="page.enable == false?'':'is--active'"
class="uni-navigate-item"
v-for="(page, key) in item.pages" :key="key" @click="goDetailPage(page)">
:hover-class="page.enable == false?'':'is--active'"
<text class="uni-navigate-text" :class="page.enable == false ? 'text-disabled' : ''">{{ page.name }}</text>
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>
<image :src="arrowRightIcon" class="uni-icon"></image>
</view>
</view>
</view>
</view>
...
@@ -61,21 +37,21 @@
...
@@ -61,21 +37,21 @@
</template>
</template>
<script lang="uts">
<script lang="uts">
type Page = {
type Page = {
name
: string
name
: string
enable
?: boolean
enable
?: boolean
url
: string
url
: string
}
}
type ListItem = {
type ListItem = {
id
: string
id
: string
name
: string
name
: string
open
: boolean
open
: boolean
pages
: Page[]
pages
: Page[]
url
?: string
url
?: string
enable
?: boolean
enable
?: boolean
}
}
export default {
export default {
data() {
data() {
return {
return {
list: [
list: [
...
@@ -88,11 +64,11 @@ export default {
...
@@ -88,11 +64,11 @@ export default {
pages: [
pages: [
{
{
name: '顶部搜索框随时下移长列表',
name: '顶部搜索框随时下移长列表',
url:'long-list'
url: 'long-list'
},
},
{
{
name: '顶部banner长列表',
name: '顶部banner长列表',
url:'long-list2'
url: 'long-list2'
},
},
] as Page[],
] as Page[],
},
},
...
@@ -118,11 +94,11 @@ export default {
...
@@ -118,11 +94,11 @@ export default {
pages: [
pages: [
{
{
name: '下划线样式',
name: '下划线样式',
url:'swiper-list'
url: 'swiper-list'
},
},
{
{
name: '字体放大样式',
name: '字体放大样式',
url:'swiper-list2'
url: 'swiper-list2'
},
},
] as Page[],
] as Page[],
},
},
...
@@ -190,7 +166,19 @@ export default {
...
@@ -190,7 +166,19 @@ export default {
name: '日历',
name: '日历',
open: false,
open: false,
pages: [] as Page[],
pages: [] as Page[],
},
}, {
id: 'schema',
url: 'schema',
name: '打开外部链接',
open: false,
pages: [] as Page[],
}, {
id: 'share',
url: 'share',
name: '分享示例',
open: false,
pages: [] as Page[],
}
] as ListItem[],
] as ListItem[],
arrowUpIcon: '/static/icons/arrow-up.png',
arrowUpIcon: '/static/icons/arrow-up.png',
arrowDownIcon: '/static/icons/arrow-down.png',
arrowDownIcon: '/static/icons/arrow-down.png',
...
@@ -198,9 +186,9 @@ export default {
...
@@ -198,9 +186,9 @@ export default {
}
}
},
},
methods: {
methods: {
triggerCollapse(index: number, item
: ListItem) {
triggerCollapse(index : number, item
: ListItem) {
if (item.pages.length == 0) {
if (item.pages.length == 0) {
const page
: Page = {
const page
: Page = {
name: item.name,
name: item.name,
enable: item.enable,
enable: item.enable,
url: item.url!,
url: item.url!,
...
@@ -216,7 +204,7 @@ export default {
...
@@ -216,7 +204,7 @@ export default {
}
}
}
}
},
},
goDetailPage(e
: Page) {
goDetailPage(e
: Page) {
if (e.enable == false) {
if (e.enable == false) {
uni.showToast({
uni.showToast({
icon: 'none',
icon: 'none',
...
@@ -233,9 +221,9 @@ export default {
...
@@ -233,9 +221,9 @@ export default {
})
})
},
},
},
},
}
}
</script>
</script>
<style>
<style>
@import '../../common/uni-uvue.css';
@import '../../common/uni-uvue.css';
</style>
</style>
\ No newline at end of file
pages/template/share/share.uvue
0 → 100644
浏览文件 @
469322d8
<template>
<view>
<button class="button" @click="shareText('https://uniapp.dcloud.io/uni-app-x','分享到')">分享</button>
</view>
</template>
<script>
import Intent from 'android.content.Intent';
export default {
data() {
return {
}
},
methods: {
shareText(text:string,title:string){
const context = UTSAndroid.getUniActivity()!;
const intent = new Intent(Intent.ACTION_SEND)
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TEXT, text);
context.startActivity(Intent.createChooser(intent, title));
// 这里是简单的文本分享示例,如需分享文件图片,需要使用fileProvider
},
}
}
</script>
<style>
.button {
margin: 30rpx;
}
</style>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录