[build] 2.4.6

This commit is contained in:
pangxie1991 2018-02-27 15:42:14 +08:00
parent 206d44252f
commit dd15c6683c
4 changed files with 45 additions and 28 deletions

View File

@ -8,6 +8,7 @@
auto-height
name="{{ name || componentId || '' }}"
value="{{ value }}"
focus="{{ focus }}"
placeholder="{{ placeholder }}"
class="zan-field__input zan-cell__bd {{ right ? 'zan-field__input--right' : '' }}"
placeholder-class="zan-field__placeholder"
@ -20,6 +21,7 @@
type="{{ inputType || 'text' }}"
name="{{ name || componentId || '' }}"
value="{{ value }}"
focus="{{ focus }}"
placeholder="{{ placeholder }}"
class="zan-field__input zan-cell__bd {{ right ? 'zan-field__input--right' : '' }}"
placeholder-class="zan-field__placeholder"

View File

@ -1 +1 @@
.zan-cell{position:relative;padding:12px 15px;display:flex;align-items:center;line-height:1.4;font-size:14px}.zan-cell::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5;border-bottom-width:1px;left:15px;right:0}.zan-cell__icon{margin-right:5px}.zan-cell__bd{flex:1}.zan-cell__text{line-height:24px;font-size:14px}.zan-cell__desc{line-height:1.2;font-size:12px;color:#666}.zan-cell__ft{position:relative;text-align:right;color:#666}.zan-cell__no-pading{padding:0}.zan-cell__no-pading .zan-cell__bd_padding{padding:12px 0 12px 15px}.zan-cell__no-pading .zan-cell__bd_padding .zan-form__input{height:26px}.zan-cell__no-pading .zan-cell__ft_padding{padding:12px 15px 12px 0}.zan-cell--last-child::after,.zan-cell:last-child::after{display:none}.zan-cell--access .zan-cell__ft{padding-right:13px}.zan-cell--access .zan-cell__ft::after{position:absolute;top:50%;right:2px;content:" ";display:inline-block;height:6px;width:6px;border-width:2px 2px 0 0;border-color:#c8c8c8;border-style:solid;transform:translateY(-50%) matrix(.71,.71,-.71,.71,0,0)}.zan-cell--switch{padding-top:6px;padding-bottom:6px}.zan-field{padding:7px 15px;color:#333}.zan-field--wrapped{margin:0 15px;background-color:#fff}.zan-field--wrapped::after{left:0;border-width:1px;border-radius:4px}.zan-field--wrapped+.zan-field--wrapped{margin-top:10px}.zan-field--error{color:#f40}.zan-field--wrapped.zan-field--error::after{border-color:#f40}.zan-field__title{color:#333;min-width:65px;padding-right:10px}.zan-field__input{flex:1;line-height:1.6;padding:4px 0;min-height:22px;height:auto;font-size:14px}.zan-field__placeholder{font-size:14px}.zan-field__input--right{text-align:right}
.zan-cell{position:relative;padding:12px 15px;display:flex;align-items:center;line-height:1.4;font-size:14px}.zan-cell::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5;border-bottom-width:1px;left:15px;right:0}.zan-cell__icon{margin-right:5px}.zan-cell__bd{flex:1}.zan-cell__text{line-height:24px;font-size:14px}.zan-cell__desc{line-height:1.2;font-size:12px;color:#666}.zan-cell__ft{position:relative;text-align:right;color:#666}.zan-cell__no-pading{padding:0}.zan-cell__no-pading .zan-cell__bd_padding{padding:12px 0 12px 15px}.zan-cell__no-pading .zan-cell__bd_padding .zan-form__input{height:26px}.zan-cell__no-pading .zan-cell__ft_padding{padding:12px 15px 12px 0}.zan-cell--last-child::after,.zan-cell:last-child::after{display:none}.zan-cell--access .zan-cell__ft{padding-right:13px}.zan-cell--access .zan-cell__ft::after{position:absolute;top:50%;right:2px;content:" ";display:inline-block;height:6px;width:6px;border-width:2px 2px 0 0;border-color:#c8c8c8;border-style:solid;transform:translateY(-50%) matrix(.71,.71,-.71,.71,0,0)}.zan-cell--switch{padding-top:6px;padding-bottom:6px}.zan-field{padding:7px 15px;color:#333}.zan-field--wrapped{margin:0 15px;background-color:#fff}.zan-field--wrapped::after{left:0;border-width:1px;border-radius:4px}.zan-field.zan-field--wrapped::after{display:block}.zan-field--wrapped+.zan-field--wrapped{margin-top:10px}.zan-field--error{color:#f40}.zan-field--wrapped.zan-field--error::after{border-color:#f40}.zan-field__title{color:#333;min-width:65px;padding-right:10px}.zan-field__input{flex:1;line-height:1.6;padding:4px 0;min-height:22px;height:auto;font-size:14px}.zan-field__placeholder{font-size:14px}.zan-field__input--right{text-align:right}

2
dist/index.wxss vendored

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
var ZanNoticeBar = {
const ZanNoticeBar = {
initZanNoticeBarScroll(componentId) {
this.zanNoticeBarNode = this.zanNoticeBarNode || {};
this.zanNoticeBarNode[`${componentId}`] = {
@ -7,38 +7,53 @@ var ZanNoticeBar = {
animation: null,
resetAnimation: null
};
var currentComponent = this.zanNoticeBarNode[`${componentId}`];
wx.createSelectorQuery().select(`#${componentId}__content`).boundingClientRect((rect) => {
if (rect.width) {
const currentComponent = this.zanNoticeBarNode[`${componentId}`];
wx.createSelectorQuery()
.in(this)
.select(`#${componentId}__content`)
.boundingClientRect((rect) => {
if (!rect || !rect.width) {
console.warn('页面缺少 noticebar 元素');
return;
}
currentComponent.width = rect.width;
wx.createSelectorQuery().select(`#${componentId}__content-wrap`).boundingClientRect((rect) => {
currentComponent.wrapWidth = rect.width;
if (currentComponent.wrapWidth < currentComponent.width) {
var mstime = currentComponent.width / 40 * 1000;
currentComponent.animation = wx.createAnimation({
duration: mstime,
timingFunction: 'linear'
});
currentComponent.resetAnimation = wx.createAnimation({
duration: 0,
timingFunction: 'linear'
});
this.scrollZanNoticeBar(componentId, mstime);
}
}).exec();
} else {
console.warn('页面缺少 noticebar 元素');
}
}).exec();
wx
.createSelectorQuery()
.in(this)
.select(`#${componentId}__content-wrap`)
.boundingClientRect((rect) => {
if (!rect || !rect.width) {
return;
}
currentComponent.wrapWidth = rect.width;
if (currentComponent.wrapWidth < currentComponent.width) {
var mstime = currentComponent.width / 40 * 1000;
currentComponent.animation = wx.createAnimation({
duration: mstime,
timingFunction: 'linear'
});
currentComponent.resetAnimation = wx.createAnimation({
duration: 0,
timingFunction: 'linear'
});
this.scrollZanNoticeBar(componentId, mstime);
}
})
.exec();
})
.exec();
},
scrollZanNoticeBar(componentId, mstime) {
var currentComponent = this.zanNoticeBarNode[`${componentId}`];
var resetAnimationData = currentComponent.resetAnimation.translateX(currentComponent.wrapWidth).step();
const currentComponent = this.zanNoticeBarNode[`${componentId}`];
const resetAnimationData = currentComponent.resetAnimation.translateX(currentComponent.wrapWidth).step();
this.setData({
[`${componentId}.animationData`]: resetAnimationData.export()
});
var aninationData = currentComponent.animation.translateX(-mstime * 40 / 1000).step();
const aninationData = currentComponent.animation.translateX(-mstime * 40 / 1000).step();
setTimeout(() => {
this.setData({
[`${componentId}.animationData`]: aninationData.export()