mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
[build] 0.5.2
This commit is contained in:
parent
57628c24e5
commit
aacdc1277e
17
dist/area/index.js
vendored
17
dist/area/index.js
vendored
@ -70,16 +70,19 @@ VantComponent({
|
||||
this.$emit(type, detail);
|
||||
},
|
||||
onChange: function onChange(event) {
|
||||
var _this = this;
|
||||
|
||||
var _event$detail = event.detail,
|
||||
index = _event$detail.index,
|
||||
picker = _event$detail.picker,
|
||||
value = _event$detail.value;
|
||||
this.code = value[index].code;
|
||||
this.setValues();
|
||||
this.$emit('change', {
|
||||
picker: picker,
|
||||
values: picker.getValues(),
|
||||
index: index
|
||||
this.setValues().then(function () {
|
||||
_this.$emit('change', {
|
||||
picker: picker,
|
||||
values: picker.getValues(),
|
||||
index: index
|
||||
});
|
||||
});
|
||||
},
|
||||
getConfig: function getConfig(type) {
|
||||
@ -133,7 +136,7 @@ VantComponent({
|
||||
return 0;
|
||||
},
|
||||
setValues: function setValues() {
|
||||
var _this = this;
|
||||
var _this2 = this;
|
||||
|
||||
var county = this.getConfig('county');
|
||||
var code = this.code || Object.keys(county)[0] || '';
|
||||
@ -156,7 +159,7 @@ VantComponent({
|
||||
|
||||
stack.push(picker.setColumnValues(2, this.getList('county', code.slice(0, 4))));
|
||||
return Promise.all(stack).then(function () {
|
||||
return picker.setIndexes([_this.getIndex('province', code), _this.getIndex('city', code), _this.getIndex('county', code)]);
|
||||
return picker.setIndexes([_this2.getIndex('province', code), _this2.getIndex('city', code), _this2.getIndex('county', code)]);
|
||||
}).catch(function () {});
|
||||
},
|
||||
getValues: function getValues() {
|
||||
|
2
dist/card/index.wxss
vendored
2
dist/card/index.wxss
vendored
@ -1 +1 @@
|
||||
@import '../common/index.wxss';.van-card{position:relative;padding:5px 15px;font-size:12px;color:#333;box-sizing:border-box;background-color:#fafafa}.van-card--center{-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center}.van-card__header{display:-webkit-flex;display:flex}.van-card__thumb{position:relative;width:90px;height:90px;margin-right:10px;-webkit-flex:none;flex:none}.van-card__thumb:empty{display:none}.van-card__img{width:100%;height:100%}.van-card__content{position:relative;-webkit-flex:1;flex:1;height:90px;min-width:0}.van-card__desc,.van-card__title{word-break:break-all}.van-card__title{max-height:32px;line-height:16px;font-weight:700}.van-card__desc{max-height:20px;line-height:20px;color:#7d7e80}.van-card__bottom{position:absolute;bottom:0;left:0;width:100%;line-height:18px}.van-card__price{display:inline-block;font-weight:700;color:#f44}.van-card__origin-price{display:inline-block;margin-left:5px;font-size:10px;color:#7d7e80;text-decoration:line-through}.van-card__num{float:right}.van-card__tag{position:absolute;top:2px;left:0}.van-card__footer{width:100%;text-align:right;-webkit-flex:none;flex:none}
|
||||
@import '../common/index.wxss';.van-card{position:relative;padding:5px 15px;font-size:12px;color:#333;background-color:#fafafa;box-sizing:border-box}.van-card--center{-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center}.van-card__header{display:-webkit-flex;display:flex}.van-card__thumb{position:relative;width:90px;height:90px;margin-right:10px;-webkit-flex:none;flex:none}.van-card__thumb:empty{display:none}.van-card__img{width:100%;height:100%}.van-card__content{position:relative;height:90px;min-width:0;-webkit-flex:1;flex:1}.van-card__desc,.van-card__title{word-break:break-all}.van-card__title{max-height:32px;font-weight:700;line-height:16px}.van-card__desc{max-height:20px;line-height:20px;color:#7d7e80}.van-card__bottom{line-height:20px}.van-card__price{display:inline-block;font-weight:700;color:#f44}.van-card__origin-price{display:inline-block;margin-left:5px;font-size:10px;color:#7d7e80;text-decoration:line-through}.van-card__num{float:right}.van-card__tag{position:absolute;top:2px;left:0}.van-card__footer{width:100%;text-align:right;-webkit-flex:none;flex:none}
|
36
dist/picker/index.js
vendored
36
dist/picker/index.js
vendored
@ -101,11 +101,11 @@ VantComponent({
|
||||
setColumnValue: function setColumnValue(index, value) {
|
||||
var column = this.getColumn(index);
|
||||
|
||||
if (column) {
|
||||
return column.setValue(value);
|
||||
if (column == null) {
|
||||
return Promise.reject('setColumnValue: 对应列不存在');
|
||||
}
|
||||
|
||||
return Promise.reject('setColumnValue: 对应列不存在');
|
||||
return column.setValue(value);
|
||||
},
|
||||
// get column option index by column index
|
||||
getColumnIndex: function getColumnIndex(columnIndex) {
|
||||
@ -115,11 +115,11 @@ VantComponent({
|
||||
setColumnIndex: function setColumnIndex(columnIndex, optionIndex) {
|
||||
var column = this.getColumn(columnIndex);
|
||||
|
||||
if (column) {
|
||||
return column.setIndex(optionIndex);
|
||||
if (column == null) {
|
||||
return Promise.reject('setColumnIndex: 对应列不存在');
|
||||
}
|
||||
|
||||
return Promise.reject('setColumnIndex: 对应列不存在');
|
||||
return column.setIndex(optionIndex);
|
||||
},
|
||||
// get options of column by index
|
||||
getColumnValues: function getColumnValues(index) {
|
||||
@ -133,17 +133,23 @@ VantComponent({
|
||||
|
||||
var column = this.children[index];
|
||||
|
||||
if (column && JSON.stringify(column.data.options) !== JSON.stringify(options)) {
|
||||
return column.set({
|
||||
options: options
|
||||
}).then(function () {
|
||||
if (needReset) {
|
||||
column.setIndex(0);
|
||||
}
|
||||
});
|
||||
if (column == null) {
|
||||
return Promise.reject('setColumnValues: 对应列不存在');
|
||||
}
|
||||
|
||||
return Promise.reject('setColumnValues: 对应列不存在');
|
||||
var isSame = JSON.stringify(column.data.options) === JSON.stringify(options);
|
||||
|
||||
if (isSame) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
return column.set({
|
||||
options: options
|
||||
}).then(function () {
|
||||
if (needReset) {
|
||||
column.setIndex(0);
|
||||
}
|
||||
});
|
||||
},
|
||||
// get values of all columns
|
||||
getValues: function getValues() {
|
||||
|
2
dist/search/index.wxml
vendored
2
dist/search/index.wxml
vendored
@ -13,7 +13,7 @@
|
||||
class="van-search__field field-class"
|
||||
value="{{ value }}"
|
||||
disabled="{{ disabled }}"
|
||||
readonly="{{ readony }}"
|
||||
readonly="{{ readonly }}"
|
||||
maxlength="{{ maxlength }}"
|
||||
input-align="{{ inputAlign }}"
|
||||
input-class="input-class"
|
||||
|
2
dist/tabbar-item/index.wxml
vendored
2
dist/tabbar-item/index.wxml
vendored
@ -1,5 +1,5 @@
|
||||
<view
|
||||
class="van-tabbar-item {{ active ? 'van-tabbar-item--active' : '' }}"
|
||||
class="van-tabbar-item custom-class {{ active ? 'van-tabbar-item--active' : '' }}"
|
||||
style="{{ active && color ? 'color: ' + color : '' }}"
|
||||
bind:tap="onClick"
|
||||
>
|
||||
|
76
dist/tabs/index.js
vendored
76
dist/tabs/index.js
vendored
@ -57,6 +57,10 @@ VantComponent({
|
||||
offsetTop: {
|
||||
type: Number,
|
||||
value: 0
|
||||
},
|
||||
scrollTop: {
|
||||
type: Number,
|
||||
value: 0
|
||||
}
|
||||
},
|
||||
data: {
|
||||
@ -79,6 +83,7 @@ VantComponent({
|
||||
lineHeight: 'setLine',
|
||||
active: 'setActiveTab',
|
||||
animated: 'setTrack',
|
||||
scrollTop: 'onScroll',
|
||||
offsetTop: 'setWrapStyle'
|
||||
},
|
||||
beforeCreate: function beforeCreate() {
|
||||
@ -88,8 +93,6 @@ VantComponent({
|
||||
this.setLine();
|
||||
this.setTrack();
|
||||
this.scrollIntoView();
|
||||
this.observerTabScroll();
|
||||
this.observerContentScroll();
|
||||
},
|
||||
destroyed: function destroyed() {
|
||||
wx.createIntersectionObserver(this).disconnect();
|
||||
@ -281,57 +284,40 @@ VantComponent({
|
||||
wrapStyle: wrapStyle
|
||||
});
|
||||
},
|
||||
observerTabScroll: function observerTabScroll() {
|
||||
// adjust tab position
|
||||
onScroll: function onScroll(scrollTop) {
|
||||
var _this5 = this;
|
||||
|
||||
if (!this.data.sticky) return;
|
||||
var offsetTop = this.data.offsetTop;
|
||||
wx.createIntersectionObserver(this, {
|
||||
thresholds: [1]
|
||||
}).relativeToViewport().observe('.van-tabs', function (result) {
|
||||
var top = result.boundingClientRect.top;
|
||||
var position = '';
|
||||
this.getRect('.van-tabs').then(function (rect) {
|
||||
var top = rect.top,
|
||||
height = rect.height;
|
||||
|
||||
if (offsetTop > top) {
|
||||
position = 'top';
|
||||
}
|
||||
_this5.getRect('.van-tabs__wrap').then(function (rect) {
|
||||
var wrapHeight = rect.height;
|
||||
var position = '';
|
||||
|
||||
_this5.$emit('scroll', {
|
||||
scrollTop: top + offsetTop,
|
||||
isFixed: position === 'top'
|
||||
if (offsetTop > top + height - wrapHeight) {
|
||||
position = 'bottom';
|
||||
} else if (offsetTop > top) {
|
||||
position = 'top';
|
||||
}
|
||||
|
||||
_this5.$emit('scroll', {
|
||||
scrollTop: scrollTop + offsetTop,
|
||||
isFixed: position === 'top'
|
||||
});
|
||||
|
||||
if (position !== _this5.data.position) {
|
||||
_this5.set({
|
||||
position: position
|
||||
}, function () {
|
||||
_this5.setWrapStyle();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
_this5.setPosition(position);
|
||||
});
|
||||
},
|
||||
observerContentScroll: function observerContentScroll() {
|
||||
var _this6 = this;
|
||||
|
||||
if (!this.data.sticky) return;
|
||||
var offsetTop = this.data.offsetTop;
|
||||
wx.createIntersectionObserver(this).relativeToViewport().observe('.van-tabs__content', function (result) {
|
||||
var top = result.boundingClientRect.top;
|
||||
var position = '';
|
||||
|
||||
if (result.intersectionRatio <= 0) {
|
||||
position = 'bottom';
|
||||
} else if (offsetTop > top) {
|
||||
position = 'top';
|
||||
}
|
||||
|
||||
_this6.setPosition(position);
|
||||
});
|
||||
},
|
||||
setPosition: function setPosition(position) {
|
||||
var _this7 = this;
|
||||
|
||||
if (position !== this.data.position) {
|
||||
this.set({
|
||||
position: position
|
||||
}, function () {
|
||||
_this7.setWrapStyle();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
2
dist/toast/index.wxss
vendored
2
dist/toast/index.wxss
vendored
@ -1 +1 @@
|
||||
@import '../common/index.wxss';.van-toast{display:-webkit-flex;display:flex;color:#fff;font-size:14px;line-height:20px;border-radius:4px;word-break:break-all;-webkit-align-items:center;align-items:center;-webkit-flex-direction:column;flex-direction:column;-webkit-justify-content:center;justify-content:center;box-sizing:content-box;background-color:rgba(51,51,51,.88)}.van-toast__container{position:fixed;top:50%;left:50%;max-width:70%;width:-webkit-fit-content;width:fit-content;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.van-toast--text{padding:8px 12px;min-width:96px}.van-toast--icon{width:90px;padding:15px;min-height:90px}.van-toast--icon .van-toast__icon{font-size:48px}.van-toast--icon .van-toast__text{padding-top:5px}.van-toast__loading{margin:10px 0}.van-toast--top{-webkit-transform:translate(0,-30vh);transform:translate(0,-30vh)}.van-toast--bottom{-webkit-transform:translate(0,30vh);transform:translate(0,30vh)}
|
||||
@import '../common/index.wxss';.van-toast{display:-webkit-flex;display:flex;color:#fff;font-size:14px;line-height:20px;border-radius:4px;word-break:break-all;-webkit-align-items:center;align-items:center;-webkit-flex-direction:column;flex-direction:column;-webkit-justify-content:center;justify-content:center;box-sizing:content-box;background-color:rgba(51,51,51,.88);white-space:pre-wrap}.van-toast__container{position:fixed;top:50%;left:50%;max-width:70%;width:-webkit-fit-content;width:fit-content;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.van-toast--text{padding:8px 12px;min-width:96px}.van-toast--icon{width:90px;padding:15px;min-height:90px}.van-toast--icon .van-toast__icon{font-size:48px}.van-toast--icon .van-toast__text{padding-top:5px}.van-toast__loading{margin:10px 0}.van-toast--top{-webkit-transform:translate(0,-30vh);transform:translate(0,-30vh)}.van-toast--bottom{-webkit-transform:translate(0,30vh);transform:translate(0,30vh)}
|
2
dist/tree-select/index.wxss
vendored
2
dist/tree-select/index.wxss
vendored
@ -1 +1 @@
|
||||
@import '../common/index.wxss';.van-tree-select{position:relative;font-size:14px;-webkit-user-select:none;user-select:none}.van-tree-select__nav{position:absolute;top:0;bottom:0;left:0;width:35%;min-width:120px;background-color:#fafafa}.van-tree-select__nitem{position:relative;padding:0 9px 0 15px;line-height:44px}.van-tree-select__nitem--active::after,.van-tree-select__nitem:active::after{position:absolute;top:0;bottom:0;left:0;width:3.6px;background-color:#f44;content:''}.van-tree-select__nitem--active{font-weight:700;background-color:#fff}.van-tree-select__nitem--disabled{color:#999}.van-tree-select__nitem--disabled:active::after{display:none}.van-tree-select__content{width:65%;padding-left:15px;margin-left:35%;background-color:#fff;box-sizing:border-box}.van-tree-select__item{position:relative;font-weight:700;line-height:44px}.van-tree-select__item--active,.van-tree-select__item:active{color:#f44}.van-tree-select__item--disabled,.van-tree-select__item--disabled:active{color:#999}.van-tree-select__selected{position:absolute;top:0;right:15px;bottom:0;height:24px;margin:auto 0;line-height:24px}
|
||||
@import '../common/index.wxss';.van-tree-select{position:relative;font-size:14px;-webkit-user-select:none;user-select:none}.van-tree-select__nav{position:absolute;top:0;bottom:0;left:0;width:35%;min-width:120px;background-color:#fafafa}.van-tree-select__nitem{position:relative;padding:0 9px 0 15px;line-height:44px}.van-tree-select__nitem--active::after{position:absolute;top:0;bottom:0;left:0;width:3.6px;background-color:#f44;content:''}.van-tree-select__nitem--active{font-weight:700;background-color:#fff}.van-tree-select__nitem--disabled{color:#999}.van-tree-select__nitem--disabled:active::after{display:none}.van-tree-select__content{width:65%;padding-left:15px;margin-left:35%;background-color:#fff;box-sizing:border-box}.van-tree-select__item{position:relative;font-weight:700;line-height:44px}.van-tree-select__item--active{color:#f44}.van-tree-select__item--disabled,.van-tree-select__item--disabled:active{color:#999}.van-tree-select__selected{position:absolute;top:0;right:15px;bottom:0;height:24px;margin:auto 0;line-height:24px}
|
Loading…
x
Reference in New Issue
Block a user