From c73689a26a7ea47988940a5ec40a40b5bdf7b79b Mon Sep 17 00:00:00 2001 From: bibi <541660090@qq.com> Date: Wed, 16 Feb 2022 15:56:26 +0800 Subject: [PATCH] 1 --- src/api/basic/console/index.js | 8 + src/components/allCity/index.vue | 40 ++ src/main.js | 2 + src/mixins/index.js | 4 +- src/permission.js | 4 +- src/store/actions.js | 3 + src/store/getters.js | 3 + src/store/mutations.js | 3 + src/store/state.js | 3 +- src/views/Basic/home/index.vue | 691 +++++++++++++++++-------------- src/views/Basic/home/settled.vue | 6 +- src/views/Login/index.vue | 9 + 12 files changed, 461 insertions(+), 315 deletions(-) create mode 100644 src/components/allCity/index.vue diff --git a/src/api/basic/console/index.js b/src/api/basic/console/index.js index f985d69..add5ec2 100644 --- a/src/api/basic/console/index.js +++ b/src/api/basic/console/index.js @@ -16,3 +16,11 @@ export function settledInsert(params) { data: params, }) } +// 新增小区 +export function communityInsert(params) { + return httpService({ + url: `/user/community/insert`, + method: 'post', + data: params, + }) +} diff --git a/src/components/allCity/index.vue b/src/components/allCity/index.vue new file mode 100644 index 0000000..9b1255e --- /dev/null +++ b/src/components/allCity/index.vue @@ -0,0 +1,40 @@ + + + + + \ No newline at end of file diff --git a/src/main.js b/src/main.js index 747a463..6bfd399 100644 --- a/src/main.js +++ b/src/main.js @@ -22,10 +22,12 @@ import router from "@/permission"; Vue.config.productionTip = false import commonTable from './components/table' import commonUpload from './components/upload/index.vue' +import allCity from './components/allCity/index.vue' // 注册组件 Vue.component('commonTable', commonTable) Vue.component('commonUpload', commonUpload) +Vue.component('allCity', allCity) router.beforeEach((to, from, next) => { // 让页面回到顶部 diff --git a/src/mixins/index.js b/src/mixins/index.js index f0e6b28..13b3daa 100644 --- a/src/mixins/index.js +++ b/src/mixins/index.js @@ -12,10 +12,10 @@ export default { install(Vue) { Vue.mixin({ computed: { - ...mapGetters(['getToken','getSelectedKeys', 'getOpenKeys']) + ...mapGetters(['getToken','getSelectedKeys', 'getOpenKeys','getCity']) }, methods: { - ...mapActions(['setToken','setSelectedKeys', 'setOpenKeys']) + ...mapActions(['setToken','setSelectedKeys', 'setOpenKeys','setCity']) } }) } diff --git a/src/permission.js b/src/permission.js index a9ca5e2..ec8fc1c 100644 --- a/src/permission.js +++ b/src/permission.js @@ -3,13 +3,15 @@ import "nprogress/nprogress.css" import router from "@/router" import store from '@/store' + const whitePath = [ '/login'] // 判断登录 router.beforeEach((to, from, next) => { NProgress.start() const token = store.getters.getToken; - if(!token && !whitePath.includes(to.path)) { + if (!token && !whitePath.includes(to.path)) { next('/login'); + } else { next(); NProgress.done() diff --git a/src/store/actions.js b/src/store/actions.js index 7707b09..21078fb 100644 --- a/src/store/actions.js +++ b/src/store/actions.js @@ -16,6 +16,9 @@ const actions = { setOpenKeys: ({commit}, log) => { commit('setOpenKeys', log) }, + setCity: ({commit}, log) => { + commit('setCity', log) + }, } export default actions \ No newline at end of file diff --git a/src/store/getters.js b/src/store/getters.js index 3afdcb1..938d8a2 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -16,6 +16,9 @@ const getters = { getToken(state) { return state.token }, + getCity(state) { + return state.cityList + }, } export default getters \ No newline at end of file diff --git a/src/store/mutations.js b/src/store/mutations.js index ef4d578..68b9ce0 100644 --- a/src/store/mutations.js +++ b/src/store/mutations.js @@ -21,6 +21,9 @@ const mutations = { state.token = log; sessionStorage.setItem('token', log); }, + setCity (state, data) { // 设置参数 + state.cityList = data + } } export default mutations \ No newline at end of file diff --git a/src/store/state.js b/src/store/state.js index 4ae39e5..96a9fe6 100644 --- a/src/store/state.js +++ b/src/store/state.js @@ -12,6 +12,7 @@ const state = { token: sessionStorage.getItem('token') || "", Info: { name:'11' - } + }, + cityList:[] } export default state \ No newline at end of file diff --git a/src/views/Basic/home/index.vue b/src/views/Basic/home/index.vue index b7fc967..a1f52c0 100644 --- a/src/views/Basic/home/index.vue +++ b/src/views/Basic/home/index.vue @@ -1,223 +1,284 @@ + + +
+ 点击新建订单 +
+
+ +
+
当前无订单
+
请购买后台功能
+ 点击新建订单 +
+ + + - +
+
小区信息
+ -
-
小区信息
- - - - - - - - - 要求文件大小不超过5mb,支持jpg、png格式 - - -
+
-
-
-
-
-
+ + + + + + + + + + + 要求文件大小不超过5mb,支持jpg、png格式 + + + + + + +
+
@@ -232,136 +293,154 @@ export default { padding-left: 40px; } .top { - width: 100%; - display: flex; - background: #fff; - height: 132px; - line-height: 132px; - justify-content: space-between; - .top-a{ - font-weight:500; - font-size:20px; - color:#000000; - line-height: 20px; - margin-top: 40px; - height: 30px; + width: 100%; + display: flex; + background: #fff; + height: 132px; + line-height: 132px; + justify-content: space-between; + .top-a { + font-weight: 500; + font-size: 20px; + color: #000000; + line-height: 20px; + margin-top: 40px; + height: 30px; + } + .top-b { + color: #000000a6; + line-height: 20px; + height: 20px; + } + .top-c { + margin-right: 30px; + } +} +.card-a { + background: #fff; + margin-right: 24px; + padding-top: 10px; + min-height: 600px; + .card-a-content { + color: #00000073; + font-size: 14px; + padding: 13px; + .cardBox { + display: flex; + flex-direction: row; + flex-wrap: wrap; + // justify-content:; + .card-add { + width: 30%; + margin: 10px; + border: 1px dashed #9db7df; + border-radius: 3%; + } + /deep/.ant-card-body { + padding-bottom: 50px; + min-height: 170px; + } + /deep/.ant-card { + position: relative; + } + /deep/.ant-card-actions { + position: absolute; + bottom: 0; + width: 100%; + // margin-top: 50px; + } + .card-a-content-add { + color: #9db7df; + font-size: 16px; + cursor: pointer; + text-align: center; + vertical-align: middle; + line-height: 72px; + } } - .top-b{ - color:#000000A6 ; - line-height: 20px; - height: 20px; + } +} +.card-b { + background: #fff; + padding-top: 10px; + min-height: 600px; + .card-b-content { + margin-top: 150px; + color: #00000073; + font-size: 14px; + text-align: center; + /deep/.ant-card-head { + background: #205fbd1a; } - .top-c{ - margin-right:30px + } + .cardBox { + // text-align: center; + /deep/.ant-card-head { + background: #205fbd1a; } -} -.card-a{ - background: #fff; - margin-right:24px; - padding-top:10px; - min-height: 600px; - .card-a-content{ - color: #00000073; - font-size: 14px; - padding: 13px; - .cardBox{ - display: flex; - flex-direction:row; - flex-wrap: wrap; - // justify-content:; - .card-add{ - width: 30%; - margin:10px; - border:1px dashed #9DB7DF; - border-radius: 3%; - } - /deep/.ant-card-body{ - padding-bottom: 50px; - min-height: 170px; - } - /deep/.ant-card { - position: relative; - } - /deep/.ant-card-actions{ - position: absolute; - bottom: 0; - width: 100%; - // margin-top: 50px; - } - .card-a-content-add{ - color:#9DB7DF; - font-size:16px; - cursor:pointer; - text-align: center; - vertical-align: middle; - line-height: 72px; - } - } + /deep/.ant-card-head-title { + font-size: 16px; + color: #000000a6; } -} -.card-b{ - background: #fff; - padding-top:10px; - min-height: 600px; - .card-b-content{ - margin-top:150px; - color: #00000073; - font-size: 14px; - text-align: center; - /deep/.ant-card-head{ - background: #205FBD1A; - } + .functionBox { + display: flex; + justify-content: flex-start; + flex-wrap: wrap; + width: 90%; + .functionList { + color: #1f519b; + border: 1px solid #1f519b; + border-radius: 5%; + margin: 2px; + padding: 2px; + white-space: nowrap; + } } - .cardBox{ - // text-align: center; - /deep/.ant-card-head{ - background: #205FBD1A; - } - /deep/.ant-card-head-title{ - font-size: 16px; - color: #000000A6; - } - .functionBox{ - display: flex; - justify-content: flex-start; - flex-wrap: wrap; - width: 90%; - .functionList{ - color: #1F519B; - border:1px solid #1F519B; - border-radius: 5%; - margin: 2px; - padding:2px; - white-space: nowrap; - } - } - .addOrder{ - border:1px dashed #9DB7DF; - border-radius: 3%; - width: 80%; - height: 200px; - margin:auto; - margin-top:20px; - .card-b-content-add{ - color:#9DB7DF; - font-size:16px; - cursor:pointer; - text-align: center; - vertical-align: middle; - line-height: 72px; - } - } + .addOrder { + border: 1px dashed #9db7df; + border-radius: 3%; + width: 80%; + height: 200px; + margin: auto; + margin-top: 20px; } + } } -.uploadImg{ - background: #0000000A; - border:2px solid #00000029; +.uploadImg { + background: #0000000a; + border: 2px solid #00000029; color: #00000029; width: 180px; height: 120px; text-align: center; line-height: 110px; - font-size:60px; + font-size: 60px; cursor: pointer; } +.card-b-content-add { + color: #9db7df; + font-size: 16px; + cursor: pointer; + text-align: center; + vertical-align: middle; + line-height: 72px; +} +.com-name { + font-size: 20px; + font-weight: 500; + line-height: 26px; + color: #000000; +} +.com-sta { + font-size: 14px; + font-weight: 400; + line-height: 30px; + color: #5bc980; +} +.com-conta { + line-height: 30px; + font-size: 14px; + font-weight: 400; + color: #000000; +} diff --git a/src/views/Basic/home/settled.vue b/src/views/Basic/home/settled.vue index f9697a3..44d92ba 100644 --- a/src/views/Basic/home/settled.vue +++ b/src/views/Basic/home/settled.vue @@ -282,9 +282,5 @@ export default { /deep/.ant-col .ant-form-item-label { margin-top: -10px; } -.com-name{ - font-size: 20px; - font-weight: 500; - line-height: 26px; -} + \ No newline at end of file diff --git a/src/views/Login/index.vue b/src/views/Login/index.vue index 23cd763..9dc582f 100644 --- a/src/views/Login/index.vue +++ b/src/views/Login/index.vue @@ -196,6 +196,7 @@ import { sendRegisterCode, userInfo } from "@/api/public/login"; +import { allCity } from "@/api/public" import { form, registerForm, registerRules } from './depend/config' export default { name: "Login", @@ -224,6 +225,7 @@ export default { this.$message.success(res.msg); // 存储token this.setToken(res.data); + this.gettheCity() userInfo().then(res =>{ console.log(res.data); sessionStorage.setItem('info',JSON.stringify(res.data)) @@ -240,6 +242,7 @@ export default { this.$message.success(res.msg); // 存储token this.setToken(res.data); + this.gettheCity() userInfo().then(res =>{ sessionStorage.setItem('info',JSON.stringify(res.data)) }) @@ -286,6 +289,12 @@ export default { resetForm() { this.$refs.ruleForm.resetFields(); }, + // 存城市 + gettheCity(){ + allCity().then(res => { + this.setCity(res.data); + }) + } }, };