refactor: 将项目内硬编码文本替换为多语言调用

统一替换所有页面和组件中的硬编码字符串为 $lang 多语言方法调用,提升项目国际化适配能力
This commit is contained in:
2026-06-22 14:04:13 +08:00
parent 46508c7d55
commit 2337e3cacf
38 changed files with 505 additions and 511 deletions

View File

@@ -72,7 +72,7 @@
<text class="iconfont icon-right"></text>
</block>
<block v-else>
<view class="box">未配置</view>
<view class="box">{{ $lang('goods.notConfigured') }}</view>
</block>
</view>

View File

@@ -3,45 +3,45 @@
<view class="ns-goods-promotion" v-if="goodsPromotion.length">
<view v-for="(item, index) in goodsPromotion" v-if="promotion != item.promotion_type" :key="index">
<view v-if="item.promotion_type == 'discount'" class="item" @click="redirectTo('/pages_goods/detail', { goods_id: item.goods_id })">
<text class="promotion-mark ">限时折扣</text>
<text class="title">当前商品正在参加{{ item.promotion_name }}</text>
<text class="promotion-mark ">{{ $lang('promotion.limitedTimeDiscount') }}</text>
<text class="title">{{ $lang('promotion.participating', { name: item.promotion_name }) }}</text>
<text class="iconfont icon-right"></text>
<!-- <view class="img-wrap"><image :src="$util.img('public/uniapp/goods/detail_more.png')" mode="aspectFit" show-menu-by-longpress/></view> -->
</view>
<view v-else-if="item.promotion_type == 'groupbuy'" class="item" @click="redirectTo('/pages_promotion/groupbuy/detail', { groupbuy_id: item.groupbuy_id })">
<!-- <view v-else-if="item.promotion_type == 'groupbuy'" class="item" @click="redirectTo('/pages_promotion/groupbuy/detail', { id: item.groupbuy_id })"> -->
<text class="promotion-mark ">团购</text>
<text class="title">当前商品正在参加{{ item.promotion_name }}</text>
<text class="promotion-mark ">{{ $lang('promotion.groupbuy') }}</text>
<text class="title">{{ $lang('promotion.participating', { name: item.promotion_name }) }}</text>
<text class="iconfont icon-right"></text>
<!-- <view class="img-wrap"><image :src="$util.img('public/uniapp/goods/detail_more.png')" mode="aspectFit" show-menu-by-longpress/></view> -->
</view>
<view v-else-if="item.promotion_type == 'pintuan'" class="item" @click="redirectTo('/pages_promotion/pintuan/detail', { pintuan_id: item.pintuan_id })">
<text class="promotion-mark ">拼团</text>
<text class="title">当前商品正在参加{{ item.promotion_name }}</text>
<text class="promotion-mark ">{{ $lang('promotion.pintuan') }}</text>
<text class="title">{{ $lang('promotion.participating', { name: item.promotion_name }) }}</text>
<text class="iconfont icon-right"></text>
<!-- <view class="img-wrap"><image :src="$util.img('public/uniapp/goods/detail_more.png')" mode="aspectFit" show-menu-by-longpress/></view> -->
</view>
<view v-else-if="item.promotion_type == 'seckill'" class="item" @click="redirectTo('/pages_promotion/seckill/detail', { seckill_id: item.id })">
<text class="promotion-mark ">秒杀</text>
<text class="title">当前商品正在参加{{ item.promotion_name }}</text>
<text class="promotion-mark ">{{ $lang('promotion.seckill') }}</text>
<text class="title">{{ $lang('promotion.participating', { name: item.promotion_name }) }}</text>
<text class="iconfont icon-right"></text>
<!-- <view class="img-wrap"><image :src="$util.img('public/uniapp/goods/detail_more.png')" mode="aspectFit" show-menu-by-longpress/></view> -->
</view>
<view v-else-if="item.promotion_type == 'topic'" class="item" @click="redirectTo('/pages_promotion/topics/goods_detail', { id: item.id })">
<text class="promotion-mark ">专题活动</text>
<text class="title">当前商品正在参加{{ item.promotion_name }}</text>
<text class="promotion-mark ">{{ $lang('promotion.topicActivity') }}</text>
<text class="title">{{ $lang('promotion.participating', { name: item.promotion_name }) }}</text>
<text class="iconfont icon-right"></text>
<!-- <view class="img-wrap"><image :src="$util.img('public/uniapp/goods/detail_more.png')" mode="aspectFit" show-menu-by-longpress/></view> -->
</view>
<view v-else-if="item.promotion_type == 'bargain'" class="item" @click="redirectTo('/pages_promotion/bargain/detail', { b_id: item.bargain_id })">
<text class="promotion-mark ">砍价</text>
<text class="title">当前商品正在参加{{ item.promotion_name }}</text>
<text class="promotion-mark ">{{ $lang('promotion.bargain') }}</text>
<text class="title">{{ $lang('promotion.participating', { name: item.promotion_name }) }}</text>
<text class="iconfont icon-right"></text>
<!-- <view class="img-wrap"><image :src="$util.img('public/uniapp/goods/detail_more.png')" mode="aspectFit" show-menu-by-longpress/></view> -->
</view>
<view v-else-if="item.promotion_type == 'pinfan'" class="item" @click="redirectTo('/pages_promotion/pinfan/detail', { pinfan_id: item.pintuan_id })">
<text class="promotion-mark ">拼团返利</text>
<text class="title">当前商品正在参加{{ item.promotion_name }}</text>
<text class="promotion-mark ">{{ $lang('promotion.pinfan') }}</text>
<text class="title">{{ $lang('promotion.participating', { name: item.promotion_name }) }}</text>
<text class="iconfont icon-right"></text>
</view>
</view>