提交 236f7302 编写于 作者: D DCloud_LXH

chore: 修改页面名称以匹配 api 名字

上级 a84f81bf
...@@ -301,7 +301,7 @@ ...@@ -301,7 +301,7 @@
} }
}, },
{ {
"path": "pages/API/show-loading/show-loading", "path": "pages/API/loading/loading",
"style": { "style": {
"navigationBarTitleText": "加载提示框" "navigationBarTitleText": "加载提示框"
} }
...@@ -752,7 +752,7 @@ ...@@ -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": { "style": {
"navigationBarTitleText": "保存图片到相册" "navigationBarTitleText": "保存图片到相册"
} }
......
<template> <template>
<view> <view>
<page-head :title="title"></page-head> <page-head :title="title"></page-head>
<view class="uni-list"> <view class="uni-list">
<view class="uni-list-cell uni-list-cell-pd"> <view class="uni-list-cell uni-list-cell-pd">
<view class="uni-list-cell-db">是否显示透明蒙层-屏蔽点击事件</view> <view class="uni-list-cell-db">是否显示透明蒙层-屏蔽点击事件</view>
<switch :checked="maskSelect" @change="maskChange" /> <switch :checked="maskSelect" @change="maskChange" />
</view> </view>
<view class="uni-padding-wrap"> <view class="uni-padding-wrap">
<view class="uni-title uni-common-mt"> <view class="uni-title uni-common-mt">
<text class="uni-title-text"> 设置标题 </text> <text class="uni-title-text"> 设置标题 </text>
</view> </view>
</view> </view>
<view class="uni-list uni-common-pl"> <view class="uni-list uni-common-pl">
<radio-group @change="radioChange" class="radio-group"> <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" <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" :class="index < items.length - 1 ? 'uni-list-cell-line' : ''" :value="item.value"
:checked="index === current"> :checked="index === current">
{{ item.name }} {{ item.name }}
</radio> </radio>
</radio-group> </radio-group>
</view> </view>
</view> </view>
<view class="uni-padding-wrap"> <view class="uni-padding-wrap">
<view class="uni-btn-v"> <view class="uni-btn-v">
<button class="uni-btn-v" type="primary" @click="showLoading">显示 loading 提示框</button> <button class="uni-btn-v" type="primary" @click="showLoading">显示 loading 提示框</button>
<!-- #ifndef MP-ALIPAY --> <!-- #ifndef MP-ALIPAY -->
<button class="uni-btn-v" @click="hideLoading">隐藏 loading 提示框</button> <button class="uni-btn-v" @click="hideLoading">隐藏 loading 提示框</button>
<!-- #endif --> <!-- #endif -->
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script lang="uts"> <script lang="uts">
type ItemType = { type ItemType = {
value : string value : string
name : string name : string
} }
export default { export default {
data() { data() {
return { return {
title: 'loading', title: 'loading',
items: [ items: [
{ {
value: 'null', value: 'null',
name: '无标题', name: '无标题',
}, },
{ {
value: '三秒后自动关闭', value: '三秒后自动关闭',
name: '普通标题', name: '普通标题',
}, },
{ {
value: '超长文本内容,测试超出范围-超长文本内容,测试超出范围-三秒后自动关闭', value: '超长文本内容,测试超出范围-超长文本内容,测试超出范围-三秒后自动关闭',
name: '长标题', name: '长标题',
}, },
] as ItemType[], ] as ItemType[],
current: 0, current: 0,
maskSelect: false, maskSelect: false,
titleSelect: "null" titleSelect: "null"
} }
}, },
methods: { methods: {
radioChange(e : RadioGroupChangeEvent) { radioChange(e : RadioGroupChangeEvent) {
const selected = this.items.find((item) : boolean => { const selected = this.items.find((item) : boolean => {
return item.value == e.detail.value return item.value == e.detail.value
}) })
if (selected != null) { if (selected != null) {
this.titleSelect = selected.value this.titleSelect = selected.value
} }
}, },
maskChange: function (e : SwitchChangeEvent) { maskChange: function (e : SwitchChangeEvent) {
this.maskSelect = e.detail.value this.maskSelect = e.detail.value
}, },
showLoading: function () { showLoading: function () {
console.log(this.titleSelect) console.log(this.titleSelect)
if (this.titleSelect == "null") { if (this.titleSelect == "null") {
uni.showLoading({ uni.showLoading({
title: "", title: "",
mask: this.maskSelect mask: this.maskSelect
}); });
} else { } else {
uni.showLoading({ uni.showLoading({
title: this.titleSelect, title: this.titleSelect,
mask: this.maskSelect mask: this.maskSelect
}); });
} }
// #ifdef MP-ALIPAY // #ifdef MP-ALIPAY
this._showTimer && clearTimeout(this._showTimer); this._showTimer && clearTimeout(this._showTimer);
this._showTimer = setTimeout(() => { this._showTimer = setTimeout(() => {
this.hideLoading(); this.hideLoading();
}, 3000) }, 3000)
// #endif // #endif
// #ifdef APP-PLUS // #ifdef APP-PLUS
setTimeout(function () { setTimeout(function () {
this.hideLoading(); this.hideLoading();
}, 3000); }, 3000);
// #endif // #endif
}, },
hideLoading: function () { hideLoading: function () {
uni.hideLoading(); uni.hideLoading();
} }
} }
// #ifdef MP-ALIPAY // #ifdef MP-ALIPAY
, ,
onUnload() { onUnload() {
// 页面卸载的时候,手动关闭loading // 页面卸载的时候,手动关闭loading
this._showTimer && clearTimeout(this._showTimer); this._showTimer && clearTimeout(this._showTimer);
} }
// #endif // #endif
} }
</script> </script>
\ No newline at end of file
...@@ -167,7 +167,7 @@ ...@@ -167,7 +167,7 @@
}, },
{ {
name: 'showLoading等待框', name: 'showLoading等待框',
url: 'show-loading', url: 'loading',
}, },
{ {
name: 'showToast轻提示框', name: 'showToast轻提示框',
...@@ -309,7 +309,7 @@ ...@@ -309,7 +309,7 @@
}, },
{ {
name: "保存图片到相册", name: "保存图片到相册",
url: 'save-image-to-album' url: 'save-image-to-photos-album'
} }
/* { /* {
name: "图片选择和拍照", name: "图片选择和拍照",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册