From 659d09ec24dab6c451220c8f3bb3943b0fdb3ba1 Mon Sep 17 00:00:00 2001 From: quanyawei <401863037@qq.com> Date: Mon, 08 Jan 2024 16:16:12 +0800 Subject: [PATCH] fix:地图导航 --- uni_modules/uview-ui/components/u-keyboard/u-keyboard.vue | 164 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 164 insertions(+), 0 deletions(-) diff --git a/uni_modules/uview-ui/components/u-keyboard/u-keyboard.vue b/uni_modules/uview-ui/components/u-keyboard/u-keyboard.vue new file mode 100644 index 0000000..14228cb --- /dev/null +++ b/uni_modules/uview-ui/components/u-keyboard/u-keyboard.vue @@ -0,0 +1,164 @@ +<template> + <u-popup + :overlay="overlay" + :closeOnClickOverlay="closeOnClickOverlay" + mode="bottom" + :popup="false" + :show="show" + :safeAreaInsetBottom="safeAreaInsetBottom" + @close="popupClose" + :zIndex="zIndex" + :customStyle="{ + backgroundColor: 'rgb(214, 218, 220)' + }" + > + <view class="u-keyboard"> + <slot /> + <view + class="u-keyboard__tooltip" + v-if="tooltip" + > + <view + hover-class="u-hover-class" + :hover-stay-time="100" + > + <text + class="u-keyboard__tooltip__item u-keyboard__tooltip__cancel" + v-if="showCancel" + @tap="onCancel" + >{{showCancel && cancelText}}</text> + </view> + <view> + <text + v-if="showTips" + class="u-keyboard__tooltip__item u-keyboard__tooltip__tips" + >{{tips ? tips : mode == 'number' ? '������������' : mode == 'card' ? '���������������' : '���������������'}}</text> + </view> + <view + hover-class="u-hover-class" + :hover-stay-time="100" + > + <text + v-if="showConfirm" + @tap="onConfirm" + class="u-keyboard__tooltip__item u-keyboard__tooltip__submit" + hover-class="u-hover-class" + >{{showConfirm && confirmText}}</text> + </view> + </view> + <template v-if="mode == 'number' || mode == 'card'"> + <u-number-keyboard + :random="random" + @backspace="backspace" + @change="change" + :mode="mode" + :dotDisabled="dotDisabled" + ></u-number-keyboard> + </template> + <template v-else> + <u-car-keyboard + :random="random" + :autoChange="autoChange" + @backspace="backspace" + @change="change" + ></u-car-keyboard> + </template> + </view> + </u-popup> +</template> + +<script> + import props from './props.js'; + + /** + * keyboard ������ + * @description ������uViw������������������������������������������������������������������������������������3������������������������������������������������������ + * @tutorial https://www.uviewui.com/components/keyboard.html + * @property {String} mode ��������������������������������������������� ��������� 'number' ��� + * @property {Boolean} dotDisabled ������������"."���������������mode=number��������� ��������� false ��� + * @property {Boolean} tooltip ��������������������������������� ��������� true ��� + * @property {Boolean} showTips ������������������������������������ ��������� true ��� + * @property {String} tips ���������������������������������������������������������������������������������������""��������� + * @property {Boolean} showCancel ������������������������������"������"������ ��������� true ��� + * @property {Boolean} showConfirm ������������������������������"������"��������� ������ true ��� + * @property {Boolean} random ��������������������������������� ��������� false ��� + * @property {Boolean} safeAreaInsetBottom ��������������������������������� ��������� true ��� + * @property {Boolean} closeOnClickOverlay ������������������������������������ ��������� true ��� + * @property {Boolean} show ��������������������������������������� false ��� + * @property {Boolean} overlay ������������������ ��������� true ��� + * @property {String | Number} zIndex ���������������z-index��� ��������� 1075 ��� + * @property {String} cancelText ��������������������� ��������� '������' ��� + * @property {String} confirmText ��������������������� ��������� '������' ��� + * @property {Object} customStyle ������������������������������ + * @event {Function} change ���������������(���������������������������) + * @event {Function} cancel ������������������������������"������"��������������� + * @event {Function} confirm ������������������������������"������"��������������� + * @event {Function} backspace ������������������������ + * @example <u-keyboard mode="number" v-model="show"></u-keyboard> + */ + export default { + name: "u-keyboard", + data() { + return { + + } + }, + mixins: [uni.$u.mpMixin, uni.$u.mixin,props], + methods: { + change(e) { + this.$emit('change', e); + }, + // ������������ + popupClose() { + this.$emit('close'); + }, + // ������������ + onConfirm() { + this.$emit('confirm'); + }, + // ������������ + onCancel() { + this.$emit('cancel'); + }, + // ��������� + backspace() { + this.$emit('backspace'); + } + } + } +</script> + +<style lang="scss" scoped> + @import "../../libs/css/components.scss"; + + .u-keyboard { + + &__tooltip { + @include flex; + justify-content: space-between; + background-color: #FFFFFF; + padding: 14px 12px; + + &__item { + color: #333333; + flex: 1; + text-align: center; + font-size: 15px; + } + + &__submit { + text-align: right; + color: $u-primary; + } + + &__cancel { + text-align: left; + color: #888888; + } + + &__tips { + color: $u-tips-color; + } + } + } +</style> -- Gitblit v1.8.0