diff --git a/packages/address-edit/Detail.js b/packages/address-edit/Detail.js index a5e1a0c2a..243a56900 100644 --- a/packages/address-edit/Detail.js +++ b/packages/address-edit/Detail.js @@ -19,41 +19,43 @@ export default sfc({ onSelect(express) { this.$emit('select-search', express); this.$emit('input', `${express.address || ''} ${express.name || ''}`.trim()); + }, + + onFinish() { + this.$refs.field.blur(); + }, + + renderFinish() { + const showFinish = this.value && this.focused && android; + if (showFinish) { + return ( +
+ {t('complete')} +
+ ); + } + }, + + renderSearchResult() { + const showSearchList = this.focused && this.searchResult && this.showSearchResult; + if (showSearchList) { + return this.searchResult.map(express => ( + { + this.onSelect(express); + }} + /> + )); + } } }, render(h) { - const { value, focused, searchResult } = this; - - const Finish = value && focused && android && ( -
{ - this.$refs.field.blur(); - }} - > - {t('complete')} -
- ); - - const SearchList = - focused && - searchResult && - this.showSearchResult && - searchResult.map(express => ( - { - this.onSelect(express); - }} - /> - )); - return ( - {Finish} - - {SearchList} + /> + {this.renderSearchResult()} ); } diff --git a/packages/address-list/Item.js b/packages/address-list/Item.js index 3823997bf..74d459f67 100644 --- a/packages/address-list/Item.js +++ b/packages/address-list/Item.js @@ -17,33 +17,41 @@ export default sfc({ if (this.switchable) { this.$emit('select'); } + }, + + onClickRightIcon(event) { + event.stopPropagation(); + this.$emit('edit'); + }, + + renderRightIcon() { + return ; + }, + + renderContent() { + const { data } = this; + const Info = [ +
{`${data.name},${data.tel}`}
, +
{data.address}
+ ]; + + return this.disabled ? Info : {Info}; } }, render(h) { - const { data, disabled, switchable } = this; - const Info = [ -
{`${data.name},${data.tel}`}
, -
{data.address}
- ]; + const { disabled, switchable } = this; return ( - {disabled ? Info : {Info}} - { - event.stopPropagation(); - this.$emit('edit'); - }} - /> - + /> ); } }); diff --git a/packages/contact-list/index.js b/packages/contact-list/index.js index 3b5ecaed7..c0f3b4e5e 100644 --- a/packages/contact-list/index.js +++ b/packages/contact-list/index.js @@ -23,24 +23,28 @@ export default sfc({ ( + +
{`${item.name},${item.tel}`}
+
+ ), + 'right-icon': () => ( + { + event.stopPropagation(); + listeners.edit && listeners.edit(item, index); + }} + /> + ) + }} onClick={() => { listeners.input && listeners.input(item.id); listeners.select && listeners.select(item, index); }} - > - -
{`${item.name},${item.tel}`}
-
- { - event.stopPropagation(); - listeners.edit && listeners.edit(item, index); - }} - /> -
+ /> )); return ( diff --git a/packages/coupon-list/index.js b/packages/coupon-list/index.js index 3ad734723..598f96fa8 100644 --- a/packages/coupon-list/index.js +++ b/packages/coupon-list/index.js @@ -123,6 +123,29 @@ export default sfc({ list.scrollTop = card[index].$el.offsetTop - 100; } }); + }, + + renderEmpty() { + return ( +
+ +

{t('empty')}

+
+ ); + }, + + renderExchangeButton() { + return ( +