refactor(fenxiao,member): replace hardcoded strings with i18n translations

standardize all hardcoded text across分销 and member pages to use language packs, fix template syntax errors in level.vue, and unify text display logic
This commit is contained in:
2026-06-22 16:20:59 +08:00
parent d8705398bb
commit cb81aad784
9 changed files with 109 additions and 109 deletions

View File

@@ -207,7 +207,7 @@
async onShow() {
this.isIphoneX = this.$util.uniappIsIPhoneX();
if (this.fenxiaoWords && this.fenxiaoWords.fenxiao_name) this.$langConfig.title(this.fenxiaoWords.fenxiao_name + '申请');
if (this.fenxiaoWords && this.fenxiaoWords.fenxiao_name) this.$langConfig.title(this.fenxiaoWords.fenxiao_name + this.$lang('fenxiao.apply'));
if (this.storeToken) {
this.applyStatus();

View File

@@ -19,28 +19,28 @@
alt="" class="level-icon">{{ info.level_name }}</p>
</view>
<view class="recommend">{{ $lang('fenxiao.parentAgent') }}:{{ info.parent_name ? info.parent_name : $lang('fenxiao.mainStore') }}</view>
<view class="recommend">{{ $lang('fenxiao.invitedSuccess') }}:{{ teamNum.num }}人<text class="iconfont icon-right"
<view class="recommend">{{ $lang('fenxiao.invitedSuccess') }}:{{ teamNum.num }}{{ $lang('fenxiao.people') }}<text class="iconfont icon-right"
style="font-size: 24rpx;"></text></view>
</view>
<!-- <view class="promote-rules font-size-tag" @click="$util.redirectTo('/pages_promotion/fenxiao/promote')">
<text class="iconfont icon-wenhao font-size-tag"></text>
推广规则
{{ $lang('fenxiao.promoteRule') }}
</view> -->
</view>
<!-- <view class="fenxiao-level-wrap" v-if="levelList.length">
<image :src="$util.img('public/uniapp/fenxiao/index/level_icon.png')" mode="widthFix" class="level-icon"/>
<view class="level-wrap" @click="$util.redirectTo('/pages_promotion/fenxiao/level')">
<view class="title">{{ info.level_num > 0 ? info.level_name : '等级未解锁' }}</view>
<view class="desc">下单、邀请好友均可提升等级</view>
<view class="title">{{ info.level_num > 0 ? info.level_name : '{{ $lang('fenxiao.levelNotUnlock') }}' }}</view>
<view class="desc">{{ $lang('fenxiao.placeOrder') }}、{{ $lang('fenxiao.inviteFriendUpgrade') }}</view>
</view>
<view class="btn" @click="$refs.taskPopup.open()" v-if="info.condition.last_level">做任务</view>
<view class="btn" @click="$refs.taskPopup.open()" v-if="info.condition.last_level">{{ $lang('fenxiao.doTask') }}</view>
</view> -->
</view>
<view class="fenxiao-index-allmoney">
<view class="allmoney-top-money">
<view class="allmoney-top">
<view class="font-size-sub">可{{ fenxiaoWords.withdraw }}(元)</view>
<view class="font-size-sub">{{ $lang('fenxiao.can') }}{{ fenxiaoWords.withdraw }}({{ $lang('fenxiao.yuan') }})</view>
<view class="withdrawal-record"
@click="$util.redirectTo('/pages_promotion/fenxiao/withdraw_list')">
{{ $lang('fenxiao.withdrawalDetail') }}
@@ -52,22 +52,22 @@
<view class="allmoney-bottom">
<!-- <view class="allmoney-all-wrap" @click="$util.redirectTo('/pages_promotion/fenxiao/bill')">
<view class="title">总{{ fenxiaoWords.account }}</view>
<view class="title">{{ $lang('fenxiao.total') }}{{ fenxiaoWords.account }}</view>
<view class="money price-font">{{ info.total_commission | moneyFormat }}</view>
</view>
<view class="allmoney-all-wrap" @click="$util.redirectTo('/pages_promotion/fenxiao/withdraw_list')">
<view class="title">已提现{{ fenxiaoWords.account }}</view>
<view class="title">{{ $lang('fenxiao.withdrawnAmount') }}{{ fenxiaoWords.account }}</view>
<view class="money price-font">{{ info.account_withdraw | moneyFormat }}</view>
</view> -->
<view class="allmoney-all-wrap"
@click="$util.redirectTo('/pages_promotion/fenxiao/withdraw_list')">
<view class="title">{{ $lang('fenxiao.withdrawing') }}(元)<text class="iconfont icon-right"
<view class="title">{{ $lang('fenxiao.withdrawing') }}({{ $lang('fenxiao.yuan') }})<text class="iconfont icon-right"
style="font-size: 24rpx;"></text></view>
<view class="money price-font">{{ info.account_withdraw_apply | moneyFormat }}</view>
</view>
<view class="allmoney-all-wrap"
@click="$util.redirectTo('/pages_promotion/fenxiao/order', { type: 1 })">
<view class="title">{{ $lang('fenxiao.pendingEntry') }}(元)<text class="iconfont icon-right"
<view class="title">{{ $lang('fenxiao.pendingEntry') }}({{ $lang('fenxiao.yuan') }})<text class="iconfont icon-right"
style="font-size: 24rpx;"></text></view>
<view class="money price-font">{{ info.in_progress_money | moneyFormat }}</view>
</view>
@@ -82,7 +82,7 @@
style="width: 100%;border-radius:24rpx" show-menu-by-longpress/>
</view>
<!-- 功能列表 -->
<!-- {{ $lang('fenxiao.functionList') }} -->
<view class="fenxiao-menu-list">
<view class="menu-item" @click="$util.redirectTo('/pages_promotion/fenxiao/team')">
<view class="icon-wrap">
@@ -100,7 +100,7 @@
</image>
</view>
<view class="info">
<view class="title">{{ fenxiaoWords.withdraw }}明细</view>
<view class="title">{{ fenxiaoWords.withdraw }}{{ $lang('fenxiao.detail') }}</view>
<view class="desc">{{ $lang('fenxiao.totalCommission') }}¥{{ info.total_commission | moneyFormat }}
</view>
</view>
@@ -130,8 +130,8 @@
<image :src="$util.img('public/uniapp/fenxiao/index/code.png')" mode="widthFix" show-menu-by-longpress></image>
</view>
<view class="info">
<view class="title">邀请好友</view>
<view class="desc">邀好友赚好礼</view>
<view class="title">{{ $lang('fenxiao.inviteFriends') }}</view>
<view class="desc">{{ $lang('fenxiao.inviteFriendsGift') }}</view>
</view>
</view> -->
<!-- <view class="menu-item" @click="$util.redirectTo('/pages_promotion/fenxiao/bill')">
@@ -139,8 +139,8 @@
<image :src="$util.img('public/uniapp/fenxiao/index/bill.png')" mode="widthFix" show-menu-by-longpress></image>
</view>
<view class="info">
<view class="title">账单报表</view>
<view class="desc">{{ fenxiaoWords.account }}变更明细</view>
<view class="title">{{ $lang('fenxiao.billReport') }}</view>
<view class="desc">{{ $lang('fenxiao.accountChange') }}</view>
</view>
</view>
<view class="menu-item" @click="$util.redirectTo('/pages_promotion/fenxiao/goods_list', { templateId: templateId })">
@@ -148,8 +148,8 @@
<image :src="$util.img('public/uniapp/fenxiao/index/market.png')" mode="widthFix" show-menu-by-longpress></image>
</view>
<view class="info">
<view class="title">{{ fenxiaoWords.concept }}商品</view>
<view class="desc">{{ fenxiaoWords.concept }}商品</view>
<view class="title">{{ fenxiaoWords.concept }}{{ $lang('fenxiao.goods') }}</view>
<view class="desc">{{ fenxiaoWords.concept }}{{ $lang('fenxiao.goods') }}</view>
</view>
</view> -->
<!-- <view class="menu-item" @click="$util.redirectTo('/pages_promotion/fenxiao/ranking_list', { type: 'profit' })">
@@ -158,8 +158,8 @@
</image>
</view>
<view class="info">
<view class="title">{{ fenxiaoWords.account }}排行</view>
<view class="desc">您的排名为第{{ profitRanking }}位</view>
<view class="title">{{ fenxiaoWords.account }}{{ $lang('fenxiao.ranking') }}</view>
<view class="desc">{{ $lang('fenxiao.yourRank', { rank: profitRanking }) }}</view>
</view>
</view> -->
<!-- <view class="menu-item" @click="$util.redirectTo('/pages_promotion/fenxiao/ranking_list', { type: 'invited_num' })">
@@ -168,8 +168,8 @@
</image>
</view>
<view class="info">
<view class="title">推广人排行</view>
<view class="desc">您的排名为{{ invitedNumRanking }}位</view>
<view class="title">{{ $lang('fenxiao.promoteRankTitle') }}</view>
<view class="desc">{{ $lang('fenxiao.yourRank', { rank: invitedNumRanking }) }}</view>
</view>
</view> -->
<!-- <view class="menu-item" @click="$util.redirectTo('/pages_promotion/fenxiao/level')" v-if="levelList.length">
@@ -177,8 +177,8 @@
<image :src="$util.img('public/uniapp/fenxiao/index/team_reward.png')" mode="widthFix" show-menu-by-longpress></image>
</view>
<view class="info">
<view class="title">等级说明</view>
<view class="desc">{{ fenxiaoWords.concept }}等级说明</view>
<view class="title">{{ $lang('fenxiao.levelDesc') }}</view>
<view class="desc">{{ fenxiaoWords.concept }}{{ $lang('fenxiao.levelDesc') }}</view>
</view>
</view> -->
</view>
@@ -190,8 +190,8 @@
<image :src="$util.img('public/uniapp/fenxiao/index/down-line.png')" mode="aspectFill" show-menu-by-longpress></image>
</view>
<view class="all-money-tit-wrap">
<text class="all-money-tit">我的粉丝</text>
<text class="all-money-num">{{ teamNum.num }}人</text>
<text class="all-money-tit">{{ $lang('fenxiao.myFans') }}</text>
<text class="all-money-num">{{ teamNum.num }}{{ $lang('fenxiao.people') }}</text>
</view>
</view>
</view>
@@ -202,7 +202,7 @@
</view>
<view class="all-money-tit-wrap">
<text class="all-money-tit">{{ fenxiaoWords.fenxiao_name }}</text>
<text class="all-money-num">{{ teamNum.fenxiao_num }}人</text>
<text class="all-money-num">{{ teamNum.fenxiao_num }}{{ $lang('fenxiao.people') }}</text>
</view>
</view>
</view>
@@ -290,7 +290,7 @@ export default {
},
mixins: [fenxiaoWords],
onShow() {
if (this.fenxiaoWords && this.fenxiaoWords.concept) this.$langConfig.title(this.fenxiaoWords.concept + '中心');
if (this.fenxiaoWords && this.fenxiaoWords.concept) this.$langConfig.title(this.fenxiaoWords.concept + this.$lang('fenxiao.center'));
if (this.storeToken) {
this.checkFenxiaoIsStart();

View File

@@ -1,4 +1,4 @@
<template>
<template>
<view class="container" :style="themeColor">
<view class="level-top">
<image :src="$util.img('public/uniapp/level/level-top-bg.png')"></image>
@@ -218,7 +218,7 @@
}
},1000);
if (this.fenxiaoWords && this.fenxiaoWords.fenxiao_name) this.$langConfig.title(this.fenxiaoWords.fenxiao_name + '等级');
if (this.fenxiaoWords && this.fenxiaoWords.fenxiao_name) this.$langConfig.title(this.fenxiaoWords.fenxiao_name + '{{ $lang('fenxiao.level') }}');
if (this.storeToken) {
this.getFenxiaoInfo();
@@ -231,7 +231,7 @@
},
methods: {
/**
* 获取分销等级信息
* 获取分销{{ $lang('fenxiao.level') }}信息
*/
getFenxiaoLevel() {
this.$api.sendRequest({

View File

@@ -14,10 +14,10 @@
@click="toDetail(orderItem.fenxiao_order_id)">
<view class="order-header">
<text class="site-name font-size-base">{{ orderItem.order_no }}</text>
<text class="status-name color-base-text" v-if="orderItem.is_refund == 1">已退款</text>
<text class="status-name color-base-text" v-if="orderItem.is_refund == 1">{{ $lang('fenxiao.refunded') }}</text>
<text class="status-name color-text-green"
v-else-if="orderItem.is_settlement == 1">已结算</text>
<text class="status-name color-text-orange" v-else>待结算</text>
v-else-if="orderItem.is_settlement == 1">{{ $lang('fenxiao.settled') }}</text>
<text class="status-name color-text-orange" v-else>{{ $lang('fenxiao.pendingSettlement') }}</text>
</view>
<view class="order-body">
@@ -30,7 +30,7 @@
<view class="top-wrap">
<view class="goods-name font-size-base">{{ orderItem.sku_name }}</view>
<view>
<text class="color-tip">返{{ fenxiaoWords.account }}</text>
<text class="color-tip">{{ $lang('fenxiao.commission') }}</text>
<text class="price-color price-style small">{{
$lang('common.currencySymbol') }}</text>
<text class="price-color price-style large">{{
@@ -66,7 +66,7 @@
<text class="color-base-text">{{ $lang('common.currencySymbol') }}{{ orderItem.commission }}</text> -->
</view>
<view class="total">
<text>合计:</text>
<text>{{ $lang('fenxiao.total') }}:</text>
<text class="price-color">{{ $lang('common.currencySymbol') }}</text>
<text class="price-color font-size-toolbar">{{
parseFloat(orderItem.real_goods_money).toFixed(2).split(".")[0] }}</text>
@@ -78,13 +78,13 @@
</view>
</view>
<view class="cart-empty">
<ns-empty text="暂无订单" :isIndex="false"
<ns-empty :text="$lang('fenxiao.emptyOrder')" :isIndex="false"
v-if="selectId == 0 && orderList.length == 0 && emptyShow"></ns-empty>
<ns-empty text="暂无待结算订单" :isIndex="false"
<ns-empty :text="$lang('fenxiao.emptyPendingSettleOrder')" :isIndex="false"
v-if="selectId == 1 && orderList.length == 0 && emptyShow"></ns-empty>
<ns-empty text="暂无已结算订单" :isIndex="false"
<ns-empty :text="$lang('fenxiao.emptySettledOrder')" :isIndex="false"
v-if="selectId == 2 && orderList.length == 0 && emptyShow"></ns-empty>
<ns-empty text="暂无已退款订单" :isIndex="false"
<ns-empty :text="$lang('fenxiao.emptyRefundedOrder')" :isIndex="false"
v-if="selectId == 3 && orderList.length == 0 && emptyShow"></ns-empty>
</view>
</view>
@@ -108,22 +108,22 @@ export default {
category: [
{
id: 0,
name: '全部',
name: this.$lang('fenxiao.all'),
number: 2
},
{
id: 1,
name: '待结算',
name: this.$lang('fenxiao.pendingSettlement'),
number: 0
},
{
id: 2,
name: '已结算',
name: this.$lang('fenxiao.settled'),
number: 0
},
{
id: 3,
name: '已退款',
name: this.$lang('fenxiao.refunded'),
number: 0
}
],
@@ -142,7 +142,7 @@ export default {
setTimeout(() => {
if (!this.addonIsExist.fenxiao) {
this.$util.showToast({
title: '商家未开启分销',
title: this.$lang('fenxiao.merchantNotOpenFenxiao'),
mask: true,
duration: 2000
});
@@ -152,7 +152,7 @@ export default {
}
}, 1000);
if (this.fenxiaoWords && this.fenxiaoWords.concept) this.$langConfig.title(this.fenxiaoWords.concept + '订单');
if (this.fenxiaoWords && this.fenxiaoWords.concept) this.$langConfig.title(this.fenxiaoWords.concept + this.$lang('fenxiao.order'));
if (!this.storeToken) {
this.$nextTick(() => {

View File

@@ -1,14 +1,14 @@
<template>
<template>
<view :style="themeColor">
<view class="order-detail">
<view class="order-detail-box">
<view class="header">
<view class="title">
<text>共{{ orderData.num }}件商品</text>
<text>{{ $lang('fenxiao.totalItems', { num: orderData.num }) }}</text>
</view>
<text class="color-base-text font-size-tag" v-if="orderData.is_refund == 1">已退款</text>
<text class="color-base-text font-size-tag" v-else-if="orderData.is_settlement == 1">已结算</text>
<text class="color-base-text font-size-tag" v-else>待结算</text>
<text class="color-base-text font-size-tag" v-if="orderData.is_refund == 1">{{ $lang('fenxiao.refunded') }}</text>
<text class="color-base-text font-size-tag" v-else-if="orderData.is_settlement == 1">{{ $lang('fenxiao.settled') }}</text>
<text class="color-base-text font-size-tag" v-else>{{ $lang('fenxiao.pendingSettlement') }}</text>
</view>
<view class="detail-body">
<view class="detail-body-box">
@@ -37,27 +37,27 @@
<view class="detail-footer">
<text></text>
<text>
<text>合计:</text>
<text>{{ $lang('fenxiao.total') }}:</text>
<text class="price-color total">¥{{ orderData.real_goods_money }}</text>
</text>
</view>
</view>
<view class="order-detail-box commission">
<view class="header">
<view class="title color-base-bg-before"><text>返佣详情</text></view>
<view class="title color-base-bg-before"><text>{{ $lang('fenxiao.commissionDetail') }}</text></view>
<text class="color-base-text">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</text>
</view>
<view class="detail-content">
<view class="order-info-item">
<text class="tit">订单编号:</text>
<text class="tit">{{ $lang('fenxiao.orderNo') }}:</text>
<text>{{ orderData.order_no }}</text>
</view>
<view class="order-info-item">
<text class="tit">分佣层级:</text>
<text>{{ orderData.commission_level }}级</text>
<text class="tit">{{ $lang('fenxiao.commissionLevel') }}:</text>
<text>{{ orderData.commission_level }}$lang('fenxiao.level')</text>
</view>
<view class="order-info-item">
<text class="tit">返佣金额:</text>
<text class="tit">{{ $lang('fenxiao.commissionAmountDetail') }}:</text>
<text class="price-color font-size-toolbar">
<text class="font-size-goods-tag">¥</text>
{{ parseFloat(orderData.commission).toFixed(2).split(".")[0] }}
@@ -100,7 +100,7 @@ export default {
setTimeout( () => {
if (!this.addonIsExist.fenxiao) {
this.$util.showToast({
title: '商家未开启分销',
title: this.$lang('fenxiao.merchantNotOpenFenxiao'),
mask: true,
duration: 2000
});
@@ -133,7 +133,7 @@ export default {
this.orderData = res.data;
} else {
this.$util.showToast({
title: '未获取到订单信息!'
title: this.$lang('fenxiao.noOrderInfo')
});
setTimeout(() => {
this.$util.redirectTo('/pages_promotion/fenxiao/order', {}, 'redirectTo');

View File

@@ -10,16 +10,16 @@
<image class="money-bg" :src="$util.img('public/uniapp/fenxiao/promote/money.png')"
mode="aspectFill"></image>
<view class="content">
累计收益
{{ $lang('fenxiao.totalEarnings') }}
<text class="money-text">{{ detailData.total_commission }}</text>
元
{{ $lang('fenxiao.yuan') }}
</view>
</view>
</view>
<view class="earnings-body">
<view class="earnings-tab">
<text :class="{ active: tabIndex == 0 }" @click="tabCut(0)">已邀请好友</text>
<text :class="{ active: tabIndex == 1 }" @click="tabCut(1)">已下单好友</text>
<text :class="{ active: tabIndex == 0 }" @click="tabCut(0)">{{ $lang('fenxiao.invitedFriends') }}</text>
<text :class="{ active: tabIndex == 1 }" @click="tabCut(1)">{{ $lang('fenxiao.orderedFriends') }}</text>
</view>
<scroll-view scroll-y="true" class="earnings-content-wrap" @scrolltolower="getTeam()">
<view class="earnings-list" v-if="promote.list.length">
@@ -32,7 +32,7 @@
</view>
</view>
</view>
<view class="earnings-empty" v-else>暂无已邀请好友,快去邀请吧</view>
<view class="earnings-empty" v-else>{{ $lang('fenxiao.emptyInvite') }}</view>
</scroll-view>
</view>
</view>
@@ -41,9 +41,9 @@
mode="aspectFit" show-menu-by-longpress></image>
<view class="content" v-if="promoteContent.content"><rich-text
:nodes="promoteContent.content"></rich-text></view>
<view class="rules-empty" v-else>暂无活动规则</view>
<view class="rules-empty" v-else>{{ $lang('fenxiao.emptyActivityRules') }}</view>
</view>
<view class="active-btn"><button type="primary" @click="toPoster()">邀请好友</button></view>
<view class="active-btn"><button type="primary" @click="toPoster()">{{ $lang('fenxiao.inviteFriend') }}</button></view>
<ns-copyright></ns-copyright>
<ns-login ref="login"></ns-login>
<loading-cover ref="loadingCover"></loading-cover>
@@ -79,7 +79,7 @@ export default {
setTimeout(() => {
if (!this.addonIsExist.fenxiao) {
this.$util.showToast({
title: '商家未开启分销',
title: this.$lang('fenxiao.merchantNotOpenFenxiao'),
mask: true,
duration: 2000
});
@@ -384,7 +384,7 @@ export default {
border-radius: 50rpx;
color: #985400;
// P0: 推广页金色按钮 → var(--promote-grad-start/end)
// 兼容: 微信小程序 / 鸿蒙元服务 — linear-gradient 嵌套 var() 现代 runtime 支持
// 兼容: 微信小程序 / 鸿蒙{{ $lang('fenxiao.yuan') }}服务 — linear-gradient 嵌套 var() 现代 runtime 支持
background: #ffe2ac; // 兜底
background: linear-gradient(45deg, var(--promote-grad-start, #ffe2ac) 0%, var(--promote-grad-end, #fdc174) 100%);
}

View File

@@ -1,4 +1,4 @@
<template>
<template>
<view class="container" :style="themeColor">
<swiper class="swiper" @change="getIndex">
<swiper-item v-for="(item, index) in poster" :key="index">
@@ -11,22 +11,22 @@
</swiper>
<!-- #ifdef H5 -->
<view class="tips">长按识别图中二维码</view>
<view class="tips">{{ $lang('fenxiao.longPressQrTip') }}</view>
<!-- #endif -->
<!-- #ifdef MP -->
<view class="btn color-base-bg color-base-border" @click="save">保存海报</view>
<view class="btn color-base-bg color-base-border" @click="save">{{ $lang('fenxiao.saveImage') }}</view>
<!-- #endif -->
<uni-popup ref="popupDialog" :custom="true" :mask-click="false">
<view class="dialog-popup">
<view class="title">提示</view>
<view class="message">您拒绝了保存图片到相册的授权请求,无法保存图片到相册,如需正常使用,请授权之后再进行操作。</view>
<view class="title">{{ $lang('fenxiao.hint') }}</view>
<view class="message">{{ $lang('fenxiao.authDeniedTip') }}</view>
<view class="action-wrap">
<view @click="closeDialog">取消</view>
<view @click="closeDialog">{{ $lang('common.cancel') }}</view>
<view>
<button type="default" open-type="openSetting" @opensetting="closeDialog"
hover-class="none">立即授权</button>
hover-class="none">{{ $lang('fenxiao.authorizeNow') }}</button>
</view>
</view>
</view>
@@ -95,7 +95,7 @@ export default {
filePath: res.tempFilePath,
success: () => {
this.$util.showToast({
title: '保存成功'
title: this.$lang('fenxiao.saveSuccess')
});
},
fail: res => {
@@ -104,20 +104,20 @@ export default {
this.$refs.popupDialog.open();
} else {
this.$util.showToast({
title: '保存失败,请稍后重试'
title: this.$lang('fenxiao.saveFailed')
});
}
}
});
} else {
this.$util.showToast({
title: '下载失败'
title: this.$lang('fenxiao.downloadFailed')
});
}
},
fail: res => {
this.$util.showToast({
title: '下载失败'
title: this.$lang('fenxiao.downloadFailed')
});
}
});
@@ -136,7 +136,7 @@ export default {
});
} catch {
this.$util.showToast({
title: '海报生成失败'
title: this.$lang('fenxiao.posterGenerateFailed')
});
}
},
@@ -149,7 +149,7 @@ export default {
setTimeout(() => {
if (!this.addonIsExist.fenxiao) {
this.$util.showToast({
title: '商家未开启分销',
title: this.$lang('fenxiao.merchantNotOpenFenxiao'),
mask: true,
duration: 2000
});

View File

@@ -55,16 +55,16 @@ export default {
isIphoneX: false,
items: [{
value: '0',
name: '未知'
name: this.$lang('member.unknown')
},
{
value: '1',
name: '男',
name: this.$lang('member.male'),
checked: 'true'
},
{
value: '2',
name: '女'
name: this.$lang('member.female')
}
],
current: 0,
@@ -109,7 +109,7 @@ export default {
},
onHide() {
this.seconds = 120;
this.formData.mobileCodeText = '获取动态码';
this.formData.mobileCodeText = this.$lang('member.getDynamicCode');
this.isSend = false;
clearInterval(this.timer);
},
@@ -117,7 +117,7 @@ export default {
seconds(value) {
if (value == 0) {
this.seconds = 120;
this.formData.mobileCodeText = '获取动态码';
this.formData.mobileCodeText = this.$lang('member.getDynamicCode');
this.isSend = false;
clearInterval(this.timer);
}
@@ -154,7 +154,7 @@ export default {
}
},
setNavbarTitle() {
let title = '个人资料';
let title = this.$lang('member.personalInfo');
switch (this.indent) {
case 'name':
title = this.$lang('modifyNickname');
@@ -184,9 +184,9 @@ export default {
this.memberInfoformData.userHeadImg = this.memberInfo.headimg;
this.memberInfoformData.number = this.memberInfo.username; //账号
this.memberInfoformData.nickName = this.memberInfo.nickname; //昵称
this.memberInfoformData.realName = this.memberInfo.realname ? this.memberInfo.realname : '请输入真实姓名'; //真实姓名
this.memberInfoformData.sex = this.memberInfo.sex == 0 ? '未知' : this.memberInfo.sex == 1 ? '男' : '女'; //性别
this.memberInfoformData.birthday = this.memberInfo.birthday ? this.$util.timeStampTurnTime(this.memberInfo.birthday, 'YYYY-MM-DD') : '请选择生日'; //生日
this.memberInfoformData.realName = this.memberInfo.realname ? this.memberInfo.realname : this.$lang('member.inputRealName'); //真实姓名
this.memberInfoformData.sex = this.memberInfo.sex == 0 ? this.$lang('member.unknown') : this.memberInfo.sex == 1 ? this.$lang('member.male') : this.$lang('member.female'); //性别
this.memberInfoformData.birthday = this.memberInfo.birthday ? this.$util.timeStampTurnTime(this.memberInfo.birthday, 'YYYY-MM-DD') : this.$lang('member.selectBirthdayTip'); //生日
this.memberInfoformData.mobile = this.memberInfo.mobile; //手机号
this.formData.username = this.memberInfo.username; //用户名
@@ -401,14 +401,14 @@ export default {
modifyRealName() {
if (this.formData.realName == this.memberInfo.realname && this.memberInfo.realname) {
this.$util.showToast({
title: '与原真实姓名一致,无需修改'
title: this.$lang('member.sameAsOriginalName')
});
return;
}
var rule = [{
name: 'realName',
checkType: 'required',
errorMsg: '真实姓名不能为空'
errorMsg: this.$lang('member.realNameNotEmpty')
}];
if (!rule.length) return;
var checkRes = validate.check(this.formData, rule);
@@ -498,7 +498,7 @@ export default {
modifyBirthday() {
if (this.formData.birthday.length == 0) {
this.$util.showToast({
title: '请选择生日'
title: this.$lang('member.selectBirthdayTip')
});
return;
}
@@ -576,15 +576,15 @@ export default {
name: 'newPassword',
checkType: 'lengthMin',
checkRule: regConfig.pwd_len,
errorMsg: '新密码长度不能小于' + regConfig.pwd_len + '位'
errorMsg: this.$lang('member.newPasswordTooShort') + regConfig.pwd_len + this.$lang('member.digit')
});
}
if (regConfig.pwd_complexity) {
let passwordErrorMsg = '密码需包含',
let passwordErrorMsg = this.$lang('member.passwordNeedInclude'),
reg = '';
if (regConfig.pwd_complexity.indexOf('number') != -1) {
reg += '(?=.*?[0-9])';
passwordErrorMsg += '数字';
passwordErrorMsg += this.$lang('member.digit');
}
if (regConfig.pwd_complexity.indexOf('letter') != -1) {
reg += '(?=.*?[a-z])';
@@ -609,13 +609,13 @@ export default {
if (checkRes) {
if (this.formData.currentPassword == this.formData.newPassword) {
this.$util.showToast({
title: '新密码不能与原密码相同'
title: this.$lang('member.sameAsOldPassword')
});
return;
}
if (this.formData.newPassword != this.formData.confirmPassword) {
this.$util.showToast({
title: '两次密码不一致'
title: this.$lang('member.passwordNotMatch')
});
return;
}
@@ -657,11 +657,11 @@ export default {
var rule = [{
name: 'mobile',
checkType: 'required',
errorMsg: '请输入手机号'
errorMsg: this.$lang('member.inputMobile')
}, {
name: 'mobile',
checkType: 'phoneno',
errorMsg: '请输入正确的手机号'
errorMsg: this.$lang('member.inputMobileCorrect')
}];
var checkRes = validate.check(this.formData, rule);
if (!checkRes) {
@@ -723,7 +723,7 @@ export default {
if (this.seconds == 120 && this.timer == null) {
this.timer = setInterval(() => {
this.seconds--;
this.formData.mobileCodeText = '已发送(' + this.seconds + 's)';
this.formData.mobileCodeText = this.$lang('member.alreadySent') + '(' + this.seconds + 's)';
}, 1000);
}
uni.setStorageSync('mobile_key', data.key);
@@ -741,7 +741,7 @@ export default {
});
} else {
this.$util.showToast({
title: validate.error ? validate.error : '请勿重复点击'
title: validate.error ? validate.error : this.$lang('member.noRepeatClick')
});
}
},
@@ -840,7 +840,7 @@ export default {
if (this.seconds == 120 && this.timer == null) {
this.timer = setInterval(() => {
this.seconds--;
this.formData.mobileCodeText = '已发送(' + this.seconds + 's)';
this.formData.mobileCodeText = this.$lang('member.alreadySent') + '(' + this.seconds + 's)';
}, 1000);
}
uni.setStorageSync('password_mobile_key', data.key);
@@ -858,7 +858,7 @@ export default {
});
} else {
this.$util.showToast({
title: '请勿重复点击'
title: this.$lang('member.noRepeatClick')
});
}
},
@@ -866,12 +866,12 @@ export default {
var rule = [{
name: 'fullAddress',
checkType: 'required',
errorMsg: '请选择所在地区'
errorMsg: this.$lang('member.selectRegion')
},
{
name: 'address',
checkType: 'required',
errorMsg: '请输入详细地址'
errorMsg: this.$lang('member.inputDetailAddress')
}
];
if (!rule.length) return;

View File

@@ -60,8 +60,8 @@ export default {
// 提交注销申请并清理登录态(供 assets.vue 等页面调用)
submitCancelApply(options = {}) {
uni.showModal({
title: options.title || '风险提示',
content: options.content || '确定要注销当前账号吗?',
title: options.title || this.$lang('member.riskTip'),
content: options.content || this.$lang('member.confirmLogoutAccount'),
confirmColor: '#000000',
success: res => {
if (res.confirm) {