diff --git a/apis/interfaces/menu.js b/apis/interfaces/menu.js index 15d307c..e39e162 100644 --- a/apis/interfaces/menu.js +++ b/apis/interfaces/menu.js @@ -36,9 +36,25 @@ const menuDet = (recipe) =>{ }) } +// 指南引导 +const guide = (recipe) =>{ + return request({ + url: 'articles/health/guide' + }) +} + +// 搜索页 +const search = () =>{ + return request({ + url: 'health/foods/search' + }) +} + export { index, categories, queue, - menuDet + menuDet, + guide, + search } diff --git a/apis/interfaces/notice.js b/apis/interfaces/notice.js new file mode 100644 index 0000000..bc75ea2 --- /dev/null +++ b/apis/interfaces/notice.js @@ -0,0 +1,36 @@ +/** + * Web唐明明 + * 匆匆数载恍如梦,岁月迢迢华发增。 + * 碌碌无为枉半生,一朝惊醒万事空。 + * moduleName: 话题 + */ + +import { request } from '../index' + +// 分类 +const categories = () =>{ + return request({ + url: 'notifications' + }) +} + +// 列表 +const lists = (type, data) =>{ + return request({ + url: 'notifications/' + type + '/list', + data:data + }) +} + +// 详情 +const noticeDet = (notification_id) =>{ + return request({ + url: 'notifications/' + notification_id + }) +} + +export { + categories, + lists, + noticeDet +} diff --git a/apis/interfaces/ranking.js b/apis/interfaces/ranking.js index dbba97e..b82c543 100644 --- a/apis/interfaces/ranking.js +++ b/apis/interfaces/ranking.js @@ -23,7 +23,15 @@ const foods = (data) =>{ }) } +// 食物详情 +const foodDet = (food) =>{ + return request({ + url: 'health/foods/' + food + }) +} + export { categories, - foods + foods, + foodDet } diff --git a/apis/interfaces/sign.js b/apis/interfaces/sign.js index 58684dc..3a26aba 100644 --- a/apis/interfaces/sign.js +++ b/apis/interfaces/sign.js @@ -14,6 +14,15 @@ const date = () =>{ }) } -export { - date +// 签到 +const sign = () =>{ + return request({ + url: 'user/sign', + method: 'POST' + }) +} + +export { + date, + sign } diff --git a/apis/interfaces/topic.js b/apis/interfaces/topic.js new file mode 100644 index 0000000..0d2122c --- /dev/null +++ b/apis/interfaces/topic.js @@ -0,0 +1,53 @@ +/** + * Web唐明明 + * 匆匆数载恍如梦,岁月迢迢华发增。 + * 碌碌无为枉半生,一朝惊醒万事空。 + * moduleName: 话题 + */ + +import { request } from '../index' + +// 首页 +const index = () =>{ + return request({ + url: 'health/discover' + }) +} + +// 列表 +const lists = (data) =>{ + return request({ + url: 'health/topics', + data: data + }) +} + +// 分类 +const categories = () =>{ + return request({ + url: 'health/topics/categories' + }) +} + +// 详情 +const topicDet = (topic) =>{ + return request({ + url: 'health/topics/' + topic + }) +} + +// 点赞 +const topicThumb = (topic) =>{ + return request({ + url: 'health/topics/' + topic + '/favorite', + method: 'POST' + }) +} + +export { + index, + lists, + categories, + topicDet, + topicThumb +} diff --git a/pages.json b/pages.json index ece1cc3..4550cad 100644 --- a/pages.json +++ b/pages.json @@ -6,6 +6,20 @@ "navigationBarTitleText": "发现", "navigationStyle": "custom" } + }, { + "path": "pages/index/guide", + "name": "indexGuide", + "style": { + "navigationBarTitleText": "", + "navigationStyle": "custom" + } + }, { + "path": "pages/index/search", + "name": "indexSearch", + "style": { + "navigationBarTitleText": "", + "navigationStyle": "custom" + } }, { "path": "pages/record/index", "name": "Record", @@ -200,30 +214,54 @@ "enablePullDownRefresh": true } }, { - "path": "pages/im/index", - "name": "IM", + "path": "pages/notice/index", + "name": "noticeIndex", "style": { - "navigationBarTitleText": "聊聊", + "navigationBarTitleText": "消息", "navigationBarBackgroundColor": "#FFFFFF", - "app-plus": { - "titleNView": { - "buttons": [{ - "float": "right", - "text": "\ue605", - "fontSrc": "/static/iconfont.ttf", - "color": "#000", - "fontSize": "20px" - }, { - "float": "left", - "text": "\ue606", - "fontSrc": "/static/iconfont.ttf", - "color": "#000", - "fontSize": "20px" - }] - } - } + "enablePullDownRefresh": true } }, { + "path": "pages/notice/list", + "name": "noticeList", + "style": { + "navigationBarTitleText": "消息", + "navigationBarBackgroundColor": "#FFFFFF", + "enablePullDownRefresh": true + } + }, { + "path": "pages/notice/details", + "name": "noticeDetails", + "style": { + "navigationBarTitleText": "消息", + "navigationBarBackgroundColor": "#FFFFFF", + "enablePullDownRefresh": true + } + },{ + "path": "pages/im/index", + "name": "IM", + "style": { + "navigationBarTitleText": "聊聊", + "navigationBarBackgroundColor": "#FFFFFF", + "app-plus": { + "titleNView": { + "buttons": [{ + "float": "right", + "text": "\ue605", + "fontSrc": "/static/iconfont.ttf", + "color": "#000", + "fontSize": "20px" + }, { + "float": "left", + "text": "\ue606", + "fontSrc": "/static/iconfont.ttf", + "color": "#000", + "fontSize": "20px" + }] + } + } + } + },{ "path": "pages/im/chum", "name": "ImChum", "style": { diff --git a/pages/index/guide.vue b/pages/index/guide.vue new file mode 100644 index 0000000..d45bf00 --- /dev/null +++ b/pages/index/guide.vue @@ -0,0 +1,34 @@ + + + + + diff --git a/pages/index/index.vue b/pages/index/index.vue index 9cdc1ea..f320512 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -4,94 +4,67 @@ 欢迎使用ZH健康 - - + + - + 低脂鸡胸肉 - + 精选推荐查看更多 - - - - {{item.title}} - {{item.describe}} + + + + {{item.name}} + {{item.description}} - 话题广场查看更多 + 话题广场更多分类 - + diff --git a/pages/menu/classify.vue b/pages/menu/classify.vue index 5611823..bb194c2 100644 --- a/pages/menu/classify.vue +++ b/pages/menu/classify.vue @@ -1,14 +1,23 @@ @@ -20,31 +29,60 @@ return { tabArr : [], menuData : [], - tabsIndex : this.$Route.query.index + tabsIndex : this.$Route.query.index, + tabsId : this.$Route.query.id, + status : 'loadmore', + page : '' }; }, mounted() { + // 获取分类 this.getTab() - this.getMenu(this.$Route.query.id) + + // 获取列表 + this.getMenu() }, methods: { + // 分类 getTab(){ categories().then(res => { this.tabArr = res }) }, - getMenu(id){ + // 列表 + getMenu(pages){ queue({ - category_id: id + category_id: this.tabsId, + page: pages }).then(res => { - this.menuData = res.data + if(res.page.current == 1){ + this.menuData = [] + } + this.menuData = this.menuData.concat(res.data) + this.status = this.page.has_more ? 'loadmore': 'nomore' + this.page = res.page }) }, + + // 切换分类 tabsClick(item) { - this.getMenu(item.category_id) + this.tabsId = item.category_id this.tabsIndex = item.index + this.getMenu(1) } + }, + + // 下拉加载 + onReachBottom() { + if(this.page.has_more){ + this.status = 'loading' + let pages = this.page.current + 1 + // 获取列表 + this.getMenu(pages) + return + } + this.status = 'nomore' } }; @@ -63,6 +101,7 @@ .box { padding: 0 $padding; box-sizing: border-box; + margin-top: $margin; } // 34CE98 diff --git a/pages/menu/details.vue b/pages/menu/details.vue index 8b5d7fc..f99e4d9 100644 --- a/pages/menu/details.vue +++ b/pages/menu/details.vue @@ -11,7 +11,7 @@ @@ -25,31 +25,31 @@ 碳水化合物 - - 200.00g + + {{ menuData.carbohydrate }}g 蛋白质 - - 200.00g + + {{ menuData.protein }}g 脂肪 - - 200.00g + + {{ menuData.cellulose }}g 千卡 - + {{ menuData.calory }} diff --git a/pages/menu/index.vue b/pages/menu/index.vue index a2a440f..5707409 100644 --- a/pages/menu/index.vue +++ b/pages/menu/index.vue @@ -5,7 +5,7 @@ {{ item.name }} - + 查看更多 @@ -26,7 +26,6 @@ - + + diff --git a/pages/notice/index.vue b/pages/notice/index.vue new file mode 100644 index 0000000..ceb7daf --- /dev/null +++ b/pages/notice/index.vue @@ -0,0 +1,102 @@ + + + + + diff --git a/pages/notice/list.vue b/pages/notice/list.vue new file mode 100644 index 0000000..1698454 --- /dev/null +++ b/pages/notice/list.vue @@ -0,0 +1,108 @@ + + + + + diff --git a/pages/ranking/details.vue b/pages/ranking/details.vue index 5f08d3c..052eda6 100644 --- a/pages/ranking/details.vue +++ b/pages/ranking/details.vue @@ -1,13 +1,13 @@ diff --git a/pages/sign/index.vue b/pages/sign/index.vue index 533d247..5ac3812 100644 --- a/pages/sign/index.vue +++ b/pages/sign/index.vue @@ -2,74 +2,80 @@ - - + - 10天 + {{ dateData.total }} 本月签到 - + - 1天 + {{ dateData.continue }} - 本月漏签 + 累计签到 - 2020-01-07 + {{ dateData.month }} - - 1 + + + 日 + + + 一 + + + 二 + + + 三 + + + 四 + + + 五 + + + 六 + - - 2 - - - 3 - - - 4 - - - 5 - - - 6 - - - 7 - - - 8 + + + {{ items.isSign ? '签' : items.date }} + - - 立即签到 + + {{ dateData.isSign ? '当日已签' : '立即签到'}} + + ZH大健康用户签到 + @@ -125,20 +149,12 @@ .label { display: flex; font-size: $title-size-sm; - &:first-child { - flex: 1; - .day { - text { - color: $main-color; - } - } - } .picture { width: 74rpx; height: 74rpx; margin-right: $margin - 10; } - .day { + .label-day { color: $text-gray; text { font-size: $title-size-lg; @@ -147,6 +163,14 @@ padding-right: $padding - 20; } } + &:first-child { + flex: 1; + .label-day { + text { + color: $main-color; + } + } + } } } .signDate { @@ -158,13 +182,40 @@ font-weight: 600; } .list { - flex-wrap: wrap; - display: flex; + .week { + display: flex; + .week-label { + text-align: center; + font-size: $title-size-m; + width: 14.28%; + margin: $margin - 10 0; + } + } .day { - width: 14.28%; - text-align: center; - line-height: 80rpx; - color: $text-color; + flex-wrap: wrap; + display: flex; + .day-label { + width: 14.28%; + text-align: center; + line-height: 80rpx; + color: $text-color; + font-size: $title-size-m; + .label-block { + display: inline-block; + background-color: transparent; + color: $text-gray-m; + border-radius: 50%; + width: 56rpx; + height: 56rpx; + line-height: 56rpx; + text-align: center; + &.active { + background-color: $main-color; + color: white; + border-radius: 50%; + } + } + } } } @@ -176,7 +227,18 @@ text-align: center; border-radius: $radius-m; line-height: 90rpx; + &.active { + background-color: #ededed; + color: $text-gray; + } } } } + + .tipsText { + text-align: center; + line-height: 120rpx; + font-size: $title-size-sm; + color: $text-gray-m; + } } diff --git a/pages/topic/details.vue b/pages/topic/details.vue index a34807d..578b4f2 100644 --- a/pages/topic/details.vue +++ b/pages/topic/details.vue @@ -1,46 +1,61 @@ diff --git a/static/dev/img-00.png b/static/dev/img-00.png index ab83f2e..7f02387 100644 Binary files a/static/dev/img-00.png and b/static/dev/img-00.png differ diff --git a/static/find/logo.png b/static/find/logo.png new file mode 100644 index 0000000..42a745f Binary files /dev/null and b/static/find/logo.png differ diff --git a/static/icon/sign-icon.gif b/static/icon/sign-icon.gif new file mode 100644 index 0000000..42ab2d2 Binary files /dev/null and b/static/icon/sign-icon.gif differ diff --git a/static/icon/sign-icon.png b/static/icon/sign-icon.png deleted file mode 100644 index 172c6ce..0000000 Binary files a/static/icon/sign-icon.png and /dev/null differ diff --git a/uni_modules/oct-menu/components/oct-menu/oct-menu.vue b/uni_modules/oct-menu/components/oct-menu/oct-menu.vue index aa20acb..ca18a00 100644 --- a/uni_modules/oct-menu/components/oct-menu/oct-menu.vue +++ b/uni_modules/oct-menu/components/oct-menu/oct-menu.vue @@ -12,7 +12,15 @@ {{ item.name }} - {{ isType ? item.weight + '克' : item.sub_title }} + + {{ item.heat }} + + + {{ item.weight }} 克 + + + {{ item.sub_title }} + @@ -41,14 +49,16 @@ default: false }, - // 是否是详情 + // det是详情 rank为排行 isType: { - type: Boolean, - default: false + type:'', + default : () => { + return {} + } } }, mounted() { - + // console.log(this.$props) } } diff --git a/uni_modules/oct-topic/components/oct-topic/oct-topic.vue b/uni_modules/oct-topic/components/oct-topic/oct-topic.vue index bdfdb5a..147e27b 100644 --- a/uni_modules/oct-topic/components/oct-topic/oct-topic.vue +++ b/uni_modules/oct-topic/components/oct-topic/oct-topic.vue @@ -1,11 +1,11 @@