提交 92ca6978 作者: 方治民

fix: 修复一些组件 Bug

上级 9071246e
......@@ -104,6 +104,21 @@
watch: {
open(val) {
this.isOpen = val
},
isOpen(val) {
this.$nextTick(async () => {
let parent = this.$parent;
let parentName = parent.$options.name;
while (parentName !== 'PageBody') {
if (parentName === 'fui-collapse-item') {
await parent.init()
}
parent = parent.$parent;
if (!parent) return false;
parentName = parent.$options.name;
}
})
}
},
updated(e) {
......@@ -136,12 +151,14 @@
},
methods: {
init() {
const promise = []
// #ifndef APP-NVUE
this.getCollapseHeight()
promise.push(this.getCollapseHeight())
// #endif
// #ifdef APP-NVUE
this.getNvueHeight()
promise.push(this.getNvueHeight())
// #endif
return Promise.all(promise)
},
uninstall() {
if (this.collapse) {
......@@ -165,6 +182,7 @@
}
},
getCollapseHeight(index = 0) {
return new Promise((resolve) => {
uni.createSelectorQuery()
// #ifndef MP-ALIPAY
.in(this)
......@@ -186,10 +204,14 @@
this.height = data.height
// #endif
this.isHeight = true
resolve(this.height)
})
.exec()
})
},
getNvueHeight() {
return new Promise((resolve) => {
const result = dom.getComponentRect(this.$refs['fui_collapse__el'], option => {
if (option && option.result && option.size) {
// #ifdef APP-NVUE
......@@ -199,8 +221,11 @@
this.height = option.size.height
// #endif
this.isHeight = true
resolve(this.height)
}
})
})
},
getCollapse(name = 'fui-collapse') {
let parent = this.$parent;
......
......@@ -522,9 +522,10 @@
this.reset();
this.getDefaultOptions(this.value)
this.handleDate()
setTimeout(() => {
// this.initData()
// setTimeout(() => {
this.initData()
}, 50)
// }, 50)
},
btnCancel(e) {
// #ifdef APP-NVUE
......@@ -626,8 +627,8 @@
return new Date(date.replace(/\-/g, '/'))
},
handleDate() {
const min = this.toDate(this.minDate, '2010-01-01');
const max = this.toDate(this.maxDate, '2030-12-31');
const min = this.toDate(this.minDate, '2010-01-01 00:00:00');
const max = this.toDate(this.maxDate, '2050-12-31 23:59:59');
this.minArr = [min.getFullYear(), min.getMonth() + 1, min.getDate(), min.getHours(), min.getMinutes(), min
.getSeconds()
];
......@@ -651,6 +652,7 @@
max = this.maxArr[1]
}
max = max < min ? min : max
// min = this.minArr[1]
this.months = this.toArray(min, max);
},
getDays(index, idx) {
......@@ -663,24 +665,42 @@
} else if (year == this.maxArr[0] && month == this.maxArr[1]) {
max = this.maxArr[2]
}
// min = this.minArr[2]
max = !max || max < min ? min : max
this.days = this.toArray(min, max);
},
getHours() {
getHours(index,mindex,dindex) {
let year = this.years[index]
let month = this.months[mindex]
let days = this.days[dindex]
let range = this.hourRange || [0, 23];
let min = Number(range[0] || 0);
let max = Number(range[1] || 23);
min = Math.floor(min < 0 || min > 23 ? 0 : min);
max = Math.floor(max < 0 || max > 23 ? 23 : max);
if (year == this.minArr[0] && month == this.minArr[1] && days == this.minArr[2]) {
min = this.minArr[3]
} else if (year == this.maxArr[0] && month == this.maxArr[1] && days == this.minArr[2]) {
max = this.maxArr[3]
}
max = max < min ? min : max
this.hours = this.toArray(min, max);
},
getMinutes() {
getMinutes(index,mindex,dindex,hindex) {
let year = this.years[index]
let month = this.months[mindex]
let days = this.days[dindex]
let hours = this.hours[hindex]
let range = this.minuteRange || [0, 59];
let min = Number(range[0] || 0);
let max = Number(range[1] || 59);
min = Math.floor(min < 0 || min > 59 ? 0 : min);
max = Math.floor(max < 0 || max > 59 ? 59 : max);
if (year == this.minArr[0] && month == this.minArr[1] && days == this.minArr[2] && hours == this.minArr[3]) {
min = this.minArr[4]
} else if (year == this.maxArr[0] && month == this.maxArr[1] && days == this.minArr[2] && hours == this.minArr[3]) {
max = this.maxArr[4]
}
max = max < min ? min : max
this.minutes = this.toArray(min, max);
},
......@@ -711,11 +731,11 @@
type > 2 && this.getDays(index, idx);
}
}
type > 3 && type < 8 && this.getHours()
type > 4 && this.getMinutes()
type > 3 && type < 8 && this.getHours(0,0,0)
type > 4 && this.getMinutes(0,0,0,0)
type > 6 && this.getSeconds()
this.$nextTick(() => {
setTimeout(() => {
// setTimeout(() => {
let di = this.getIndex(this.days, this.values[2]);
let hi = this.getIndex(this.hours, this.values[3]);
let mi = this.getIndex(this.minutes, this.values[4])
......@@ -730,7 +750,7 @@
[hi, mi, si],
[mi, si]
][type - 1]
}, 50)
// }, 50)
})
},
getResult() {
......@@ -885,9 +905,12 @@
if (type > 2) {
this.getDays(value[0], value[1])
}
} else if (value[1] != this.vals[1] && type > 2) {
this.getDays(value[0], value[1])
}
this.getHours(value[0], value[1],value[2])
this.getMinutes(value[0], value[1],value[2],value[3])
}
this.vals = value;
if (this.range) {
......
......@@ -16,7 +16,7 @@
<view class="fui-input__required" :style="{color:requiredColor}" v-if="required">*</view>
<!-- #endif -->
<view class="fui-input__label" :style="{minWidth:labelWidth+'rpx'}" v-if="label">
<text :style="{fontSize:getLabelSize,color:labelColor}">{{label}}</text>
<text :style="{fontSize:getLabelSize,color:labelColor,fontWeight:500}">{{label}}</text>
</view>
<slot name="left"></slot>
<input class="fui-input__self" :class="{'fui-input__text-right':textRight}"
......
<!--本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号:1 5 616 2 6 01 95,身份证尾号:5 0 37 5T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。-->
<template>
<view @appear="handleAppear" class="fui-lazyload__wrap"
:style="{background:background,width:width+'rpx',height:height==0?'auto':height+'rpx',borderRadius:radius+'rpx'}"
:style="{background:background,width:width+'rpx',borderRadius:radius+'rpx'}"
@tap="handleTap">
<image class="fui-lazyload__img" lazy-load :class="[visible?'fui-lazyload__visible':'fui-lazyload__hidden']"
:style="{width:width+'rpx',height:height==0?'auto':height+'rpx',borderRadius:radius+'rpx'}"
:style="{width:width+'rpx',borderRadius:radius+'rpx'}"
:src="show?src:placeholder" :mode="height==0?'widthFix':mode" :webp="webp" :draggable="draggable"
@load="handleLoad" @error="handleError" :id="elId"></image>
<slot></slot>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论