qukaidi il y a 4 ans
Parent
commit
8929a92c93

+ 11 - 1
App.vue

@@ -7,7 +7,8 @@
 		data() {
 			return {
 				show: false,
-				content: '东临碣石,以观沧海'
+				content: '东临碣石,以观沧海',
+				lang:""
 			}
 		},
 		// 此处globalData为了演示其作用,不是uView框架的一部分
@@ -39,6 +40,15 @@
 					type: "redirect"
 				})
 			}
+			let _this=this
+			uni.getStorage({
+				key: "lang",
+				success:e=>{
+					if(e.data){
+						this.$i18n.locale = e.data
+					}
+				}
+			})
 		},
 		// onLaunch() {
 		// 	this.$u.route({

+ 52 - 2
common/locales/zh.js

@@ -1,4 +1,5 @@
 export default {
+	//登录
 	login: {
 		code: "获取验证码",
 		login: "登录",
@@ -16,6 +17,7 @@ export default {
 		repeatcode:"倒计时结束后再发送",
 		telcode:"请输入手机号"
 	},
+	//注册
 	register:{
 		tips:"请按照要求上传您的营业执照和门头照片",
 		uplicense:"请上传营业执照",
@@ -31,7 +33,55 @@ export default {
 		errAnalyse: "识别失败",
 		sucupload:"上传成功",
 		delupload:"移除成功",
-		reloadText:"点击重试1"
+		reloadText:"点击重试"
+	},
+	//注册2
+	register_2:{
+		cardtitle:"基本信息",
+		storeText:"门店名称",
+		store:"请输入门店名称",
+		companyText:"公司名称",
+		company:"请输入公司名称",
+		notwrite:"不可修改",
+		name: "请输入联系人",
+		phone: "请输入联系电话",
+		code: '请输入验证码',
+		region: '点击选择省市区',
+		latitude: '点击选择详细地址',
+		nextstep:"下一步",
+		tipstitle:"温馨提示",
+		modelcontent: "如果店名和联系人与营业执照不一致,请重新上传清晰度更高的营业执照。",
+		storemessage: '门店名称必须为中文或英语、数字',
+		namemessage: '姓名长度至少在2个字符以上',
+		namemessage2: '姓名必须为中文或英文',
+		phonemessage: '手机号码不正确',
+		codemessage: '验证码为6位数',
+		codemessage2: '验证码只能为数字',
+		bd09Text:"正在转换坐标,请稍候",
+		repeatcode:"倒计时结束后再发送",
+		confirmText: "确认"
+	},
+	//注册3
+	register_3:{
+		cardtitle:"选择合作品牌",
+		cooperation:"点击选择合作品牌",
+		confirmText: "确认",
+		cancelText:"取消",
+		cardtitle2:"已选合作品牌",
+		cardtitle3:"合作品牌签约任务",
+		cardtitle4:"温馨提示",
+		cardText:"此地区暂无此品牌的经销商",
+		Text:"同意",
+		Text2:"《用户协议》",
+		Text3:"及",
+		Text4:"《隐私政策》",
+		confirmRegister:"确认注册",
+		cooperationmessage: '请选择品牌',
+		tips:"未正确选择经销商,请正确选择",
+		tips2:"请选择",
+		tips3:"品牌签约任务",
+		tips4:"请阅读并同意用户协议和隐私协议",
+		tips5:"注册资料已提交",
 	},
 	//页面标题
 	pagetitle:{
@@ -40,7 +90,7 @@ export default {
 		numberquery:'胎号查询',
 		supplier:'我的供应商',
 		brandmanagement:'我的经营品牌'
-		
+
 	},
 	unified:{
 		networkstate: '无网络,请连接网络后再试~',

+ 22 - 16
pages/login/index.vue

@@ -16,14 +16,15 @@
 					<view style="margin-top: 30rpx;">
 						<u-field v-model="code" :placeholder="$t('login.code')" label-width="50" maxlength="6">
 							<u-icon slot="icon" name="lock" size="36" color="#666666"></u-icon>
-							<u-button v-if="send!='zh'" size="mini" slot="right" type="primary" @click="getCode" shape="circle" :loading="codeLoading">{{codeText}}</u-button>
+							<u-button v-if="send=='zh'" size="mini" slot="right" type="primary" @click="getCode" shape="circle" :loading="codeLoading">{{codeText}}</u-button>
 							<u-button v-else size="mini" slot="right" type="primary" @click="getCode" shape="circle" :loading="codeLoading">{{codeText}}</u-button>
 						</u-field>
 					</view>
-					<view class="" v-if="send!='zh'">
-						<u-verification-code  ref="uCode" @change="codeChange"></u-verification-code>
+					<view class="" v-if="send=='zh'">
+						<u-verification-code ref="uCode" @change="codeChange"></u-verification-code>
 					</view>
-					<u-verification-code v-else ref="uCode" @change="codeChange" start-text="Send" change-text="Reacquire in X S" end-text="Reacquire"></u-verification-code>
+					<u-verification-code v-else ref="uCode" @change="codeChange" start-text="Send" change-text="Reacquire in X S"
+					 end-text="Reacquire"></u-verification-code>
 					<view style="margin-top: 80rpx;">
 						<u-button type="primary" :ripple="true" ripple-bg-color="#99d4ff" shape="circle" @tap="$u.debounce(submit, 2000,immediate = true)"
 						 :loading="loading">{{$t("login.login")}}</u-button>
@@ -43,8 +44,8 @@
 		</view>
 		<view class="foot">
 			<view class="u-flex u-row-center u-col-center">
-				<!-- <u-divider color="#0095FF" border-color="#0095FF" bg-color="#F4F4F4" fontSize="30" @click="switchLang">{{$t("login.Lan")}}</u-divider> -->
-				<u-divider color="#0095FF" border-color="#0095FF" bg-color="#F4F4F4" fontSize="30">赛轮集团</u-divider>
+				<u-divider color="#0095FF" border-color="#0095FF" bg-color="#F4F4F4" fontSize="30" @click="switchLang">{{$t("login.Lan")}}</u-divider>
+				<!-- <u-divider color="#0095FF" border-color="#0095FF" bg-color="#F4F4F4" fontSize="30">赛轮集团</u-divider> -->
 			</view>
 		</view>
 	</view>
@@ -65,14 +66,14 @@
 			return {
 				tel: '',
 				code: '',
-				codeText:"",
+				codeText: "",
 				pact: false,
 				loading: false,
 				codeLoading: false,
 				SystemInfo: '',
 				networkType: '',
 				version: '',
-				send:'',
+				send: '',
 			}
 		},
 		computed: {
@@ -109,12 +110,17 @@
 			uni.$on('loginphone', data => {
 				this.tel = data
 			})
+			this.send = this.$i18n.locale
+			console.log(this.send)
 		},
 		methods: {
 			switchLang() {
 				this.$i18n.locale = this.$i18n.locale == 'en' ? 'zh' : 'en';
-				this.send= this.$i18n.locale == 'en' ? 'zh' : 'en';
-				
+				this.send = this.$i18n.locale
+				uni.setStorage({
+					key: "lang",
+					data: this.$i18n.locale
+				})
 			},
 			...mapMutations(['login']),
 			judgeIosPermission() {
@@ -122,8 +128,8 @@
 				if (!result) {
 					uni.showModal({
 						title: this.$t('login.locationtitle'),
-						content:this.$t('login.locationcontent'),
-						cancelText:this.$t('login.locationcancelText'),
+						content: this.$t('login.locationcontent'),
+						cancelText: this.$t('login.locationcancelText'),
 						confirmText: this.$t('login.locationconfirmText'),
 						success: res => {
 							if (res.confirm) {
@@ -168,7 +174,7 @@
 						}
 					}).then(res => {
 						if (res.data.code == 0) {
-							
+
 							this.toUser(res.data.data)
 							uni.$emit('login', {
 								msg: this.$t('login.suclogin')
@@ -178,7 +184,7 @@
 							this.$u.toast(res.data.msg);
 						}
 					}).catch(err => {
-						
+
 						this.$u.toast(this.$t('login.errlogin'));
 					}).finally(() => {
 						this.loading = false
@@ -212,7 +218,7 @@
 								this.$u.toast(res.data.msg);
 							}
 						}).catch(err => {
-							
+
 						}).finally(() => {
 							this.codeLoading = false
 						})
@@ -244,7 +250,7 @@
 		position: fixed;
 		bottom: 10rpx;
 		width: 100%;
-		padding-bottom: 0;  
+		padding-bottom: 0;
 		padding-bottom: constant(safe-area-inset-bottom);
 		padding-bottom: env(safe-area-inset-bottom);
 	}

+ 1 - 1
pages/login/register.vue

@@ -9,7 +9,7 @@
 			</view>
 			<view slot="body">
 				<u-upload :custom-btn="true" max-count="1" class="u-flex u-row-center" :action="action" :form-data="licensepicType"
-				 @on-change="getLicensedata"  @on-remove="licenseRemove" :show-tips="false" :reloadText="this.$t('register.reloadText')">
+				 @on-change="getLicensedata"  @on-remove="licenseRemove" :show-tips="false">
 					<view slot="addBtn" hover-class="slot-btn__hover" hover-stay-time="150">
 						<u-image width="475rpx" height="303rpx" src="../../static/sailun/upload_preview.png"></u-image>
 					</view>

+ 8 - 8
pages/login/register_2.vue

@@ -4,7 +4,7 @@
 			<view slot="head">
 				<view class="u-flex">
 					<view style="width: 8rpx;height: 34rpx;background: #0292FD;margin-right:20rpx;"></view>
-					基本信息
+					{{$t('register_2.cardtitle')}}
 				</view>
 			</view>
 			<view slot="body">
@@ -13,30 +13,30 @@
 						<view style="margin-right: 10rpx;">
 							<u-icon name="home" size="36"></u-icon>
 						</view>
-						<view style="margin-right: 10rpx;">门店名称</view>
-						<u-input v-model="form.store" placeholder="请输入门店名称" />
+						<view style="margin-right: 10rpx;">{{$t('register_2.storeText')}}</view>
+						<u-input v-model="form.store" :placeholder="this.$t('register_2.store')" />
 					</u-form-item>
 					<u-form-item prop="company">
 						<view style="margin-right: 10rpx;">
 							<u-icon name="home" size="36"></u-icon>
 						</view>
-						<view style="margin-right: 10rpx;">公司名称</view>
-						<u-input v-model="form.company" placeholder="请输入公司名称" :disabled="true" />
+						<view style="margin-right: 10rpx;">{{$t('register_2.companyText')}}</view>
+						<u-input v-model="form.company" :placeholder="this.$t('register_2.company')" :disabled="true" />
 						<view style="font-size: 16rpx;color: red;">
-							不可修改
+							{{$t('register_2.notwrite')}}
 						</view>
 					</u-form-item>
 					<u-form-item prop="name">
 						<view style="margin-right: 10rpx;">
 							<u-icon name="account" size="36"></u-icon>
 						</view>
-						<u-input v-model="form.name" placeholder="请输入联系人" />
+						<u-input v-model="form.name" placeholder="this.$t('register_2.name')" />
 					</u-form-item>
 					<u-form-item prop="phone">
 						<view style="margin-right: 10rpx;">
 							<u-icon name="phone" size="36"></u-icon>
 						</view>
-						<u-input v-model="form.phone" placeholder="请输入联系电话" type="number" />
+						<u-input v-model="form.phone" :placeholder="this.$t('register_2.phone')" type="number" />
 					</u-form-item>
 					<u-form-item prop="code">
 						<view style="margin-right: 10rpx;">

+ 2 - 5
uview-ui/components/u-upload/u-upload.vue

@@ -254,17 +254,14 @@ export default {
 			type: [Number, String],
 			default: ''
 		},
-		reloadText:{
-			type: String,
-			default: '点击重试'
-		}
 	},
 	mounted() {},
 	data() {
 		return {
 			lists: [],
 			isInCount: true,
-			uploading: false
+			uploading: false,
+			reloadText:this.$t('register.reloadText')
 		};
 	},
 	watch: {