From 00f06e76f8c9427a44160cb5015efe8b2c3542f9 Mon Sep 17 00:00:00 2001 From: lion <120344285@qq.com> Date: Wed, 21 Aug 2024 00:51:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/face.png | Bin 0 -> 1033 bytes src/layout/components/Navbar.vue | 42 ++++++--- src/mixin/selectMixin.js | 35 +++++--- src/store/modules/user.js | 28 +++++- src/utils/auth.js | 3 +- src/utils/common.js | 11 +++ src/utils/request.js | 7 +- src/views/book/appointment.vue | 19 ++++- src/views/book/components/addAppointment.vue | 80 ++++++++++++------ src/views/book/count.vue | 2 +- src/views/component/imports.vue | 71 +++++++++------- src/views/course/apply.vue | 6 +- src/views/course/attendance.vue | 12 ++- src/views/course/class.vue | 6 +- src/views/course/components/addCourse.vue | 47 ++++++++-- src/views/course/components/addTypes.vue | 14 +-- src/views/course/components/checkPay.vue | 4 +- .../course/components/showAttendance.vue | 7 +- src/views/course/history.vue | 10 +-- src/views/course/index.vue | 36 ++++---- src/views/course/pay.vue | 4 +- src/views/course/txl.vue | 19 ++++- src/views/login/index.vue | 41 +++++---- src/views/student/components/detail.vue | 76 ++++++++++++----- src/views/student/index.vue | 15 +++- src/views/student/search.vue | 9 +- 26 files changed, 419 insertions(+), 185 deletions(-) create mode 100644 src/assets/face.png diff --git a/src/assets/face.png b/src/assets/face.png new file mode 100644 index 0000000000000000000000000000000000000000..072dc07edd8df9e9e4ce63707a144b22d7dad615 GIT binary patch literal 1033 zcmV+k1or!hP)NH5 z+VsJ^SOTRKs`%nZkmR96YeG!uLqXQKG5CR@sU%UObxr2}%el@jGm|^Bn*)d3y_vbc zIsbF+xz{2Iw@nW8=wEtX0kkO3yg@Qg@^zA%Xfvgt+^9Ocsgsi-2X};lDRAeQgwv=BC4dvc_el)Q*mWN9>pb_^6z-ASqWSn~=%v z*Pyc1CmZnW#w^DF_zm~&OoXY@PVfMLFXDn$_VeI$s zu((hPicrQyDsGm&meZwgGN(XRHNF%G(|NHXNNs2h&ASs&PO7vsOiF>)KeH|nR*`pg zLulnX<4%e2wQ5!Q_`yt7VCmtU`F(iCJ0!vu&zt^zW)b(NiZU4rynEwHHAy8(ox@bM z&8-#}F>&!kAZ&c_1Qs4YstOdAHQx7AiDbN%=DeaViF9)otI`{!R4{+{7N!a#`0v5Y z(yA;s2YTk8$Ud9}(4?b+S^s!q4W4^>C+vk1=4bBU{`4&<+lCd3p|LrOcrt~lE5n%k z=Y}zNx?rCEo{f>bMzTpuX}h3KLr$b#z@|6%!-_<;d}(Ym%G$VbD++@rF;y51?6snP z#A#{9{6(X6XzBQ{0;^`Nx%ZJ++vtzV?L!eLoDE9y^RMJQt*jQyw7q4Lvh3#~v^WTb zqC3j+c+L7P%YunDtZy+%DOLnnVcXca$0F&$` zIqG>p5x4&u(3NQ~Jn?zS=+eB4!{1!`-<`Ep3e&;_sQn0p<{$LYM0Ae`^qr*?=;!Hhx@3w+xe;*Kt709Mp> z%`n~C`kY(WShWaX=qQej$qm8}3j&IZyxU2BLULjm(#o^)&i2kjKUQS)RB-@MT#@|Q zso -
- +
+
+ + {{userName}} +
+
@@ -36,7 +40,7 @@ } from 'vuex' import Breadcrumb from '@/components/Breadcrumb' import Hamburger from '@/components/Hamburger' - + import state from '@/store/modules/user.js' export default { components: { Breadcrumb, @@ -47,6 +51,15 @@ 'sidebar', 'avatar' ]) + }, + data(){ + return{ + userName:'' + } + }, + created(){ + console.log("state",state) + this.userName = state.state.name?state.state.name:'' }, methods: { toggleSideBar() { @@ -88,7 +101,7 @@ .right-menu { float: right; height: 100%; - line-height: 50px; + line-height: 46px; &:focus { outline: none; @@ -116,21 +129,26 @@ margin-right: 30px; .avatar-wrapper { - margin-top: 5px; + // margin-top: 5px; position: relative; - + display:flex; + align-items: center; + color:#3c4758; .user-avatar { cursor: pointer; - width: 40px; - height: 40px; - border-radius: 10px; + width: 30px; + height: 30px; + border-radius: 10px; + vertical-align: middle; + margin-right: 10px; } .el-icon-caret-bottom { cursor: pointer; - position: absolute; - right: -20px; - top: 25px; + // position: absolute; + // right: -20px; + // top: 25px; + font-size: 12px; } } diff --git a/src/mixin/selectMixin.js b/src/mixin/selectMixin.js index 6913cd3..2df8bef 100644 --- a/src/mixin/selectMixin.js +++ b/src/mixin/selectMixin.js @@ -19,12 +19,12 @@ export default { }], false_or_true: [{ id: 0, - value: '否', - type:'info' + value: '否', + type: 'info' }, { id: 1, - value: '是', - type:'' + value: '是', + type: '' }], apply_status_list: [{ id: 0, @@ -78,14 +78,21 @@ export default { type: '' }], course_date: [{ + value: '课程待定', + type: 'info', + id: 30, + }, { value: '课程未开始', type: 'info', + id: 20, }, { value: '课程进行中', type: '', + id: 10, }, { value: '课程已结束', type: 'success', + id: 40, }], // 学员 @@ -114,19 +121,19 @@ export default { // is_vip_list: [{ id: 0, - value: '普通学员', - type:'' + value: '普通学员', + type: '' }, { id: 1, value: 'vip学员' - }], - is_schoolmate_list: [{ - id: 0, - value: '否', - type:'' - }, { - id: 1, - value: '是' + }], + is_schoolmate_list: [{ + id: 0, + value: '否', + type: '' + }, { + id: 1, + value: '是' }], company_type_list: [{ id: 0, diff --git a/src/store/modules/user.js b/src/store/modules/user.js index c288974..9b1d0e5 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -1,7 +1,8 @@ import { login, logout, - getInfo + getInfo, + loginMsg } from '@/api/user' import { getToken, @@ -67,6 +68,31 @@ const actions = { reject(error) }) }) + }, + loginMsg({ + commit + }, userInfo) { + const { + mobile, + code + } = userInfo + return new Promise((resolve, reject) => { + loginMsg({ + mobile: mobile, + code: code + }).then(response => { + console.log(response) + const { + data + } = response; + console.log(response.access_token) + commit('SET_TOKEN', response.access_token) + setToken(response.access_token) + resolve() + }).catch(error => { + reject(error) + }) + }) }, // get user info diff --git a/src/utils/auth.js b/src/utils/auth.js index 7ce33e8..d11e676 100644 --- a/src/utils/auth.js +++ b/src/utils/auth.js @@ -5,7 +5,8 @@ export function getToken() { return Cookies.get(TOKEN_KEY) } -export function setToken(token) { +export function setToken(token,callback) { + console.log("set",TOKEN_KEY, token) return Cookies.set(TOKEN_KEY, token) } diff --git a/src/utils/common.js b/src/utils/common.js index e6c9fbe..24c83fb 100644 --- a/src/utils/common.js +++ b/src/utils/common.js @@ -1,4 +1,15 @@ +import { + Message +} from 'element-ui' let base = { + showMessage(msg,type){ + return Message({ + message: msg, + type: type, + duration: 2 * 1000, + offset: window.screen.height / 4 + }) + }, isPhone (val) { return /^[1][3,4,5,6,7,8,9][0-9]{9}$/.test(val) }, diff --git a/src/utils/request.js b/src/utils/request.js index ab840ea..a3aafa8 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -71,7 +71,8 @@ service.interceptors.response.use( Message({ message: res.errmsg || 'Error', type: 'error', - duration: 5 * 1000 + duration: 5 * 1000, + offset: window.screen.height / 4 }) // 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired; @@ -98,10 +99,12 @@ service.interceptors.response.use( loading?.close() } console.log('err' + error) // for debug + console.log("window.screen.height / 2",window.screen.height / 4) Message({ message: error.message, type: 'error', - duration: 5 * 1000 + duration: 5 * 1000, + offset: window.screen.height / 4 }) return Promise.reject(error) } diff --git a/src/views/book/appointment.vue b/src/views/book/appointment.vue index ca0089a..04d42c2 100644 --- a/src/views/book/appointment.vue +++ b/src/views/book/appointment.vue @@ -34,9 +34,19 @@
+ +