refactor: 替换多页面国际化文本为硬编码中文内容
移除项目内大部分$lang()国际化调用,替换为直接中文文本,统一前端展示文案
This commit is contained in:
@@ -19,27 +19,27 @@
|
||||
<block v-if="type == 'point'">
|
||||
<block v-if="goodsDetail.type == 1">
|
||||
<view class="price-wrap">
|
||||
<text class="price price-color font-size-toolbar">{{ goodsDetail.point }}{{ $lang('sku.point') }}</text>
|
||||
<text class="price price-color font-size-toolbar">{{ goodsDetail.point }}积分</text>
|
||||
<block v-if="goodsDetail.exchange_price != '0.00' && goodsDetail.pay_type > 0">
|
||||
<text class="unit price-color font-size-tag">+</text>
|
||||
<text class="price price-color font-size-toolbar price-font">{{ $lang('common.currencySymbol') }}{{ goodsDetail.exchange_price }}</text>
|
||||
</block>
|
||||
</view>
|
||||
<view class="stock" v-if="goodsDetail.stock_show">
|
||||
{{ $lang('sku.stock') }}{{ goodsDetail.stock }}{{ goodsDetail.unit }}</view>
|
||||
库存{{ goodsDetail.stock }}{{ goodsDetail.unit }}</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="price-wrap">
|
||||
<view class="price font-size-toolbar">{{ goodsDetail.name }}</view>
|
||||
</view>
|
||||
<view class="stock" style="height: auto;">
|
||||
{{ $lang('sku.point') }}:
|
||||
<text class="price-color">{{ goodsDetail.point }}</text>
|
||||
</view>
|
||||
<view class="stock">
|
||||
{{ $lang('sku.stock') }}:
|
||||
<text class="color-base-text">{{ goodsDetail.stock }}{{ goodsDetail.unit }}</text>
|
||||
</view>
|
||||
积分:
|
||||
<text class="price-color">{{ goodsDetail.point }}</text>
|
||||
</view>
|
||||
<view class="stock">
|
||||
库存:
|
||||
<text class="color-base-text">{{ goodsDetail.stock }}{{ goodsDetail.unit }}</text>
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
<block v-else-if="type == 'presale'">
|
||||
@@ -48,14 +48,14 @@
|
||||
<text class="price price-style large">{{ parseFloat(goodsDetail.presale_deposit).toFixed(2).split('.')[0] }}</text>
|
||||
<text class="unit price-style small">.{{ parseFloat(goodsDetail.presale_deposit).toFixed(2).split('.')[1] }}</text>
|
||||
<view class="balance" v-if="balance > 0">
|
||||
<text>{{ $lang('sku.tailPayment') }}</text>
|
||||
<text>尾款</text>
|
||||
<text class="unit price-color font-size-tag price-font">¥</text>
|
||||
<text class="price-color price-font">{{ balance }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="stock presale-stock">
|
||||
<block v-if="goodsDetail.stock_show">{{ $lang('sku.stock') }}{{ goodsDetail.stock }}{{ goodsDetail.unit }}
|
||||
</block>
|
||||
<block v-if="goodsDetail.stock_show">库存{{ goodsDetail.stock }}{{ goodsDetail.unit }}
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
@@ -117,11 +117,11 @@
|
||||
<text class="unit price-style small" v-else>.{{ parseFloat(goodsDetail.price).toFixed(2).split('.')[1] }}</text>
|
||||
</block>
|
||||
</view>
|
||||
<view class="stock" v-if="goodsDetail.stock_show">{{ $lang('sku.stock') }}{{ goodsDetail.stock }}{{ goodsDetail.unit }}</view>
|
||||
<view class="stock" v-if="goodsDetail.stock_show">库存{{ goodsDetail.stock }}{{ goodsDetail.unit }}</view>
|
||||
</block>
|
||||
|
||||
<view class="sku-name font-size-tag" v-if="goodsDetail.sku_spec_format">
|
||||
<text class="color-tip">{{ $lang('sku.selectedSpec') }}</text>
|
||||
<text class="color-tip">已选规格:</text>
|
||||
<text v-for="(item, index) in goodsDetail.sku_spec_format" :key="index" class="spec-value">{{ item.spec_value_name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -135,13 +135,13 @@
|
||||
<view class="sku-list-wrap" v-if="type == 'pintuan' && goodsDetail.pintuan_type == 'ladder' && !goodsDetail.group_id">
|
||||
<text class="title font-size-base"> </text>
|
||||
<view class="items" :class="{ selected: pintuan_num_field == 'pintuan_num' }" @click="pintuanChange('pintuan_num')">
|
||||
<text>{{ goodsDetail.pintuan_num }}{{ $lang('sku.personTeam') }}</text>
|
||||
<text>{{ goodsDetail.pintuan_num }}人团</text>
|
||||
</view>
|
||||
<view class="items" v-if="goodsDetail.pintuan_num_2 > 0" :class="{ selected: pintuan_num_field == 'pintuan_num_2' }" @click="pintuanChange('pintuan_num_2')">
|
||||
<text>{{ goodsDetail.pintuan_num_2 }}{{ $lang('sku.personTeam') }}</text>
|
||||
<text>{{ goodsDetail.pintuan_num_2 }}人团</text>
|
||||
</view>
|
||||
<view class="items" v-if="goodsDetail.pintuan_num_3 > 0" :class="{ selected: pintuan_num_field == 'pintuan_num_3' }" @click="pintuanChange('pintuan_num_3')">
|
||||
<text>{{ goodsDetail.pintuan_num_3 }}{{ $lang('sku.personTeam') }}</text>
|
||||
<text>{{ goodsDetail.pintuan_num_3 }}人团</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -158,14 +158,14 @@
|
||||
|
||||
<view class="number-wrap">
|
||||
<view class="number-line">
|
||||
<text class="title font-size-base" v-if="type == 'point'">{{ $lang('sku.exchangeQuantity') }}</text>
|
||||
<text class="title font-size-base" v-else>{{ $lang('sku.buyQuantity') }}</text>
|
||||
<text class="limit-txt color-base-text" v-if="limitNumber > 0">({{ $lang('sku.perPersonLimit') }}{{ limitNumber }}{{ goodsDetail.unit }})</text>
|
||||
<text class="title font-size-base" v-if="type == 'point'">兑换数量</text>
|
||||
<text class="title font-size-base" v-else>购买数量</text>
|
||||
<text class="limit-txt color-base-text" v-if="limitNumber > 0">(每人限购{{ limitNumber }}{{ goodsDetail.unit }})</text>
|
||||
<text v-if="maxBuy > 0 && minBuy > 1" class="limit-txt color-base-text">
|
||||
({{ minBuy }}{{ goodsDetail.unit }}{{ $lang('sku.startSale') }},{{ $lang('sku.limit') }}{{ maxBuy }}{{ goodsDetail.unit }})
|
||||
({{ minBuy }}{{ goodsDetail.unit }}起售,限购{{ maxBuy }}{{ goodsDetail.unit }})
|
||||
</text>
|
||||
<text v-else-if="maxBuy > 0" class="limit-txt color-base-text">({{ $lang('sku.limit') }}{{ maxBuy }}{{ goodsDetail.unit }})</text>
|
||||
<text v-else-if="minBuy > 1" class="limit-txt color-base-text">({{ minBuy }}{{ goodsDetail.unit }}{{ $lang('sku.startSale') }})</text>
|
||||
<text v-else-if="maxBuy > 0" class="limit-txt color-base-text">(限购{{ maxBuy }}{{ goodsDetail.unit }})</text>
|
||||
<text v-else-if="minBuy > 1" class="limit-txt color-base-text">({{ minBuy }}{{ goodsDetail.unit }}起售)</text>
|
||||
<view class="number">
|
||||
<button type="default" class="decrease color-line-border" :class="{ disabled: decreaseDisabled }" @click="changeNum('-')">-</button>
|
||||
<input type="number" class="uni-input color-line-border font-size-goods-tag" @blur="blur" v-model="number" placeholder="0" @input="keyInput(false)" />
|
||||
@@ -178,34 +178,34 @@
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="footer" @click="confirm()">
|
||||
<button type="primary" v-if="goodsDetail.stock && goodsDetail.stock != 0 && goodsDetail.is_virtual == 0 && type == 'buy_now'" :style="{ background: themeStyle.goods_detail.goods_btn_color_shallow, color : '#fff' }" @click.stop="confirm(true)">{{ $lang('sku.addToCart') }}</button>
|
||||
<button type="primary" v-if="goodsDetail.stock && goodsDetail.stock != 0 && goodsDetail.is_virtual == 0 && type == 'buy_now'" :style="{ background: themeStyle.goods_detail.goods_btn_color_shallow, color : '#fff' }" @click.stop="confirm(true)">加入购物车</button>
|
||||
<block v-if="type == 'point'">
|
||||
<block v-if="goodsDetail.type == 1">
|
||||
<!-- 兑换商品 -->
|
||||
<button v-if="goodsDetail.stock && goodsDetail.stock != 0" type="primary">{{ $lang('sku.exchange') }}</button>
|
||||
<button type="primary" v-else disabled="true">{{ $lang('sku.stockInsufficient') }}</button>
|
||||
<button v-if="goodsDetail.stock && goodsDetail.stock != 0" type="primary">兑换</button>
|
||||
<button type="primary" v-else disabled="true">库存不足</button>
|
||||
</block>
|
||||
<block v-else-if="goodsDetail.type == 2 || goodsDetail.type == 3">
|
||||
<!-- 兑换优惠券、红包 -->
|
||||
<button type="primary">{{ $lang('sku.exchange') }}</button>
|
||||
<button type="primary">兑换</button>
|
||||
</block>
|
||||
</block>
|
||||
<block v-else-if="goodsDetail.goods_state == 1">
|
||||
<button type="primary" v-if="goodsDetail.stock && goodsDetail.stock != 0 && type == 'join_cart'">{{ $lang('sku.addToCart') }}</button>
|
||||
<button type="primary" v-else-if="goodsDetail.stock && goodsDetail.stock != 0 && type == 'buy_now'">{{ $lang('sku.buyNow') }}</button>
|
||||
<button type="primary" v-else-if="goodsDetail.stock && goodsDetail.stock != 0 && type == 'confirm'">{{ $lang('sku.confirm') }}</button>
|
||||
<button type="primary" v-if="goodsDetail.stock && goodsDetail.stock != 0 && type == 'join_cart'">加入购物车</button>
|
||||
<button type="primary" v-else-if="goodsDetail.stock && goodsDetail.stock != 0 && type == 'buy_now'">立即购买</button>
|
||||
<button type="primary" v-else-if="goodsDetail.stock && goodsDetail.stock != 0 && type == 'confirm'">确认</button>
|
||||
<template v-else-if="goodsDetail.stock && goodsDetail.stock != 0">
|
||||
<template v-if="goodsDetail.buy_num">
|
||||
<button type="primary" v-if="goodsDetail.buy_num <= goodsDetail.stock">{{ $lang('sku.snatchNow') }}</button>
|
||||
<button type="primary" v-else disabled="true">{{ $lang('sku.stockInsufficient') }}</button>
|
||||
<button type="primary" v-if="goodsDetail.buy_num <= goodsDetail.stock">立即抢购</button>
|
||||
<button type="primary" v-else disabled="true">库存不足</button>
|
||||
</template>
|
||||
<template v-else>
|
||||
<button type="primary">{{ $lang('sku.snatchNow') }}</button>
|
||||
<button type="primary">立即抢购</button>
|
||||
</template>
|
||||
</template>
|
||||
<button type="primary" v-else disabled="true">{{ $lang('sku.stockInsufficient') }}</button>
|
||||
<button type="primary" v-else disabled="true">库存不足</button>
|
||||
</block>
|
||||
<button type="primary" v-else disabled="true">{{ $lang('sku.productRemoved') }}</button>
|
||||
<button type="primary" v-else disabled="true">该商品已下架</button>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup-sku>
|
||||
@@ -707,7 +707,7 @@
|
||||
if (this.$util.inArray(this.skuId + '', this.goodsDetail.activity_sku_ids) == -1) {
|
||||
this.confirmDisabled = true;
|
||||
this.$util.showToast({
|
||||
title: this.$lang('sku.specNotInCombo')
|
||||
title: '该规格未参与打包一口价活动'
|
||||
});
|
||||
} else {
|
||||
this.confirmDisabled = false;
|
||||
@@ -771,7 +771,7 @@
|
||||
if (this.$util.inArray(skuId + '', this.goodsDetail.activity_sku_ids) == -1) {
|
||||
this.confirmDisabled = true;
|
||||
this.$util.showToast({
|
||||
title: this.$lang('sku.specNotInCombo')
|
||||
title: '该规格未参与打包一口价活动'
|
||||
});
|
||||
} else {
|
||||
this.confirmDisabled = false;
|
||||
@@ -850,7 +850,7 @@
|
||||
} else {
|
||||
if (this.number >= this.goodsDetail.stock) {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('sku.stockInsufficient')
|
||||
title: '库存不足'
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -858,13 +858,13 @@
|
||||
if (this.goodsDetail.is_limit == 1 && this.maxBuy > 0) {
|
||||
if (this.goodsDetail.limit_type == 1) {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('sku.maxBuyPerOrder') + this.maxBuy + this.goodsDetail.unit
|
||||
title: '该商品每次最多购买' + this.maxBuy + this.goodsDetail.unit
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.goodsDetail.limit_type == 2) {
|
||||
let message = this.$lang('sku.maxBuyPerPerson') + this.maxBuy + this.goodsDetail.unit;
|
||||
let message = '该商品每人限购' + this.maxBuy + this.goodsDetail.unit;
|
||||
message += this.goodsDetail.purchased_num > 0 ? ',您已购买了' + this.goodsDetail.purchased_num + this.goodsDetail.unit : '';
|
||||
this.$util.showToast({
|
||||
title: message
|
||||
@@ -875,14 +875,14 @@
|
||||
|
||||
if (this.type == 'seckill' && this.goodsDetail.seckill_id && this.goodsDetail.num > 0) {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('sku.maxBuyPerPerson') + this.goodsDetail.num + this.goodsDetail.unit
|
||||
title: '该商品每人限购' + this.goodsDetail.num + this.goodsDetail.unit
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.type == 'presale' && this.goodsDetail.presale_id && this.goodsDetail.presale_num > 0) {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('sku.maxBuyPerPerson') + this.goodsDetail.presale_num + this.goodsDetail.unit
|
||||
title: '该商品每人限购' + this.goodsDetail.presale_num + this.goodsDetail.unit
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -894,7 +894,7 @@
|
||||
} else {
|
||||
if (this.minBuy > 1) {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('sku.minBuyStart') + this.minBuy + this.goodsDetail.unit + this.$lang('sku.startSale')
|
||||
title: '该商品' + this.minBuy + this.goodsDetail.unit + '起售'
|
||||
});
|
||||
}
|
||||
return;
|
||||
@@ -982,7 +982,7 @@
|
||||
uni.removeStorageSync('delivery');
|
||||
if (this.preview) {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('sku.previewCannotBuy')
|
||||
title: '预览商品无法购买'
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -997,42 +997,42 @@
|
||||
this.keyInput(true, () => {
|
||||
if (this.goodsDetail.stock == 0) {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('sku.productSoldOut')
|
||||
title: '商品已售罄'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.number.length == 0 || this.number <= 0) {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('sku.quantityMustBePositive')
|
||||
title: '购买数量不能小于等于0'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.goodsDetail.buy_num > this.goodsDetail.stock) {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('sku.stockLessThanMin')
|
||||
title: '库存小于最低购买数量'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.number > this.goodsDetail.stock) {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('sku.stockInsufficient')
|
||||
title: '库存不足'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.goodsDetail.is_limit == 1 && this.goodsDetail.limit_type == 1 && this.maxBuy > 0 && this.number > this.maxBuy) {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('sku.maxBuyPerOrder') + this.maxBuy + this.goodsDetail.unit
|
||||
title: '该商品每次最多购买' + this.maxBuy + this.goodsDetail.unit
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.goodsDetail.is_limit == 1 && this.goodsDetail.limit_type == 2 && this.maxBuy > 0 &&
|
||||
this.number + this.goodsDetail.purchased_num > this.maxBuy) {
|
||||
let message = this.$lang('sku.maxBuyPerPerson') + this.maxBuy + this.goodsDetail.unit;
|
||||
let message = '该商品每人限购' + this.maxBuy + this.goodsDetail.unit;
|
||||
message += this.goodsDetail.purchased_num > 0 ? ',您已购买了' + this.goodsDetail.purchased_num + this.goodsDetail.unit : '';
|
||||
this.$util.showToast({
|
||||
title: message
|
||||
@@ -1042,7 +1042,7 @@
|
||||
|
||||
if ((this.type == 'join_cart' || isJoinCartBtn) && this.goodsDetail.is_limit == 1 && this.maxBuy > 0 && this.cartNum + this.number > this.maxBuy) {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('sku.maxBuyPerPerson') + this.maxBuy + this.goodsDetail.unit
|
||||
title: '该商品每人限购' + this.maxBuy + this.goodsDetail.unit
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -1070,7 +1070,7 @@
|
||||
var data = res.data;
|
||||
if (data > 0) {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('sku.addToCartSuccess')
|
||||
title: '加入购物车成功'
|
||||
});
|
||||
this.cartNum += this.number;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user