diff --git a/App.vue b/App.vue index 11dd6ce..62e0d20 100644 --- a/App.vue +++ b/App.vue @@ -20,7 +20,6 @@ // 监听消息 pushListener() // #endif - console.log('App Launch') }) diff --git a/api/login.ts b/api/login.ts index 843b7a5..1235a2f 100644 --- a/api/login.ts +++ b/api/login.ts @@ -1,7 +1,7 @@ import { get, post, put, del } from '../utils/request'; -export const userInfo = (data : any) => get('/power/drv', data); +export const userInfo = (data : any) => get('v1/info', data); export const register = (data : any) => post('/power/drv', data); diff --git a/api/message.ts b/api/message.ts new file mode 100644 index 0000000..57580d1 --- /dev/null +++ b/api/message.ts @@ -0,0 +1,13 @@ +import { get, post, put, del } from '../utils/request'; + +export const newMessage = (data : any = {}) => get('v1/message/new/count', data); + +export const register = (data : any) => post('/power/drv', data); + +export const updateUser = (data : any) => put('/power/drv', data); + +export const deleteUser = (data : any) => del('/power/drv', data); + +export const captcha = (data : any) => get('v1/captcha', data); + +export const login = (data : any) => post('v1/login', data); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 284f3cd..ebe9c71 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,6 +5,7 @@ "packages": { "": { "dependencies": { + "crypto-js": "^4.2.0", "pinia-plugin-persistedstate": "^4.2.0" } }, @@ -522,6 +523,11 @@ "resolved": "https://registry.npmmirror.com/convert-source-map/-/convert-source-map-2.0.0.tgz", "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==" }, + "node_modules/crypto-js": { + "version": "4.2.0", + "resolved": "https://registry.npmmirror.com/crypto-js/-/crypto-js-4.2.0.tgz", + "integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==" + }, "node_modules/debug": { "version": "4.4.0", "resolved": "https://registry.npmmirror.com/debug/-/debug-4.4.0.tgz", @@ -1741,6 +1747,11 @@ "resolved": "https://registry.npmmirror.com/convert-source-map/-/convert-source-map-2.0.0.tgz", "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==" }, + "crypto-js": { + "version": "4.2.0", + "resolved": "https://registry.npmmirror.com/crypto-js/-/crypto-js-4.2.0.tgz", + "integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==" + }, "debug": { "version": "4.4.0", "resolved": "https://registry.npmmirror.com/debug/-/debug-4.4.0.tgz", diff --git a/package.json b/package.json index e5b5a62..42256a3 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "dependencies": { - "pinia-plugin-persistedstate": "^4.2.0" + "pinia-plugin-persistedstate": "^4.2.0", + "crypto-js": "^4.2.0" } } diff --git a/pages.json b/pages.json index 2feaa11..ebfacb3 100644 --- a/pages.json +++ b/pages.json @@ -1,14 +1,5 @@ { "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages - { - "path": "pages/login/index", - "style": { - "enablePullDownRefresh": false, - "navigationBarTextStyle": "black", - "navigationStyle": "custom", - "navigationBarTitleText": "登录页" - } - }, { "path": "pages/index/index", "style": { @@ -18,6 +9,15 @@ "navigationBarTitleText": "首页" } }, + { + "path": "pages/login/index", + "style": { + "enablePullDownRefresh": false, + "navigationBarTextStyle": "black", + "navigationStyle": "custom", + "navigationBarTitleText": "登录页" + } + }, { "path": "pages/message/index", "style": { @@ -39,7 +39,7 @@ ], "globalStyle": { "navigationBarTextStyle": "black", - "navigationBarTitleText": "", + "navigationBarTitleText": "物业综合管理平台", "navigationBarBackgroundColor": "#F8F8F8", "backgroundColor": "#F8F8F8" }, diff --git a/pages/index/index.vue b/pages/index/index.vue index e53c0cd..acad8bc 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -96,6 +96,12 @@ import { bannerList } from '@/api/banner'; + import { + userInfo + } from '@/api/login'; + import { + newMessage + } from '@/api/message'; import { ref } from 'vue' @@ -105,7 +111,7 @@ declare const uni : Uni const card_back = uni.$globalData?.RESOURCE_URL + 'home/card-back.png' const keyword = ref('') - const messageCount = ref(10) + const messageCount = ref(0) const current = ref(0) const state = ref('loading') @@ -254,8 +260,15 @@ state.value = 'finished' }) + // 加载页面数据 + const loadData = (async () => { + var mess = await newMessage() + messageCount.value = mess.data.count + }) + onLoad(() => { - getBannerList() + loadData() + // getBannerList() }) diff --git a/pages/login/index.vue b/pages/login/index.vue index 1d850c6..efb15d2 100644 --- a/pages/login/index.vue +++ b/pages/login/index.vue @@ -6,7 +6,7 @@ - @@ -22,19 +22,18 @@ prefix-icon="secured" placeholderStyle="font-size:30rpx" :focus-when-clear="false" clear-trigger="focus" clearable no-border /> - - + + - 登录 + 登录 - - + + 阅读并同意 《用户协议》 @@ -49,28 +48,103 @@