QYF-GitLab1
3 天以前 51a35a1cea7a381c33c86e9a9697ecef602c773f
src/views/personalCenter/userInfo.vue
@@ -39,10 +39,9 @@
          </div>
        </div>
      </div>
      <div class="content-item">
      <!-- <div class="content-item">
        <div class="item-title flex jc-sb">
          <span>用户类型</span>
          <!-- <span class="change-info hover" @click="userTypeDialog = true">修改</span> -->
          <span class="change-info hover" @click="updateUserInfo()">修改</span>
        </div>
        <div class="item-box">
@@ -51,7 +50,7 @@
            <span class="text">{{ userInfo.userType }}</span>
          </div>
        </div>
      </div>
      </div> -->
      <div class="content-item">
        <div class="item-title flex jc-sb">
          <span>教师认证</span>
@@ -199,14 +198,14 @@
    >
      <div>
        <div class="qrcodeBox">
          <!-- <wxlogin
          <wxlogin
            :redirect_uri="wxLogin.redirectURL"
            style="width: 300px; height: 400px; margin: -40px auto 0; overflow: hidden"
            :appid="wxLogin.appid"
            :scope="wxLogin.scope"
            state="WeChatScanningCodeBind"
          >
          </wxlogin> -->
          </wxlogin>
        </div>
        <p class="tips">使用微信扫一扫扫描二维码进行绑定</p>
      </div>
@@ -273,19 +272,13 @@
<script setup lang="ts">
import { reactive, ref, inject, onMounted, watch } from 'vue'
import type { FormInstance, FormRules } from 'element-plus'
// import verify from '@/components/sliderImg/component/verify.vue'
// import '@/components/sliderImg/sliderImg.js'
// import '@/components/sliderImg/sliderImg.css'
import { ElMessage } from 'element-plus'
import tool from '@/assets/js/toolClass.js'
// import { useUserStore } from '@/store'
import { useUserStore } from '@/store'
// import wxlogin from 'vue-wxlogin'
// import teacherCertification from '@/views/components/teacherCertification.vue'
// import login from '@/layout/components/login.vue'
// const userStore = useUserStore()
import { useRoute } from 'vue-router'
import teacherCertification from './teacherCertification.vue'
import login from '@/layout/components/login.vue'
const userStore = useUserStore()
import moment from 'moment'
const route = useRoute()
const MG: any = inject('MG')
const config: any = inject('config')
@@ -323,13 +316,13 @@
  }
}
// onMounted(() => {
//   getWechatAuthenticationState()
//   getIntegral()
//   if (localStorage.getItem(config.tokenKey)) {
//     getUserRole()
//   }
// })
onMounted(() => {
  getWechatAuthenticationState()
  getIntegral()
  if (localStorage.getItem(config.tokenKey)) {
    getUserRole()
  }
})
// watch(route, () => {
//   bindWeChat()
@@ -346,28 +339,29 @@
let changeType = ref('password')
const imgCode = ref<string>() // 图形验证码url
let countDown = ref(0)
// function changeUserInfo(type) {
//   changeType.value = type
//   if (type == 'password') {
//     if (userStore.userInfo?.phoneNumber) {
//       getImgCapcha()
//       userInfoDialog.value = true
//     } else {
//       ElMessage({
//         message: '修改密码需短信验证,请绑定手机号后再修改密码!',
//         type: 'warning'
//       })
//     }
//   } else {
//     getImgCapcha()
//     userInfoDialog.value = true
//   }
// }
// const getImgCapcha = () => {
//   MG.identity.getImgCode().then((res) => {
//     imgCode.value = 'data:image/png;base64,' + res
//   })
// }
const changeUserInfo = (type) => {
  changeType.value = type
  if (type == 'password') {
    if (userStore.userInfo?.phoneNumber) {
      getImgCapcha()
      userInfoDialog.value = true
    } else {
      ElMessage({
        message: '修改密码需短信验证,请绑定手机号后再修改密码!',
        type: 'warning',
      })
    }
  } else {
    getImgCapcha()
    userInfoDialog.value = true
  }
}
const getImgCapcha = () => {
  MG.identity.getImgCode().then((res) => {
    imgCode.value = 'data:image/png;base64,' + res
  })
}
const userFormRef = ref<FormInstance>()
const userInfoForm = reactive({
@@ -570,10 +564,11 @@
}
//微信认证
let wxLogin = reactive({
  appid: 'wx5cfe8b007a3c6f8c',
  appid: 'wx2b9d4a6308fd03d6',
  scope: 'snsapi_login',
  redirectURL: encodeURIComponent(config.requestCtx + '/home/#/personalCenter'),
  redirectURL: encodeURIComponent(config.requestCtx + '/#/personalCenter'),
})
//获取微信认证状态
const getWechatAuthenticationState = () => {
  MG.identity.checkBuildingWeChat({}).then((res: any) => {
    if (res) {
@@ -925,6 +920,7 @@
  .change-info {
    color: #019e58;
    font-size: 14px;
  }
  .record {