[Improvement] Coupon i18n (#431)

This commit is contained in:
neverland
2017-12-14 10:46:26 +08:00
committed by GitHub
parent c6a37bba5b
commit 1d105afc70
10 changed files with 175 additions and 116 deletions
+3 -3
View File
@@ -1,6 +1,6 @@
<template>
<cell-group class="van-coupon-cell">
<cell :title="title || '优惠券码'" :value="value" :isLink="editable" @click="$emit('click')" />
<cell :title="title || $t('title')" :value="value" :isLink="editable" @click="$emit('click')" />
</cell-group>
</template>
@@ -42,9 +42,9 @@ export default create({
const { coupons } = this;
const coupon = coupons[this.chosenCoupon];
if (coupon) {
return `${(coupon.value / 100).toFixed(2)}`;
return `${this.$t('reduce')}${(coupon.value / 100).toFixed(2)}`;
}
return coupons.length === 0 ? '使用优惠' : `您有 ${coupons.length} 个可用优惠`;
return coupons.length === 0 ? this.$t('tips') : this.$t('count', coupons.length);
}
}
});