lex 2 gadi atpakaļ
vecāks
revīzija
a949ad8afb

+ 68 - 26
src/components/col-protocol/index.tsx

@@ -4,6 +4,8 @@ import styles from './index.module.less'
 import activeButtonIcon from '@common/images/icon_checkbox.png'
 import inactiveButtonIcon from '@common/images/icon_checkbox_default.png'
 import ColHeader from '../col-header'
+import { state } from '@/state'
+import request from '@/helpers/request'
 
 export default defineComponent({
   name: 'protocol',
@@ -19,14 +21,32 @@ export default defineComponent({
   },
   data() {
     return {
-      checked: false,
+      exists: true,
+      checked: this.modelValue,
       popupStatus: false,
       protocolHTML: '',
-      protocolPopup: null as any
+      protocolPopup: null as any,
+      baseUrl:
+        state.platformType === 'STUDENT' ? '/api-student' : '/api-teacher'
     }
   },
-  mounted() {
+  async mounted() {
+    try {
+      const res = await request.get(
+        this.baseUrl + '/sysUserContractRecord/checkContractSign',
+        {
+          params: {
+            contractType: 'BUY_ORDER'
+          }
+        }
+      )
+      // console.log(res)
+      this.exists = res.data
+      this.checked = this.checked || this.exists
+      this.$emit('update:modelValue', this.checked || this.exists)
+    } catch {}
     this.checked = this.modelValue
+    // this.getContractDetail()
     window.addEventListener('hashchange', this.onHash, false)
   },
   unmounted() {
@@ -38,14 +58,29 @@ export default defineComponent({
     }
   },
   methods: {
+    async getContractDetail() {
+      try {
+        console.log('getContractDetail')
+        // 判断是否有协议内容
+        if (!this.protocolHTML) {
+          const res = await request.get(
+            this.baseUrl + '/sysUserContractRecord/queryContract',
+            {
+              params: {
+                contractType: 'BUY_ORDER'
+              }
+            }
+          )
+          this.protocolHTML = res.data
+          console.log(res)
+        }
+        this.onPopupClose()
+      } catch {}
+    },
     onHash() {
       this.popupStatus = false
     },
     onPopupClose() {
-      // 判断是否有协议内容
-      // if (!this.protocolHTML) {
-      //   return
-      // }
       this.popupStatus = !this.popupStatus
 
       // 打开弹窗
@@ -69,21 +104,24 @@ export default defineComponent({
   render() {
     return (
       <div class={styles.colProtocol}>
-        <Checkbox
-          v-model={this.checked}
-          v-slots={{
-            icon: (props: any) => (
-              <Icon
-                class={styles.boxStyle}
-                name={props.checked ? activeButtonIcon : inactiveButtonIcon}
-                size="15"
-              />
-            )
-          }}
-        >
-          我已阅读并同意
-        </Checkbox>
-        <span onClick={this.onPopupClose} class={styles.protocolText}>
+        {!this.exists && (
+          <Checkbox
+            v-model={this.checked}
+            v-slots={{
+              icon: (props: any) => (
+                <Icon
+                  class={styles.boxStyle}
+                  name={props.checked ? activeButtonIcon : inactiveButtonIcon}
+                  size="15"
+                />
+              )
+            }}
+          >
+            我已阅读并同意
+          </Checkbox>
+        )}
+        {this.exists && <>查看</>}
+        <span onClick={this.getContractDetail} class={styles.protocolText}>
           《酷乐秀平台服务协议》
         </span>
 
@@ -94,10 +132,14 @@ export default defineComponent({
           style={{ height: '100%' }}
         >
           {this.showHeader && <ColHeader title="酷乐秀平台服务协议" />}
-          <div class={styles.protocolContent}>
-            <div class={styles.protocolTitle}>酷乐秀平台服务协议</div>
-            <div class={styles.protocolContent}>呆头呆脑的协议内容</div>
-          </div>
+          {this.popupStatus && (
+            <div class={styles.protocolContent} id="mProtocol">
+              <div
+                class={styles.protocolContent}
+                v-html={this.protocolHTML}
+              ></div>
+            </div>
+          )}
         </Popup>
       </div>
     )

+ 3 - 2
src/student/live-class/live-detail.tsx

@@ -20,6 +20,7 @@ export default defineComponent({
   data() {
     const query = this.$route.query
     return {
+      joinRoom: query.joinRoom,
       groupId: query.groupId,
       courseId: query.classId,
       live: {} as any
@@ -73,7 +74,7 @@ export default defineComponent({
         roomUid: ''
       }
       coursePlanList.forEach((item: any) => {
-        if (item.liveState === 1) {
+        if (item.courseId === Number(this.courseId)) {
           tempObj.status = true
           tempObj.roomUid = item.roomUid
         }
@@ -218,7 +219,7 @@ export default defineComponent({
           </Sticky>
         )}
 
-        {this.liveStatus.status && (
+        {this.joinRoom == '1' && (
           <Sticky offsetBottom={0} position="bottom">
             <div class={['btnGroup']} style={{ paddingTop: '12px' }}>
               <Button

+ 3 - 2
src/teacher/live-class/live-detail.tsx

@@ -21,6 +21,7 @@ export default defineComponent({
   data() {
     const query = this.$route.query
     return {
+      joinRoom: query.joinRoom,
       groupId: query.groupId,
       courseId: query.classId,
       live: {} as any
@@ -70,7 +71,7 @@ export default defineComponent({
         roomUid: ''
       }
       coursePlanList.forEach((item: any) => {
-        if (item.liveState === 1) {
+        if (item.courseId === Number(this.courseId)) {
           tempObj.status = true
           tempObj.roomUid = item.roomUid
         }
@@ -186,7 +187,7 @@ export default defineComponent({
           </Sticky>
         )}
 
-        {this.liveStatus.status && (
+        {this.joinRoom == '1' && (
           <Sticky offsetBottom={0} position="bottom">
             <div class={['btnGroup']} style={{ paddingTop: '12px' }}>
               <Button

+ 1 - 1
src/teacher/piano-room/account-recharge-timer/index.tsx

@@ -78,7 +78,7 @@ export default defineComponent({
   },
   render() {
     return (
-      <div>
+      <div style={{ minHeight: '100vh', overflow: 'hidden' }}>
         <ColHeader
           rightText="充值记录"
           onClickRight={() => {