luohailiang hace 2 años
padre
commit
c9741e2b61

+ 165 - 0
src/pages/jsd/personal/change_pwd.vue

@@ -0,0 +1,165 @@
+<template>
+<div class="main bg-white-grey pl-25px pt-30px pr-35px h-640px rounded-10px relative">
+  <div class="flex items-center justify-between">
+    <h3 class="nav-title">修改密码</h3>
+    <div class="btnDiv">
+      <el-button size="large" @click="linkTo('jsd_personal_wdkc')" class="w-100px">返回
+      </el-button>
+    </div>
+  </div>
+  <div class="form-box">
+    <el-form :model="form" label-position="top" ref="formRef" :rules="rules">
+      <el-form-item label="原密码" prop="old_pwd">
+        <el-input type="password" v-model="form.old_pwd" placeholder="请输入原密码" />
+      </el-form-item>
+      <el-form-item label="新密码" prop="new_pwd">
+        <el-input type="password" v-model="form.new_pwd" placeholder="请输入新密码" />
+      </el-form-item>
+    </el-form>
+    <div class="mt-70px btnDiv text-center">
+      <el-button size="large" @click="submitForm"  v-loading.fullscreen.lock="loading" class="w-160px">确定</el-button>
+    </div>
+  </div>
+
+
+</div>
+</template>
+
+<script setup>
+import { ElMessage } from "element-plus";
+import { useRouter } from "vue-router";
+const router = useRouter();
+const linkTo = (name) => {
+  router.push({ name });
+};
+let loading = $ref(false)
+let formRef = $ref();
+let form = $ref({
+  old_pwd:'',
+  new_pwd:''
+})
+const rules = {
+  old_pwd:[{ required: true, message: "请输入原密码", trigger: "submit" }],
+  new_pwd:[{ required: true, message: "请输入新密码", trigger: "submit" }]
+}
+function submitForm() {
+  formRef.validate().then(res=>{
+    if(res === true) {
+      if(form.old_pwd === form.new_pwd) {
+        ElMessage.warning("新旧密码不能相同!");
+      } else {
+        loading = true
+        const submitData = {
+          user_password_old:form.old_pwd,
+          user_password_new:form.new_pwd
+        }
+        request({
+          url:'/user/main/reset_my_password',
+          data:{
+            user_main:submitData
+          }
+        }).then(res=>{
+          loading = false;
+          if(res.code === '1') {
+            ElMessage.success("密码修改成功!");
+
+          }
+        })
+      }
+    }
+  })
+}
+</script>
+
+<style lang="scss" scoped>
+$color: #1259a1;
+.main {
+  box-shadow: 0 10px 24px rgba(161, 153, 168, 0.18);
+}
+.bg-white-grey{
+  background: #fcfeff;
+}
+.nav-title{
+  font-size: 18px;
+  color: $color;
+}
+.btnDiv {
+  .el-button {
+    background: $color;
+    border-color: $color;
+    color: #fff;
+  }
+}
+</style>
+<style lang="scss">
+.form-box{
+  width: 520px;
+  margin: 25px auto;
+  .el-form {
+    .el-form-item {
+      &.is-required {
+        .el-form-item__label {
+          &::before {
+            display: none;
+          }
+
+          &::after {
+            content: "*";
+            color: #f35421;
+            margin-left: 4px;
+          }
+        }
+      }
+
+      .el-form-item__label {
+        color: #949494;
+        font-size: 14px;
+        position: relative;
+      }
+
+      .el-form-item__content {
+        .el-select {
+          width: 100%;
+        }
+
+        .el-input {
+          width: 100%;
+
+          .el-input__wrapper {
+            width: 100%;
+            box-shadow: none;
+            background: #f9f9f9;
+            border-radius: 6px;
+          }
+        }
+
+        .el-textarea {
+          .el-textarea__inner {
+            box-shadow: none;
+            background: #f9f9f9;
+            border-radius: 6px;
+            // color: #d0d0d0;
+          }
+        }
+
+        .el-date-editor {
+          box-shadow: none;
+          background: #f9f9f9;
+          border-radius: 6px;
+        }
+
+        .el-checkbox.read {
+          .el-checkbox__inner {
+            border-radius: 50%;
+          }
+        }
+
+        .el-input__inner {
+          // color: #d0d0d0;
+        }
+      }
+    }
+
+  }
+}
+</style>

+ 2 - 2
src/pages/jsd/personal/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="">
-    <div class="main bg-white px-4 pt-8 rounded-6px relative">
+    <div class="main bg-white px-4 pt-8 rounded-10px relative">
       <div class="flex items-center space-x-4 mx-10">
         <img class="avatar" src="/images/icon/person.png" alt="" />
         <div>
@@ -38,7 +38,7 @@
       </div>
 
       <div class="btnDiv absolute top-8 right-8">
-        <el-button size="large">修改密码</el-button>
+        <el-button size="large" @click="linkTo('jsd_personal_xgmm')">修改密码</el-button>
         <el-button size="large">设置</el-button>
       </div>
     </div>

+ 5 - 1
src/pages/jsd/wdkc/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="main bg-white rounded-6px mt-4 py-8 px-12 relative grid grid-cols-3 gap-x-6 gap-y-12" style="font-size: 18px;">
+  <div class="main bg-white-grey rounded-10px mt-4 py-8 px-12 relative grid grid-cols-3 gap-x-6 gap-y-12" style="font-size: 18px;">
     <div v-for="(item, index) in production" :key="index" @click="linkTo(item.name)" class="rounded-10px h-110px flex items-center space-x-8 cursor-pointer" :style="{background: item.color}">
       <img class="ml-40px w-48px" :src="item.img" alt="" />
       <div>{{ item.title }}</div>
@@ -49,6 +49,10 @@ const linkTo = (name) => {
 </script>
 
 <style lang="scss" scoped>
+.bg-white-grey{
+  background: #fcfeff;
+}
+
 // img {
 //   width: 48px;
 // }

+ 36 - 6
src/pages/jsd/wdkc/tskc/index.vue

@@ -1,12 +1,42 @@
 <template>
-  <div>特色课程</div>
-</template>
+  <div class="mt-10px main bg-white pl-70px pr-30px pr-35px h-60px rounded-10px relative flex items-center justify-between">
+    <h3 class="nav-title">特色课程</h3>
+    <div class="btnDiv">
+      <el-button size="large" @click="linkTo('jsd_personal_wdkc')" class="w-100px">返回
+      </el-button>
+    </div>
+  </div>
+  <div class="mt-10px main bg-white-grey pt-25px pl-35px pr-35px rounded-10px">
 
-<script>
-export default {
+  </div>
+</template>
 
-}
+<script setup>
+import { ElMessage } from "element-plus";
+import { useRouter } from "vue-router";
+const router = useRouter();
+const linkTo = (name) => {
+  router.push({ name });
+};
 </script>
 
-<style>
+<style lang="scss" scoped>
+$color: #1259a1;
+.bg-white-grey{
+  background: #fcfeff;
+}
+.main {
+  box-shadow: 0 10px 24px rgba(161, 153, 168, 0.18);
+}
+.nav-title{
+  font-size: 18px;
+  color: #050026;
+}
+.btnDiv {
+  .el-button {
+    background: $color;
+    border-color: $color;
+    color: #fff;
+  }
+}
 </style>

+ 98 - 86
src/router/routes/jsd/wdkc.ts

@@ -1,96 +1,108 @@
-import type { RouteRecordRawWithMeta } from '../../routes'
+import type {RouteRecordRawWithMeta} from '../../routes'
 
 export default <RouteRecordRawWithMeta>{
-  path: '/jsd',
-  component: () => import('@/components/CommonHeader/index.vue'),
-  name: 'jsd_wdkc_head',
-  meta: {
-    hidden: true,
-    sort: 0,
-    title: '教师端',
-    breadcrumb: false,
-  },
-  redirect: { name: 'jsd_personal_wdkc_index' },
-  children: [
-    {
-      path: 'person',
-      component: () => import('@/pages/jsd/personal/index.vue'),
-      name: 'jsd_personal_wdkc_index',
-      meta: {
+    path: '/jsd',
+    component: () => import('@/components/CommonHeader/index.vue'),
+    name: 'jsd_wdkc_head',
+    meta: {
         hidden: true,
         sort: 0,
-        title: '个人中心',
+        title: '教师端',
         breadcrumb: false,
-      },
-      redirect: { name: 'jsd_personal_wdkc' },
-      children: [
+    },
+    redirect: {name: 'jsd_personal_wdkc_index'},
+    children: [
         {
-          path: 'wdkc',
-          component: () => import('@/pages/jsd/wdkc/index.vue'),
-          name: 'jsd_personal_wdkc',
-          meta: {
-            hidden: false,
-            sort: 0,
-            title: '我的课程',
-            breadcrumb: false,
-          }
+            path: 'person',
+            component: () => import('@/pages/jsd/personal/index.vue'),
+            name: 'jsd_personal_wdkc_index',
+            meta: {
+                hidden: true,
+                sort: 0,
+                title: '个人中心',
+                breadcrumb: false,
+            },
+            redirect: {name: 'jsd_personal_wdkc'},
+            children: [
+                {
+                    path: 'wdkc',
+                    component: () => import('@/pages/jsd/wdkc/index.vue'),
+                    name: 'jsd_personal_wdkc',
+                    meta: {
+                        hidden: false,
+                        sort: 0,
+                        title: '我的课程',
+                        breadcrumb: false,
+                    }
+                },
+                {
+                    path: 'jtjy',
+                    component: () => import('@/pages/jsd/wdkc/jtjy/index.vue'),
+                    name: 'jsd_personal_wdkc_jtjy',
+                    meta: {
+                        hidden: true,
+                        sort: 0,
+                        title: '家庭教育',
+                        breadcrumb: false,
+                    }
+                },
+                {
+                    path: 'tskc',
+                    component: () => import('@/pages/jsd/wdkc/tskc/index.vue'),
+                    name: 'jsd_personal_wdkc_tskc',
+                    meta: {
+                        hidden: true,
+                        sort: 0,
+                        title: '特色课程',
+                        breadcrumb: false,
+                    }
+                },
+                {
+                    path: 'mszy',
+                    component: () => import('@/pages/jsd/wdkc/mszy/index.vue'),
+                    name: 'jsd_personal_wdkc_mszy',
+                    meta: {
+                        hidden: true,
+                        sort: 0,
+                        title: '名师资源',
+                        breadcrumb: false,
+                    }
+                },
+                {
+                    path: 'zbkc',
+                    component: () => import('@/pages/jsd/wdkc/zbkc/index.vue'),
+                    name: 'jsd_personal_wdkc_zbkc',
+                    meta: {
+                        hidden: true,
+                        sort: 0,
+                        title: '直播课程',
+                        breadcrumb: false,
+                    }
+                },
+                {
+                    path: 'zyfd',
+                    component: () => import('@/pages/jsd/wdkc/zyfd/index.vue'),
+                    name: 'jsd_personal_wdkc_zyfd',
+                    meta: {
+                        hidden: true,
+                        sort: 0,
+                        title: '作业辅导',
+                        breadcrumb: false,
+                    }
+                }
+            ]
         },
         {
-          path: 'jtjy',
-          component: () => import('@/pages/jsd/wdkc/jtjy/index.vue'),
-          name: 'jsd_personal_wdkc_jtjy',
-          meta: {
-            hidden: true,
-            sort: 0,
-            title: '家庭教育',
-            breadcrumb: false,
-          }
+            path: 'person/xgmm',
+            component: () => import('@/pages/jsd/personal/change_pwd.vue'),
+            name: 'jsd_personal_xgmm',
+            meta: {
+                hidden:true,
+                sort: 0,
+                title: '修改密码',
+                breadcrumb: false,
+            }
         },
-        {
-          path: 'tskc',
-          component: () => import('@/pages/jsd/wdkc/tskc/index.vue'),
-          name: 'jsd_personal_wdkc_tskc',
-          meta: {
-            hidden: true,
-            sort: 0,
-            title: '特色课程',
-            breadcrumb: false,
-          }
-        },
-        {
-          path: 'mszy',
-          component: () => import('@/pages/jsd/wdkc/mszy/index.vue'),
-          name: 'jsd_personal_wdkc_mszy',
-          meta: {
-            hidden: true,
-            sort: 0,
-            title: '名师资源',
-            breadcrumb: false,
-          }
-        },
-        {
-          path: 'zbkc',
-          component: () => import('@/pages/jsd/wdkc/zbkc/index.vue'),
-          name: 'jsd_personal_wdkc_zbkc',
-          meta: {
-            hidden: true,
-            sort: 0,
-            title: '直播课程',
-            breadcrumb: false,
-          }
-        },
-        {
-          path: 'zyfd',
-          component: () => import('@/pages/jsd/wdkc/zyfd/index.vue'),
-          name: 'jsd_personal_wdkc_zyfd',
-          meta: {
-            hidden: true,
-            sort: 0,
-            title: '作业辅导',
-            breadcrumb: false,
-          }
-        }
-      ]
-    }
-  ]
+
+    ]
 }

+ 53 - 50
src/store/index.ts

@@ -5,56 +5,59 @@
 import type { User } from './user/index.d'
 
 let obj = {
-  "user_id": "100",
-  "user_name": "tyyxadmin",
-  "user_realname": "局管理",
-  "user_password": "b923bc037bffebe673963ddd046c7306990ea7aa",
-  "user_group_id": "1",
-  "user_role_id": "69",
-  "user_level_id": "1",
-  "user_detail_id": null,
-  "user_score": "31",
-  "modify_dateline": "1667551967",
-  "create_dateline": "1616403054",
-  "isdelete": "0",
-  "area_id1": "0",
-  "area_id2": "0",
-  "area_id3": "0",
-  "area_id4": "0",
-  "sm_id": "0",
-  "sm_admin": "0",
-  "cm_id": "0",
-  "cm_admin": "0",
-  "user_phone": "",
-  "phone_validation": "0",
-  "parent_user_id": null,
-  "user_nickname": null,
-  "user_avatar": "https://txwxopenapi.bozedu.top/",
-  "user_email": null,
-  "email_validation": "0",
-  "email_token": null,
-  "email_token_exptime": null,
-  "ischeck": "1",
-  "student_no": null,
-  "address": null,
-  "gender": null,
-  "about": null,
-  "qq": null,
-  "openid": "",
-  "webchatopenid": null,
-  "user_level": "1",
-  "user_birthday": "",
-  "grade_id": null,
-  "create_user_id": null,
-  "user_dept": "",
-  "user_cardno": null,
-  "dept_id": "",
-  "user_eyear": "0",
-  "user_grade_num": "0",
-  "user_class_num": "0",
-  "last_token": null,
-  "last_login": null,
-  "token": "387dK_aDh6NYujFLpIWNC3G5qmZRw_bqMeoZk0vzXYWw6esskbu8Ciyk56tVrGig76zEfgg_b13ntMA0KvJILQnkX12aDXDNe4IXQ"
+    "user_id": "2",
+    "user_name": "demo1",
+    "user_realname": "张校长",
+    "user_password": "b923bc037bffebe673963ddd046c7306990ea7aa",
+    "user_group_id": "1",
+    "user_role_id": "72",
+    "user_role_id_ext": null,
+    "user_role_id_ext_now": "0",
+    "user_level_id": "3",
+    "user_detail_id": "0",
+    "user_score": "119",
+    "modify_dateline": "1667188771",
+    "create_dateline": "1663232792",
+    "isdelete": "0",
+    "area_id1": "0",
+    "area_id2": "0",
+    "area_id3": "0",
+    "area_id4": "0",
+    "sm_id": "10001",
+    "sm_admin": "0",
+    "cm_id": "0",
+    "cm_admin": "0",
+    "user_phone": "12345678911",
+    "phone_validation": "0",
+    "parent_user_id": "0",
+    "user_nickname": "",
+    "user_avatar": "https://tyyxopenapi.bozedu.top/data/upload/month_202210/202210101401324986_qLQO.jpg",
+    "user_email": "",
+    "email_validation": "0",
+    "email_token": "",
+    "email_token_exptime": "0",
+    "ischeck": "1",
+    "student_no": "",
+    "address": "",
+    "gender": "0",
+    "about": "",
+    "qq": "",
+    "openid": "",
+    "webchatopenid": "",
+    "user_level": "0",
+    "user_birthday": "0000-00-00",
+    "grade_id": "0",
+    "create_user_id": null,
+    "user_dept": "",
+    "user_cardno": "",
+    "dept_id": "",
+    "user_eyear": "0",
+    "user_grade_num": "0",
+    "user_class_num": "0",
+    "last_token": "",
+    "last_login": null,
+    "graduation": "0",
+    "token": "cdf3QWd9sQQ41_bw7Q6_btnkLMAYBCeeVs6f1tmZlcc8rSLL3YCu2e54ewABskWlXB6vbIaCxfpdpnAc_bwRD_bK4qyLcol4poc"
 }
 
 // export const user = ref<User>(JSON.parse(sessionStorage.getItem('userInfo') ?? '{}'))

+ 22 - 22
windi.config.ts

@@ -1,25 +1,25 @@
-import { defineConfig } from 'windicss/helpers'
+import {defineConfig} from 'windicss/helpers'
 
 export default defineConfig({
-  darkMode: 'media',
-  shortcuts: {
-    card: 'rounded-xl bg-white p-3 relative box-border',
-    divider: 'w-full h-0 border border-solid border-gray-100 my-2',
-    divider_y: 'w-0 h-full border border-solid border-gray-100 mx-2',
-    icon: 'w-24px h-24px fill-blue-600 bg-light-100 rounded-2px cursor-pointer  mx-4px box-border',
-    icon_reserve:
-      'w-24px h-24px bg-blue-600 fill-light-100 rounded-2px cursor-pointer mx-4px p-2px box-border',
-    flex_center: 'flex justify-center items-center',
-    flex_start: 'flex justify-start items-center',
-    area: 'flex bg-gray-100 text-gray-600 my-2 p-4 text-sm h-300px overflow-auto',
-    pre: 'before:content-["|"] before:w-4px before:h-full before:inline-block before:text-transparent before:mr-6px before:bg-blue-400 text-gray-700',
-  },
-  plugins: [
-    require('@windicss/plugin-scrollbar'),
-    require('windicss/plugin/line-clamp'),
-    // ...
-  ],
-  variants: {
-    scrollbar: ['rounded'],
-  },
+    darkMode: 'media',
+    shortcuts: {
+        card: 'rounded-xl bg-white p-3 relative box-border',
+        divider: 'w-full h-0 border border-solid border-gray-100 my-2',
+        divider_y: 'w-0 h-full border border-solid border-gray-100 mx-2',
+        icon: 'w-24px h-24px fill-blue-600 bg-light-100 rounded-2px cursor-pointer  mx-4px box-border',
+        icon_reserve:
+            'w-24px h-24px bg-blue-600 fill-light-100 rounded-2px cursor-pointer mx-4px p-2px box-border',
+        flex_center: 'flex justify-center items-center',
+        flex_start: 'flex justify-start items-center',
+        area: 'flex bg-gray-100 text-gray-600 my-2 p-4 text-sm h-300px overflow-auto',
+        pre: 'before:content-["|"] before:w-4px before:h-full before:inline-block before:text-transparent before:mr-6px before:bg-blue-400 text-gray-700',
+    },
+    plugins: [
+        require('@windicss/plugin-scrollbar'),
+        require('windicss/plugin/line-clamp'),
+        // ...
+    ],
+    variants: {
+        scrollbar: ['rounded'],
+    },
 })