Ver Fonte

更新微信授权

1、微信授权;
2、乐团报名判断是否是退团学生;
lex há 2 anos atrás
pai
commit
1dac63357a

+ 40 - 0
public/project/css/initiation.css

@@ -165,3 +165,43 @@ span {
   font-size: 18px;
   font-weight: 500;
 }
+
+
+
+.wxPopupDialog {
+  overflow: initial;
+}
+.wxPopupDialog::before {
+    position: absolute;
+    content: ' ';
+    top: -73px;
+    left: 50%;
+    margin-left: -86px;
+    display: inline-block;
+    background: url('../images/initiation/wx-no-top.png') no-repeat top center;
+    background-size: contain;
+    width: 172px;
+    height: 154px;
+  }
+.popupContainer {
+  background: url('../images/initiation/wx-no-bg.png') no-repeat top center !important;
+  background-size: cover;
+  border-radius: 20px;
+  overflow: hidden;
+  
+}
+.popupContainer .title1 {
+  padding-top: 57px;
+  text-align: center;
+  font-size: 18px;
+  font-weight: 500;
+  color: #3b2300;
+}
+.popupContainer .popupTips {
+  padding-top: 12px;
+  padding-bottom: 47px;
+  text-align: center;
+  font-size: 15px;
+  color: #777777;
+  line-height: 21px;
+}

+ 40 - 0
public/project/css/preRegister.css

@@ -165,3 +165,43 @@ span {
   font-size: 18px;
   font-weight: 500;
 }
+
+
+
+.wxPopupDialog {
+  overflow: initial;
+}
+.wxPopupDialog::before {
+    position: absolute;
+    content: ' ';
+    top: -73px;
+    left: 50%;
+    margin-left: -86px;
+    display: inline-block;
+    background: url('../images/initiation/wx-no-top.png') no-repeat top center;
+    background-size: contain;
+    width: 172px;
+    height: 154px;
+  }
+.popupContainer {
+  background: url('../images/initiation/wx-no-bg.png') no-repeat top center !important;
+  background-size: cover;
+  border-radius: 20px;
+  overflow: hidden;
+  
+}
+.popupContainer .title1 {
+  padding-top: 57px;
+  text-align: center;
+  font-size: 18px;
+  font-weight: 500;
+  color: #3b2300;
+}
+.popupContainer .popupTips {
+  padding-top: 12px;
+  padding-bottom: 47px;
+  text-align: center;
+  font-size: 15px;
+  color: #777777;
+  line-height: 21px;
+}

BIN
public/project/images/initiation/wx-no-bg.png


BIN
public/project/images/initiation/wx-no-top.png


+ 50 - 3
public/project/initiation.html

@@ -211,7 +211,7 @@
           :rules="[{ required: true, message: '请选择在读年级', trigger: 'onChange' }]" @click="() => showPicker = true"
           placeholder="请选择在读年级">
           <template #right-icon>
-            <van-icon name="arrow" :color="checkPhone ? '#aaa' : '#323233'" size="16"></van-icon>
+            <van-icon name="arrow" :color="'#323233'" size="16"></van-icon>
           </template>
         </van-field>
         <van-field v-show="false" v-model="stu.currentGradeNum" name="currentGradeNum" readonly></van-field>
@@ -219,7 +219,7 @@
           :rules="[{ required: true, message: '请选择所在班级', trigger: 'onChange' }]" @click="() => classPicker = true"
           placeholder="请选择所在班级">
           <template #right-icon>
-            <van-icon name="arrow" :color="checkPhone ? '#aaa' : '#323233'" size="16"></van-icon>
+            <van-icon name="arrow" :color="'#323233'" size="16"></van-icon>
           </template>
         </van-field>
 
@@ -281,6 +281,13 @@
         <div @click="onLinkUrl" class="submit-btn"></div>
       </div>
     </van-popup>
+
+    <van-popup v-model:show="showPopup" round style="width: 88%" :close-on-click-overlay="false" class="wxPopupDialog">
+      <div class="popupContainer">
+        <p class="title1">温馨提示</p>
+        <p class="popupTips">请使用微信打开</p>
+      </div>
+    </van-popup>
   </div>
 
   <!-- 引入 Vue 和 Vant 的 JS 文件 -->
@@ -329,13 +336,31 @@
             joinParentMeeting: null
           },
           btnLoading: false,
-          checkPhone: true
+          checkPhone: true,
+          showPopup: false
         }
       },
       async mounted() {
         if (document.querySelector('#m_loading')) {
           document.querySelector('#m_loading').remove()
         }
+
+        // 判断是否是微信,只能微信中打开
+        if (!browser().weixin) {
+          this.showPopup = true
+          return
+        } else {
+          //授权
+          const code = getUrlCode()
+          console.log(code)
+          if (!code) {
+            this.getAppIdAndCode(window.location.href)
+            return
+          } else {
+            state.code = code
+          }
+        }
+
         if (!this.orchestraId) {
           vant.showToast('信息获取失败,请联系老师')
         }
@@ -367,6 +392,28 @@
         this.setLoading(false)
       },
       methods: {
+        async getAppIdAndCode(url) {
+          try {
+            var res = await axios.get('/api-school/open/paramConfig/wechatAppId')
+            // 判断是否有微信appId
+            if (res.data.code === 200 && res.data.data) {
+              vant.closeToast()
+              this.goAuth(res.data.data, url)
+            }
+          } catch {
+            //
+          }
+        },
+        goAuth(wxAppId, urlString) {
+          // 用户授权
+          console.log(urlString || window.location.href, 'urlString || window.location.href')
+          const urlNow = encodeURIComponent(urlString || window.location.href)
+          console.log(urlNow, 'urlNow')
+          const scope = 'snsapi_base' //snsapi_userinfo   //静默授权 用户无感知
+          const appid = wxAppId || 'wx8654c671631cfade'
+          const url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${urlNow}&response_type=code&scope=${scope}&state=STATE&connect_redirect=1#wechat_redirect`
+          window.location.replace(url)
+        },
         onLinkUrl() {
           this.submitStatus = false
           window.location.href = window.location.origin + '/orchestra-student/#/download'

+ 16 - 0
public/project/js/utils.js

@@ -38,3 +38,19 @@ function browser() {
     qq: u.match(/\sQQ/i) == ' qq' //是否QQ
   }
 }
+
+// 获取授权的code码
+function getUrlCode(name = 'code') {
+  // 截取url中的code方法
+  const url = location.search
+  const theRequest = new Object()
+  if (url.indexOf('?') != -1) {
+    const str = url.substr(1)
+    const strs = str.split('&')
+    for (let i = 0; i < strs.length; i++) {
+      theRequest[strs[i].split('=')[0]] = strs[i].split('=')[1]
+    }
+  }
+  console.log(theRequest, 'theRequest')
+  return theRequest[name]
+}

+ 59 - 17
public/project/preRegister.html

@@ -196,11 +196,11 @@
         <van-field label="性别" name="sex" :rules="[{ required: true, message: '请选择性别' }]">
           <template #input>
             <van-radio-group v-model="stu.sex" checked-color="#9A64FF" direction="horizontal">
-              <van-tag size="large" type="primary" :color="!(stu.sex === 1) ? '#EAEAEA' : '#64A9FF'"
+              <van-tag size="large" type="primary" :color="!(stu.sex === 1) ? '#EAEAEA' : '#9A64FF'"
                 :text-color="!(stu.sex === 1) ? '#AAA' : '#FFF'" class="radioSection" round>
                 <van-radio class="radioItem" :name="1"></van-radio>男生
               </van-tag>
-              <van-tag size="large" type="primary" :color="!(stu.sex === 0) ? '#EAEAEA' : '#64A9FF'"
+              <van-tag size="large" type="primary" :color="!(stu.sex === 0) ? '#EAEAEA' : '#9A64FF'"
                 :text-color="!(stu.sex === 0) ? '#AAA' : '#FFF'" class="radioSection" round>
                 <van-radio class="radioItem" :name="0"></van-radio>女生
               </van-tag>
@@ -211,14 +211,14 @@
           :rules="[{ required: true, message: '请选择在读年级', trigger: 'onChange' }]" @click="pickerChange"
           placeholder="请选择在读年级">
           <template #right-icon>
-            <van-icon name="arrow" :color="checkPhone ? '#aaa' : '#323233'" size="16"></van-icon>
+            <van-icon name="arrow" :color="'#323233'" size="16"></van-icon>
           </template>
         </van-field>
         <van-field label="所在班级" v-model="stu.currentClass" readonly name="currentClass"
           :rules="[{ required: true, message: '请选择所在班级', trigger: 'onChange' }]" @click="pickerChange1"
           placeholder="请选择所在班级">
           <template #right-icon>
-            <van-icon name="arrow" :color="checkPhone ? '#aaa' : '#323233'" size="16"></van-icon>
+            <van-icon name="arrow" :color="'#323233'" size="16"></van-icon>
           </template>
         </van-field>
       </van-cell-group>
@@ -228,7 +228,7 @@
           :rules="[{ required: true, message: '请选择选报声部', trigger: 'onChange' }]" @click="pickerChange2"
           placeholder="请选择选报声部">
           <template #right-icon>
-            <van-icon name="arrow" :color="checkPhone ? '#aaa' : '#323233'" size="16"></van-icon>
+            <van-icon name="arrow" :color="'#323233'" size="16"></van-icon>
           </template>
         </van-field>
 
@@ -236,13 +236,13 @@
           <template #input>
             <van-radio-group v-model="stu.instrumentsPrepareMode" checked-color="#9A64FF" direction="horizontal">
               <van-tag size="large" type="primary"
-                :color="!(stu.instrumentsPrepareMode === 'GROUP_PURCHASE')  ? '#EAEAEA' : '#64A9FF'"
+                :color="!(stu.instrumentsPrepareMode === 'GROUP_PURCHASE')  ? '#EAEAEA' : '#9A64FF'"
                 :text-color="!(stu.instrumentsPrepareMode === 'GROUP_PURCHASE') ? '#AAA' : '#FFF'" class="radioSection"
                 round>
                 <van-radio class="radioItem" name="GROUP_PURCHASE"></van-radio>团购
               </van-tag>
               <van-tag size="large" type="primary"
-                :color="!(stu.instrumentsPrepareMode === 'ONESELF') ? '#EAEAEA' : '#64A9FF'"
+                :color="!(stu.instrumentsPrepareMode === 'ONESELF') ? '#EAEAEA' : '#9A64FF'"
                 :text-color="!(stu.instrumentsPrepareMode === 'ONESELF') ? '#AAA' : '#FFF'" class="radioSection" round>
                 <van-radio class="radioItem" name="ONESELF"></van-radio>自备
               </van-tag>
@@ -254,17 +254,16 @@
           :rules="[{ required: true, message: '请选择乐团学习系统准备方式' }]">
           <template #input>
             <van-radio-group v-model="stu.learningSystemPrepareMode" checked-color="#9A64FF" direction="horizontal">
-              <!-- :color="checkPhone ? '#ccc': '#9A64FF'" -->
               <van-tag size="large" type="primary"
-                :color="!(stu.learningSystemPrepareMode === 'GROUP_PURCHASE') ? '#EAEAEA' : '#64A9FF'"
+                :color="!(stu.learningSystemPrepareMode === 'GROUP_PURCHASE') ? '#EAEAEA' : '#9A64FF'"
                 :text-color="!(stu.learningSystemPrepareMode === 'GROUP_PURCHASE') ? '#AAA' : '#FFF'"
                 class="radioSection" round>
                 <van-radio class="radioItem" name="GROUP_PURCHASE"></van-radio>团购
               </van-tag>
               <van-tag size="large" type="primary"
-                :color="!(stu.learningSystemPrepareMode === 'ONESELF') ? '#EAEAEA' : '#64A9FF'"
-                :text-color="!(stu.learningSystemPrepareMode === 'ONESELF') ? '#AAA' : '#FFF'"
-                :color="checkPhone ? '#ccc': '#9A64FF'" class="radioSection" round>
+                :color="!(stu.learningSystemPrepareMode === 'ONESELF') ? '#EAEAEA' : '#9A64FF'"
+                :text-color="!(stu.learningSystemPrepareMode === 'ONESELF') ? '#AAA' : '#FFF'" :color="'#9A64FF'"
+                class="radioSection" round>
                 <van-radio class="radioItem" name="ONESELF"></van-radio>自备
               </van-tag>
             </van-radio-group>
@@ -296,6 +295,13 @@
         <div @click="onLinkUrl" class="submit-btn"></div>
       </div>
     </van-popup>
+
+    <van-popup v-model:show="showPopup" round style="width: 88%" :close-on-click-overlay="false" class="wxPopupDialog">
+      <div class="popupContainer">
+        <p class="title1">温馨提示</p>
+        <p class="popupTips">请使用微信打开</p>
+      </div>
+    </van-popup>
   </div>
 
   <!-- 引入 Vue 和 Vant 的 JS 文件 -->
@@ -347,13 +353,31 @@
             learningSystemPrepareMode: null,
           },
           btnLoading: false,
-          checkPhone: true
+          checkPhone: true,
+          showPopup: false
         }
       },
       async mounted() {
         if (document.querySelector('#m_loading')) {
           document.querySelector('#m_loading').remove()
         }
+
+        // 判断是否是微信,只能微信中打开
+        // if (!browser().weixin) {
+        //   this.showPopup = true
+        //   return
+        // } else {
+        //   //授权
+        //   const code = getUrlCode()
+        //   console.log(code)
+        //   if (!code) {
+        //     this.getAppIdAndCode(window.location.href)
+        //     return
+        //   } else {
+        //     state.code = code
+        //   }
+        // }
+
         if (!this.orchestraId) {
           vant.showToast('信息获取失败,请联系老师')
         }
@@ -383,7 +407,6 @@
           })
           if (subjects.data.code === 200) {
             var rows = subjects.data.data.rows || []
-            // console.log(rows, 'rows')
             rows.forEach(item => {
               this.subjectList.push({
                 text: item.name,
@@ -401,6 +424,28 @@
         this.setLoading(false)
       },
       methods: {
+        async getAppIdAndCode(url) {
+          try {
+            var res = await axios.get('/api-school/open/paramConfig/wechatAppId')
+            // 判断是否有微信appId
+            if (res.data.code === 200 && res.data.data) {
+              vant.closeToast()
+              this.goAuth(res.data.data, url)
+            }
+          } catch {
+            //
+          }
+        },
+        goAuth(wxAppId, urlString) {
+          // 用户授权
+          console.log(urlString || window.location.href, 'urlString || window.location.href')
+          const urlNow = encodeURIComponent(urlString || window.location.href)
+          console.log(urlNow, 'urlNow')
+          const scope = 'snsapi_base' //snsapi_userinfo   //静默授权 用户无感知
+          const appid = wxAppId || 'wx8654c671631cfade'
+          const url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${urlNow}&response_type=code&scope=${scope}&state=STATE&connect_redirect=1#wechat_redirect`
+          window.location.replace(url)
+        },
         onLinkUrl() {
           this.submitStatus = false
           window.location.href = window.location.origin + '/orchestra-student/#/download'
@@ -515,15 +560,12 @@
           }
         },
         pickerChange(type) {
-          if (this.checkPhone) return
           this.showPicker = true
         },
         pickerChange1(type) {
-          if (this.checkPhone) return
           this.classPicker = true
         },
         pickerChange2(type) {
-          if (this.checkPhone) return
           this.subjectPicker = true
         },
         onConfirm(options) {

+ 53 - 53
src/school/approval-manage/subsidy/subsidyTypes.ts

@@ -26,18 +26,18 @@ interface ICourseSchedule {
   className: string
   /**课程类型 */
   type:
-    | 'PERCUSSION_SINGLE'
-    | 'FLUTE_SINGLE'
-    | 'SAX_SINGLE'
-    | 'CLARINET_SINGLE'
-    | 'TRUMPET_SINGLE'
-    | 'TROMBONE_SINGLE'
-    | 'HORN_SINGLE'
-    | 'BARITONE_TUBA_SINGLE'
-    | 'EUPHONIUM_SINGLE'
-    | 'TUBA_SINGLE'
-    | 'MUSIC_THEORY'
-    | 'INSTRUMENTAL_ENSEMBLE'
+  | 'PERCUSSION_SINGLE'
+  | 'FLUTE_SINGLE'
+  | 'SAX_SINGLE'
+  | 'CLARINET_SINGLE'
+  | 'TRUMPET_SINGLE'
+  | 'TROMBONE_SINGLE'
+  | 'HORN_SINGLE'
+  | 'BARITONE_TUBA_SINGLE'
+  | 'EUPHONIUM_SINGLE'
+  | 'TUBA_SINGLE'
+  | 'MUSIC_THEORY'
+  | 'INSTRUMENTAL_ENSEMBLE'
   /**训练时长 */
   singleCourseTime: string | number
   /**班组IM群 */
@@ -56,21 +56,21 @@ interface ICourseSchedule {
   signOutTime: string
   /**课程老师签到信息 */
   attendanceStatus:
-    | 'NORMAL'
-    | 'EXCEPTION'
-    | 'LATE'
-    | 'EARLY'
-    | 'TRUANCY'
-    | 'NO_SIGN'
-    | 'NO_SIGN_OUT'
-    | 'LOCATION_EXCEPTION'
-  /**伴学老师名 */
+  | 'NORMAL'
+  | 'EXCEPTION'
+  | 'LATE'
+  | 'EARLY'
+  | 'TRUANCY'
+  | 'NO_SIGN'
+  | 'NO_SIGN_OUT'
+  | 'LOCATION_EXCEPTION'
+  /**伴学指导名 */
   teacherAvatar: string
   /**课程计划内容编号 */
   lessonCoursewareDetailId: string
   /**上课日期 */
   classDate: string
-  /**伴学老师名 */
+  /**伴学指导名 */
   teacherName: string
   /**学生考勤 */
   studentAttendance: 'LATE' | 'NORMAL' | 'LEAVE' | 'TRUANCY' | 'UNCALLED'
@@ -82,7 +82,7 @@ interface ICourseSchedule {
   signOut: boolean
   /**签到时间 */
   signInTime: string
-  /**伴学老师Id */
+  /**伴学指导Id */
   teacherId: string
   /**是否签到 */
   signIn: boolean
@@ -161,19 +161,19 @@ interface ICourseSalaryRecordDetail {
 interface ICourseSalaryRecordDetailItem {
   /**课程类型 */
   courseType:
-    | 'PERCUSSION_SINGLE'
-    | 'FLUTE_SINGLE'
-    | 'SAX_SINGLE'
-    | 'CLARINET_SINGLE'
-    | 'TRUMPET_SINGLE'
-    | 'TROMBONE_SINGLE'
-    | 'HORN_SINGLE'
-    | 'BARITONE_TUBA_SINGLE'
-    | 'EUPHONIUM_SINGLE'
-    | 'TUBA_SINGLE'
-    | 'TEST_CLARINET'
-    | 'MUSIC_THEORY'
-    | 'INSTRUMENTAL_ENSEMBLE'
+  | 'PERCUSSION_SINGLE'
+  | 'FLUTE_SINGLE'
+  | 'SAX_SINGLE'
+  | 'CLARINET_SINGLE'
+  | 'TRUMPET_SINGLE'
+  | 'TROMBONE_SINGLE'
+  | 'HORN_SINGLE'
+  | 'BARITONE_TUBA_SINGLE'
+  | 'EUPHONIUM_SINGLE'
+  | 'TUBA_SINGLE'
+  | 'TEST_CLARINET'
+  | 'MUSIC_THEORY'
+  | 'INSTRUMENTAL_ENSEMBLE'
   /**扣款金额 */
   reduceSalary: number
   /**补助标准 */
@@ -187,7 +187,7 @@ interface ICourseSalaryRecordDetailItem {
   /**课程考勤信息 */
   courseScheduleTeacherAttendanceList: ICourseScheduleTeacherAttendance[]
 }
-/**伴学老师签到 */
+/**伴学指导签到 */
 interface ICourseScheduleTeacherAttendance {
   /**老师名称 */
   teacherName: string
@@ -199,14 +199,14 @@ interface ICourseScheduleTeacherAttendance {
   singleCourseTime: string
   /**签到状态(正常、异常、迟到、早退、旷课、未签到) */
   signInStatus:
-    | 'NORMAL'
-    | 'EXCEPTION'
-    | 'LATE'
-    | 'EARLY'
-    | 'TRUANCY'
-    | 'NO_SIGN'
-    | 'NO_SIGN_OUT'
-    | 'LOCATION_EXCEPTION'
+  | 'NORMAL'
+  | 'EXCEPTION'
+  | 'LATE'
+  | 'EARLY'
+  | 'TRUANCY'
+  | 'NO_SIGN'
+  | 'NO_SIGN_OUT'
+  | 'LOCATION_EXCEPTION'
   /**乐团编号 */
   orchestraId: string
   /**班级名称 */
@@ -233,14 +233,14 @@ interface ICourseScheduleTeacherAttendance {
   id: string
   /**签退状态(正常、异常、迟到、早退、旷课、未签到) */
   signOutStatus:
-    | 'NORMAL'
-    | 'EXCEPTION'
-    | 'LATE'
-    | 'EARLY'
-    | 'TRUANCY'
-    | 'NO_SIGN'
-    | 'NO_SIGN_OUT'
-    | 'LOCATION_EXCEPTION'
+  | 'NORMAL'
+  | 'EXCEPTION'
+  | 'LATE'
+  | 'EARLY'
+  | 'TRUANCY'
+  | 'NO_SIGN'
+  | 'NO_SIGN_OUT'
+  | 'LOCATION_EXCEPTION'
   /**签退时间 */
   signOutTime: string
   /**课程类型 */

+ 4 - 4
src/school/companion-teacher/companion-teacher-register.tsx

@@ -193,7 +193,7 @@ export default defineComponent({
 
     onMounted(async () => {
       if (!state.id) {
-        showToast('信息获取失败,请联系老师')
+        showToast('信息获取失败,请联系伴学指导')
       }
 
       // 判断是否是微信,只能微信中打开
@@ -283,7 +283,7 @@ export default defineComponent({
         state.columnSubject = tempSubjects
       } catch {
         showDialog({
-          message: '信息获取失败,请联系老师',
+          message: '信息获取失败,请联系伴学指导',
           theme: 'round-button',
           confirmButtonColor: '#ff8057'
         })
@@ -426,7 +426,7 @@ export default defineComponent({
             ></Field>
             <div class={styles.phoneTips}>
               <Icon name="warning" size="16" />
-              提示:手机号码将成为您管乐团老师端登录账号
+              提示:手机号码将成为您管乐团伴学指导端登录账号
             </div>
             <Field
               label="真实姓名"
@@ -730,7 +730,7 @@ export default defineComponent({
                 {state.name} <br />
                 <span>【伴学指导】</span>
               </p>
-              <p class={styles['submit-tips']}>请下载管乐团老师端APP进行授课</p>
+              <p class={styles['submit-tips']}>请下载管乐团伴学指导端APP进行授课</p>
               <Button
                 type="primary"
                 color="#FF8057"

+ 2 - 2
src/school/companion-teacher/compontent/teacher.tsx

@@ -90,9 +90,9 @@ export default defineComponent({
     return () => (
       <>
         <OSticky position="top">
-          <OHeader title="交接老师" desotry={false} />
+          <OHeader title="交接伴学指导" desotry={false} />
           <OSearch
-            placeholder="请输入老师姓名"
+            placeholder="请输入伴学指导姓名"
             inputBackground="white"
             background="#F8F8F8"
             onSearch={(val: any) => {

+ 5 - 5
src/school/companion-teacher/unbind.tsx

@@ -36,12 +36,12 @@ export default defineComponent({
       }
     }
 
-    // 选择交接老师
+    // 选择交接伴学指导
     const onSelectTeacher = (item: any) => {
       state.teacherStatus = true
       state.selectTeacher = item
     }
-    // 选择了交接老师之后
+    // 选择了交接伴学指导之后
     const onSelectItem = (item: any) => {
       console.log(item, 'steacher')
       state.selectTeacher.sTeacher = item
@@ -49,7 +49,7 @@ export default defineComponent({
 
     const onSubmit = () => {
       console.log('submit')
-      let isSelectAll = false // 是否有没有选择交接老师的数据
+      let isSelectAll = false // 是否有没有选择交接伴学指导的数据
       const courseInfo = [] as any
       state.classList.forEach((item: any) => {
         if (!item.sTeacher || (item.sTeacher && !item.sTeacher.id)) {
@@ -65,7 +65,7 @@ export default defineComponent({
       })
 
       if (isSelectAll) {
-        showToast('请选择交接老师')
+        showToast('请选择交接伴学指导')
         return
       }
 
@@ -111,7 +111,7 @@ export default defineComponent({
       <>
         <OHeader />
 
-        <div class={styles.unbindTips}>该伴学指导存在以下班级及课程未开始,请选择交接老师</div>
+        <div class={styles.unbindTips}>该伴学指导存在以下班级及课程未开始,请选择交接伴学指导</div>
 
         <CellGroup inset class={styles.detailCellGroup}>
           {state.classList.map((item: any) => (

+ 10 - 1
src/school/manage-teacher/manage-teacher-register.module.less

@@ -220,11 +220,20 @@ span {
 
 .protocol {
   display: flex;
-  align-items: center;
+  align-items: flex-start;
   justify-content: center;
+  padding: 0 13px;
   font-size: 12px;
   color: #aaaaaa;
   line-height: 17px;
+  :global {
+    .van-checkbox {
+      flex-shrink: 0;
+    }
+  }
+  & > div {
+    flex: 1 auto;
+  }
 }
 
 .protocol .c {

+ 131 - 34
src/school/manage-teacher/manage-teacher-register.tsx

@@ -27,7 +27,9 @@ import iconClose from './images/icon-close.png'
 import topBanner1 from './images/top-banner.png'
 import { checkPhone } from '@/helpers/validate'
 import dayjs from 'dayjs'
-import { browser } from '@/helpers/utils'
+import { browser, getUrlCode } from '@/helpers/utils'
+import OUpload from '@/components/o-upload'
+import qs from 'query-string'
 
 export default defineComponent({
   name: 'companion-teacher-register',
@@ -42,6 +44,7 @@ export default defineComponent({
       name: route.query.name,
       t: route.query.t as any, // 过期时间
       qrCodeStatus: false, // 二维码是否失效
+      qrCodeMessage: '',
       pattern: /^1(3|4|5|6|7|8|9)\d{9}$/,
       columns: [] as any,
       pickerType: null, // 下拉类型
@@ -50,7 +53,9 @@ export default defineComponent({
         phone: null,
         gender: 1,
         idCardNo: null,
-        smsValidCode: ''
+        smsValidCode: '',
+        idcardFrontImg: '',
+        idcardBackImg: '' // 身份证反面照
       },
       btnLoading: false,
       checkPhone: false,
@@ -60,16 +65,17 @@ export default defineComponent({
       countDownTime: 120, // 倒计时时间
       // countDownRef: null as any, // 倒计时实例
       imgCodeStatus: false,
-      showPopup: false
+      showPopup: false,
+      code: ''
     })
 
     const onSubmit = async () => {
       if (state.qrCodeStatus) {
         showDialog({
           title: '提示',
-          message: '二维码已失效',
+          message: state.qrCodeMessage,
           theme: 'round-button',
-          confirmButtonColor: '#64A9FF'
+          confirmButtonColor: '#ff8057'
         })
         return
       }
@@ -122,10 +128,28 @@ export default defineComponent({
       }
 
       // 判断是否是微信,只能微信中打开
-      // if (!browser().weixin) {
-      //   state.showPopup = true
-      //   return
-      // }
+      if (!browser().weixin) {
+        state.showPopup = true
+        return
+      } else {
+        //授权
+        const code = getUrlCode()
+        if (!code) {
+          const newUrl =
+            window.location.origin +
+            window.location.pathname +
+            '#' +
+            route.path +
+            '?' +
+            qs.stringify({
+              ...route.query
+            })
+          getAppIdAndCode(newUrl)
+          return
+        } else {
+          state.code = code
+        }
+      }
 
       // t: route.query.t, // 过期时间
       try {
@@ -138,13 +162,15 @@ export default defineComponent({
           }
         })
         if (res.code === 999) {
-          state.qrCodeStatus = true
           showDialog({
             title: '提示',
             message: res.message,
             theme: 'round-button',
             confirmButtonColor: '#64A9FF'
           })
+
+          state.qrCodeStatus = true
+          state.qrCodeMessage = res.message
         }
       } catch (e: any) {
         //
@@ -200,11 +226,44 @@ export default defineComponent({
       }
     })
 
-    const onPreview = () => {
-      window.open(
-        window.location.origin + window.location.pathname + '#/preview-protocol',
-        '_blank'
-      )
+    const getAppIdAndCode = async (url?: string) => {
+      try {
+        const { data } = await request.get('/api-school/open/paramConfig/wechatAppId')
+        // 判断是否有微信appId
+        if (data) {
+          closeToast()
+          goAuth(data, url)
+        }
+      } catch {
+        //
+      }
+    }
+    const goAuth = (wxAppId: string, urlString?: string) => {
+      // 用户授权
+      console.log(urlString || window.location.href, 'urlString || window.location.href')
+      const urlNow = encodeURIComponent(urlString || window.location.href)
+      console.log(urlNow, 'urlNow')
+      const scope = 'snsapi_base' //snsapi_userinfo   //静默授权 用户无感知
+      const appid = wxAppId || 'wx8654c671631cfade'
+      const url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${urlNow}&response_type=code&scope=${scope}&state=STATE&connect_redirect=1#wechat_redirect`
+      window.location.replace(url)
+    }
+
+    const onPreview = (type: string) => {
+      if (type === 'REGISTER') {
+        window.open(
+          window.location.origin + window.location.pathname + '#/preview-protocol',
+          '_blank'
+        )
+      } else if (type === 'PRIVACY') {
+        window.open(
+          window.location.origin + window.location.pathname + '#/privacyProtocol',
+          '_blank'
+        )
+      } else if (type === 'WITHDRAW') {
+        //
+        window.open(window.location.origin + window.location.pathname + '#/cashProtocol', '_blank')
+      }
     }
 
     return () => (
@@ -258,6 +317,43 @@ export default defineComponent({
               placeholder="请输入身份证号码"
             ></Field>
 
+            <Field
+              label="身份证照片正面"
+              v-model={state.forms.idcardFrontImg}
+              readonly
+              name="idcardFrontImg"
+              rules={[{ required: true, message: '请上传身份证正面', trigger: 'onChange' }]}
+              placeholder="请上传身份证正面"
+            >
+              {{
+                input: () => (
+                  <OUpload
+                    style={{ width: '100%' }}
+                    tips="上传身份证正面"
+                    v-model:modelValue={state.forms.idcardFrontImg}
+                  />
+                )
+              }}
+            </Field>
+            <Field
+              label="身份证照片反面"
+              v-model={state.forms.idcardBackImg}
+              readonly
+              name="idcardBackImg"
+              rules={[{ required: true, message: '请上传身份证反面', trigger: 'onChange' }]}
+              placeholder="请上传身份证反面"
+            >
+              {{
+                input: () => (
+                  <OUpload
+                    style={{ width: '100%' }}
+                    tips="上传身份证反面"
+                    v-model:modelValue={state.forms.idcardBackImg}
+                  />
+                )
+              }}
+            </Field>
+
             <Field label="性别" name="gender" rules={[{ required: true, message: '请选择性别' }]}>
               {{
                 input: () => (
@@ -328,16 +424,26 @@ export default defineComponent({
               style="margin-right: 6px"
               checked-color="#64A9FF"
             ></Checkbox>
-            <span
-              onClick={() => {
-                state.checked = !state.checked
-              }}
-            >
-              请认真阅读并勾选
-            </span>
-            <span class={styles.c} onClick={onPreview}>
-              《乐团管理老师注册协议》
-            </span>
+            <div>
+              <span
+                onClick={() => {
+                  state.checked = !state.checked
+                }}
+              >
+                请认真阅读并勾选
+              </span>
+              <span class={styles.c} onClick={() => onPreview('REGISTER')}>
+                《管乐团用户注册协议》
+              </span>
+              、
+              <span class={styles.c} onClick={() => onPreview('PRIVACY')}>
+                《隐私协议》
+              </span>
+              、
+              <span class={styles.c} onClick={() => onPreview('WITHDRAW')}>
+                《共享经济平台注册经营者协议》
+              </span>
+            </div>
           </div>
 
           <Button
@@ -355,15 +461,6 @@ export default defineComponent({
 
         <Popup v-model:show={state.submitStatus} round style="width: 75%" closeOnClickOverlay>
           <div class={styles.stautsS}>
-            {/* <img
-              class={styles['icon-close']}
-              src={iconClose}
-              onClick={() => {
-                state.submitStatus = false
-                window.location.href =
-                  window.location.origin + '/orchestra-student/#/download?type=manage'
-              }}
-            /> */}
             <img src={topBanner1} class={styles['submit-img']} />
             <div class={styles['submit-container']}>
               <p class={styles['submit-title']}>恭喜您已成功登记为</p>

+ 2 - 2
src/school/mass-message/component/manage-list/index.tsx

@@ -149,7 +149,7 @@ export default defineComponent({
           <OSearch
             inputBackground="white"
             background="#F8F8F8"
-            placeholder="老师名称/手机号"
+            placeholder="伴学指导名称/手机号"
             onSearch={(val: any) => {
               forms.params.keyword = val
               onSearch()
@@ -196,7 +196,7 @@ export default defineComponent({
             </CheckboxGroup>
           </List>
         ) : (
-          <OEmpty btnStatus={false} tips="暂无老师" />
+          <OEmpty btnStatus={false} tips="暂无伴学指导" />
         )}
       </div>
     )

+ 1 - 1
src/school/mass-message/component/student-list/index.tsx

@@ -192,7 +192,7 @@ export default defineComponent({
             </CheckboxGroup>
           </List>
         ) : (
-          <OEmpty btnStatus={false} tips="暂无老师" />
+          <OEmpty btnStatus={false} tips="暂无学生" />
         )}
       </div>
     )

+ 2 - 2
src/school/mass-message/component/teacher-list/teacher-list.tsx

@@ -150,7 +150,7 @@ export default defineComponent({
           <OSearch
             inputBackground="white"
             background="#F8F8F8"
-            placeholder="老师名称/手机号"
+            placeholder="伴学名称/手机号"
             onSearch={(val: any) => {
               forms.params.keyword = val
               onSearch()
@@ -214,7 +214,7 @@ export default defineComponent({
             </CheckboxGroup>
           </List>
         ) : (
-          <OEmpty btnStatus={false} tips="暂无老师" />
+          <OEmpty btnStatus={false} tips="暂无伴学指导" />
         )}
       </div>
     )

+ 1 - 1
src/school/mass-message/index.tsx

@@ -122,7 +122,7 @@ export default defineComponent({
           <OSearch
             background="#f6f8f9"
             inputBackground="white"
-            placeholder="请输入群聊/学员名称/老师名称"
+            placeholder="请输入群聊/学员名称/伴学指导名称"
             onSearch={(val: string) => {
               console.log('val', val)
               state.params.keyword = val

+ 2 - 2
src/school/orchestra/create-orchestra/select-teacher.tsx

@@ -80,7 +80,7 @@ export default defineComponent({
 
     return () => (
       <div class={styles.selectTeacher}>
-        <OHeader title="选择老师" />
+        <OHeader title="选择伴学指导" />
 
         <CellGroup inset class={styles.cellGroup}>
           {state.selectLastTeacherSubjects.map((subject: any) => (
@@ -99,7 +99,7 @@ export default defineComponent({
                     {subject.teacher?.nickname ? (
                       <p class={styles.name}>{subject.teacher?.nickname || ''}</p>
                     ) : (
-                      <p class={styles.tips}>请选择老师</p>
+                      <p class={styles.tips}>请选择伴学指导</p>
                     )}
                   </>
                 )

+ 3 - 3
src/school/orchestra/modal/teacher-list.tsx

@@ -133,11 +133,11 @@ export default defineComponent({
     return () => (
       <div>
         <OSticky position="top" mode={props.mode}>
-          {props.header && <OHeader title="选择老师" />}
+          {props.header && <OHeader title="选择伴学指导" />}
           <OSearch
             inputBackground="white"
             background="#F8F8F8"
-            placeholder="老师名称"
+            placeholder="伴学指导名称"
             onSearch={(val: any) => {
               forms.params.keyword = val
               onSearch()
@@ -173,7 +173,7 @@ export default defineComponent({
             ))}
           </List>
         ) : (
-          <OEmpty btnStatus={false} tips="暂无老师" />
+          <OEmpty btnStatus={false} tips="暂无伴学指导" />
         )}
       </div>
     )

+ 1 - 1
src/school/train-planning/component/course-preview/index.tsx

@@ -178,7 +178,7 @@ export default defineComponent({
             message: res.message,
             confirmButtonColor: '#ff8057'
           }).then(() => {
-            // 原生班级调整伴学老师
+            // 原生班级调整伴学指导
             // if (state.type === 'native') {
             //   postMessage({ api: 'back', content: {} })
             // } else {

+ 17 - 11
src/student/music-group/pre-apply/index.tsx

@@ -51,20 +51,26 @@ export default defineComponent({
         )
         state.registerInfo = data || {}
 
-        // 判断是否报名注册过
-        state.register = data.register
-        if (data.register) {
+        if (data.registerStatus === 'OUTOF_ORCHESTRA') {
           nextTick(() => {
-            state.tabValue = 'payment'
+            state.tabValue = 'apply'
           })
-        }
+        } else {
+          // 判断是否报名注册过
+          state.register = data.register
+          if (data.register) {
+            nextTick(() => {
+              state.tabValue = 'payment'
+            })
+          }
 
-        // 	购买状态, 判断是否已经购买完了
-        if (data.purchase) {
-          state.purchase = data.purchase
-          nextTick(() => {
-            state.tabValue = 'order'
-          })
+          // 	购买状态, 判断是否已经购买完了
+          if (data.purchase) {
+            state.purchase = data.purchase
+            nextTick(() => {
+              state.tabValue = 'order'
+            })
+          }
         }
 
         // INITIATION_SURVEY: '启蒙调查',