Skip to content

Commit

Permalink
feat: 完善地区选择组件
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzhenfei committed Oct 14, 2020
1 parent c05a41c commit 111995f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions components/pi-button/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ export default {
position: relative;
display: inline-block;
padding: $pi-button-default-padding;
margin: initial;
border: none;
border-radius: $pi-button-default-radius;
&::after {
Expand Down
1 change: 1 addition & 0 deletions components/pi-date-picker/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<!-- 标题栏 -->
<view
v-if="showTitle"
style="z-index: 1;"
class="pi-justify-center pi-fz-32 pi-fw-500"
:style="[{ padding: getTitlePadding }]"
>
Expand Down
15 changes: 13 additions & 2 deletions components/pi-regions-select/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,15 @@
<slot v-if="$slots.toolbar" name="toolbar" />
<template v-else>
<view class="item-btn" @tap="handlePopupClose">取消</view>
<view class="item-btn pi-primary" @tap="handleConfirm">确定</view>
<pi-button
type="secondary"
size="small"
:disabled="!isCompleted"
:custom-style="{ padding: 0, backgroundColor: 'transparent' }"
@tap="handleConfirm"
>
确定
</pi-button>
</template>
</view>
<pi-tabs v-model="tabCurrentItem" :items="getTabItems" />
Expand Down Expand Up @@ -73,7 +81,7 @@
<!-- 顶部操作条 -->
<pi-bottom-bar v-if="toolbarPosition === 'bottom'">
<slot v-if="$slots.toolbar" name="toolbar" />
<pi-button v-else width="100%" type="primary" @tap="handleConfirm">
<pi-button v-else :disabled="!isCompleted" width="100%" type="primary" @tap="handleConfirm">
确定
</pi-button>
</pi-bottom-bar>
Expand Down Expand Up @@ -321,6 +329,9 @@ export default {
tabs.push({ id: 'county', text: county.name || PLEASE_SELECT_TIP })
}
return tabs
},
isCompleted() {
return this.getTabItems.findIndex(t => t.text === PLEASE_SELECT_TIP) === -1
}
},
watch: {
Expand Down

0 comments on commit 111995f

Please sign in to comment.