diff --git a/App.vue b/App.vue index 8f62dff8..f68a6320 100644 --- a/App.vue +++ b/App.vue @@ -27,10 +27,6 @@ that.$store.commit('changePhoneInfo', { platform: e.platform }) - let language = uni.getStorageSync('language') ? uni.getStorageSync('language') : e - .language == "zh-CN" ? "zh-Hans" : e.language - uni.setStorageSync('language', language) - console.log("getSystemInfo", language, e) } }) if (platform === 'ios') { // ios首次安装没有网络 @@ -78,7 +74,7 @@ that.handleoginversion() that.handleCityList() that.handleCooperationUrl() - console.log('App Launch') + console.log('App Launch', uni.getLocale()) }, onShow: function() { console.log('App Show') @@ -94,15 +90,27 @@ // 版本信息 handleoginversion() { let that = this - that.$model.getloginversion({}).then(res => { - // #ifdef MP-WEIXIN - uni.setStorageSync('language', 'en') - // #endif + that.$model.getloginversion({ + is_wechat: uni.getSystemInfoSync().uniPlatform == 'app' ? false : true + }).then(res => { that.$store.commit('changeLanguage', res.data.language_arr) if (res.code == 0) { + // uni.setLocale(res.data.language) + uni.setStorageSync('language', res.data.language) uni.$emit('login-sucesss'); + console.log("已登录手机语言", res.data.language) } else { - uni.$emit('need-login'); + uni.getSystemInfo({ + success(e) { + let language = uni.getStorageSync('language') ? uni.getStorageSync( + 'language') : e.language.indexOf("zh") != -1 ? "zh-Hans" : e + .language + uni.setLocale(language) + uni.setStorageSync('language', language) + uni.$emit('need-login'); + console.log("未登录手机语言", language) + } + }) } // #ifdef APP-PLUS||APP that.$store.commit('changePhoneInfo', { diff --git a/element/headerIndex.vue b/element/headerIndex.vue index 492e3a0a..bce55339 100644 --- a/element/headerIndex.vue +++ b/element/headerIndex.vue @@ -8,10 +8,13 @@ {{info.nickname}} - {{$t("common.infoGender")}}:{{info.gender==1?$t("common.infoMan"):info.gender==2?$t("common.infoWoman"):$t("common.infoUnknown")}} + {{$t("common.infoGender")}}:{{info.gender==1?$t("common.infoMan"):info.gender==2?$t("common.infoWoman"):$t("common.infoUnknown")}} {{$t("common.infoAge")}}:{{info.age}}{{$t("common.infoAgeunit")}} - {{$t("common.infoNowUser")}}{{$t("common.infoAddress")}}:{{info.address}} + + {{$t("common.infoNowUser")}}{{$t("common.infoAddress")}}:{{info.address}} + @@ -75,6 +78,7 @@ province: [], //省 city: [], //市 area: [], //区 + language: "", indicatorStyle: `height: 45px;`, }; }, @@ -107,6 +111,7 @@ that.handleCityList() } }, 1000); + that.language = uni.getStorageSync('language') ? uni.getStorageSync('language') : uni.getLocale() }, watch: { userAddress() { diff --git a/locale/en.json b/locale/en.json index 679034ac..fc9c0e52 100644 --- a/locale/en.json +++ b/locale/en.json @@ -136,6 +136,7 @@ "titleContrast": "Data comparison", "titleDetail": "Details", "titleBody": "Curve/Target", + "titleIncrement": "Increment", "titleLanguage": "Language switching", @@ -229,7 +230,7 @@ "infoHeight": "height", - "infoHead": "head circumference", + "infoHead": "HC", "infoWeight": "weight", @@ -259,7 +260,7 @@ "linkBluetooth": { - "onBluetoothTips": "Please search for the device while it is powered on.", + "onBluetoothTips": "Please make sure the device is on.", "onBluetoothHaveFound": "Has been discovered", @@ -269,72 +270,76 @@ "onBluetoothBind": "Device Binding Process Description", - "onBluetoothSelect": "Select Bluetooth for binding", + "onBluetoothSelect": "Select BLE for binding", - "onPhoneBluetoothTips": "The phone's Bluetooth is not turned on.", + "onPhoneBluetoothTips": "The phone's BLE is not turned on.", - "onDeviceBluetoothTips": "Please make sure the device is powered on and the Bluetooth permission on your phone is enabled!", + "onDeviceBluetoothTips": "Please make sure the device is powered on and the BLE permission on your phone is enabled!", - "Youdaoplaceholder0 ": "You need to authorize the use of Bluetooth on your phone", + "accreditTips ": "You need to authorize the use of your mobile phone's BLE", - "openBluetoothSuccess": "Bluetooth permission was obtained successfully. Reconnect to Bluetooth.", + "openBluetoothSuccess": "BLE permission was obtained successfully. Reconnect to BLE.", - "openSettingFail": "Permission acquisition failed. Measurement cannot be conducted using the phone's Bluetooth.", + "openSettingFail": "Failed to obtain permission", "isLinkBluetooth": "Please connect the device first.", "startlinkBluetooth": "Start Connecting", - "linkBluetooth": "Bluetooth connection in progress", + + "linkBluetooth": "BLE connection in progress", - "anewlinkBluetooth": "Reconnect", + "anewlinkBluetooth": "reconnection", - "linkBluetoothFail": "Device connection failed. Return to the home page and reconnect.", - - "linkBluetoothSuccess": "Bluetooth connection successful. Please start measuring.", + "linkBluetoothFail": "Connection failed", + + "linkBluetoothSuccess": "The connection is successful. Start measuring", "startSearchBluetooth": "Start searching", - "searchBluetooth": "Bluetooth search ongoing", + "searchBluetooth": "BLE search ongoing", - "searchBluetoothFail": "Re-search", - "Nodevicefound": "No Bluetooth device was found", + "searchBluetoothFail": "Search again", + + "Nodevicefound": "No BLE device was found", "onDeviceMeasureTips": "Please make sure the device is on.", - "openDeviceeMeasureTips": "Please make sure your phone's Bluetooth and location information are turned on.", + "openDeviceeMeasureTips": "Please turn on the Bluetooth of your mobile phone", + "openDeviceeMeasureTips2": "Please turn on the location information of your mobile phone", - "deviceDisconnection": "The connection with the device was interrupted during the measurement process. Please reconnect the device and start the measurement again.", - "offBluetooth": "Bluetooth is turned off. Please turn it on again before starting the measurement.", + "deviceDisconnection": "Connection interrupted Reconnect", + + "offBluetooth": "BLE is turned off. Measure after turning on BLE.", "remeasure": "Remeasure", "StableWeight": "Stable weight", - "StableWeightText": "Your stable weight is :", + "StableWeightText": "stable weight is :", "realTimeWeight": "Real-time weight", - "realTimeWeightText": "Your real-time weight is :", + "realTimeWeightText": "real-time weight is :", "heightText": "Your height is", - "zeroBtn": "Reset to zero", + "zeroBtn": "zero", "LockBtn": "Lock", - "SaveResult": "Save the result", + "SaveResult": "Save", - "measureResultTips": "Measurement Result Prompts", + "measureResultTips": "Measurement Result Tips", - "nowWeight": "The weight measured this time is", + "nowWeight": "this weight ", - "lastHeight": "The last height measurement was:", + "lastHeight": "last height ", - "lastWeight": "The last measured weight was:", - - "nowHeight": "The height measured this time is:", - "lastHead": "The last measurement of head circumference was:", + "lastWeight": "last weight ", + "nowHeight": "this height ", + + "lastHead": "last head ", "errorOperation": "Operation error. Please remeasure." }, @@ -496,6 +501,7 @@ "index.Standard": "Standard value", "bmi.desc": "BMI stands for Body Mass Index, which is currently a commonly used international standard for measuring the degree of fatness or thinness of the human body and whether it is healthy.", + "inheritHeighet.title": "Adult Height Prediction", "inheritHeighet.dad": "Dad's height", diff --git a/locale/zh.json b/locale/zh.json index 23c037a9..b29830f1 100644 --- a/locale/zh.json +++ b/locale/zh.json @@ -79,6 +79,7 @@ "titleBusinesSList": "设备列表", "titleBusinesSearch": "搜索设备", "titleInheritHeighet": "身高预测", + "titleIncrement": "增量对比", "titleBmi": "BMI测评", "titlePhone": "绑定手机号", "titleEmail": "绑定邮箱", diff --git a/main.js b/main.js index 40b5a4bd..7d351e96 100644 --- a/main.js +++ b/main.js @@ -18,7 +18,7 @@ Vue.prototype.$model = model; // 语言 let i18nConfig = { - locale: uni.getStorageSync('language'), + locale: uni.getStorageSync('language') ? uni.getStorageSync('language') : uni.getLocale(), messages } diff --git a/pageTwo/devices/B20.vue b/pageTwo/devices/B20.vue index b6c0fac3..077e4c5a 100644 --- a/pageTwo/devices/B20.vue +++ b/pageTwo/devices/B20.vue @@ -1,7 +1,7 @@