Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
236f7302
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
5992
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看板
提交
236f7302
编写于
9月 26, 2023
作者:
D
DCloud_LXH
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: 修改页面名称以匹配 api 名字
上级
a84f81bf
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
116 addition
and
116 deletion
+116
-116
pages.json
pages.json
+2
-2
pages/API/loading/loading.uvue
pages/API/loading/loading.uvue
+112
-112
pages/API/save-image-to-photos-album/save-image-to-photos-album.uvue
...ave-image-to-photos-album/save-image-to-photos-album.uvue
+0
-0
pages/tabBar/API.uvue
pages/tabBar/API.uvue
+2
-2
未找到文件。
pages.json
浏览文件 @
236f7302
...
...
@@ -301,7 +301,7 @@
}
},
{
"path"
:
"pages/API/
show-loading/show-
loading"
,
"path"
:
"pages/API/
loading/
loading"
,
"style"
:
{
"navigationBarTitleText"
:
"加载提示框"
}
...
...
@@ -752,7 +752,7 @@
}
},
{
"path"
:
"pages/API/save-image-to-
album/save-image-to
-album"
,
"path"
:
"pages/API/save-image-to-
photos-album/save-image-to-photos
-album"
,
"style"
:
{
"navigationBarTitleText"
:
"保存图片到相册"
}
...
...
pages/API/
show-loading/show-
loading.uvue
→
pages/API/
loading/
loading.uvue
浏览文件 @
236f7302
<template>
<view>
<page-head :title="title"></page-head>
<view class="uni-list">
<view class="uni-list-cell uni-list-cell-pd">
<view class="uni-list-cell-db">是否显示透明蒙层-屏蔽点击事件</view>
<switch :checked="maskSelect" @change="maskChange" />
</view>
<view class="uni-padding-wrap">
<view class="uni-title uni-common-mt">
<text class="uni-title-text"> 设置标题 </text>
</view>
</view>
<view class="uni-list uni-common-pl">
<radio-group @change="radioChange" class="radio-group">
<radio class="uni-list-cell uni-list-cell-pd radio" v-for="(item, index) in items" :key="item.value"
:class="index < items.length - 1 ? 'uni-list-cell-line' : ''" :value="item.value"
:checked="index === current">
{{ item.name }}
</radio>
</radio-group>
</view>
</view>
<view class="uni-padding-wrap">
<view class="uni-btn-v">
<button class="uni-btn-v" type="primary" @click="showLoading">显示 loading 提示框</button>
<!-- #ifndef MP-ALIPAY -->
<button class="uni-btn-v" @click="hideLoading">隐藏 loading 提示框</button>
<!-- #endif -->
</view>
</view>
</view>
</template>
<script lang="uts">
type ItemType = {
value : string
name : string
}
export default {
data() {
return {
title: 'loading',
items: [
{
value: 'null',
name: '无标题',
},
{
value: '三秒后自动关闭',
name: '普通标题',
},
{
value: '超长文本内容,测试超出范围-超长文本内容,测试超出范围-三秒后自动关闭',
name: '长标题',
},
] as ItemType[],
current: 0,
maskSelect: false,
titleSelect: "null"
}
},
methods: {
radioChange(e : RadioGroupChangeEvent) {
const selected = this.items.find((item) : boolean => {
return item.value == e.detail.value
})
if (selected != null) {
this.titleSelect = selected.value
}
},
maskChange: function (e : SwitchChangeEvent) {
this.maskSelect = e.detail.value
},
showLoading: function () {
console.log(this.titleSelect)
if (this.titleSelect == "null") {
uni.showLoading({
title: "",
mask: this.maskSelect
});
} else {
uni.showLoading({
title: this.titleSelect,
mask: this.maskSelect
});
}
// #ifdef MP-ALIPAY
this._showTimer && clearTimeout(this._showTimer);
this._showTimer = setTimeout(() => {
this.hideLoading();
}, 3000)
// #endif
// #ifdef APP-PLUS
setTimeout(function () {
this.hideLoading();
}, 3000);
// #endif
},
hideLoading: function () {
uni.hideLoading();
}
}
// #ifdef MP-ALIPAY
,
onUnload() {
// 页面卸载的时候,手动关闭loading
this._showTimer && clearTimeout(this._showTimer);
}
// #endif
}
<template>
<view>
<page-head :title="title"></page-head>
<view class="uni-list">
<view class="uni-list-cell uni-list-cell-pd">
<view class="uni-list-cell-db">是否显示透明蒙层-屏蔽点击事件</view>
<switch :checked="maskSelect" @change="maskChange" />
</view>
<view class="uni-padding-wrap">
<view class="uni-title uni-common-mt">
<text class="uni-title-text"> 设置标题 </text>
</view>
</view>
<view class="uni-list uni-common-pl">
<radio-group @change="radioChange" class="radio-group">
<radio class="uni-list-cell uni-list-cell-pd radio" v-for="(item, index) in items" :key="item.value"
:class="index < items.length - 1 ? 'uni-list-cell-line' : ''" :value="item.value"
:checked="index === current">
{{ item.name }}
</radio>
</radio-group>
</view>
</view>
<view class="uni-padding-wrap">
<view class="uni-btn-v">
<button class="uni-btn-v" type="primary" @click="showLoading">显示 loading 提示框</button>
<!-- #ifndef MP-ALIPAY -->
<button class="uni-btn-v" @click="hideLoading">隐藏 loading 提示框</button>
<!-- #endif -->
</view>
</view>
</view>
</template>
<script lang="uts">
type ItemType = {
value : string
name : string
}
export default {
data() {
return {
title: 'loading',
items: [
{
value: 'null',
name: '无标题',
},
{
value: '三秒后自动关闭',
name: '普通标题',
},
{
value: '超长文本内容,测试超出范围-超长文本内容,测试超出范围-三秒后自动关闭',
name: '长标题',
},
] as ItemType[],
current: 0,
maskSelect: false,
titleSelect: "null"
}
},
methods: {
radioChange(e : RadioGroupChangeEvent) {
const selected = this.items.find((item) : boolean => {
return item.value == e.detail.value
})
if (selected != null) {
this.titleSelect = selected.value
}
},
maskChange: function (e : SwitchChangeEvent) {
this.maskSelect = e.detail.value
},
showLoading: function () {
console.log(this.titleSelect)
if (this.titleSelect == "null") {
uni.showLoading({
title: "",
mask: this.maskSelect
});
} else {
uni.showLoading({
title: this.titleSelect,
mask: this.maskSelect
});
}
// #ifdef MP-ALIPAY
this._showTimer && clearTimeout(this._showTimer);
this._showTimer = setTimeout(() => {
this.hideLoading();
}, 3000)
// #endif
// #ifdef APP-PLUS
setTimeout(function () {
this.hideLoading();
}, 3000);
// #endif
},
hideLoading: function () {
uni.hideLoading();
}
}
// #ifdef MP-ALIPAY
,
onUnload() {
// 页面卸载的时候,手动关闭loading
this._showTimer && clearTimeout(this._showTimer);
}
// #endif
}
</script>
\ No newline at end of file
pages/API/save-image-to-
album/save-image-to
-album.uvue
→
pages/API/save-image-to-
photos-album/save-image-to-photos
-album.uvue
浏览文件 @
236f7302
文件已移动
pages/tabBar/API.uvue
浏览文件 @
236f7302
...
...
@@ -167,7 +167,7 @@
},
{
name: 'showLoading等待框',
url: '
show-
loading',
url: 'loading',
},
{
name: 'showToast轻提示框',
...
...
@@ -309,7 +309,7 @@
},
{
name: "保存图片到相册",
url: 'save-image-to-album'
url: 'save-image-to-
photos-
album'
}
/* {
name: "图片选择和拍照",
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录