[improvement] Coupon: update cell value color (#2359)

This commit is contained in:
neverland 2018-12-22 11:25:27 +08:00 committed by GitHub
parent 92ebce4462
commit a843cf79c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 1 deletions

View File

@ -5,6 +5,7 @@
:value="value" :value="value"
:border="border" :border="border"
:is-link="editable" :is-link="editable"
:value-class="valueClass"
@click="$emit('click')" @click="$emit('click')"
/> />
</template> </template>
@ -49,6 +50,10 @@ export default create({
return `-${this.currency}${(value / 100).toFixed(2)}`; return `-${this.currency}${(value / 100).toFixed(2)}`;
} }
return coupons.length === 0 ? this.$t('tips') : this.$t('count', coupons.length); return coupons.length === 0 ? this.$t('tips') : this.$t('count', coupons.length);
},
valueClass() {
return this.coupons[this.chosenCoupon] ? 'van-coupon-cell--selected' : '';
} }
} }
}); });

View File

@ -2,6 +2,10 @@
@import '../style/mixins/ellipsis'; @import '../style/mixins/ellipsis';
.van-coupon { .van-coupon {
&-cell--selected {
color: @text-color;
}
&-list { &-list {
height: 100%; height: 100%;
position: relative; position: relative;

View File

@ -18,7 +18,7 @@ exports[`coupon cell 2`] = `
<div class="van-cell__title"><span>优惠券</span> <div class="van-cell__title"><span>优惠券</span>
<!----> <!---->
</div> </div>
<div class="van-cell__value"><span>-¥1.00</span></div> <i class="van-icon van-icon-arrow van-cell__right-icon"> <div class="van-cell__value van-coupon-cell--selected"><span>-¥1.00</span></div> <i class="van-icon van-icon-arrow van-cell__right-icon">
<!----> <!---->
<!----></i> <!----></i>
</div> </div>