语言调试

This commit is contained in:
qcl_123 2025-12-22 09:34:09 +08:00
parent 6c6e82e095
commit 4c9e7954b8
183 changed files with 42901 additions and 29981 deletions

View File

@ -1,16 +1,20 @@
{ // launch.json configurations app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/ {
// launchtypelocalremote, localremote // launch.json configurations app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
"version": "0.0", // launchtypelocalremote, localremote
"configurations": [{ "version" : "0.0",
"default" : "configurations" : [
{ {
"launchtype" : "local" "default" : {
}, "launchtype" : "local"
"mp-weixin" : },
{ "mp-weixin" : {
"launchtype" : "local" "launchtype" : "local"
}, },
"type" : "uniCloud" "type" : "uniCloud"
} },
{
"playground" : "standard",
"type" : "uni-app:app-android"
}
] ]
} }

122
App.vue
View File

@ -1,31 +1,121 @@
<script> <script>
import { let platform = ""
mapState let SystemVersion = ""
} from "vuex";
export default { export default {
computed: {
...mapState(["bleValue"]),
},
onLaunch: function() { onLaunch: function() {
let that = this let that = this
that.$store.dispatch("getHomeConfig") // #ifdef APP-PLUS
console.log('App Launch') uni.getSystemInfo({
success(e) {
platform = e.platform
that.$store.commit('changePhoneInfo', {
platform: e.platform
})
}
})
if (platform === 'ios') { // ios
uni.onNetworkStatusChange(function(res) {
if (res.isConnected == true) {
that.handleoginversion()
}
});
}
plus.runtime.getProperty(plus.runtime.appid, function(info) {
uni.setStorageSync('VERSION', info.version)
SystemVersion = info.version
that.$store.commit('changePhoneInfo', {
info: info
})
})
// #endif
that.handleoginversion()
// that.$store.dispatch("getHomeConfig")
},
onHide: function() {
// #ifdef APP-PLUS
uni.offNetworkStatusChange(function(res) {
console.log("取消网络监听")
})
// #endif
}, },
onShow: function() { onShow: function() {
let that = this
that.handleTabBarItem()
console.log('App Show') console.log('App Show')
}, },
onHide: function() { onHide: function() {
console.log('App Hide') console.log('App Hide')
}, },
methods: { methods: {
// handleHomeConfig() { //
// let that = this handleoginversion() {
// that.$model.getHomeConfig({}).then(res => { let that = this
// if (res.code != 0) return that.$model.getloginversion({}).then(res => {
// that.$store.commit('changeMenuList', res.data.cook_label) console.log("res.data", res)
// that.$store.commit('changeFoodList', res.data.food_list) let language = res.data.language == "zh" ? 'zh-Hans' : res.data.language
// }) uni.setLocale(language)
// }, that.$i18n.locale = language
uni.setStorageSync('language', res.data.language)
if (res.code == 0) {
that.$store.dispatch("getHomeConfig")
} else {
uni.setStorageSync('token', null)
uni.setStorageSync('aan_id', null)
setTimeout(() => {
uni.reLaunch({
url: '/pageTwo/login/login'
})
}, 500);
}
// #ifdef APP-PLUS||APP
that.$store.commit('changePhoneInfo', {
versionUrl: res.data
})
//
let version = that.$tools.compareVersions(SystemVersion, res.data.version)
console.log("是否登录及版本号", res, res.data.version, SystemVersion, version)
if (version == -1) { // 01-1
uni.showModal({
title: '发现新版本',
content: '检查到新版本' + res.data.version + ',是否更新?',
cancelText: that.$t('btnSancellation'),
confirmText: that.$t('btnConfirm'),
success: (modalRes) => {
if (modalRes.confirm) { //
if (platform === 'android') { //
uni.setStorageSync('VERSION', res.data.version)
uni.navigateTo({
url: "/pageTwo/me/about"
})
} else { //ios
plus.runtime.launchApplication({
action: `itms-apps://itunes.apple.com/cn/app/id6654906497?mt=8`
})
}
} else {
that.$tools.msg("稍后可在'关于我们'内更新程序!")
}
}
});
}
// #endif
})
},
handleTabBarItem() {
let that = this
uni.setTabBarItem({
index: 0,
text: that.$t('titleHome')
})
uni.setTabBarItem({
index: 1,
text: that.$t('titleCount')
})
uni.setTabBarItem({
index: 2,
text: that.$t('titleMe')
})
}
} }
} }
</script> </script>

View File

@ -844,7 +844,7 @@ page {
.mubiao { .mubiao {
width: 100%; width: 100%;
margin-top: 32rpx; // margin-top: 32rpx;
text-align: center; text-align: center;
font-size: 26rpx; font-size: 26rpx;

View File

@ -3,10 +3,10 @@
<view class="table"> <view class="table">
<view class="text"> <view class="text">
<image src="/static/zhong.png"></image> <image src="/static/zhong.png"></image>
<text @click="openBluetoothAdapter">{{bleTipsText}}</text> <text @click="openBluetoothAdapter">{{bletipstext}}</text>
</view> </view>
<view class="duan" @click="handleBack" v-if="isShow&&isConnection == 0"> <view class="duan" @click="handleBack" v-if="isShow&&isConnection == 0">
断开连接 {{$t('Disconnect')}}
</view> </view>
</view> </view>
<!-- --> <!-- -->
@ -25,20 +25,20 @@
<picker mode="selector" :range="unitList" range-key="name" @change="changleUnits" <picker mode="selector" :range="unitList" range-key="name" @change="changleUnits"
:value="unitListIndex"> :value="unitListIndex">
<view class="uni-input"> <view class="uni-input">
单位 {{$t('UnitBtn')}}
</view> </view>
</picker> </picker>
</view> </view>
</view> </view>
</view> </view>
<view class="btn addbtn size14" @click="handlesub" v-if="btnType==2">保存</view> <view class="btn addbtn size14" @click="handlesub" v-if="btnType==2">{{$t('Save')}}</view>
<view class="btn addbtn" @click="handleAddFood" v-if="btnType==1">+</view> <view class="btn addbtn" @click="handleAddFood" v-if="btnType==1">+</view>
<view class="btn qingling" @click="handleqingling">清零</view> <view class="btn qingling" @click="handleqingling">{{$t('resetBtn')}}</view>
</view> </view>
<!-- --> <!-- -->
<view> <view>
<uni-popup ref="popup" type="dialog"> <uni-popup ref="popup" type="dialog">
<uni-popup-dialog mode="input" title="重量" placeholder="请输入食物重量" @close="close" <uni-popup-dialog mode="input" :title="$t('Weight')" :placeholder="$t('RecordWeight')" @close="close"
@confirm="confirm"></uni-popup-dialog> @confirm="confirm"></uni-popup-dialog>
</uni-popup> </uni-popup>
</view> </view>
@ -57,7 +57,6 @@
kcal: 0, kcal: 0,
unit: '', unit: '',
// weight: "", // weight: "",
bleTipsText: "",
inputDialog: false, inputDialog: false,
unitList: [{ unitList: [{
name: "克", name: "克",
@ -69,7 +68,7 @@
unit: "oz" unit: "oz"
}], }],
unitListIndex: 0, unitListIndex: 0,
units: ['kg', '', 'st:lb', 'lb', 'g', 'ml', 'Waterml', units: ['kg', 'g', 'st:lb', 'lb', 'g', 'ml', 'Waterml',
'milkml', 'oz', 'floz', 'lboz' 'milkml', 'oz', 'floz', 'lboz'
] ]
} }
@ -87,16 +86,20 @@
computed: { computed: {
...mapState(["bleValue", "isBluetoothTyle", "countFoodInfo"]), ...mapState(["bleValue", "isBluetoothTyle", "countFoodInfo"]),
weight() { 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.unit = this.bleValue.unit
this.bleTipsText = this.bleValue.bleTipsText
this.kcal = this.convertToGrams(kcal, this.bleValue.unit).toFixed(2)
return this.bleValue.countWeight return this.bleValue.countWeight
}, },
isConnection() { isConnection() {
this.bleTipsText = this.bleValue.bleTipsText
return this.bleValue.isConnectStatus return this.bleValue.isConnectStatus
}, },
isShow() { isShow() {
return this.bleValue.serviceId != '' ? true : false return this.bleValue.serviceId != '' ? true : false
},
bletipstext() {
return this.bleValue.bleTipsText
} }
}, },
@ -117,7 +120,7 @@
if (!that.isBluetoothTyle) { if (!that.isBluetoothTyle) {
that.handleBack() that.handleBack()
} }
}, }
}, },
methods: { methods: {
// //
@ -132,18 +135,18 @@
write: '', write: '',
unit: "g", unit: "g",
countWeight: "", countWeight: "",
bleTipsText: "蓝牙搜索中", bleTipsText: that.$t('SearchBluetooth'),
isConnectStatus: 0, isConnectStatus: 0,
}) })
that.$ble.openBluetoothAdapter() that.$ble.openBluetoothAdapter()
}, },
changleUnits(e) { changleUnits(e) {
let that = this let that = this
let name = that.unitList[e.detail.value].name let name = that.unitList[e.detail.value].unit
console.log("单位切换", name, that.unit) console.log("单位切换", name, that.unit)
if (that.isShow && that.unit != name) { if (that.isShow && that.unit != unit) {
that.handletoggleUnit(name == '盎司' ? 0x08 : 0x04) that.handletoggleUnit(name == 'oz' ? 0x08 : 0x04)
} }
that.unitListIndex = [e.detail.value] that.unitListIndex = [e.detail.value]
that.$store.commit('changeBluetoothValue', { that.$store.commit('changeBluetoothValue', {
@ -192,19 +195,33 @@
if (Number(that.weight) > 0) { if (Number(that.weight) > 0) {
that.$emit("handleBle", that.weight, that.unit, that.kcal) that.$emit("handleBle", that.weight, that.unit, that.kcal)
} else { } else {
that.$tools.msg("数据异常,请清零后重新测量!") that.$tools.msg(that.$t('reset'))
} }
}, },
handleBack() { handleBack() {
let that = this let that = this
that.$store.commit("changeBluetoothValue", { that.$store.commit("changeBluetoothValue", {
bleTipsText: "连接失败,点击重新连接", bleTipsText: that.$t('ConnectionTimeout'),
isConnectStatus: 1 isConnectStatus: 1
}) })
that.$ble.stopBluetoothDevicesDiscovery() // that.$ble.stopBluetoothDevicesDiscovery() //
that.$ble.closeBLEConnection(that.bleValue.deviceId) that.$ble.closeBLEConnection(that.bleValue.deviceId)
that.$ble.closeBluetoothAdapter() 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) { unitConversion(unit) {
if (unit == 'kcal') { if (unit == 'kcal') {
@ -221,7 +238,7 @@
// //
handleAddFood() { handleAddFood() {
uni.navigateTo({ uni.navigateTo({
url: "/pageTwo/count/search?name=早餐&time=" + this.countFoodInfo.date url: "/pageTwo/count/search?index=0&time=" + this.countFoodInfo.date
}) })
}, },
inputDialogToggle() { inputDialogToggle() {
@ -348,6 +365,7 @@
.text { .text {
color: #8284f0; color: #8284f0;
display: flex; display: flex;
align-items: center;
} }
image { image {

View File

@ -1,14 +1,150 @@
{ {
"index.home": "index", "msgTitle": "Friendly Reminder",
"index.component": "Component", "msgUpgradeFail": "Upgrade failed",
"index.api": "API", "msgDownloading": "Downloading",
"index.schema": "Schema", "msgLatestVersion": "It's already the latest version!",
"index.demo": "uni-app globalization", "msgCancel": "You have canceled the operation!",
"index.demo-description": "Include uni-framework, manifest.json, pages.json, tabbar, Page, Component, API, Schema", "msgLoginSuccess": "Login successful!",
"index.detail": "Detail", "msgDelete": "Deleted successfully",
"index.language": "Language", "msgSetSuccess": "Setup successful",
"index.language-info": "Settings", "msgBottom": "That's it, let's look at something else",
"index.system-language": "System language", "msgNoMoreData": "No more data available!",
"index.application-language": "Application language", "msgSetPasswordSuccess": "Password set successfully, entering the program!",
"index.language-change-confirm": "Applying this setting will restart the app" "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"
} }

View File

@ -2,11 +2,31 @@ import en from './en.json'
import zh from './zh.json' import zh from './zh.json'
import zhHant from './zh-Hant.json' import zhHant from './zh-Hant.json'
import ja from './ja.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 { export default {
zh, zh, //中文
en, // 英语 en, // 英语
ja, //日语 ja, //日语
fr, //法语
de, //德语
ko, //韩语
ru, //俄语
pt, //葡萄牙
es, //西班牙
ar, //阿拉伯
"zh-Hans": zh, //中文 "zh-Hans": zh, //中文
'zh-Hant': zhHant, //繁体 'zh-Hant': zhHant, //繁体
"en-CN": en "en-CN": en,
"jp":ja,
"fra":fr,
"kor":ko,
"spa":es,
"ara":ar,
} }

View File

@ -1,15 +1,151 @@
{ {
"index.title": "Hello i18n",
"index.home": "ホーム", "msgTitle": "友情のヒント",
"index.component": "コンポーネント", "msgUpgradeFail": "アップグレード失敗",
"index.api": "API", "msgDownloading": "ダウンロード中",
"index.schema": "Schema", "msgLatestVersion": "最新バージョンですよ!",
"index.demo": "uni-app globalization", "msgCancel": "操作をキャンセルしました!",
"index.demo-description": "ユニフレームワーク、manifest.json、pages.json、タブバー、ページ、コンポーネント、APIを含める、Schema", "msgLoginSuccess": "ログイン成功!",
"index.detail": "詳細", "msgDelete": "削除に成功しました",
"index.language": "言語", "msgSetSuccess": "設定完了",
"index.language-info": "設定", "msgBottom": "これ以上ありません。他のものを見てみましょう",
"index.system-language": "システム言語", "msgNoMoreData": "これ以上データはありません!",
"index.application-language": "アプリケーション言語", "msgSetPasswordSuccess": "パスワード設定完了、プログラムに入ります!",
"index.language-change-confirm": "この設定を適用すると、アプリが再起動します" "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": "活動係数を選択します"
}

View File

@ -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": {}
}

View File

@ -1,162 +1,148 @@
{ {
"tips": { "msgTitle": "友情提示",
"msgTitle": "友情提示", "msgUpgradeFail": "升级失败",
"msgUpgradeFail": "升级失败", "msgDownloading": "正在下载",
"msgDownloading": "正在下载", "msgLatestVersion": "已经是最新版本了!",
"msgLatestVersion": "已经是最新版本了!", "msgCancel": "您已取消操作!",
"msgCancel": "您已取消操作!", "msgLoginSuccess": "登录成功!",
"msgLoginSuccess": "登录成功!", "msgDelete": "删除成功",
"msgDelete": "删除成功", "msgSetSuccess": "设置成功",
"msgSetSuccess": "设置成功", "msgBottom": "到底了,看看别的吧",
"msgBottom": "到底了,看看别的吧", "msgNoMoreData": "暂无数据!",
"msgNoMoreData": "没有更多数据了!", "msgSetPasswordSuccess": "密码设置成功,进入程序中!",
"msgSetPasswordSuccess": "密码设置成功,进入程序中!", "msgAddUser": "暂无成员,请先添加",
"msgAddUser": "暂无成员,请先添加", "verifyNickName": "请输入昵称",
"verifyNickName": "请输入昵称", "verifyNotOptional": "未来日期不可选",
"verifyNotOptional": "未来日期不可选", "verifyDate": "请选择测量日期",
"verifyDate": "请选择测量日期", "verifyBirthday": "请选择出生日期",
"verifyBirthday": "请选择出生日期", "verifyHeight": "请输入身高",
"verifyHeight": "请输入身高", "verifyWeight": "请输入体重",
"verifyWeight": "请输入体重", "verifyGender": "请选择性别",
"verifyGender": "请选择性别", "verifyBontrast": "请选择数据",
"verifyBontrast": "请选择数据", "verifyBodyDate": "请选择正确的时间",
"verifyBodyDate": "请选择正确的时间", "verifyRecord": "请输入",
"verifyRecord": "请输入", "verifyPicker": "请选择",
"verifyPicker": "请选择", "verifyAccount": "请输入正确的手机号或邮箱",
"verifyAccount": "请输入正确的手机号或邮箱", "verifyEmail": "请输入邮箱",
"verifyEmail": "请输入邮箱", "verifyEmailCorrect": "请输入正确的邮箱",
"verifyEmailCorrect": "请输入正确的邮箱", "verifyMobile": "请输入手机号",
"verifyMobile": "请输入手机号", "verifyMobileCorrect": "请输入正确的手机号",
"verifyMobileCorrect": "请输入正确的手机号", "verifyCode": "请输入验证码",
"verifyCode": "请输入验证码", "verifyPassword": "请输入密码",
"verifyPassword": "请输入密码", "verifyPasswordTwo": "请输入确认密码",
"verifyPasswordTwo": "请输入确认密码", "verifyPasswordCorrect": "请确认两次密码填写一致",
"verifyPasswordCorrect": "请确认两次密码填写一致", "verifyAgreement": "请先确认并勾选协议",
"verifyAgreement": "请先确认并勾选协议", "verifyOutLogin": "是否退出登录?",
"verifyOutLogin": "是否退出登录?", "verifyDeleteUser": "是否删除该成员?",
"verifyDeleteUser": "是否删除该成员?", "verifyDeleteHistory": "是否删除当前测量记录?",
"verifyDeleteHistory": "是否删除当前测量记录?", "verifyDeleteAccount": "删除成功后,该账号的所有关联信息将被清空且无法找回,是否删除?",
"verifyDeleteAccount": "删除成功后,该账号的所有关联信息将被清空且无法找回,是否删除?", "btnConfirm": "确认",
"btnConfirm": "确认", "btnSubmit": "提交",
"btnSubmit": "提交", "btnSancellation": "取消",
"btnSancellation": "取消", "btnContinue": "继续",
"btnContinue": "继续", "btnBack": "返回",
"btnBack": "返回", "btnDelete": "删除",
"btnDelete": "删除" "ConnectionTimeout": "连接超时,点击重新连接",
}, "Measuring": "测量中,请将食物放到秤上",
"linkBluetooth": { "Weight": "重量",
"onBluetoothTips": "请在设备开机状态下,搜索设备", "RecordWeight": "请输入食物重量",
"onBluetoothHaveFound": "已发现", "SearchBluetooth": "蓝牙搜索中",
"onBluetoothDevice": "个设备", "Remeasure": "数据异常,请重新测量!",
"onBluetoothMac": "mac地址", "reset": "数据异常,请清零后重新测量!",
"onBluetoothBind": "设备绑定流程说明", "Disconnect": "断开连接",
"onBluetoothSelect": "选择蓝牙进行绑定", "remeasure": "重新测量",
"onPhoneBluetoothTips": "手机蓝牙未打开", "resetBtn": "清零",
"onDeviceBluetoothTips": "请确定设备是开机状态、手机蓝牙权限已打开!", "UnitBtn": "单位",
"accreditTips": "需要您授权使用手机蓝牙", "titleHome": "首页",
"openBluetoothSuccess": "蓝牙权限获取成功,重新连接蓝牙", "titleMenu": "菜谱",
"openSettingFail": "获取权限失败,将无法使用手机蓝牙进行测量", "titleMenuAdd": "添加食谱",
"isLinkBluetooth": "请先连接设备", "titleMenuSearch": "搜索菜谱",
"startlinkBluetooth": "开始连接", "titleCount": "计食",
"linkBluetooth": "蓝牙连接中", "titleCountList": "食材库",
"anewlinkBluetooth": "重新连接", "titleCustomKcal": "自定义卡路里",
"linkBluetoothFail": "设备连接失败,返回首页重新连接", "titleEveryMeal": "餐食详情",
"linkBluetoothSuccess": "蓝牙连接成功,请开始测量", "titleCountSearch": "食材搜索",
"startSearchBluetooth": "开始搜索", "titleeveryDay": "营养分析",
"searchBluetooth": "蓝牙搜索中", "titleMe": "我的",
"searchBluetoothFail": "重新搜索", "titleDetail": "详情",
"Nodevicefound": "没有搜索到蓝牙设备", "titleBody": "目标",
"onDeviceMeasureTips": "请确定设备是开机状态", "titleHistory": "饮食记录",
"openDeviceeMeasureTips": "请确定手机蓝牙已打开", "titlePhone": "绑定手机号",
"openDeviceeMeasureTips2": "请确定手机位置信息已打开", "titleEmail": "绑定邮箱",
"deviceDisconnection": "测量过程中已与设备连接中断,请重新连接设备再开始测量", "titlePasswordEdit": "修改密码",
"offBluetooth": "蓝牙已关闭,请重新打开蓝牙后再开始测量", "titleSet": "设置",
"remeasure": "重新测量", "titleDate": "日期",
"zeroBtn": "清零", "titleMember": "资料",
"UnitBtn": "单位", "titleManage": "成员管理",
"SaveResult": "保存结果", "titleManageAdd": "添加成员",
"measureResultTips": "测量结果提示" "titleAboutUs": "关于我们",
}, "titleSetPassword": "设置密码",
"common": { "titlePassword": "密码",
"titleHome": "首页", "titleConfirmPassword": "确认密码",
"titleMenu": "菜谱", "titleForgotPassword": "忘记密码",
"titleMenuAdd": "添加食谱", "titleCode": "验证码",
"titleMenuSearch": "搜索菜谱", "titleLanguage": "语言设置",
"titleCount": "计食", "titleSendCode": "获取验证码",
"titleCountList": "食材库", "titleSendCodeRetry": "S后重发",
"titleCustomKcal": "自定义卡路里", "titleLogin": "登录",
"titleEveryMeal": "餐食详情", "titleRegister": "注册",
"titleCountSearch": "食材搜索", "titleToggleLogin": "切换登录",
"titleeveryDay": "营养分析", "titleAccountText": "手机号/邮箱",
"titleMe": "我的", "titleAgreementText": "阅读并同意",
"titleDetail": "详情", "titleAgreementContntText": "隐私协议",
"titleBody": "目标", "titleVersionUpdate": "版本更新",
"titleHistory": "饮食记录", "titleNewVersion": "新版本",
"titlePhone": "绑定手机号", "infoActivityCoefficient": "活动系数",
"titleEmail": "绑定邮箱", "infoPersonalProfile": "个人资料",
"titlePasswordEdit": "修改密码", "infoMyRecipes": "我的菜谱",
"titleSet": "设置", "infoMyCollection": "我的收藏",
"titleDate": "日期", "infoAvatar": "头像",
"titleMember": "资料", "infoNickname": "昵称",
"titleManage": "成员管理", "infoMobile": "手机号",
"titleManageAdd": "添加成员", "infoEmail": "邮箱",
"titleAboutUs": "关于我们", "infoAge": "年龄",
"titleSetPassword": "设置密码", "infoAgeunit": "岁",
"titlePassword": "密码", "infoGender": "性别",
"titleConfirmPassword": "确认密码", "infoMan": "男",
"titleForgotPassword": "忘记密码", "infoWoman": "女",
"titleCode": "验证码", "infoUnknown": "未知",
"titleLanguage": "语言设置", "infoBirthday": "出生日期",
"titleSendCode": "获取验证码", "infoHeight": "身高",
"titleSendCodeRetry": "S后重发", "infoWeight": "体重",
"titleLogin": "登录", "btnEdit": "编辑",
"titleRegister": "注册", "btnAdd": "添加",
"titleToggleLogin": "切换登录", "btnDetail": "查看详情",
"titleAccountText": "手机号/邮箱", "btnDeleteAccount": "删除账号",
"titleAgreementText": "阅读并同意", "btnLogOut": "退出登录",
"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": "摄入", "countIntake": "摄入",
"countCalorieIntake": "热量摄入", "countCalorieIntake": "热量摄入",
"countMealdetails": "餐食详情", "countMealdetails": "餐食详情",
"countAddFood": "添加食物", "countAddFood": "添加食物",
"countNutritionalProportion": "营养占比", "countNutritionalProportion": "营养占比",
"countComponentStatistics": "成分统计", "countComponentStatistics": "成分统计",
"countCalorieAnalysis": "卡路里分析", "countCalorieAnalysis": "卡路里分析",
"countNutrientElementEnergyProportion": "营养元素能量占比", "countNutrientElementEnergyProportion": "营养元素能量占比",
"countNutritionClassification": "营养分类", "countNutritionClassification": "营养分类",
"countNutritionElementRankingList": "营养元素排行榜", "countNutritionElementRankingList": "营养元素排行榜",
"countFoodTypes": "食物类型" "countFoodTypes": "食物类型",
"total": "共",
"records": "条记录",
"Search": "搜索",
"VoiceSearch": "语音搜索",
"Save": "保存",
"noMoreData": "没有更多数据了",
"HistoricalSearch": "历史搜索",
"wantSearch": "猜你想搜",
"verifyCalorie": "请输入卡路里",
"kcal": "卡路里",
"countNoFood": "暂无食物",
"msgLoginTips": "登录后查看更多",
"Nutrients": "营养素",
"Content": "含量",
"CaloriesAndnutrients": "热量和营养",
"ImproveInformation": "完善信息",
"WhetherTodelete": "是否删除",
"BusinessCooperation": "商务合作",
"verifyActivityCoefficient": "请选择活动系数"
} }

View File

@ -14,7 +14,7 @@ Vue.prototype.$http = http;
import model from '@/tools/model.js' import model from '@/tools/model.js'
Vue.prototype.$model = model; Vue.prototype.$model = model;
// 语言 // 语言
import messages from './language/index' import messages from '@/language/index.js'
let i18nConfig = { let i18nConfig = {

View File

@ -2,8 +2,8 @@
"name" : "kitchendDevice", "name" : "kitchendDevice",
"appid" : "__UNI__20604F1", "appid" : "__UNI__20604F1",
"description" : "", "description" : "",
"versionName" : "1.0.0", "versionName" : "1.1.1",
"versionCode" : "100", "versionCode" : 111,
"transformPx" : false, "transformPx" : false,
"sassImplementationName" : "node-sass", "sassImplementationName" : "node-sass",
/* 5+App */ /* 5+App */
@ -18,7 +18,9 @@
"delay" : 0 "delay" : 0
}, },
/* */ /* */
"modules" : {}, "modules" : {
"Bluetooth" : {}
},
/* */ /* */
"distribute" : { "distribute" : {
/* android */ /* android */
@ -42,10 +44,50 @@
] ]
}, },
/* ios */ /* ios */
"ios" : {}, "ios" : {
"privacyDescription" : {
"NSBluetoothPeripheralUsageDescription" : "使用蓝牙与外设通信",
"NSBluetoothAlwaysUsageDescription" : "需要蓝牙权限来连接设备"
}
},
/* SDK */ /* SDK */
"sdkConfigs" : { "sdkConfigs" : {
"speech" : {} "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" : { "uniStatistics" : {
"enable" : false "enable" : false
}, },
"vueVersion" : "2" "vueVersion" : "2",
"locale" : "zh-Hans",
"fallbackLocale" : "zh-Hans",
"h5" : {
"template" : "index.html"
}
} }

View File

@ -1,14 +1,14 @@
<template> <template>
<view class="content"> <view class="content">
<view class="title"> <view class="title">
自定义卡路里量 {{$t('titleCustomKcal')}}
<text class="desc">{{suggestion_kcal_range_val}}</text> <text class="desc">{{suggestion_kcal_range_val}}</text>
</view> </view>
<view class="input"> <view class="input">
<input type="digit" placeholder="请输入" v-model="kcal" /> <input type="digit" :placeholder="$t('verifyCalorie')" v-model="kcal" />
<text>千卡</text> <text>kcal</text>
</view> </view>
<view class="btn" @click="handlesub">确认修改</view> <view class="btn" @click="handlesub">{{$t('btnSubmit')}}</view>
</view> </view>
</template> </template>
@ -28,13 +28,16 @@
...mapState(["user"]), ...mapState(["user"]),
}, },
onLoad(options) { onLoad(options) {
uni.setNavigationBarTitle({
title: this.$t('titleSet')
})
this.suggestion_kcal_range_val = options.suggestion_kcal_range_val this.suggestion_kcal_range_val = options.suggestion_kcal_range_val
}, },
methods: { methods: {
handlesub() { handlesub() {
let that = this let that = this
if (that.kcal == '' || Number(that.kcal) <= 0) { if (that.kcal == '' || Number(that.kcal) <= 0) {
that.$tools.msg("请输入卡路里") that.$tools.msg(that.$t('verifyCalorie'))
return return
} }
that.$model.getCountSetUserKcal({ that.$model.getCountSetUserKcal({
@ -42,7 +45,7 @@
set_kcal: that.kcal set_kcal: that.kcal
}).then(res => { }).then(res => {
if (res.code == 0) { if (res.code == 0) {
that.$tools.msg("设置成功") that.$tools.msg(that.$t('msgSetSuccess'))
setTimeout(function() { setTimeout(function() {
uni.switchTab({ uni.switchTab({
url: '/pages/count/count' url: '/pages/count/count'

View File

@ -5,7 +5,7 @@
<!-- 早午晚餐 --> <!-- 早午晚餐 -->
<view class="everyDay"> <view class="everyDay">
<view class="title"> <view class="title">
<view><text class="quan"></text>卡路里分析</view> <view><text class="quan"></text>{{$t("countCalorieAnalysis")}}</view>
</view> </view>
<div class="chart-wrap"> <div class="chart-wrap">
<qiun-data-charts type="ring" :opts="opts" :chartData="chartData" :cHeight="320" :cWidth="320" /> <qiun-data-charts type="ring" :opts="opts" :chartData="chartData" :cHeight="320" :cWidth="320" />
@ -23,15 +23,15 @@
<!--营养元素分析 --> <!--营养元素分析 -->
<view class="everyDay"> <view class="everyDay">
<view class="title"> <view class="title">
<view><text class="quan"></text>营养元素能量占比</view> <view><text class="quan"></text>{{$t("countNutrientElementEnergyProportion")}}</view>
</view> </view>
<div class="chart-wrap"> <div class="chart-wrap">
<qiun-data-charts type="ring" :opts="opts2" :chartData="chartData2" :cHeight="320" :cWidth="320" /> <qiun-data-charts type="ring" :opts="opts2" :chartData="chartData2" :cHeight="320" :cWidth="320" />
</div> </div>
<view class="foodtools"> <view class="foodtools">
<view class="top"> <view class="top">
<view>营养分类</view> <view>{{$t("countNutritionClassification")}}</view>
<view>摄入</view> <view>{{$t("countIntake")}}</view>
</view> </view>
<view class="type"> <view class="type">
<view class="name"> <view class="name">
@ -66,7 +66,7 @@
<!--营养元素排行榜 --> <!--营养元素排行榜 -->
<view class="everyDay"> <view class="everyDay">
<view class="title"> <view class="title">
<view><text class="quan"></text>营养元素排行榜</view> <view><text class="quan"></text>{{$t("countNutritionElementRankingList")}}</view>
</view> </view>
<view class="foodtools rank_list"> <view class="foodtools rank_list">
<view class="topname">{{details.carbohydrate.name}}</view> <view class="topname">{{details.carbohydrate.name}}</view>
@ -138,7 +138,7 @@
import { import {
mapState mapState
} from "vuex"; } 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 { export default {
data() { data() {
return { return {
@ -170,6 +170,9 @@
onLoad(options) { onLoad(options) {
let that = this let that = this
that.page = options.page that.page = options.page
uni.setNavigationBarTitle({
title: this.$t('titleeveryDay')
})
that.handleList() that.handleList()
}, },
methods: { methods: {

View File

@ -12,7 +12,7 @@
<!-- 成分统计 --> <!-- 成分统计 -->
<view class="everyDay"> <view class="everyDay">
<view class="title"> <view class="title">
<view><text class="quan"></text>成分统计</view> <view><text class="quan"></text>{{$t('countComponentStatistics')}}</view>
</view> </view>
<view class="progress"> <view class="progress">
<div class="chart-wrap"> <div class="chart-wrap">
@ -36,7 +36,7 @@
<view class="foodtools"> <view class="foodtools">
<view class="type"> <view class="type">
<view class="title"> <view class="title">
<view><text class="quan"></text>食物类型</view> <view><text class="quan"></text>{{$t('countFoodTypes')}}</view>
</view> </view>
<view class="list" v-if="info.list.length"> <view class="list" v-if="info.list.length">
<uni-swipe-action> <uni-swipe-action>
@ -54,29 +54,29 @@
</view> </view>
<view v-else class="nolist"> <view v-else class="nolist">
<image src="/static/none.png"></image> <image src="/static/none.png"></image>
<view>暂无食物</view> <view>{{$t('countNoFood')}}</view>
</view> </view>
</view> </view>
</view> </view>
<!-- 添加食物 --> <!-- 添加食物 -->
<view class="add" @click="handleAddFood()"> <view class="add" @click="handleAddFood()">
<text>+</text>添加食物 <text>+</text>{{$t('countAddFood')}}
</view> </view>
</view> </view>
</view> </view>
<!-- 营养含量分析 --> <!-- 营养含量分析 -->
<uni-drawer ref="showRight" mode="right" width="300"> <uni-drawer ref="showRight" mode="right">
<scroll-view style="height: 100%;" scroll-y="true"> <scroll-view style="height: 100%;" scroll-y="true">
<view class="foodDetail"> <view class="foodDetail">
<view class="foodInfo"> <view class="foodInfo">
<image :src="activeFoodDetail.pic_url" mode="aspectFill"></image> <image :src="activeFoodDetail.pic_url" mode="aspectFill"></image>
<view class="info"> <view class="info">
<view class="name">{{activeFoodDetail.name}}</view> <view class="name">{{activeFoodDetail.name}}</view>
<view class="kcal">{{activeFoodDetail.val}}千卡</view> <view class="kcal">{{activeFoodDetail.val}}kcal</view>
</view> </view>
</view> </view>
<view class="foodContent"> <view class="foodContent">
<view class="title">热量和营养</view> <view class="title">{{$t('CaloriesAndnutrients')}}</view>
<view class="progress"> <view class="progress">
<div class="chart-wrap"> <div class="chart-wrap">
<qiun-data-charts type="ring" :opts="opts2" :chartData="chartData2" :cHeight="280" <qiun-data-charts type="ring" :opts="opts2" :chartData="chartData2" :cHeight="280"
@ -92,8 +92,8 @@
</view> </view>
</view> </view>
<view class="tips"> <view class="tips">
<text>营养素</text> <text>{{$t('Nutrients')}}</text>
<text>{{activeFoodDetail.weight}}含量</text> <text>{{activeFoodDetail.weight}}{{$t('Content')}}</text>
</view> </view>
<view class="foodDetailList"> <view class="foodDetailList">
<view class="foodDetailItem" v-for="(item,index) in activeFoodDetail.nutrients_list" <view class="foodDetailItem" v-for="(item,index) in activeFoodDetail.nutrients_list"
@ -115,7 +115,7 @@
mapState mapState
} from "vuex"; } from "vuex";
let next = 0 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 { export default {
data() { data() {
return { return {
@ -135,7 +135,7 @@
chartData2: {}, chartData2: {},
activeFoodDetail: {}, activeFoodDetail: {},
actionOptions: [{ actionOptions: [{
text: '删除', text: this.$t('btnDelete'),
style: { style: {
backgroundColor: '#dd524d', backgroundColor: '#dd524d',
borderRadius: '10rpx' borderRadius: '10rpx'
@ -166,6 +166,9 @@
that.page = options.page that.page = options.page
that.index = options.index that.index = options.index
that.bgimage = that.foodItem[options.index].icon_bg that.bgimage = that.foodItem[options.index].icon_bg
uni.setNavigationBarTitle({
title: this.$t('titleEveryMeal')
})
that.handleInfo() that.handleInfo()
}, },
watch: { watch: {
@ -230,7 +233,7 @@
delAcitionItem(item) { delAcitionItem(item) {
let that = this let that = this
uni.showModal({ uni.showModal({
content: `是否删除[${item.name}]`, content: that.$t("WhetherTodelete") + item.name,
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
this.$model.delCEatAction({ this.$model.delCEatAction({
@ -317,7 +320,6 @@
position: relative; position: relative;
width: 280rpx; width: 280rpx;
height: 280rpx; height: 280rpx;
margin-top: -30rpx;
margin-left: -15px; margin-left: -15px;
} }

View File

@ -248,7 +248,7 @@
import blueTooth from "../../components/bluetooth_food.vue" import blueTooth from "../../components/bluetooth_food.vue"
import FoodItem from "../../components/food_item.vue" import FoodItem from "../../components/food_item.vue"
// import ruler from "../../components/select-ruler/select-ruler.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") const plugin = requirePlugin("WechatSI")
export default { export default {
components: { components: {

View File

@ -13,11 +13,11 @@
</view> </view>
<view class="serach-box"> <view class="serach-box">
<view class="searchInput"> <view class="searchInput">
<input placeholder="请输入..." class="city-serach-input" v-model="search_value" /> <input :placeholder="$t('verifyRecord')" class="city-serach-input" v-model="search_value" />
<icon v-if="search_value" class="iconfont icon-error" @click="handlecolse" size="30"></icon> <icon v-if="search_value" class="iconfont icon-error" @click="handlecolse" size="30"></icon>
</view> </view>
<view class="searchBtn"> <view class="searchBtn">
<view @click="handleSerach">搜索</view> <view @click="handleSerach">{{$t("Search")}}</view>
</view> </view>
</view> </view>
</view> </view>
@ -25,7 +25,7 @@
<view class="content-box" v-if="!search_list.length"> <view class="content-box" v-if="!search_list.length">
<view v-if="history_food.length" class="search-history"> <view v-if="history_food.length" class="search-history">
<view class="title"> <view class="title">
<view class="quan mr-5"></view>历史搜索 <view class="quan mr-5"></view>{{$t("HistoricalSearch")}}
</view> </view>
<view class="button-container" @click="showAll =! showAll" v-if="history_food.length>10"> <view class="button-container" @click="showAll =! showAll" v-if="history_food.length>10">
<image :src="showAll?'/static/arrow-up.png':'/static/arrow-down.png'"></image> <image :src="showAll?'/static/arrow-up.png':'/static/arrow-down.png'"></image>
@ -40,7 +40,7 @@
</view> </view>
<view class="popular-container"> <view class="popular-container">
<view class="title"> <view class="title">
<view class="quan mr-5"></view>猜你想搜 <view class="quan mr-5"></view>{{$t("wantSearch")}}
</view> </view>
<view class="popular-food-item" v-for="(ite,index) in popular_food" :key="index"> <view class="popular-food-item" v-for="(ite,index) in popular_food" :key="index">
<view class="food-title">{{ite.title}}</view> <view class="food-title">{{ite.title}}</view>
@ -64,11 +64,11 @@
<image src="/static/arrow-down.png"></image> <image src="/static/arrow-down.png"></image>
</view> </view>
</view> </view>
<view class="mic-icon" @touchstart="onVoiceTouchStart" @touchend="onVoiceTouchEnd" <!-- <view class="mic-icon" @touchstart="onVoiceTouchStart" @touchend="onVoiceTouchEnd"
@touchcancel="cancelRecording"> @touchcancel="cancelRecording">
<uni-icons type="mic-filled" size="20" color="#fff"></uni-icons> <uni-icons type="mic-filled" size="20" color="#fff"></uni-icons>
语音搜索 {{$t("VoiceSearch")}}
</view> </view> -->
</view> </view>
<!-- 搜索列表 --> <!-- 搜索列表 -->
<view class="search_list" v-if="search_list.length"> <view class="search_list" v-if="search_list.length">
@ -79,7 +79,7 @@
<text>100g/{{ite.kcal}}kcal</text> <text>100g/{{ite.kcal}}kcal</text>
</view> </view>
</view> </view>
<view class="endtext" v-if="!lastPage || page >= lastPage"> 到底了看看别的吧 </view> <view class="endtext" v-if="!lastPage || page >= lastPage"> {{$t("msgBottom")}} </view>
</view> </view>
<!-- 购物车弹框 --> <!-- 购物车弹框 -->
<view class="wrapper activeList" v-if="isShop"> <view class="wrapper activeList" v-if="isShop">
@ -90,16 +90,15 @@
<view class="jishiqi"> <view class="jishiqi">
<view class="left"> <view class="left">
<view class="chart-wrap"> <view class="chart-wrap">
<qiun-data-charts type="arcbar" :chartData="chartData" :cHeight="280" :cWidth="280" <qiun-data-charts type="arcbar" :chartData="chartData" :cHeight="320" :cWidth="320" />
:canvas2d="true" canvasId="searchCharts" />
<view class="center"> <view class="center">
摄入 {{$t("countIntake")}}
<text>{{foodInfo[0].today_intake}}</text> <text>{{foodInfo[0].today_intake}}</text>
<view class="unit">Kcal</view> <view class="unit">Kcal</view>
</view> </view>
</view> </view>
<view class="mubiao"> <view class="mubiao">
目标<text>{{foodInfo[0].suggestion}}</text>kcal {{$t("titleBody")}}<text>{{foodInfo[0].suggestion}}</text>kcal
</view> </view>
</view> </view>
<view class="right"> <view class="right">
@ -132,8 +131,8 @@
</view> </view>
</view> </view>
<view class="box_list_item" v-if="ActiveList.length"> <view class="box_list_item" v-if="ActiveList.length">
<view class="length"><text <view class="length">{{$t("total")}}<text
class="red">{{ActiveList.filter(ite => ite.meals_type == foodName).length}}</text>条记录 class="red">{{ActiveList.filter(ite => ite.meals_type == foodName).length}}</text>{{$t("records")}}
</view> </view>
<view class="item" v-for="(ite,ind) in ActiveList" :key="ind" <view class="item" v-for="(ite,ind) in ActiveList" :key="ind"
v-if="ite.meals_type==foodName"> v-if="ite.meals_type==foodName">
@ -150,7 +149,7 @@
</view> </view>
<view v-else class="nolist list"> <view v-else class="nolist list">
<icon class="iconfont icon-wancan"></icon> <icon class="iconfont icon-wancan"></icon>
<text>还没有添加食物</text> <text>{{$t('countNoFood')}}</text>
</view> </view>
</view> </view>
</view> </view>
@ -168,7 +167,7 @@
<image :src="activeType.pic_url" mode="aspectFill"></image> <image :src="activeType.pic_url" mode="aspectFill"></image>
<view class="info"> <view class="info">
<view class="name">{{activeType.name}}</view> <view class="name">{{activeType.name}}</view>
<view class="kcal">{{activeType.kcal}}千卡/100</view> <view class="kcal">{{activeType.kcal}}kcal/100g</view>
</view> </view>
</view> </view>
</view> </view>
@ -187,15 +186,15 @@
<!-- 蓝牙称重 --> <!-- 蓝牙称重 -->
<view class="blue-tooth" v-if="isBle"> <view class="blue-tooth" v-if="isBle">
<blue-tooth @handleBle="handleBle" :weightKcal="weightKcal" <blue-tooth @handleBle="handleBle" :weightKcal="weightKcal"
@realTimeWeight="realTimeWeight" :btnType="'2'"></blue-tooth> @realTimeWeight="realTimeWeight" :btnType="btnType"></blue-tooth>
</view> </view>
</view> </view>
<!-- 营养分析 --> <!-- 营养分析 -->
<view class="foodDetail"> <view class="foodDetail">
<view class="foodContent"> <view class="foodContent">
<view class="tips"> <view class="tips">
<text>营养素</text> <text>{{$t('Nutrients')}}</text>
<text>{{Math.floor(activeType.weight)}}克含量</text> <text>{{Math.floor(activeType.weight)}}g{{$t('Content')}}</text>
</view> </view>
<view class="foodDetailList"> <view class="foodDetailList">
<view class="foodDetailItem" v-for="(item,index) in activeType.nutrients_list" <view class="foodDetailItem" v-for="(item,index) in activeType.nutrients_list"
@ -234,10 +233,10 @@
import { import {
mapState mapState
} from "vuex"; } from "vuex";
const plugin = requirePlugin("WechatSI") // const plugin = requirePlugin("WechatSI")
import search from "../../components/search.vue" import search from "../../components/search.vue"
import blueTooth from "../../components/bluetooth_food.vue" import blueTooth from "../../components/bluetooth_food.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';
export default { export default {
data() { data() {
return { return {
@ -249,6 +248,7 @@
}, },
foodInfo: [], foodInfo: [],
time: "", time: "",
btnType: 2,
page: 1, page: 1,
foodName: "", foodName: "",
showAll: false, showAll: false,
@ -257,12 +257,13 @@
isShop: false, isShop: false,
lastPage: "", lastPage: "",
isBle: true, isBle: true,
weightKcal: "", weightKcal: 0,
search_value: '', search_value: '',
ActiveList: [], ActiveList: [],
activeType: {}, activeType: {},
voiceManager: null, voiceManager: null,
showAutoSearchDlg: false showAutoSearchDlg: false,
index: 0,
}; };
}, },
computed: { computed: {
@ -285,7 +286,11 @@
onLoad(options) { onLoad(options) {
let that = this let that = this
that.time = options.time that.time = options.time
that.foodName = options.name that.index = options.index
uni.setNavigationBarTitle({
title: this.$t('titleCountSearch')
})
that.foodName = that.foodItem[that.index].name
}, },
watch: { watch: {
bleValue: { bleValue: {
@ -297,21 +302,21 @@
}, },
mounted() { mounted() {
let that = this let that = this
that.voiceManager = plugin.getRecordRecognitionManager() // that.voiceManager = plugin.getRecordRecognitionManager()
that.voiceManager.onStop = function(res) { // that.voiceManager.onStop = function(res) {
that.search_value = res.result.replace('。', '') // that.search_value = res.result.replace('', '')
that.handleSerach() // that.handleSerach()
} // }
that.voiceManager.onError = function(res) { // that.voiceManager.onError = function(res) {
console.error("error msg", res.retcode) // console.error("error msg", res.retcode)
} // }
that.voiceManager.stop() // that.voiceManager.stop()
}, },
onReachBottom() { onReachBottom() {
let that = this let that = this
if (!this.lastPage || this.page >= this.lastPage) { if (!this.lastPage || this.page >= this.lastPage) {
uni.showToast({ uni.showToast({
title: '没有更多数据!', title: this.$t('noMoreData'),
icon: 'none' icon: 'none'
}) })
return return
@ -389,7 +394,7 @@
that.IsWeight = true that.IsWeight = true
that.showAutoSearchDlg = false that.showAutoSearchDlg = false
that.activeType = ite that.activeType = ite
that.weightKcal = ite.kcal that.weightKcal = Number(ite.kcal)
if (that.bleValue.serviceId != "") { if (that.bleValue.serviceId != "") {
that.realTimeWeight(that.bleValue.countWeight, that.bleValue.unit) that.realTimeWeight(that.bleValue.countWeight, that.bleValue.unit)
} else { } else {
@ -471,7 +476,7 @@
let that = this let that = this
that.search_list = [] that.search_list = []
if (that.search_value == "") { if (that.search_value == "") {
that.$tools.msg("输入关键字后搜索") that.$tools.msg(this.$t('searchkeywords'))
return return
} }
that.$model.getFoodSearch({ that.$model.getFoodSearch({
@ -509,7 +514,7 @@
handledelactive(ite) { handledelactive(ite) {
let that = this let that = this
uni.showModal({ uni.showModal({
content: `是否删除[${ite.name}]`, content: this.$t('WhetherTodelete') + ite.name,
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
this.$model.delCEatAction({ this.$model.delCEatAction({
@ -1140,18 +1145,24 @@
border-radius: 10px; border-radius: 10px;
height: 340rpx; height: 340rpx;
.chart-wrap { .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 { .box_list {

View File

@ -3,7 +3,8 @@
<!-- --> <!-- -->
<view class="kcal"> <view class="kcal">
<view class="set"> <view class="set">
<input type="digit" v-model="weight" placeholder="请输入" :focus="focus" @blur="handleBlur"> <input type="digit" v-model="weight" :placeholder="$t('verifyRecord')" :focus="focus"
@blur="handleBlur">
<uni-icons v-if="weight!=''" type="close" size="24" class="uni-iocns" color="#999" <uni-icons v-if="weight!=''" type="close" size="24" class="uni-iocns" color="#999"
@click="handleclear"></uni-icons> @click="handleclear"></uni-icons>
<view class="num"> <view class="num">
@ -17,7 +18,7 @@
<!-- --> <!-- -->
<view class="kcal"> <view class="kcal">
<view class="text"> <view class="text">
营养占比 {{$t('countNutritionalProportion')}}
</view> </view>
<view class="slider"> <view class="slider">
<llt-slider-range :model-value="rangeValue" @change="handleChange" /> <llt-slider-range :model-value="rangeValue" @change="handleChange" />
@ -36,7 +37,7 @@
<text>{{ite}}</text> <text>{{ite}}</text>
</view> </view>
</view> </view>
<view class="subbtn" @click="handleEditKcal">保存</view> <view class="subbtn" @click="handleEditKcal">{{$t('btnSubmit')}}</view>
</view> </view>
</template> </template>
@ -69,6 +70,9 @@
}, },
onLoad() { onLoad() {
this.handleList() this.handleList()
uni.setNavigationBarTitle({
title: this.$t('titleSet')
})
}, },
components: { components: {
lltSliderRange lltSliderRange
@ -85,7 +89,8 @@
that.nutrition = res.data.nutrition that.nutrition = res.data.nutrition
that.weight = res.data.kcal.suggestion_kcal_val that.weight = res.data.kcal.suggestion_kcal_val
that.rangeValue[0] = Number(that.nutrition.list[0].proportion) 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) console.log("that.rangeValue", that.rangeValue)
that.handleProportion() that.handleProportion()
} }
@ -105,20 +110,20 @@
handleProportion() { handleProportion() {
let that = this let that = this
that.nutrition.list.forEach(ite => { that.nutrition.list.forEach(ite => {
if (ite.name.indexOf('碳水') != -1) { if (ite.key_v == "carbohydrate") {
ite.proportion = that.rangeValue[0] ite.proportion = that.rangeValue[0]
ite.val = Number(that.weight * ite.proportion / 100 / 4).toFixed(2) ite.val = Number(that.weight * ite.proportion / 100 / 4).toFixed(2)
that.carbohydrate_v = ite.val that.carbohydrate_v = ite.val
that.carbohydrate_p = ite.proportion that.carbohydrate_p = ite.proportion
} }
if (ite.name.indexOf('蛋白') != -1) { if (ite.key_v == "protein") {
ite.proportion = that.rangeValue[1] - that.rangeValue[0] ite.proportion = that.rangeValue[1] - that.rangeValue[0]
ite.val = Number(that.weight * ite.proportion / 100 / 4).toFixed(2) ite.val = Number(that.weight * ite.proportion / 100 / 4).toFixed(2)
that.protein_v = ite.val that.protein_v = ite.val
that.protein_p = ite.proportion that.protein_p = ite.proportion
} }
if (ite.name.indexOf('脂肪') != -1) { if (ite.key_v == "fat") {
ite.proportion = 100 - that.rangeValue[1] ite.proportion = 100 - that.rangeValue[1]
ite.val = Number(that.weight * ite.proportion / 100 / 9).toFixed(2) ite.val = Number(that.weight * ite.proportion / 100 / 9).toFixed(2)
that.fat_v = ite.val that.fat_v = ite.val
@ -134,7 +139,7 @@
handleEditKcal() { handleEditKcal() {
let that = this let that = this
if (that.weight == '' || Number(that.weight) <= 0) { if (that.weight == '' || Number(that.weight) <= 0) {
that.$tools.msg("请输入卡路里") that.$tools.msg(that.$t('verifyCalorie'))
return return
} }
that.$model.getCountSetUserKcal({ that.$model.getCountSetUserKcal({
@ -148,7 +153,7 @@
fat_p: that.fat_p, fat_p: that.fat_p,
}).then(res => { }).then(res => {
if (res.code == 0) { if (res.code == 0) {
that.$tools.msg("设置成功") that.$tools.msg(that.$t('msgSetSuccess'))
that.$store.dispatch("getUserInfo") that.$store.dispatch("getUserInfo")
setTimeout(function() { setTimeout(function() {
uni.switchTab({ uni.switchTab({

View File

@ -4,28 +4,28 @@
<view class="login"> <view class="login">
<view class="editem"> <view class="editem">
<view class="item"> <view class="item">
<view class="text">手机号/邮箱</view> <view class="text">{{$t("infoMobile")}}</view>
<view class="input"> <view class="input">
<input v-model="phone" type="text"/> <input v-model="phone" type="text" />
</view> </view>
</view> </view>
<view class="item "> <view class="item ">
<view class="text">验证码</view> <view class="text">{{$t("titleCode")}}</view>
<view class="input yanzhengma"> <view class="input yanzhengma">
<input class="uni-input" v-model="code" /> <input class="uni-input" v-model="code" />
<button class="code" type="none" @click="handleCode" v-model="code" <button class="code" type="none" @click="handleCode" v-model="code"
:disabled="disabled">{{second<60 ? second+'S后重发':'获取验证码'}} :disabled="disabled">{{second<60 ? second+$t("titleSendCodeRetry"):$t("titleSendCode")}}
</button> </button>
</view> </view>
</view> </view>
<view class="item"> <view class="item">
<view class="text">密码</view> <view class="text">{{$t("titlePassword")}}</view>
<view class="input"> <view class="input">
<input class="uni-input" v-model="password" /> <input class="uni-input" v-model="password" />
</view> </view>
</view> </view>
<view class="item"> <view class="item">
<view class="text">确认密码</view> <view class="text">{{$t("titleConfirmPassword")}}</view>
<view class="input"> <view class="input">
<input class="uni-input" v-model="password2" /> <input class="uni-input" v-model="password2" />
</view> </view>
@ -39,7 +39,7 @@
</label> </label>
</checkbox-group> </checkbox-group>
</view> --> </view> -->
<view class="btnlogin" @click="handleTelLogin">确认</view> <view class="btnlogin" @click="handleTelLogin">{{$t("titleRegister")}}</view>
</view> </view>
</view> </view>
</template> </template>
@ -59,6 +59,10 @@
} }
}, },
onLoad(options) { onLoad(options) {
let that = this
uni.setNavigationBarTitle({
title: that.$t('titleLogin')
})
this.type = options.type //1 this.type = options.type //1
}, },
methods: { methods: {
@ -70,31 +74,31 @@
let that = this let that = this
let phoneType = that.phone.indexOf("@") !== -1 let phoneType = that.phone.indexOf("@") !== -1
if (that.value == 0) { if (that.value == 0) {
that.$tools.msg("请先确认勾选协议") that.$tools.msg(that.$t("verifyAgreement"))
return return
} }
if (!phoneType && !(/^1[3456789]\d{9}$/.test(that.phone))) { if (!phoneType && !(/^1[3456789]\d{9}$/.test(that.phone))) {
that.$tools.msg("请输入正确的手机号") that.$tools.msg(that.$t("verifyMobileCorrect"))
return return
} }
if (phoneType && !(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(that.phone))) { if (phoneType && !(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(that.phone))) {
that.$tools.msg("请输入正确的邮箱") that.$tools.msg(that.$t("verifyEmailCorrect"))
return return
} }
if (!that.code) { if (!that.code) {
that.$tools.msg("请填写验证码") that.$tools.msg(that.$t("verifyCode"))
return return
} }
if (!that.password) { if (!that.password) {
that.$tools.msg("请填写密码") that.$tools.msg(that.$t("verifyPassword"))
return return
} }
if (!that.password2) { if (!that.password2) {
that.$tools.msg("请确认密码") that.$tools.msg(that.$t("verifyPassword"))
return return
} }
if (that.password2 != that.password) { if (that.password2 != that.password) {
that.$tools.msg("请确认两次密码填写一致") that.$tools.msg(that.$t("verifyPasswordCorrect"))
return return
} }
let account = { let account = {
@ -113,7 +117,8 @@
} }
uni.setStorageSync('token', res.data.token) uni.setStorageSync('token', res.data.token)
uni.setStorageSync('aan_id', res.data.aan_id) uni.setStorageSync('aan_id', res.data.aan_id)
that.$tools.msg("设置成功,进入程序中") that.$store.dispatch("getUserInfo")
that.$tools.msg(that.$t("msgSetPasswordSuccess"))
setTimeout(function() { setTimeout(function() {
uni.reLaunch({ uni.reLaunch({
url: "/pages/index/index" url: "/pages/index/index"
@ -126,11 +131,11 @@
let that = this let that = this
let phoneType = that.phone.indexOf("@") !== -1 let phoneType = that.phone.indexOf("@") !== -1
if (!phoneType && !(/^1[3456789]\d{9}$/.test(that.phone))) { if (!phoneType && !(/^1[3456789]\d{9}$/.test(that.phone))) {
that.$tools.msg("请输入正确的手机号") that.$tools.msg(that.$t("verifyMobileCorrect"))
return return
} }
if (phoneType && !(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(that.phone))) { if (phoneType && !(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(that.phone))) {
that.$tools.msg("请输入正确的邮箱") that.$tools.msg(that.$t("verifyEmailCorrect"))
return return
} }
// //
@ -194,7 +199,7 @@
.title { .title {
text-align: left; text-align: left;
color: #333; color: #333;
font-size: 40rpx; font-size: 40rpx;
font-weight: bold; font-weight: bold;
margin-bottom: 30rpx; margin-bottom: 30rpx;
} }
@ -242,13 +247,13 @@
left: 20rpx; left: 20rpx;
right: 0px; right: 0px;
z-index: 88; z-index: 88;
font-size:28rpx; font-size: 28rpx;
} }
.yanzhengma { .yanzhengma {
input { input {
right: 220rpx; right: 220rpx;
font-size:28rpx; font-size: 28rpx;
} }
} }
} }

View File

@ -6,54 +6,56 @@
<text>轻厨记</text> <text>轻厨记</text>
</view> </view>
<view class="login box_shadow"> <view class="login box_shadow">
<view class="title">登录</view> <view class="title">{{$t("titleLogin")}}</view>
<view class="toggle cblue" @click="handleToggle"> <view class="toggle cblue" @click="handleToggle">
切换登录 {{$t("titleToggleLogin")}}
</view> </view>
<view class="editem"> <view class="editem">
<view class="item"> <view class="item">
<view class="text">手机号/邮箱</view> <view class="text">{{$t("titleAccountText")}}</view>
<view class="input"> <view class="input">
<input v-model="phone" /> <input v-model="phone" />
</view> </view>
</view> </view>
<!-- 验证码登录 --> <!-- 验证码登录 -->
<view class="item " v-if="isCode"> <view class="item " v-if="isCode">
<view class="text">验证码</view> <view class="text">{{$t("titleCode")}}</view>
<view class="input yanzhengma"> <view class="input yanzhengma">
<input class="uni-input" v-model="code" /> <input class="uni-input" v-model="code" />
<button class="code" type="none" @click="handleCode" v-model="code" <button class="code" type="none" @click="handleCode" v-model="code"
:disabled="disabled">{{second<60 ? second+'S后重发':'获取验证码'}} :disabled="disabled">{{second<60 ? second+$t("titleSendCodeRetry"):$t("titleSendCode")}}
</button> </button>
</view> </view>
</view> </view>
<!-- 密码登录 --> <!-- 密码登录 -->
<view class="item " v-else> <view class="item " v-else>
<view class="text">密码</view> <view class="text">{{$t("titlePassword")}}</view>
<view class="input"> <view class="input">
<input class="uni-input" v-model="password" /> <input class="uni-input" v-model="password" />
</view> </view>
</view> </view>
<view class="forget " v-if="!isCode"> <view class="forget " v-if="!isCode">
<text @click="handlePassword('forgetPassword')">忘记密码?</text> <text @click="handlePassword('forgetPassword')">{{$t("titleForgotPassword")}}</text>
</view> </view>
</view> </view>
<view class="xieyi"> <view class="xieyi">
<checkbox-group @change="checkboxChange" class="group"> <checkbox-group @change="checkboxChange" class="group">
<label> <label>
<checkbox :value="1" style="transform:scale(0.7)" />阅读并同意 <checkbox :value="1" style="transform:scale(0.7)" />{{$t("titleAgreementText")}}
<!-- <text @click.stop @click="handleUserXieyi" class="blue">用户协议</text> --> <!-- <text @click.stop @click="handleUserXieyi" class="blue">用户协议</text> -->
<text @click.stop @click="handlexieyi" class="blue">隐私协议</text> <text @click.stop @click="handlexieyi" class="blue">{{$t("titleAgreementContntText")}}</text>
</label> </label>
</checkbox-group> </checkbox-group>
</view> </view>
<view class="btnlogin" @click="handleTelLogin">登录</view> <view class="btnlogin" @click="handleTelLogin">{{$t("titleLogin")}}</view>
<view class="btngroup" @click="handlePassword('register')"> <view class="btngroup" @click="handlePassword('register')">
<text>注册</text> <text>{{$t("titleRegister")}}</text>
</view> </view>
</view> </view>
<view class="wxbtn">
<!-- #ifdef MP-WEIXIN -->
<!-- <view class="wxbtn">
<button open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" v-if="value==1"> <button open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" v-if="value==1">
<view> <view>
<image src="../../static/phone.png"></image> <image src="../../static/phone.png"></image>
@ -66,7 +68,8 @@
</view> </view>
<text>手机号快捷登录</text> <text>手机号快捷登录</text>
</button> </button>
</view> </view> -->
<!-- #endif -->
</view> </view>
</template> </template>
@ -85,6 +88,10 @@
} }
}, },
onLoad() { onLoad() {
let that = this
uni.setNavigationBarTitle({
title: that.$t('titleLogin')
})
this.login() this.login()
}, },
methods: { methods: {
@ -96,23 +103,23 @@
let that = this let that = this
let phoneType = that.phone.indexOf("@") !== -1 let phoneType = that.phone.indexOf("@") !== -1
if (that.value == 0) { if (that.value == 0) {
that.$tools.msg("请先确认勾选协议") that.$tools.msg(that.$t("verifyAgreement"))
return return
} }
if (!phoneType && !(/^1[3456789]\d{9}$/.test(that.phone))) { if (!phoneType && !(/^1[3456789]\d{9}$/.test(that.phone))) {
that.$tools.msg("请输入正确的手机号") that.$tools.msg(that.$t("verifyMobileCorrect"))
return return
} }
if (phoneType && !(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(that.phone))) { if (phoneType && !(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(that.phone))) {
that.$tools.msg("请输入正确的邮箱") that.$tools.msg(that.$t("verifyEmailCorrect"))
return return
} }
if (that.isCode && !that.code) { if (that.isCode && !that.code) {
that.$tools.msg("请输入验证码") that.$tools.msg(that.$t("verifyCode"))
return return
} }
if (!that.isCode && !that.password) { if (!that.isCode && !that.password) {
that.$tools.msg('请输入正确密码') that.$tools.msg(that.$t("verifyPassword"))
return return
} }
this.$model.getonlogin({ this.$model.getonlogin({
@ -123,8 +130,9 @@
console.log("data", res.data) console.log("data", res.data)
that.$tools.msg(res.msg) that.$tools.msg(res.msg)
if (res.code != 0) return if (res.code != 0) return
that.$tools.msg("登录成功") that.$tools.msg(that.$t("msgLoginSuccess"))
uni.setStorageSync('token', res.data.token) uni.setStorageSync('token', res.data.token)
that.$store.dispatch("getHomeConfig")
setTimeout(function() { setTimeout(function() {
uni.reLaunch({ uni.reLaunch({
url: "/pages/index/index" url: "/pages/index/index"
@ -137,11 +145,11 @@
let that = this let that = this
let phoneType = that.phone.indexOf("@") !== -1 let phoneType = that.phone.indexOf("@") !== -1
if (!phoneType && !(/^1[3456789]\d{9}$/.test(that.phone))) { if (!phoneType && !(/^1[3456789]\d{9}$/.test(that.phone))) {
that.$tools.msg("请输入正确的手机号") that.$tools.msg(that.$t("verifyMobileCorrect"))
return return
} }
if (phoneType && !(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(that.phone))) { if (phoneType && !(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(that.phone))) {
that.$tools.msg("请输入正确的邮箱") that.$tools.msg(that.$t("verifyEmailCorrect"))
return return
} }
// //
@ -190,6 +198,7 @@
if (res.code != 0) return if (res.code != 0) return
that.value = 1 that.value = 1
uni.setStorageSync('token', res.data.token) uni.setStorageSync('token', res.data.token)
that.$store.dispatch("getHomeConfig")
setTimeout(function() { setTimeout(function() {
uni.reLaunch({ uni.reLaunch({
url: "/pages/index/index" url: "/pages/index/index"
@ -200,7 +209,7 @@
}, },
handleIsTel() { handleIsTel() {
if (this.value == 0) { if (this.value == 0) {
this.$tools.msg("请先确认勾选协议") this.$tools.msg(that.$t("verifyAgreement"))
return return
} }
}, },

View File

@ -51,10 +51,6 @@
onLoad(option) { onLoad(option) {
let that = this let that = this
that.type = option.pageName that.type = option.pageName
uni.setNavigationBarTitle({
title: option.pageName
});
}, },
onShow() { onShow() {
let that = this let that = this

View File

@ -3,20 +3,25 @@
<!-- 列表 --> <!-- 列表 -->
<view class="box"> <view class="box">
<view class="list" v-for="(item,ind) in infoList" :key="ind" @click="handleDetail(item)"> <view class="list" v-for="(item,ind) in infoList" :key="ind" @click="handleDetail(item)">
<view class="time">{{item.time}}</view> <view class="time">
<view class="date size14">{{item.time}}</view>
<uni-icons type="forward" size="20" color="#666"></uni-icons>
</view>
<view class="kcal"> <view class="kcal">
<view>摄入卡路里<text>{{item.val}}</text>{{item.unit}}</view> <view class="intake">
{{$t('countIntake')}}{{$t('kcal')}}
<text>{{item.val}}</text>{{item.unit}}
</view>
<view class="status"> <view class="status">
<text class="quan0" :style="'background:'+item.color"></text> <text class="quan0" :style="'background:'+item.color"></text>
{{item.describe}} {{item.describe}}
</view> </view>
<uni-icons type="forward" size="20" color="#666"></uni-icons>
</view> </view>
</view> </view>
<view class="endtext" v-if="!lastPage || page >= lastPage"> 到底了看看别的吧 </view> <view class="endtext" v-if="!lastPage || page >= lastPage"> {{$t('msgBottom')}} </view>
<view v-if="!infoList.length" class="nolist"> <view v-if="!infoList.length" class="nolist">
<icon class="iconfont icon-wancan"></icon> <icon class="iconfont icon-wancan"></icon>
<text>还没有记录哦</text> <text>{{$t('msgNoMoreData')}}</text>
</view> </view>
</view> </view>
@ -46,6 +51,9 @@
}, },
onLoad() { onLoad() {
let that = this let that = this
uni.setNavigationBarTitle({
title: that.$t('titleHistory')
})
that.page = 1 that.page = 1
that.handleList() that.handleList()
}, },
@ -53,7 +61,7 @@
let that = this let that = this
if (!this.lastPage || this.page >= this.lastPage) { if (!this.lastPage || this.page >= this.lastPage) {
uni.showToast({ uni.showToast({
title: '没有更多数据!', title: that.$t('noMoreData'),
icon: 'none' icon: 'none'
}) })
return return
@ -124,6 +132,18 @@
width: 100%; width: 100%;
height: 60rpx; height: 60rpx;
line-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 { .kcal {
@ -138,17 +158,8 @@
color: #000; color: #000;
} }
.status { .intake {
width: 85px; width: 80%;
}
.quan0 {
width: 24rpx;
height: 24rpx;
background: $uni-color-warning;
display: inline-block;
border-radius: 50%;
margin-right: 5px;
} }
} }
} }

View File

@ -117,7 +117,7 @@
mapState mapState
} from "vuex"; } from "vuex";
let next = 0 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 { export default {
data() { data() {
return { return {

View File

@ -10,28 +10,31 @@
</view> </view>
</view> </view>
<view class="lan border-bottom"> <view class="lan border-bottom">
<view class="left">昵称</view> <view class="left">{{$t('infoNickname')}}</view>
<view class="right"> <view class="right">
<input name="name" type="text" v-model="memInfo.nickname" placeholder="请输入" class="name" /> <input name="name" type="text" v-model="memInfo.nickname" :placeholder="$t('verifyRecord')"
class="name" />
<icon class="iconfont icon-bianji" v-if="!memInfo.nickname"></icon> <icon class="iconfont icon-bianji" v-if="!memInfo.nickname"></icon>
<icon class="iconfont icon-error" v-else @click="memInfo.nickname=''"></icon> <icon class="iconfont icon-error" v-else @click="memInfo.nickname=''"></icon>
</view> </view>
</view> </view>
<view class="lan border-bottom"> <view class="lan border-bottom">
<view class="left">性别</view> <view class="left">{{$t('infoGender')}}</view>
<view class="right"> <view class="right">
<picker mode="selector" :range="sexItem" @change="onsexArr"> <picker mode="selector" :range="sexItem" @change="onsexArr">
<view class="uni-input">{{memInfo.gender==0?'请选择':memInfo.gender==1?'男':'女'}}</view> <view class="uni-input">
{{memInfo.gender==0?$t('verifyPicker'):memInfo.gender==1? $t('infoMan'):$t('infoWoman')}}
</view>
<icon class="iconfont icon-arrow-down"></icon> <icon class="iconfont icon-arrow-down"></icon>
</picker> </picker>
</view> </view>
</view> </view>
<view class="lan border-bottom"> <view class="lan border-bottom">
<view class="left">出生日期</view> <view class="left">{{$t('infoBirthday')}}</view>
<view class="right"> <view class="right">
<picker mode="date" :end="endDate" @change="maskClick" <picker mode="date" :end="endDate" @change="maskClick"
:value="memInfo.birthday?memInfo.birthday:endDate"> :value="memInfo.birthday?memInfo.birthday:endDate" fields="day">
<view class="uni-input">{{memInfo.birthday?memInfo.birthday:"请选择"}}</view> <view class="uni-input">{{memInfo.birthday?memInfo.birthday:$t('verifyPicker')}}</view>
<icon class="iconfont icon-arrow-down"></icon> <icon class="iconfont icon-arrow-down"></icon>
</picker> </picker>
</view> </view>
@ -46,23 +49,24 @@
</view> </view>
</view> --> </view> -->
<view class="lan border-bottom"> <view class="lan border-bottom">
<view class="left">身高</view> <view class="left">{{$t('infoHeight')}}</view>
<view class="right"> <view class="right">
<input type="digit" v-model="memInfo.height" placeholder="请输入" /> <input type="digit" v-model="memInfo.height" :placeholder="$t('verifyRecord')" />
<text>cm</text> <text>cm</text>
</view> </view>
</view> </view>
<view class="lan border-bottom"> <view class="lan border-bottom">
<view class="left">体重</view> <view class="left">{{$t('infoWeight')}}</view>
<view class="right"> <view class="right">
<input type="digit" v-model="memInfo.weight" placeholder="请输入" /> <input type="digit" v-model="memInfo.weight" :placeholder="$t('verifyRecord')" />
<text>kg</text> <text>kg</text>
</view> </view>
</view> </view>
<view class="lan border-bottom"> <view class="lan border-bottom">
<view class="left">活动系数</view> <view class="left">{{$t('infoActivityCoefficient')}}</view>
<view class="right"> <view class="right">
<picker mode="selector" @change="changeClickType" :range="activityLevel" range-key="name" :value="levelInd"> <picker mode="selector" @change="changeClickType" :range="activityLevel" range-key="name"
:value="levelInd">
<view> <view>
{{activityLevel[levelInd].name}} {{activityLevel[levelInd].name}}
<icon class="iconfont icon-arrow-down"></icon> <icon class="iconfont icon-arrow-down"></icon>
@ -72,7 +76,7 @@
</view> </view>
</view> </view>
<view class="btn" @click="confirmInfo">提交</view> <view class="btn" @click="confirmInfo">{{$t('btnSubmit')}}</view>
</view> </view>
</template> </template>
@ -110,6 +114,10 @@
}, },
onLoad(options) { onLoad(options) {
// //
let that = this
uni.setNavigationBarTitle({
title: that.$t('infoPersonalProfile')
})
if (options.familayData) { if (options.familayData) {
let info = options.familayData let info = options.familayData
this.memInfo = JSON.parse(info) this.memInfo = JSON.parse(info)
@ -130,27 +138,27 @@
let that = this let that = this
console.log("activity_level", this.memInfo) console.log("activity_level", this.memInfo)
if (!this.memInfo.nickname) { if (!this.memInfo.nickname) {
this.$tools.msg("请输入昵称") this.$tools.msg(that.$t('verifyNickName'))
return; return;
} }
if (!this.memInfo.gender) { if (!this.memInfo.gender) {
this.$tools.msg("请选择性别") this.$tools.msg(that.$t('verifyGender'))
return; return;
} }
if (!this.memInfo.birthday) { if (!this.memInfo.birthday) {
this.$tools.msg("请选择出生日期") this.$tools.msg(that.$t('verifyBirthday'))
return; return;
} }
if (!this.memInfo.height) { if (!this.memInfo.height) {
this.$tools.msg("请输入身高") this.$tools.msg(that.$t('verifyHeight'))
return; return;
} }
if (!this.memInfo.weight) { if (!this.memInfo.weight) {
this.$tools.msg("请输入体重") this.$tools.msg(that.$t('verifyWeight'))
return; return;
} }
if (!this.memInfo.activity_level) { if (!this.memInfo.activity_level) {
this.$tools.msg("请选择活动系数") this.$tools.msg(that.$t('verifyActivityCoefficient'))
return; return;
} }
that.subInfo(this.memInfo) that.subInfo(this.memInfo)
@ -159,7 +167,6 @@
let that = this let that = this
that.$model.getUserInfoEdit(data).then(res => { that.$model.getUserInfoEdit(data).then(res => {
if (res.code == 0) { if (res.code == 0) {
that.$tools.msg("提交成功");
that.handleHomeUserInfo() that.handleHomeUserInfo()
uni.navigateBack({ uni.navigateBack({
delta: 1 delta: 1
@ -179,7 +186,6 @@
}, },
// //
maskClick(e) { maskClick(e) {
console.log("出生日期", e.detail.value)
this.memInfo.birthday = e.detail.value this.memInfo.birthday = e.detail.value
}, },
// //
@ -235,6 +241,7 @@
.left { .left {
width: 24%; width: 24%;
text-align: left; text-align: left;
line-height: 20px;
} }

View File

@ -3,22 +3,22 @@
<view class="login"> <view class="login">
<view class="editem"> <view class="editem">
<view class="item"> <view class="item">
<view class="text">邮箱</view> <view class="text">{{$t("infoEmail")}}</view>
<view class="input"> <view class="input">
<input v-model="phone" placeholder="请输入邮箱"/> <input v-model="phone" :placeholder="$t('verifyEmail')" />
</view> </view>
</view> </view>
<view class="item "> <view class="item ">
<view class="text">验证码</view> <view class="text">{{$t("titleCode")}}</view>
<view class="input yanzhengma"> <view class="input yanzhengma">
<input class="uni-input" v-model="code" /> <input class="uni-input" v-model="code" />
<button class="code" type="none" @click="handleCode" v-model="code" <button class="code" type="none" @click="handleCode" v-model="code"
:disabled="disabled">{{second<60 ? second+'S后重发':'获取验证码'}} :disabled="disabled">{{second<60 ? second+$t("titleSendCodeRetry"):$t("titleSendCode")}}
</button> </button>
</view> </view>
</view> </view>
</view> </view>
<view class="btnlogin" @click="handleTelLogin">确认</view> <view class="btnlogin" @click="handleTelLogin">{{$t("btnConfirm")}}</view>
</view> </view>
</view> </view>
</template> </template>
@ -33,16 +33,22 @@
second: 60, second: 60,
} }
}, },
onLoad() {
let that = this
uni.setNavigationBarTitle({
title: that.$t('titleEmail')
})
},
methods: { methods: {
// //
handleTelLogin() { handleTelLogin() {
let that = this let that = this
if (!(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(that.phone))) { if (!(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(that.phone))) {
that.$tools.msg("请输入正确的邮箱") that.$tools.msg(that.$t("verifyEmailCorrect"))
return return
} }
if (!that.code) { if (!that.code) {
that.$tools.msg("请填写验证码") that.$tools.msg(that.$t("verifyCode"))
return return
} }
that.$model.getAccountMsg({ that.$model.getAccountMsg({
@ -53,7 +59,7 @@
that.$tools.msg(res.msg) that.$tools.msg(res.msg)
return return
} else { } else {
that.$tools.msg("设置成功!") that.$tools.msg(that.$t("msgSetSuccess"))
that.$store.commit('changeAccountNumber', { that.$store.commit('changeAccountNumber', {
my_email: that.phone my_email: that.phone
}) })
@ -69,11 +75,11 @@
handleCode() { handleCode() {
let that = this let that = this
if (!that.phone) { if (!that.phone) {
that.$tools.msg("请输入邮箱") that.$tools.msg(that.$t("verifyEmail"))
return return
} }
if (!(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(that.phone))) { if (!(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(that.phone))) {
that.$tools.msg("请输入正确的邮箱") that.$tools.msg(that.$t("verifyEmailCorrect"))
return return
} }
// //
@ -114,7 +120,7 @@
background: #fff; background: #fff;
border-radius: 20rpx; border-radius: 20rpx;
padding: 30rpx; padding: 30rpx;
z-index: 99; z-index: 99;
.title { .title {
@ -180,7 +186,7 @@
} }
.code { .code {
width: 120rpx; width: auto;
background: #dfdfdf; background: #dfdfdf;
font-size: 14px; font-size: 14px;
margin: 0; margin: 0;

View File

@ -3,19 +3,19 @@
<view class="login"> <view class="login">
<view class="editem"> <view class="editem">
<view class="item"> <view class="item">
<view class="text">密码</view> <view class="text">{{$t('titlePassword')}}</view>
<view class="input"> <view class="input">
<input class="uni-input" v-model="password" placeholder="请输入密码" /> <input class="uni-input" v-model="password" :placeholder="$t('verifyPassword')" />
</view> </view>
</view> </view>
<view class="item"> <view class="item">
<view class="text">确认密码</view> <view class="text">{{$t('titleConfirmPassword')}}</view>
<view class="input"> <view class="input">
<input class="uni-input" v-model="password2" placeholder="请输入确认密码" /> <input class="uni-input" v-model="password2" :placeholder="$t('verifyPasswordTwo')" />
</view> </view>
</view> </view>
</view> </view>
<view class="btnlogin" @click="handleTelLogin">确认</view> <view class="btnlogin" @click="handleTelLogin">{{$t('btnSubmit')}}</view>
</view> </view>
</view> </view>
</template> </template>
@ -28,21 +28,26 @@
password2: "", password2: "",
} }
}, },
onLoad() {}, onLoad() {
let that = this
uni.setNavigationBarTitle({
title: that.$t('titlePasswordEdit')
})
},
methods: { methods: {
// //
handleTelLogin() { handleTelLogin() {
let that = this let that = this
if (!that.password) { if (!that.password) {
that.$tools.msg("请填写密码") that.$tools.msg(that.$t('verifyPassword'))
return return
} }
if (!that.password2) { if (!that.password2) {
that.$tools.msg("请确认密码") that.$tools.msg(that.$t('verifyPasswordTwo'))
return return
} }
if (that.password2 != that.password) { if (that.password2 != that.password) {
that.$tools.msg("请确认两次密码填写一致") that.$tools.msg(that.$t('verifyPasswordCorrect'))
return return
} }
that.$model.getAccountPassword({ that.$model.getAccountPassword({
@ -53,7 +58,7 @@
if (res.code != 0) { if (res.code != 0) {
that.$tools.msg(res.msg) that.$tools.msg(res.msg)
} else { } else {
that.$tools.msg("密码设置成功") that.$tools.msg(that.$t('msgSetSuccess'))
setTimeout(function() { setTimeout(function() {
uni.navigateBack() uni.navigateBack()
}, 1000) }, 1000)

View File

@ -3,22 +3,22 @@
<view class="login"> <view class="login">
<view class="editem"> <view class="editem">
<view class="item"> <view class="item">
<view class="text">手机号</view> <view class="text">{{$t('infoMobile')}}</view>
<view class="input"> <view class="input">
<input v-model="phone" placeholder="请输入手机号" /> <input v-model="phone" :placeholder="$t('verifyMobile')" />
</view> </view>
</view> </view>
<view class="item "> <view class="item ">
<view class="text">验证码</view> <view class="text">{{$t('titleCode')}}</view>
<view class="input yanzhengma"> <view class="input yanzhengma">
<input class="uni-input" v-model="code" /> <input class="uni-input" v-model="code" />
<button class="code" type="none" @click="handleCode" v-model="code" <button class="code" type="none" @click="handleCode" v-model="code"
:disabled="disabled">{{second<60 ? second+'S后重发':'获取验证码'}} :disabled="disabled">{{second<60 ? second+$t('titleSendCodeRetry'):$t('titleSendCode')}}
</button> </button>
</view> </view>
</view> </view>
</view> </view>
<view class="btnlogin" @click="handleTelLogin">确认</view> <view class="btnlogin" @click="handleTelLogin">{{$t('btnSubmit')}}</view>
</view> </view>
</view> </view>
</template> </template>
@ -33,16 +33,22 @@
second: 60, second: 60,
} }
}, },
onLoad() {
let that = this
uni.setNavigationBarTitle({
title: that.$t('titlePhone')
})
},
methods: { methods: {
// //
handleTelLogin() { handleTelLogin() {
let that = this let that = this
if (!phoneType && !(/^1[3456789]\d{9}$/.test(that.phone))) { if (!(/^1[3456789]\d{9}$/.test(that.phone))) {
that.$tools.msg("请输入正确的手机号") that.$tools.msg(that.$t('verifyMobileCorrect'))
return return
} }
if (!that.code) { if (!that.code) {
that.$tools.msg("请填写验证码") that.$tools.msg(that.$t('verifyCode'))
return return
} }
that.$model.getAccountMsg({ that.$model.getAccountMsg({
@ -53,7 +59,7 @@
that.$tools.msg(res.msg) that.$tools.msg(res.msg)
return return
} else { } else {
that.$tools.msg("设置成功!") that.$tools.msg(that.$t('msgSetSuccess'))
that.$store.commit('changeAccountNumber', { that.$store.commit('changeAccountNumber', {
my_tel: that.phone my_tel: that.phone
}) })
@ -69,11 +75,11 @@
handleCode() { handleCode() {
let that = this let that = this
if (!that.phone) { if (!that.phone) {
that.$tools.msg("请输入手机号") that.$tools.msg(that.$t('verifyMobile'))
return return
} }
if (!phoneType && !(/^1[3456789]\d{9}$/.test(that.phone))) { if (!phoneType && !(/^1[3456789]\d{9}$/.test(that.phone))) {
that.$tools.msg("请输入正确的手机号") that.$tools.msg(that.$t('verifyMobileCorrect'))
return return
} }
// //
@ -179,7 +185,7 @@
} }
.code { .code {
width: 120rpx; width: auto;
background: #dfdfdf; background: #dfdfdf;
font-size: 14px; font-size: 14px;
margin: 0; margin: 0;

View File

@ -1,21 +1,21 @@
<template> <template>
<view class="content"> <view class="content">
<view class="caritem" @click="navTo('/pageTwo/setting/phone')"> <view class="caritem" @click="navTo('/pageTwo/setting/phone')">
<view class="text">手机号</view> <view class="text">{{$t('infoMobile')}}</view>
<view class="text_r"> <view class="text_r">
<text>{{userinfo.tel?userinfo.tel:''}}</text> <text>{{userinfo.tel?userinfo.tel:''}}</text>
<uni-icons type="forward" size="20" color="#666"></uni-icons> <uni-icons type="forward" size="20" color="#666"></uni-icons>
</view> </view>
</view> </view>
<view class="caritem" @click="navTo('/pageTwo/setting/email')"> <view class="caritem" @click="navTo('/pageTwo/setting/email')">
<view class="text">邮箱</view> <view class="text">{{$t('infoEmail')}}</view>
<view class="text_r"> <view class="text_r">
<text>{{userinfo.email}}</text> <text>{{userinfo.email}}</text>
<uni-icons type="forward" size="20" color="#666"></uni-icons> <uni-icons type="forward" size="20" color="#666"></uni-icons>
</view> </view>
</view> </view>
<view class="caritem" @click="navTo('/pageTwo/setting/password')"> <view class="caritem" @click="navTo('/pageTwo/setting/password')">
<view class="text">设置密码</view> <view class="text">{{$t('titleSetPassword')}}</view>
<uni-icons type="forward" size="20" color="#666"></uni-icons> <uni-icons type="forward" size="20" color="#666"></uni-icons>
</view> </view>
<!-- <view class="btn mb-15" @click="handleOutLogin">删除账号</view> --> <!-- <view class="btn mb-15" @click="handleOutLogin">删除账号</view> -->
@ -40,18 +40,24 @@
return this.user return this.user
} }
}, },
onLoad() {
let that = this
uni.setNavigationBarTitle({
title: that.$t('titleSet')
})
},
methods: { methods: {
handleOutLogin() { handleOutLogin() {
let that = this let that = this
uni.showModal({ uni.showModal({
title: '友情提示', title: that.$t('msgTitle'),
confirmText: '删除', confirmText: that.$t('btnDelete'),
content: '删除成功后,该账号的所有关联信息将被清空且无法找回,是否删除?', content: that.$t('verifyDeleteAccount'),
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
that.$model.getdeleteAccount({}).then((res) => { that.$model.getdeleteAccount({}).then((res) => {
if (res.code != 0) return if (res.code != 0) return
that.$tools.msg("删除成功!"); that.$tools.msg(that.$t('msgDelete'));
uni.setStorageSync('token', null) uni.setStorageSync('token', null)
uni.setStorageSync('aan_id', null) uni.setStorageSync('aan_id', null)
uni.clearStorageSync() uni.clearStorageSync()
@ -62,7 +68,7 @@
}, 3000); }, 3000);
}) })
} else if (res.cancel) { } else if (res.cancel) {
that.$tools.msg("您已取消操作!"); that.$tools.msg(that.$t('msgCancel'));
} }
}, },
}) })

View File

@ -206,6 +206,12 @@
"style": { "style": {
"navigationBarTitleText": "营养分析" "navigationBarTitleText": "营养分析"
} }
},
{
"path": "me/about",
"style": {
"navigationBarTitleText": "关于我们"
}
} }
] ]
}], }],
@ -225,18 +231,6 @@
"selectedIconPath": "static/home01.png", "selectedIconPath": "static/home01.png",
"text": "首页" "text": "首页"
}, },
{
"pagePath": "pages/search/search",
"iconPath": "static/cai.png",
"selectedIconPath": "static/cai01.png",
"text": "教你做"
},
{
"pagePath": "pages/add/add",
"iconPath": "static/add.png",
"selectedIconPath": "static/add.png",
"text": ""
},
{ {
"pagePath": "pages/count/count", "pagePath": "pages/count/count",
"iconPath": "static/ji.png", "iconPath": "static/ji.png",

View File

@ -3,23 +3,23 @@
<view v-if="!token" class="list2" @click="handleLogin()"> <view v-if="!token" class="list2" @click="handleLogin()">
<view class="nolist"> <view class="nolist">
<icon class="iconfont icon-zanwushuju"></icon> <icon class="iconfont icon-zanwushuju"></icon>
<text>登录后查看更多哦</text> <text>{{$t('msgLoginTips')}}</text>
</view> </view>
<view class="btn">登录</view> <view class="btn">{{$t('titleLogin')}}</view>
</view> </view>
<view v-else class="content_box"> <view v-else class="content_box">
<!-- 称重 --> <!-- 称重 -->
<view class="blue-tooth"> <view class="blue-tooth">
<blue-tooth :btnType="'1'"></blue-tooth> <blue-tooth :btnType="btnType"></blue-tooth>
</view> </view>
<!-- 每日摄入 --> <!-- 每日摄入 -->
<view class="box" v-if="user.aud_id!=''"> <view class="box" v-if="user.aud_id!=''">
<!-- 日期选择 --> <!-- 日期选择 -->
<view class="data"> <view class="data">
<picker mode="date" :end="endDate" @change="changeClickDate" <picker mode="date" :end="endDate" @change="changeClickDate"
:value="foodInfo.date?foodInfo.date:endDate"> :value="foodInfo.date?foodInfo.date:endDate" fields="day">
<view> <view>
{{foodInfo.date?foodInfo.date:"请选择"}} {{foodInfo.date?foodInfo.date:$t('verifyPicker')}}
<image src="/static/qie.png"></image> <image src="/static/qie.png"></image>
</view> </view>
</picker> </picker>
@ -27,7 +27,7 @@
<!-- 能量摄入 --> <!-- 能量摄入 -->
<view class="everyDay"> <view class="everyDay">
<view class="title"> <view class="title">
<view>热量摄入</view> <view>{{$t('countCalorieIntake')}}</view>
<view class="icon" @click="handleSet"> <view class="icon" @click="handleSet">
<icon class="iconfont icon-shezhi1"></icon> <icon class="iconfont icon-shezhi1"></icon>
</view> </view>
@ -35,16 +35,15 @@
<view class="jishiqi"> <view class="jishiqi">
<view class="left"> <view class="left">
<view class="chart-wrap"> <view class="chart-wrap">
<qiun-data-charts type="arcbar" :chartData="chartData" :cHeight="280" :cWidth="280" <qiun-data-charts type="arcbar" :chartData="chartData" :cHeight="320" :cWidth="320" />
:canvas2d="true" canvasId="countCharts" v-if="handTrue" />
<view class="center"> <view class="center">
摄入 {{$t('countIntake')}}
<text>{{foodInfo.nutrients_four[0].today_intake}}</text> <text>{{foodInfo.nutrients_four[0].today_intake}}</text>
<view class="unit">Kcal</view> <view class="unit">Kcal</view>
</view> </view>
</view> </view>
<view class="mubiao"> <view class="mubiao">
目标<text>{{foodInfo.nutrients_four[0].suggestion}}</text>kcal {{$t('titleBody')}}<text>{{foodInfo.nutrients_four[0].suggestion}}</text>kcal
</view> </view>
</view> </view>
<view class="right"> <view class="right">
@ -79,7 +78,7 @@
<text>{{item.val}}{{item.unit}}</text> <text>{{item.val}}{{item.unit}}</text>
</view> </view>
<view class="detail"> <view class="detail">
餐食详情 {{$t('countMealdetails')}}
<uni-icons type="forward" size="20" color="#999"></uni-icons> <uni-icons type="forward" size="20" color="#999"></uni-icons>
</view> </view>
</view> </view>
@ -96,8 +95,8 @@
</view> </view>
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
<view class="add" @click="handleAddFood(item.name)"> <view class="add" @click="handleAddFood(index)">
<text>+</text>添加食物 <text>+</text>{{$t('countAddFood')}}
</view> </view>
</view> </view>
</view> </view>
@ -106,29 +105,29 @@
<view v-else class="list2" @click="handleEditUser()"> <view v-else class="list2" @click="handleEditUser()">
<view class="nolist"> <view class="nolist">
<image src="/static/none.png"></image> <image src="/static/none.png"></image>
<text>完善资料后记录更准确哦</text> <text>{{$t('msgAddUser')}}</text>
</view> </view>
<view class="btn">完善资料</view> <view class="btn">{{$t('ImproveInformation')}}</view>
</view> </view>
<view class="fenxi" @click="navTo('/pageTwo/count/everyDay?page=count')"> <view class="fenxi" @click="navTo('/pageTwo/count/everyDay?page=count')">
<image src="/static/fenxi.png"></image> <image src="/static/fenxi.png"></image>
营养分析 {{$t('titleeveryDay')}}
</view> </view>
</view> </view>
<!-- 营养含量分析 --> <!-- 营养含量分析 -->
<uni-drawer ref="showRight" mode="right" width="300"> <uni-drawer ref="showRight" mode="right">
<scroll-view style="height: 100%;" scroll-y="true"> <scroll-view style="height: 100%;" scroll-y="true">
<view class="foodDetail"> <view class="foodDetail">
<view class="foodInfo"> <view class="foodInfo">
<image :src="activeFoodDetail.pic_url" mode="aspectFill"></image> <image :src="activeFoodDetail.pic_url" mode="aspectFill"></image>
<view class="info"> <view class="info">
<view class="name">{{activeFoodDetail.name}}</view> <view class="name">{{activeFoodDetail.name}}</view>
<view class="kcal">{{activeFoodDetail.val}}千卡</view> <view class="kcal">{{activeFoodDetail.val}}kcal</view>
</view> </view>
</view> </view>
<view class="foodContent"> <view class="foodContent">
<view class="title">热量和营养</view> <view class="title">{{$t('CaloriesAndnutrients')}}</view>
<view class="progress"> <view class="progress">
<div class="chart-wrap"> <div class="chart-wrap">
<qiun-data-charts type="ring" :opts="opts" :chartData="chartData2" :cHeight="280" <qiun-data-charts type="ring" :opts="opts" :chartData="chartData2" :cHeight="280"
@ -144,8 +143,8 @@
</view> </view>
</view> </view>
<view class="tips"> <view class="tips">
<text>营养素</text> <text>{{$t('Nutrients')}}</text>
<text>{{activeFoodDetail.weight}}含量</text> <text>{{activeFoodDetail.weight}}{{$t('Content')}}</text>
</view> </view>
<view class="foodDetailList"> <view class="foodDetailList">
<view class="foodDetailItem" v-for="(item,index) in activeFoodDetail.nutrients_list" <view class="foodDetailItem" v-for="(item,index) in activeFoodDetail.nutrients_list"
@ -167,12 +166,13 @@
mapState mapState
} from "vuex"; } from "vuex";
import blueTooth from "../../components/bluetooth_food.vue" import blueTooth from "../../components/bluetooth_food.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';
export default { export default {
data() { data() {
return { return {
token: "", token: "",
index: 0, index: 0,
btnType: 1,
opts: { opts: {
background: "transparent", background: "transparent",
title: { title: {
@ -190,7 +190,7 @@
chartData2: {}, chartData2: {},
activeFoodDetail: {}, activeFoodDetail: {},
actionOptions: [{ actionOptions: [{
text: '删除', text: this.$t('btnDelete'),
style: { style: {
backgroundColor: '#dd524d', backgroundColor: '#dd524d',
borderRadius: '10rpx' borderRadius: '10rpx'
@ -217,6 +217,11 @@
return this.$tools.getDate("start") return this.$tools.getDate("start")
}, },
}, },
onLoad() {
uni.setNavigationBarTitle({
title: this.$t('titleCount')
})
},
onShow() { onShow() {
let that = this let that = this
that.token = uni.getStorageSync('token') that.token = uni.getStorageSync('token')
@ -279,10 +284,10 @@
}) })
}, },
// //
handleAddFood(name) { handleAddFood(index) {
this.isShow = false this.isShow = false
uni.navigateTo({ uni.navigateTo({
url: "/pageTwo/count/search?name=" + name + "&time=" + this.foodInfo.date url: "/pageTwo/count/search?index=" + index + "&time=" + this.foodInfo.date
}) })
}, },
// //
@ -301,7 +306,7 @@
delAcitionItem(item) { delAcitionItem(item) {
let that = this let that = this
uni.showModal({ uni.showModal({
content: `是否删除[${item.name}]`, content: that.$t('WhetherTodelete') + item.name,
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
this.$model.delCEatAction({ this.$model.delCEatAction({
@ -384,9 +389,8 @@
.chart-wrap { .chart-wrap {
position: relative; position: relative;
width: 250rpx; width: 280rpx;
height: 250rpx; height: 280rpx;
margin-top: -30rpx;
margin-left: -5px; margin-left: -5px;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
@ -396,7 +400,7 @@
width: 280rpx; width: 280rpx;
height: 210rpx; height: 210rpx;
position: absolute; position: absolute;
top: 64rpx; top: 44rpx;
} }
} }

View File

@ -2,18 +2,18 @@
<view class="content"> <view class="content">
<view class="box1 box" v-if="!token" @click="handleLogin"> <view class="box1 box" v-if="!token" @click="handleLogin">
<view class="info2"> <view class="info2">
未登录点击登录 {{$t('msgLoginTips')}}
</view> </view>
</view> </view>
<!-- 个人资料 --> <!-- 个人资料 -->
<view v-if="token" class="content-box"> <view v-if="token" class="content-box">
<view class="box" v-if="info.aud_id!=''"> <view class="box" v-if="info.aud_id!=''">
<view class="info"> <view class="info">
<!-- /pageTwo/me/userEdit -->
<view class="name" @click="navTo('/pageTwo/me/userEdit')"> <view class="name" @click="navTo('/pageTwo/me/userEdit')">
<image :src="info.head_pic"></image> <image :src="info.head_pic"></image>
<text class="bold">{{info.nickname}}</text> <text class="bold">{{info.nickname}}</text>
<text>{{info.gender=='1'?'男':'女'}}</text> <text>{{info.gender=='1'?$t('infoMan'):$t('infoWoman')}}</text>
</view> </view>
<view class="edit" @click="navTo('/pageTwo/me/userEdit')"> <view class="edit" @click="navTo('/pageTwo/me/userEdit')">
<image src="/static/26.png"></image> <image src="/static/26.png"></image>
@ -21,22 +21,22 @@
</view> </view>
<view class="age"> <view class="age">
<view class="age-item"> <view class="age-item">
<view><text>{{info.age}}</text></view> <view><text>{{info.age}}</text></view>
<view>年龄</view> <view>{{$t("infoAge")}}</view>
</view> </view>
<view class="age-item age-item2"> <view class="age-item age-item2">
<view><text>{{info.weight}}</text>kg</view> <view><text>{{info.weight}}</text></view>
<view>体重</view> <view>{{$t("infoWeight")}}</view>
</view> </view>
<view class="age-item"> <view class="age-item">
<view><text>{{info.height}}</text>cm</view> <view><text>{{info.height}}</text></view>
<view>身高</view> <view>{{$t("infoHeight")}}</view>
</view> </view>
</view> </view>
</view> </view>
<view class="box1 box" v-else @click="navTo('/pageTwo/me/userEdit')"> <view class="box1 box" v-else @click="navTo('/pageTwo/me/userEdit')">
<view class="info2"> <view class="info2">
完善资料后记录更准确哦 {{$t('msgAddUser')}}
</view> </view>
</view> </view>
</view> </view>
@ -46,21 +46,21 @@
<view class="date">{{foodInfo.date}}</view> <view class="date">{{foodInfo.date}}</view>
<view class="detail" @click="navTo('/pageTwo/count/everyDay?page=home')"> <view class="detail" @click="navTo('/pageTwo/count/everyDay?page=home')">
<image src="/static/fenxi.png"></image> <image src="/static/fenxi.png"></image>
营养分析 {{$t('titleeveryDay')}}
</view> </view>
</view> </view>
<view class="left"> <view class="left" v-if="foodInfo.list.length">
<view class="chart-wrap"> <view class="chart-wrap">
<qiun-data-charts v-if="handTrue" type="arcbar" :chartData="chartData" :cHeight="280" <qiun-data-charts v-if="handTrue" type="arcbar" :chartData="chartData" :cHeight="320"
:cWidth="280" /> :cWidth="320" />
<view class="center"> <view class="center">
摄入 {{$t('countIntake')}}
<text>{{foodInfo.nutrients_four[0].today_intake}}</text> <text>{{foodInfo.nutrients_four[0].today_intake}}</text>
<view class="unit">Kcal</view> <view class="unit">Kcal</view>
</view> </view>
</view> </view>
<view class="mubiao"> <view class="mubiao">
目标<text>{{foodInfo.nutrients_four[0].suggestion}}</text>kcal {{$t('titleBody')}}<text>{{foodInfo.nutrients_four[0].suggestion}}</text>kcal
</view> </view>
</view> </view>
<view class="right" v-if="foodInfo.list.length"> <view class="right" v-if="foodInfo.list.length">
@ -94,8 +94,8 @@
<view class="kcal"> <view class="kcal">
<text>{{ite.val}}</text>kcal <text>{{ite.val}}</text>kcal
</view> </view>
<view class="tools-btn" @click="navTo('/pageTwo/count/search?name='+ite.name+'&time='+foodInfo.date)"> <view class="tools-btn" @click="navTo('/pageTwo/count/search?index='+ind+'&time='+foodInfo.date)">
添加 {{$t('btnAdd')}}
</view> </view>
<view class="add" @click="navTo('/pageTwo/count/everyMeal?page=home&index='+ind)"> <view class="add" @click="navTo('/pageTwo/count/everyMeal?page=home&index='+ind)">
<image src="/static/xiangqing.png"></image> <image src="/static/xiangqing.png"></image>
@ -104,7 +104,7 @@
</view> </view>
<!-- 搜索 --> <!-- 搜索 -->
<view class="serachBox"> <!-- <view class="serachBox">
<view class="title"> <view class="title">
<view class="quan mr-5"></view>教你做 <view class="quan mr-5"></view>教你做
</view> </view>
@ -114,7 +114,7 @@
<image src="/static/28.png"></image> <image src="/static/28.png"></image>
</div> </div>
</view> </view>
</view> </view> -->
<!-- 轮播 --> <!-- 轮播 -->
<view class="f_banner footbox" v-if="configInfo.banner_data.length"> <view class="f_banner footbox" v-if="configInfo.banner_data.length">
@ -131,7 +131,7 @@
import { import {
mapState mapState
} from "vuex"; } 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 { export default {
data() { data() {
return { return {
@ -178,6 +178,9 @@
}, },
onLoad() { onLoad() {
let that = this let that = this
uni.setNavigationBarTitle({
title: that.$t('titleHome')
})
that.token = uni.getStorageSync('token') that.token = uni.getStorageSync('token')
if (that.token) { if (that.token) {
that.$ble.openBluetoothAdapter() that.$ble.openBluetoothAdapter()
@ -210,14 +213,6 @@
this.stopWatching() this.stopWatching()
}, },
methods: { methods: {
handleInfo() {
let that = this
this.$nextTick(() => {
that.chartData.series[0].data = that.user.aud_id == "" ? 0 : Number(that.user.food_count
.nutrients_four[0]
.proportion) / 100
})
},
startWatching() { startWatching() {
this.unwatch = this.$watch('bleValue', (newVal, oldVal) => { this.unwatch = this.$watch('bleValue', (newVal, oldVal) => {
// //
@ -247,7 +242,7 @@
// //
navTo(url) { navTo(url) {
if (!this.token) { if (!this.token) {
this.$tools.msg("登录后查看更多") this.$tools.msg(this.$t('msgLoginTips'))
return return
} }
uni.navigateTo({ uni.navigateTo({
@ -279,19 +274,18 @@
.chart-wrap { .chart-wrap {
position: relative; position: relative;
width: 250rpx; width: 280rpx;
height: 250rpx; height: 280rpx;
margin-top: -30rpx;
margin-left: -5px;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
margin-left: -5px;
.center { .center {
border: none; border: none;
width: 280rpx; width: 280rpx;
height: 210rpx; height: 210rpx;
position: absolute; position: absolute;
top: 64rpx; top: 44rpx;
} }
} }

View File

@ -1,7 +1,7 @@
<template> <template>
<view class="content"> <view class="content">
<view v-if="token" style="width: 100%;"> <view v-if="token" style="width: 100%;">
<view class="head" v-if="info.aud_id" @tap="navTo('/pageTwo/setting/setting')"> <view class="head" v-if="info.aud_id" @click="navTo('/pageTwo/setting/setting')">
<view class="left"> <view class="left">
<image :src="info.head_pic"></image> <image :src="info.head_pic"></image>
<text>{{info.nickname}}</text> <text>{{info.nickname}}</text>
@ -11,49 +11,68 @@
</view> </view>
</view> </view>
<view class="head " v-else @click="handleUserEdit"> <view class="head " v-else @click="handleUserEdit">
<text class="size22">完善资料后记录更准确哦</text> <text class="size22">{{$t('ImproveInformation')}}</text>
</view> </view>
</view> </view>
<view class="list"> <view class="list">
<view class="item" @tap="navTo('/pageTwo/me/userEdit')"> <view class="item" @click="navTo('/pageTwo/me/userEdit')">
<view> <view class="left">
<image src="/static/11.png" mode=""></image>个人资料 <image src="/static/11.png" mode=""></image>{{$t('infoPersonalProfile')}}
</view> </view>
<uni-icons type="forward" size="20" color="#666"></uni-icons> <uni-icons type="forward" size="20" color="#666"></uni-icons>
</view> </view>
<view class="item" @tap="navTo('/pageTwo/me/mymenu?pageName=我的菜谱')"> <!-- <view class="item" @click="navTo('/pageTwo/me/mymenu?pageName=我的菜谱')">
<view> <view class="left">
<image src="/static/12.png" mode=""></image>我的菜谱 <image src="/static/12.png" mode=""></image>{{$t('infoMyRecipes')}}
</view> </view>
<uni-icons type="forward" size="20" color="#666"></uni-icons> <uni-icons type="forward" size="20" color="#666"></uni-icons>
</view> </view>
<view class="item" @tap="navTo('/pageTwo/me/mymenu?pageName=我的收藏')"> <view class="item" @click="navTo('/pageTwo/me/mymenu?pageName=我的收藏')">
<view> <view class="left">
<image src="/static/27.png" mode=""></image>我的收藏 <image src="/static/27.png" mode=""></image>{{$t('infoMyCollection')}}
</view>
<uni-icons type="forward" size="20" color="#666"></uni-icons>
</view> -->
<view class="item" @click="navTo('/pageTwo/me/record')">
<view class="left">
<image src="/static/13.png" mode=""></image>{{$t('titleHistory')}}
</view> </view>
<uni-icons type="forward" size="20" color="#666"></uni-icons> <uni-icons type="forward" size="20" color="#666"></uni-icons>
</view> </view>
<view class="item" @tap="navTo('/pageTwo/me/record')"> <!-- #ifdef APP-PLUS -->
<view> <view class="item" @click="navTo('/pageTwo/me/about')">
<image src="/static/13.png" mode=""></image>饮食记录 <view class="left">
<image src="/static/27.png" mode=""></image>{{$t('titleAboutUs')}}
</view> </view>
<uni-icons type="forward" size="20" color="#666"></uni-icons> <uni-icons type="forward" size="20" color="#666"></uni-icons>
</view> </view>
<!-- #endif -->
<view class="item">
<view class="left">
<image src="/static/12.png" mode=""></image>{{$t('titleLanguage')}}
</view>
<view class="right">
<picker mode="selector" @change="changeClickLanguage" :range="languageList" range-key="name"
:value="levelInd">
<view>
{{languageList[levelInd].name}}
<icon class="iconfont icon-arrow-down"></icon>
</view>
</picker>
</view>
</view>
<view class="item" @click="navTo('/pageTwo/webview/webview?url=' + configInfo.business_cooperation.jump_url)"> <view class="item" @click="navTo('/pageTwo/webview/webview?url=' + configInfo.business_cooperation.jump_url)">
<view> <view class="left">
<image src="/static/14.png" mode=""></image>商务合作 <image src="/static/14.png" mode=""></image>{{$t('BusinessCooperation')}}
</view> </view>
<uni-icons type="forward" size="20" color="#666"></uni-icons> <uni-icons type="forward" size="20" color="#666"></uni-icons>
</view> </view>
<!-- <view class="item" @tap="navTo('/pageTwo/me/feedBack')">
<text>联系客服</text>
<uni-icons type="forward" size="20" color="#666"></uni-icons>
</view> -->
</view> </view>
<view class="btn" v-if="!token" @click="handleLogin">登录后查看更多</view> <view class="btn" v-if="!token" @click="handleLogin">{{$t('msgLoginTips')}}</view>
<view class="btn " v-if="token" @click="handleOutLogin">退出登录</view> <view class="btn " v-if="token" @click="handleOutLogin">{{$t('btnLogOut')}}</view>
</view> </view>
</template> </template>
@ -64,25 +83,34 @@
export default { export default {
data() { data() {
return { return {
token: null token: null,
levelInd: 0,
} }
}, },
computed: { computed: {
...mapState(["user",'configInfo']), ...mapState(["user", 'configInfo']),
info() { info() {
return this.user return this.user
}, },
languageList() {
return this.configInfo.language_arr
}
}, },
onLoad() { onLoad() {
let that = this let that = this
uni.setNavigationBarTitle({
title: that.$t('titleMe')
})
console.log(uni.getStorageSync('language'))
that.token = uni.getStorageSync('token') that.token = uni.getStorageSync('token')
that.levelInd = that.languageList.findIndex(ite => ite.key == uni.getStorageSync('language'))
}, },
methods: { methods: {
handleOutLogin() { handleOutLogin() {
let that = this let that = this
uni.showModal({ uni.showModal({
title: '友情提示', title: that.$t('msgTitle'),
content: '是否退出登录?', content: that.$t('verifyOutLogin'),
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
that.$model.getloginOut({}).then((res) => { that.$model.getloginOut({}).then((res) => {
@ -96,7 +124,7 @@
}) })
}) })
} else if (res.cancel) { } else if (res.cancel) {
that.$tools.msg("您已取消操作!"); that.$tools.msg($t('msgCancel'));
} }
}, },
}) })
@ -106,6 +134,44 @@
url: "/pageTwo/login/login" url: "/pageTwo/login/login"
}) })
}, },
//
changeClickLanguage(e) {
let that = this
let key = that.languageList[e.target.value].key
let val = that.languageList[e.target.value].val
that.levelInd = e.target.value
that.$model.getSetLanguage({
language: val,
}).then(res => {
that.$i18n.locale = key
uni.setStorageSync('language', key)
that.$store.commit('changeLocale', key)
that.$store.dispatch("getHomeConfig")
that.handleTabBarItem()
setTimeout(() => {
uni.reLaunch({
url: '/pages/index/index'
})
}, 500)
})
},
handleTabBarItem() {
let that = this
uni.setTabBarItem({
index: 0,
text: that.$t('titleHome')
})
uni.setTabBarItem({
index: 1,
text: that.$t('titleCount')
})
uni.setTabBarItem({
index: 2,
text: that.$t('titleMe')
})
},
// //
handleUserEdit() { handleUserEdit() {
uni.navigateTo({ uni.navigateTo({
@ -114,7 +180,7 @@
}, },
navTo(url) { navTo(url) {
if (!uni.getStorageSync('token')) { if (!uni.getStorageSync('token')) {
this.$tools.msg("登录后查看等多!") this.$tools.msg(this.$t('msgLoginTips'))
return return
} }
uni.navigateTo({ uni.navigateTo({
@ -188,12 +254,22 @@
margin-top: 30rpx; margin-top: 30rpx;
padding: 0 20rpx; padding: 0 20rpx;
view { .left {
width: 80%; width: 50%;
display: flex; display: flex;
align-items: center; align-items: center;
} }
.right {
width: 50%;
view {
width: 100%;
display: flex;
justify-content: flex-end;
}
}
image { image {
width: 50rpx; width: 50rpx;
height: 50rpx; height: 50rpx;

View File

@ -40,7 +40,10 @@ export default new Vuex.Store({
}, },
cookbook_label: [], cookbook_label: [],
activity_level: [], activity_level: [],
default_count_foot: {}, language_arr: [],
default_count_foot: {
list: [],
},
business_cooperation: {} business_cooperation: {}
}, },
// 计食器 // 计食器
@ -52,6 +55,11 @@ export default new Vuex.Store({
nutrients_four: [], nutrients_four: [],
trace_elements_all_day: [] trace_elements_all_day: []
}, },
phoneInfo: {
info: {},
versionUrl: null,
platform: ""
},
bleValue: { bleValue: {
deviceId: "", deviceId: "",
serviceId: "", serviceId: "",
@ -64,9 +72,14 @@ export default new Vuex.Store({
isConnectStatus: null, isConnectStatus: null,
}, },
isBluetoothTyle: false, isBluetoothTyle: false,
setLocale: "zh"
}, },
// mutations: Store中更改state数据状态的唯一方法(必须是同步函数) // mutations: Store中更改state数据状态的唯一方法(必须是同步函数)
mutations: { mutations: {
// 版本信息
changePhoneInfo(state, newData) {
Object.assign(state.phoneInfo, newData)
},
/* 用户信息 */ /* 用户信息 */
changeUserInfo(state, newData) { changeUserInfo(state, newData) {
state.user = newData state.user = newData
@ -82,6 +95,11 @@ export default new Vuex.Store({
changeConfig(state, newData) { changeConfig(state, newData) {
state.configInfo = newData state.configInfo = newData
}, },
// 设置语言
changeLocale(state, newData) {
console.log("changeLocale", newData)
state.setLocale = newData
},
// 计食器 // 计食器
changeCountFoodInfo(state, newData) { changeCountFoodInfo(state, newData) {
state.countFoodInfo = newData state.countFoodInfo = newData

View File

@ -1,19 +1,23 @@
import $store from '@/store' import $store from '@/store'
import messages from '@/language/index.js'
let searchTimer = null let searchTimer = null
let devicesList = [] let devicesList = []
// 初始化蓝牙 // 初始化蓝牙
function openBluetoothAdapter() { function openBluetoothAdapter() {
let Language = $store.state.setLocale
let $t = messages[Language]
uni.openBluetoothAdapter({ uni.openBluetoothAdapter({
success: e => { success: e => {
$store.commit("changeBluetoothValue", { $store.commit("changeBluetoothValue", {
bleTipsText: "蓝牙搜索中", bleTipsText: $t.SearchBluetooth,
isConnectStatus: 0 isConnectStatus: 0
}) })
startBluetoothDeviceDiscovery() startBluetoothDeviceDiscovery()
}, },
fail: e => { fail: e => {
$store.commit("changeBluetoothValue", { $store.commit("changeBluetoothValue", {
bleTipsText: "连接超时,点击重新连接", bleTipsText: $t.ConnectionTimeout,
isConnectStatus: 1 isConnectStatus: 1
}) })
} }
@ -21,6 +25,8 @@ function openBluetoothAdapter() {
} }
// 开始搜寻附近的蓝牙外围设备 // 开始搜寻附近的蓝牙外围设备
function startBluetoothDeviceDiscovery() { function startBluetoothDeviceDiscovery() {
let Language = $store.state.setLocale
let $t = messages[Language]
uni.startBluetoothDevicesDiscovery({ uni.startBluetoothDevicesDiscovery({
allowDuplicatesKey: true, allowDuplicatesKey: true,
services: [], services: [],
@ -31,7 +37,7 @@ function startBluetoothDeviceDiscovery() {
if (!devicesList.length) { if (!devicesList.length) {
clearTimeout(searchTimer); clearTimeout(searchTimer);
$store.commit("changeBluetoothValue", { $store.commit("changeBluetoothValue", {
bleTipsText: "连接超时,点击重新连接", bleTipsText: $t.ConnectionTimeout,
isConnectStatus: 1 isConnectStatus: 1
}); });
} }
@ -39,7 +45,7 @@ function startBluetoothDeviceDiscovery() {
}, },
fail: res => { fail: res => {
$store.commit("changeBluetoothValue", { $store.commit("changeBluetoothValue", {
bleTipsText: "连接超时,点击重新连接", bleTipsText: $t.ConnectionTimeout,
isConnectStatus: 1 isConnectStatus: 1
}) })
} }
@ -57,8 +63,8 @@ function onBluetoothDeviceFound() {
if (!device.name && !device.localName) { if (!device.name && !device.localName) {
return return
} }
if (device.name.indexOf('Chipsea-BLE') != -1 || (device.localName && device if (device.name.indexOf('G02') != -1 || (device.localName && device
.localName.indexOf('Chipsea-BLE') != -1) || id == 'a5fe') { .localName.indexOf('G02') != -1) || id == 'a5fe') {
clearTimeout(searchTimer); clearTimeout(searchTimer);
stopBluetoothDevicesDiscovery() stopBluetoothDevicesDiscovery()
Bluetoothfilter(device.deviceId) Bluetoothfilter(device.deviceId)
@ -143,6 +149,8 @@ function getBLEDeviceCharacteristics(deviceId, serviceId) {
function getBLECharacteristicValueChange(deviceId, serviceId, notify, write) { function getBLECharacteristicValueChange(deviceId, serviceId, notify, write) {
let that = this let that = this
let Language = $store.state.setLocale
let $t = messages[Language]
uni.notifyBLECharacteristicValueChange({ uni.notifyBLECharacteristicValueChange({
deviceId: deviceId, deviceId: deviceId,
serviceId: serviceId, serviceId: serviceId,
@ -156,10 +164,10 @@ function getBLECharacteristicValueChange(deviceId, serviceId, notify, write) {
write: write, write: write,
unit: "g", unit: "g",
countWeight: "", countWeight: "",
bleTipsText: "测量中,请将食物放到秤上", bleTipsText: $t.Measuring,
isConnectStatus: 0 isConnectStatus: 0
}) })
const units = ['kg', '', 'st:lb', 'lb', 'g', 'ml', 'Waterml', const units = ['kg', 'g', 'st:lb', 'lb', 'g', 'ml', 'Waterml',
'milkml', 'oz', 'floz', 'lboz' 'milkml', 'oz', 'floz', 'lboz'
] ]
uni.onBLECharacteristicValueChange(function(res) { uni.onBLECharacteristicValueChange(function(res) {
@ -264,11 +272,13 @@ function closeBLEConnection(deviceId) {
} }
// 监听蓝牙连接状态 // 监听蓝牙连接状态
function onBLEConnectionStateChange() { function onBLEConnectionStateChange() {
let Language = $store.state.setLocale
let $t = messages[Language]
uni.onBLEConnectionStateChange(function(res) { uni.onBLEConnectionStateChange(function(res) {
console.log("监听蓝牙连接状态", res.connected) console.log("监听蓝牙连接状态", res.connected)
if (!res.connected) { if (!res.connected) {
$store.commit("changeBluetoothValue", { $store.commit("changeBluetoothValue", {
bleTipsText: "连接超时,点击重新连接", bleTipsText: $t.ConnectionTimeout,
isConnectStatus: 1 isConnectStatus: 1
}) })
closeBLEConnection() closeBLEConnection()

View File

@ -44,7 +44,6 @@ const httpRequest = (url, method = "get", data) => {
}; };
function uploadFile(url, filePath) { function uploadFile(url, filePath) {
config.log
let promise = new Promise((resolve, reject) => { let promise = new Promise((resolve, reject) => {
uni.uploadFile({ uni.uploadFile({
url: baseUrl + url, url: baseUrl + url,

View File

@ -24,59 +24,70 @@ export default {
}) })
}, },
getRegisterPhone(param) { // 手机号快捷登录 getRegisterPhone(param) { // 手机号快捷登录
return http.post("/kitchenscale2/wechat_quick_login", param).then(res => { return http.post("/kitchenscale3/wechat_quick_login", param).then(res => {
return res return res
}) })
}, },
getResetPassword(param) { // 重置密码 getResetPassword(param) { // 重置密码
return http.post("/kitchenscale2/reset_password", param).then(res => { return http.post("/kitchenscale3/reset_password", param).then(res => {
return res return res
}) })
}, },
getAccountPassword(param) { // 修改密码 getAccountPassword(param) { // 修改密码
return http.post("/kitchenscale2/update_my_password", param).then(res => { return http.post("/kitchenscale3/update_my_password", param).then(res => {
return res return res
}) })
}, },
getAccountMsg(param) { // 邮箱/手机号绑定 getAccountMsg(param) { // 邮箱/手机号绑定
return http.post("/kitchenscale2/update_my_account_msg", param).then(res => { return http.post("/kitchenscale3/update_my_account_msg", param).then(res => {
return res return res
}) })
}, },
getloginversion(param) { // 版本信息
return http.post("/kitchenscale3/login_invalid_version", param).then(res => {
return res
})
},
getSetLanguage(param) { // 语言设置
return http.post("/kitchenscale3/update_language", param).then(res => {
return res
})
},
// 首页 // 首页
getHomeInfo(param) { // 默认数据 getHomeInfo(param) { // 默认数据
return http.post("/kitchenscale2/get_homepage_information", param).then(res => { return http.post("/kitchenscale3/get_homepage_information", param).then(res => {
return res return res
}) })
}, },
getHomeUserInfo(param) { // 用户信息 getHomeUserInfo(param) { // 用户信息
return http.post("/kitchenscale2/get_user_msg", param).then(res => { return http.post("/kitchenscale3/get_user_msg", param).then(res => {
return res return res
}) })
}, },
getHomeConfig(param) { // 配置 getHomeConfig(param) { // 配置
return http.post("/kitchenscale2/get_default_config", param).then(res => { return http.post("/kitchenscale3/get_default_config", param).then(res => {
return res return res
}) })
}, },
getHomeSearch(param) { // 首页搜索 getHomeSearch(param) { // 首页搜索
return http.post("/kitchenscale2/search_column", param).then(res => { return http.post("/kitchenscale3/search_column", param).then(res => {
return res return res
}) })
}, },
getUserInfoEdit(param) { // 修改用户信息 getUserInfoEdit(param) { // 修改用户信息
return http.post("/kitchenscale2/update_user_msg", param).then(res => { return http.post("/kitchenscale3/update_user_msg", param).then(res => {
return res return res
}) })
}, },
getSearchPopularFood(param) { //获取搜索页面常用食材 getSearchPopularFood(param) { //获取搜索页面常用食材
return http.post("/kitchenscale2/get_search_food_page_list", param).then(res => { return http.post("/kitchenscale3/get_search_food_page_list", param).then(res => {
return res return res
}) })
}, },
getFoodSearch(param) { //搜索食材 getFoodSearch(param) { //搜索食材
return http.post("/kitchenscale2/get_food_list", param).then(res => { return http.post("/kitchenscale3/get_food_list", param).then(res => {
return res return res
}) })
}, },
@ -86,129 +97,129 @@ export default {
}) })
}, },
getMenuSearchColumn(param) { //搜索菜谱2 getMenuSearchColumn(param) { //搜索菜谱2
return http.post("/kitchenscale2/search_column", param).then(res => { return http.post("/kitchenscale3/search_column", param).then(res => {
return res return res
}) })
}, },
getPhotoSearch(param) { //图像识别 getPhotoSearch(param) { //图像识别
return http.post("/kitchenscale2/baidu_identify_food", param).then(res => { return http.post("/kitchenscale3/baidu_identify_food", param).then(res => {
return res return res
}) })
}, },
// 通用 // 通用
getUploadImg(param) { // 上传素材 getUploadImg(param) { // 上传素材
return http.upload("/kitchenscale2/pic_upload_one_action", param).then(res => { return http.upload("/kitchenscale3/pic_upload_one_action", param).then(res => {
return res return res
}) })
}, },
// 菜谱 // 菜谱
getAddCookbook(param) { // 添加菜谱 getAddCookbook(param) { // 添加菜谱
return http.post("/kitchenscale2/add_cookbook", param).then(res => { return http.post("/kitchenscale3/add_cookbook", param).then(res => {
return res return res
}) })
}, },
getEditCookbook(param) { // 修改菜谱 getEditCookbook(param) { // 修改菜谱
return http.post("/kitchenscale2/update_cookbook", param).then(res => { return http.post("/kitchenscale3/update_cookbook", param).then(res => {
return res return res
}) })
}, },
getCookListLabel(param) { // 菜谱查询(根据菜谱标签拉取) getCookListLabel(param) { // 菜谱查询(根据菜谱标签拉取)
return http.post("/kitchenscale2/find_by_cook_label", param).then(res => { return http.post("/kitchenscale3/find_by_cook_label", param).then(res => {
return res return res
}) })
}, },
getCookListFood(param) { // 菜谱列表(根据食材名称拉取) getCookListFood(param) { // 菜谱列表(根据食材名称拉取)
return http.post("/kitchenscale2/find_by_food", param).then(res => { return http.post("/kitchenscale3/find_by_food", param).then(res => {
return res return res
}) })
}, },
getCookListDetails(param) { // 查询菜谱详情 getCookListDetails(param) { // 查询菜谱详情
return http.post("/kitchenscale2/cookbook_details", param).then(res => { return http.post("/kitchenscale3/cookbook_details", param).then(res => {
return res return res
}) })
}, },
getCookFollow(param) { // 关注行为 getCookFollow(param) { // 关注行为
return http.post("/kitchenscale2/cookbook_follow", param).then(res => { return http.post("/kitchenscale3/cookbook_follow", param).then(res => {
return res return res
}) })
}, },
getCookLike(param) { // 点赞收藏菜谱 getCookLike(param) { // 点赞收藏菜谱
return http.post("/kitchenscale2/cookbook_like", param).then(res => { return http.post("/kitchenscale3/cookbook_like", param).then(res => {
return res return res
}) })
}, },
getCookKcal(param) { // 食材卡路里计算 getCookKcal(param) { // 食材卡路里计算
return http.post("/kitchenscale2/food_count_kcal", param).then(res => { return http.post("/kitchenscale3/food_count_kcal", param).then(res => {
return res return res
}) })
}, },
// 食材 // 食材
getCookFoodList(param) { // 食材列表 getCookFoodList(param) { // 食材列表
return http.post("/kitchenscale2/get_food_list", param).then(res => { return http.post("/kitchenscale3/get_food_list", param).then(res => {
return res return res
}) })
}, },
getCookListSave(param) { // 食材列表查询 getCookListSave(param) { // 食材列表查询
return http.post("/kitchenscale2/save_food_list", param).then(res => { return http.post("/kitchenscale3/save_food_list", param).then(res => {
return res return res
}) })
}, },
// 计食器 // 计食器
getAddIntakeFood(param) { // 添加每日摄入记录 getAddIntakeFood(param) { // 添加每日摄入记录
return http.post("/kitchenscale2/add_intake_food", param).then(res => { return http.post("/kitchenscale3/add_intake_food", param).then(res => {
return res return res
}) })
}, },
getAddEveryMealFood(param) { // 当次食材添加的卡路里摄入记录 getAddEveryMealFood(param) { // 当次食材添加的卡路里摄入记录
return http.post("/kitchenscale2/current_food_statistics", param).then(res => { return http.post("/kitchenscale3/current_food_statistics", param).then(res => {
return res return res
}) })
}, },
getCountfootCon(param) { // 每日记食器板块详细内容 getCountfootCon(param) { // 每日记食器板块详细内容
return http.post("/kitchenscale2/get_countfoot_content", param).then(res => { return http.post("/kitchenscale3/get_countfoot_content", param).then(res => {
return res return res
}) })
}, },
delCEatAction(param) { // 删除餐饮食物 delCEatAction(param) { // 删除餐饮食物
return http.post("/kitchenscale2/del_user_eat_log", param).then(res => { return http.post("/kitchenscale3/del_user_eat_log", param).then(res => {
return res return res
}) })
}, },
getLogList(param) { // 记食器角色饮食记录列表 getLogList(param) { // 记食器角色饮食记录列表
return http.post("/kitchenscale2/get_log_list", param).then(res => { return http.post("/kitchenscale3/get_log_list", param).then(res => {
return res return res
}) })
}, },
getSetUpContent(param) { // 计食器板块-设置里的内容 getSetUpContent(param) { // 计食器板块-设置里的内容
return http.post("/kitchenscale2/set_up_content", param).then(res => { return http.post("/kitchenscale3/set_up_content", param).then(res => {
return res return res
}) })
}, },
getSetUserKcal(param) { // 设置用户的卡路里 getSetUserKcal(param) { // 设置用户的卡路里
return http.post("/kitchenscale2/set_user_kcal", param).then(res => { return http.post("/kitchenscale3/set_user_kcal", param).then(res => {
return res return res
}) })
}, },
// 个人中心 // 个人中心
getUserCollectList(param) { // 用户收藏点赞列表 getUserCollectList(param) { // 用户收藏点赞列表
return http.post("/kitchenscale2/get_user_collect_list", param).then(res => { return http.post("/kitchenscale3/get_user_collect_list", param).then(res => {
return res return res
}) })
}, },
getMyCookbook(param) { // 我的菜谱 getMyCookbook(param) { // 我的菜谱
return http.post("/kitchenscale2/get_my_cookbook", param).then(res => { return http.post("/kitchenscale3/get_my_cookbook", param).then(res => {
return res return res
}) })
}, },
getMyCookbookDel(param) { // 删除我的菜谱 getMyCookbookDel(param) { // 删除我的菜谱
return http.post("/kitchenscale2/del_my_cookbook", param).then(res => { return http.post("/kitchenscale3/del_my_cookbook", param).then(res => {
return res return res
}) })
}, },
getMyLogList(param) { // 饮食列表 getMyLogList(param) { // 饮食列表
return http.post("/kitchenscale2/get_log_list", param).then(res => { return http.post("/kitchenscale3/get_log_list", param).then(res => {
let pkList = { let pkList = {
list: [], list: [],
Dlist: [] Dlist: []
@ -227,22 +238,22 @@ export default {
}, },
// 计食器 // 计食器
getAddIntakeFood(param) { // 添加每日摄入记录 getAddIntakeFood(param) { // 添加每日摄入记录
return http.post("/kitchenscale2/add_intake_food", param).then(res => { return http.post("/kitchenscale3/add_intake_food", param).then(res => {
return res return res
}) })
}, },
getCountFoodInfo(param) { // 获取记食器板块详细内容 getCountFoodInfo(param) { // 获取记食器板块详细内容
return http.post("/kitchenscale2/get_countfoot_content", param).then(res => { return http.post("/kitchenscale3/get_countfoot_content", param).then(res => {
return res return res
}) })
}, },
getCountSetKcal(param) { // 获取记食器设置里的内容 getCountSetKcal(param) { // 获取记食器设置里的内容
return http.post("/kitchenscale2/set_up_content", param).then(res => { return http.post("/kitchenscale3/set_up_content", param).then(res => {
return res return res
}) })
}, },
getCountSetUserKcal(param) { // 获取记食器设置里的内容 getCountSetUserKcal(param) { // 获取记食器设置里的内容
return http.post("/kitchenscale2/set_user_kcal", param).then(res => { return http.post("/kitchenscale3/set_user_kcal", param).then(res => {
return res return res
}) })
}, },

View File

@ -8,8 +8,30 @@ export default {
getMonth, getMonth,
GetDateStr, GetDateStr,
NewsPtype, NewsPtype,
compareVersions,
mergeAndDeduplicate mergeAndDeduplicate
} }
// 版本对比
function compareVersions(version1, version2) {
console.log("版本对比", version1, version2)
// 将版本号拆分成数字数组
var arr1 = version1.split('.').map(Number);;
var arr2 = version2.split('.').map(Number);;
// 遍历数字数组进行逐段比较
for (var i = 0; i < Math.max(arr1.length, arr2.length); i++) {
var num1 = parseInt(arr1[i] || 0); // 如果数组长度不够则将缺失部分补0
var num2 = parseInt(arr2[i] || 0);
if (num1 < num2) {
return -1; // 版本1小于版本2
} else if (num1 > num2) {
return 1; // 版本1大于版本2
}
}
return 0; // 版本1等于版本2
}
function NewsPtype(con) { function NewsPtype(con) {
if (con.type == "wechat") { //跳小程序 if (con.type == "wechat") { //跳小程序

File diff suppressed because it is too large Load Diff

View File

@ -1,579 +0,0 @@
/*
* uCharts®
* 高性能跨平台图表库支持H5APP小程序微信/支付宝/百度/头条/QQ/360VueTaro等支持canvas的框架平台
* Copyright (c) 2021 QIUN®秋云 https://www.ucharts.cn All rights reserved.
* Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
* 复制使用请保留本段注释感谢支持开源
*
* uCharts®官方网站
* https://www.uCharts.cn
*
* 开源地址:
* https://gitee.com/uCharts/uCharts
*
* uni-app插件市场地址
* http://ext.dcloud.net.cn/plugin?id=271
*
*/
// 主题颜色配置如每个图表类型需要不同主题请在对应图表类型上更改color属性
const color = ['#1890FF', '#91CB74', '#FAC858', '#EE6666', '#73C0DE', '#3CA272', '#FC8452', '#9A60B4', '#ea7ccc'];
//事件转换函数主要用作格式化x轴为时间轴根据需求自行修改
const formatDateTime = (timeStamp, returnType) => {
var date = new Date();
date.setTime(timeStamp * 1000);
var y = date.getFullYear();
var m = date.getMonth() + 1;
m = m < 10 ? ('0' + m) : m;
var d = date.getDate();
d = d < 10 ? ('0' + d) : d;
var h = date.getHours();
h = h < 10 ? ('0' + h) : h;
var minute = date.getMinutes();
var second = date.getSeconds();
minute = minute < 10 ? ('0' + minute) : minute;
second = second < 10 ? ('0' + second) : second;
if (returnType == 'full') {
return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + second;
}
if (returnType == 'y-m-d') {
return y + '-' + m + '-' + d;
}
if (returnType == 'h:m') {
return h + ':' + minute;
}
if (returnType == 'h:m:s') {
return h + ':' + minute + ':' + second;
}
return [y, m, d, h, minute, second];
}
module.exports = {
//demotype为自定义图表类型一般不需要自定义图表类型只需要改根节点上对应的类型即可
"type": ["pie", "ring", "rose", "word", "funnel", "map", "arcbar", "line", "column", "area", "radar", "gauge",
"candle", "mix", "tline", "tarea", "scatter", "bubble", "demotype"
],
"range": ["饼状图", "圆环图", "玫瑰图", "词云图", "漏斗图", "地图", "圆弧进度条", "折线图", "柱状图", "区域图", "雷达图", "仪表盘", "K线图", "混合图",
"时间轴折线", "时间轴区域", "散点图", "气泡图", "自定义类型"
],
//增加自定义图表类型如果需要categories请在这里加入您的图表类型例如最后的"demotype"
//自定义类型时需要注意"tline","tarea","scatter","bubble"等时间轴矢量x轴类图表没有categories不需要加入categories
"categories": ["line", "column", "area", "radar", "gauge", "candle", "mix", "demotype"],
//instance为实例变量承载属性不要删除
"instance": {},
//option为opts及eopts承载属性不要删除
"option": {},
//下面是自定义format配置因除H5端外的其他端无法通过props传递函数只能通过此属性对应下标的方式来替换
"formatter": {
"yAxisDemo1": function(val) {
return val + '元'
},
"yAxisDemo2": function(val) {
return val.toFixed(2)
},
"xAxisDemo1": function(val) {
return val + '年'
},
"xAxisDemo2": function(val) {
return formatDateTime(val, 'h:m')
},
"seriesDemo1": function(val) {
return val + '元'
},
"tooltipDemo1": function(item, category, index, opts) {
if (index == 0) {
return '随便用' + item.data + '年'
} else {
return '其他我没改' + item.data + '天'
}
},
"pieDemo": function(val, index, series) {
if (index !== undefined) {
return series[index].name + '' + series[index].data + '元'
}
},
},
//这里演示了自定义您的图表类型的option可以随意命名之后在组件上 type="demotype" 后组件会调用这个花括号里的option如果组件上还存在opts参数会将demotype与opts中option合并后渲染图表。
"demotype": {
//我这里把曲线图当做了自定义图表类型,您可以根据需要随意指定类型或配置
"type": "line",
"color": color,
"padding": [15, 10, 0, 15],
"xAxis": {
"disableGrid": true,
},
"yAxis": {
"gridType": "dash",
"dashLength": 2,
},
"legend": {},
"extra": {
"line": {
"type": "curve",
"width": 2
},
}
},
//下面是自定义配置,请添加项目所需的通用配置
"pie": {
"type": "pie",
"color": color,
"padding": [5, 5, 5, 5],
"extra": {
"pie": {
"activeOpacity": 0.5,
"activeRadius": 10,
"offsetAngle": 0,
"labelWidth": 15,
"border": true,
"borderWidth": 3,
"borderColor": "#FFFFFF"
},
}
},
"ring": {
"type": "ring",
"color": color,
"padding": [5, 5, 5, 5],
"rotate": false,
"dataLabel": false,
"legend": {
"show": false,
"position": "right",
"lineHeight": 25,
},
"title": {
"name": "",
"fontSize": 22,
"color": "#666666"
},
"subtitle": {
"name": "kcal",
"fontSize": 14,
"offsetY": 8,
"color": "#888888"
},
"extra": {
"ring": {
"ringWidth": 10,
"activeOpacity": 0.5,
"activeRadius": 10,
"offsetAngle": 0,
"labelWidth": 0,
"border": false,
"borderWidth": 3,
"borderColor": "#FFFFFF"
},
},
},
"rose": {
"type": "rose",
"color": color,
"padding": [5, 5, 5, 5],
"legend": {
"show": true,
"position": "left",
"lineHeight": 25,
},
"extra": {
"rose": {
"type": "area",
"minRadius": 50,
"activeOpacity": 0.5,
"activeRadius": 10,
"offsetAngle": 0,
"labelWidth": 15,
"border": false,
"borderWidth": 2,
"borderColor": "#FFFFFF"
},
}
},
"word": {
"type": "word",
"color": color,
"extra": {
"word": {
"type": "normal",
"autoColors": false
}
}
},
"funnel": {
"type": "funnel",
"color": color,
"padding": [15, 15, 0, 15],
"extra": {
"funnel": {
"activeOpacity": 0.3,
"activeWidth": 10,
"border": true,
"borderWidth": 2,
"borderColor": "#FFFFFF",
"fillOpacity": 1,
"labelAlign": "right"
},
}
},
"map": {
"type": "map",
"color": color,
"padding": [0, 0, 0, 0],
"dataLabel": true,
"extra": {
"map": {
"border": true,
"borderWidth": 1,
"borderColor": "#666666",
"fillOpacity": 0.6,
"activeBorderColor": "#F04864",
"activeFillColor": "#FACC14",
"activeFillOpacity": 1
},
}
},
"arcbar": {
"type": "arcbar",
"color": color,
"title": {
"name": "",
"fontSize": 25,
"color": "#00FF00"
},
"subtitle": {
"name": "",
"fontSize": 15,
"color": "#666666"
},
"extra": {
"arcbar": {
"type": "circle",
"width": 8,
"backgroundColor": "#E9E9E9",
"startAngle": 0.75,
"endAngle": 0.25,
"gap": 2
}
}
},
"line": {
"type": "line",
"color": color,
"padding": [15, 10, 0, 15],
"xAxis": {
"disableGrid": true,
},
"yAxis": {
"gridType": "dash",
"dashLength": 2,
},
"legend": {},
"extra": {
"line": {
"type": "straight",
"width": 2
},
}
},
"tline": {
"type": "line",
"color": color,
"padding": [15, 10, 0, 15],
"xAxis": {
"disableGrid": false,
"boundaryGap": "justify",
},
"yAxis": {
"gridType": "dash",
"dashLength": 2,
"data": [{
"min": 0,
"max": 80
}]
},
"legend": {},
"extra": {
"line": {
"type": "curve",
"width": 2
},
}
},
"tarea": {
"type": "area",
"color": color,
"padding": [0, 15, 15, 5],
"xAxis": {
"disableGrid": true,
"boundaryGap": "justify",
},
"yAxis": {
"gridType": "dash",
"dashLength": 2,
"data": [{
"min": 0,
"max": 80
}]
},
"legend": {},
"extra": {
"area": {
"type": "curve",
"opacity": 0.2,
"addLine": true,
"width": 2,
"gradient": true
},
}
},
"column": {
"type": "column",
"color": color,
"padding": [15, 15, 0, 5],
"xAxis": {
"disableGrid": true,
},
"yAxis": {
"gridType": "dash",
"disableGrid": true,
"gridColor": '#ffffff',
"data": [{
"tofix": 1,
"min": 0
}],
},
"legend": {},
"extra": {
"column": {
"type": "group",
"width": 20,
"seriesGap": 5,
"meterFillColor": "#FFFFFF",
"activeBgColor": "#000000",
"activeBgOpacity": 0.5,
"barBorderCircle": true,
"linearType": "opacity",
// "customColor": "#ff9f40",
"linearOpacity": 1,
},
}
},
"area": {
"type": "area",
"color": color,
"padding": [20, 15, 5, 10],
"xAxis": {
"disableGrid": true,
},
"yAxis": {
"gridType": "dash",
"disableGrid": true,
"gridColor": '#ffffff',
"data": [{
"tofix": 1,
"min": 0
}],
},
"legend": {
"show": false,
},
"extra": {
"area": {
"type": "curve",
"opacity": 0.2,
"addLine": true,
"width": 1,
"gradient": true
},
}
},
"radar": {
"type": "radar",
"color": color,
"padding": [5, 5, 5, 5],
"legend": {
"show": true,
"position": "right",
"lineHeight": 25,
},
"extra": {
"radar": {
"gridType": "radar",
"gridColor": "#CCCCCC",
"gridCount": 3,
"opacity": 0.2,
"max": 200
},
}
},
"gauge": {
"type": "gauge",
"color": color,
"title": {
"name": "66Km/H",
"fontSize": 25,
"color": "#2fc25b",
"offsetY": 50
},
"subtitle": {
"name": "实时速度",
"fontSize": 15,
"color": "#1890ff",
"offsetY": -50
},
"extra": {
"gauge": {
"type": "default",
"width": 30,
"labelColor": "#666666",
"startAngle": 0.75,
"endAngle": 0.25,
"startNumber": 0,
"endNumber": 100,
"labelFormat": "",
"splitLine": {
"fixRadius": 0,
"splitNumber": 10,
"width": 30,
"color": "#FFFFFF",
"childNumber": 5,
"childWidth": 12
},
"pointer": {
"width": 24,
"color": "auto"
}
}
}
},
"candle": {
"type": "candle",
"color": color,
"padding": [15, 15, 0, 15],
"enableScroll": true,
"enableMarkLine": true,
"dataLabel": false,
"xAxis": {
"labelCount": 4,
"itemCount": 40,
"disableGrid": true,
"gridColor": "#CCCCCC",
"gridType": "solid",
"dashLength": 4,
"scrollShow": true,
"scrollAlign": "left",
"scrollColor": "#A6A6A6",
"scrollBackgroundColor": "#EFEBEF"
},
"yAxis": {},
"legend": {},
"extra": {
"candle": {
"color": {
"upLine": "#f04864",
"upFill": "#f04864",
"downLine": "#2fc25b",
"downFill": "#2fc25b"
},
"average": {
"show": true,
"name": ["MA5", "MA10", "MA30"],
"day": [5, 10, 20],
"color": ["#1890ff", "#2fc25b", "#facc14"]
}
},
"markLine": {
"type": "dash",
"dashLength": 5,
"data": [{
"value": 2150,
"lineColor": "#f04864",
"showLabel": true
},
{
"value": 2350,
"lineColor": "#f04864",
"showLabel": true
}
]
}
}
},
"mix": {
"type": "mix",
"color": color,
"padding": [15, 15, 0, 15],
"xAxis": {
"disableGrid": true,
},
"yAxis": {
"disabled": false,
"disableGrid": false,
"splitNumber": 5,
"gridType": "dash",
"dashLength": 4,
"gridColor": "#CCCCCC",
"padding": 10,
"showTitle": true,
"data": []
},
"legend": {},
"extra": {
"mix": {
"column": {
"width": 20
}
},
}
},
"scatter": {
"type": "scatter",
"color": color,
"padding": [15, 15, 0, 15],
"dataLabel": false,
"xAxis": {
"disableGrid": false,
"gridType": "dash",
"splitNumber": 5,
"boundaryGap": "justify",
"min": 0
},
"yAxis": {
"disableGrid": false,
"gridType": "dash",
},
"legend": {},
"extra": {
"scatter": {},
}
},
"bubble": {
"type": "bubble",
"color": color,
"padding": [15, 15, 0, 15],
"xAxis": {
"disableGrid": false,
"gridType": "dash",
"splitNumber": 5,
"boundaryGap": "justify",
"min": 0,
"max": 250
},
"yAxis": {
"disableGrid": false,
"gridType": "dash",
"data": [{
"min": 0,
"max": 150
}]
},
"legend": {},
"extra": {
"bubble": {
"border": 2,
"opacity": 0.5,
},
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -61,7 +61,7 @@
*/ */
width: { width: {
type: Number, type: Number,
default: 220 default: 300
} }
}, },
data() { data() {
@ -70,7 +70,7 @@
showDrawer: false, showDrawer: false,
rightMode: false, rightMode: false,
watchTimer: null, watchTimer: null,
drawerWidth: 220 drawerWidth: 300
} }
}, },
created() { created() {
@ -108,7 +108,7 @@
<style lang="scss" scoped> <style lang="scss" scoped>
$uni-mask: rgba($color: #000000, $alpha: 0.4) ; $uni-mask: rgba($color: #000000, $alpha: 0.4) ;
// //
$drawer-width: 240rpx; $drawer-width: 300rpx;
.uni-drawer { .uni-drawer {
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,8 +1,8 @@
var isReady=false;var onReadyCallbacks=[]; var isReady=false;var onReadyCallbacks=[];
var isServiceReady=false;var onServiceReadyCallbacks=[]; var isServiceReady=false;var onServiceReadyCallbacks=[];
var __uniConfig = {"pages":["pages/index/index","pages/menu/menu","pages/add/add","pages/count/count","pages/me/me","pages/add/Preview","pages/search/search","pageTwo/login/forgetPassword","pageTwo/login/login","pageTwo/me/feedBack","pageTwo/me/userEdit","pageTwo/me/record","pageTwo/me/mymenu","pageTwo/me/menudetail","pageTwo/me/foodlist","pageTwo/count/setting","pageTwo/count/KcalEdit","pageTwo/count/food","pageTwo/webview/webview","pageTwo/setting/setting","pageTwo/setting/password","pageTwo/setting/email","pageTwo/setting/phone","pageTwo/me/menuEdit"],"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"uni-app","navigationBarBackgroundColor":"#efefef","backgroundColor":"#efefef"},"tabBar":{"color":"#333","selectedColor":"#ff4c4f","backgroundColor":"#fff","list":[{"pagePath":"pages/index/index","iconPath":"static/home.png","selectedIconPath":"static/home01.png","text":"首页"},{"pagePath":"pages/menu/menu","iconPath":"static/cai.png","selectedIconPath":"static/cai01.png","text":"菜谱"},{"pagePath":"pages/add/add","iconPath":"static/add.png","selectedIconPath":"static/add.png","text":""},{"pagePath":"pages/count/count","iconPath":"static/ji.png","selectedIconPath":"static/ji01.png","text":"计食"},{"pagePath":"pages/me/me","iconPath":"static/me.png","selectedIconPath":"static/me01.png","text":"我的"}]},"darkmode":false,"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"kitchendDevice","compilerVersion":"4.76","entryPagePath":"pages/index/index","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}}; var __uniConfig = {"pages":["pages/index/index","pages/menu/menu","pages/add/add","pages/count/count","pages/me/me","pages/add/Preview","pages/search/search","pages/search/list","pageTwo/login/forgetPassword","pageTwo/login/login","pageTwo/me/feedBack","pageTwo/me/userEdit","pageTwo/me/record","pageTwo/me/recordetail","pageTwo/me/mymenu","pageTwo/me/menudetail","pageTwo/me/foodlist","pageTwo/count/setting","pageTwo/count/KcalEdit","pageTwo/count/everyMeal","pageTwo/count/search","pageTwo/webview/webview","pageTwo/setting/setting","pageTwo/setting/password","pageTwo/setting/email","pageTwo/setting/phone","pageTwo/me/menuEdit","pageTwo/count/everyDay","pageTwo/me/about"],"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"uni-app","navigationBarBackgroundColor":"#3CB383","backgroundColor":"#f7f7f7"},"tabBar":{"color":"#333","selectedColor":"#3CB383","backgroundColor":"#fff","list":[{"pagePath":"pages/index/index","iconPath":"static/home.png","selectedIconPath":"static/home01.png","text":"首页"},{"pagePath":"pages/count/count","iconPath":"static/ji.png","selectedIconPath":"static/ji01.png","text":"计食"},{"pagePath":"pages/me/me","iconPath":"static/me.png","selectedIconPath":"static/me01.png","text":"我的"}]},"darkmode":false,"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"kitchendDevice","compilerVersion":"4.76","entryPagePath":"pages/index/index","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
var __uniRoutes = [{"path":"/pages/index/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"首页","enablePullDownRefresh":true}},{"path":"/pages/menu/menu","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"菜谱","enablePullDownRefresh":true}},{"path":"/pages/add/add","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"添加食谱","enablePullDownRefresh":false}},{"path":"/pages/count/count","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"计食","enablePullDownRefresh":false}},{"path":"/pages/me/me","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"个人中心","enablePullDownRefresh":false}},{"path":"/pages/add/Preview","meta":{},"window":{"navigationBarTitleText":""}},{"path":"/pages/search/search","meta":{},"window":{"navigationBarTitleText":"搜索"}},{"path":"/pageTwo/login/forgetPassword","meta":{},"window":{"navigationBarTitleText":"密码","enablePullDownRefresh":false}},{"path":"/pageTwo/login/login","meta":{},"window":{"navigationBarTitleText":"登录","enablePullDownRefresh":false,"navigationStyle":"custom"}},{"path":"/pageTwo/me/feedBack","meta":{},"window":{"navigationBarTitleText":"意见反馈","navigationBarBackgroundColor":"#F9FAFC"}},{"path":"/pageTwo/me/userEdit","meta":{},"window":{"navigationBarTitleText":"个人资料","navigationBarBackgroundColor":"#F9FAFC"}},{"path":"/pageTwo/me/record","meta":{},"window":{"navigationBarTitleText":"饮食记录","enablePullDownRefresh":false}},{"path":"/pageTwo/me/mymenu","meta":{},"window":{"navigationBarTitleText":"","enablePullDownRefresh":false}},{"path":"/pageTwo/me/menudetail","meta":{},"window":{"navigationBarTitleText":"详情","enablePullDownRefresh":false}},{"path":"/pageTwo/me/foodlist","meta":{},"window":{"navigationBarTitleText":"食材库","enablePullDownRefresh":true}},{"path":"/pageTwo/count/setting","meta":{},"window":{"navigationBarTitleText":"设置","enablePullDownRefresh":false}},{"path":"/pageTwo/count/KcalEdit","meta":{},"window":{"navigationBarTitleText":"自定义卡路里","enablePullDownRefresh":false}},{"path":"/pageTwo/count/food","meta":{},"window":{"navigationBarTitleText":"食材","enablePullDownRefresh":false}},{"path":"/pageTwo/webview/webview","meta":{},"window":{"navigationBarTitleText":"","enablePullDownRefresh":false}},{"path":"/pageTwo/setting/setting","meta":{},"window":{"navigationBarTitleText":"设置","enablePullDownRefresh":false}},{"path":"/pageTwo/setting/password","meta":{},"window":{"navigationBarTitleText":"修改密码","enablePullDownRefresh":false}},{"path":"/pageTwo/setting/email","meta":{},"window":{"navigationBarTitleText":"绑定邮箱","enablePullDownRefresh":false}},{"path":"/pageTwo/setting/phone","meta":{},"window":{"navigationBarTitleText":"绑定手机号","enablePullDownRefresh":false}},{"path":"/pageTwo/me/menuEdit","meta":{},"window":{"navigationBarTitleText":""}}]; var __uniRoutes = [{"path":"/pages/index/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"首页","enablePullDownRefresh":true}},{"path":"/pages/menu/menu","meta":{},"window":{"navigationBarTitleText":"菜谱","enablePullDownRefresh":true}},{"path":"/pages/add/add","meta":{},"window":{"navigationBarTitleText":"添加食谱","enablePullDownRefresh":false}},{"path":"/pages/count/count","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"计食","enablePullDownRefresh":false}},{"path":"/pages/me/me","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"个人中心","enablePullDownRefresh":false}},{"path":"/pages/add/Preview","meta":{},"window":{"navigationBarTitleText":""}},{"path":"/pages/search/search","meta":{},"window":{"navigationBarTitleText":"搜索菜谱"}},{"path":"/pages/search/list","meta":{},"window":{"navigationBarTitleText":""}},{"path":"/pageTwo/login/forgetPassword","meta":{},"window":{"navigationBarTitleText":"密码","enablePullDownRefresh":false}},{"path":"/pageTwo/login/login","meta":{},"window":{"navigationBarTitleText":"登录","enablePullDownRefresh":false,"navigationStyle":"custom"}},{"path":"/pageTwo/me/feedBack","meta":{},"window":{"navigationBarTitleText":"意见反馈"}},{"path":"/pageTwo/me/userEdit","meta":{},"window":{"navigationBarTitleText":"个人资料"}},{"path":"/pageTwo/me/record","meta":{},"window":{"navigationBarTitleText":"饮食记录","enablePullDownRefresh":false}},{"path":"/pageTwo/me/recordetail","meta":{},"window":{"navigationBarTitleText":"饮食详情","enablePullDownRefresh":false}},{"path":"/pageTwo/me/mymenu","meta":{},"window":{"navigationBarTitleText":"","enablePullDownRefresh":false}},{"path":"/pageTwo/me/menudetail","meta":{},"window":{"navigationBarTitleText":"详情","enablePullDownRefresh":false}},{"path":"/pageTwo/me/foodlist","meta":{},"window":{"navigationBarTitleText":"食材库","enablePullDownRefresh":true}},{"path":"/pageTwo/count/setting","meta":{},"window":{"navigationBarTitleText":"设置","enablePullDownRefresh":false,"popGesture":"none"}},{"path":"/pageTwo/count/KcalEdit","meta":{},"window":{"navigationBarTitleText":"自定义卡路里","enablePullDownRefresh":false}},{"path":"/pageTwo/count/everyMeal","meta":{},"window":{"navigationBarTitleText":"餐食详情","enablePullDownRefresh":false}},{"path":"/pageTwo/count/search","meta":{},"window":{"navigationBarTitleText":"食材搜索","enablePullDownRefresh":false}},{"path":"/pageTwo/webview/webview","meta":{},"window":{"navigationBarTitleText":"","enablePullDownRefresh":false}},{"path":"/pageTwo/setting/setting","meta":{},"window":{"navigationBarTitleText":"设置","enablePullDownRefresh":false}},{"path":"/pageTwo/setting/password","meta":{},"window":{"navigationBarTitleText":"修改密码","enablePullDownRefresh":false}},{"path":"/pageTwo/setting/email","meta":{},"window":{"navigationBarTitleText":"绑定邮箱","enablePullDownRefresh":false}},{"path":"/pageTwo/setting/phone","meta":{},"window":{"navigationBarTitleText":"绑定手机号","enablePullDownRefresh":false}},{"path":"/pageTwo/me/menuEdit","meta":{},"window":{"navigationBarTitleText":""}},{"path":"/pageTwo/count/everyDay","meta":{},"window":{"navigationBarTitleText":"营养分析"}},{"path":"/pageTwo/me/about","meta":{},"window":{"navigationBarTitleText":"关于我们"}}];
__uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}}); __uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
__uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}}); __uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
service.register("uni-app-config",{create(a,b,c){if(!__uniConfig.viewport){var d=b.weex.config.env.scale,e=b.weex.config.env.deviceWidth,f=Math.ceil(e/d);Object.assign(__uniConfig,{viewport:f,defaultFontSize:Math.round(f/20)})}return{instance:{__uniConfig:__uniConfig,__uniRoutes:__uniRoutes,global:void 0,window:void 0,document:void 0,frames:void 0,self:void 0,location:void 0,navigator:void 0,localStorage:void 0,history:void 0,Caches:void 0,screen:void 0,alert:void 0,confirm:void 0,prompt:void 0,fetch:void 0,XMLHttpRequest:void 0,WebSocket:void 0,webkit:void 0,print:void 0}}}}); service.register("uni-app-config",{create(a,b,c){if(!__uniConfig.viewport){var d=b.weex.config.env.scale,e=b.weex.config.env.deviceWidth,f=Math.ceil(e/d);Object.assign(__uniConfig,{viewport:f,defaultFontSize:Math.round(f/20)})}return{instance:{__uniConfig:__uniConfig,__uniRoutes:__uniRoutes,global:void 0,window:void 0,document:void 0,frames:void 0,self:void 0,location:void 0,navigator:void 0,localStorage:void 0,history:void 0,Caches:void 0,screen:void 0,alert:void 0,confirm:void 0,prompt:void 0,fetch:void 0,XMLHttpRequest:void 0,WebSocket:void 0,webkit:void 0,print:void 0}}}});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__9A0614A","name":"kitchendDevice","version":{"name":"1.0.0","code":"100"},"description":"","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"target":"id:1","autoclose":true,"waiting":true,"delay":0},"popGesture":"close","launchwebview":{"id":"1","kernel":"WKWebview"},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#efefef"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"distribute":{"google":{"permissions":["<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-feature android:name=\"android.hardware.camera\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"]},"apple":{},"plugins":{"speech":{},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}}},"uniStatistics":{"enable":false},"allowsInlineMediaPlayback":true,"safearea":{"background":"#fff","bottom":{"offset":"auto"}},"uni-app":{"compilerVersion":"4.76","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"tabBar":{"color":"#333","selectedColor":"#ff4c4f","backgroundColor":"#fff","list":[{"pagePath":"pages/index/index","iconPath":"static/home.png","selectedIconPath":"static/home01.png","text":"首页"},{"pagePath":"pages/menu/menu","iconPath":"static/cai.png","selectedIconPath":"static/cai01.png","text":"菜谱"},{"pagePath":"pages/add/add","iconPath":"static/add.png","selectedIconPath":"static/add.png","text":""},{"pagePath":"pages/count/count","iconPath":"static/ji.png","selectedIconPath":"static/ji01.png","text":"计食"},{"pagePath":"pages/me/me","iconPath":"static/me.png","selectedIconPath":"static/me01.png","text":"我的"}],"borderStyle":"rgba(0,0,0,0.4)","height":"50px","child":["lauchwebview"],"selected":0},"launch_path":"__uniappview.html"}} {"@platforms":["android","iPhone","iPad"],"id":"__UNI__20604F1","name":"kitchendDevice","version":{"name":"1.1.1","code":111},"description":"","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"Bluetooth":{},"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"target":"id:1","autoclose":true,"waiting":true,"delay":0},"popGesture":"close","launchwebview":{"id":"1","kernel":"WKWebview"},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#3CB383"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"distribute":{"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},"google":{"permissions":["<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-feature android:name=\"android.hardware.camera\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"]},"apple":{"privacyDescription":{"NSBluetoothPeripheralUsageDescription":"使用蓝牙与外设通信","NSBluetoothAlwaysUsageDescription":"需要蓝牙权限来连接设备"}},"plugins":{"speech":{},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}}},"uniStatistics":{"enable":false},"allowsInlineMediaPlayback":true,"safearea":{"background":"#fff","bottom":{"offset":"auto"}},"uni-app":{"compilerVersion":"4.76","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"tabBar":{"color":"#333","selectedColor":"#3CB383","backgroundColor":"#fff","list":[{"pagePath":"pages/index/index","iconPath":"static/home.png","selectedIconPath":"static/home01.png","text":"首页"},{"pagePath":"pages/count/count","iconPath":"static/ji.png","selectedIconPath":"static/ji01.png","text":"计食"},{"pagePath":"pages/me/me","iconPath":"static/me.png","selectedIconPath":"static/me01.png","text":"我的"}],"borderStyle":"rgba(0,0,0,0.4)","height":"50px","child":["lauchwebview"],"selected":0},"launch_path":"__uniappview.html"},"locale":"zh-Hans"}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 648 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 258 B

View File

@ -32,7 +32,8 @@
"setting/email", "setting/email",
"setting/phone", "setting/phone",
"me/menuEdit", "me/menuEdit",
"count/everyDay" "count/everyDay",
"me/about"
] ]
} }
], ],
@ -53,18 +54,6 @@
"selectedIconPath": "static/home01.png", "selectedIconPath": "static/home01.png",
"text": "首页" "text": "首页"
}, },
{
"pagePath": "pages/search/search",
"iconPath": "static/cai.png",
"selectedIconPath": "static/cai01.png",
"text": "教你做"
},
{
"pagePath": "pages/add/add",
"iconPath": "static/add.png",
"selectedIconPath": "static/add.png",
"text": ""
},
{ {
"pagePath": "pages/count/count", "pagePath": "pages/count/count",
"iconPath": "static/ji.png", "iconPath": "static/ji.png",

Some files were not shown because too many files have changed in this diff Show More