diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json index 81f13f4..6663cca 100644 --- a/.hbuilderx/launch.json +++ b/.hbuilderx/launch.json @@ -1,16 +1,20 @@ -{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/ - // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数 - "version": "0.0", - "configurations": [{ - "default" : - { - "launchtype" : "local" - }, - "mp-weixin" : - { - "launchtype" : "local" - }, - "type" : "uniCloud" - } +{ + // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/ + // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数 + "version" : "0.0", + "configurations" : [ + { + "default" : { + "launchtype" : "local" + }, + "mp-weixin" : { + "launchtype" : "local" + }, + "type" : "uniCloud" + }, + { + "playground" : "standard", + "type" : "uni-app:app-android" + } ] } diff --git a/App.vue b/App.vue index e6e53ac..1c1478d 100644 --- a/App.vue +++ b/App.vue @@ -1,31 +1,121 @@ diff --git a/assets/common.scss b/assets/common.scss index 5c86721..7788bea 100644 --- a/assets/common.scss +++ b/assets/common.scss @@ -844,7 +844,7 @@ page { .mubiao { width: 100%; - margin-top: 32rpx; + // margin-top: 32rpx; text-align: center; font-size: 26rpx; diff --git a/components/bluetooth_food.vue b/components/bluetooth_food.vue index 129be7a..c17cea1 100644 --- a/components/bluetooth_food.vue +++ b/components/bluetooth_food.vue @@ -3,10 +3,10 @@ - {{bleTipsText}} + {{bletipstext}} - 断开连接 + {{$t('Disconnect')}} @@ -25,20 +25,20 @@ - 单位 + {{$t('UnitBtn')}} - 保存 + {{$t('Save')}} + - 清零 + {{$t('resetBtn')}} - @@ -57,7 +57,6 @@ kcal: 0, unit: '', // weight: "", - bleTipsText: "", inputDialog: false, unitList: [{ name: "克", @@ -69,7 +68,7 @@ unit: "oz" }], unitListIndex: 0, - units: ['kg', '斤', 'st:lb', 'lb', 'g', 'ml', 'Waterml', + units: ['kg', 'g', 'st:lb', 'lb', 'g', 'ml', 'Waterml', 'milkml', 'oz', 'floz', 'lboz' ] } @@ -87,16 +86,20 @@ computed: { ...mapState(["bleValue", "isBluetoothTyle", "countFoodInfo"]), weight() { - this.kcal = (Number(this.weightKcal) / 100 * this.bleValue.countWeight).toFixed(2) + let kcal = (Number(this.weightKcal) / 100 * this.bleValue.countWeight).toFixed(2) this.unit = this.bleValue.unit + this.bleTipsText = this.bleValue.bleTipsText + this.kcal = this.convertToGrams(kcal, this.bleValue.unit).toFixed(2) return this.bleValue.countWeight }, isConnection() { - this.bleTipsText = this.bleValue.bleTipsText return this.bleValue.isConnectStatus }, isShow() { return this.bleValue.serviceId != '' ? true : false + }, + bletipstext() { + return this.bleValue.bleTipsText } }, @@ -117,7 +120,7 @@ if (!that.isBluetoothTyle) { that.handleBack() } - }, + } }, methods: { // 初始化蓝牙 @@ -132,18 +135,18 @@ write: '', unit: "g", countWeight: "", - bleTipsText: "蓝牙搜索中", + bleTipsText: that.$t('SearchBluetooth'), isConnectStatus: 0, }) that.$ble.openBluetoothAdapter() }, - + changleUnits(e) { let that = this - let name = that.unitList[e.detail.value].name + let name = that.unitList[e.detail.value].unit console.log("单位切换", name, that.unit) - if (that.isShow && that.unit != name) { - that.handletoggleUnit(name == '盎司' ? 0x08 : 0x04) + if (that.isShow && that.unit != unit) { + that.handletoggleUnit(name == 'oz' ? 0x08 : 0x04) } that.unitListIndex = [e.detail.value] that.$store.commit('changeBluetoothValue', { @@ -192,19 +195,33 @@ if (Number(that.weight) > 0) { that.$emit("handleBle", that.weight, that.unit, that.kcal) } else { - that.$tools.msg("数据异常,请清零后重新测量!") + that.$tools.msg(that.$t('reset')) } }, handleBack() { let that = this that.$store.commit("changeBluetoothValue", { - bleTipsText: "连接失败,点击重新连接", + bleTipsText: that.$t('ConnectionTimeout'), isConnectStatus: 1 }) that.$ble.stopBluetoothDevicesDiscovery() //取消蓝牙搜索 that.$ble.closeBLEConnection(that.bleValue.deviceId) that.$ble.closeBluetoothAdapter() }, + convertToGrams(value, fromUnit) { + const conversionFactors = { + 'lb': 453.59237, // 1磅 = 453.59237克 + 'oz': 28.349523125, // 1盎司 = 28.349523125克 + 'kg': 1000, // 1公斤 = 1000克 + 'g': 1 + }; + + if (!conversionFactors.hasOwnProperty(fromUnit)) { + return '' + } + + return value * conversionFactors[fromUnit]; + }, unitConversion(unit) { if (unit == 'kcal') { @@ -221,7 +238,7 @@ // 添加食物 handleAddFood() { uni.navigateTo({ - url: "/pageTwo/count/search?name=早餐&time=" + this.countFoodInfo.date + url: "/pageTwo/count/search?index=0&time=" + this.countFoodInfo.date }) }, inputDialogToggle() { @@ -348,6 +365,7 @@ .text { color: #8284f0; display: flex; + align-items: center; } image { diff --git a/language/en.json b/language/en.json index 81c5c29..b43aa32 100644 --- a/language/en.json +++ b/language/en.json @@ -1,14 +1,150 @@ { - "index.home": "index", - "index.component": "Component", - "index.api": "API", - "index.schema": "Schema", - "index.demo": "uni-app globalization", - "index.demo-description": "Include uni-framework, manifest.json, pages.json, tabbar, Page, Component, API, Schema", - "index.detail": "Detail", - "index.language": "Language", - "index.language-info": "Settings", - "index.system-language": "System language", - "index.application-language": "Application language", - "index.language-change-confirm": "Applying this setting will restart the app" + "msgTitle": "Friendly Reminder", + "msgUpgradeFail": "Upgrade failed", + "msgDownloading": "Downloading", + "msgLatestVersion": "It's already the latest version!", + "msgCancel": "You have canceled the operation!", + "msgLoginSuccess": "Login successful!", + "msgDelete": "Deleted successfully", + "msgSetSuccess": "Setup successful", + "msgBottom": "That's it, let's look at something else", + "msgNoMoreData": "No more data available!", + "msgSetPasswordSuccess": "Password set successfully, entering the program!", + "msgAddUser": "Currently, there are no members. Please add one first", + "verifyNickName": "Please enter a nickname", + "verifyNotOptional": "Future dates are not selectable", + "verifyDate": "Please select the measurement date", + "verifyBirthday": "Please select your date of birth", + "verifyHeight": "Please enter your height", + "verifyWeight": "Please enter your weight", + "verifyGender": "Please select gender", + "verifyBontrast": "Please select data", + "verifyBodyDate": "Please choose the correct time", + "verifyRecord": "Please enter", + "verifyPicker": "Please select", + "verifyAccount": "Please enter a correct phone number or email address", + "verifyEmail": "Please enter your email", + "verifyEmailCorrect": "Please enter a correct email address", + "verifyMobile": "Please enter your phone number", + "verifyMobileCorrect": "Please enter a correct phone number", + "verifyCode": "Please enter the verification code", + "verifyPassword": "Please enter the password", + "verifyPasswordTwo": "Please enter the confirmation password", + "verifyPasswordCorrect": "Please confirm that the passwords entered are identical", + "verifyAgreement": "Please confirm and check the agreement first", + "verifyOutLogin": "Are you sure you want to log out?", + "verifyDeleteUser": "Should this member be deleted?", + "verifyDeleteHistory": "Do you want to delete the current measurement record?", + "verifyDeleteAccount": "After successful deletion, all associated information of the account will be cleared and cannot be retrieved. Are you sure you want to delete?", + "btnConfirm": "confirm", + "btnSubmit": "submit", + "btnSancellation": "Cancel", + "btnContinue": "continue", + "btnBack": "return", + "ConnectionTimeout": "Connection timed out, click to reconnect", + "Measuring": "During the measurement, please place the food on the scale", + "Weight": "weight", + "RecordWeight": "Please enter food weight", + "SearchBluetooth": "In Bluetooth search", + "Remeasure": "Data anomaly, please re-measure!", + "reset": "Data anomaly, please reset and measure again!", + "Disconnect": "Disconnect", + "remeasure": "remeasure", + "resetBtn": "Tare", + "UnitBtn": "unit", + "SaveResult": "save", + "titleHome": "home", + "titleMenu": "recipe", + "titleMenuAdd": "Add recipe", + "titleMenuSearch": "Search for recipes", + "titleCount": "Count food", + "titleCountList": "Ingredient library", + "titleCustomKcal": "Custom calorie", + "titleEveryMeal": "Meal details", + "titleCountSearch": "Ingredient search", + "titleeveryDay": "Nutritional Analysis", + "titleMe": "my", + "titleDetail": "Details", + "titleBody": "target", + "titleHistory": "Diet record", + "titlePhone": "Bind mobile number", + "titleEmail": "Bind email", + "titlePasswordEdit": "Change password", + "titleSet": "Settings", + "titleDate": "date", + "titleMember": "data", + "titleManage": "Member Management", + "titleManageAdd": "Add member", + "titleAboutUs": "About Us", + "titleSetPassword": "set password", + "titlePassword": "password", + "titleConfirmPassword": "Confirm Password", + "titleForgotPassword": "Forgot password", + "titleCode": "CAPTCHA", + "titleLanguage": "Language settings", + "titleSendCode": "Get verification code", + "titleSendCodeRetry": "Resend after S", + "titleLogin": "login", + "titleRegister": "register", + "titleToggleLogin": "Switch login", + "titleAccountText": "Mobile phone number/Email", + "titleAgreementText": "Read and agree", + "titleAgreementContntText": "Privacy Policy", + "titleVersionUpdate": "Version Update", + "titleNewVersion": "new version", + "infoActivityCoefficient": "Activity coefficient", + "infoPersonalProfile": "Personal Profile", + "infoMyRecipes": "My recipe", + "infoMyCollection": "My Collection", + "infoAvatar": "avatar", + "infoNickname": "nickname", + "infoMobile": "mobile phone number", + "infoEmail": "email", + "infoAge": "age", + "infoAgeunit": "year", + "infoGender": "gender", + "infoMan": "male", + "infoWoman": "female", + "infoUnknown": "unknown", + "infoBirthday": "Birthday", + "infoHeight": "height", + "infoWeight": "weight", + "btnEdit": "edit", + "btnDelete": "delete", + "btnAdd": "add", + "btnDetail": "View details", + "btnDeleteAccount": "Delete account", + "btnLogOut": "Log out", + "countIntake": "intake", + "countCalorieIntake": "caloric intake", + "countMealdetails": "Meal details", + "countAddFood": "Add food", + "countNutritionalProportion": "Nutrient composition", + "countComponentStatistics": "Ingredient statistics", + "countCalorieAnalysis": "Calorie analysis", + "countNutrientElementEnergyProportion": "Energy proportion", + "countNutritionClassification": "Nutrition classification", + "countNutritionElementRankingList": "Nutrient Rankings", + "countFoodTypes": "Food type", + + "total": "Total of", + "records": "records", + "Search": "Search", + "VoiceSearch": "VoiceSearch", + "Save": "Save", + "noMoreData": "There is no more data", + "HistoricalSearch": "Historical search", + "wantSearch": "I guess you want to search", + "verifyCalorie": "Please enter calories", + "kcal": "Calorie", + "countNoFood": "NO Food Yet", + "msgLoginTips": "Log in to view more", + "Nutrients": "Nutrients", + "Content": "Content", + "CaloriesAndnutrients": "Calories and nutrients", + "ImproveInformation": "Improve information", + "WhetherTodelete": "Whether to delete", + "BusinessCooperation": "Businesscooperation", + "verifyActivityCoefficient": "Please select the activity coefficient" + } \ No newline at end of file diff --git a/language/index.js b/language/index.js index 99737b0..ea4ac1b 100644 --- a/language/index.js +++ b/language/index.js @@ -2,11 +2,31 @@ import en from './en.json' import zh from './zh.json' import zhHant from './zh-Hant.json' import ja from './ja.json' +import fr from './fr.json' +import de from './de.json' +import ko from './ko.json' +import ru from './ru.json' +import pt from './pt.json' +import es from './es.json' +import ar from './ar.json' export default { - zh, + zh, //中文 en, // 英语 ja, //日语 + fr, //法语 + de, //德语 + ko, //韩语 + ru, //俄语 + pt, //葡萄牙 + es, //西班牙 + ar, //阿拉伯 "zh-Hans": zh, //中文 'zh-Hant': zhHant, //繁体 - "en-CN": en + "en-CN": en, + "jp":ja, + "fra":fr, + "kor":ko, + "spa":es, + "ara":ar, + } \ No newline at end of file diff --git a/language/ja.json b/language/ja.json index 0dc3a8d..17a7322 100644 --- a/language/ja.json +++ b/language/ja.json @@ -1,15 +1,151 @@ { - "index.title": "Hello i18n", - "index.home": "ホーム", - "index.component": "コンポーネント", - "index.api": "API", - "index.schema": "Schema", - "index.demo": "uni-app globalization", - "index.demo-description": "ユニフレームワーク、manifest.json、pages.json、タブバー、ページ、コンポーネント、APIを含める、Schema", - "index.detail": "詳細", - "index.language": "言語", - "index.language-info": "設定", - "index.system-language": "システム言語", - "index.application-language": "アプリケーション言語", - "index.language-change-confirm": "この設定を適用すると、アプリが再起動します" -} + + "msgTitle": "友情のヒント", + "msgUpgradeFail": "アップグレード失敗", + "msgDownloading": "ダウンロード中", + "msgLatestVersion": "最新バージョンですよ!", + "msgCancel": "操作をキャンセルしました!", + "msgLoginSuccess": "ログイン成功!", + "msgDelete": "削除に成功しました", + "msgSetSuccess": "設定完了", + "msgBottom": "これ以上ありません。他のものを見てみましょう", + "msgNoMoreData": "これ以上データはありません!", + "msgSetPasswordSuccess": "パスワード設定完了、プログラムに入ります!", + "msgAddUser": "メンバーがまだいません。まず追加してください", + "verifyNickName": "ニックネームを入力してください", + "verifyNotOptional": "将来の日付は選択できません", + "verifyDate": "測定日を選択してください", + "verifyBirthday": "生年月日を選択してください", + "verifyHeight": "身長を入力してください", + "verifyWeight": "体重を入力してください", + "verifyGender": "性別を選択してください", + "verifyBontrast": "データを選択してください", + "verifyBodyDate": "正しい時間を選択してください", + "verifyRecord": "入力してください", + "verifyPicker": "選択してください", + "verifyAccount": "正しい携帯電話番号またはメールアドレスを入力してください", + "verifyEmail": "メールアドレスを入力してください", + "verifyEmailCorrect": "正しいメールアドレスを入力してください", + "verifyMobile": "携帯電話番号を入力してください", + "verifyMobileCorrect": "正しい携帯電話番号を入力してください", + "verifyCode": "認証コードを入力してください", + "verifyPassword": "パスワードを入力してください", + "verifyPasswordTwo": "確認用パスワードを入力してください", + "verifyPasswordCorrect": "パスワードが一致しているか確認してください", + "verifyAgreement": "まず、同意書を確認してチェックしてください", + "verifyOutLogin": "ログアウトしますか?", + "verifyDeleteUser": "このメンバーを削除しますか?", + "verifyDeleteHistory": "現在の測定記録を削除しますか?", + "verifyDeleteAccount": "削除に成功すると、そのアカウントに関連するすべての情報が消去され、復元できません。削除しますか?", + "btnConfirm": "確認", + "btnSubmit": "提出", + "btnSancellation": "キャンセル", + "btnContinue": "続ける", + "btnBack": "戻る", + "ConnectionTimeout": "接続タイムアウト、再接続をクリックしてください", + "Measuring": "測定中は、食べ物をはかりの上に置いてください", + "Weight": "重量", + "RecordWeight": "食品の重量を入力してください", + "SearchBluetooth": "Bluetooth検索中", + "Remeasure": "データに異常があります。再度計測してください!", + "reset": "データ異常です。ゼロにしてから再度測定してください!", + "Disconnect": "接続を切断", + "remeasure": "再測定", + "resetBtn": "ゼロクリア", + "UnitBtn": "単位", + "SaveResult": "保存", + "titleHome": "ホームページ", + "titleMenu": "レシシピ", + "titleMenuAdd": "レシピを追加", + "titleMenuSearch": "レシピ検索", + "titleCount": "食事の計算", + "titleCountList": "食材庫(しょかいく)", + "titleCustomKcal": "カスタムカロリー", + "titleEveryMeal": "食事の詳細", + "titleCountSearch": "食材検索", + "titleeveryDay": "栄養分析", + "titleMe": "私の", + "titleDetail": "詳細", + "titleBody": "目標", + "titleHistory": "食事記録", + "titlePhone": "携帯電話番号の紐付け", + "titleEmail": "メールアドレスの紐付け", + "titlePasswordEdit": "パスワードを変更する", + "titleSet": "設定", + "titleDate": "日付", + "titleMember": "資料", + "titleManage": "メンバー管理", + "titleManageAdd": "メンバー追加", + "titleAboutUs": "私たちについて", + "titleSetPassword": "パスワードを設定する", + "titlePassword": "パスワード", + "titleConfirmPassword": "確認用パスワード", + "titleForgotPassword": "パスワードを忘れた", + "titleCode": "認証コード", + "titleLanguage": "言語設定", + "titleSendCode": "認証コードを取得する", + "titleSendCodeRetry": "S後再送", + "titleLogin": "ログイン", + "titleRegister": "登録", + "titleToggleLogin": "ログイン切り替え", + "titleAccountText": "携帯電話番号/メールアドレス", + "titleAgreementText": "読み、同意する", + "titleAgreementContntText": "プライバシーポリシー", + "titleVersionUpdate": "バージョンアップデート", + "titleNewVersion": "新バージョン", + "infoActivityCoefficient": "活動係数", + "infoPersonalProfile": "個人情報", + "infoMyRecipes": "私のレシピ", + "infoMyCollection": "私のコレクション", + "infoAvatar": "アバター", + "infoNickname": "ニックネーム", + "infoMobile": "携帯電話番号", + "infoEmail": "メールボックス", + "infoAge": "年齢", + "infoAgeunit": "歳", + "infoGender": "性別", + "infoMan": "男", + "infoWoman": "女(おんな)", + "infoUnknown": "未知(みちゅう)", + "infoBirthday": "生年月日", + "infoHeight": "身長", + "infoWeight": "体重", + "btnEdit": "編集", + "btnDelete": "削除", + "btnAdd": "追加", + "btnDetail": "詳細を見る", + "btnDeleteAccount": "アカウント削除", + "btnLogOut": "ログアウト", + "countIntake": "摂取", + "countCalorieIntake": "熱量摂取", + "countMealdetails": "食事の詳細", + "countAddFood": "食品を追加する", + "countNutritionalProportion": "栄養の割合", + "countComponentStatistics": "成分統計", + "countCalorieAnalysis": "カロリー分析", + "countNutrientElementEnergyProportion": "栄養素のエネルギー割合", + "countNutritionClassification": "栄養分類", + "countNutritionElementRankingList": "栄養素ランキング", + "countFoodTypes": "食品タイプ", + + "total": "共です", + "records": "記録します", + "Search": "検索します", + "VoiceSearch": "音声検索です", + "Save": "保存します", + "noMoreData": "これ以上のデータはありません", + "HistoricalSearch": "履歴検索です", + "wantSearch": "あなたが探していると思います", + "verifyCalorie": "カロリー入力お願いします。", + "kcal": "カロリーです", + "countNoFood": "しばらく食べ物がありません", + "msgLoginTips": "ログインしてもっと見ます", + "Nutrients": "栄養素です", + "Content": "含有量です", + "CaloriesAndnutrients": "カロリーと栄養です", + "ImproveInformation": "情報を補完します", + "WhetherTodelete": "削除しますか", + "BusinessCooperation": "ビジネス提携です", + "verifyActivityCoefficient": "活動係数を選択します" + +} \ No newline at end of file diff --git a/language/uni-app.ja.json b/language/uni-app.ja.json deleted file mode 100644 index 41cef76..0000000 --- a/language/uni-app.ja.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "common": { - "uni.app.quit": "もう一度押すと、アプリケーションが終了します", - "uni.async.error": "サーバーへの接続がタイムアウトしました。画面をクリックして再試行してください", - "uni.showActionSheet.cancel": "キャンセル", - "uni.showToast.unpaired": "使用するには、showToastとhideToastをペアにする必要があることに注意してください", - "uni.showLoading.unpaired": "使用するには、showLoadingとhideLoadingをペアにする必要があることに注意してください", - "uni.showModal.cancel": "キャンセル", - "uni.showModal.confirm": "OK", - "uni.chooseImage.cancel": "キャンセル", - "uni.chooseImage.sourceType.album": "アルバムから選択", - "uni.chooseImage.sourceType.camera": "カメラ", - "uni.chooseVideo.cancel": "キャンセル", - "uni.chooseVideo.sourceType.album": "アルバムから選択", - "uni.chooseVideo.sourceType.camera": "カメラ", - "uni.previewImage.cancel": "キャンセル", - "uni.previewImage.button.save": "画像を保存", - "uni.previewImage.save.success": "画像をアルバムに正常に保存します", - "uni.previewImage.save.fail": "画像をアルバムに保存できませんでした", - "uni.setClipboardData.success": "コンテンツがコピーされました", - "uni.scanCode.title": "スキャンコード", - "uni.scanCode.album": "アルバム", - "uni.scanCode.fail": "認識に失敗しました", - "uni.scanCode.flash.on": "タッチして点灯", - "uni.scanCode.flash.off": "タップして閉じる", - "uni.startSoterAuthentication.authContent": "指紋認識...", - "uni.picker.done": "完了", - "uni.picker.cancel": "キャンセル", - "uni.video.danmu": "「弾幕」", - "uni.video.volume": "ボリューム", - "uni.button.feedback.title": "質問のフィードバック", - "uni.button.feedback.send": "送信" - }, - "ios": {}, - "android": {} -} diff --git a/language/zh.json b/language/zh.json index 122a638..d7c254a 100644 --- a/language/zh.json +++ b/language/zh.json @@ -1,162 +1,148 @@ { - "tips": { - "msgTitle": "友情提示", - "msgUpgradeFail": "升级失败", - "msgDownloading": "正在下载", - "msgLatestVersion": "已经是最新版本了!", - "msgCancel": "您已取消操作!", - "msgLoginSuccess": "登录成功!", - "msgDelete": "删除成功", - "msgSetSuccess": "设置成功", - "msgBottom": "到底了,看看别的吧", - "msgNoMoreData": "没有更多数据了!", - "msgSetPasswordSuccess": "密码设置成功,进入程序中!", - "msgAddUser": "暂无成员,请先添加", - "verifyNickName": "请输入昵称", - "verifyNotOptional": "未来日期不可选", - "verifyDate": "请选择测量日期", - "verifyBirthday": "请选择出生日期", - "verifyHeight": "请输入身高", - "verifyWeight": "请输入体重", - "verifyGender": "请选择性别", - "verifyBontrast": "请选择数据", - "verifyBodyDate": "请选择正确的时间", - "verifyRecord": "请输入", - "verifyPicker": "请选择", - "verifyAccount": "请输入正确的手机号或邮箱", - "verifyEmail": "请输入邮箱", - "verifyEmailCorrect": "请输入正确的邮箱", - "verifyMobile": "请输入手机号", - "verifyMobileCorrect": "请输入正确的手机号", - "verifyCode": "请输入验证码", - "verifyPassword": "请输入密码", - "verifyPasswordTwo": "请输入确认密码", - "verifyPasswordCorrect": "请确认两次密码填写一致", - "verifyAgreement": "请先确认并勾选协议", - "verifyOutLogin": "是否退出登录?", - "verifyDeleteUser": "是否删除该成员?", - "verifyDeleteHistory": "是否删除当前测量记录?", - "verifyDeleteAccount": "删除成功后,该账号的所有关联信息将被清空且无法找回,是否删除?", - "btnConfirm": "确认", - "btnSubmit": "提交", - "btnSancellation": "取消", - "btnContinue": "继续", - "btnBack": "返回", - "btnDelete": "删除" - }, - "linkBluetooth": { - "onBluetoothTips": "请在设备开机状态下,搜索设备", - "onBluetoothHaveFound": "已发现", - "onBluetoothDevice": "个设备", - "onBluetoothMac": "mac地址", - "onBluetoothBind": "设备绑定流程说明", - "onBluetoothSelect": "选择蓝牙进行绑定", - "onPhoneBluetoothTips": "手机蓝牙未打开", - "onDeviceBluetoothTips": "请确定设备是开机状态、手机蓝牙权限已打开!", - "accreditTips": "需要您授权使用手机蓝牙", - "openBluetoothSuccess": "蓝牙权限获取成功,重新连接蓝牙", - "openSettingFail": "获取权限失败,将无法使用手机蓝牙进行测量", - "isLinkBluetooth": "请先连接设备", - "startlinkBluetooth": "开始连接", - "linkBluetooth": "蓝牙连接中", - "anewlinkBluetooth": "重新连接", - "linkBluetoothFail": "设备连接失败,返回首页重新连接", - "linkBluetoothSuccess": "蓝牙连接成功,请开始测量", - "startSearchBluetooth": "开始搜索", - "searchBluetooth": "蓝牙搜索中", - "searchBluetoothFail": "重新搜索", - "Nodevicefound": "没有搜索到蓝牙设备", - "onDeviceMeasureTips": "请确定设备是开机状态", - "openDeviceeMeasureTips": "请确定手机蓝牙已打开", - "openDeviceeMeasureTips2": "请确定手机位置信息已打开", - "deviceDisconnection": "测量过程中已与设备连接中断,请重新连接设备再开始测量", - "offBluetooth": "蓝牙已关闭,请重新打开蓝牙后再开始测量", - "remeasure": "重新测量", - "zeroBtn": "清零", - "UnitBtn": "单位", - "SaveResult": "保存结果", - "measureResultTips": "测量结果提示" - }, - "common": { - "titleHome": "首页", - "titleMenu": "菜谱", - "titleMenuAdd": "添加食谱", - "titleMenuSearch": "搜索菜谱", - "titleCount": "计食", - "titleCountList": "食材库", - "titleCustomKcal": "自定义卡路里", - "titleEveryMeal": "餐食详情", - "titleCountSearch": "食材搜索", - "titleeveryDay": "营养分析", - "titleMe": "我的", - "titleDetail": "详情", - "titleBody": "目标", - "titleHistory": "饮食记录", - "titlePhone": "绑定手机号", - "titleEmail": "绑定邮箱", - "titlePasswordEdit": "修改密码", - "titleSet": "设置", - "titleDate": "日期", - "titleMember": "资料", - "titleManage": "成员管理", - "titleManageAdd": "添加成员", - "titleAboutUs": "关于我们", - "titleSetPassword": "设置密码", - "titlePassword": "密码", - "titleConfirmPassword": "确认密码", - "titleForgotPassword": "忘记密码", - "titleCode": "验证码", - "titleLanguage": "语言设置", - "titleSendCode": "获取验证码", - "titleSendCodeRetry": "S后重发", - "titleLogin": "登录", - "titleRegister": "注册", - "titleToggleLogin": "切换登录", - "titleAccountText": "手机号/邮箱", - "titleAgreementText": "阅读并同意", - "titleAgreementContntText": "隐私协议", - "titleVersionUpdate": "版本更新", - "titleNewVersion": "新版本", - "infoActivityCoefficient": "活动系数", - "infoPersonalProfile": "个人资料", - "infoMyRecipes": "我的菜谱", - "infoMyCollection": "我的收藏", - "infoAvatar": "头像", - "infoNickname": "昵称", - "infoMobile": "手机号", - "infoEmail": "邮箱", - "infoAge": "年龄", - "infoAgeunit": "岁", - "infoGender": "性别", - "infoMan": "男", - "infoWoman": "女", - "infoUnknown": "未知", - "infoBirthday": "出生日期", - "infoHeight": "身高", - "infoWeight": "体重", - "btnEdit": "编辑", - "btnDelete": "删除", - "btnAdd": "添加", - "btnDetail": "查看详情", - "btnDeleteAccount": "删除账号", - "btnLogOut": "退出登录" - }, + "msgTitle": "友情提示", + "msgUpgradeFail": "升级失败", + "msgDownloading": "正在下载", + "msgLatestVersion": "已经是最新版本了!", + "msgCancel": "您已取消操作!", + "msgLoginSuccess": "登录成功!", + "msgDelete": "删除成功", + "msgSetSuccess": "设置成功", + "msgBottom": "到底了,看看别的吧", + "msgNoMoreData": "暂无数据!", + "msgSetPasswordSuccess": "密码设置成功,进入程序中!", + "msgAddUser": "暂无成员,请先添加", + "verifyNickName": "请输入昵称", + "verifyNotOptional": "未来日期不可选", + "verifyDate": "请选择测量日期", + "verifyBirthday": "请选择出生日期", + "verifyHeight": "请输入身高", + "verifyWeight": "请输入体重", + "verifyGender": "请选择性别", + "verifyBontrast": "请选择数据", + "verifyBodyDate": "请选择正确的时间", + "verifyRecord": "请输入", + "verifyPicker": "请选择", + "verifyAccount": "请输入正确的手机号或邮箱", + "verifyEmail": "请输入邮箱", + "verifyEmailCorrect": "请输入正确的邮箱", + "verifyMobile": "请输入手机号", + "verifyMobileCorrect": "请输入正确的手机号", + "verifyCode": "请输入验证码", + "verifyPassword": "请输入密码", + "verifyPasswordTwo": "请输入确认密码", + "verifyPasswordCorrect": "请确认两次密码填写一致", + "verifyAgreement": "请先确认并勾选协议", + "verifyOutLogin": "是否退出登录?", + "verifyDeleteUser": "是否删除该成员?", + "verifyDeleteHistory": "是否删除当前测量记录?", + "verifyDeleteAccount": "删除成功后,该账号的所有关联信息将被清空且无法找回,是否删除?", + "btnConfirm": "确认", + "btnSubmit": "提交", + "btnSancellation": "取消", + "btnContinue": "继续", + "btnBack": "返回", + "btnDelete": "删除", + "ConnectionTimeout": "连接超时,点击重新连接", + "Measuring": "测量中,请将食物放到秤上", + "Weight": "重量", + "RecordWeight": "请输入食物重量", + "SearchBluetooth": "蓝牙搜索中", + "Remeasure": "数据异常,请重新测量!", + "reset": "数据异常,请清零后重新测量!", + "Disconnect": "断开连接", + "remeasure": "重新测量", + "resetBtn": "清零", + "UnitBtn": "单位", + "titleHome": "首页", + "titleMenu": "菜谱", + "titleMenuAdd": "添加食谱", + "titleMenuSearch": "搜索菜谱", + "titleCount": "计食", + "titleCountList": "食材库", + "titleCustomKcal": "自定义卡路里", + "titleEveryMeal": "餐食详情", + "titleCountSearch": "食材搜索", + "titleeveryDay": "营养分析", + "titleMe": "我的", + "titleDetail": "详情", + "titleBody": "目标", + "titleHistory": "饮食记录", + "titlePhone": "绑定手机号", + "titleEmail": "绑定邮箱", + "titlePasswordEdit": "修改密码", + "titleSet": "设置", + "titleDate": "日期", + "titleMember": "资料", + "titleManage": "成员管理", + "titleManageAdd": "添加成员", + "titleAboutUs": "关于我们", + "titleSetPassword": "设置密码", + "titlePassword": "密码", + "titleConfirmPassword": "确认密码", + "titleForgotPassword": "忘记密码", + "titleCode": "验证码", + "titleLanguage": "语言设置", + "titleSendCode": "获取验证码", + "titleSendCodeRetry": "S后重发", + "titleLogin": "登录", + "titleRegister": "注册", + "titleToggleLogin": "切换登录", + "titleAccountText": "手机号/邮箱", + "titleAgreementText": "阅读并同意", + "titleAgreementContntText": "隐私协议", + "titleVersionUpdate": "版本更新", + "titleNewVersion": "新版本", + "infoActivityCoefficient": "活动系数", + "infoPersonalProfile": "个人资料", + "infoMyRecipes": "我的菜谱", + "infoMyCollection": "我的收藏", + "infoAvatar": "头像", + "infoNickname": "昵称", + "infoMobile": "手机号", + "infoEmail": "邮箱", + "infoAge": "年龄", + "infoAgeunit": "岁", + "infoGender": "性别", + "infoMan": "男", + "infoWoman": "女", + "infoUnknown": "未知", + "infoBirthday": "出生日期", + "infoHeight": "身高", + "infoWeight": "体重", + "btnEdit": "编辑", + "btnAdd": "添加", + "btnDetail": "查看详情", + "btnDeleteAccount": "删除账号", + "btnLogOut": "退出登录", "countIntake": "摄入", "countCalorieIntake": "热量摄入", "countMealdetails": "餐食详情", "countAddFood": "添加食物", "countNutritionalProportion": "营养占比", - - - "countComponentStatistics": "成分统计", "countCalorieAnalysis": "卡路里分析", "countNutrientElementEnergyProportion": "营养元素能量占比", "countNutritionClassification": "营养分类", "countNutritionElementRankingList": "营养元素排行榜", - "countFoodTypes": "食物类型" - - - + "countFoodTypes": "食物类型", + "total": "共", + "records": "条记录", + "Search": "搜索", + "VoiceSearch": "语音搜索", + "Save": "保存", + "noMoreData": "没有更多数据了", + "HistoricalSearch": "历史搜索", + "wantSearch": "猜你想搜", + "verifyCalorie": "请输入卡路里", + "kcal": "卡路里", + "countNoFood": "暂无食物", + "msgLoginTips": "登录后查看更多", + "Nutrients": "营养素", + "Content": "含量", + "CaloriesAndnutrients": "热量和营养", + "ImproveInformation": "完善信息", + "WhetherTodelete": "是否删除", + "BusinessCooperation": "商务合作", + "verifyActivityCoefficient": "请选择活动系数" } \ No newline at end of file diff --git a/main.js b/main.js index d2a35e4..bd1c1b7 100644 --- a/main.js +++ b/main.js @@ -14,7 +14,7 @@ Vue.prototype.$http = http; import model from '@/tools/model.js' Vue.prototype.$model = model; // 语言 -import messages from './language/index' +import messages from '@/language/index.js' let i18nConfig = { diff --git a/manifest.json b/manifest.json index a259319..cfb9058 100644 --- a/manifest.json +++ b/manifest.json @@ -2,8 +2,8 @@ "name" : "kitchendDevice", "appid" : "__UNI__20604F1", "description" : "", - "versionName" : "1.0.0", - "versionCode" : "100", + "versionName" : "1.1.1", + "versionCode" : 111, "transformPx" : false, "sassImplementationName" : "node-sass", /* 5+App特有相关 */ @@ -18,7 +18,9 @@ "delay" : 0 }, /* 模块配置 */ - "modules" : {}, + "modules" : { + "Bluetooth" : {} + }, /* 应用发布信息 */ "distribute" : { /* android打包配置 */ @@ -42,10 +44,50 @@ ] }, /* ios打包配置 */ - "ios" : {}, + "ios" : { + "privacyDescription" : { + "NSBluetoothPeripheralUsageDescription" : "使用蓝牙与外设通信", + "NSBluetoothAlwaysUsageDescription" : "需要蓝牙权限来连接设备" + } + }, /* SDK配置 */ "sdkConfigs" : { "speech" : {} + }, + "icons" : { + "android" : { + "hdpi" : "unpackage/res/icons/72x72.png", + "xhdpi" : "unpackage/res/icons/96x96.png", + "xxhdpi" : "unpackage/res/icons/144x144.png", + "xxxhdpi" : "unpackage/res/icons/192x192.png" + }, + "ios" : { + "appstore" : "unpackage/res/icons/1024x1024.png", + "ipad" : { + "app" : "unpackage/res/icons/76x76.png", + "app@2x" : "unpackage/res/icons/152x152.png", + "notification" : "unpackage/res/icons/20x20.png", + "notification@2x" : "unpackage/res/icons/40x40.png", + "proapp@2x" : "unpackage/res/icons/167x167.png", + "settings" : "unpackage/res/icons/29x29.png", + "settings@2x" : "unpackage/res/icons/58x58.png", + "spotlight" : "unpackage/res/icons/40x40.png", + "spotlight@2x" : "unpackage/res/icons/80x80.png" + }, + "iphone" : { + "app@2x" : "unpackage/res/icons/120x120.png", + "app@3x" : "unpackage/res/icons/180x180.png", + "notification@2x" : "unpackage/res/icons/40x40.png", + "notification@3x" : "unpackage/res/icons/60x60.png", + "settings@2x" : "unpackage/res/icons/58x58.png", + "settings@3x" : "unpackage/res/icons/87x87.png", + "spotlight@2x" : "unpackage/res/icons/80x80.png", + "spotlight@3x" : "unpackage/res/icons/120x120.png" + } + } + }, + "splashscreen" : { + "useOriginalMsgbox" : true } } }, @@ -84,5 +126,10 @@ "uniStatistics" : { "enable" : false }, - "vueVersion" : "2" + "vueVersion" : "2", + "locale" : "zh-Hans", + "fallbackLocale" : "zh-Hans", + "h5" : { + "template" : "index.html" + } } diff --git a/pageTwo/count/KcalEdit.vue b/pageTwo/count/KcalEdit.vue index 2c9e2a6..df654f7 100644 --- a/pageTwo/count/KcalEdit.vue +++ b/pageTwo/count/KcalEdit.vue @@ -1,14 +1,14 @@ @@ -28,13 +28,16 @@ ...mapState(["user"]), }, onLoad(options) { + uni.setNavigationBarTitle({ + title: this.$t('titleSet') + }) this.suggestion_kcal_range_val = options.suggestion_kcal_range_val }, methods: { handlesub() { let that = this if (that.kcal == '' || Number(that.kcal) <= 0) { - that.$tools.msg("请输入卡路里") + that.$tools.msg(that.$t('verifyCalorie')) return } that.$model.getCountSetUserKcal({ @@ -42,7 +45,7 @@ set_kcal: that.kcal }).then(res => { if (res.code == 0) { - that.$tools.msg("设置成功") + that.$tools.msg(that.$t('msgSetSuccess')) setTimeout(function() { uni.switchTab({ url: '/pages/count/count' diff --git a/pageTwo/count/everyDay.vue b/pageTwo/count/everyDay.vue index e4de7e4..ae0b828 100644 --- a/pageTwo/count/everyDay.vue +++ b/pageTwo/count/everyDay.vue @@ -5,7 +5,7 @@ - 卡路里分析 + {{$t("countCalorieAnalysis")}}
@@ -23,15 +23,15 @@ - 营养元素能量占比 + {{$t("countNutrientElementEnergyProportion")}}
- 营养分类 - 摄入 + {{$t("countNutritionClassification")}} + {{$t("countIntake")}} @@ -66,7 +66,7 @@ - 营养元素排行榜 + {{$t("countNutritionElementRankingList")}} {{details.carbohydrate.name}} @@ -138,7 +138,7 @@ import { mapState } from "vuex"; - import qiunDataCharts from '@/uni_modules/qiun-data-charts/components/qiun-data-charts.vue'; + import qiunDataCharts from '@/uni_modules/qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue'; export default { data() { return { @@ -170,6 +170,9 @@ onLoad(options) { let that = this that.page = options.page + uni.setNavigationBarTitle({ + title: this.$t('titleeveryDay') + }) that.handleList() }, methods: { diff --git a/pageTwo/count/everyMeal.vue b/pageTwo/count/everyMeal.vue index 2c70b5a..9e565f7 100644 --- a/pageTwo/count/everyMeal.vue +++ b/pageTwo/count/everyMeal.vue @@ -12,7 +12,7 @@ - 成分统计 + {{$t('countComponentStatistics')}}
@@ -36,7 +36,7 @@ - 食物类型 + {{$t('countFoodTypes')}} @@ -54,29 +54,29 @@ - 暂无食物 + {{$t('countNoFood')}} - +添加食物 + +{{$t('countAddFood')}} - + {{activeFoodDetail.name}} - {{activeFoodDetail.val}}千卡 + {{activeFoodDetail.val}}kcal - 热量和营养 + {{$t('CaloriesAndnutrients')}}
- 营养素 - {{activeFoodDetail.weight}}含量 + {{$t('Nutrients')}} + {{activeFoodDetail.weight}}{{$t('Content')}} { if (res.confirm) { this.$model.delCEatAction({ @@ -317,7 +320,6 @@ position: relative; width: 280rpx; height: 280rpx; - margin-top: -30rpx; margin-left: -15px; } diff --git a/pageTwo/count/food-copy.vue b/pageTwo/count/food-copy.vue index a101f2e..faa1f75 100644 --- a/pageTwo/count/food-copy.vue +++ b/pageTwo/count/food-copy.vue @@ -248,7 +248,7 @@ import blueTooth from "../../components/bluetooth_food.vue" import FoodItem from "../../components/food_item.vue" // import ruler from "../../components/select-ruler/select-ruler.vue" - import qiunDataCharts from '@/uni_modules/qiun-data-charts/components/qiun-data-charts.vue'; +import qiunDataCharts from '@/uni_modules/qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue'; const plugin = requirePlugin("WechatSI") export default { components: { diff --git a/pageTwo/count/search.vue b/pageTwo/count/search.vue index 20f88d8..b105918 100644 --- a/pageTwo/count/search.vue +++ b/pageTwo/count/search.vue @@ -13,11 +13,11 @@ - + - 搜索 + {{$t("Search")}} @@ -25,7 +25,7 @@ - 历史搜索 + {{$t("HistoricalSearch")}} @@ -40,7 +40,7 @@ - 猜你想搜 + {{$t("wantSearch")}} {{ite.title}} @@ -64,11 +64,11 @@ - - 语音搜索 - + {{$t("VoiceSearch")}} + --> @@ -79,7 +79,7 @@ 100g/{{ite.kcal}}kcal - —— 到底了,看看别的吧 —— + —— {{$t("msgBottom")}} —— @@ -90,16 +90,15 @@ - + - 摄入 + {{$t("countIntake")}} {{foodInfo[0].today_intake}} Kcal - 目标:{{foodInfo[0].suggestion}}kcal + {{$t("titleBody")}}:{{foodInfo[0].suggestion}}kcal @@ -132,8 +131,8 @@ - {{ActiveList.filter(ite => ite.meals_type == foodName).length}}条记录 + {{$t("total")}}{{ActiveList.filter(ite => ite.meals_type == foodName).length}}{{$t("records")}} @@ -150,7 +149,7 @@ - 还没有添加食物 + {{$t('countNoFood')}} @@ -168,7 +167,7 @@ {{activeType.name}} - {{activeType.kcal}}千卡/100克 + {{activeType.kcal}}kcal/100g @@ -187,15 +186,15 @@ + @realTimeWeight="realTimeWeight" :btnType="btnType"> - 营养素 - {{Math.floor(activeType.weight)}}克含量 + {{$t('Nutrients')}} + {{Math.floor(activeType.weight)}}g{{$t('Content')}} = this.lastPage) { uni.showToast({ - title: '没有更多数据!', + title: this.$t('noMoreData'), icon: 'none' }) return @@ -389,7 +394,7 @@ that.IsWeight = true that.showAutoSearchDlg = false that.activeType = ite - that.weightKcal = ite.kcal + that.weightKcal = Number(ite.kcal) if (that.bleValue.serviceId != "") { that.realTimeWeight(that.bleValue.countWeight, that.bleValue.unit) } else { @@ -471,7 +476,7 @@ let that = this that.search_list = [] if (that.search_value == "") { - that.$tools.msg("输入关键字后搜索") + that.$tools.msg(this.$t('searchkeywords')) return } that.$model.getFoodSearch({ @@ -509,7 +514,7 @@ handledelactive(ite) { let that = this uni.showModal({ - content: `是否删除[${ite.name}]?`, + content: this.$t('WhetherTodelete') + ite.name, success: (res) => { if (res.confirm) { this.$model.delCEatAction({ @@ -1140,18 +1145,24 @@ border-radius: 10px; height: 340rpx; + .chart-wrap { - margin-top: -15px; + position: relative; + width: 280rpx; + height: 280rpx; + margin-left: -5px; + display: flex; + flex-wrap: wrap; + + .center { + border: none; + width: 280rpx; + height: 210rpx; + position: absolute; + top: 44rpx; + } } - .center { - height: 270rpx; - top: 80rpx; - } - - .mubiao { - margin-top: 10px - } } .box_list { diff --git a/pageTwo/count/setting.vue b/pageTwo/count/setting.vue index 851fa18..2e13815 100644 --- a/pageTwo/count/setting.vue +++ b/pageTwo/count/setting.vue @@ -3,7 +3,8 @@ - + @@ -17,7 +18,7 @@ - 营养占比 + {{$t('countNutritionalProportion')}} @@ -36,7 +37,7 @@ {{ite}} - 保存 + {{$t('btnSubmit')}} @@ -69,6 +70,9 @@ }, onLoad() { this.handleList() + uni.setNavigationBarTitle({ + title: this.$t('titleSet') + }) }, components: { lltSliderRange @@ -85,7 +89,8 @@ that.nutrition = res.data.nutrition that.weight = res.data.kcal.suggestion_kcal_val that.rangeValue[0] = Number(that.nutrition.list[0].proportion) - that.rangeValue[1] = Number(that.nutrition.list[0].proportion) + Number(that.nutrition.list[1].proportion) + that.rangeValue[1] = Number(that.nutrition.list[0].proportion) + Number(that.nutrition + .list[1].proportion) console.log("that.rangeValue", that.rangeValue) that.handleProportion() } @@ -105,20 +110,20 @@ handleProportion() { let that = this that.nutrition.list.forEach(ite => { - if (ite.name.indexOf('碳水') != -1) { + if (ite.key_v == "carbohydrate") { ite.proportion = that.rangeValue[0] ite.val = Number(that.weight * ite.proportion / 100 / 4).toFixed(2) that.carbohydrate_v = ite.val that.carbohydrate_p = ite.proportion } - if (ite.name.indexOf('蛋白') != -1) { + if (ite.key_v == "protein") { ite.proportion = that.rangeValue[1] - that.rangeValue[0] ite.val = Number(that.weight * ite.proportion / 100 / 4).toFixed(2) that.protein_v = ite.val that.protein_p = ite.proportion } - if (ite.name.indexOf('脂肪') != -1) { + if (ite.key_v == "fat") { ite.proportion = 100 - that.rangeValue[1] ite.val = Number(that.weight * ite.proportion / 100 / 9).toFixed(2) that.fat_v = ite.val @@ -134,7 +139,7 @@ handleEditKcal() { let that = this if (that.weight == '' || Number(that.weight) <= 0) { - that.$tools.msg("请输入卡路里") + that.$tools.msg(that.$t('verifyCalorie')) return } that.$model.getCountSetUserKcal({ @@ -148,7 +153,7 @@ fat_p: that.fat_p, }).then(res => { if (res.code == 0) { - that.$tools.msg("设置成功") + that.$tools.msg(that.$t('msgSetSuccess')) that.$store.dispatch("getUserInfo") setTimeout(function() { uni.switchTab({ diff --git a/pageTwo/login/forgetPassword.vue b/pageTwo/login/forgetPassword.vue index f382640..541826f 100644 --- a/pageTwo/login/forgetPassword.vue +++ b/pageTwo/login/forgetPassword.vue @@ -4,28 +4,28 @@ @@ -59,6 +59,10 @@ } }, onLoad(options) { + let that = this + uni.setNavigationBarTitle({ + title: that.$t('titleLogin') + }) this.type = options.type //1 }, methods: { @@ -70,31 +74,31 @@ let that = this let phoneType = that.phone.indexOf("@") !== -1 if (that.value == 0) { - that.$tools.msg("请先确认勾选协议") + that.$tools.msg(that.$t("verifyAgreement")) return } if (!phoneType && !(/^1[3456789]\d{9}$/.test(that.phone))) { - that.$tools.msg("请输入正确的手机号") + that.$tools.msg(that.$t("verifyMobileCorrect")) return } if (phoneType && !(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(that.phone))) { - that.$tools.msg("请输入正确的邮箱") + that.$tools.msg(that.$t("verifyEmailCorrect")) return } if (!that.code) { - that.$tools.msg("请填写验证码") + that.$tools.msg(that.$t("verifyCode")) return } if (!that.password) { - that.$tools.msg("请填写密码") + that.$tools.msg(that.$t("verifyPassword")) return } if (!that.password2) { - that.$tools.msg("请确认密码") + that.$tools.msg(that.$t("verifyPassword")) return } if (that.password2 != that.password) { - that.$tools.msg("请确认两次密码填写一致") + that.$tools.msg(that.$t("verifyPasswordCorrect")) return } let account = { @@ -113,7 +117,8 @@ } uni.setStorageSync('token', res.data.token) uni.setStorageSync('aan_id', res.data.aan_id) - that.$tools.msg("设置成功,进入程序中") + that.$store.dispatch("getUserInfo") + that.$tools.msg(that.$t("msgSetPasswordSuccess")) setTimeout(function() { uni.reLaunch({ url: "/pages/index/index" @@ -126,11 +131,11 @@ let that = this let phoneType = that.phone.indexOf("@") !== -1 if (!phoneType && !(/^1[3456789]\d{9}$/.test(that.phone))) { - that.$tools.msg("请输入正确的手机号") + that.$tools.msg(that.$t("verifyMobileCorrect")) return } if (phoneType && !(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(that.phone))) { - that.$tools.msg("请输入正确的邮箱") + that.$tools.msg(that.$t("verifyEmailCorrect")) return } // @@ -194,7 +199,7 @@ .title { text-align: left; color: #333; - font-size: 40rpx; + font-size: 40rpx; font-weight: bold; margin-bottom: 30rpx; } @@ -242,13 +247,13 @@ left: 20rpx; right: 0px; z-index: 88; - font-size:28rpx; + font-size: 28rpx; } .yanzhengma { input { right: 220rpx; - font-size:28rpx; + font-size: 28rpx; } } } diff --git a/pageTwo/login/login.vue b/pageTwo/login/login.vue index 61598f8..f8ee2f4 100644 --- a/pageTwo/login/login.vue +++ b/pageTwo/login/login.vue @@ -6,54 +6,56 @@ 轻厨记 - + + + + @@ -85,6 +88,10 @@ } }, onLoad() { + let that = this + uni.setNavigationBarTitle({ + title: that.$t('titleLogin') + }) this.login() }, methods: { @@ -96,23 +103,23 @@ let that = this let phoneType = that.phone.indexOf("@") !== -1 if (that.value == 0) { - that.$tools.msg("请先确认勾选协议") + that.$tools.msg(that.$t("verifyAgreement")) return } if (!phoneType && !(/^1[3456789]\d{9}$/.test(that.phone))) { - that.$tools.msg("请输入正确的手机号") + that.$tools.msg(that.$t("verifyMobileCorrect")) return } if (phoneType && !(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(that.phone))) { - that.$tools.msg("请输入正确的邮箱") + that.$tools.msg(that.$t("verifyEmailCorrect")) return } if (that.isCode && !that.code) { - that.$tools.msg("请输入验证码") + that.$tools.msg(that.$t("verifyCode")) return } if (!that.isCode && !that.password) { - that.$tools.msg('请输入正确密码') + that.$tools.msg(that.$t("verifyPassword")) return } this.$model.getonlogin({ @@ -123,8 +130,9 @@ console.log("data", res.data) that.$tools.msg(res.msg) if (res.code != 0) return - that.$tools.msg("登录成功") + that.$tools.msg(that.$t("msgLoginSuccess")) uni.setStorageSync('token', res.data.token) + that.$store.dispatch("getHomeConfig") setTimeout(function() { uni.reLaunch({ url: "/pages/index/index" @@ -137,11 +145,11 @@ let that = this let phoneType = that.phone.indexOf("@") !== -1 if (!phoneType && !(/^1[3456789]\d{9}$/.test(that.phone))) { - that.$tools.msg("请输入正确的手机号") + that.$tools.msg(that.$t("verifyMobileCorrect")) return } if (phoneType && !(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(that.phone))) { - that.$tools.msg("请输入正确的邮箱") + that.$tools.msg(that.$t("verifyEmailCorrect")) return } // @@ -190,6 +198,7 @@ if (res.code != 0) return that.value = 1 uni.setStorageSync('token', res.data.token) + that.$store.dispatch("getHomeConfig") setTimeout(function() { uni.reLaunch({ url: "/pages/index/index" @@ -200,7 +209,7 @@ }, handleIsTel() { if (this.value == 0) { - this.$tools.msg("请先确认勾选协议") + this.$tools.msg(that.$t("verifyAgreement")) return } }, diff --git a/pageTwo/me/mymenu.vue b/pageTwo/me/mymenu.vue index 56c4fdb..bfc6994 100644 --- a/pageTwo/me/mymenu.vue +++ b/pageTwo/me/mymenu.vue @@ -51,10 +51,6 @@ onLoad(option) { let that = this that.type = option.pageName - uni.setNavigationBarTitle({ - title: option.pageName - }); - }, onShow() { let that = this diff --git a/pageTwo/me/record.vue b/pageTwo/me/record.vue index b3e1658..7696840 100644 --- a/pageTwo/me/record.vue +++ b/pageTwo/me/record.vue @@ -3,20 +3,25 @@ - {{item.time}} + + {{item.time}} + + - 摄入卡路里{{item.val}}{{item.unit}} + + {{$t('countIntake')}}{{$t('kcal')}} + {{item.val}}{{item.unit}} + {{item.describe}} - - —— 到底了,看看别的吧 —— + —— {{$t('msgBottom')}} —— - 还没有记录哦 + {{$t('msgNoMoreData')}} @@ -46,6 +51,9 @@ }, onLoad() { let that = this + uni.setNavigationBarTitle({ + title: that.$t('titleHistory') + }) that.page = 1 that.handleList() }, @@ -53,7 +61,7 @@ let that = this if (!this.lastPage || this.page >= this.lastPage) { uni.showToast({ - title: '没有更多数据!', + title: that.$t('noMoreData'), icon: 'none' }) return @@ -124,6 +132,18 @@ width: 100%; height: 60rpx; line-height: 60rpx; + display: flex; + justify-content: space-between; + align-content: center; + } + + .quan0 { + width: 24rpx; + height: 24rpx; + background: $uni-color-warning; + display: inline-block; + border-radius: 50%; + margin-right: 5px; } .kcal { @@ -138,17 +158,8 @@ color: #000; } - .status { - width: 85px; - } - - .quan0 { - width: 24rpx; - height: 24rpx; - background: $uni-color-warning; - display: inline-block; - border-radius: 50%; - margin-right: 5px; + .intake { + width: 80%; } } } diff --git a/pageTwo/me/recordetail.vue b/pageTwo/me/recordetail.vue index 5d6f906..095cf16 100644 --- a/pageTwo/me/recordetail.vue +++ b/pageTwo/me/recordetail.vue @@ -117,7 +117,7 @@ mapState } from "vuex"; let next = 0 - import qiunDataCharts from '@/uni_modules/qiun-data-charts/components/qiun-data-charts.vue'; + import qiunDataCharts from '@/uni_modules/qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue'; export default { data() { return { diff --git a/pageTwo/me/userEdit.vue b/pageTwo/me/userEdit.vue index a38a680..eca6c16 100644 --- a/pageTwo/me/userEdit.vue +++ b/pageTwo/me/userEdit.vue @@ -10,28 +10,31 @@ - 昵称 + {{$t('infoNickname')}} - + - 性别 + {{$t('infoGender')}} - {{memInfo.gender==0?'请选择':memInfo.gender==1?'男':'女'}} + + {{memInfo.gender==0?$t('verifyPicker'):memInfo.gender==1? $t('infoMan'):$t('infoWoman')}} + - 出生日期 + {{$t('infoBirthday')}} - {{memInfo.birthday?memInfo.birthday:"请选择"}} + :value="memInfo.birthday?memInfo.birthday:endDate" fields="day"> + {{memInfo.birthday?memInfo.birthday:$t('verifyPicker')}} @@ -46,23 +49,24 @@ --> - 身高 + {{$t('infoHeight')}} - + cm - 体重 + {{$t('infoWeight')}} - + kg - 活动系数 + {{$t('infoActivityCoefficient')}} - + {{activityLevel[levelInd].name}} @@ -72,7 +76,7 @@ - 提交 + {{$t('btnSubmit')}} @@ -110,6 +114,10 @@ }, onLoad(options) { // 编辑 + let that = this + uni.setNavigationBarTitle({ + title: that.$t('infoPersonalProfile') + }) if (options.familayData) { let info = options.familayData this.memInfo = JSON.parse(info) @@ -130,27 +138,27 @@ let that = this console.log("activity_level", this.memInfo) if (!this.memInfo.nickname) { - this.$tools.msg("请输入昵称") + this.$tools.msg(that.$t('verifyNickName')) return; } if (!this.memInfo.gender) { - this.$tools.msg("请选择性别") + this.$tools.msg(that.$t('verifyGender')) return; } if (!this.memInfo.birthday) { - this.$tools.msg("请选择出生日期") + this.$tools.msg(that.$t('verifyBirthday')) return; } if (!this.memInfo.height) { - this.$tools.msg("请输入身高") + this.$tools.msg(that.$t('verifyHeight')) return; } if (!this.memInfo.weight) { - this.$tools.msg("请输入体重") + this.$tools.msg(that.$t('verifyWeight')) return; } if (!this.memInfo.activity_level) { - this.$tools.msg("请选择活动系数") + this.$tools.msg(that.$t('verifyActivityCoefficient')) return; } that.subInfo(this.memInfo) @@ -159,7 +167,6 @@ let that = this that.$model.getUserInfoEdit(data).then(res => { if (res.code == 0) { - that.$tools.msg("提交成功"); that.handleHomeUserInfo() uni.navigateBack({ delta: 1 @@ -179,7 +186,6 @@ }, //确定年龄 maskClick(e) { - console.log("出生日期", e.detail.value) this.memInfo.birthday = e.detail.value }, //确定性别 @@ -235,6 +241,7 @@ .left { width: 24%; text-align: left; + line-height: 20px; } diff --git a/pageTwo/setting/email.vue b/pageTwo/setting/email.vue index 2196dc3..cef8fea 100644 --- a/pageTwo/setting/email.vue +++ b/pageTwo/setting/email.vue @@ -3,22 +3,22 @@ @@ -33,16 +33,22 @@ second: 60, } }, + onLoad() { + let that = this + uni.setNavigationBarTitle({ + title: that.$t('titleEmail') + }) + }, methods: { // 登录、 handleTelLogin() { let that = this if (!(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(that.phone))) { - that.$tools.msg("请输入正确的邮箱") + that.$tools.msg(that.$t("verifyEmailCorrect")) return } if (!that.code) { - that.$tools.msg("请填写验证码") + that.$tools.msg(that.$t("verifyCode")) return } that.$model.getAccountMsg({ @@ -53,7 +59,7 @@ that.$tools.msg(res.msg) return } else { - that.$tools.msg("设置成功!") + that.$tools.msg(that.$t("msgSetSuccess")) that.$store.commit('changeAccountNumber', { my_email: that.phone }) @@ -69,11 +75,11 @@ handleCode() { let that = this if (!that.phone) { - that.$tools.msg("请输入邮箱") + that.$tools.msg(that.$t("verifyEmail")) return } if (!(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(that.phone))) { - that.$tools.msg("请输入正确的邮箱") + that.$tools.msg(that.$t("verifyEmailCorrect")) return } // @@ -114,7 +120,7 @@ background: #fff; border-radius: 20rpx; padding: 30rpx; - + z-index: 99; .title { @@ -180,7 +186,7 @@ } .code { - width: 120rpx; + width: auto; background: #dfdfdf; font-size: 14px; margin: 0; diff --git a/pageTwo/setting/password.vue b/pageTwo/setting/password.vue index c37ae8b..0d05dc9 100644 --- a/pageTwo/setting/password.vue +++ b/pageTwo/setting/password.vue @@ -3,19 +3,19 @@ @@ -28,21 +28,26 @@ password2: "", } }, - onLoad() {}, + onLoad() { + let that = this + uni.setNavigationBarTitle({ + title: that.$t('titlePasswordEdit') + }) + }, methods: { // 登录、 handleTelLogin() { let that = this if (!that.password) { - that.$tools.msg("请填写密码") + that.$tools.msg(that.$t('verifyPassword')) return } if (!that.password2) { - that.$tools.msg("请确认密码") + that.$tools.msg(that.$t('verifyPasswordTwo')) return } if (that.password2 != that.password) { - that.$tools.msg("请确认两次密码填写一致") + that.$tools.msg(that.$t('verifyPasswordCorrect')) return } that.$model.getAccountPassword({ @@ -53,7 +58,7 @@ if (res.code != 0) { that.$tools.msg(res.msg) } else { - that.$tools.msg("密码设置成功") + that.$tools.msg(that.$t('msgSetSuccess')) setTimeout(function() { uni.navigateBack() }, 1000) diff --git a/pageTwo/setting/phone.vue b/pageTwo/setting/phone.vue index 68ac431..8fd24c8 100644 --- a/pageTwo/setting/phone.vue +++ b/pageTwo/setting/phone.vue @@ -3,22 +3,22 @@ @@ -33,16 +33,22 @@ second: 60, } }, + onLoad() { + let that = this + uni.setNavigationBarTitle({ + title: that.$t('titlePhone') + }) + }, methods: { // 登录、 handleTelLogin() { let that = this - if (!phoneType && !(/^1[3456789]\d{9}$/.test(that.phone))) { - that.$tools.msg("请输入正确的手机号") + if (!(/^1[3456789]\d{9}$/.test(that.phone))) { + that.$tools.msg(that.$t('verifyMobileCorrect')) return } if (!that.code) { - that.$tools.msg("请填写验证码") + that.$tools.msg(that.$t('verifyCode')) return } that.$model.getAccountMsg({ @@ -53,7 +59,7 @@ that.$tools.msg(res.msg) return } else { - that.$tools.msg("设置成功!") + that.$tools.msg(that.$t('msgSetSuccess')) that.$store.commit('changeAccountNumber', { my_tel: that.phone }) @@ -69,11 +75,11 @@ handleCode() { let that = this if (!that.phone) { - that.$tools.msg("请输入手机号") + that.$tools.msg(that.$t('verifyMobile')) return } if (!phoneType && !(/^1[3456789]\d{9}$/.test(that.phone))) { - that.$tools.msg("请输入正确的手机号") + that.$tools.msg(that.$t('verifyMobileCorrect')) return } // @@ -179,7 +185,7 @@ } .code { - width: 120rpx; + width: auto; background: #dfdfdf; font-size: 14px; margin: 0; diff --git a/pageTwo/setting/setting.vue b/pageTwo/setting/setting.vue index c1a2716..8972138 100644 --- a/pageTwo/setting/setting.vue +++ b/pageTwo/setting/setting.vue @@ -1,21 +1,21 @@