From a67f3f9b4835865fb563e2c0a10932b9304d640d Mon Sep 17 00:00:00 2001 From: Runtus <893119806@qq.com> Date: Fri, 15 Sep 2023 17:31:57 +0800 Subject: [PATCH 1/8] feat: base turn develop over. --- mock/service.js | 16 ++-- package-lock.json | 3 - pages/home/components/nav/index.js | 42 +++++++++- pages/home/components/nav/index.wxml | 8 +- pages/home/index.js | 3 + pages/home/index.wxml | 1 + pages/my/index.js | 3 + pages/my/index.wxml | 6 +- project.config.json | 112 +++++++++++++-------------- 9 files changed, 119 insertions(+), 75 deletions(-) diff --git a/mock/service.js b/mock/service.js index 0fdbde9..8b69d5a 100644 --- a/mock/service.js +++ b/mock/service.js @@ -4,14 +4,14 @@ module.exports = { message:'success', data:{ service:[ - {image:'/../images/image.png',name:'微信',type:'weixin'}, - {image:'/../images/image(1).png',name:'QQ',type:'QQ'}, - {image:'/../images/image(2).png',name:'腾讯文档',type:'document'}, - {image:'/../images/image(3).png',name:'腾讯地图',type:'map'}, - {image:'/../images/image(4).png',name:'数据中心',type:'data'}, - {image:'/../images/image(4).png',name:'数据中心',type:'data'}, - {image:'/../images/image(4).png',name:'数据中心',type:'data'}, - {image:'/../images/image(4).png',name:'数据中心',type:'data'}, + {image:'/../images/image.png',name:'微信',type:'weixin', url: ''}, + {image:'/../images/image(1).png',name:'QQ',type:'QQ', url: ''}, + {image:'/../images/image(2).png',name:'腾讯文档',type:'document', url: ''}, + {image:'/../images/image(3).png',name:'腾讯地图',type:'map', url: ''}, + {image:'/../images/image(4).png',name:'数据中心',type:'data', url: '/pages/dataCenter/index'}, + {image:'/../images/image(4).png',name:'数据中心',type:'data', url: '/pages/dataCenter/index'}, + {image:'/../images/image(4).png',name:'数据中心',type:'data', url: '/pages/dataCenter/index'}, + {image:'/../images/image(4).png',name:'数据中心',type:'data', url: '/pages/dataCenter/index'}, ], } } diff --git a/package-lock.json b/package-lock.json index 8e16b07..f6735c4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -88,7 +88,6 @@ "version": "0.11.11", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.11.tgz", "integrity": "sha512-N2brEuAadi0CcdeMXUkhbZB84eskAc8MEX1By6qEchoVywSgXPIjou4rYsl0V3Hj0ZnuGycGCjdNgockbzeWNA==", - "dev": true, "license": "Apache-2.0", "dependencies": { @@ -752,7 +751,6 @@ } }, "node_modules/eslint": { - "version": "8.49.0", "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.49.0.tgz", "integrity": "sha512-jw03ENfm6VJI0jA9U+8H5zfl5b+FvuU3YYvZRdZHOlU2ggJkxrlkJH4HcDrZpj6YwD8kuYqvQM8LyesoazrSOQ==", @@ -3183,7 +3181,6 @@ "version": "0.11.11", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.11.tgz", "integrity": "sha512-N2brEuAadi0CcdeMXUkhbZB84eskAc8MEX1By6qEchoVywSgXPIjou4rYsl0V3Hj0ZnuGycGCjdNgockbzeWNA==", - "dev": true, "requires": { "@humanwhocodes/object-schema": "^1.2.1", diff --git a/pages/home/components/nav/index.js b/pages/home/components/nav/index.js index 9d7c704..f18cef0 100644 --- a/pages/home/components/nav/index.js +++ b/pages/home/components/nav/index.js @@ -8,32 +8,52 @@ Component({ data: { visible: false, sidebar: [{ - title: '首页' + title: '首页', + url: "pages/home/index", + isSidebar: true }, { - title: '搜索页' + title: '搜索页', + url: "pages/search/index", + isSidebar: false }, { title: '发布页', + url: "pages/release/index", + isSidebar: false }, { title: '消息列表页', + url: "pages/message/index", + isSidebar: true }, { title: '对话页', + url: "pages/chat/index", + isSidebar: false }, { title: '个人中心页', + url: "pages/my/index", + isSidebar: true }, { title: '个人信息表单页', + url: "pages/my/info-edit/index", + isSidebar: false }, { title: '设置页', + url: "pages/setup/index", + isSidebar: false }, { title: '数据图表页', + url: "pages/dataCenter/index", + isSidebar: false }, { title: '登录注册页', + url: "pages/login/login", + isSidebar: false }, ] }, @@ -42,6 +62,24 @@ Component({ this.setData({ visible: true }) + }, + itemClick(e) { + const { isSidebar , url } = e.detail.item; + if(isSidebar){ + wx.switchTab({ + url: `/${url}`, + }) + } else { + wx.navigateTo({ + url: `/${url}`, + }) + } + }, + + searchTurn() { + wx.navigateTo({ + url: `/pages/search/index`, + }) } } }) \ No newline at end of file diff --git a/pages/home/components/nav/index.wxml b/pages/home/components/nav/index.wxml index 1688f54..328f14b 100644 --- a/pages/home/components/nav/index.wxml +++ b/pages/home/components/nav/index.wxml @@ -2,8 +2,12 @@ - + - + \ No newline at end of file diff --git a/pages/home/index.js b/pages/home/index.js index 1ecb0ad..f6f46af 100644 --- a/pages/home/index.js +++ b/pages/home/index.js @@ -26,6 +26,8 @@ Page({ cardInfo: cardRes.data, swiperList: swiperRes.data }) + + }, onLoad(option) { if (wx.getUserProfile) { @@ -70,4 +72,5 @@ Page({ url: '/pages/release/index', }); }, + }) \ No newline at end of file diff --git a/pages/home/index.wxml b/pages/home/index.wxml index 7568820..cd22291 100644 --- a/pages/home/index.wxml +++ b/pages/home/index.wxml @@ -1,4 +1,5 @@ +