uview-plus组件库全面升级更新,订单结算判断支付方式是否可用代码调整,公众号关注二维码修改

This commit is contained in:
2025-10-21 10:44:31 +08:00
parent 5d98b7efc2
commit 5f3a307fec
395 changed files with 31264 additions and 2477 deletions

View File

@@ -1,6 +1,7 @@
<template>
<view
class="u-search"
:class="[iconPosition === 'right' && 'u-search__reverse']"
@tap="clickHandler"
:style="[{
margin: margin,
@@ -20,12 +21,12 @@
</slot>
</template>
<view class="u-search__content__icon">
<u-icon
<up-icon
@tap="clickIcon"
:size="searchIconSize"
:name="searchIcon"
:color="searchIconColor ? searchIconColor : color"
></u-icon>
></up-icon>
</view>
<input
confirm-type="search"
@@ -54,16 +55,17 @@
/>
<view
class="u-search__content__icon u-search__content__close"
v-if="keyword && clearabled && focused"
v-if="isShowClear"
@click="clear"
>
<u-icon
<up-icon
name="close"
size="11"
color="#ffffff"
customStyle="line-height: 12px"
></u-icon>
></up-icon>
</view>
<slot name="inputRight"></slot>
</view>
<text
:style="[actionStyle]"
@@ -100,14 +102,16 @@
* @property {String} color 输入框字体颜色(默认 '#606266'
* @property {String} placeholderColor placeholder的颜色默认 '#909399'
* @property {String} searchIcon 输入框左边的图标可以为uView图标名称或图片路径 (默认 'search' )
* @property {String} iconPosition 输入框图标位置left-左边, right-右边 (默认 'left' )
* @property {String} margin 组件与其他上下左右元素之间的距离,带单位的字符串形式,如"30px" (默认 '0' )
* @property {Boolean} animation 是否开启动画,见上方说明(默认 false
* @property {String} value 输入框初始值
* @property {String | Number} maxlength 输入框最大能输入的长度,-1为不限制长度 (默认 '-1' )
* @property {String | Number} height 输入框高度单位px默认 64
* @property {String | Number} label 搜索框左边显示内容
* @property {Boolean} adjustPosition 键盘弹起时,是否自动上推页面
* @property {Boolean} autoBlur 键盘收起时,是否自动失去焦点
* @property {Boolean} adjustPosition 键盘弹起时,是否自动上推页面
* @property {Boolean} autoBlur 键盘收起时,是否自动失去焦点
* @property {Boolean} onlyClearableOnFocused 是否仅在聚焦时显示清除控件(默认 true
* @property {Object} customStyle 定义需要用到的外部样式
*
* @event {Function} change 输入框内容发生变化时触发
@@ -122,7 +126,6 @@
data() {
return {
keyword: '',
showClear: false, // 是否显示右边的清除图标
show: false,
// 标记input当前状态是否处于聚焦中如果是才会显示右侧的清除控件
focused: this.focus
@@ -162,6 +165,18 @@
computed: {
showActionBtn() {
return !this.animation && this.showAction
},
// 是否显示清除控件
isShowClear() {
const { clearabled, focused, keyword, onlyClearableOnFocused } = this;
if (!clearabled) {
return false;
}
if (onlyClearableOnFocused) {
return !!focused && keyword !== "";
} else {
return keyword !== "";
}
}
},
emits: ['clear', 'search', 'custom', 'focus', 'blur', 'click', 'clickIcon', 'update:modelValue', 'change'],
@@ -231,7 +246,6 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/components.scss";
$u-search-content-padding: 0 10px !default;
$u-search-label-color: $u-main-color !default;
$u-search-label-font-size: 14px !default;
@@ -328,5 +342,13 @@ $u-search-action-margin-left: 5px !default;
margin-left: $u-search-action-margin-left;
}
}
&__reverse &__content__icon {
order: 3;
}
&__reverse &__content__close {
order: 2;
}
}
</style>