[new feature] Coupon add 'showExchangeBar' prop && add empty style (#243)

* [bugfix] Checkbox border render error in weixin browser

* [bugfix] TreeSelect dependency path error

* [bugfix] Swipe should clear autoplay timer when destroyed

* [bugfix] Optimize component dependency analyze when build style entry

* merge

* update yarn.lock

* update README.md

* update README.md

* update README.md

* update README.md

* update README.md

* [Doc] add more badges in README.md

* update README.md

* [bugfix] Address & Contact list style

* fix: contact test cases

* [bugfix] popup style missing when build style entry

* [bugfix] Search: onSearch event arguments missing

* [Doc] add demo pages

* update zan-doc@0.3.7

* fix: build entry error

* [Doc] add goods demo

* [bugfix] button primary background color

* [Doc] update doc detail

* [new feature] Coupon add 'showExchangeBar' prop && add empty style
This commit is contained in:
neverland 2017-10-24 22:19:44 -05:00 committed by GitHub
parent 276042b84c
commit 9178ebab86
7 changed files with 89 additions and 24 deletions

View File

@ -160,6 +160,7 @@ export default {
| closeButtonText | 列表底部按钮文字 | `String` | 不使用优惠 | - | | closeButtonText | 列表底部按钮文字 | `String` | 不使用优惠 | - |
| disabledListTitle | 不可用券列表标题 | `String` | 不可用优惠 | - | | disabledListTitle | 不可用券列表标题 | `String` | 不可用优惠 | - |
| inputPlaceholder | 输入框文字提示 | `String` | 请输入优惠码 | - | | inputPlaceholder | 输入框文字提示 | `String` | 请输入优惠码 | - |
| showExchangeBar | 是否展示兑换栏 | `Boolean` | `true` | - |
### CouponList Event ### CouponList Event

View File

@ -1,7 +1,10 @@
<template> <template>
<div class="side-nav"> <div class="side-nav">
<h1 class="zanui-title">Zan UI</h1> <h1 class="zanui-title">
<h2 class="zanui-desc">有赞移动端 Vue 组件库</h2> <img src="https://img.yzcdn.cn/public_files/2017/10/25/c2e074cd97d4d9e9b14a87b2fcb29430.png" />
<span>Vant</span>
</h1>
<h2 class="zanui-desc">{{ description }}</h2>
<div class="mobile-navs"> <div class="mobile-navs">
<div class="mobile-nav-item" v-for="(item, index) in navList" v-if="item.showInMobile" :key="index"> <div class="mobile-nav-item" v-for="(item, index) in navList" v-if="item.showInMobile" :key="index">
<mobile-nav v-for="(group, index) in item.groups" :group="group" :base="base" :nav-key="index" :key="index" /> <mobile-nav v-for="(group, index) in item.groups" :group="group" :base="base" :nav-key="index" :key="index" />
@ -42,6 +45,10 @@ export default {
navList() { navList() {
return this.docConfig[this.lang].nav || []; return this.docConfig[this.lang].nav || [];
},
description() {
return this.lang === 'zh-CN' ? '有赞移动端 Vue 组件库' : 'A Vue.js 2.0 Mobile UI at YouZan';
} }
} }
}; };
@ -63,17 +70,28 @@ export default {
} }
.zanui-title { .zanui-title {
padding-top: 40px; margin: 0 0 15px;
height: 0;
overflow: hidden; img,
background: url(https://img.yzcdn.cn/upload_files/2017/04/20/FjwR1mraVIqtHWb8YWDW_YzQ_Kh2.png) center center no-repeat; span {
background-size: 156px 40px; display: inline-block;
margin: 0 0 10px; vertical-align: middle;
}
img {
width: 30px;
}
span {
font-size: 40px;
margin-left: 15px;
font-family: "Dosis", "Source Sans Pro", "Helvetica Neue", Arial, sans-serif;
}
} }
.zanui-desc { .zanui-desc {
font-size: 14px; font-size: 14px;
color: #666; color: #455a64;
margin: 0 0 50px; margin: 0 0 50px;
} }
} }

View File

@ -8,11 +8,11 @@ module.exports = {
footer: { footer: {
github: 'https://github.com/youzan/vant', github: 'https://github.com/youzan/vant',
nav: { nav: {
React: 'https://www.youzanyun.com/zanui/react', 'React 组件库': 'https://www.youzanyun.com/zanui/react',
微信小程序: 'https://github.com/youzan/zanui-weapp', 小程序组件库: 'https://github.com/youzan/zanui-weapp',
意见反馈: 'https://github.com/youzan/vant/issues', 意见反馈: 'https://github.com/youzan/vant/issues',
开发指南: 开发指南: 'https://github.com/youzan/vant/blob/dev/.github/CONTRIBUTING.zh-CN.md',
'https://github.com/youzan/vant/blob/dev/.github/CONTRIBUTING.zh-CN.md' 加入我们: 'https://job.youzan.com'
} }
}, },
nav: [ nav: [
@ -270,8 +270,8 @@ module.exports = {
footer: { footer: {
github: 'https://github.com/youzan/vant', github: 'https://github.com/youzan/vant',
nav: { nav: {
React: 'https://www.youzanyun.com/zanui/react', 'React UI': 'https://www.youzanyun.com/zanui/react',
Weapp: 'https://github.com/youzan/zanui-weapp', 'Weapp UI': 'https://github.com/youzan/zanui-weapp',
Feedback: 'https://github.com/youzan/vant/issues', Feedback: 'https://github.com/youzan/vant/issues',
Contribute: Contribute:
'https://github.com/youzan/vant/blob/dev/.github/CONTRIBUTING.md' 'https://github.com/youzan/vant/blob/dev/.github/CONTRIBUTING.md'

View File

@ -119,6 +119,6 @@
"webpack-bundle-analyzer": "^2.9.0", "webpack-bundle-analyzer": "^2.9.0",
"webpack-dev-server": "^2.9.2", "webpack-dev-server": "^2.9.2",
"webpack-merge": "^4.1.0", "webpack-merge": "^4.1.0",
"zan-doc": "^0.3.8" "zan-doc": "^0.3.9"
} }
} }

View File

@ -1,10 +1,10 @@
<template> <template>
<div class="van-coupon-list"> <div class="van-coupon-list">
<van-cell-group class="van-coupon-list__top"> <van-cell-group class="van-coupon-list__top" v-if="showExchangeBar">
<van-field v-model="exchangeCode" :placeholder="inputPlaceholder" :maxlength="20" /> <van-field class="van-coupon-list__filed van-hairline--surround" v-model="exchangeCode" :placeholder="inputPlaceholder" :maxlength="20" />
<van-button size="small" type="danger" class="van-coupon-list__exchange" :disabled="exchangeButtonDisabled || !exchangeCode.length" @click="onClickExchangeButton">{{ exchangeButtonText }}</van-button> <van-button size="small" type="danger" class="van-coupon-list__exchange" :disabled="exchangeButtonDisabled || !exchangeCode.length" @click="onClickExchangeButton">{{ exchangeButtonText }}</van-button>
</van-cell-group> </van-cell-group>
<div class="van-coupon-list__list" ref="list"> <div :class="['van-coupon-list__list', { 'van-coupon-list--with-exchange': showExchangeBar }]" ref="list">
<van-coupon-item <van-coupon-item
ref="card" ref="card"
v-for="(item, index) in coupons" v-for="(item, index) in coupons"
@ -20,6 +20,10 @@
:key="item.id || item.name" :key="item.id || item.name"
:data="item" :data="item"
/> />
<div class="van-coupon-list__empty">
<img src="https://b.yzcdn.cn/v2/image/wap/trade/new_order/empty@2x.png" >
<p>暂无优惠券</p>
</div>
</div> </div>
<div class="van-coupon-list__close van-hairline--top" @click="onClickNotUse">{{ closeButtonText }}</div> <div class="van-coupon-list__close van-hairline--top" @click="onClickNotUse">{{ closeButtonText }}</div>
</div> </div>
@ -81,6 +85,10 @@ export default {
inputPlaceholder: { inputPlaceholder: {
type: String, type: String,
default: '请输入优惠码' default: '请输入优惠码'
},
showExchangeBar: {
type: Boolean,
default: true
} }
}, },

View File

@ -13,20 +13,33 @@
left: 0; left: 0;
width: 100%; width: 100%;
z-index: 1; z-index: 1;
padding-right: 85px;
box-sizing: border-box; box-sizing: border-box;
} }
&__filed {
margin: 10px 0;
padding: 4px 10px;
&::after {
border-radius: 6px;
border-color: #cacaca;
}
}
&__exchange { &__exchange {
top: 6px; top: 10px;
right: 15px; right: 15px;
height: 32px;
line-height: 30px;
position: absolute; position: absolute;
border-radius: 2px; border-radius: 2px;
} }
&__list { &__list {
padding: 60px 0;
max-height: 100%; max-height: 100%;
overflow-y: auto; overflow-y: auto;
padding: 15px 0 60px;
box-sizing: border-box; box-sizing: border-box;
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
@ -64,6 +77,10 @@
} }
} }
&--with-exchange {
padding-top: 60px;
}
&__close { &__close {
left: 0; left: 0;
bottom: 0; bottom: 0;
@ -73,6 +90,27 @@
text-align: center; text-align: center;
position: absolute; position: absolute;
background-color: $white; background-color: $white;
&:active {
background-color: $active-color;
}
}
&__empty {
padding-top: 100px;
text-align: center;
p {
color: #999;
margin: 15px 0;
font-size: 14px;
line-height: 20px;
}
img {
width: 80px;
height: 84px;
}
} }
} }

View File

@ -8262,9 +8262,9 @@ yeast@0.1.2:
version "0.1.2" version "0.1.2"
resolved "https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419" resolved "https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419"
zan-doc@^0.3.8: zan-doc@^0.3.9:
version "0.3.8" version "0.3.9"
resolved "https://registry.yarnpkg.com/zan-doc/-/zan-doc-0.3.8.tgz#96eb93a196963e95af15527a426270ae73375351" resolved "https://registry.yarnpkg.com/zan-doc/-/zan-doc-0.3.9.tgz#4a666408569aee6481590aba281cf40c98ce89b7"
dependencies: dependencies:
cheerio "0.22.0" cheerio "0.22.0"
decamelize "^1.2.0" decamelize "^1.2.0"