Merge branch 'master' of gitlab.qima-inc.com:weapp/zui

This commit is contained in:
pangxie1991 2016-12-28 13:36:02 +08:00
commit fcdfe960e0
9 changed files with 36 additions and 14 deletions

13
dist/btn/index.wxss vendored
View File

@ -60,7 +60,7 @@
padding-left: 5px; padding-left: 5px;
padding-right: 5px; padding-right: 5px;
} }
.zui-btn--big { .zui-btn--large {
border-radius: 0; border-radius: 0;
margin-bottom: 0; margin-bottom: 0;
border: none; border: none;
@ -125,11 +125,12 @@
/* disabled */ /* disabled */
.zui-btn.zui-btn--disabled { .zui-btn.zui-btn--disabled {
color: #999; /* 防止样式被 button[disabled] 的规则覆盖所以使用了important */
background: #f8f8f8; color: #999 ! important;
border-color: #e5e5e5; background: #f8f8f8 ! important;
cursor: not-allowed; border-color: #e5e5e5 ! important;
opacity: 1; cursor: not-allowed ! important;
opacity: 1 ! important;
} }
/* ::last-child */ /* ::last-child */

View File

@ -1,5 +1,5 @@
<template name="zui-quantity"> <template name="zui-quantity">
<view class="zui-quantity"> <view class="zui-quantity {{ size === 'small' ? 'zui-quantity--small' : '' }}">
<view <view
class="zui-quantity__minus {{ quantity <= min ? 'zui-quantity--disabled' : '' }}" class="zui-quantity__minus {{ quantity <= min ? 'zui-quantity--disabled' : '' }}"
data-component-id="{{ componentId }}" data-component-id="{{ componentId }}"

View File

@ -35,3 +35,12 @@
color: #bbb; color: #bbb;
border-color: #e8e8e8; border-color: #e8e8e8;
} }
.zui-quantity--small view {
min-width: 36px;
line-height: 18px;
}
.zui-quantity--small .zui-quantity__text {
width: 36px;
line-height: 28px;
height: 28px;
}

View File

@ -8,9 +8,9 @@
</view> </view>
<view class="zui-panel"> <view class="zui-panel">
<button class="zui-btn zui-btn--big zui-btn--primary">确认付款</button> <button class="zui-btn zui-btn--large zui-btn--primary">确认付款</button>
<button class="zui-btn zui-btn--big zui-btn--warn">立即购买</button> <button class="zui-btn zui-btn--large zui-btn--warn">立即购买</button>
<button class="zui-btn zui-btn--big zui-btn--danger">立即购买</button> <button class="zui-btn zui-btn--large zui-btn--danger">立即购买</button>
</view> </view>
<view class="zui-panel" style="padding: 15px;"> <view class="zui-panel" style="padding: 15px;">

View File

@ -2,7 +2,7 @@
<view class="zui-btns"> <view class="zui-btns">
<button <button
class="zui-btn zui-btn--primary zui-btn--big" class="zui-btn zui-btn--primary zui-btn--large"
bindtap="toggleDialog" bindtap="toggleDialog"
style="margin-top: 40vh;" style="margin-top: 40vh;"
> >

View File

@ -3,7 +3,7 @@ var ZUI = require('../../dist/index');
Page(Object.assign({}, ZUI.Quantity, { Page(Object.assign({}, ZUI.Quantity, {
data: { data: {
quantity1: { quantity1: {
quantity: 1, quantity: 10,
min: 1, min: 1,
max: 20 max: 20
}, },
@ -11,6 +11,11 @@ Page(Object.assign({}, ZUI.Quantity, {
quantity: 1, quantity: 1,
min: 1, min: 1,
max: 1 max: 1
},
quantity3: {
quantity: 10,
min: 1,
max: 20
} }
}, },

View File

@ -4,7 +4,14 @@
<view style="padding: 40px 15px"> <view style="padding: 40px 15px">
<template is="zui-quantity" data="{{ ...quantity1, componentId: 'quantity1' }}" /> <template is="zui-quantity" data="{{ ...quantity1, componentId: 'quantity1' }}" />
</view> </view>
<!-- 当最大值等于最小值时,组件不可用 -->
<view style="padding: 40px 15px "> <view style="padding: 40px 15px ">
<template is="zui-quantity" data="{{ ...quantity2, componentId: 'quantity2' }}" /> <template is="zui-quantity" data="{{ ...quantity2, componentId: 'quantity2' }}" />
</view> </view>
<!-- small size -->
<view style="padding: 40px 15px ">
<template is="zui-quantity" data="{{ ...quantity3, componentId: 'quantity3', size: 'small' }}" />
</view>
</view> </view>

View File

@ -3,7 +3,7 @@
<view class="container"> <view class="container">
<view class="zui-btns"> <view class="zui-btns">
<button <button
class="zui-btn zui-btn--primary zui-btn--big" class="zui-btn zui-btn--primary zui-btn--large"
catchtap="showToast" catchtap="showToast"
style="margin-top: 40vh;" style="margin-top: 40vh;"
> >

View File

@ -3,7 +3,7 @@
<view class="container"> <view class="container">
<view class="zui-btns"> <view class="zui-btns">
<button <button
class="zui-btn zui-btn--primary zui-btn--big" class="zui-btn zui-btn--primary zui-btn--large"
catchtap="showTopTips" catchtap="showTopTips"
style="margin-top: 40vh;" style="margin-top: 40vh;"
> >