refactor: 替换项目中硬编码文本为多语言配置

将多处页面和组件内的硬编码文字替换为国际化语言包调用,包括空状态提示、按钮文案、表单占位符、弹窗标题等内容,统一项目多语言管理
This commit is contained in:
2026-06-22 10:38:33 +08:00
parent 062fb3be90
commit 45830ebda4
14 changed files with 126 additions and 126 deletions

View File

@@ -14,7 +14,7 @@
</view> </view>
<view class="fui-remark jump" style="padding-right: 20rpx; text-align: center; line-height: 140rpx;"> <view class="fui-remark jump" style="padding-right: 20rpx; text-align: center; line-height: 140rpx;">
<span style="font-size:24rpx;padding: 14rpx 18rpx;border-radius:8rpx" <span style="font-size:24rpx;padding: 14rpx 18rpx;border-radius:8rpx"
:style="{ background: item.BtBgColor, color: item.BtColor }" @tap.stop="previewSqs()">立即添加</span> :style="{ background: item.BtBgColor, color: item.BtColor }" @tap.stop="previewSqs()">{{ $lang('form.addNow') }}</span>
</view> </view>
</view> </view>
</view> </view>

View File

@@ -12,7 +12,7 @@
<!-- #ifdef MP --> <!-- #ifdef MP -->
<block <block
v-if="(memberInfo.nickname.indexOf('u_') != -1 && memberInfo.nickname == memberInfo.username) || memberInfo.nickname == memberInfo.mobile"> v-if="(memberInfo.nickname.indexOf('u_') != -1 && memberInfo.nickname == memberInfo.username) || memberInfo.nickname == memberInfo.mobile">
<view class="nickname"><text class="name" @tap.stop="getWxAuth">点击授权头像昵称</text></view> <view class="nickname"><text class="name" @tap.stop="getWxAuth">{{ $lang('member.authAvatarNickname') }}</text></view>
</block> </block>
<view class="nickname" v-else> <view class="nickname" v-else>
<text class="name" @tap.stop="getWxAuth">{{ memberInfo.nickname }}</text> <text class="name" @tap.stop="getWxAuth">{{ memberInfo.nickname }}</text>
@@ -36,7 +36,7 @@
<!-- #ifdef H5 --> <!-- #ifdef H5 -->
<block <block
v-if="$util.isWeiXin() && ((memberInfo.nickname.indexOf('u_') != -1 && memberInfo.nickname == memberInfo.username) || memberInfo.nickname == memberInfo.mobile)"> v-if="$util.isWeiXin() && ((memberInfo.nickname.indexOf('u_') != -1 && memberInfo.nickname == memberInfo.username) || memberInfo.nickname == memberInfo.mobile)">
<view class="nickname"><text class="name" @tap.stop="getWxAuth">点击获取微信头像</text></view> <view class="nickname"><text class="name" @tap.stop="getWxAuth">{{ $lang('member.getWechatAvatar') }}</text></view>
</block> </block>
<view class="nickname" v-else> <view class="nickname" v-else>
<text class="name" @tap.stop="redirect('/pages_tool/member/info')">{{ memberInfo.nickname <text class="name" @tap.stop="redirect('/pages_tool/member/info')">{{ memberInfo.nickname

View File

@@ -42,11 +42,11 @@
<uni-popup ref="noticePopup" type="center"> <uni-popup ref="noticePopup" type="center">
<view class="notice-popup"> <view class="notice-popup">
<view class="head-wrap" @tap.stop="closeNoticePopup"> <view class="head-wrap" @tap.stop="closeNoticePopup">
<text>公告</text> <text>{{ $lang('notice.title') }}</text>
<text class="iconfont icon-close"></text> <text class="iconfont icon-close"></text>
</view> </view>
<view class="content-wrap">{{ notice }}</view> <view class="content-wrap">{{ notice }}</view>
<button type="primary" @tap.stop="closeNoticePopup">我知道了</button> <button type="primary" @tap.stop="closeNoticePopup">{{ $lang('notice.iknow') }}</button>
</view> </view>
</uni-popup> </uni-popup>
</view> </view>

View File

@@ -28,7 +28,7 @@
@tap.stop="handlerSearchClick" @tap.stop="handlerSearchClick"
:placeholderStyle="placeholderStyle" /> :placeholderStyle="placeholderStyle" />
<text class="search-content-btn" @tap.stop="handlerSearchClick" <text class="search-content-btn" @tap.stop="handlerSearchClick"
:style="{ 'backgroundColor': value.pageBgColor ? value.pageBgColor : 'rgba(0,0,0,0)' }">搜索</text> :style="{ 'backgroundColor': value.pageBgColor ? value.pageBgColor : 'rgba(0,0,0,0)' }">{{ $lang('form.search') }}</text>
</view> </view>
<view class="img" v-if="value.iconType == 'img'" <view class="img" v-if="value.iconType == 'img'"
@tap.stop="handlerRedirectToClick(value.searchLink)"> @tap.stop="handlerRedirectToClick(value.searchLink)">

View File

@@ -15,7 +15,7 @@ export default {
props: { props: {
text: { text: {
type: String, type: String,
default: '暂无相关数据' default: ''
}, },
subText: { subText: {
type: String, type: String,
@@ -28,7 +28,7 @@ export default {
emptyBtn: { emptyBtn: {
type: Object, type: Object,
default: () => { default: () => {
return { text: '去逛逛' }; return { text: '' };
} }
}, },
fixed: { fixed: {

View File

@@ -7,34 +7,34 @@
<!-- #ifdef H5 --> <!-- #ifdef H5 -->
<template v-if="forceBindingMobileControl"> <template v-if="forceBindingMobileControl">
<view class="head"> <view class="head">
<text class="title">检测到您还未绑定手机号</text> <text class="title">{{ $lang('loginPage.detectPhoneNotBound') }}</text>
<text class="color-tip tips">为了方便您接收订单等信息,需要绑定手机号</text> <text class="color-tip tips">{{ $lang('loginPage.bindPhoneForOrder') }}</text>
<text class="iconfont icon-close color-tip" @click="cancelCompleteInfo"></text> <text class="iconfont icon-close color-tip" @click="cancelCompleteInfo"></text>
</view> </view>
<view class="item-wrap"> <view class="item-wrap">
<text class="label">手机号</text> <text class="label">{{ $lang('loginPage.phone') }}</text>
<input type="number" placeholder="请输入手机号" v-model="formData.mobile" maxlength="11" /> <input type="number" :placeholder="$lang('loginPage.phone')" v-model="formData.mobile" maxlength="11" />
</view> </view>
<view class="item-wrap" v-if="isOpenCaptcha"> <view class="item-wrap" v-if="isOpenCaptcha">
<text class="label">验证码</text> <text class="label">{{ $lang('loginPage.verificationCode') }}</text>
<input type="number" placeholder="请输入验证码" v-model="formData.vercode" maxlength="4" /> <input type="number" :placeholder="$lang('loginPage.verificationCode')" v-model="formData.vercode" maxlength="4" />
<image :src="captcha.img" class="captcha" @click="getCaptcha" show-menu-by-longpress></image> <image :src="captcha.img" class="captcha" @click="getCaptcha" show-menu-by-longpress></image>
</view> </view>
<view class="item-wrap"> <view class="item-wrap">
<text class="label">动态码</text> <text class="label">{{ $lang('loginPage.dynamicCode') }}</text>
<input type="number" placeholder="请输入动态码" v-model="formData.dynacode" maxlength="4" /> <input type="number" :placeholder="$lang('loginPage.dynamicCode')" v-model="formData.dynacode" maxlength="4" />
<view class="send color-base-text" @click="sendMobileCode">{{ dynacodeData.codeText }} <view class="send color-base-text" @click="sendMobileCode">{{ dynacodeData.codeText }}
</view> </view>
</view> </view>
</template> </template>
<button type="default" class="save-btn" @click="saveH5" :disabled="isDisabled">保存</button> <button type="default" class="save-btn" @click="saveH5" :disabled="isDisabled">{{ $lang('loginPage.save') }}</button>
<!-- #endif --> <!-- #endif -->
<!-- #ifdef MP --> <!-- #ifdef MP -->
<view class="head"> <view class="head">
<text class="title">欢迎来到 {{ site_name }}</text> <text class="title">{{ $lang('loginPage.welcomeTo') }} {{ site_name }}</text>
<text class="color-tip tips"> <text class="color-tip tips">
<template>{{ forceBindingMobileControl ? '使用手机号登录,' : '注册登录,' }}</template> <template>{{ forceBindingMobileControl ? $lang('loginPage.usePhoneLogin') : $lang('loginPage.registerLogin') }}</template>
获得订单、售后等服务。 获得订单、售后等服务。
</text> </text>
<text class="iconfont icon-close color-tip" @click="cancelCompleteInfo"></text> <text class="iconfont icon-close color-tip" @click="cancelCompleteInfo"></text>
@@ -48,9 +48,9 @@
<view style="text-align: left; margin-left: 10rpx; padding-top: 2rpx; font-size: 28rpx;"> <view style="text-align: left; margin-left: 10rpx; padding-top: 2rpx; font-size: 28rpx;">
我同意 我同意
<text style="color: #4395ff;" <text style="color: #4395ff;"
@click="tourl('/pages_tool/agreement/contenr?type=0')">《隐私条款》</text> @click="tourl('/pages_tool/agreement/contenr?type=0')">{{ $lang('loginPage.privacyClause') }}</text>
<text style="color: #4395ff;" <text style="color: #4395ff;"
@click="tourl('/pages_tool/agreement/contenr?type=1')">《用户服务协议》</text> @click="tourl('/pages_tool/agreement/contenr?type=1')">{{ $lang('loginPage.userAgreement') }}</text>
</view> </view>
</view> </view>
@@ -58,25 +58,25 @@
<block v-if="isAgree"> <block v-if="isAgree">
<button class="auth-login save-btn border-0" style="border: none;" open-type="getPhoneNumber" <button class="auth-login save-btn border-0" style="border: none;" open-type="getPhoneNumber"
@getphonenumber="getPhoneNumber"> @getphonenumber="getPhoneNumber">
<text style="color: #fff; font-size: 30rpx;">同意隐私协议并授权手机号</text> <text style="color: #fff; font-size: 30rpx;">{{ $lang('loginPage.agreePrivacyAndAuth') }}</text>
</button> </button>
</block> </block>
<block v-else> <block v-else>
<button class="auth-login save-btn border-0" style="border: none;" @click="authno"> <button class="auth-login save-btn border-0" style="border: none;" @click="authno">
<text style="color: #fff; font-size: 30rpx;">授权手机号码</text> <text style="color: #fff; font-size: 30rpx;">{{ $lang('loginPage.authPhoneNumber') }}</text>
</button> </button>
</block> </block>
<view @click="closeLogin" <view @click="closeLogin"
style="font-size: 30rpx; color: #888; text-align: center; padding-top: 10rpx;"> style="font-size: 30rpx; color: #888; text-align: center; padding-top: 10rpx;">
暂不登录 {{ $lang('loginPage.notNow') }}
</view> </view>
<!-- 昵称和头像模式 --> <!-- 昵称和头像模式 -->
<template v-if="enableNickAndAvatar"> <template v-if="enableNickAndAvatar">
<!-- #ifdef MP-WEIXIN --> <!-- #ifdef MP-WEIXIN -->
<view class="item-wrap"> <view class="item-wrap">
<text class="label">头像</text> <text class="label">{{ $lang('loginPage.avatar') }}</text>
<button open-type="chooseAvatar" @chooseavatar="onChooseAvatar"> <button open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
<image :src="avatarUrl ? avatarUrl : $util.getDefaultImage().head" <image :src="avatarUrl ? avatarUrl : $util.getDefaultImage().head"
@error="avatarUrl = $util.getDefaultImage().head" mode="aspectFill" show-menu-by-longpress/> @error="avatarUrl = $util.getDefaultImage().head" mode="aspectFill" show-menu-by-longpress/>
@@ -84,15 +84,15 @@
</button> </button>
</view> </view>
<view class="item-wrap"> <view class="item-wrap">
<text class="label">昵称</text> <text class="label">{{ $lang('loginPage.nickname') }}</text>
<input type="nickname" placeholder="请输入昵称" v-model="nickName" @blur="blurNickName" <input type="nickname" :placeholder="$lang('loginPage.nickname')" v-model="nickName" @blur="blurNickName"
maxlength="50" /> maxlength="50" />
</view> </view>
<!-- #endif --> <!-- #endif -->
<!-- #ifdef MP-ALIPAY --> <!-- #ifdef MP-ALIPAY -->
<view class="item-wrap"> <view class="item-wrap">
<text class="label">头像</text> <text class="label">{{ $lang('loginPage.avatar') }}</text>
<button open-type="getAuthorize" scope="userInfo" @getAuthorize="aliappGetUserinfo" <button open-type="getAuthorize" scope="userInfo" @getAuthorize="aliappGetUserinfo"
:plain="true" class="border-0"> :plain="true" class="border-0">
<image :src="avatarUrl ? avatarUrl : $util.getDefaultImage().head" <image :src="avatarUrl ? avatarUrl : $util.getDefaultImage().head"
@@ -101,21 +101,21 @@
</button> </button>
</view> </view>
<view class="item-wrap"> <view class="item-wrap">
<text class="label">昵称</text> <text class="label">{{ $lang('loginPage.nickname') }}</text>
<input type="nickname" placeholder="请输入昵称" v-model="nickName" @blur="blurNickName" <input type="nickname" :placeholder="$lang('loginPage.nickname')" v-model="nickName" @blur="blurNickName"
maxlength="50" /> maxlength="50" />
</view> </view>
<!-- #endif --> <!-- #endif -->
<view class="item-wrap" v-if="forceBindingMobileControl"> <view class="item-wrap" v-if="forceBindingMobileControl">
<text class="label">手机号</text> <text class="label">{{ $lang('loginPage.phone') }}</text>
<button open-type="getPhoneNumber" :plain="true" class="auth-login border-0" <button open-type="getPhoneNumber" :plain="true" class="auth-login border-0"
@getphonenumber="getPhoneNumber"> @getphonenumber="getPhoneNumber">
<text class="mobile" v-if="formData.mobile">{{ formData.mobile }}</text> <text class="mobile" v-if="formData.mobile">{{ formData.mobile }}</text>
<text class="color-base-text" v-else>获取手机号</text> <text class="color-base-text" v-else>{{ $lang('loginPage.getPhone') }}</text>
</button> </button>
</view> </view>
<button type="default" class="save-btn" @click="saveMp" :disabled="isDisabled">保存</button> <button type="default" class="save-btn" @click="saveMp" :disabled="isDisabled">{{ $lang('loginPage.save') }}</button>
</template> </template>
<!-- #endif --> <!-- #endif -->
</view> </view>
@@ -166,7 +166,7 @@ export default {
dynacodeData: { dynacodeData: {
seconds: 120, seconds: 120,
timer: null, timer: null,
codeText: '获取动态码', codeText: this.$lang('loginPage.dynamicCode'),
isSend: false isSend: false
}, },
// 小程序获取手机号所需数据 // 小程序获取手机号所需数据
@@ -228,7 +228,7 @@ export default {
// 同意协议 // 同意协议
authno() { authno() {
if (!this.isAgree) { if (!this.isAgree) {
this.$util.showToast({ title: '请确认相关协议' }); this.$util.showToast({ title: this.$lang('loginPage.confirmAgreement') });
} }
}, },
@@ -324,7 +324,7 @@ export default {
}, },
fail: () => { fail: () => {
this.$util.showToast({ this.$util.showToast({
title: '上传失败' title: this.$lang('loginPage.uploadFailed')
}); });
} }
}) })
@@ -386,17 +386,17 @@ export default {
var rule = [{ var rule = [{
name: 'mobile', name: 'mobile',
checkType: 'required', checkType: 'required',
errorMsg: '请输入手机号' errorMsg: this.$lang('loginPage.phoneRequired')
}, { }, {
name: 'mobile', name: 'mobile',
checkType: 'phoneno', checkType: 'phoneno',
errorMsg: '请输入正确的手机号' errorMsg: this.$lang('loginPage.phoneInvalid')
}]; }];
if (this.isOpenCaptcha == 1) { if (this.isOpenCaptcha == 1) {
rule.push({ rule.push({
name: 'captcha_code', name: 'captcha_code',
checkType: 'required', checkType: 'required',
errorMsg: '请输入验证码' errorMsg: this.$lang('loginPage.verificationCodeRequired')
}); });
} }
var checkRes = validate.check(data, rule); var checkRes = validate.check(data, rule);
@@ -444,7 +444,7 @@ export default {
this.dynacodeData = { this.dynacodeData = {
seconds: 120, seconds: 120,
timer: null, timer: null,
codeText: '获取动态码', codeText: this.$lang('loginPage.dynamicCode'),
isSend: false isSend: false
}; };
}, },
@@ -455,23 +455,23 @@ export default {
let rule = [{ let rule = [{
name: 'mobile', name: 'mobile',
checkType: 'required', checkType: 'required',
errorMsg: '请输入手机号' errorMsg: this.$lang('loginPage.phoneRequired')
}, { }, {
name: 'mobile', name: 'mobile',
checkType: 'phoneno', checkType: 'phoneno',
errorMsg: '请输入正确的手机号' errorMsg: this.$lang('loginPage.phoneInvalid')
}]; }];
if (this.isOpenCaptcha == 1) { if (this.isOpenCaptcha == 1) {
if (this.captcha.id != '') rule.push({ if (this.captcha.id != '') rule.push({
name: 'captcha_code', name: 'captcha_code',
checkType: 'required', checkType: 'required',
errorMsg: '请输入验证码' errorMsg: this.$lang('loginPage.verificationCodeRequired')
}); });
} }
rule.push({ rule.push({
name: 'code', name: 'code',
checkType: 'required', checkType: 'required',
errorMsg: '请输入动态码' errorMsg: this.$lang('loginPage.dynamicCodeRequired')
}); });
var checkRes = validate.check(data, rule); var checkRes = validate.check(data, rule);
@@ -603,7 +603,7 @@ export default {
// 授权登录 // 授权登录
authLogin(data, type = 'authLogin') { authLogin(data, type = 'authLogin') {
uni.showLoading({ uni.showLoading({
title: '登录中' title: this.$lang('loginPage.loggingIn')
}); });
uni.setStorageSync('authInfo', data); uni.setStorageSync('authInfo', data);
if (uni.getStorageSync('source_member')) data.source_member = uni.getStorageSync('source_member'); if (uni.getStorageSync('source_member')) data.source_member = uni.getStorageSync('source_member');
@@ -643,7 +643,7 @@ export default {
fail: () => { fail: () => {
uni.hideLoading(); uni.hideLoading();
this.$util.showToast({ this.$util.showToast({
title: '登录失败' title: this.$lang('loginPage.loginFailed')
}); });
} }
}); });
@@ -669,12 +669,12 @@ export default {
// 微信小程序保存数据 // 微信小程序保存数据
saveMp() { saveMp() {
if (this.formData.mobile === '') { if (this.formData.mobile === '') {
this.$util.showToast({ title: '请授权您的手机号码' }); this.$util.showToast({ title: this.$lang('loginPage.phoneAuthRequired') });
return; return;
} }
if (this.nickName.length == 0 && this.enableNickAndAvatar) { if (this.nickName.length == 0 && this.enableNickAndAvatar) {
this.$util.showToast({ title: '请输入昵称' }); this.$util.showToast({ title: this.$lang('loginPage.nicknameRequired') });
return; return;
} }
@@ -715,7 +715,7 @@ export default {
}, },
fail: () => { fail: () => {
this.$util.showToast({ this.$util.showToast({
title: '头像拉取失败' title: this.$lang('loginPage.avatarFetchFailed')
}); });
} }
}) })

View File

@@ -11,7 +11,7 @@
<view :class="['box', 'align-left']" :style="item._boxAlignStyle"> <view :class="['box', 'align-left']" :style="item._boxAlignStyle">
<input <input
type="text" type="text"
:placeholder="item.value.placeholder || '请输入提示语'" :placeholder="item.value.placeholder || $lang('form.inputPlaceholder')"
placeholder-class="placeholder color-tip" placeholder-class="placeholder color-tip"
v-model="item.val" v-model="item.val"
/> />
@@ -28,7 +28,7 @@
</view> </view>
<view :class="['box', 'align-left']" :style="item._boxAlignStyle"> <view :class="['box', 'align-left']" :style="item._boxAlignStyle">
<textarea <textarea
:placeholder="item.value.placeholder || '请输入提示语'" :placeholder="item.value.placeholder || $lang('form.inputPlaceholder')"
placeholder-class="placeholder color-tip" placeholder-class="placeholder color-tip"
v-model="item.val" v-model="item.val"
></textarea> ></textarea>
@@ -50,7 +50,7 @@
</view> </view>
<view :class="['box', 'box-flex', 'align-right']"> <view :class="['box', 'box-flex', 'align-right']">
<text v-if="item.val != ''">{{ item.val }}</text> <text v-if="item.val != ''">{{ item.val }}</text>
<text v-else class="color-tip">{{ item.value.placeholder || '请选择' }}</text> <text v-else class="color-tip">{{ item.value.placeholder || $lang('form.selectPlaceholder') }}</text>
<text class="iconfont icon-right"></text> <text class="iconfont icon-right"></text>
</view> </view>
</view> </view>
@@ -146,7 +146,7 @@
@change="bindDateChange($event, index)" @change="bindDateChange($event, index)"
> >
<view :class="['uni-input', !item.val ? 'color-tip' : '']"> <view :class="['uni-input', !item.val ? 'color-tip' : '']">
{{ item.val ? item.val : (item.value.placeholder || '请选择日期') }} {{ item.val ? item.val : (item.value.placeholder || $lang('form.selectDate')) }}
</view> </view>
</picker> </picker>
<text class="iconfont icon-right"></text> <text class="iconfont icon-right"></text>
@@ -170,7 +170,7 @@
> >
<view class="picker-box"> <view class="picker-box">
<view :class="['uni-input', !item.start_date ? 'color-tip' : '']"> <view :class="['uni-input', !item.start_date ? 'color-tip' : '']">
{{ item.start_date ? item.start_date : (item.value.placeholder_start || '开始日期') }} {{ item.start_date ? item.start_date : (item.value.placeholder_start || $lang('form.startDate')) }}
</view> </view>
</view> </view>
</picker> </picker>
@@ -184,7 +184,7 @@
> >
<view class="picker-box"> <view class="picker-box">
<view :class="['uni-input', !item.end_date ? 'color-tip' : '']"> <view :class="['uni-input', !item.end_date ? 'color-tip' : '']">
{{ item.end_date ? item.end_date : (item.value.placeholder_end || '结束日期') }} {{ item.end_date ? item.end_date : (item.value.placeholder_end || $lang('form.endDate')) }}
</view> </view>
</view> </view>
</picker> </picker>
@@ -207,7 +207,7 @@
@change="bindTimeChange($event, index)" @change="bindTimeChange($event, index)"
> >
<view :class="['uni-input', !item.val ? 'color-tip' : '']"> <view :class="['uni-input', !item.val ? 'color-tip' : '']">
{{ item.val ? item.val : (item.value.placeholder || '请选择时间') }} {{ item.val ? item.val : (item.value.placeholder || $lang('form.selectTime')) }}
</view> </view>
</picker> </picker>
<text class="iconfont icon-right"></text> <text class="iconfont icon-right"></text>
@@ -231,7 +231,7 @@
> >
<view class="picker-box"> <view class="picker-box">
<view :class="['uni-input', !item.start_time ? 'color-tip' : '']"> <view :class="['uni-input', !item.start_time ? 'color-tip' : '']">
{{ item.start_time ? item.start_time : (item.value.placeholder_start || '开始时间') }} {{ item.start_time ? item.start_time : (item.value.placeholder_start || $lang('form.startTime')) }}
</view> </view>
</view> </view>
</picker> </picker>
@@ -245,7 +245,7 @@
> >
<view class="picker-box"> <view class="picker-box">
<view :class="['uni-input', !item.end_time ? 'color-tip' : '']"> <view :class="['uni-input', !item.end_time ? 'color-tip' : '']">
{{ item.end_time ? item.end_time : (item.value.placeholder_end || '结束时间') }} {{ item.end_time ? item.end_time : (item.value.placeholder_end || $lang('form.endTime')) }}
</view> </view>
</view> </view>
</picker> </picker>
@@ -268,7 +268,7 @@
@getRegions="handleGetRegions($event, index)" @getRegions="handleGetRegions($event, index)"
> >
<view :class="['select-address', !item.val ? 'empty' : '', !item.val ? 'color-tip' : '']"> <view :class="['select-address', !item.val ? 'empty' : '', !item.val ? 'color-tip' : '']">
{{ item.val ? item.val : (item.value.placeholder || (item.value.default_type == 1 ? '请选择省市' : '请选择省市区')) }} {{ item.val ? item.val : (item.value.placeholder || (item.value.default_type == 1 ? $lang('form.selectProvinceCity') : $lang('form.selectProvinceCityDistrict'))) }}
</view> </view>
</pick-regions> </pick-regions>
<text class="iconfont icon-right"></text> <text class="iconfont icon-right"></text>
@@ -788,89 +788,89 @@ export default {
if (item.controller == 'Text') { if (item.controller == 'Text') {
if (item.value.required && !item.val) { if (item.value.required && !item.val) {
this.$util.showToast({ title: '请输入' + item.value.title }); this.$util.showToast({ title: this.$lang('form.inputRequired') + item.value.title });
return false; return false;
} }
if (item.name == 'ID_CARD' && !/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(item.val)) { if (item.name == 'ID_CARD' && !/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(item.val)) {
if (!item.value.required) { if (!item.value.required) {
this.$util.showToast({ title: '身份证输入不合法' }); this.$util.showToast({ title: this.$lang('form.idCardInvalid') });
return false; return false;
} }
if (item.val != '') { if (item.val != '') {
this.$util.showToast({ title: '身份证输入不合法' }); this.$util.showToast({ title: this.$lang('form.idCardInvalid') });
return false; return false;
} }
} }
if (item.name == 'MOBILE' && !this.$util.verifyMobile(item.val)) { if (item.name == 'MOBILE' && !this.$util.verifyMobile(item.val)) {
if (!item.value.required) { if (!item.value.required) {
this.$util.showToast({ title: '手机号输入不合法' }); this.$util.showToast({ title: this.$lang('form.phoneInvalid') });
return false; return false;
} }
if (item.val != '') { if (item.val != '') {
this.$util.showToast({ title: '手机号输入不合法' }); this.$util.showToast({ title: this.$lang('form.phoneInvalid') });
return false; return false;
} }
} }
} }
if (item.controller == 'Textarea' && item.value.required && !item.val) { if (item.controller == 'Textarea' && item.value.required && !item.val) {
this.$util.showToast({ title: '请输入' + item.value.title }); this.$util.showToast({ title: this.$lang('form.inputRequired') + item.value.title });
return false; return false;
} }
if (item.controller == 'Select' && item.value.required && !item.val) { if (item.controller == 'Select' && item.value.required && !item.val) {
this.$util.showToast({ title: '请选择' + item.value.title }); this.$util.showToast({ title: this.$lang('form.selectRequired') + item.value.title });
return false; return false;
} }
if (item.controller == 'Checkbox' && item.value.required && !item.val) { if (item.controller == 'Checkbox' && item.value.required && !item.val) {
this.$util.showToast({ title: '请至少选择一个' + item.value.title }); this.$util.showToast({ title: this.$lang('form.selectAtLeastOne') + item.value.title });
return false; return false;
} }
if (item.controller == 'Img' && item.value.required && !item.val) { if (item.controller == 'Img' && item.value.required && !item.val) {
this.$util.showToast({ title: '请至少上传一张' + item.value.title }); this.$util.showToast({ title: this.$lang('form.uploadAtLeastOne') + item.value.title });
return false; return false;
} }
if (item.controller == 'Date' && item.value.required && !item.val) { if (item.controller == 'Date' && item.value.required && !item.val) {
this.$util.showToast({ title: '请选择' + item.value.title }); this.$util.showToast({ title: this.$lang('form.selectRequired') + item.value.title });
return false; return false;
} }
if (item.controller == 'Datelimit') { if (item.controller == 'Datelimit') {
if (item.value.required && !item.val) { if (item.value.required && !item.val) {
this.$util.showToast({ title: '请选择' + item.value.title }); this.$util.showToast({ title: this.$lang('form.selectRequired') + item.value.title });
return false; return false;
} }
if (this.$util.timeTurnTimeStamp(item.start_date) > this.$util.timeTurnTimeStamp(item.end_date)) { if (this.$util.timeTurnTimeStamp(item.start_date) > this.$util.timeTurnTimeStamp(item.end_date)) {
this.$util.showToast({ title: '结束日期不能小于开始日期' }); this.$util.showToast({ title: this.$lang('form.endDateBeforeStart') });
return false; return false;
} }
} }
if (item.controller == 'Time' && item.value.required && !item.val) { if (item.controller == 'Time' && item.value.required && !item.val) {
this.$util.showToast({ title: '请选择' + item.value.title }); this.$util.showToast({ title: this.$lang('form.selectRequired') + item.value.title });
return false; return false;
} }
if (item.controller == 'Timelimit') { if (item.controller == 'Timelimit') {
if (item.value.required && !item.val) { if (item.value.required && !item.val) {
this.$util.showToast({ title: '请选择' + item.value.title }); this.$util.showToast({ title: this.$lang('form.selectRequired') + item.value.title });
return false; return false;
} }
if (item.start_time >= item.end_time) { if (item.start_time >= item.end_time) {
this.$util.showToast({ title: '结束时间必须大于开始时间' }); this.$util.showToast({ title: this.$lang('form.endTimeBeforeStart') });
return false; return false;
} }
} }
if (item.controller == 'City' && item.value.required && !item.val) { if (item.controller == 'City' && item.value.required && !item.val) {
this.$util.showToast({ title: '请选择' + item.value.title }); this.$util.showToast({ title: this.$lang('form.selectRequired') + item.value.title });
return false; return false;
} }
} }
@@ -902,7 +902,7 @@ export default {
if (res.length > 0) { if (res.length > 0) {
res.forEach(function(img) { res.forEach(function(img) {
if (self.formData[index].img_lists.length >= Number(self.formData[index].value.max_count)) { if (self.formData[index].img_lists.length >= Number(self.formData[index].value.max_count)) {
self.$util.showToast({ title: '最多上传' + self.formData[index].value.max_count + '张图片' }); self.$util.showToast({ title: this.$lang('form.maxUploadImages') + self.formData[index].value.max_count + this.$lang('form.images') });
return false; return false;
} }
self.formData[index].img_lists.push(img); self.formData[index].img_lists.push(img);
@@ -916,7 +916,7 @@ export default {
addImg(index) { addImg(index) {
let self = this; let self = this;
if (this.formData[index].img_lists.length >= Number(this.formData[index].value.max_count)) { if (this.formData[index].img_lists.length >= Number(this.formData[index].value.max_count)) {
this.$util.showToast({ title: '最多上传' + this.formData[index].value.max_count + '张图片' }); this.$util.showToast({ title: this.$lang('form.maxUploadImages') + this.formData[index].value.max_count + this.$lang('form.images') });
return false; return false;
} }

View File

@@ -4,19 +4,19 @@
<uni-popup ref="choosePaymentPopup" type="center" :mask-click="false"> <uni-popup ref="choosePaymentPopup" type="center" :mask-click="false">
<view class="choose-payment-popup popup" @touchmove.prevent.stop> <view class="choose-payment-popup popup" @touchmove.prevent.stop>
<view class="popup-header"> <view class="popup-header">
<text class="tit">支付方式</text> <text class="tit">{{ $lang('payment.paymentMethod') }}</text>
<text class="iconfont icon-close" @click="close()"></text> <text class="iconfont icon-close" @click="close()"></text>
</view> </view>
<scroll-view scroll-y="true" class="popup-body" :class="{ 'safe-area': isIphoneX }"> <scroll-view scroll-y="true" class="popup-body" :class="{ 'safe-area': isIphoneX }">
<view class="pay-money"> <view class="pay-money">
<!-- <text class="unit">{{ $lang('common.currencySymbol') }}</text> --> <!-- <text class="unit">{{ $lang('common.currencySymbol') }}</text> -->
<text class="money">支付金额{{ payMoney | moneyFormat }}元</text> <text class="money">{{ $lang('payment.paymentAmount') }}{{ payMoney | moneyFormat }}{{ $lang('sku.unit') }}</text>
</view> </view>
<view class="payment-item" v-if="balanceDeduct > 0 && balanceConfig == 1 && sale"> <view class="payment-item" v-if="balanceDeduct > 0 && balanceConfig == 1 && sale">
<view class="iconfont icon-yue"></view> <view class="iconfont icon-yue"></view>
<view class="info-wrap"> <view class="info-wrap">
<text class="name">余额抵扣</text> <text class="name">{{ $lang('payment.balanceDeduct') }}</text>
<view class="money">可用¥{{ balanceDeduct }}</view> <view class="money">{{ $lang('payment.available') }}¥{{ balanceDeduct }}</view>
</view> </view>
<ns-switch class="balance-switch" @change="useBalance" :checked="isBalance == 1"></ns-switch> <ns-switch class="balance-switch" @change="useBalance" :checked="isBalance == 1"></ns-switch>
</view> </view>
@@ -31,12 +31,12 @@
</view> </view>
</block> </block>
<block v-else> <block v-else>
<view class="empty">平台尚未配置支付方式!</view> <view class="empty">{{ $lang('payment.noPaymentMethod') }}</view>
</block> </block>
</block> </block>
</scroll-view> </scroll-view>
<view class="popup-footer" :class="{ 'bottom-safe-area': isIphoneX }"> <view class="popup-footer" :class="{ 'bottom-safe-area': isIphoneX }">
<view class="confirm-btn color-base-bg" @click="confirm()">确认支付</view> <view class="confirm-btn color-base-bg" @click="confirm()">{{ $lang('payment.confirmPayment') }}</view>
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
@@ -158,12 +158,12 @@ export default {
confirm() { confirm() {
if (this.payTypeList.length == 0 && this.payMoney > 0) { if (this.payTypeList.length == 0 && this.payMoney > 0) {
this.$util.showToast({ this.$util.showToast({
title: '请选择支付方式!' title: this.$lang('payment.selectPaymentMethod')
}); });
return; return;
} }
uni.showLoading({ uni.showLoading({
title: '支付中...', title: this.$lang('payment.paying'),
mask: true mask: true
}); });
this.$refs.choosePaymentPopup.close(); this.$refs.choosePaymentPopup.close();
@@ -182,7 +182,7 @@ export default {
this.pay(); this.pay();
} else { } else {
this.$util.showToast({ this.$util.showToast({
title: '未获取到支付信息!' title: this.$lang('payment.noPaymentInfo')
}); });
setTimeout(() => { setTimeout(() => {
this.$util.redirectTo(this.$util.INDEX_PAGE_URL); this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
@@ -295,7 +295,7 @@ export default {
}, },
res => { res => {
this.$util.showToast({ this.$util.showToast({
title: '您已取消支付' title: this.$lang('payment.cancelledPayment')
}); });
setTimeout(() => { setTimeout(() => {
this.$util.redirectTo('/pages_tool/pay/result', { this.$util.redirectTo('/pages_tool/pay/result', {

View File

@@ -3,8 +3,8 @@
<uni-popup type="bottom" ref="selectTime"> <uni-popup type="bottom" ref="selectTime">
<view class="box"> <view class="box">
<view class="title"> <view class="title">
<block v-if="obj.delivery && obj.delivery.delivery_type == 'local'">选择送达时间</block> <block v-if="obj.delivery && obj.delivery.delivery_type == 'local'">{{ $lang('appointment.selectDeliveryTime') }}</block>
<block v-if="obj.delivery && obj.delivery.delivery_type == 'store'">选择自提时间</block> <block v-if="obj.delivery && obj.delivery.delivery_type == 'store'">{{ $lang('appointment.selectPickupTime') }}</block>
<text class="iconfont icon-close" @click="close"></text> <text class="iconfont icon-close" @click="close"></text>
</view> </view>
<view class="body"> <view class="body">

View File

@@ -14,7 +14,7 @@
autoplay autoplay
class="video-player" class="video-player"
></video> ></video>
<view v-else class="video-error">视频地址不存在</view> <view v-else class="video-error">{{ $lang('video.videoNotFound') }}</view>
</view> </view>
</view> </view>
</uni-popup> </uni-popup>

View File

@@ -4,19 +4,19 @@
<uni-popup ref="choosePaymentPopup" type="center" v-if="payInfo" :mask-click="false"> <uni-popup ref="choosePaymentPopup" type="center" v-if="payInfo" :mask-click="false">
<view class="choose-payment-popup popup" @touchmove.prevent.stop> <view class="choose-payment-popup popup" @touchmove.prevent.stop>
<view class="popup-header"> <view class="popup-header">
<text class="tit">支付方式</text> <text class="tit">{{ $lang('payment.paymentMethod') }}</text>
<text class="iconfont icon-close" @click="close()"></text> <text class="iconfont icon-close" @click="close()"></text>
</view> </view>
<scroll-view scroll-y="true" class="popup-body"> <scroll-view scroll-y="true" class="popup-body">
<view class="pay-money"> <view class="pay-money">
<text class="money">支付金额{{ payMoney|moneyFormat }}元</text> <text class="money">{{ $lang('payment.paymentAmount') }}{{ payMoney|moneyFormat }}{{ $lang('sku.unit') }}</text>
</view> </view>
<view class="payment-item" v-if="balanceDeduct > 0 && balanceUsable && balanceConfig == 1"> <view class="payment-item" v-if="balanceDeduct > 0 && balanceUsable && balanceConfig == 1">
<view class="iconfont icon-yue"></view> <view class="iconfont icon-yue"></view>
<view class="info-wrap"> <view class="info-wrap">
<text class="name">余额支付</text> <text class="name">{{ $lang('payment.balancePayment') }}</text>
<view class="money">可用¥{{ balanceDeduct|moneyFormat }}</view> <view class="money">{{ $lang('payment.available') }}¥{{ balanceDeduct|moneyFormat }}</view>
</view> </view>
<ns-switch class="balance-switch" @change="useBalance" :checked="isBalance == 1"></ns-switch> <ns-switch class="balance-switch" @change="useBalance" :checked="isBalance == 1"></ns-switch>
</view> </view>
@@ -29,12 +29,12 @@
</view> </view>
</block> </block>
<block v-else> <block v-else>
<view class="empty">平台尚未配置支付方式!</view> <view class="empty">{{ $lang('payment.noPaymentMethod') }}</view>
</block> </block>
</block> </block>
</scroll-view> </scroll-view>
<view class="popup-footer"> <view class="popup-footer">
<view class="confirm-btn color-base-bg" @click="confirm()">确认支付</view> <view class="confirm-btn color-base-bg" @click="confirm()">{{ $lang('payment.confirmPayment') }}</view>
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
@@ -135,12 +135,12 @@
confirm() { confirm() {
if (this.payTypeList.length == 0 && this.payMoney > 0) { if (this.payTypeList.length == 0 && this.payMoney > 0) {
this.$util.showToast({ this.$util.showToast({
title: '请选择支付方式!' title: this.$lang('payment.selectPaymentMethod')
}); });
return; return;
} }
uni.showLoading({ uni.showLoading({
title: '支付中...', title: this.$lang('payment.paying'),
mask: true mask: true
}); });
this.pay(); this.pay();
@@ -161,7 +161,7 @@
}) })
} else { } else {
this.$util.showToast({ this.$util.showToast({
title: '未获取到支付信息!' title: this.$lang('payment.noPaymentInfo')
}); });
} }
} }
@@ -294,7 +294,7 @@
}, },
res => { res => {
this.$util.showToast({ this.$util.showToast({
title: '您已取消支付' title: this.$lang('payment.cancelledPayment')
}); });
this.resetpay(); this.resetpay();
} }

View File

@@ -2,23 +2,23 @@
<view> <view>
<view class="privacy-mask" v-if="showPop"> <view class="privacy-mask" v-if="showPop">
<view class="privacy-wrap"> <view class="privacy-wrap">
<view class="privacy-title">用户隐私保护提示</view> <view class="privacy-title">{{ $lang('privacy.title') }}</view>
<view class="privacy-desc"> <view class="privacy-desc">
感谢您使用{{ appName }},在使用前您应当阅读并同意 {{ $lang('privacy.thanks') }}{{ appName }},{{ $lang('privacy.beforeUse') }}
<text class="privacy-link" @tap="openPrivacyContract">{{ privacyContractName }}</text> <text class="privacy-link" @tap="openPrivacyContract">{{ privacyContractName }}</text>
<!-- #ifdef QUICKAPP-WEBVIEW || H5 --> <!-- #ifdef QUICKAPP-WEBVIEW || H5 -->
<text class="privacy-link" @tap="openPrivacyService">{{ privacyServiceName }}</text> <text class="privacy-link" @tap="openPrivacyService">{{ privacyServiceName }}</text>
<!-- #endif --> <!-- #endif -->
,当点击同意并继续时,即表示您已理解并同意该条款内容,该条款将对您产生法律约束力;如您不同意,将无法继续使用{{ appName }}相关功能。 {{ $lang('privacy.agreeTip') }}{{ appName }}{{ $lang('privacy.functionTip') }}
</view> </view>
<view class="privacy-button-flex"> <view class="privacy-button-flex">
<button class="privacy-button-btn bg-disagree" @tap="handleDisagree">不同意</button> <button class="privacy-button-btn bg-disagree" @tap="handleDisagree">{{ $lang('privacy.disagree') }}</button>
<!-- #ifdef QUICKAPP-WEBVIEW || MP-WEIXIN --> <!-- #ifdef QUICKAPP-WEBVIEW || MP-WEIXIN -->
<button id="agree-btn" class="privacy-button-btn bg-agree" open-type="agreePrivacyAuthorization" <button id="agree-btn" class="privacy-button-btn bg-agree" open-type="agreePrivacyAuthorization"
@agreeprivacyauthorization="handleAgree">同意并继续</button> @agreeprivacyauthorization="handleAgree">{{ $lang('privacy.agreeAndContinue') }}</button>
<!-- #endif --> <!-- #endif -->
<!-- #ifdef WEB || H5 --> <!-- #ifdef WEB || H5 -->
<button id="agree-btn" class="privacy-button-btn bg-agree" @tap="handleAgree" @click="handleAgree">同意并继续</button> <button id="agree-btn" class="privacy-button-btn bg-agree" @tap="handleAgree" @click="handleAgree">{{ $lang('privacy.agreeAndContinue') }}</button>
<!-- #endif --> <!-- #endif -->
</view> </view>
</view> </view>

View File

@@ -11,59 +11,59 @@
<scroll-view scroll-y="true" class="register-box"> <scroll-view scroll-y="true" class="register-box">
<view class="reward-content"> <view class="reward-content">
<view class="reward-item" v-if="reward.point > 0"> <view class="reward-item" v-if="reward.point > 0">
<view class="head">积分奖励</view> <view class="head">{{ $lang('reward.pointReward') }}</view>
<view class="content"> <view class="content">
<view class="info"> <view class="info">
<view> <view>
<text class="num">{{ reward.point }}</text> <text class="num">{{ reward.point }}</text>
<text class="type">积分</text> <text class="type">{{ $lang('reward.point') }}</text>
</view> </view>
<view class="desc">用于下单时抵现或兑换商品等</view> <view class="desc">{{ $lang('reward.pointDesc') }}</view>
</view> </view>
<view class="tip" @click="closeRewardPopup('point')">立即查看</view> <view class="tip" @click="closeRewardPopup('point')">{{ $lang('reward.viewNow') }}</view>
</view> </view>
</view> </view>
<view class="reward-item" v-if="reward.growth > 0"> <view class="reward-item" v-if="reward.growth > 0">
<view class="head">成长值</view> <view class="head">{{ $lang('reward.growthReward') }}</view>
<view class="content"> <view class="content">
<view class="info"> <view class="info">
<view> <view>
<text class="num">{{ reward.growth }}</text> <text class="num">{{ reward.growth }}</text>
<text class="type">成长值</text> <text class="type">{{ $lang('reward.growth') }}</text>
</view> </view>
<view class="desc">用于提升会员等级</view> <view class="desc">{{ $lang('reward.growthDesc') }}</view>
</view> </view>
<view class="tip" @click="closeRewardPopup('growth')">立即查看</view> <view class="tip" @click="closeRewardPopup('growth')">{{ $lang('reward.viewNow') }}</view>
</view> </view>
</view> </view>
<view class="reward-item" v-if="reward.balance > 0"> <view class="reward-item" v-if="reward.balance > 0">
<view class="head">红包奖励</view> <view class="head">{{ $lang('reward.hongbaoReward') }}</view>
<view class="content"> <view class="content">
<view class="info"> <view class="info">
<view> <view>
<text class="num">{{ reward.balance }}</text> <text class="num">{{ reward.balance }}</text>
<text class="type">元</text> <text class="type">{{ $lang('reward.yuan') }}</text>
</view> </view>
<view class="desc">不可提现下单时可用</view> <view class="desc">{{ $lang('reward.hongbaoDesc') }}</view>
</view> </view>
<view class="tip" @click="closeRewardPopup('balance')">立即查看</view> <view class="tip" @click="closeRewardPopup('balance')">{{ $lang('reward.viewNow') }}</view>
</view> </view>
</view> </view>
<view class="reward-item" v-if="reward.coupon_list.length > 0"> <view class="reward-item" v-if="reward.coupon_list.length > 0">
<view class="head">优惠券奖励</view> <view class="head">{{ $lang('reward.couponReward') }}</view>
<view class="content" v-for="(item, index) in reward.coupon_list" :key="index"> <view class="content" v-for="(item, index) in reward.coupon_list" :key="index">
<view class="info"> <view class="info">
<view> <view>
<text class="num coupon-name">{{ item.coupon_name }}</text> <text class="num coupon-name">{{ item.coupon_name }}</text>
</view> </view>
<view class="desc" v-if="item.at_least > 0"> <view class="desc" v-if="item.at_least > 0">
满{{ item.at_least }}{{ item.type == 'discount' ? '打' + item.discount + '折' : '减' + item.money }} {{ $lang('reward.full') }}{{ item.at_least }}{{ item.type == 'discount' ? $lang('reward.discount') + item.discount + $lang('reward.zhe') : $lang('reward.minus') + item.money }}
</view> </view>
<view class="desc" v-else> <view class="desc" v-else>
无门槛,{{ item.type == 'discount' ? '打' + item.discount + '折' : '减' + item.money }} {{ $lang('reward.noThreshold') }},{{ item.type == 'discount' ? $lang('reward.discount') + item.discount + $lang('reward.zhe') : $lang('reward.minus') + item.money }}
</view> </view>
</view> </view>
<view class="tip" @click="closeRewardPopup('coupon')">立即查看</view> <view class="tip" @click="closeRewardPopup('coupon')">{{ $lang('reward.viewNow') }}</view>
</view> </view>
</view> </view>
</view> </view>

View File

@@ -13,14 +13,14 @@
<uni-popup ref="confirmPopup" type="center"> <uni-popup ref="confirmPopup" type="center">
<view class="confirm-popup"> <view class="confirm-popup">
<view class="popup-header"> <view class="popup-header">
<text>添加企业微信客服</text> <text>{{ $lang('chat.addEnterpriseWeChat') }}</text>
</view> </view>
<view class="popup-body"> <view class="popup-body">
<text>点击确定后将跳转至企业微信,添加专业客服为您服务</text> <text>{{ $lang('chat.confirmAddWeChatTip') }}</text>
</view> </view>
<view class="popup-footer"> <view class="popup-footer">
<button class="cancel-btn" @click="closePopup">取消</button> <button class="cancel-btn" @click="closePopup">{{ $lang('chat.cancel') }}</button>
<button class="confirm-btn" @click="confirmAdd">确定</button> <button class="confirm-btn" @click="confirmAdd">{{ $lang('chat.confirm') }}</button>
</view> </view>
</view> </view>
</uni-popup> </uni-popup>