From 4d2722d0b26984a584337b53c49334d302a8a776 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=98=89=E6=B6=B5?= Date: Fri, 19 Oct 2018 19:29:03 +0800 Subject: [PATCH] [build] 0.4.2 --- dist/area/index.js | 50 +++++++++++++++++++++++++++-- dist/field/index.js | 2 +- dist/field/index.wxml | 4 +-- dist/goods-action-button/index.js | 2 ++ dist/goods-action-button/index.wxml | 2 ++ dist/icon/index.wxss | 2 +- dist/notify/index.wxml | 2 +- dist/search/index.js | 1 + dist/search/index.wxml | 1 + dist/tag/index.js | 28 +++++++++++++++- dist/tag/index.wxml | 4 +-- dist/tag/index.wxss | 2 +- 12 files changed, 87 insertions(+), 13 deletions(-) diff --git a/dist/area/index.js b/dist/area/index.js index 081ad3e8..d14bef91 100644 --- a/dist/area/index.js +++ b/dist/area/index.js @@ -45,13 +45,15 @@ VantComponent({ onCancel: function onCancel() { this.$emit('cancel', { values: this.getValues(), - indexs: this.getIndexs() + indexs: this.getIndexs(), + detail: this.getDetail() }); }, onConfirm: function onConfirm() { this.$emit('confirm', { values: this.getValues(), - indexs: this.getIndexs() + indexs: this.getIndexs(), + detail: this.getDetail() }); }, onChange: function onChange(event) { @@ -92,6 +94,11 @@ VantComponent({ }); if (code) { + // oversea code + if (code[0] === '9' && type === 'city') { + code = '9'; + } + result = result.filter(function (item) { return item.code.indexOf(code) === 0; }); @@ -101,7 +108,12 @@ VantComponent({ }, getIndex: function getIndex(type, code) { var compareNum = type === 'province' ? 2 : type === 'city' ? 4 : 6; - var list = this.getList(type, code.slice(0, compareNum - 2)); + var list = this.getList(type, code.slice(0, compareNum - 2)); // oversea code + + if (code[0] === '9' && type === 'province') { + compareNum = 1; + } + code = code.slice(0, compareNum); for (var i = 0; i < list.length; i++) { @@ -138,6 +150,8 @@ VantComponent({ pickerValue = _this$data3$pickerVal === void 0 ? [] : _this$data3$pickerVal; return displayColumns.map(function (option, index) { return option[pickerValue[index]]; + }).filter(function (value) { + return !!value; }); }, getIndexs: function getIndexs() { @@ -146,6 +160,36 @@ VantComponent({ columnsNum = _this$data4.columnsNum; return pickerValue.slice(0, columnsNum); }, + getDetail: function getDetail() { + var values = this.getValues(); + var area = { + code: '', + country: '', + province: '', + city: '', + county: '' + }; + + if (!values.length) { + return area; + } + + var names = values.map(function (item) { + return item.name; + }); + area.code = values[values.length - 1].code; + + if (area.code[0] === '9') { + area.country = names[1] || ''; + area.province = names[2] || ''; + } else { + area.province = names[0] || ''; + area.city = names[1] || ''; + area.county = names[2] || ''; + } + + return area; + }, reset: function reset() { this.code = ''; this.setValues(); diff --git a/dist/field/index.js b/dist/field/index.js index 756f8ed2..f9328a0b 100644 --- a/dist/field/index.js +++ b/dist/field/index.js @@ -56,7 +56,7 @@ VantComponent({ 'van-field--error': data.error, 'van-field__textarea': data.type === 'textarea', 'van-field__input--disabled': data.disabled, - ["van-field--" + data.inputAlign]: data.inputAlign + ["van-field__input--" + data.inputAlign]: data.inputAlign }); } }, diff --git a/dist/field/index.wxml b/dist/field/index.wxml index 97223b3d..212f4c48 100644 --- a/dist/field/index.wxml +++ b/dist/field/index.wxml @@ -20,7 +20,7 @@ maxlength="{{ maxlength }}" auto-height="{{ autosize }}" placeholder="{{ placeholder }}" - placeholder-style="{{ placeholderStyle }} " + placeholder-style="{{ placeholderStyle }}" placeholder-class="{{ error ? 'van-field--error' : '' }}" cursor-spacing="{{ cursorSpacing }}" bindinput="onInput" @@ -37,7 +37,7 @@ disabled="{{ disabled || readonly }}" maxlength="{{ maxlength }}" placeholder="{{ placeholder }}" - placeholder-style="{{ placeholderStyle }} " + placeholder-style="{{ placeholderStyle }}" placeholder-class="{{ error ? 'van-field--error' : '' }}" confirm-type="{{ confirmType }}" cursor-spacing="{{ cursorSpacing }}" diff --git a/dist/goods-action-button/index.js b/dist/goods-action-button/index.js index 495d0c17..7e79a074 100644 --- a/dist/goods-action-button/index.js +++ b/dist/goods-action-button/index.js @@ -4,6 +4,8 @@ VantComponent({ mixins: [link], props: { text: String, + loading: Boolean, + disabled: Boolean, type: { type: String, value: 'danger' diff --git a/dist/goods-action-button/index.wxml b/dist/goods-action-button/index.wxml index 1dcf10f4..a4e6084e 100644 --- a/dist/goods-action-button/index.wxml +++ b/dist/goods-action-button/index.wxml @@ -2,6 +2,8 @@ square size="large" type="{{ type }}" + loading="{{ loading }}" + disabled="{{ disabled }}" bind:click="onClick" > {{ text }} diff --git a/dist/icon/index.wxss b/dist/icon/index.wxss index c2b9b993..0e06562d 100644 --- a/dist/icon/index.wxss +++ b/dist/icon/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss';@font-face{font-style:normal;font-weight:400;font-family:vant-icon;src:url(https://img.yzcdn.cn/vant/vant-icon-76f274.ttf) format('truetype')}.van-icon{position:relative;display:inline-block;font:normal normal normal 14px/1 vant-icon;font-size:inherit;text-rendering:auto}.van-icon__info{color:#fff;left:100%;top:-.5em;font-size:.6em;padding:0 .25em;text-align:center;min-width:1.4em;line-height:1.4;position:absolute;border-radius:.6em;box-sizing:border-box;background-color:#f44;-webkit-transform:translateX(-50%);transform:translateX(-50%);font-family:PingFang SC,Helvetica Neue,Arial,sans-serif}.van-icon::before{display:inline-block}.van-icon-add-o::before{content:"\F000"}.van-icon-add::before{content:"\F001"}.van-icon-add2::before{content:"\F002"}.van-icon-after-sale::before{content:"\F003"}.van-icon-aim::before{content:"\F004"}.van-icon-alipay::before{content:"\F005"}.van-icon-arrow-left::before{content:"\F006"}.van-icon-arrow::before{content:"\F007"}.van-icon-balance-pay::before{content:"\F008"}.van-icon-browsing-history::before{content:"\F009"}.van-icon-card::before{content:"\F00A"}.van-icon-cart::before{content:"\F00B"}.van-icon-cash-back-record::before{content:"\F00C"}.van-icon-cash-on-deliver::before{content:"\F00D"}.van-icon-certificate::before{content:"\F00E"}.van-icon-chat::before{content:"\F00F"}.van-icon-check::before{content:"\F010"}.van-icon-checked::before{content:"\F011"}.van-icon-clear::before{content:"\F012"}.van-icon-clock::before{content:"\F013"}.van-icon-close::before{content:"\F014"}.van-icon-completed::before{content:"\F015"}.van-icon-contact::before{content:"\F016"}.van-icon-coupon::before{content:"\F017"}.van-icon-credit-pay::before{content:"\F018"}.van-icon-debit-pay::before{content:"\F019"}.van-icon-delete::before{content:"\F01A"}.van-icon-description::before{content:"\F01B"}.van-icon-discount::before{content:"\F01C"}.van-icon-ecard-pay::before{content:"\F01D"}.van-icon-edit-data::before{content:"\F01E"}.van-icon-edit::before{content:"\F01F"}.van-icon-exchange-record::before{content:"\F020"}.van-icon-exchange::before{content:"\F021"}.van-icon-fail::before{content:"\F022"}.van-icon-free-postage::before{content:"\F023"}.van-icon-gift-card-pay::before{content:"\F024"}.van-icon-gift-card::before{content:"\F025"}.van-icon-gift::before{content:"\F026"}.van-icon-gold-coin::before{content:"\F027"}.van-icon-goods-collect::before{content:"\F028"}.van-icon-home::before{content:"\F029"}.van-icon-hot-sale::before{content:"\F02A"}.van-icon-hot::before{content:"\F02B"}.van-icon-idcard::before{content:"\F02C"}.van-icon-info-o::before{content:"\F02D"}.van-icon-like-o::before{content:"\F02E"}.van-icon-like::before{content:"\F02F"}.van-icon-location::before{content:"\F030"}.van-icon-logistics::before{content:"\F031"}.van-icon-more-o::before{content:"\F032"}.van-icon-more::before{content:"\F033"}.van-icon-new-arrival::before{content:"\F034"}.van-icon-new::before{content:"\F035"}.van-icon-other-pay::before{content:"\F036"}.van-icon-passed::before{content:"\F037"}.van-icon-password-not-view::before{content:"\F038"}.van-icon-password-view::before{content:"\F039"}.van-icon-pause::before{content:"\F03A"}.van-icon-peer-pay::before{content:"\F03B"}.van-icon-pending-deliver::before{content:"\F03C"}.van-icon-pending-evaluate::before{content:"\F03D"}.van-icon-pending-orders::before{content:"\F03E"}.van-icon-pending-payment::before{content:"\F03F"}.van-icon-phone::before{content:"\F040"}.van-icon-photo::before{content:"\F041"}.van-icon-photograph::before{content:"\F042"}.van-icon-play::before{content:"\F043"}.van-icon-point-gift::before{content:"\F044"}.van-icon-points-mall::before{content:"\F045"}.van-icon-points::before{content:"\F046"}.van-icon-qr-invalid::before{content:"\F047"}.van-icon-qr::before{content:"\F048"}.van-icon-question::before{content:"\F049"}.van-icon-receive-gift::before{content:"\F04A"}.van-icon-records::before{content:"\F04B"}.van-icon-search::before{content:"\F04C"}.van-icon-send-gift::before{content:"\F04D"}.van-icon-setting::before{content:"\F04E"}.van-icon-share::before{content:"\F04F"}.van-icon-shop-collect::before{content:"\F050"}.van-icon-shop::before{content:"\F051"}.van-icon-shopping-cart::before{content:"\F052"}.van-icon-sign::before{content:"\F053"}.van-icon-stop::before{content:"\F054"}.van-icon-success::before{content:"\F055"}.van-icon-tosend::before{content:"\F056"}.van-icon-underway::before{content:"\F057"}.van-icon-upgrade::before{content:"\F058"}.van-icon-value-card::before{content:"\F059"}.van-icon-wap-home::before{content:"\F05A"}.van-icon-wap-nav::before{content:"\F05B"}.van-icon-warn::before{content:"\F05C"}.van-icon-wechat::before{content:"\F05D"} \ No newline at end of file +@import '../common/index.wxss';@font-face{font-style:normal;font-weight:400;font-family:vant-icon;src:url(https://img.yzcdn.cn/vant/vant-icon-82b481.ttf) format('truetype')}.van-icon{position:relative;display:inline-block;font:normal normal normal 14px/1 vant-icon;font-size:inherit;text-rendering:auto}.van-icon__info{color:#fff;left:100%;top:-.5em;font-size:.6em;padding:0 .25em;text-align:center;min-width:1.4em;line-height:1.4;position:absolute;border-radius:.6em;box-sizing:border-box;background-color:#f44;-webkit-transform:translateX(-50%);transform:translateX(-50%);font-family:PingFang SC,Helvetica Neue,Arial,sans-serif}.van-icon::before{display:inline-block}.van-icon-add-o::before{content:"\F000"}.van-icon-add::before{content:"\F001"}.van-icon-add2::before{content:"\F002"}.van-icon-after-sale::before{content:"\F003"}.van-icon-aim::before{content:"\F004"}.van-icon-alipay::before{content:"\F005"}.van-icon-arrow-left::before{content:"\F006"}.van-icon-arrow::before{content:"\F007"}.van-icon-balance-pay::before{content:"\F008"}.van-icon-browsing-history::before{content:"\F009"}.van-icon-card::before{content:"\F00A"}.van-icon-cart-o::before{content:"\F00B"}.van-icon-cart::before{content:"\F00C"}.van-icon-cash-back-record::before{content:"\F00D"}.van-icon-cash-on-deliver::before{content:"\F00E"}.van-icon-certificate::before{content:"\F00F"}.van-icon-chat::before{content:"\F010"}.van-icon-check::before{content:"\F011"}.van-icon-checked::before{content:"\F012"}.van-icon-clear::before{content:"\F013"}.van-icon-clock::before{content:"\F014"}.van-icon-close::before{content:"\F015"}.van-icon-completed::before{content:"\F016"}.van-icon-contact::before{content:"\F017"}.van-icon-coupon::before{content:"\F018"}.van-icon-credit-pay::before{content:"\F019"}.van-icon-debit-pay::before{content:"\F01A"}.van-icon-delete::before{content:"\F01B"}.van-icon-description::before{content:"\F01C"}.van-icon-discount::before{content:"\F01D"}.van-icon-ecard-pay::before{content:"\F01E"}.van-icon-edit-data::before{content:"\F01F"}.van-icon-edit::before{content:"\F020"}.van-icon-exchange-record::before{content:"\F021"}.van-icon-exchange::before{content:"\F022"}.van-icon-fail::before{content:"\F023"}.van-icon-free-postage::before{content:"\F024"}.van-icon-gift-card-pay::before{content:"\F025"}.van-icon-gift-card::before{content:"\F026"}.van-icon-gift::before{content:"\F027"}.van-icon-gold-coin::before{content:"\F028"}.van-icon-goods-collect::before{content:"\F029"}.van-icon-home::before{content:"\F02A"}.van-icon-hot-sale::before{content:"\F02B"}.van-icon-hot::before{content:"\F02C"}.van-icon-idcard::before{content:"\F02D"}.van-icon-info-o::before{content:"\F02E"}.van-icon-like-o::before{content:"\F02F"}.van-icon-like::before{content:"\F030"}.van-icon-location::before{content:"\F031"}.van-icon-logistics::before{content:"\F032"}.van-icon-more-o::before{content:"\F033"}.van-icon-more::before{content:"\F034"}.van-icon-new-arrival::before{content:"\F035"}.van-icon-new::before{content:"\F036"}.van-icon-other-pay::before{content:"\F037"}.van-icon-passed::before{content:"\F038"}.van-icon-password-not-view::before{content:"\F039"}.van-icon-password-view::before{content:"\F03A"}.van-icon-pause::before{content:"\F03B"}.van-icon-peer-pay::before{content:"\F03C"}.van-icon-pending-deliver::before{content:"\F03D"}.van-icon-pending-evaluate::before{content:"\F03E"}.van-icon-pending-orders::before{content:"\F03F"}.van-icon-pending-payment::before{content:"\F040"}.van-icon-phone::before{content:"\F041"}.van-icon-photo::before{content:"\F042"}.van-icon-photograph::before{content:"\F043"}.van-icon-play::before{content:"\F044"}.van-icon-point-gift::before{content:"\F045"}.van-icon-points-mall::before{content:"\F046"}.van-icon-points::before{content:"\F047"}.van-icon-qr-invalid::before{content:"\F048"}.van-icon-qr::before{content:"\F049"}.van-icon-question::before{content:"\F04A"}.van-icon-receive-gift::before{content:"\F04B"}.van-icon-records::before{content:"\F04C"}.van-icon-search::before{content:"\F04D"}.van-icon-send-gift::before{content:"\F04E"}.van-icon-setting::before{content:"\F04F"}.van-icon-share::before{content:"\F050"}.van-icon-shop-collect::before{content:"\F051"}.van-icon-shop::before{content:"\F052"}.van-icon-shopping-cart::before{content:"\F053"}.van-icon-sign::before{content:"\F054"}.van-icon-stop::before{content:"\F055"}.van-icon-success::before{content:"\F056"}.van-icon-tosend::before{content:"\F057"}.van-icon-underway::before{content:"\F058"}.van-icon-upgrade::before{content:"\F059"}.van-icon-value-card::before{content:"\F05A"}.van-icon-wap-home::before{content:"\F05B"}.van-icon-wap-nav::before{content:"\F05C"}.van-icon-warn::before{content:"\F05D"}.van-icon-wechat::before{content:"\F05E"} \ No newline at end of file diff --git a/dist/notify/index.wxml b/dist/notify/index.wxml index 19cf17e5..e55f859f 100644 --- a/dist/notify/index.wxml +++ b/dist/notify/index.wxml @@ -2,7 +2,7 @@ name="slide-down" show="{{ show }}" custom-class="van-notify" - custom-style="background-color:{{ backgroundColor }}" + custom-style="background-color:{{ backgroundColor }}; color: {{ color }}" > {{ text }} diff --git a/dist/search/index.js b/dist/search/index.js index ea774eee..b1814461 100644 --- a/dist/search/index.js +++ b/dist/search/index.js @@ -9,6 +9,7 @@ VantComponent({ showAction: Boolean, useActionSlot: Boolean, placeholder: String, + placeholderStyle: String, background: { type: String, value: '#f2f2f2' diff --git a/dist/search/index.wxml b/dist/search/index.wxml index 1a3bc847..8af8fcac 100644 --- a/dist/search/index.wxml +++ b/dist/search/index.wxml @@ -15,6 +15,7 @@ readonly="{{ readony }}" maxlength="{{ maxlength }}" placeholder="{{ placeholder }}" + placeholder-style="{{ placeholderStyle }}" custom-style="padding: 3px 10px" bind:blur="onBlur" bind:focus="onFocus" diff --git a/dist/tag/index.js b/dist/tag/index.js index a130471c..04ead9ac 100644 --- a/dist/tag/index.js +++ b/dist/tag/index.js @@ -1,8 +1,34 @@ import { VantComponent } from '../common/component'; +var DEFAULT_COLOR = '#999'; +var COLOR_MAP = { + danger: '#f44', + primary: '#38f', + success: '#06bf04' +}; VantComponent({ props: { + size: String, type: String, mark: Boolean, - plain: Boolean + color: String, + plain: Boolean, + round: Boolean + }, + computed: { + classes: function classes() { + var data = this.data; + return this.classNames('van-tag', 'custom-class', { + 'van-tag--mark': data.mark, + 'van-tag--plain': data.plain, + 'van-tag--round': data.round, + ["van-tag--" + data.size]: data.size, + 'van-hairline--surround': data.plain + }); + }, + style: function style() { + var color = this.data.color || COLOR_MAP[this.data.type] || DEFAULT_COLOR; + var key = this.data.plain ? 'color' : 'background-color'; + return key + ": " + color; + } } }); \ No newline at end of file diff --git a/dist/tag/index.wxml b/dist/tag/index.wxml index e8cef802..5a7a009f 100644 --- a/dist/tag/index.wxml +++ b/dist/tag/index.wxml @@ -1,5 +1,3 @@ - + diff --git a/dist/tag/index.wxss b/dist/tag/index.wxss index 8587c3f4..17d1eded 100644 --- a/dist/tag/index.wxss +++ b/dist/tag/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss';.van-tag{display:inline-block;padding:2px 5px;line-height:normal;border-radius:3px;font-size:10px;background:#c9c9c9;color:#fff}.van-tag::after{border-color:currentColor;border-radius:4px}.van-tag--mark{padding-right:7px;border-radius:0 8px 8px 0}.van-tag--mark::after{border-radius:0 16px 16px 0}.van-tag--success{background:#06bf04}.van-tag--success.van-tag--plain{color:#06bf04}.van-tag--danger{background:#f44}.van-tag--danger.van-tag--plain{color:#f44}.van-tag--primary{background:#38f}.van-tag--primary.van-tag--plain{color:#38f}.van-tag--plain{background:#fff;color:#c9c9c9} \ No newline at end of file +@import '../common/index.wxss';.van-tag{color:#fff;font-size:10px;padding:.2em .5em;line-height:normal;border-radius:.2em;display:inline-block}.van-tag::after{border-color:currentColor;border-radius:.4em}.van-tag--mark{padding-right:.6em;border-radius:0 .8em .8em 0}.van-tag--mark::after{border-radius:0 1.6em 1.6em 0}.van-tag--round{border-radius:.8em}.van-tag--round::after{border-radius:1.6em}.van-tag--medium{font-size:12px}.van-tag--large{font-size:14px} \ No newline at end of file