确认组箱
This commit is contained in:
@@ -512,6 +512,10 @@ uni-button[disabled]:not([type]), uni-button[disabled][type=default] {
|
|||||||
.uni-date-x {
|
.uni-date-x {
|
||||||
background-color: transparent !important
|
background-color: transparent !important
|
||||||
}
|
}
|
||||||
|
// 下拉框
|
||||||
|
.uni-select--disabled {
|
||||||
|
background-color: #eee !important
|
||||||
|
}
|
||||||
// 标签页
|
// 标签页
|
||||||
.tab-item-wraper {
|
.tab-item-wraper {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
|||||||
@@ -86,7 +86,7 @@
|
|||||||
<span class="filter_label filter_input_disabled">料箱类型</span>
|
<span class="filter_label filter_input_disabled">料箱类型</span>
|
||||||
</view>
|
</view>
|
||||||
<view class="zd-col-18">
|
<view class="zd-col-18">
|
||||||
<input type="text" class="filter_input filter_input_disabled" v-model="boxType" disabled>
|
<input type="text" class="filter_input filter_input_disabled" v-model="['小料箱', '大料箱', '焊条筒'][Number(boxType) - 1]" disabled>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="zd-row border-bottom">
|
<view class="zd-row border-bottom">
|
||||||
|
|||||||
@@ -1,3 +1,38 @@
|
|||||||
|
## 1.1.0(2025-08-19)
|
||||||
|
- 新增 插槽 selected empty option
|
||||||
|
- 新增 mutiple 属性,支持多选功能
|
||||||
|
- 新增 wrap 属性,支持选中的文字超过一行显示
|
||||||
|
- 新增 align 属性,支持修改选中的文字显示的位置
|
||||||
|
- 新增 hideRight 属性,支持隐藏右侧所有按钮
|
||||||
|
- 新增 mode 属性,支持修改边框样式
|
||||||
|
- 新增 事件 open close clear
|
||||||
|
## 1.0.10(2025-04-14)
|
||||||
|
- 修复 清除按钮不展示问题
|
||||||
|
## 1.0.9(2025-03-26)
|
||||||
|
- 优化 默认背景为白色与整体组件保持风格统一
|
||||||
|
## 1.0.8(2024-03-28)
|
||||||
|
- 修复 在vue2下:style动态绑定导致编译失败的bug
|
||||||
|
## 1.0.7(2024-01-20)
|
||||||
|
- 修复 长文本回显超过容器的bug,超过容器部分显示省略号
|
||||||
|
## 1.0.6(2023-04-12)
|
||||||
|
- 修复 微信小程序点击时会改变背景颜色的 bug
|
||||||
|
## 1.0.5(2023-02-03)
|
||||||
|
- 修复 禁用时会显示清空按钮
|
||||||
|
## 1.0.4(2023-02-02)
|
||||||
|
- 优化 查询条件短期内多次变更只查询最后一次变更后的结果
|
||||||
|
- 调整 内部缓存键名调整为 uni-data-select-lastSelectedValue
|
||||||
|
## 1.0.3(2023-01-16)
|
||||||
|
- 修复 不关联服务空间报错的问题
|
||||||
|
## 1.0.2(2023-01-14)
|
||||||
|
- 新增 属性 `format` 可用于格式化显示选项内容
|
||||||
|
## 1.0.1(2022-12-06)
|
||||||
|
- 修复 当where变化时,数据不会自动更新的问题
|
||||||
|
## 0.1.9(2022-09-05)
|
||||||
|
- 修复 微信小程序下拉框出现后选择会点击到蒙板后面的输入框
|
||||||
|
## 0.1.8(2022-08-29)
|
||||||
|
- 修复 点击的位置不准确
|
||||||
|
## 0.1.7(2022-08-12)
|
||||||
|
- 新增 支持 disabled 属性
|
||||||
## 0.1.6(2022-07-06)
|
## 0.1.6(2022-07-06)
|
||||||
- 修复 pc端宽度异常的bug
|
- 修复 pc端宽度异常的bug
|
||||||
## 0.1.5
|
## 0.1.5
|
||||||
|
|||||||
@@ -2,26 +2,57 @@
|
|||||||
<view class="uni-stat__select">
|
<view class="uni-stat__select">
|
||||||
<span v-if="label" class="uni-label-text hide-on-phone">{{label + ':'}}</span>
|
<span v-if="label" class="uni-label-text hide-on-phone">{{label + ':'}}</span>
|
||||||
<view class="uni-stat-box" :class="{'uni-stat__actived': current}">
|
<view class="uni-stat-box" :class="{'uni-stat__actived': current}">
|
||||||
<view class="uni-select">
|
<view class="uni-select" :class="{'uni-select--disabled':disabled, 'uni-select--wrap': shouldWrap , 'border-default': mode == 'default','border-bottom': mode == 'underline'}">
|
||||||
<view class="uni-select__input-box" @click="toggleSelector">
|
<view class="uni-select__input-box" @click="toggleSelector" :class="{'uni-select__input-box--wrap': shouldWrap}">
|
||||||
<view v-if="current" class="uni-select__input-text">{{current}}</view>
|
<view v-if="slotSelected" class="slot-content padding-top-bottom" :class="{'uni-select__input-text--wrap': shouldWrap}">
|
||||||
<view v-else class="uni-select__input-text uni-select__input-placeholder">{{typePlaceholder}}</view>
|
<slot name="selected" :selectedItems="getSelectedItems()"></slot>
|
||||||
<uni-icons class="zd_icon_wraper" v-if="current && clear" type="clear" color="#c0c4cc" size="24" @click="clearVal" />
|
</view>
|
||||||
<uni-icons class="zd_icon_wraper" v-else :type="showSelector? 'top' : 'bottom'" size="14" color="#999" />
|
<template v-else>
|
||||||
|
<view v-if="textShow" class="uni-select__input-text" :class="{'uni-select__input-text--wrap': shouldWrap}">
|
||||||
|
<view class="padding-top-bottom" :class="'align-'+align">{{textShow}}</view>
|
||||||
|
</view>
|
||||||
|
<view v-else class="uni-select__input-text uni-select__input-placeholder" :class="'align-'+align">{{typePlaceholder}}</view>
|
||||||
|
</template>
|
||||||
|
<view key="clear-button" v-if="!hideRight && shouldShowClear && clear && !disabled" @click.stop="clearVal">
|
||||||
|
<uni-icons type="clear" color="#c0c4cc" size="24" />
|
||||||
|
</view>
|
||||||
|
<view key="arrow-button" v-else-if="!hideRight">
|
||||||
|
<uni-icons :type="showSelector? 'top' : 'bottom'" size="14" color="#999" />
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="uni-select--mask" v-if="showSelector" @click="toggleSelector" />
|
<view class="uni-select--mask" v-if="showSelector" @click="toggleSelector" />
|
||||||
<view class="uni-select__selector" v-if="showSelector">
|
<view class="uni-select__selector" :style="getOffsetByPlacement" v-if="showSelector">
|
||||||
<view class="uni-popper__arrow"></view>
|
<view :class="placement=='bottom'?'uni-popper__arrow_bottom':'uni-popper__arrow_top'"></view>
|
||||||
<input v-if="searchInput === true" type="text" class="filter_input filter_input_s" :value="svalue" @input="handleInput($event)">
|
|
||||||
<scroll-view scroll-y="true" class="uni-select__selector-scroll">
|
<scroll-view scroll-y="true" class="uni-select__selector-scroll">
|
||||||
<view class="uni-select__selector-empty" v-if="mixinDatacomResData.length === 0">
|
<template v-if="slotEmpty && mixinDatacomResData.length === 0">
|
||||||
|
<view class="uni-select__selector-empty">
|
||||||
|
<slot name="empty" :empty="emptyTips"></slot>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<view v-if="mixinDatacomResData.length === 0" class="uni-select__selector-empty">
|
||||||
<text>{{emptyTips}}</text>
|
<text>{{emptyTips}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view v-else class="uni-select__selector-item" v-for="(item,index) in mixinDatacomResData"
|
</template>
|
||||||
:key="index" @click="change(item)">
|
<template v-if="slotOption">
|
||||||
<text
|
<view v-for="(itemData,index) in mixinDatacomResData" :key="index" @click="change(itemData)">
|
||||||
:class="{'uni-select__selector__disabled': item.disable}">{{formatItemName(item)}}</text>
|
<slot name="option" :item="itemData" :itemSelected="multiple? getCurrentValues().includes(itemData.value):getCurrentValues() == itemData.value"></slot>
|
||||||
</view>
|
</view>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<view v-if="!multiple && mixinDatacomResData.length > 0" class="uni-select__selector-item" v-for="(item,index) in mixinDatacomResData" :key="index"
|
||||||
|
@click="change(item)">
|
||||||
|
<text :class="{'uni-select__selector__disabled': item.disable}">{{formatItemName(item)}}</text>
|
||||||
|
</view>
|
||||||
|
<view v-if="multiple && mixinDatacomResData.length > 0" >
|
||||||
|
<checkbox-group @change="checkBoxChange">
|
||||||
|
<label class="uni-select__selector-item" v-for="(item,index) in mixinDatacomResData" :key="index" >
|
||||||
|
<checkbox :value="index+''" :checked="getCurrentValues().includes(item.value)" :disabled="item.disable"></checkbox>
|
||||||
|
<view :class="{'uni-select__selector__disabled': item.disable}">{{formatItemName(item)}}</view>
|
||||||
|
</label>
|
||||||
|
</checkbox-group>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -34,26 +65,55 @@
|
|||||||
* DataChecklist 数据选择器
|
* DataChecklist 数据选择器
|
||||||
* @description 通过数据渲染的下拉框组件
|
* @description 通过数据渲染的下拉框组件
|
||||||
* @tutorial https://uniapp.dcloud.io/component/uniui/uni-data-select
|
* @tutorial https://uniapp.dcloud.io/component/uniui/uni-data-select
|
||||||
* @property {String} value 默认值
|
* @property {String|Array} value 默认值,多选时为数组
|
||||||
* @property {Array} localdata 本地数据 ,格式 [{text:'',value:''}]
|
* @property {Array} localdata 本地数据 ,格式 [{text:'',value:''}]
|
||||||
* @property {Boolean} clear 是否可以清空已选项
|
* @property {Boolean} clear 是否可以清空已选项
|
||||||
* @property {Boolean} emptyText 没有数据时显示的文字 ,本地数据无效
|
* @property {Boolean} emptyText 没有数据时显示的文字 ,本地数据无效
|
||||||
* @property {String} label 左侧标题
|
* @property {String} label 左侧标题
|
||||||
* @property {String} placeholder 输入框的提示文字
|
* @property {String} placeholder 输入框的提示文字
|
||||||
|
* @property {Boolean} disabled 是否禁用
|
||||||
|
* @property {Boolean} multiple 是否多选模式
|
||||||
|
* @property {Boolean} wrap 是否允许选中文本换行显示
|
||||||
|
* @property {String} placement 弹出位置
|
||||||
|
* @value top 顶部弹出
|
||||||
|
* @value bottom 底部弹出(default)
|
||||||
|
* @property {String} align 选择文字的位置
|
||||||
|
* @value left 显示左侧
|
||||||
|
* @value center 显示中间
|
||||||
|
* @value right 显示 右侧
|
||||||
|
* @property {Boolean} hideRight 是否隐藏右侧按钮
|
||||||
|
* @property {String} mode 边框样式
|
||||||
|
* @value default 四周边框
|
||||||
|
* @value underline 下边框
|
||||||
|
* @value none 无边框
|
||||||
* @event {Function} change 选中发生变化触发
|
* @event {Function} change 选中发生变化触发
|
||||||
|
* @event {Function} open 选择框开启时触发
|
||||||
|
* @event {Function} close 选择框关闭时触发
|
||||||
|
* @event {Function} clear 点击清除按钮之后触发
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "uni-stat-select",
|
name: "uni-data-select",
|
||||||
mixins: [uniCloud.mixinDatacom || {}],
|
mixins: [uniCloud.mixinDatacom || {}],
|
||||||
data() {
|
emits: [
|
||||||
return {
|
'open',
|
||||||
showSelector: false,
|
'close',
|
||||||
current: '',
|
'update:modelValue',
|
||||||
mixinDatacomResData: [],
|
'input',
|
||||||
apps: [],
|
'clear',
|
||||||
channels: []
|
'change'
|
||||||
};
|
],
|
||||||
|
model: {
|
||||||
|
prop: 'modelValue',
|
||||||
|
event: 'update:modelValue'
|
||||||
|
},
|
||||||
|
options: {
|
||||||
|
// #ifdef MP-TOUTIAO
|
||||||
|
virtualHost: false,
|
||||||
|
// #endif
|
||||||
|
// #ifndef MP-TOUTIAO
|
||||||
|
virtualHost: true
|
||||||
|
// #endif
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
localdata: {
|
localdata: {
|
||||||
@@ -62,20 +122,12 @@
|
|||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
searchInput: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
svalue: {
|
|
||||||
type: [String, Number],
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
value: {
|
value: {
|
||||||
type: [String, Number],
|
type: [String, Number, Array],
|
||||||
default: ''
|
default: ''
|
||||||
},
|
},
|
||||||
modelValue: {
|
modelValue: {
|
||||||
type: [String, Number],
|
type: [String, Number, Array],
|
||||||
default: ''
|
default: ''
|
||||||
},
|
},
|
||||||
label: {
|
label: {
|
||||||
@@ -97,12 +149,57 @@
|
|||||||
defItem: {
|
defItem: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 0
|
default: 0
|
||||||
|
},
|
||||||
|
disabled: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
// 格式化输出 用法 field="_id as value, version as text, uni_platform as label" format="{label} - {text}"
|
||||||
|
format: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
placement: {
|
||||||
|
type: String,
|
||||||
|
default: 'bottom'
|
||||||
|
},
|
||||||
|
multiple: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
wrap: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
align:{
|
||||||
|
type: String,
|
||||||
|
default: "left"
|
||||||
|
},
|
||||||
|
hideRight: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
mode:{
|
||||||
|
type: String,
|
||||||
|
default: 'default'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
showSelector: false,
|
||||||
|
current: '',
|
||||||
|
mixinDatacomResData: [],
|
||||||
|
apps: [],
|
||||||
|
channels: [],
|
||||||
|
cacheKey: "uni-data-select-lastSelectedValue",
|
||||||
|
};
|
||||||
|
},
|
||||||
created() {
|
created() {
|
||||||
this.last = `${this.collection}_last_selected_option_value`
|
this.debounceGet = this.debounce(() => {
|
||||||
|
this.query();
|
||||||
|
}, 300);
|
||||||
if (this.collection && !this.localdata.length) {
|
if (this.collection && !this.localdata.length) {
|
||||||
this.mixinDatacomEasyGet()
|
this.debounceGet();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -117,9 +214,77 @@
|
|||||||
return placeholder ?
|
return placeholder ?
|
||||||
common + placeholder :
|
common + placeholder :
|
||||||
common
|
common
|
||||||
|
},
|
||||||
|
valueCom() {
|
||||||
|
if (this.value === '') return this.modelValue
|
||||||
|
if (this.modelValue === '') return this.value
|
||||||
|
return this.value
|
||||||
|
},
|
||||||
|
textShow() {
|
||||||
|
// 长文本显示
|
||||||
|
if (this.multiple) {
|
||||||
|
const currentValues = this.getCurrentValues();
|
||||||
|
if (Array.isArray(currentValues) && currentValues.length > 0) {
|
||||||
|
const selectedItems = this.mixinDatacomResData.filter(item => currentValues.includes(item.value));
|
||||||
|
return selectedItems.map(item => this.formatItemName(item)).join(', ');
|
||||||
|
} else {
|
||||||
|
return ''; // 空数组时返回空字符串,显示占位符
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return this.current;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
shouldShowClear() {
|
||||||
|
if (this.multiple) {
|
||||||
|
const currentValues = this.getCurrentValues();
|
||||||
|
return Array.isArray(currentValues) && currentValues.length > 0;
|
||||||
|
} else {
|
||||||
|
return !!this.current;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
shouldWrap() {
|
||||||
|
// 只有在多选模式、开启换行、且有内容时才应用换行样式
|
||||||
|
return this.multiple && this.wrap && !!this.textShow;
|
||||||
|
},
|
||||||
|
getOffsetByPlacement() {
|
||||||
|
switch (this.placement) {
|
||||||
|
case 'top':
|
||||||
|
return "bottom:calc(100% + 12px);";
|
||||||
|
case 'bottom':
|
||||||
|
return "top:calc(100% + 12px);";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
slotSelected(){
|
||||||
|
// #ifdef VUE2
|
||||||
|
return this.$scopedSlots ? this.$scopedSlots.selected : false
|
||||||
|
// #endif
|
||||||
|
// #ifdef VUE3
|
||||||
|
return this.$slots ? this.$slots.selected : false
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
slotEmpty(){
|
||||||
|
// #ifdef VUE2
|
||||||
|
return this.$scopedSlots ? this.$scopedSlots.empty : false
|
||||||
|
// #endif
|
||||||
|
// #ifdef VUE3
|
||||||
|
return this.$slots ? this.$slots.empty : false
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
slotOption(){
|
||||||
|
// #ifdef VUE2
|
||||||
|
return this.$scopedSlots ? this.$scopedSlots.option : false
|
||||||
|
// #endif
|
||||||
|
// #ifdef VUE3
|
||||||
|
return this.$slots ? this.$slots.option : false
|
||||||
|
// #endif
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
showSelector:{
|
||||||
|
handler(val,old){
|
||||||
|
val ? this.$emit('open') : this.$emit('close')
|
||||||
|
}
|
||||||
|
},
|
||||||
localdata: {
|
localdata: {
|
||||||
immediate: true,
|
immediate: true,
|
||||||
handler(val, old) {
|
handler(val, old) {
|
||||||
@@ -128,16 +293,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// #ifndef VUE3
|
valueCom(val, old) {
|
||||||
value() {
|
|
||||||
this.initDefVal()
|
this.initDefVal()
|
||||||
},
|
},
|
||||||
// #endif
|
|
||||||
// #ifdef VUE3
|
|
||||||
modelValue() {
|
|
||||||
this.initDefVal()
|
|
||||||
},
|
|
||||||
// #endif
|
|
||||||
mixinDatacomResData: {
|
mixinDatacomResData: {
|
||||||
immediate: true,
|
immediate: true,
|
||||||
handler(val) {
|
handler(val) {
|
||||||
@@ -145,80 +303,184 @@
|
|||||||
this.initDefVal()
|
this.initDefVal()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleInput($event) {
|
getSelectedItems() {
|
||||||
this.$emit('input', $event.target.value)
|
const currentValues = this.getCurrentValues();
|
||||||
this.$emit('handleChange', $event.target.value)
|
let _minxData = this.mixinDatacomResData
|
||||||
|
// #ifdef MP-WEIXIN || MP-TOUTIAO
|
||||||
|
_minxData = JSON.parse(JSON.stringify(this.mixinDatacomResData))
|
||||||
|
// #endif
|
||||||
|
if (this.multiple) {
|
||||||
|
return _minxData.filter(item => currentValues.includes(item.value)) || [];
|
||||||
|
} else {
|
||||||
|
return _minxData.filter(item => item.value === currentValues) || [];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
debounce(fn, time = 100) {
|
||||||
|
let timer = null
|
||||||
|
return function(...args) {
|
||||||
|
if (timer) clearTimeout(timer)
|
||||||
|
timer = setTimeout(() => {
|
||||||
|
fn.apply(this, args)
|
||||||
|
}, time)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 检查项目是否已选中
|
||||||
|
isSelected(item) {
|
||||||
|
if (this.multiple) {
|
||||||
|
const currentValues = this.getCurrentValues();
|
||||||
|
return Array.isArray(currentValues) && currentValues.includes(item.value);
|
||||||
|
} else {
|
||||||
|
return this.getCurrentValues() === item.value;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 获取当前选中的值
|
||||||
|
getCurrentValues() {
|
||||||
|
if (this.multiple) {
|
||||||
|
return Array.isArray(this.valueCom) ? this.valueCom : (this.valueCom ? [this.valueCom] : []);
|
||||||
|
} else {
|
||||||
|
return this.valueCom;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 执行数据库查询
|
||||||
|
query() {
|
||||||
|
this.mixinDatacomEasyGet();
|
||||||
|
},
|
||||||
|
// 监听查询条件变更事件
|
||||||
|
onMixinDatacomPropsChange() {
|
||||||
|
if (this.collection) {
|
||||||
|
this.debounceGet();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
initDefVal() {
|
initDefVal() {
|
||||||
let defValue = ''
|
let defValue = this.multiple ? [] : ''
|
||||||
if ((this.value || this.value === 0) && !this.isDisabled(this.value)) {
|
if ((this.valueCom || this.valueCom === 0) && !this.isDisabled(this.valueCom)) {
|
||||||
defValue = this.value
|
defValue = this.valueCom
|
||||||
} else if ((this.modelValue || this.modelValue === 0) && !this.isDisabled(this.modelValue)) {
|
|
||||||
defValue = this.modelValue
|
|
||||||
} else {
|
} else {
|
||||||
let strogeValue
|
let strogeValue
|
||||||
if (this.collection) {
|
if (this.collection) {
|
||||||
strogeValue = uni.getStorageSync(this.last)
|
strogeValue = this.getCache()
|
||||||
}
|
}
|
||||||
if (strogeValue || strogeValue === 0) {
|
if (strogeValue || strogeValue === 0) {
|
||||||
defValue = strogeValue
|
defValue = strogeValue
|
||||||
} else {
|
} else {
|
||||||
let defItem = ''
|
let defItem = this.multiple ? [] : ''
|
||||||
if (this.defItem > 0 && this.defItem < this.mixinDatacomResData.length) {
|
if (this.defItem > 0 && this.defItem <= this.mixinDatacomResData.length) {
|
||||||
defItem = this.mixinDatacomResData[this.defItem - 1].value
|
defItem = this.multiple ? [this.mixinDatacomResData[this.defItem - 1].value] : this.mixinDatacomResData[this.defItem - 1].value
|
||||||
}
|
}
|
||||||
defValue = defItem
|
defValue = defItem
|
||||||
}
|
}
|
||||||
|
if (defValue || defValue === 0 || (this.multiple && Array.isArray(defValue) && defValue.length > 0)) {
|
||||||
this.emit(defValue)
|
this.emit(defValue)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.multiple) {
|
||||||
|
const selectedValues = Array.isArray(defValue) ? defValue : (defValue ? [defValue] : []);
|
||||||
|
const selectedItems = this.mixinDatacomResData.filter(item => selectedValues.includes(item.value));
|
||||||
|
this.current = selectedItems.map(item => this.formatItemName(item));
|
||||||
|
} else {
|
||||||
const def = this.mixinDatacomResData.find(item => item.value === defValue)
|
const def = this.mixinDatacomResData.find(item => item.value === defValue)
|
||||||
this.current = def ? this.formatItemName(def) : ''
|
this.current = def ? this.formatItemName(def) : ''
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {[String, Number]} value
|
* @param {[String, Number, Array]} value
|
||||||
* 判断用户给的 value 是否同时为禁用状态
|
* 判断用户给的 value 是否同时为禁用状态
|
||||||
*/
|
*/
|
||||||
isDisabled(value) {
|
isDisabled(value) {
|
||||||
|
if (Array.isArray(value)) {
|
||||||
|
// 对于数组,如果任意一个值被禁用,则认为整体被禁用
|
||||||
|
return value.some(val => {
|
||||||
|
return this.mixinDatacomResData.some(item => item.value === val && item.disable);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
let isDisabled = false;
|
let isDisabled = false;
|
||||||
|
|
||||||
this.mixinDatacomResData.forEach(item => {
|
this.mixinDatacomResData.forEach(item => {
|
||||||
if (item.value === value) {
|
if (item.value === value) {
|
||||||
isDisabled = item.disable
|
isDisabled = item.disable
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
return isDisabled;
|
return isDisabled;
|
||||||
},
|
|
||||||
|
|
||||||
clearVal() {
|
|
||||||
this.emit('')
|
|
||||||
if (this.collection) {
|
|
||||||
uni.removeStorageSync(this.last)
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
clearVal() {
|
||||||
|
const emptyValue = this.multiple ? [] : '';
|
||||||
|
this.emit(emptyValue)
|
||||||
|
this.current = this.multiple ? [] : ''
|
||||||
|
if (this.collection) {
|
||||||
|
this.removeCache()
|
||||||
|
}
|
||||||
|
this.$emit('clear')
|
||||||
|
},
|
||||||
|
checkBoxChange(res){
|
||||||
|
let range = res.detail.value
|
||||||
|
|
||||||
|
let currentValues = range && range.length > 0? range.map((item)=>{
|
||||||
|
const index = parseInt(item, 10);
|
||||||
|
|
||||||
|
if (isNaN(index)) {
|
||||||
|
console.error(`无效索引: ${item}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (index < 0 || index >= this.mixinDatacomResData.length) {
|
||||||
|
console.error(`索引越界: ${index}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.mixinDatacomResData[index].value;
|
||||||
|
}) : []
|
||||||
|
const selectedItems = this.mixinDatacomResData.filter(dataItem => currentValues.includes(dataItem.value));
|
||||||
|
this.current = selectedItems.map(dataItem => this.formatItemName(dataItem));
|
||||||
|
|
||||||
|
this.emit(currentValues);
|
||||||
|
},
|
||||||
change(item) {
|
change(item) {
|
||||||
if (!item.disable) {
|
if (!item.disable) {
|
||||||
|
if (this.multiple) {
|
||||||
|
// 多选模式
|
||||||
|
let currentValues = this.getCurrentValues();
|
||||||
|
if (!Array.isArray(currentValues)) {
|
||||||
|
currentValues = currentValues ? [currentValues] : [];
|
||||||
|
}
|
||||||
|
|
||||||
|
const itemValue = item.value;
|
||||||
|
const index = currentValues.indexOf(itemValue);
|
||||||
|
|
||||||
|
if (index > -1) {
|
||||||
|
currentValues.splice(index, 1);
|
||||||
|
} else {
|
||||||
|
currentValues.push(itemValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
const selectedItems = this.mixinDatacomResData.filter(dataItem => currentValues.includes(dataItem.value));
|
||||||
|
this.current = selectedItems.map(dataItem => this.formatItemName(dataItem));
|
||||||
|
|
||||||
|
this.emit(currentValues);
|
||||||
|
} else {
|
||||||
|
// 单选模式
|
||||||
this.showSelector = false
|
this.showSelector = false
|
||||||
this.current = this.formatItemName(item)
|
this.current = this.formatItemName(item)
|
||||||
this.emit(item.value)
|
this.emit(item.value)
|
||||||
}
|
}
|
||||||
},
|
|
||||||
emit(val) {
|
|
||||||
this.$emit('change', val)
|
|
||||||
this.$emit('input', val)
|
|
||||||
this.$emit('update:modelValue', val)
|
|
||||||
if (this.collection) {
|
|
||||||
uni.setStorageSync(this.last, val)
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
emit(val) {
|
||||||
|
this.$emit('input', val)
|
||||||
|
this.$emit('update:modelValue', val)
|
||||||
|
this.$emit('change', val)
|
||||||
|
if (this.collection) {
|
||||||
|
this.setCache(val);
|
||||||
|
}
|
||||||
|
},
|
||||||
toggleSelector() {
|
toggleSelector() {
|
||||||
|
if (this.disabled) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
this.showSelector = !this.showSelector
|
this.showSelector = !this.showSelector
|
||||||
this.$emit('showSelector', this.showSelector)
|
|
||||||
},
|
},
|
||||||
formatItemName(item) {
|
formatItemName(item) {
|
||||||
let {
|
let {
|
||||||
@@ -227,6 +489,16 @@
|
|||||||
channel_code
|
channel_code
|
||||||
} = item
|
} = item
|
||||||
channel_code = channel_code ? `(${channel_code})` : ''
|
channel_code = channel_code ? `(${channel_code})` : ''
|
||||||
|
|
||||||
|
if (this.format) {
|
||||||
|
// 格式化输出
|
||||||
|
let str = "";
|
||||||
|
str = this.format;
|
||||||
|
for (let key in item) {
|
||||||
|
str = str.replace(new RegExp(`{${key}}`, "g"), item[key]);
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
} else {
|
||||||
return this.collection.indexOf('app-list') > 0 ?
|
return this.collection.indexOf('app-list') > 0 ?
|
||||||
`${text}(${value})` :
|
`${text}(${value})` :
|
||||||
(
|
(
|
||||||
@@ -235,6 +507,32 @@
|
|||||||
`未命名${channel_code}`
|
`未命名${channel_code}`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
// 获取当前加载的数据
|
||||||
|
getLoadData() {
|
||||||
|
return this.mixinDatacomResData;
|
||||||
|
},
|
||||||
|
// 获取当前缓存key
|
||||||
|
getCurrentCacheKey() {
|
||||||
|
return this.collection;
|
||||||
|
},
|
||||||
|
// 获取缓存
|
||||||
|
getCache(name = this.getCurrentCacheKey()) {
|
||||||
|
let cacheData = uni.getStorageSync(this.cacheKey) || {};
|
||||||
|
return cacheData[name];
|
||||||
|
},
|
||||||
|
// 设置缓存
|
||||||
|
setCache(value, name = this.getCurrentCacheKey()) {
|
||||||
|
let cacheData = uni.getStorageSync(this.cacheKey) || {};
|
||||||
|
cacheData[name] = value;
|
||||||
|
uni.setStorageSync(this.cacheKey, cacheData);
|
||||||
|
},
|
||||||
|
// 删除缓存
|
||||||
|
removeCache(name = this.getCurrentCacheKey()) {
|
||||||
|
let cacheData = uni.getStorageSync(this.cacheKey) || {};
|
||||||
|
delete cacheData[name];
|
||||||
|
uni.setStorageSync(this.cacheKey, cacheData);
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -244,7 +542,11 @@
|
|||||||
$uni-main-color: #333 !default;
|
$uni-main-color: #333 !default;
|
||||||
$uni-secondary-color: #909399 !default;
|
$uni-secondary-color: #909399 !default;
|
||||||
$uni-border-3: #e5e5e5;
|
$uni-border-3: #e5e5e5;
|
||||||
|
$uni-primary: #2979ff !default;
|
||||||
|
$uni-success: #4cd964 !default;
|
||||||
|
$uni-warning: #f0ad4e !default;
|
||||||
|
$uni-error: #dd524d !default;
|
||||||
|
$uni-info: #909399 !default;
|
||||||
|
|
||||||
/* #ifndef APP-NVUE */
|
/* #ifndef APP-NVUE */
|
||||||
@media screen and (max-width: 500px) {
|
@media screen and (max-width: 500px) {
|
||||||
@@ -258,13 +560,16 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
// padding: 15px;
|
// padding: 15px;
|
||||||
|
/* #ifdef H5 */
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
/* #endif */
|
||||||
width: 100%;
|
width: 100%;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.uni-stat-box {
|
.uni-stat-box {
|
||||||
|
background-color: #fff;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
@@ -283,9 +588,16 @@
|
|||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.border-bottom {
|
||||||
|
border-bottom: solid 1px $uni-border-3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.border-default {
|
||||||
|
border: 1px solid $uni-border-3;
|
||||||
|
}
|
||||||
|
|
||||||
.uni-select {
|
.uni-select {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
border: 1px solid $uni-border-3;
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
padding: 0 5px;
|
padding: 0 5px;
|
||||||
@@ -297,10 +609,20 @@
|
|||||||
/* #endif */
|
/* #endif */
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
border-bottom: solid 1px $uni-border-3;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
height: 35px;
|
min-height: 35px;
|
||||||
|
|
||||||
|
&--disabled {
|
||||||
|
background-color: #f5f7fa;
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
&--wrap {
|
||||||
|
height: auto;
|
||||||
|
min-height: 35px;
|
||||||
|
// align-items: flex-start;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.uni-select__label {
|
.uni-select__label {
|
||||||
@@ -313,6 +635,7 @@
|
|||||||
|
|
||||||
.uni-select__input-box {
|
.uni-select__input-box {
|
||||||
// height: 35px;
|
// height: 35px;
|
||||||
|
width: 0px;
|
||||||
position: relative;
|
position: relative;
|
||||||
/* #ifndef APP-NVUE */
|
/* #ifndef APP-NVUE */
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -320,8 +643,24 @@
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
|
||||||
overflow: hidden;
|
&--wrap {
|
||||||
|
.uni-select__input-text {
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.padding-top-bottom {
|
||||||
|
padding-top: 5px;
|
||||||
|
padding-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slot-content {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.uni-select__input {
|
.uni-select__input {
|
||||||
@@ -341,14 +680,13 @@
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
/* #endif */
|
/* #endif */
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: calc(100% + 12px);
|
|
||||||
left: 0;
|
left: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background-color: #FFFFFF;
|
background-color: #FFFFFF;
|
||||||
border: 1px solid #EBEEF5;
|
border: 1px solid #EBEEF5;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||||
z-index: 2;
|
z-index: 3;
|
||||||
padding: 4px 0;
|
padding: 4px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -359,23 +697,33 @@
|
|||||||
/* #endif */
|
/* #endif */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* #ifdef H5 */
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
.uni-select__selector-scroll {
|
||||||
|
max-height: 600px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* #endif */
|
||||||
|
|
||||||
.uni-select__selector-empty,
|
.uni-select__selector-empty,
|
||||||
.uni-select__selector-item {
|
.uni-select__selector-item {
|
||||||
/* #ifndef APP-NVUE */
|
/* #ifndef APP-NVUE */
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
/* #endif */
|
/* #endif */
|
||||||
line-height: 15px;
|
flex-direction: row;
|
||||||
height: 35px;
|
align-items: center;
|
||||||
font-size: 12px;
|
line-height: 35px;
|
||||||
text-align: left;
|
font-size: 14px;
|
||||||
/* border-bottom: solid 1px $uni-border-3; */
|
/* border-bottom: solid 1px $uni-border-3; */
|
||||||
padding: 0px 10px;
|
padding: 0px 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.uni-select__selector-item:hover {
|
|
||||||
background-color: #f9f9f9;
|
|
||||||
|
.uni-select__selector-item-check {
|
||||||
|
margin-left: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.uni-select__selector-empty:last-child,
|
.uni-select__selector-empty:last-child,
|
||||||
@@ -391,8 +739,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* picker 弹出层通用的指示小三角 */
|
/* picker 弹出层通用的指示小三角 */
|
||||||
.uni-popper__arrow,
|
.uni-popper__arrow_bottom,
|
||||||
.uni-popper__arrow::after {
|
.uni-popper__arrow_bottom::after,
|
||||||
|
.uni-popper__arrow_top,
|
||||||
|
.uni-popper__arrow_top::after {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
display: block;
|
display: block;
|
||||||
width: 0;
|
width: 0;
|
||||||
@@ -402,7 +752,7 @@
|
|||||||
border-width: 6px;
|
border-width: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.uni-popper__arrow {
|
.uni-popper__arrow_bottom {
|
||||||
filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03));
|
filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03));
|
||||||
top: -6px;
|
top: -6px;
|
||||||
left: 10%;
|
left: 10%;
|
||||||
@@ -411,7 +761,7 @@
|
|||||||
border-bottom-color: #EBEEF5;
|
border-bottom-color: #EBEEF5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.uni-popper__arrow::after {
|
.uni-popper__arrow_bottom::after {
|
||||||
content: " ";
|
content: " ";
|
||||||
top: 1px;
|
top: 1px;
|
||||||
margin-left: -6px;
|
margin-left: -6px;
|
||||||
@@ -419,24 +769,48 @@
|
|||||||
border-bottom-color: #fff;
|
border-bottom-color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.uni-popper__arrow_top {
|
||||||
|
filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03));
|
||||||
|
bottom: -6px;
|
||||||
|
left: 10%;
|
||||||
|
margin-right: 3px;
|
||||||
|
border-bottom-width: 0;
|
||||||
|
border-top-color: #EBEEF5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-popper__arrow_top::after {
|
||||||
|
content: " ";
|
||||||
|
bottom: 1px;
|
||||||
|
margin-left: -6px;
|
||||||
|
border-bottom-width: 0;
|
||||||
|
border-top-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.uni-select__input-text {
|
.uni-select__input-text {
|
||||||
// width: 280px;
|
// width: 280px;
|
||||||
width: calc(100% - 50px);
|
width: 100%;
|
||||||
color: $uni-main-color;
|
color: $uni-main-color;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
-o-text-overflow: ellipsis;
|
-o-text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
|
||||||
|
|
||||||
.zd_icon_wraper {
|
&--wrap {
|
||||||
width: 50px;
|
white-space: normal;
|
||||||
text-align: right;
|
text-overflow: initial;
|
||||||
|
-o-text-overflow: initial;
|
||||||
|
overflow: visible;
|
||||||
|
word-wrap: break-word;
|
||||||
|
word-break: break-all;
|
||||||
|
// line-height: 1.5;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.uni-select__input-placeholder {
|
.uni-select__input-placeholder {
|
||||||
color: $uni-base-color;
|
color: $uni-base-color;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
|
margin: 1px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.uni-select--mask {
|
.uni-select--mask {
|
||||||
@@ -445,9 +819,19 @@
|
|||||||
bottom: 0;
|
bottom: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
z-index: 2;
|
||||||
}
|
}
|
||||||
.filter_input_s {
|
|
||||||
width: calc(100% - 30rpx);
|
.align-left {
|
||||||
margin: 0 20rpx 0 10rpx;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.align-center {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.align-right {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "uni-data-select",
|
"id": "uni-data-select",
|
||||||
"displayName": "uni-data-select 下拉框选择器",
|
"displayName": "uni-data-select 下拉框选择器",
|
||||||
"version": "0.1.6",
|
"version": "1.1.0",
|
||||||
"description": "通过数据驱动的下拉框选择器",
|
"description": "通过数据驱动的下拉框选择器",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"uni-ui",
|
"uni-ui",
|
||||||
@@ -12,16 +12,14 @@
|
|||||||
],
|
],
|
||||||
"repository": "https://github.com/dcloudio/uni-ui",
|
"repository": "https://github.com/dcloudio/uni-ui",
|
||||||
"engines": {
|
"engines": {
|
||||||
"HBuilderX": "^3.1.1"
|
"HBuilderX": "^3.1.1",
|
||||||
|
"uni-app": "^4.45",
|
||||||
|
"uni-app-x": ""
|
||||||
},
|
},
|
||||||
"directories": {
|
"directories": {
|
||||||
"example": "../../temps/example_temps"
|
"example": "../../temps/example_temps"
|
||||||
},
|
},
|
||||||
"dcloudext": {
|
"dcloudext": {
|
||||||
"category": [
|
|
||||||
"前端组件",
|
|
||||||
"通用组件"
|
|
||||||
],
|
|
||||||
"sale": {
|
"sale": {
|
||||||
"regular": {
|
"regular": {
|
||||||
"price": "0.00"
|
"price": "0.00"
|
||||||
@@ -38,49 +36,69 @@
|
|||||||
"data": "无",
|
"data": "无",
|
||||||
"permissions": "无"
|
"permissions": "无"
|
||||||
},
|
},
|
||||||
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
|
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
|
||||||
|
"type": "component-vue",
|
||||||
|
"darkmode": "x",
|
||||||
|
"i18n": "x",
|
||||||
|
"widescreen": "x"
|
||||||
},
|
},
|
||||||
"uni_modules": {
|
"uni_modules": {
|
||||||
"dependencies": ["uni-load-more"],
|
"dependencies": [
|
||||||
|
"uni-load-more"
|
||||||
|
],
|
||||||
"encrypt": [],
|
"encrypt": [],
|
||||||
"platforms": {
|
"platforms": {
|
||||||
"cloud": {
|
"cloud": {
|
||||||
"tcb": "y",
|
"tcb": "√",
|
||||||
"aliyun": "y"
|
"aliyun": "√",
|
||||||
|
"alipay": "√"
|
||||||
},
|
},
|
||||||
"client": {
|
"client": {
|
||||||
"App": {
|
"uni-app": {
|
||||||
"app-vue": "u",
|
"vue": {
|
||||||
"app-nvue": "n"
|
"vue2": "√",
|
||||||
|
"vue3": "√"
|
||||||
},
|
},
|
||||||
"H5-mobile": {
|
"web": {
|
||||||
"Safari": "y",
|
"safari": "√",
|
||||||
"Android Browser": "y",
|
"chrome": "√"
|
||||||
"微信浏览器(Android)": "y",
|
|
||||||
"QQ浏览器(Android)": "y"
|
|
||||||
},
|
},
|
||||||
"H5-pc": {
|
"app": {
|
||||||
"Chrome": "y",
|
"vue": "√",
|
||||||
"IE": "y",
|
"nvue": "-",
|
||||||
"Edge": "y",
|
"android": "√",
|
||||||
"Firefox": "y",
|
"ios": "√",
|
||||||
"Safari": "y"
|
"harmony": "√"
|
||||||
},
|
},
|
||||||
"小程序": {
|
"mp": {
|
||||||
"微信": "y",
|
"weixin": "√",
|
||||||
"阿里": "u",
|
"alipay": "√",
|
||||||
"百度": "u",
|
"toutiao": "√",
|
||||||
"字节跳动": "u",
|
"baidu": "-",
|
||||||
"QQ": "u",
|
"kuaishou": "-",
|
||||||
"京东": "u"
|
"jd": "-",
|
||||||
|
"harmony": "-",
|
||||||
|
"qq": "-",
|
||||||
|
"lark": "-"
|
||||||
},
|
},
|
||||||
"快应用": {
|
"quickapp": {
|
||||||
"华为": "u",
|
"huawei": "-",
|
||||||
"联盟": "u"
|
"union": "-"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"Vue": {
|
"uni-app-x": {
|
||||||
"vue2": "y",
|
"web": {
|
||||||
"vue3": "y"
|
"safari": "-",
|
||||||
|
"chrome": "-"
|
||||||
|
},
|
||||||
|
"app": {
|
||||||
|
"android": "-",
|
||||||
|
"ios": "-",
|
||||||
|
"harmony": "-"
|
||||||
|
},
|
||||||
|
"mp": {
|
||||||
|
"weixin": "-"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
## 1.3.7(2025-08-20)
|
||||||
|
- 修复 微信小程序css警告问题
|
||||||
|
## 1.3.6(2024-10-15)
|
||||||
|
- 修复 微信小程序中的getSystemInfo警告
|
||||||
## 1.3.3(2022-01-20)
|
## 1.3.3(2022-01-20)
|
||||||
- 新增 showText属性 ,是否显示文本
|
- 新增 showText属性 ,是否显示文本
|
||||||
## 1.3.2(2022-01-19)
|
## 1.3.2(2022-01-19)
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
<!-- #ifndef APP-NVUE -->
|
<!-- #ifndef APP-NVUE -->
|
||||||
<view v-else-if="!webviewHide && status === 'loading' && showIcon"
|
<view v-else-if="!webviewHide && status === 'loading' && showIcon"
|
||||||
:style="{width:iconSize+'px',height:iconSize+'px'}" class="uni-load-more__img uni-load-more__img--ios-H5">
|
:style="{width:iconSize+'px',height:iconSize+'px'}" class="uni-load-more__img uni-load-more__img--ios-H5">
|
||||||
<image :src="imgBase64" mode="widthFix"></image>
|
<image class="image" :src="imgBase64" mode="widthFix"></image>
|
||||||
</view>
|
</view>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<text v-if="showText" class="uni-load-more__text"
|
<text v-if="showText" class="uni-load-more__text"
|
||||||
@@ -37,7 +37,12 @@
|
|||||||
<script>
|
<script>
|
||||||
let platform
|
let platform
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
platform = uni.getDeviceInfo().platform
|
||||||
|
// #endif
|
||||||
|
// #ifndef MP-WEIXIN
|
||||||
platform = uni.getSystemInfoSync().platform
|
platform = uni.getSystemInfoSync().platform
|
||||||
|
// #endif
|
||||||
}, 16)
|
}, 16)
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -205,7 +210,7 @@
|
|||||||
animation: loading-ios-H5 1s 0s step-end infinite;
|
animation: loading-ios-H5 1s 0s step-end infinite;
|
||||||
}
|
}
|
||||||
|
|
||||||
.uni-load-more__img--ios-H5 image {
|
.uni-load-more__img--ios-H5 .image {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "uni-load-more",
|
"id": "uni-load-more",
|
||||||
"displayName": "uni-load-more 加载更多",
|
"displayName": "uni-load-more 加载更多",
|
||||||
"version": "1.3.3",
|
"version": "1.3.7",
|
||||||
"description": "LoadMore 组件,常用在列表里面,做滚动加载使用。",
|
"description": "LoadMore 组件,常用在列表里面,做滚动加载使用。",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"uni-ui",
|
"uni-ui",
|
||||||
@@ -11,16 +11,14 @@
|
|||||||
],
|
],
|
||||||
"repository": "https://github.com/dcloudio/uni-ui",
|
"repository": "https://github.com/dcloudio/uni-ui",
|
||||||
"engines": {
|
"engines": {
|
||||||
"HBuilderX": ""
|
"HBuilderX": "",
|
||||||
|
"uni-app": "^4.07",
|
||||||
|
"uni-app-x": ""
|
||||||
},
|
},
|
||||||
"directories": {
|
"directories": {
|
||||||
"example": "../../temps/example_temps"
|
"example": "../../temps/example_temps"
|
||||||
},
|
},
|
||||||
"dcloudext": {
|
"dcloudext": {
|
||||||
"category": [
|
|
||||||
"前端组件",
|
|
||||||
"通用组件"
|
|
||||||
],
|
|
||||||
"sale": {
|
"sale": {
|
||||||
"regular": {
|
"regular": {
|
||||||
"price": "0.00"
|
"price": "0.00"
|
||||||
@@ -37,48 +35,69 @@
|
|||||||
"data": "无",
|
"data": "无",
|
||||||
"permissions": "无"
|
"permissions": "无"
|
||||||
},
|
},
|
||||||
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
|
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
|
||||||
|
"type": "component-vue",
|
||||||
|
"darkmode": "x",
|
||||||
|
"i18n": "x",
|
||||||
|
"widescreen": "x"
|
||||||
},
|
},
|
||||||
"uni_modules": {
|
"uni_modules": {
|
||||||
"dependencies": ["uni-scss"],
|
"dependencies": [
|
||||||
|
"uni-scss"
|
||||||
|
],
|
||||||
"encrypt": [],
|
"encrypt": [],
|
||||||
"platforms": {
|
"platforms": {
|
||||||
"cloud": {
|
"cloud": {
|
||||||
"tcb": "y",
|
"tcb": "x",
|
||||||
"aliyun": "y"
|
"aliyun": "x",
|
||||||
|
"alipay": "x"
|
||||||
},
|
},
|
||||||
"client": {
|
"client": {
|
||||||
"App": {
|
"uni-app": {
|
||||||
"app-vue": "y",
|
"vue": {
|
||||||
"app-nvue": "y"
|
"vue2": "√",
|
||||||
|
"vue3": "√"
|
||||||
},
|
},
|
||||||
"H5-mobile": {
|
"web": {
|
||||||
"Safari": "y",
|
"safari": "√",
|
||||||
"Android Browser": "y",
|
"chrome": "√"
|
||||||
"微信浏览器(Android)": "y",
|
|
||||||
"QQ浏览器(Android)": "y"
|
|
||||||
},
|
},
|
||||||
"H5-pc": {
|
"app": {
|
||||||
"Chrome": "y",
|
"vue": "√",
|
||||||
"IE": "y",
|
"nvue": "-",
|
||||||
"Edge": "y",
|
"android": "√",
|
||||||
"Firefox": "y",
|
"ios": "√",
|
||||||
"Safari": "y"
|
"harmony": "√"
|
||||||
},
|
},
|
||||||
"小程序": {
|
"mp": {
|
||||||
"微信": "y",
|
"weixin": "√",
|
||||||
"阿里": "y",
|
"alipay": "√",
|
||||||
"百度": "y",
|
"toutiao": "√",
|
||||||
"字节跳动": "y",
|
"baidu": "√",
|
||||||
"QQ": "y"
|
"kuaishou": "-",
|
||||||
|
"jd": "-",
|
||||||
|
"harmony": "-",
|
||||||
|
"qq": "√",
|
||||||
|
"lark": "-"
|
||||||
},
|
},
|
||||||
"快应用": {
|
"quickapp": {
|
||||||
"华为": "u",
|
"huawei": "√",
|
||||||
"联盟": "u"
|
"union": "√"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"Vue": {
|
"uni-app-x": {
|
||||||
"vue2": "y",
|
"web": {
|
||||||
"vue3": "y"
|
"safari": "-",
|
||||||
|
"chrome": "-"
|
||||||
|
},
|
||||||
|
"app": {
|
||||||
|
"android": "-",
|
||||||
|
"ios": "-",
|
||||||
|
"harmony": "-"
|
||||||
|
},
|
||||||
|
"mp": {
|
||||||
|
"weixin": "-"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ export const updatePointqueryPointInfo = (time, search) => {
|
|||||||
export const queryNowVehicle = () => {
|
export const queryNowVehicle = () => {
|
||||||
let res = {
|
let res = {
|
||||||
message: 'ok',
|
message: 'ok',
|
||||||
data: {box_type: 'aa'}
|
data: {box_type: '3'}
|
||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user