Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
469322d8
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
5994
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看板
提交
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 @@
}
},
{
"path"
:
"pages/API/element-takesnapshot/element-takesnapshot"
,
"style"
:
{
"navigationBarTitleText"
:
"takeSnapshot"
,
"enablePullDownRefresh"
:
false
"path"
:
"pages/API/element-takesnapshot/element-takesnapshot"
,
"style"
:
{
"navigationBarTitleText"
:
"takeSnapshot"
,
"enablePullDownRefresh"
:
false
}
},
{
"path"
:
"pages/API/element-draw/element-draw"
,
"style"
:
{
"navigationBarTitleText"
:
"getDrawableContext"
,
"enablePullDownRefresh"
:
false
"path"
:
"pages/API/element-draw/element-draw"
,
"style"
:
{
"navigationBarTitleText"
:
"getDrawableContext"
,
"enablePullDownRefresh"
:
false
}
},
{
"path"
:
"pages/component/general-event/transition-event"
,
"style"
:
{
"navigationBarTitleText"
:
"transitionend事件"
,
"enablePullDownRefresh"
:
false
"path"
:
"pages/component/general-event/transition-event"
,
"style"
:
{
"navigationBarTitleText"
:
"transitionend事件"
,
"enablePullDownRefresh"
:
false
}
},
{
"path"
:
"pages/API/install-apk/install-apk"
,
"style"
:
{
"navigationBarTitleText"
:
"install-apk"
,
"enablePullDownRefresh"
:
false
"path"
:
"pages/API/install-apk/install-apk"
,
"style"
:
{
"navigationBarTitleText"
:
"install-apk"
,
"enablePullDownRefresh"
:
false
}
},
{
"path"
:
"pages/template/schema/schema"
,
"style"
:
{
"navigationBarTitleText"
:
"打开schema示例"
"path"
:
"pages/template/schema/schema"
,
"style"
:
{
"navigationBarTitleText"
:
"打开schema示例"
}
},
{
"path"
:
"pages/component/sticky-section/sticky-section"
,
"style"
:
{
"navigationBarTitleText"
:
"sticky-section"
,
"enablePullDownRefresh"
:
false
"path"
:
"pages/component/sticky-section/sticky-section"
,
"style"
:
{
"navigationBarTitleText"
:
"sticky-section"
,
"enablePullDownRefresh"
:
false
}
},
{
"path"
:
"pages/component/list-view/list-view-multiplex"
,
"style"
:
"path"
:
"pages/component/list-view/list-view-multiplex"
,
"style"
:
{
"navigationBarTitleText"
:
"list-view-multiplex"
,
"enablePullDownRefresh"
:
false
}
},
{
"navigationBarTitleText"
:
"list-view-multiplex"
,
"enablePullDownRefresh"
:
false
"path"
:
"pages/template/share/share"
,
"style"
:
{
"navigationBarTitleText"
:
"分享"
,
"enablePullDownRefresh"
:
false
}
}
...
...
pages/tabBar/template.uvue
浏览文件 @
469322d8
...
...
@@ -8,48 +8,24 @@
</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>
<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="
<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"
>
" 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
>
<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>
...
...
@@ -61,21 +37,21 @@
</template>
<script lang="uts">
type Page = {
name
: string
enable
?: boolean
url
: string
}
type Page = {
name
: string
enable
?: boolean
url
: string
}
type ListItem = {
id
: string
name
: string
open
: boolean
pages
: Page[]
url
?: string
enable
?: boolean
}
export default {
type ListItem = {
id
: string
name
: string
open
: boolean
pages
: Page[]
url
?: string
enable
?: boolean
}
export default {
data() {
return {
list: [
...
...
@@ -88,11 +64,11 @@ export default {
pages: [
{
name: '顶部搜索框随时下移长列表',
url:'long-list'
url: 'long-list'
},
{
name: '顶部banner长列表',
url:'long-list2'
url: 'long-list2'
},
] as Page[],
},
...
...
@@ -118,11 +94,11 @@ export default {
pages: [
{
name: '下划线样式',
url:'swiper-list'
url: 'swiper-list'
},
{
name: '字体放大样式',
url:'swiper-list2'
url: 'swiper-list2'
},
] as Page[],
},
...
...
@@ -190,7 +166,19 @@ export default {
name: '日历',
open: false,
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[],
arrowUpIcon: '/static/icons/arrow-up.png',
arrowDownIcon: '/static/icons/arrow-down.png',
...
...
@@ -198,9 +186,9 @@ export default {
}
},
methods: {
triggerCollapse(index: number, item
: ListItem) {
triggerCollapse(index : number, item
: ListItem) {
if (item.pages.length == 0) {
const page
: Page = {
const page
: Page = {
name: item.name,
enable: item.enable,
url: item.url!,
...
...
@@ -216,7 +204,7 @@ export default {
}
}
},
goDetailPage(e
: Page) {
goDetailPage(e
: Page) {
if (e.enable == false) {
uni.showToast({
icon: 'none',
...
...
@@ -233,9 +221,9 @@ export default {
})
},
},
}
}
</script>
<style>
@import '../../common/uni-uvue.css';
@import '../../common/uni-uvue.css';
</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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录