From db94c6b962fafbc0dd85e4ebc97913131dda3321 Mon Sep 17 00:00:00 2001 From: zhangdongxue Date: Mon, 14 Feb 2022 11:44:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/essentialInfo/index.vue | 136 ++------ pages/evaluation/index.vue | 331 +++++++++---------- pages/evaluation/introduce.vue | 239 +++++++------- pages/evaluation/list.vue | 43 +-- pages/evaluation/result.vue | 18 +- pages/record/addExercises.vue | 11 +- pages/record/addFoods.vue | 20 +- pages/record/drink.vue | 59 ++-- pages/record/foods.vue | 103 +++--- pages/record/index.vue | 10 +- pages/record/weight.vue | 2 - pages/setting/setting.vue | 32 +- pages/user/files.vue | 568 +++++++++++++++++---------------- pages/user/index.vue | 2 +- 14 files changed, 762 insertions(+), 812 deletions(-) diff --git a/pages/essentialInfo/index.vue b/pages/essentialInfo/index.vue index 357dd56..a149002 100644 --- a/pages/essentialInfo/index.vue +++ b/pages/essentialInfo/index.vue @@ -11,21 +11,18 @@ - 基本信息 - + 基本信息 - 健康目标 - + 健康目标 - 行为习惯 - + 行为习惯 - + 生理性别和激素会影响我们的身体代谢食物的方式 @@ -47,19 +44,7 @@ 你的出生日期是? {{ showBirthday }} - + @@ -68,7 +53,6 @@ 身高体重信息对健康信息有重要参考价值 您的身高是? - {{ heightU }}厘米 @@ -84,51 +68,18 @@ 下一步 - + - + 您的目标是? - - - 减肥 - - - - 保持体重 - - - - 增肌 - + 减肥 + 保持体重 + 增肌 上一步 @@ -141,10 +92,7 @@ 您的打算减脂多少? - - {{ weightTargetU }} - 公斤 - + {{ weightTargetU }} 公斤 @@ -153,7 +101,7 @@ 下一步 - + @@ -162,51 +110,19 @@ 您的运动量是? - + 久坐不动 - + 少量运动 - + 中等运动量 - + 超强度运动 @@ -274,7 +190,6 @@ export default { }, computed: { showBirthday() { - console.log(moment(this.birthday).format('YYYY年MM月DD日')); return moment(this.birthday).format('YYYY年MM月DD日'); } }, @@ -297,6 +212,7 @@ export default { this.percentplan1 = uni.$u.range(0, 100, this.percentplan1 + 33.33); // 增加进度 this.heightWeightShow = true; // 展示身高体重模块 }, + // 年龄 ----- 取消选择年龄 camcelBirthday() { this.birthdayShow = false; // // 年龄页面弹窗不显示 @@ -304,6 +220,7 @@ export default { this.percentplan1 = 0; // 进度为0 this.sexShow = true; // 显示性别页面 }, + //年龄------------- 过滤出生年月日 formatter(type, value) { if (type === 'year') {return `${value}年`;} @@ -311,6 +228,8 @@ export default { if (type === 'day') {return `${value}日`;} return value; }, + + // 体重---------标尺滚动 scrollWeight(msg) { this.weightU = msg; @@ -332,6 +251,8 @@ export default { this.targetShow = true; // 目标页面展示 } }, + + // 目标 ------------点击 1上一页 2 下一页 targetClick(type) { if (type === 1) { @@ -368,6 +289,8 @@ export default { this.behaviorShow = true; // 打开行为习惯页面 } }, + + // 目标 运动量--------- 1上一页 2 下一页 targetBehaviorClick(type) { if (type === 1) { @@ -391,7 +314,6 @@ export default { exercise: this.activedbehaviarTarget, // 运动量 days: 1 }; - console.log(params, 'params.....'); recordsHealth(params) .then(res => { uni.showModal({ @@ -406,10 +328,12 @@ export default { }); }) .catch(err => { - uni.showToast({ - title: err.message, - icon: 'none' - }); + uni.showToast({ + title: err.message, + icon: "none", + duration: 2000, + mask: true + }) }); } } diff --git a/pages/evaluation/index.vue b/pages/evaluation/index.vue index e97b152..b512745 100644 --- a/pages/evaluation/index.vue +++ b/pages/evaluation/index.vue @@ -6,172 +6,175 @@ * @LastEditTime: 2022-01-13 17:16:09 --> diff --git a/pages/evaluation/introduce.vue b/pages/evaluation/introduce.vue index 8850f9d..37b52d7 100644 --- a/pages/evaluation/introduce.vue +++ b/pages/evaluation/introduce.vue @@ -6,129 +6,138 @@ * @LastEditTime: 2022-01-13 17:26:38 --> diff --git a/pages/evaluation/list.vue b/pages/evaluation/list.vue index c2a4daa..896493b 100644 --- a/pages/evaluation/list.vue +++ b/pages/evaluation/list.vue @@ -11,44 +11,20 @@ - - {{ item.title }} - {{ item.description || '--' }} - + {{ item.title }} {{ item.description || '--' }} - - {{ item.answer.total }} - 分 - + {{ item.answer.total }} - - · - {{ item.remark }} - + · {{ item.remark }} 查看历史结果 - - · - {{ item.remark }} - 人已测 | 约4~8分钟 - - + · {{ item.remark }} 人已测 | 约4~8分钟 + @@ -72,7 +48,14 @@ export default { getList() { evaluations().then(res => { this.evalList = res; - }); + }).catch(err => { + uni.showToast({ + title: err.message, + icon: "none", + duration: 2000, + mask: true + }) + }); }, // nowEva nowEva(item) { diff --git a/pages/evaluation/result.vue b/pages/evaluation/result.vue index 29fa042..6888e1e 100644 --- a/pages/evaluation/result.vue +++ b/pages/evaluation/result.vue @@ -53,9 +53,7 @@ 营养建议 - - {{ item }}. 低Gi - + {{ item }}. 低Gi 饮食营养及生活方式对维持面部年轻态影响较大,建议注意食材选择,逐步清淡口味;规律作息,逐个改善不良生活习惯;帮助改善当前皮肤状态。 @@ -63,10 +61,7 @@ - - 更多护肤知识 - - + 更多护肤知识 @@ -109,7 +104,14 @@ export default { ] }; this.loaded = true; - }); + }).catch(err => { + uni.showToast({ + title: err.message, + icon: "none", + duration: 2000, + mask: true + }) + }); }, reEva() { uni.navigateTo({ diff --git a/pages/record/addExercises.vue b/pages/record/addExercises.vue index 8390a35..5b4e857 100644 --- a/pages/record/addExercises.vue +++ b/pages/record/addExercises.vue @@ -60,11 +60,17 @@ export default { healthSports(data).then(res => { this.lists = this.lists.concat(res.data); this.has_more = res.page.has_more; - }); + }).catch(err => { + uni.showToast({ + title: err.message, + icon: "none", + duration: 2000, + mask: true + }) + }); }, // 显示弹窗内容 addSport(item) { - console.log(item); this.selectSports = item; this.selectSports.duration = 60; this.addSportsShow = true; @@ -99,7 +105,6 @@ export default { //#region 搜索相关方法 start // 点击搜索左侧按钮 searchCustom(e) { - console.log(e); this.name = e; this.reset(); }, diff --git a/pages/record/addFoods.vue b/pages/record/addFoods.vue index b273661..97f95d3 100644 --- a/pages/record/addFoods.vue +++ b/pages/record/addFoods.vue @@ -8,11 +8,7 @@ @@ -156,12 +145,17 @@ this.tagertsDefaultIndex = [res.tagerts.findIndex(item => item.number === res.water .target)]; this.loaded = true; + }).catch(err => { + uni.showToast({ + title: err.message, + icon: "none", + duration: 2000, + mask: true + }) }); }, // 确认方法index===1 每日目标 2,水杯容量 targetSure(index, e) { - // console.log("触发了targetSure", index, e.value[0]); - // let date = moment(new Date()).format("YYYY--MM--DD"); let params = {}; if (index === '1') { params = { @@ -180,25 +174,29 @@ this.getWaters(); this.waterCShow = false; this.targetShow = false; + }).catch(err => { + uni.showToast({ + title: err.message, + icon: "none", + duration: 2000, + mask: true + }) }); }, // 喝水 drinkWater() { - console.log('喝水。。。') let data = { date: this.today } - console.log(data, 'data....') drinkWater(data).then(res => { this.getWaters(); this.dateLists() }).catch(err => { - console.log(err, '添加食物error'); uni.showToast({ title: err.message, icon: "none", - duration:2000, - mask:true + duration: 2000, + mask: true }) }); }, @@ -219,8 +217,10 @@ .catch(err => { uni.showToast({ title: err.message, - icon: 'none' - }); + icon: "none", + duration: 2000, + mask: true + }) }); } } @@ -233,22 +233,21 @@ month: this.month, type: this.dateType } - console.log(data,'data.....') dateList(data).then(res => { - console.log(res) this.calendarList = res.calendar this.dateType = '' this.month = res.month }).catch(err => { uni.showToast({ title: err.message, - icon: 'none' + icon: "none", + duration: 2000, + mask: true }) }) }, // 选择日期 dateClick(item) { - console.log(item) this.today = item.today this.month = item.today this.reset() diff --git a/pages/record/foods.vue b/pages/record/foods.vue index c0be654..7488c32 100644 --- a/pages/record/foods.vue +++ b/pages/record/foods.vue @@ -10,53 +10,35 @@ - - - + - - - + - - 饮食摄入 - {{ calorys.intake_total }} - + 饮食摄入 {{ calorys.intake_total }} + :activeColor="calorys.exceeds ? '#c50000' : '#34ce98'" width="300" class="cricle" borderWidth="20"> {{ calorys.exceeds ? '多吃了' : '还可以吃' }} {{ calorys.amount }} 推荐预算{{ calorys.goal }} - - 运动消耗 - {{ calorys.exercise_total }} - + 运动消耗 {{ calorys.exercise_total }} 摄入量推荐 - + @@ -173,6 +143,13 @@ this.intakes = res.intakes; this.sports = res.exercises.lists; this.sportsTotal = res.exercises.total; + }).catch(err => { + uni.showToast({ + title: err.message, + icon: "none", + duration: 2000, + mask: true + }) }); }, @@ -188,7 +165,6 @@ exercise_id: item.exercise_id, title: '编辑运动' }; - // console.log(this.selectSports); this.addSportsShow = true; }, // 弹窗确认按钮新增 这里接口报错了 , @@ -207,7 +183,9 @@ }).catch(err => { uni.showToast({ title: err.message, - icon: 'none' + icon: "none", + duration: 2000, + mask: true }) }); }, @@ -220,11 +198,17 @@ let params = { exercise_id: this.selectSports.exercise_id // }; - console.log(params); delHealthSports(params).then(res => { this.addSportsShow = false; this.selectSports = {}; this.getList(); + }).catch(err => { + uni.showToast({ + title: err.message, + icon: "none", + duration: 2000, + mask: true + }) }); }, // 长按删除触发事件运动 @@ -272,7 +256,6 @@ }, // 底部按钮点击触发的事件 早餐1 午餐3 晚餐5 加餐(早2中4晚6) tabbarClick(e) { - console.log(e); this.tabarIndex = e; if (e === 3) { this.addEatShow = true; @@ -319,14 +302,14 @@ // 添加食物 editHealthFoods(data) { editHealthFoods(data).then(res => { - console.log(res,'添加食物'); this.addShow = false; this.getList(); - }).catch(err=>{ - console.log(res,'添加食物error'); + }).catch(err => { uni.showToast({ - title:err.message, - icon:"none" + title: err.message, + icon: "none", + duration: 2000, + mask: true }) }); }, @@ -335,6 +318,13 @@ delHealthFoods(this.selectGoods[0].intake_id).then(res => { this.addShow = false; this.getList(); + }).catch(err => { + uni.showToast({ + title: err.message, + icon: "none", + duration: 2000, + mask: true + }) }); }, // 跳转到食品详情 @@ -354,14 +344,15 @@ type: this.dateType } dateList(data).then(res => { - console.log(res) this.calendarList = res.calendar this.dateType = '' this.month = res.month }).catch(err => { uni.showToast({ title: err.message, - icon: 'none' + icon: "none", + duration: 2000, + mask: true }) }) }, diff --git a/pages/record/index.vue b/pages/record/index.vue index dfa5f76..54b15aa 100644 --- a/pages/record/index.vue +++ b/pages/record/index.vue @@ -398,7 +398,6 @@ export default { */ logs() { logs().then(res => { - // console.log(res.is_login) this.weight = res.weight; this.water = res.water; this.intake_run = res.intake_run; @@ -408,7 +407,14 @@ export default { this.banner = res.banner; this.user = res.user; this.notifications_count = res.notifications_count; - }); + }).catch(err => { + uni.showToast({ + title: err.message, + icon: "none", + duration: 2000, + mask: true + }) + }); }, /** * @description:跳转登录页面 diff --git a/pages/record/weight.vue b/pages/record/weight.vue index 9f4661e..bad53fb 100644 --- a/pages/record/weight.vue +++ b/pages/record/weight.vue @@ -134,7 +134,6 @@ //获取体重首页接口 getWeights() { weights(this.page).then((res) => { - console.log(res) if (res.lists.page.current === 1) { this.lists = [] } @@ -198,7 +197,6 @@ // 点击底部切换 tabbarClick(e) { - console.log(e) this.tabbarId = Number(e) } }, diff --git a/pages/setting/setting.vue b/pages/setting/setting.vue index 7f9ba30..124931b 100644 --- a/pages/setting/setting.vue +++ b/pages/setting/setting.vue @@ -3,18 +3,14 @@ - - 修改头像 - + 修改头像 - - 修改昵称 - + 修改昵称 @@ -86,11 +82,13 @@ this.avatar.showPath = pathRes.url[0] this.resetUserInfo('avatar',pathRes.url[0]) }).catch(err => { - uni.showToast({ - title: err.message, - icon: 'none' - }) - }) + uni.showToast({ + title: err.message, + icon: "none", + duration: 2000, + mask: true + }) + }) } }) }, @@ -114,11 +112,13 @@ }) this.getUserInfo() }).catch(err => { - uni.showToast({ - title: err.message, - icon: 'none' - }) - }) + uni.showToast({ + title: err.message, + icon: "none", + duration: 2000, + mask: true + }) + }) } } } diff --git a/pages/user/files.vue b/pages/user/files.vue index 3a1dc8a..0271b33 100644 --- a/pages/user/files.vue +++ b/pages/user/files.vue @@ -1,282 +1,316 @@ diff --git a/pages/user/index.vue b/pages/user/index.vue index 9f92075..50cdd88 100644 --- a/pages/user/index.vue +++ b/pages/user/index.vue @@ -316,7 +316,7 @@ .user-content { padding-left: 158rpx; - height: 128rpx; + height: 140rpx; display: flex; flex-direction: column; justify-content: center;