Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
icarusion committed Jun 6, 2018
1 parent 4844ac9 commit b8a3540
Show file tree
Hide file tree
Showing 19 changed files with 88 additions and 55 deletions.
29 changes: 3 additions & 26 deletions dist/alert/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ Component({
//info, success, warning, error
type: {
type: String,
value: 'info',
observer: 'setIconType'
value: 'info'
},
closable: {
type: Boolean,
Expand All @@ -24,36 +23,14 @@ Component({
},
},
data: {
closed: false,
iconType: '',
closed: false
},
methods: {
setIconType() {
let type = '';

switch (this.data.type) {
case 'success':
type = 'success';
break;
case 'info':
type = 'prompt';
break;
case 'warning':
type = 'warning';
break;
case 'error':
type = 'delete';
break;
}
this.setData({
iconType: type
});
},
handleTap() {
this.setData({
closed: !this.data.closed,
});
this.triggerEvent('click');
this.triggerEvent('close');
},

}
Expand Down
7 changes: 5 additions & 2 deletions dist/alert/index.wxml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<view class="i-class i-alert {{'i-alert-'+type}} {{showIcon?'i-alert-with-icon':''}} {{desc?'i-alert-with-desc':''}}" wx:if="{{!closed}}">
<view wx:if="{{showIcon}}" class="i-alert-icon">
<i-icon type="{{iconType}}" size="{{desc?24:16}}"></i-icon>
<view wx:if="{{ showIcon }}" class="i-alert-icon">
<i-icon type="prompt" wx:if="{{ type === 'info' }}" size="{{desc?24:16}}"></i-icon>
<i-icon type="success" wx:if="{{ type === 'success' }}" size="{{desc?24:16}}"></i-icon>
<i-icon type="warning" wx:if="{{ type === 'warning' }}" size="{{desc?24:16}}"></i-icon>
<i-icon type="delete" wx:if="{{ type === 'error' }}" size="{{desc?24:16}}"></i-icon>
</view>
<slot></slot>
<view class="i-alert-desc">
Expand Down
2 changes: 1 addition & 1 deletion dist/button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Component({
sendMessageTitle: String,
sendMessagePath: String,
sendMessageImg: String,
showMessageCard: String
showMessageCard: Boolean
},

methods: {
Expand Down
2 changes: 1 addition & 1 deletion dist/cell/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Component({
const { url } = this.data;
const type = typeof this.data.isLink;

this.triggerEvent('tap', {});
this.triggerEvent('click', {});

if (!this.data.isLink || !url || url === 'true' || url === 'false') return;

Expand Down
10 changes: 5 additions & 5 deletions dist/drawer/index.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
Component({
externalClasses: ['i-class'],
properties: {
show: {
visible: {
type: Boolean,
value: false
},

overlay: {
mask: {
type: Boolean,
value: true
},

closeOverlay: {
maskClosable: {
type: Boolean,
value: true
},

type: {
mode: {
type: String,
value: 'left' // left right
}
},
data: {},
methods: {
handleMaskClick() {
if (!this.data.closeOverlay) {
if (!this.data.maskClosable) {
return;
}
this.triggerEvent('close', {});
Expand Down
4 changes: 2 additions & 2 deletions dist/drawer/index.wxml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<view class="i-class i-drawer {{show?'i-drawer-show':''}} {{'i-drawer-'+type}}">
<view wx:if="{{overlay}}" class="i-drawer-mask" bindtap="handleMaskClick"></view>
<view class="i-class i-drawer {{ visible ? 'i-drawer-show' : '' }} {{ 'i-drawer-' + mode }}">
<view wx:if="{{ mask }}" class="i-drawer-mask" bindtap="handleMaskClick"></view>
<view class="i-drawer-container">
<slot></slot>
</view>
Expand Down
2 changes: 2 additions & 0 deletions dist/notice-bar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ const FONT_COLOR = '#f60';
const BG_COLOR = '#fff7cc';

Component({
externalClasses: ['i-class'],

properties: {
closable: {
type: Boolean,
Expand Down
2 changes: 1 addition & 1 deletion dist/notice-bar/index.wxml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<view wx:if="{{ show }}" class="i-noticebar">
<view wx:if="{{ show }}" class="i-class i-noticebar">
<i-icon wx:if="{{ icon }}" type="{{ icon }}" size="24" color="#f76a24" class="i-noticebar-icon"></i-icon>
<view class="i-noticebar-content-wrap">
<view class="i-noticebar-content {{loop?'i-noticebar-content-loop':''}}" animation="{{ animationData }}">
Expand Down
2 changes: 1 addition & 1 deletion dist/page/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<view class="i-page-number-current">{{ current }}</view>/{{total}}
</view>
<view class="i-page-pointer" wx:if="{{ mode === 'pointer' }}">
<view class="i-page-pointer-dot {{ (index + 1) === current ? 'current' : '' }}" wx:for="{{ total }}"></view>
<view class="i-page-pointer-dot {{ (index + 1) === current ? 'current' : '' }}" wx:for="{{ total }}" wx:key="index"></view>
</view>
<view class="i-page-next" wx:if="{{ mode === 'button' }}">
<i-button i-class="i-page-button" type="ghost" bindclick="handleNext" disabled="{{ current === total }}"><slot name="next"></slot></i-button>
Expand Down
42 changes: 35 additions & 7 deletions dist/rate/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,48 @@ Component({
value : ''
}
},
data : {
touchesStart : {
pageX : 0
}
},
methods : {
handleClick(e){
const data = this.data;
if( data.disabled ){
return;
}
const index = e.currentTarget.dataset.index;
this.triggerEvent('change',{
index : index + 1
})
},
//later to do this
handleTouch(e){
//console.log(e,2222222)
},
handleTouchEnd(e){

//console.log(e,'----handleTouchEnd')
handleTouchMove(e){
const data = this.data;
if( data.disabled ){
return;
}
if( !e.changedTouches[0] ){
return;
}
const movePageX = e.changedTouches[0].pageX;
const space = movePageX - data.touchesStart.pageX;

if( space <= 0 ){
return;
}
let setIndex = Math.ceil( space/data.size );
setIndex = setIndex > data.count ? data.count : setIndex ;
this.triggerEvent('change',{
index : setIndex
})
}
},
ready(){
const className = '.i-rate';
var query = wx.createSelectorQuery().in(this)
query.select( className ).boundingClientRect((res)=>{
this.data.touchesStart.pageX = res.left || 0;
}).exec()
}
});
3 changes: 2 additions & 1 deletion dist/rate/index.wxml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<view class="i-class i-rate" bindtouchmove="handleTouch">
<view class="i-class i-rate"
bindtouchmove="handleTouchMove">
<input type="text" :name="name" wx:value="{{value}}" class="i-rate-hide-input" />
<view
wx:for="{{count}}"
Expand Down
15 changes: 15 additions & 0 deletions dist/slide/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Component({
externalClasses: ['i-class'],
options: {
// 在组件定义时的选项中启用多slot支持
multipleSlots: true
},
methods : {
handleTap2(){
console.log(event,1111111)
},
handleTap3(){

}
}
});
8 changes: 8 additions & 0 deletions dist/slide/index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"component": true,
"usingComponents":
{
"i-button": "../button/index",
"i-icon": "../icon/index"
}
}
4 changes: 4 additions & 0 deletions dist/slide/index.wxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<view class="i-class i-slide" capture-catch:touchstart="handleTap2" capture-catch:touchmove="handleTap3">
1111

</view>
Empty file added dist/slide/index.wxss
Empty file.
2 changes: 1 addition & 1 deletion dist/step/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<view class="i-step-item-ico">
<view class="i-step-ico" wx:if="{{parse.noIco(status,current,index,icon) }}">{{ index+1 }}</view>
<view class="i-step-ico" wx:else>
<i-icon type="{{parse.getIcoClass(status,icon)}}"></i-icon>
<i-icon i-class="i-step-ico-in" type="{{parse.getIcoClass(status,icon)}}"></i-icon>
</view>
<view class="i-step-line" wx:if="{{ index !== len - 1 }}"></view>
</view>
Expand Down
2 changes: 1 addition & 1 deletion dist/step/index.wxss
Original file line number Diff line number Diff line change
@@ -1 +1 @@
.i-step-ico{width:24px;height:100%;border-radius:100%;background:#fff;position:relative;z-index:2;margin:0 auto;border:#dddee1 solid 1px}.i-step-line{position:absolute;left:50%;top:12px;width:100%;height:1px;background:#dddee1}.i-step-horizontal .i-step-ico::after{position:absolute;top:11px;left:23px;z-index:1;content:'';height:1px;background:#fff;width:10px}.i-step-horizontal .i-step-item-main{text-align:center}.i-step-horizontal .i-step-ico::before{position:absolute;top:11px;left:-11px;z-index:1;content:'';height:1px;background:#fff;width:10px}.i-step-ico{box-sizing:border-box;font-size:12px}.i-step-process .i-step-ico{border:#2d8cf0 solid 1px;color:#fff;background:#2d8cf0}.i-step-wait .i-step-ico{border:#e9eaec solid 1px;color:#e9eaec}.i-step-wait .i-step-line{background:#2d8cf0}.i-step-finish .i-step-ico{border:#2d8cf0 solid 1px;color:#2d8cf0}.i-step-finish .i-step-line{background:#2d8cf0}.i-step-error .i-step-ico{border:#ed3f14 solid 1px;color:#ed3f14}.i-step-error .i-step-line{background:#ed3f14}.i-step-item{font-size:12px;position:relative;display:inline-block;box-sizing:border-box;padding-left:10px;vertical-align:top}.i-step-item-ico{width:100%;height:24px;line-height:24px;text-align:center}.i-step-item-main{margin-top:10px;clear:both}.i-step-item-title{font-size:14px;font-weight:700;color:#1c2438}.i-step-item-content{font-size:12px;font-weight:700;margin-top:2px;color:#80848f}.i-step-vertical{padding-bottom:30px}.i-step-vertical .i-step-item-ico{width:24px;float:left}.i-step-vertical .i-step-item-main{margin-left:40px;margin-top:0;clear:inherit}.i-step-vertical .i-step-line{position:absolute;height:100%;top:0;left:10px;margin:0 0 0 12px;width:1px}
.i-step-ico{width:24px;height:100%;border-radius:100%;background:#fff;position:relative;z-index:2;margin:0 auto;border:#dddee1 solid 1px}.i-step-ico-in{vertical-align:baseline}.i-step-line{position:absolute;left:50%;top:12px;width:100%;height:1px;background:#dddee1}.i-step-horizontal .i-step-ico::after{position:absolute;top:11px;left:23px;z-index:1;content:'';height:1px;background:#fff;width:10px}.i-step-horizontal .i-step-item-main{text-align:center}.i-step-horizontal .i-step-ico::before{position:absolute;top:11px;left:-11px;z-index:1;content:'';height:1px;background:#fff;width:10px}.i-step-ico{box-sizing:border-box;font-size:12px}.i-step-process .i-step-ico{border:#2d8cf0 solid 1px;color:#fff;background:#2d8cf0}.i-step-wait .i-step-ico{border:#e9eaec solid 1px;color:#e9eaec}.i-step-wait .i-step-line{background:#2d8cf0}.i-step-finish .i-step-ico{border:#2d8cf0 solid 1px;color:#2d8cf0}.i-step-finish .i-step-line{background:#2d8cf0}.i-step-error .i-step-ico{border:#ed3f14 solid 1px;color:#ed3f14}.i-step-error .i-step-line{background:#ed3f14}.i-step-item{font-size:12px;position:relative;display:inline-block;box-sizing:border-box;padding-left:10px;vertical-align:top}.i-step-item-ico{width:100%;height:24px;line-height:24px;text-align:center}.i-step-item-main{margin-top:10px;clear:both}.i-step-item-title{font-size:14px;font-weight:700;color:#1c2438}.i-step-item-content{font-size:12px;font-weight:700;margin-top:2px;color:#80848f}.i-step-vertical{padding-bottom:30px}.i-step-vertical .i-step-item-ico{width:24px;float:left}.i-step-vertical .i-step-item-main{margin-left:40px;margin-top:0;clear:inherit}.i-step-vertical .i-step-line{position:absolute;height:100%;top:0;left:10px;margin:0 0 0 12px;width:1px}
5 changes: 0 additions & 5 deletions dist/tag/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
Component({
externalClasses: ['i-class'],
properties : {
//close button show or not;
closable : {
type : Boolean,
value : false
},
//slot name
name : {
type : String,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iview-weapp",
"version": "1.0.0",
"version": "1.1.0",
"description": "高质量微信小程序 UI 组件库",
"main": "app.js",
"directories": {
Expand Down

0 comments on commit b8a3540

Please sign in to comment.