diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..b1fac77 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/policeSecurity.iml b/.idea/policeSecurity.iml new file mode 100644 index 0000000..24643cc --- /dev/null +++ b/.idea/policeSecurity.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/collect_information/.env.development b/collect_information/.env.development index c876df6..edad538 100644 --- a/collect_information/.env.development +++ b/collect_information/.env.development @@ -1,2 +1,3 @@ +# 配置文档参考 https://taro-docs.jd.com/docs/next/env-mode-config TARO_APP_ID="wx0acd1c4fcf94bdd3" TARO_APP_BASE_API="http://172.10.10.93:8765" diff --git a/collect_information/.env.production b/collect_information/.env.production index bf2df6e..be6f45e 100644 --- a/collect_information/.env.production +++ b/collect_information/.env.production @@ -1,2 +1 @@ -TARO_APP_ID="wx24cc8a872b57ac79" -TARO_APP_BASE_API="http://172.10.10.207:7000" +# TARO_APP_ID="生产环境下的小程序appid" \ No newline at end of file diff --git a/collect_information/.eslintrc b/collect_information/.eslintrc index a5306c7..59b61d8 100644 --- a/collect_information/.eslintrc +++ b/collect_information/.eslintrc @@ -5,6 +5,15 @@ "taro/vue3" ], "rules": { - "vue/multi-word-component-names": "off" + // 添加组件命名忽略规则 + "vue/multi-word-component-names": [ + "error", + { + //需要忽略的组件名 + "ignores": [ + "index" + ] + } + ] } } diff --git a/collect_information/.gitignore b/collect_information/.gitignore index e83724e..63712f5 100644 --- a/collect_information/.gitignore +++ b/collect_information/.gitignore @@ -5,8 +5,9 @@ deploy_versions/ node_modules/ .DS_Store .swc -yarn.lock -components.d.ts -package-lock.json .idea + +components.d.ts +package-lock.json +yarn.lock diff --git a/collect_information/config/dev.ts b/collect_information/config/dev.ts index 83b5450..c37eb43 100644 --- a/collect_information/config/dev.ts +++ b/collect_information/config/dev.ts @@ -1,124 +1,9 @@ -// import type { UserConfigExport } from "@tarojs/cli"; -// export default { -// logger: { -// quiet: false, -// stats: true -// }, -// mini: {}, -// h5: {} -// } satisfies UserConfigExport -import {defineConfig, type UserConfigExport} from '@tarojs/cli' -import TsconfigPathsPlugin from 'tsconfig-paths-webpack-plugin' -import devConfig from './dev' -import prodConfig from './prod' -import ComponentsPlugin from 'unplugin-vue-components/webpack' -import NutUIResolver from '@nutui/auto-import-resolver' - -// https://taro-docs.jd.com/docs/next/config#defineconfig-辅助函数 -export default defineConfig(async (merge, {command, mode}) => { - const baseConfig: UserConfigExport = { - projectName: 'collect_information', - date: '2024-4-12', - designWidth(input: any) { - // 配置 NutUI 375 尺寸 - if (input?.file?.replace(/\\+/g, '/').indexOf('@nutui') > -1) { - return 375 - } - // 全局使用 Taro 默认的 750 尺寸 - return 750 - }, - deviceRatio: { - 640: 2.34 / 2, - 750: 1, - 828: 1.81 / 2, - 375: 2 - }, - sourceRoot: 'src', - outputRoot: 'dist', - plugins: ['@tarojs/plugin-html'], - defineConstants: {}, - copy: { - patterns: [], - options: {} - }, - framework: 'vue3', - compiler: 'webpack5', - cache: { - enable: false // Webpack 持久化缓存配置,建议开启。默认配置请参考:https://docs.taro.zone/docs/config-detail#cache - }, - mini: { - miniCssExtractPluginOption: { - ignoreOrder: true - }, - postcss: { - pxtransform: { - enable: true, - config: {} - }, - url: { - enable: true, - config: { - limit: 1024 // 设定转换尺寸上限 - } - }, - cssModules: { - enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true - config: { - namingPattern: 'module', // 转换模式,取值为 global/module - generateScopedName: '[name]__[local]___[hash:base64:5]' - } - } - }, - webpackChain(chain) { - chain.resolve.plugin('tsconfig-paths').use(TsconfigPathsPlugin) - chain.plugin('unplugin-vue-components').use(ComponentsPlugin({ - resolvers: [NutUIResolver({taro: true})] - })) - } - }, - h5: { - publicPath: '/', - staticDirectory: 'static', - output: { - filename: 'js/[name].[hash:8].js', - chunkFilename: 'js/[name].[chunkhash:8].js' - }, - miniCssExtractPluginOption: { - ignoreOrder: true, - filename: 'css/[name].[hash].css', - chunkFilename: 'css/[name].[chunkhash].css' - }, - postcss: { - autoprefixer: { - enable: true, - config: {} - }, - cssModules: { - enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true - config: { - namingPattern: 'module', // 转换模式,取值为 global/module - generateScopedName: '[name]__[local]___[hash:base64:5]' - } - } - }, - webpackChain(chain) { - chain.resolve.plugin('tsconfig-paths').use(TsconfigPathsPlugin) - } - }, - rn: { - appName: 'taroDemo', - postcss: { - cssModules: { - enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true - } - } - } - } - if (process.env.NODE_ENV === 'development') { - // 本地开发构建配置(不混淆压缩) - return merge({}, baseConfig, devConfig) - } - // 生产构建配置(默认开启压缩混淆等) - return merge({}, baseConfig, prodConfig) -}) - +import type { UserConfigExport } from "@tarojs/cli"; +export default { + logger: { + quiet: false, + stats: true + }, + mini: {}, + h5: {} +} satisfies UserConfigExport diff --git a/collect_information/config/index.ts b/collect_information/config/index.ts index 54a4b61..3a25c14 100644 --- a/collect_information/config/index.ts +++ b/collect_information/config/index.ts @@ -3,13 +3,13 @@ import TsconfigPathsPlugin from 'tsconfig-paths-webpack-plugin' import devConfig from './dev' import prodConfig from './prod' import ComponentsPlugin from 'unplugin-vue-components/webpack' -import NutUIResolver from '@nutui/auto-import-resolver' +import NutUIResolver from "@nutui/auto-import-resolver"; // https://taro-docs.jd.com/docs/next/config#defineconfig-辅助函数 export default defineConfig(async (merge, {command, mode}) => { const baseConfig: UserConfigExport = { projectName: 'collect_information', - date: '2024-4-12', + date: '2024-9-14', designWidth(input: any) { // 配置 NutUI 375 尺寸 if (input?.file?.replace(/\\+/g, '/').indexOf('@nutui') > -1) { @@ -26,6 +26,7 @@ export default defineConfig(async (merge, {command, mode}) => { }, sourceRoot: 'src', outputRoot: 'dist', + // 开启 HTML 插件 plugins: ['@tarojs/plugin-html'], defineConstants: {}, copy: { diff --git a/collect_information/package.json b/collect_information/package.json index f7d1452..1830680 100644 --- a/collect_information/package.json +++ b/collect_information/package.json @@ -2,7 +2,7 @@ "name": "collect_information", "version": "1.0.0", "private": true, - "description": "警保联勤联动小程序", + "description": "警保联动小程序", "templateInfo": { "name": "default", "typescript": true, @@ -40,47 +40,44 @@ "author": "", "dependencies": { "@babel/runtime": "^7.21.5", - "@nutui/icons-vue-taro": "^0.0.9", - "@nutui/nutui-taro": "^4.3.5", - "@tarojs/components": "3.6.25", - "@tarojs/helper": "3.6.25", - "@tarojs/plugin-framework-vue3": "3.6.25", + "@nutui/nutui-taro": "^4.3.13", + "@tarojs/components": "3.6.26", + "@tarojs/helper": "3.6.26", + "@tarojs/plugin-framework-vue3": "3.6.26", "@tarojs/plugin-html": "^3.6.26", - "@tarojs/plugin-platform-alipay": "3.6.25", - "@tarojs/plugin-platform-h5": "3.6.25", - "@tarojs/plugin-platform-harmony-hybrid": "3.6.25", - "@tarojs/plugin-platform-jd": "3.6.25", - "@tarojs/plugin-platform-qq": "3.6.25", - "@tarojs/plugin-platform-swan": "3.6.25", - "@tarojs/plugin-platform-tt": "3.6.25", - "@tarojs/plugin-platform-weapp": "3.6.25", - "@tarojs/runtime": "3.6.25", - "@tarojs/shared": "3.6.25", - "@tarojs/taro": "3.6.25", - "dayjs": "^1.11.10", - "pinia": "^2.1.7", - "pinia-plugin-persistedstate": "^4.0.1", + "@tarojs/plugin-platform-alipay": "3.6.26", + "@tarojs/plugin-platform-h5": "3.6.26", + "@tarojs/plugin-platform-harmony-hybrid": "3.6.26", + "@tarojs/plugin-platform-jd": "3.6.26", + "@tarojs/plugin-platform-qq": "3.6.26", + "@tarojs/plugin-platform-swan": "3.6.26", + "@tarojs/plugin-platform-tt": "3.6.26", + "@tarojs/plugin-platform-weapp": "3.6.26", + "@tarojs/runtime": "3.6.26", + "@tarojs/shared": "3.6.26", + "@tarojs/taro": "3.6.26", + "dayjs": "^1.11.13", + "pinia": "^2.2.2", "vue": "^3.0.0" }, "devDependencies": { "@babel/core": "^7.8.0", "@nutui/auto-import-resolver": "^1.0.0", - "@tarojs/cli": "3.6.25", - "@tarojs/taro-loader": "3.6.25", + "@tarojs/cli": "3.6.26", + "@tarojs/taro-loader": "3.6.26", "@tarojs/test-utils-vue3": "^0.1.1", - "@tarojs/webpack5-runner": "3.6.25", + "@tarojs/webpack5-runner": "3.6.26", "@types/jest": "^29.3.1", "@types/node": "^18.15.11", - "@types/qrcode": "^1.5.5", "@types/webpack-env": "^1.13.6", "@typescript-eslint/eslint-plugin": "^6.2.0", "@typescript-eslint/parser": "^6.2.0", "@vue/babel-plugin-jsx": "^1.0.6", "@vue/compiler-sfc": "^3.0.0", - "babel-preset-taro": "3.6.25", + "babel-preset-taro": "3.6.26", "css-loader": "3.4.2", "eslint": "^8.12.0", - "eslint-config-taro": "3.6.25", + "eslint-config-taro": "3.6.26", "eslint-plugin-vue": "^8.0.0", "jest": "^29.3.1", "jest-environment-jsdom": "^29.5.0", @@ -90,8 +87,8 @@ "ts-node": "^10.9.1", "tsconfig-paths-webpack-plugin": "^4.1.0", "typescript": "^5.1.0", - "unplugin-vue-components": "^0.26.0", - "vue-loader": "^17.0.0", + "unplugin-vue-components": "^0.27.4", + "vue-loader": "^17.1.0", "webpack": "5.78.0" } } diff --git a/collect_information/project.config.json b/collect_information/project.config.json index 4959a1d..2d18dde 100644 --- a/collect_information/project.config.json +++ b/collect_information/project.config.json @@ -1,32 +1,15 @@ { - "miniprogramRoot": "dist/", + "miniprogramRoot": "./dist", "projectname": "collect_information", - "description": "警保联勤联动小程序", + "description": "警保联动小程序", + "appid": "touristappid", "setting": { "urlCheck": false, "es6": false, "enhance": false, - "compileHotReLoad": true, + "compileHotReLoad": false, "postcss": false, - "minified": false, - "babelSetting": { - "ignore": [], - "disablePlugins": [], - "outputPath": "" - }, - "ignoreUploadUnusedFiles": true + "minified": false }, - "compileType": "miniprogram", - "libVersion": "3.5.0", - "srcMiniprogramRoot": "dist/", - "packOptions": { - "ignore": [], - "include": [] - }, - "condition": {}, - "editorSetting": { - "tabIndent": "insertSpaces", - "tabSize": 2 - }, - "appid": "wx8902ddbfddb820d1" + "compileType": "miniprogram" } diff --git a/collect_information/project.private.config.json b/collect_information/project.private.config.json deleted file mode 100644 index 99e9c4e..0000000 --- a/collect_information/project.private.config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", - "projectname": "collect_information", - "setting": { - "compileHotReLoad": true - }, - "condition": { - "miniprogram": { - "list": [ - { - "name": "pages/projectManager/myProject/myProject", - "pathName": "pages/projectManager/myProject/myProject", - "query": "", - "launchMode": "default", - "scene": null - }, - { - "name": "", - "pathName": "pages/mine/mine", - "query": "", - "launchMode": "default", - "scene": null - }, - { - "name": "", - "pathName": "pages/login/login", - "query": "", - "launchMode": "default", - "scene": null - }, - { - "name": "", - "pathName": "pages/mine/mine", - "query": "", - "launchMode": "default", - "scene": null - }, - { - "name": "", - "pathName": "pages/index/index", - "query": "", - "launchMode": "default", - "scene": null - }, - { - "name": "", - "pathName": "pages/index/dataEntry/buildFloorEntry/buildFloorEntry", - "query": "", - "launchMode": "default", - "scene": null - }, - { - "name": "", - "pathName": "pages/register/register", - "query": "", - "launchMode": "default", - "scene": null - } - ] - } - } -} \ No newline at end of file diff --git a/collect_information/src/app.config.ts b/collect_information/src/app.config.ts index c2b33bf..3690c73 100644 --- a/collect_information/src/app.config.ts +++ b/collect_information/src/app.config.ts @@ -1,58 +1,38 @@ +import {MINI_PROGRAM_USER_CONFIG} from "@/config"; + + +const tabBarItems = Object.values(MINI_PROGRAM_USER_CONFIG).map(item => item.tabBarList).flat() + export default defineAppConfig({ pages: [ 'pages/login/login', 'pages/register/register', - 'pages/projectManager/index/index', - 'pages/policeManager/index/index', - 'pages/mine/mine', - 'pages/employeeInfo/employeeInfo', + ...tabBarItems.map(i => i.pagePath) + ], + subPackages: [ + { + root: "subPages/projectManager", + pages: [ + 'myProject/myProject', + 'myProject/projectDetails/projectDetails', + 'securityUserForm/securityUserForm', + ] + }, { + root: "subPages/police", + pages: [ + 'myEnterprisesUnit/myEnterprisesUnit', + 'myEnterprisesUnit/projectDetails/projectDetails' + ] + } ], window: { backgroundTextStyle: 'light', navigationBarBackgroundColor: '#4e87ff', navigationBarTitleText: '', - navigationBarTextStyle:'white', + navigationBarTextStyle: 'white', }, - subpackages: [ - { - root: "subPages", - pages: [ - 'pages/policeManager/index', - 'pages/policeDetails/index', - 'pages/myProject/myProject', - 'pages/projectDetails/projectDetails', - 'pages/form/form' - ] - } - ], tabBar: { custom: true, - list: [ - { - pagePath: 'pages/projectManager/index/index', - text: '首页', - iconPath: "assets/mine/punch.png", - selectedIconPath: "assets/mine/punch-active.png" - }, - { - pagePath: 'pages/policeManager/index/index', - text: '首页', - iconPath: "assets/mine/punch.png", - selectedIconPath: "assets/mine/punch-active.png" - }, - { - pagePath: 'pages/employeeInfo/employeeInfo', - text: '员工信息', - iconPath: "assets/mine/punch.png", - selectedIconPath: "assets/mine/punch-active.png" - }, - { - pagePath: 'pages/mine/mine', - text: '我的', - iconPath: "assets/mine/my.png", - selectedIconPath: "assets/mine/my-active.png" - }, - ] + list: tabBarItems } - }) diff --git a/collect_information/src/app.scss b/collect_information/src/app.scss index 0570844..e69de29 100644 --- a/collect_information/src/app.scss +++ b/collect_information/src/app.scss @@ -1,4 +0,0 @@ -*{ - margin: 0; - padding: 0; -} diff --git a/collect_information/src/app.ts b/collect_information/src/app.ts index 95a2ac5..28f74dd 100644 --- a/collect_information/src/app.ts +++ b/collect_information/src/app.ts @@ -1,35 +1,28 @@ import {createApp} from 'vue' -import {createPinia} from 'pinia' -import {useCounterStore} from '@/store' -import './app.scss' -import './assets/scss/colorui.scss' +import '@/app.scss' +import '@/assets/css/main.css' +import {pinia} from "@/store"; import Taro from "@tarojs/taro"; +import {MINI_PROGRAM_USER_CONFIG} from "@/config"; +import {useUserStore} from "@/store/userStore"; +import {initEnum} from "@/enums"; -const pinia = createPinia() -// import piniaPluginPersistedstate from 'pinia-plugin-persistedstate' -// pinia.use(piniaPluginPersistedstate) const App = createApp({ - onShow(options) { - // try { - // const store = useCounterStore() - // const token = Taro.getStorageSync('token') - // console.log(token) - // if (token) { - // Taro.switchTab({ - // url: '/pages/mine/mine' - // // url: '/pages/projectManager/index/index' - // - // }) - // store.setSelected(2) - // } else { - // console.log(2222) - // } - // console.log('App onShow.') - // } catch (err) { - // console.log(err) - // - // } - + onLaunch(opt) { + initEnum() + if (opt.path === 'subPages/projectManager/securityUserForm/securityUserForm' && opt.query.type === 'QcCodeInput') { + return + } + const tokenInfo = useUserStore().getTokenInfo(); + if (tokenInfo) { + Taro.switchTab({ + url: MINI_PROGRAM_USER_CONFIG[tokenInfo.extData.identity.value].toIndex + }) + } else { + Taro.navigateTo({ + url: '/pages/login/login', + }) + } }, // 入口组件不需要实现 render 方法,即使实现了也会被 taro 所覆盖 }) diff --git a/collect_information/src/assets/scss/colorui.scss b/collect_information/src/assets/css/main.css similarity index 100% rename from collect_information/src/assets/scss/colorui.scss rename to collect_information/src/assets/css/main.css diff --git a/collect_information/src/assets/images/01.png b/collect_information/src/assets/images/01.png new file mode 100644 index 0000000..b66fa47 Binary files /dev/null and b/collect_information/src/assets/images/01.png differ diff --git a/collect_information/src/assets/images/arrow.png b/collect_information/src/assets/images/arrow.png deleted file mode 100644 index 521b08a..0000000 Binary files a/collect_information/src/assets/images/arrow.png and /dev/null differ diff --git a/collect_information/src/assets/images/banner.jpg b/collect_information/src/assets/images/banner.jpg deleted file mode 100644 index f29618c..0000000 Binary files a/collect_information/src/assets/images/banner.jpg and /dev/null differ diff --git a/collect_information/src/assets/images/project.png b/collect_information/src/assets/images/project.png new file mode 100644 index 0000000..8de6ed4 Binary files /dev/null and b/collect_information/src/assets/images/project.png differ diff --git a/collect_information/src/assets/logo/guohui.png b/collect_information/src/assets/logo/guohui.png new file mode 100644 index 0000000..d06ce3a Binary files /dev/null and b/collect_information/src/assets/logo/guohui.png differ diff --git a/collect_information/src/config/index.ts b/collect_information/src/config/index.ts new file mode 100644 index 0000000..f9bd5c6 --- /dev/null +++ b/collect_information/src/config/index.ts @@ -0,0 +1,46 @@ +import {UserConfig} from "@/types/config"; + +/** + * 客户端 + */ +export const CLIENT_TYPE = 'MINI_PROGRAM' + +/** + * 小程序用户配置 + */ +export const MINI_PROGRAM_USER_CONFIG: Record = { + police: { + toIndex: '/pages/police/index/index', + tabBarList: [ + { + pagePath: 'pages/police/index/index', + text: '首页', + iconPath: "assets/mine/punch.png", + selectedIconPath: "assets/mine/punch-active.png" + }, + { + pagePath: 'pages/police/mine/index', + text: '警察我的', + iconPath: "assets/mine/my.png", + selectedIconPath: "assets/mine/my-active.png" + }, + ] + }, + project_manager: { + toIndex: '/pages/projectManager/index/index', + tabBarList: [ + { + pagePath: 'pages/projectManager/index/index', + text: '首页', + iconPath: "assets/mine/punch.png", + selectedIconPath: "assets/mine/punch-active.png" + }, + { + pagePath: 'pages/projectManager/mine/index', + text: '项目经理我的', + iconPath: "assets/mine/my.png", + selectedIconPath: "assets/mine/my-active.png" + }, + ] + } +} diff --git a/collect_information/src/custom-tab-bar/index.json.js b/collect_information/src/custom-tab-bar/index.json.ts similarity index 100% rename from collect_information/src/custom-tab-bar/index.json.js rename to collect_information/src/custom-tab-bar/index.json.ts diff --git a/collect_information/src/custom-tab-bar/index.vue b/collect_information/src/custom-tab-bar/index.vue index f2b91fb..8d062e0 100644 --- a/collect_information/src/custom-tab-bar/index.vue +++ b/collect_information/src/custom-tab-bar/index.vue @@ -1,34 +1,42 @@ - @@ -63,12 +71,12 @@ function setSelected(index) { flex-direction: column; } -.tab-bar-item image { +.tab-bar-item cover-image { width: 54px; height: 54px; } -.tab-bar-item view { +.tab-bar-item cover-view { font-size: 20px; } diff --git a/collect_information/src/enums/index.ts b/collect_information/src/enums/index.ts index 3566495..efdc1ef 100644 --- a/collect_information/src/enums/index.ts +++ b/collect_information/src/enums/index.ts @@ -1,34 +1,40 @@ -export const SEX: SelectNode[] = [ - { - value: 0, - label: "男", - }, - { - value: 1, - label: "女", - }, - { - value: 2, - label: "隐藏", +import api from "@/request"; +import Taro from "@tarojs/taro"; + +type EnumType = + 'CheckStatus' + | 'DeleteFlag' + | 'IsEnable' + | 'IsOrNot' + | 'Sex' + | 'ServiceProjectType' + | 'MiniProgramUserIdentity' + +export const initEnum = () => { + api.get[]>>('/common/enums').then(resp => { + Taro.setStorageSync('enumMap', resp.data) + }) +}; + +export const enumSelectNodes = (enumType: EnumType): SelectNodeVo[] => Taro.getStorageSync('enumMap')?.[enumType] + +export const getEnumByValue = (enumType: EnumType, value: T): null | SelectNodeVo => { + const enumList = enumSelectNodes(enumType); + if (!enumList) { + return null; } -]; - -export const IDENTITY: SelectNode[] = [ - { - label: "公安", - value: "police" - }, - { - label: "项目经理", - value: "project_manager" - }, -] - -export const getLabelByEnumValue = (enums: SelectNode[], value: any): string => { - for (let i = 0; i < enums.length; i++) { - if (enums[i].value === value) { - return enums[i].label + for (let i = 0; i < enumList.length; i++) { + if (value === enumList[i].value) { + return enumList[i] } } - return '-' -} + return null; +}; + +export const getEnumLabelByValue = (enumType: EnumType, value: T): string => { + const enums = getEnumByValue(enumType, value) + if (!enums) { + return '-' + } + return enums.label; +}; diff --git a/collect_information/src/pages/employeeInfo/employeeInfo.config.ts b/collect_information/src/pages/employeeInfo/employeeInfo.config.ts deleted file mode 100644 index ca739e2..0000000 --- a/collect_information/src/pages/employeeInfo/employeeInfo.config.ts +++ /dev/null @@ -1,4 +0,0 @@ -export default definePageConfig({ - // navigationBarTitleText: '自定义导航栏', - navigationStyle: "custom" -}) diff --git a/collect_information/src/pages/employeeInfo/employeeInfo.scss b/collect_information/src/pages/employeeInfo/employeeInfo.scss deleted file mode 100644 index 139597f..0000000 --- a/collect_information/src/pages/employeeInfo/employeeInfo.scss +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/collect_information/src/pages/employeeInfo/employeeInfo.vue b/collect_information/src/pages/employeeInfo/employeeInfo.vue deleted file mode 100644 index 77742df..0000000 --- a/collect_information/src/pages/employeeInfo/employeeInfo.vue +++ /dev/null @@ -1,21 +0,0 @@ - - - diff --git a/collect_information/src/pages/login/login.config.ts b/collect_information/src/pages/login/login.config.ts index 97683f1..9d41d86 100644 --- a/collect_information/src/pages/login/login.config.ts +++ b/collect_information/src/pages/login/login.config.ts @@ -1,3 +1,3 @@ export default definePageConfig({ - navigationBarTitleText: '登录', + navigationBarTitleText: '登录', }) diff --git a/collect_information/src/pages/login/login.vue b/collect_information/src/pages/login/login.vue index 0ebac18..ed09acd 100644 --- a/collect_information/src/pages/login/login.vue +++ b/collect_information/src/pages/login/login.vue @@ -1,73 +1,45 @@ + + diff --git a/collect_information/src/pages/mine/mine.config.ts b/collect_information/src/pages/mine/mine.config.ts deleted file mode 100644 index 18e4d2b..0000000 --- a/collect_information/src/pages/mine/mine.config.ts +++ /dev/null @@ -1,5 +0,0 @@ -export default definePageConfig({ - navigationBarTitleText: '我的', - navigationBarBackgroundColor:'#3d69dc', - navigationBarTextStyle:'white' -}) diff --git a/collect_information/src/pages/mine/mine.scss b/collect_information/src/pages/mine/mine.scss deleted file mode 100644 index 810e441..0000000 --- a/collect_information/src/pages/mine/mine.scss +++ /dev/null @@ -1,84 +0,0 @@ -.message { - height: 100vh; - background-color: #fff; -} - -.login-container { - height: 205rpx; - display: flex; - align-items: center; - background-image: url('../../assets/images/banner.jpg'); - background-repeat: no-repeat; - background-position: right; - overflow: hidden; - padding: 18rpx; - box-sizing: border-box; - - .contact { - height: 100rpx; - width: 100rpx; - border-radius: 50%; - border: solid 1px gray; - - .image { - width: 100%; - height: 100%; - border-radius: 50% - } - } - - .tips-text { - display: flex; - font-size: 28rpx; - color: #fff; - line-height: 50rpx; - margin-left: 20rpx; - flex-direction: column; - justify-content: space-evenly; - } -} - -.userIndex { - .exit { - height: 100rpx; - line-height: 40px; - border-bottom: solid 0.5px #ebebf7; - box-sizing: border-box; - display: flex; - justify-content: space-between; - align-items: center; - // margin-bottom: 30rpx; - color: #7d7d7d; - - .exitItem { - display: flex; - align-items: center; - margin-left: 30rpx; - } - - .exitItemIndex { - height: 40rpx; - width: 40rpx; - border-radius: 50%; - // border: solid 1px gray; - display: block; - line-height: 48rpx; - - image { - width: 100%; - height: 100%; - } - } - - .iconScope { - width: 8px; - height: 8px; - display: inline-block; - border: solid 2px #ccc; - -webkit-transform: rotate(45deg); - transform: rotate(45deg); - border-bottom: white; - border-left: white; - } - } -} diff --git a/collect_information/src/pages/mine/mine.vue b/collect_information/src/pages/mine/mine.vue deleted file mode 100644 index ba68e5e..0000000 --- a/collect_information/src/pages/mine/mine.vue +++ /dev/null @@ -1,17 +0,0 @@ - - - - diff --git a/collect_information/src/pages/policeManager/index/index.config.ts b/collect_information/src/pages/police/index/index.config.ts similarity index 98% rename from collect_information/src/pages/policeManager/index/index.config.ts rename to collect_information/src/pages/police/index/index.config.ts index 16286d6..a7c25c7 100644 --- a/collect_information/src/pages/policeManager/index/index.config.ts +++ b/collect_information/src/pages/police/index/index.config.ts @@ -1,4 +1,3 @@ export default definePageConfig({ navigationBarTitleText: '首页', - }) diff --git a/collect_information/src/pages/police/index/index.scss b/collect_information/src/pages/police/index/index.scss new file mode 100644 index 0000000..650fcb5 --- /dev/null +++ b/collect_information/src/pages/police/index/index.scss @@ -0,0 +1,47 @@ +.swiperDemoItem { + color: #3886d0; + display: flex; + padding: 20px 0 0 50px; + overflow: hidden; + height: 70rpx; + + .swiperDemoIndex { + width: 15px; + height: 45px; + background-image: linear-gradient(to bottom, #5d9cf9, #317ad9); + //background: rgb(); + border-radius: 20px; + margin-right: 15px; + } +} + +.subModule { + display: flex; + align-items: center; + flex-wrap: wrap; + margin-right: -3px; + margin-left: -1px; + + .subModuleItem { + width: 33%; + height: 180rpx; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + padding-bottom: 10rpx; + border: 1px solid #ccc; + border-left: 0; + margin-top: -1px; + + .subModuleIndex { + width: 65rpx; + height: 65rpx; + + image { + width: 100%; + height: 100%; + } + } + } +} diff --git a/collect_information/src/pages/police/index/index.vue b/collect_information/src/pages/police/index/index.vue new file mode 100644 index 0000000..9ca7928 --- /dev/null +++ b/collect_information/src/pages/police/index/index.vue @@ -0,0 +1,58 @@ + + diff --git a/collect_information/src/pages/police/mine/index.config.ts b/collect_information/src/pages/police/mine/index.config.ts new file mode 100644 index 0000000..a7c25c7 --- /dev/null +++ b/collect_information/src/pages/police/mine/index.config.ts @@ -0,0 +1,3 @@ +export default definePageConfig({ + navigationBarTitleText: '首页', +}) diff --git a/collect_information/src/pages/police/mine/index.scss b/collect_information/src/pages/police/mine/index.scss new file mode 100644 index 0000000..e69de29 diff --git a/collect_information/src/pages/police/mine/index.vue b/collect_information/src/pages/police/mine/index.vue new file mode 100644 index 0000000..d00e9e3 --- /dev/null +++ b/collect_information/src/pages/police/mine/index.vue @@ -0,0 +1,9 @@ + + + diff --git a/collect_information/src/pages/policeManager/index/index.scss b/collect_information/src/pages/policeManager/index/index.scss deleted file mode 100644 index a3b707a..0000000 --- a/collect_information/src/pages/policeManager/index/index.scss +++ /dev/null @@ -1,39 +0,0 @@ -page { - background-color: #f0f0f0; -} - -.content { - width: 702rpx; - margin: 10rpx auto; - background-color: #fff; - border-radius: 10rpx; - height: 500rpx; - display: grid; - /* 定义两列,每列占据50%的宽度 */ - grid-template-columns: repeat(2, 1fr); - /* 定义两行,每行占据1fr(分数单位,表示剩余空间的一部分) */ - grid-template-rows: repeat(2, 1fr); - /* 可选:增加一些间隙 */ - gap: 10px; - - .grid-item { - //width: 100%; - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - - - .grid-item-image { - height: 150rpx; - width: 150rpx; - background-color: #f0f0f0; - border-radius: 50%; - } - - .grid-item-text { - - - } - } -} diff --git a/collect_information/src/pages/policeManager/index/index.vue b/collect_information/src/pages/policeManager/index/index.vue deleted file mode 100644 index 94154d2..0000000 --- a/collect_information/src/pages/policeManager/index/index.vue +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/collect_information/src/pages/projectManager/index/index.config.ts b/collect_information/src/pages/projectManager/index/index.config.ts index 6b0b2af..a7c25c7 100644 --- a/collect_information/src/pages/projectManager/index/index.config.ts +++ b/collect_information/src/pages/projectManager/index/index.config.ts @@ -1,4 +1,3 @@ - export default definePageConfig({ - navigationBarTitleText: '首页', + navigationBarTitleText: '首页', }) diff --git a/collect_information/src/pages/projectManager/index/index.scss b/collect_information/src/pages/projectManager/index/index.scss index e69de29..b802829 100644 --- a/collect_information/src/pages/projectManager/index/index.scss +++ b/collect_information/src/pages/projectManager/index/index.scss @@ -0,0 +1,48 @@ +.swiperDemoItem { + color: #3886d0; + display: flex; + padding: 20px 0 0 50px; + overflow: hidden; + height: 70rpx; + + .swiperDemoIndex { + width: 15px; + height: 45px; + background-image: linear-gradient(to bottom, #5d9cf9, #317ad9); + //background: rgb(); + border-radius: 20px; + margin-right: 15px; + } +} + +.subModule { + display: flex; + align-items: center; + flex-wrap: wrap; + margin-right: -3px; + margin-left: -1px; + + .subModuleItem { + width: 33%; + height: 180rpx; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + padding-bottom: 10rpx; + border: 1px solid #ccc; + border-left: 0; + margin-top: -1px; + + .subModuleIndex { + width: 65rpx; + height: 65rpx; + + image { + width: 100%; + height: 100%; + } + } + } +} + diff --git a/collect_information/src/pages/projectManager/index/index.vue b/collect_information/src/pages/projectManager/index/index.vue index 0ffa443..7455202 100644 --- a/collect_information/src/pages/projectManager/index/index.vue +++ b/collect_information/src/pages/projectManager/index/index.vue @@ -1,41 +1,58 @@ - - diff --git a/collect_information/src/pages/projectManager/mine/index.config.ts b/collect_information/src/pages/projectManager/mine/index.config.ts new file mode 100644 index 0000000..b4d3feb --- /dev/null +++ b/collect_information/src/pages/projectManager/mine/index.config.ts @@ -0,0 +1,3 @@ +export default definePageConfig({ + navigationBarTitleText: '我的', +}) diff --git a/collect_information/src/pages/projectManager/mine/index.scss b/collect_information/src/pages/projectManager/mine/index.scss new file mode 100644 index 0000000..e69de29 diff --git a/collect_information/src/pages/projectManager/mine/index.vue b/collect_information/src/pages/projectManager/mine/index.vue new file mode 100644 index 0000000..55e8097 --- /dev/null +++ b/collect_information/src/pages/projectManager/mine/index.vue @@ -0,0 +1,9 @@ + + + diff --git a/collect_information/src/pages/register/register.config.ts b/collect_information/src/pages/register/register.config.ts index 7632e93..1c854c8 100644 --- a/collect_information/src/pages/register/register.config.ts +++ b/collect_information/src/pages/register/register.config.ts @@ -1,3 +1,3 @@ export default definePageConfig({ - navigationBarTitleText: '用户注册' + navigationBarTitleText: '注册' }) diff --git a/collect_information/src/pages/register/register.scss b/collect_information/src/pages/register/register.scss index eaa1ebf..d3ec4b4 100644 --- a/collect_information/src/pages/register/register.scss +++ b/collect_information/src/pages/register/register.scss @@ -27,7 +27,7 @@ } .nickNameInput{ - color: black; + color: black; } .contact { diff --git a/collect_information/src/pages/register/register.vue b/collect_information/src/pages/register/register.vue index e3e7fc7..0368d69 100644 --- a/collect_information/src/pages/register/register.vue +++ b/collect_information/src/pages/register/register.vue @@ -11,9 +11,9 @@ @@ -26,18 +26,18 @@ {{ item.label }} @@ -47,21 +47,21 @@ - {{ selectedLabel || '请选择单位'}} + {{ selectedLabel || '请选择单位' }} @@ -75,19 +75,23 @@ - diff --git a/collect_information/src/request/index.ts b/collect_information/src/request/index.ts index 0947285..8c22ad3 100644 --- a/collect_information/src/request/index.ts +++ b/collect_information/src/request/index.ts @@ -1,26 +1,33 @@ import Taro from "@tarojs/taro"; -import {ApiOptions} from "../../types/request"; -import {type} from "os"; +import {ApiOptions} from "@/types/request"; +import {useUserStore} from "@/store/userStore"; + +/** + * 请求拦截器 + * @param chain + */ const requestInterceptor = (chain: Taro.Chain) => { const requestParams = chain.requestParams - const token = Taro.getStorageSync('token') - if (token) { - requestParams.header = { - ...requestParams.header, - token: token.value - } + const tokenInfo = useUserStore().getTokenInfo() + const {header} = requestParams; + const customHeader: Record = {} + //添加token + tokenInfo && (customHeader[tokenInfo.name] = tokenInfo.value); + requestParams.header = { + ...header, + ...customHeader } return chain.proceed(requestParams) } -class CustomRequest { - BASE_API: string +//所有的拦截器 +const interceptors = [requestInterceptor]; +//注册拦截器 +interceptors.forEach((interceptorItem) => Taro.addInterceptor(interceptorItem)); - public constructor() { - this.BASE_API = process.env.TARO_APP_BASE_API - Taro.addInterceptor(requestInterceptor) - } +class CustomRequest { + BASE_API: string = process.env.TARO_APP_BASE_API; private request(url: string, method: keyof Taro.request.Method, options: ApiOptions, params?: object,): Promise> { return new Promise>((resolve, reject) => { @@ -29,7 +36,6 @@ class CustomRequest { title: '请求中...', }).then() } - Taro.request, object>({ url: this.BASE_API + url, data: params, @@ -37,10 +43,14 @@ class CustomRequest { ...options, success: (result) => { Taro.hideLoading() + if (result.header['Content-Type'] === 'application/octet-stream') { + resolve(result.data) + return + } const jsonResult = result.data if (jsonResult.code !== 200) { if ([401].includes(jsonResult.code)) { - //todo 重新登录 跳转登录页 提示错误 + // 重新登录 跳转登录页 提示错误 } Taro.showToast({ title: jsonResult.message, @@ -49,8 +59,9 @@ class CustomRequest { duration: 2000 }).then() reject(jsonResult); + } else { + resolve(jsonResult); } - resolve(jsonResult); }, fail: (res) => { Taro.hideLoading() @@ -61,13 +72,16 @@ class CustomRequest { duration: 2000 }).then() reject(res.errMsg); - console.log(res.errMsg, '000') } }) }) } get(url: string, params?: object, options: ApiOptions = {loading: false}): Promise> { + options.header = { + ...options.header, + "content-type": 'application/x-www-form-urlencoded' + } return this.request(url, "GET", options, params) } @@ -76,12 +90,17 @@ class CustomRequest { } delete(url: string, params?: object, options: ApiOptions = {loading: false}): Promise> { + options.header = { + ...options.header, + "content-type": 'application/x-www-form-urlencoded' + } return this.request(url, "DELETE", options, params) } put(url: string, params?: object, options: ApiOptions = {loading: false}): Promise> { return this.request(url, "PUT", options, params) } + } const api = new CustomRequest(); diff --git a/collect_information/src/store/index.ts b/collect_information/src/store/index.ts index e29a946..e917126 100644 --- a/collect_information/src/store/index.ts +++ b/collect_information/src/store/index.ts @@ -1,51 +1,3 @@ -import {defineStore} from 'pinia' -import Taro from '@tarojs/taro' - -export const useCounterStore = defineStore('counter', { - state: () => { - return { - userInfo: {}, - selected: 0, - list: Taro.getStorageSync('list') || [ - { - pagePath: '/pages/projectManager/index/index', - text: '首页', - iconPath: "/assets/mine/punch.png", - selectedIconPath: "/assets/mine/punch-active.png" - }, - { - pagePath: '/pages/employeeInfo/employeeInfo', - text: '员工信息', - iconPath: "/assets/mine/punch.png", - selectedIconPath: "/assets/mine/punch-active.png" - }, - { - pagePath: '/pages/mine/mine', - text: '我的', - iconPath: "/assets/mine/my.png", - selectedIconPath: "/assets/mine/my-active.png" - }, - ] - } - }, - actions: { - setSelected(index: number) { - this.selected = index - }, - updateHomePagePath(newPath: string) { - this.list[0].pagePath = newPath - // 更新 list 后存储到小程序本地存储 - Taro.setStorageSync('list', this.list) - } - }, - getters: { - getSelected: (state) => state.selected, - getList: (state) => state.list - }, - persist: { - // key: 'my-store', // 存储到 localStorage 的 key - // storage: localStorage, // 持久化方式为 localStorage - // paths: ['list'] // 持久化 list - } -}) +import {createPinia} from 'pinia' +export const pinia = createPinia() diff --git a/collect_information/src/store/tabBarStore.ts b/collect_information/src/store/tabBarStore.ts new file mode 100644 index 0000000..accf8c3 --- /dev/null +++ b/collect_information/src/store/tabBarStore.ts @@ -0,0 +1,14 @@ +import {defineStore} from "pinia"; +import {ref} from "vue"; + +export const useTabBarStore = defineStore('tabBar', () => { + const selected = ref(0) + const setSelected = (index: number) => { + selected.value = index; + } + + return { + selected, + setSelected + } +}) diff --git a/collect_information/src/store/userStore.ts b/collect_information/src/store/userStore.ts index e69de29..2dafcb3 100644 --- a/collect_information/src/store/userStore.ts +++ b/collect_information/src/store/userStore.ts @@ -0,0 +1,40 @@ +import {defineStore} from "pinia"; +import {ref} from "vue"; +import Taro from "@tarojs/taro"; + +export const useUserStore = defineStore('userStore', () => { + /** 获取token信息 **/ + const getTokenInfo = (): TokenInfo | null => { + const ti = Taro.getStorageSync('tokenInfo') + // 如果 ti 存在且不是空字符串,则返回 ti,否则返回 null + return (ti !== undefined && ti !== null && ti !== '') ? ti : null; + } + /** 用户token信息 **/ + const tokenInfo = ref(getTokenInfo()) + /** 保存token信息 **/ + const saveTokenInfo = (t: TokenInfo) => { + tokenInfo.value = t; + Taro.setStorageSync('tokenInfo', tokenInfo.value) + } + /** 清楚token信息 */ + const clearTokenInfo = () => { + tokenInfo.value = null + Taro.removeStorageSync('tokenInfo') + } + + + /** + * 重置用户数据 + * 一般用于用户退出登录 重置所有相关数据 + */ + const resetUserInfo = () => { + clearTokenInfo() + } + + return { + tokenInfo, + saveTokenInfo, + getTokenInfo, + resetUserInfo + } +}) diff --git a/collect_information/src/subPages/pages/form/form.config.ts b/collect_information/src/subPages/pages/form/form.config.ts deleted file mode 100644 index 7652664..0000000 --- a/collect_information/src/subPages/pages/form/form.config.ts +++ /dev/null @@ -1,3 +0,0 @@ -export default definePageConfig({ - navigationBarTitleText: '项目人员录入', -}) diff --git a/collect_information/src/subPages/pages/form/form.scss b/collect_information/src/subPages/pages/form/form.scss deleted file mode 100644 index 93df7ae..0000000 --- a/collect_information/src/subPages/pages/form/form.scss +++ /dev/null @@ -1,8 +0,0 @@ -.form{ - .formButton{ - display: flex; - margin-top: auto; - justify-content: space-around; - margin-bottom: 30px - } -} diff --git a/collect_information/src/subPages/pages/myProject/myproject.config.ts b/collect_information/src/subPages/pages/myProject/myproject.config.ts deleted file mode 100644 index 7bccd60..0000000 --- a/collect_information/src/subPages/pages/myProject/myproject.config.ts +++ /dev/null @@ -1,3 +0,0 @@ -export default definePageConfig({ - navigationBarTitleText: '我的项目', -}) diff --git a/collect_information/src/subPages/pages/myProject/myproject.scss b/collect_information/src/subPages/pages/myProject/myproject.scss deleted file mode 100644 index 867ee38..0000000 --- a/collect_information/src/subPages/pages/myProject/myproject.scss +++ /dev/null @@ -1,31 +0,0 @@ -.myProject{ - height: 100vh; - overflow: hidden; - background: #f1f1f1; - .myProjectItem{ - //height: 20%; - margin: 20px; - border-radius: 10px; - background: #ffffff; - padding: 15px; - font-size: 28px; - line-height: 50px; - color: #333333; - .myProjectIndex{ - color: #9b9b9f; - } - .project{ - display: flex; - justify-content: space-between; - flex-flow: wrap; - text-align: center; - view{ - width: 45%; - height: 100rpx; - border: 1px solid #cccccc; - line-height: 100rpx; - margin: 8px 0 8px 0; - } - } - } -} diff --git a/collect_information/src/subPages/pages/policeManager/index.scss b/collect_information/src/subPages/police/myEnterprisesUnit/myEnterprisesUnit.scss similarity index 99% rename from collect_information/src/subPages/pages/policeManager/index.scss rename to collect_information/src/subPages/police/myEnterprisesUnit/myEnterprisesUnit.scss index b1dd448..1cab77b 100644 --- a/collect_information/src/subPages/pages/policeManager/index.scss +++ b/collect_information/src/subPages/police/myEnterprisesUnit/myEnterprisesUnit.scss @@ -32,4 +32,3 @@ page { } } } - diff --git a/collect_information/src/subPages/pages/policeManager/index.config.ts b/collect_information/src/subPages/police/myEnterprisesUnit/myEnterprisesUnit.ts similarity index 98% rename from collect_information/src/subPages/pages/policeManager/index.config.ts rename to collect_information/src/subPages/police/myEnterprisesUnit/myEnterprisesUnit.ts index 30c5ed6..db6b2a1 100644 --- a/collect_information/src/subPages/pages/policeManager/index.config.ts +++ b/collect_information/src/subPages/police/myEnterprisesUnit/myEnterprisesUnit.ts @@ -1,4 +1,3 @@ export default definePageConfig({ navigationBarTitleText: '企事业单位', - }) diff --git a/collect_information/src/subPages/pages/policeManager/index.vue b/collect_information/src/subPages/police/myEnterprisesUnit/myEnterprisesUnit.vue similarity index 66% rename from collect_information/src/subPages/pages/policeManager/index.vue rename to collect_information/src/subPages/police/myEnterprisesUnit/myEnterprisesUnit.vue index e8d67a4..b1cb95e 100644 --- a/collect_information/src/subPages/pages/policeManager/index.vue +++ b/collect_information/src/subPages/police/myEnterprisesUnit/myEnterprisesUnit.vue @@ -13,8 +13,9 @@ 电话:{{ item?.contactPersonInfo.telephone }} - - {{ items.name }} + + {{ serviceProject.name }} @@ -25,33 +26,21 @@ import api from "@/request/index"; import {onMounted, ref} from "vue"; import Taro from "@tarojs/taro"; -import './index.scss' +import './myEnterprisesUnit.scss' +import {MyProjectList, ServiceProjectList} from "@/types/subPages/projectManager/myProject"; const myProjectList = ref() const getMyServiceProject = async () => { - const token = Taro.getStorageSync('token') - const resp = await api.get(`/policeIndex/getUnitServiceProjectList`, { - token: token.value - }) - + const resp = await api.get(`/policeIndex/getUnitServiceProjectList`) myProjectList.value = resp.data - console.log(resp.data) } -const projectClick = (items: ServiceProjectList, name: string) => { - console.log(name, JSON.stringify(items)) +const projectClick = (enterprisesUnitName: string, serviceProject: ServiceProjectList) => { Taro.navigateTo({ - - url: `/subPages/pages/policeDetails/index?name=${name}&item=${JSON.stringify(items)}`, + url: `/subPages/police/myEnterprisesUnit/projectDetails/projectDetails?enterprisesUnitName=${enterprisesUnitName}&serviceProject=${JSON.stringify(serviceProject)}`, }) } onMounted(async () => { await getMyServiceProject() }) - - - - - - diff --git a/collect_information/src/subPages/pages/policeDetails/index.scss b/collect_information/src/subPages/police/myEnterprisesUnit/projectDetails/projectDetails.scss similarity index 79% rename from collect_information/src/subPages/pages/policeDetails/index.scss rename to collect_information/src/subPages/police/myEnterprisesUnit/projectDetails/projectDetails.scss index 3bddb3c..ef412c6 100644 --- a/collect_information/src/subPages/pages/policeDetails/index.scss +++ b/collect_information/src/subPages/police/myEnterprisesUnit/projectDetails/projectDetails.scss @@ -1,10 +1,11 @@ -.projectDetails{ +.projectDetails { height: 100vh; overflow: hidden; background: #f1f1f1; display: flex; flex-direction: column; - .projectDetailsItem{ + + .projectDetailsItem { margin: 10px 20px 10px 20px; border-radius: 10px; background: #ffffff; @@ -12,19 +13,23 @@ font-size: 28px; line-height: 65px; color: #333333; - .projectDetailsIndex{ + + .projectDetailsIndex { display: flex; flex-wrap: wrap; line-height: 44rpx; margin-bottom: 20px; - .content{ - color: #9b9b9f; + + .content { + color: #9b9b9f; } } } - .projectDetailsTableDrop{ + + .projectDetailsTableDrop { height: 80%; - .projectDetailsTable{ + + .projectDetailsTable { margin: 20px; border-radius: 10px; background: #ffffff; @@ -32,18 +37,21 @@ font-size: 28px; line-height: 50px; color: #333333; - .projectDetailsTableItem{ + + .projectDetailsTableItem { //display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; font-size: 24px; margin-bottom: 15px; - .projectDetailsTableIndex{ + + .projectDetailsTableIndex { display: flex; justify-content: flex-end; text-align: center; - view{ + + view { width: 70px; margin-right: 20px; } @@ -51,7 +59,8 @@ } } } - .projectDetailsButton{ + + .projectDetailsButton { position: fixed; bottom: 19px; display: flex; @@ -60,12 +69,11 @@ right: 0; width: 100%; } - .nutPopup{ + + .nutPopup { width: 300px; height: 100px; display: flex; flex-wrap: wrap; } } - - diff --git a/collect_information/src/subPages/pages/projectDetails/projectDetails.config.ts b/collect_information/src/subPages/police/myEnterprisesUnit/projectDetails/projectDetails.ts similarity index 98% rename from collect_information/src/subPages/pages/projectDetails/projectDetails.config.ts rename to collect_information/src/subPages/police/myEnterprisesUnit/projectDetails/projectDetails.ts index c155561..463c9fb 100644 --- a/collect_information/src/subPages/pages/projectDetails/projectDetails.config.ts +++ b/collect_information/src/subPages/police/myEnterprisesUnit/projectDetails/projectDetails.ts @@ -1,4 +1,3 @@ export default definePageConfig({ navigationBarTitleText: '项目详情', - }) diff --git a/collect_information/src/subPages/pages/policeDetails/index.vue b/collect_information/src/subPages/police/myEnterprisesUnit/projectDetails/projectDetails.vue similarity index 66% rename from collect_information/src/subPages/pages/policeDetails/index.vue rename to collect_information/src/subPages/police/myEnterprisesUnit/projectDetails/projectDetails.vue index c6d5ba6..b68a6cc 100644 --- a/collect_information/src/subPages/pages/policeDetails/index.vue +++ b/collect_information/src/subPages/police/myEnterprisesUnit/projectDetails/projectDetails.vue @@ -3,14 +3,14 @@ - {{ nameValue ? nameValue : '' }}{{ '-----' + detailsList?.name }}项目 + {{ enterprisesUnitName }}-----{{ serviceProject?.name }}项目 - 经理名称:{{ detailsList?.projectManagerMiniProgramUserInfo.name }} + 经理名称:{{ serviceProject?.projectManagerMiniProgramUserInfo.name }} - 手机号:{{ detailsList?.projectManagerMiniProgramUserInfo.telephone }} + 手机号:{{ serviceProject?.projectManagerMiniProgramUserInfo.telephone }} @@ -18,28 +18,28 @@ - 保安证件号:{{ detailsList?.idNumber }} + 保安证件号:{{ serviceProject?.idNumber }} - 工作人员数量:{{ detailsList?.staffTotal }} + 工作人员数量:{{ serviceProject?.staffTotal }} - 保安人员数量:{{ detailsList?.securityUserTotal }} + 保安人员数量:{{ serviceProject?.securityUserTotal }} - 服务区域面积:{{ detailsList?.serviceArea }} + 服务区域面积:{{ serviceProject?.serviceArea }} - 楼栋数量:{{ detailsList?.buildingTotal }} + 楼栋数量:{{ serviceProject?.buildingTotal }} - 户数:{{ detailsList?.houseTotal }} + 户数:{{ serviceProject?.houseTotal }} @@ -51,7 +51,7 @@ :scroll-into-view="toView" :scroll-top="scrollTop" :refresherEnabled="true" @refresherrefresh="onRefresherRefresh" :refresher-triggered="isRefresher" > - + @@ -79,17 +79,19 @@ - diff --git a/collect_information/src/subPages/projectManager/myProject/myProject.scss b/collect_information/src/subPages/projectManager/myProject/myProject.scss new file mode 100644 index 0000000..d94d1d9 --- /dev/null +++ b/collect_information/src/subPages/projectManager/myProject/myProject.scss @@ -0,0 +1,35 @@ +.myProject { + height: 100vh; + overflow: hidden; + background: #f1f1f1; + + .myProjectItem { + //height: 20%; + margin: 20px; + border-radius: 10px; + background: #ffffff; + padding: 15px; + font-size: 28px; + line-height: 50px; + color: #333333; + + .myProjectIndex { + color: #9b9b9f; + } + + .project { + display: flex; + justify-content: space-between; + flex-flow: wrap; + text-align: center; + + view { + width: 45%; + height: 100rpx; + border: 1px solid #cccccc; + line-height: 100rpx; + margin: 8px 0 8px 0; + } + } + } +} diff --git a/collect_information/src/subPages/projectManager/myProject/myProject.ts b/collect_information/src/subPages/projectManager/myProject/myProject.ts new file mode 100644 index 0000000..7d4dae7 --- /dev/null +++ b/collect_information/src/subPages/projectManager/myProject/myProject.ts @@ -0,0 +1,3 @@ +export default definePageConfig({ + navigationBarTitleText: '我的项目', +}) diff --git a/collect_information/src/subPages/pages/myProject/myProject.vue b/collect_information/src/subPages/projectManager/myProject/myProject.vue similarity index 64% rename from collect_information/src/subPages/pages/myProject/myProject.vue rename to collect_information/src/subPages/projectManager/myProject/myProject.vue index 32eadff..8cdf561 100644 --- a/collect_information/src/subPages/pages/myProject/myProject.vue +++ b/collect_information/src/subPages/projectManager/myProject/myProject.vue @@ -1,10 +1,9 @@