提交 5137b89d 编写于 作者: 杜庆泉's avatar 杜庆泉

showloading 编译告警处理

上级 5577bf26
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<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">
...@@ -13,14 +13,9 @@ ...@@ -13,14 +13,9 @@
</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 <radio class="uni-list-cell uni-list-cell-pd radio" v-for="(item, index) in items" :key="item.value"
class="uni-list-cell uni-list-cell-pd radio" :class="index < items.length - 1 ? 'uni-list-cell-line' : ''" :value="item.value"
v-for="(item, index) in items" :checked="index === current">
:key="item.value"
:class="index < items.length - 1 ? 'uni-list-cell-line' : ''"
:value="item.value"
:checked="index === current"
>
{{ item.name }} {{ item.name }}
</radio> </radio>
</radio-group> </radio-group>
...@@ -38,8 +33,8 @@ ...@@ -38,8 +33,8 @@
</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() {
...@@ -60,39 +55,37 @@ ...@@ -60,39 +55,37 @@
}, },
] 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") {
// 测试空的情况 todo
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(() => {
...@@ -100,12 +93,12 @@ ...@@ -100,12 +93,12 @@
}, 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();
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册