Browse Source

更新优化

lex-xin 2 years ago
parent
commit
cc519e9400

+ 2 - 1
src/business-components/user-detail/index.tsx

@@ -22,6 +22,7 @@ interface UserType {
   headUrl: string
   headUrl: string
   username: string
   username: string
   startTime?: string
   startTime?: string
+  id?: number
   buyNum?: number
   buyNum?: number
   lessonPrice: number
   lessonPrice: number
   lessonNum?: number
   lessonNum?: number
@@ -89,7 +90,7 @@ export default defineComponent({
               ),
               ),
               title: () => (
               title: () => (
                 <div class={styles.name}>
                 <div class={styles.name}>
-                  {this.userInfo.username}
+                  {this.userInfo.username || '游客' + this.userInfo.id}
                   {this.showType === 'TIME' ? (
                   {this.showType === 'TIME' ? (
                     <Tag
                     <Tag
                       style={{ marginLeft: '8px' }}
                       style={{ marginLeft: '8px' }}

+ 0 - 2
src/components/col-header/index.tsx

@@ -57,7 +57,6 @@ export default defineComponent({
     this.navBarInit()
     this.navBarInit()
   },
   },
   unmounted() {
   unmounted() {
-    console.log(true, 'unmounted')
     // 设置是否显示导航栏 0 显示 1 不显示
     // 设置是否显示导航栏 0 显示 1 不显示
     postMessage({ api: 'setBarStatus', content: { status: 1 } })
     postMessage({ api: 'setBarStatus', content: { status: 1 } })
     // 设置返回按钮颜色
     // 设置返回按钮颜色
@@ -71,7 +70,6 @@ export default defineComponent({
       // 设置是否显示导航栏 0 显示 1 不显示
       // 设置是否显示导航栏 0 显示 1 不显示
       postMessage({ api: 'setBarStatus', content: { status: 0 } })
       postMessage({ api: 'setBarStatus', content: { status: 0 } })
       // 设置返回按钮颜色
       // 设置返回按钮颜色
-      console.log(this.backIconColor, 'this.backIconColor')
       postMessage({
       postMessage({
         api: 'backIconChange',
         api: 'backIconChange',
         content: { iconStyle: this.backIconColor || 'black' }
         content: { iconStyle: this.backIconColor || 'black' }

+ 5 - 1
src/components/col-popup/index.tsx

@@ -5,6 +5,10 @@ import qs from 'query-string'
 export default defineComponent({
 export default defineComponent({
   name: 'col-popup',
   name: 'col-popup',
   props: {
   props: {
+    height: {
+      type: String,
+      default: '100%'
+    },
     modelValue: {
     modelValue: {
       type: Boolean,
       type: Boolean,
       default: false
       default: false
@@ -65,7 +69,7 @@ export default defineComponent({
         show={this.modelValue}
         show={this.modelValue}
         transitionAppear={true}
         transitionAppear={true}
         position="bottom"
         position="bottom"
-        style={{ height: '100%' }}
+        style={{ height: this.height }}
       >
       >
         {this.$slots.default && this.$slots.default()}
         {this.$slots.default && this.$slots.default()}
       </Popup>
       </Popup>

+ 36 - 20
src/components/col-protocol/index.tsx

@@ -1,12 +1,17 @@
-import { Checkbox, Icon, Popup } from "vant";
-import { defineComponent } from "vue";
-import styles from './index.module.less';
-import activeButtonIcon from '@common/images/icon_checkbox.png';
-import inactiveButtonIcon from '@common/images/icon_checkbox_default.png';
+import { Checkbox, Icon, Popup } from 'vant'
+import { defineComponent } from 'vue'
+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'
 
 
 export default defineComponent({
 export default defineComponent({
   name: 'protocol',
   name: 'protocol',
   props: {
   props: {
+    showHeader: {
+      type: Boolean,
+      default: false
+    },
     modelValue: {
     modelValue: {
       type: Boolean,
       type: Boolean,
       default: false
       default: false
@@ -17,11 +22,11 @@ export default defineComponent({
       checked: false,
       checked: false,
       popupStatus: false,
       popupStatus: false,
       protocolHTML: '',
       protocolHTML: '',
-      protocolPopup: null as any,
+      protocolPopup: null as any
     }
     }
   },
   },
   mounted() {
   mounted() {
-    this.checked = this.modelValue;
+    this.checked = this.modelValue
     window.addEventListener('hashchange', this.onHash, false)
     window.addEventListener('hashchange', this.onHash, false)
   },
   },
   unmounted() {
   unmounted() {
@@ -34,7 +39,7 @@ export default defineComponent({
   },
   },
   methods: {
   methods: {
     onHash() {
     onHash() {
-      this.popupStatus = false;
+      this.popupStatus = false
     },
     },
     onPopupClose() {
     onPopupClose() {
       // 判断是否有协议内容
       // 判断是否有协议内容
@@ -46,44 +51,55 @@ export default defineComponent({
       // 打开弹窗
       // 打开弹窗
       if (this.popupStatus) {
       if (this.popupStatus) {
         const route = this.$route
         const route = this.$route
-        let times = 0;
+        let times = 0
         for (let i in route.query) {
         for (let i in route.query) {
           times += 1
           times += 1
         }
         }
         const origin = window.location.href
         const origin = window.location.href
-        const url = times > 0 ? '&pto=' + (+new Date()) : '?pto=' + (+new Date())
-        history.pushState("", "", `${origin}${url}`)
+        const url = times > 0 ? '&pto=' + +new Date() : '?pto=' + +new Date()
+        history.pushState('', '', `${origin}${url}`)
       } else {
       } else {
         window.history.go(-1)
         window.history.go(-1)
       }
       }
       if (this.protocolPopup) {
       if (this.protocolPopup) {
-        (this.protocolPopup as any).scrollTop = 0
+        ;(this.protocolPopup as any).scrollTop = 0
       }
       }
     }
     }
   },
   },
   render() {
   render() {
     return (
     return (
       <div class={styles.colProtocol}>
       <div class={styles.colProtocol}>
-        <Checkbox v-model={this.checked}
+        <Checkbox
+          v-model={this.checked}
           v-slots={{
           v-slots={{
             icon: (props: any) => (
             icon: (props: any) => (
-              <Icon class={styles.boxStyle} name={props.checked ? activeButtonIcon : inactiveButtonIcon} size="15" />
+              <Icon
+                class={styles.boxStyle}
+                name={props.checked ? activeButtonIcon : inactiveButtonIcon}
+                size="15"
+              />
             )
             )
           }}
           }}
         >
         >
           我已阅读并同意
           我已阅读并同意
         </Checkbox>
         </Checkbox>
-        <span onClick={this.onPopupClose} class={styles.protocolText}>《酷乐秀平台服务协议》</span>
+        <span onClick={this.onPopupClose} class={styles.protocolText}>
+          《酷乐秀平台服务协议》
+        </span>
 
 
-        <Popup ref={this.protocolPopup} show={this.popupStatus} position="bottom" style={{ height: '100%' }}>
+        <Popup
+          ref={this.protocolPopup}
+          show={this.popupStatus}
+          position="bottom"
+          style={{ height: '100%' }}
+        >
+          {this.showHeader && <ColHeader title="酷乐秀平台服务协议" />}
           <div class={styles.protocolContent}>
           <div class={styles.protocolContent}>
             <div class={styles.protocolTitle}>酷乐秀平台服务协议</div>
             <div class={styles.protocolTitle}>酷乐秀平台服务协议</div>
-            <div class={styles.protocolContent}>
-              呆头呆脑的协议内容
-            </div>
+            <div class={styles.protocolContent}>呆头呆脑的协议内容</div>
           </div>
           </div>
         </Popup>
         </Popup>
       </div>
       </div>
     )
     )
   }
   }
-})
+})

+ 3 - 3
src/student/layout/auth.tsx

@@ -35,7 +35,7 @@ export default defineComponent({
       if (state.user.status === 'init' || state.user.status === 'error') {
       if (state.user.status === 'init' || state.user.status === 'error') {
         this.loading = true
         this.loading = true
         try {
         try {
-          let res = await request.get('/api-auth/api/queryUserInfo', {
+          let res = await request.get('/api-student/student/queryUserInfo', {
             initRequest: true // 初始化接口
             initRequest: true // 初始化接口
           })
           })
           // console.log(res)
           // console.log(res)
@@ -43,9 +43,9 @@ export default defineComponent({
         } catch (e: any) {
         } catch (e: any) {
           const message = e.message
           const message = e.message
           if (message.indexOf('430') !== -1) {
           if (message.indexOf('430') !== -1) {
-            setLogout()
-          } else {
             setLoginError()
             setLoginError()
+          } else {
+            setLogout()
           }
           }
         }
         }
         this.loading = false
         this.loading = false

+ 1 - 1
src/student/layout/login.tsx

@@ -77,7 +77,7 @@ export default defineComponent({
         const { authentication } = res.data
         const { authentication } = res.data
         setAuth(authentication.token_type + ' ' + authentication.access_token)
         setAuth(authentication.token_type + ' ' + authentication.access_token)
 
 
-        let userCash = await request.get('/api-auth/api/queryUserInfo', {
+        let userCash = await request.get('/api-student/student/queryUserInfo', {
           initRequest: true // 初始化接口
           initRequest: true // 初始化接口
         })
         })
         setLogin(userCash.data)
         setLogin(userCash.data)

+ 2 - 2
src/student/main.ts

@@ -11,8 +11,8 @@ import '../styles/index.less'
 
 
 const app = createApp(App)
 const app = createApp(App)
 
 
-import Vconsole from 'vconsole'
-const vconsole = new Vconsole()
+// import Vconsole from 'vconsole'
+// const vconsole = new Vconsole()
 
 
 dayjs.locale('zh-ch')
 dayjs.locale('zh-ch')
 app.config.globalProperties.$dayjs = dayjs
 app.config.globalProperties.$dayjs = dayjs

+ 30 - 6
src/student/practice-class/index.tsx

@@ -7,17 +7,21 @@ import PracticeItem from './practice-item'
 import request from '@/helpers/request'
 import request from '@/helpers/request'
 import ColResult from '@/components/col-result'
 import ColResult from '@/components/col-result'
 import AllSearch from './model/all-search'
 import AllSearch from './model/all-search'
+import OrganSearch from './model/organ-search'
+import { state } from '@/state'
 
 
 export default defineComponent({
 export default defineComponent({
   name: 'practiceClass',
   name: 'practiceClass',
   data() {
   data() {
     return {
     return {
+      openStatus: false,
       searchStatus: false,
       searchStatus: false,
-
+      subjectList: [],
       list: [],
       list: [],
       dataShow: true, // 判断是否有数据
       dataShow: true, // 判断是否有数据
       loading: false,
       loading: false,
       finished: false,
       finished: false,
+      searchType: 'organ' as 'organ' | 'all',
       tempSort: {
       tempSort: {
         starGrade: 'ALL',
         starGrade: 'ALL',
         expTime: 'ALL',
         expTime: 'ALL',
@@ -26,6 +30,7 @@ export default defineComponent({
       params: {
       params: {
         search: '',
         search: '',
         sort: '',
         sort: '',
+        subjectName: '',
         subjectId: null as any,
         subjectId: null as any,
         page: 1,
         page: 1,
         rows: 20
         rows: 20
@@ -33,9 +38,11 @@ export default defineComponent({
     }
     }
   },
   },
   async mounted() {
   async mounted() {
+    this.params.subjectId = state.user.data?.subjectId || null
+    this.params.subjectName = state.user.data?.subjectName || ''
     try {
     try {
       const res = await request.get('/api-student/subject/subjectSelect')
       const res = await request.get('/api-student/subject/subjectSelect')
-      console.log(res)
+      this.subjectList = res.data || []
     } catch {}
     } catch {}
     this.getList()
     this.getList()
   },
   },
@@ -109,8 +116,13 @@ export default defineComponent({
                 size="small"
                 size="small"
                 round
                 round
                 plain
                 plain
+                onClick={() => {
+                  this.searchStatus = !this.searchStatus
+                  this.openStatus = !this.openStatus
+                  this.searchType = 'organ'
+                }}
               >
               >
-                全部
+                {this.params.subjectName}
                 <Icon
                 <Icon
                   classPrefix="iconfont"
                   classPrefix="iconfont"
                   name="down"
                   name="down"
@@ -119,15 +131,16 @@ export default defineComponent({
                   color="var(--van-primary)"
                   color="var(--van-primary)"
                 />
                 />
               </Button>
               </Button>
-              <Button class={[styles.btn]} size="small" round plain>
+              {/* <Button class={[styles.btn]} size="small" round plain>
                 30天内未约满
                 30天内未约满
-              </Button>
+              </Button> */}
             </div>
             </div>
             <div>
             <div>
               <div
               <div
                 class={styles.dataItem}
                 class={styles.dataItem}
                 onClick={() => {
                 onClick={() => {
                   this.searchStatus = !this.searchStatus
                   this.searchStatus = !this.searchStatus
+                  this.searchType = 'all'
                 }}
                 }}
               >
               >
                 筛选
                 筛选
@@ -181,8 +194,19 @@ export default defineComponent({
           closeable
           closeable
           safe-area-inset-bottom
           safe-area-inset-bottom
           onClose={() => (this.searchStatus = false)}
           onClose={() => (this.searchStatus = false)}
+          onClosed={() => (this.openStatus = false)}
         >
         >
-          <AllSearch v-model={this.tempSort} onSort={this.onSort} />
+          {this.searchType === 'all' && (
+            <AllSearch v-model={this.tempSort} onSort={this.onSort} />
+          )}
+          {this.searchType === 'organ' && this.openStatus && (
+            <OrganSearch
+              subjectList={this.subjectList}
+              onSort={this.onSort}
+              v-model={this.params.subjectId}
+              v-model:subjectName={this.params.subjectName}
+            />
+          )}
         </Popup>
         </Popup>
       </>
       </>
     )
     )

+ 12 - 0
src/student/practice-class/model/all-search.module.less

@@ -22,6 +22,7 @@
   display: flex;
   display: flex;
   margin-top: 10px;
   margin-top: 10px;
   margin-bottom: 20px;
   margin-bottom: 20px;
+  flex-wrap: wrap;
   .radio:first-child {
   .radio:first-child {
     :global {
     :global {
       .van-radio__label {
       .van-radio__label {
@@ -57,6 +58,17 @@
   }
   }
 }
 }
 
 
+.organ-radio {
+  :global {
+    .van-tag--large {
+      width: auto;
+      padding: 3px 10px;
+      margin-bottom: 8px;
+      margin-right: 8px;
+    }
+  }
+}
+
 .btn {
 .btn {
   padding: 5px 14px;
   padding: 5px 14px;
 
 

+ 104 - 0
src/student/practice-class/model/organ-search.tsx

@@ -0,0 +1,104 @@
+import { defineComponent } from 'vue'
+import styles from './all-search.module.less'
+import { RadioGroup, Radio, Tag, Button, Sticky } from 'vant'
+
+export default defineComponent({
+  name: 'organ-search',
+  props: {
+    modelValue: {
+      type: [Number, String],
+      default: 0
+    },
+    subjectName: {
+      type: String,
+      default: ''
+    },
+    subjectList: {
+      type: Array,
+      default: () => []
+    },
+    onSort: {
+      type: Function,
+      default: (item: any) => {}
+    }
+  },
+  data() {
+    return {
+      subjectId: 0,
+      subName: ''
+    }
+  },
+  mounted() {
+    this.subjectId = Number(this.modelValue)
+    this.subName = this.subjectName
+  },
+  render() {
+    return (
+      <>
+        <div class={styles.filterTitle}>全部声部</div>
+        <div
+          class={styles.searchResult}
+          style={{ maxHeight: '45vh', overflowY: 'auto' }}
+        >
+          {this.subjectList.map(
+            (item: any) =>
+              item.subjects &&
+              item.subjects.length > 0 && (
+                <>
+                  <div class={styles.searchTitle}>{item.name}</div>
+                  <div
+                    class={[
+                      styles['radio-group'],
+                      styles.radio,
+                      styles['organ-radio']
+                    ]}
+                  >
+                    {item.subjects.map((subject: any) => {
+                      const isActive = subject.id === Number(this.subjectId)
+                      const type = isActive ? 'primary' : 'default'
+                      return (
+                        <Tag
+                          size="large"
+                          plain={isActive}
+                          type={type}
+                          round
+                          onClick={() => {
+                            console.log(subject)
+                            this.subjectId = subject.id
+                            this.subName = subject.name
+                          }}
+                        >
+                          {subject.name}
+                        </Tag>
+                      )
+                    })}
+                  </div>
+                </>
+              )
+          )}
+        </div>
+        <Sticky position="bottom" offsetBottom={0}>
+          <div class="btnGroup">
+            {/* <Button type="primary" plain round onClick={() => {
+              this.$emit('update:modelValue', this.modelValue)
+            }}>
+              重置
+            </Button> */}
+            <Button
+              type="primary"
+              round
+              block
+              onClick={() => {
+                this.$emit('update:modelValue', this.subjectId)
+                this.$emit('update:subjectName', this.subName)
+                this.onSort()
+              }}
+            >
+              确认
+            </Button>
+          </div>
+        </Sticky>
+      </>
+    )
+  }
+})

+ 1 - 1
src/student/practice-class/practice-item.module.less

@@ -1,7 +1,7 @@
 .practiceItem {
 .practiceItem {
   margin: 10px 14px 0;
   margin: 10px 14px 0;
   padding: 15px 12px;
   padding: 15px 12px;
-  width: auto;
+  width: auto !important;
   border-radius: 8px;
   border-radius: 8px;
 
 
   .piCoverContainer {
   .piCoverContainer {

+ 14 - 3
src/student/teacher-dependent/components/practice.tsx

@@ -17,8 +17,19 @@ export default defineComponent({
       selectCourseList: []
       selectCourseList: []
     }
     }
   },
   },
-  mounted() {
-    this.getList()
+  async mounted() {
+    try {
+      const res = await request.get(
+        '/api-student/courseSchedule/getTeacherSubjectPrice',
+        {
+          params: {
+            teacherId: this.teacherId
+          }
+        }
+      )
+      console.log(res)
+      this.getList()
+    } catch {}
   },
   },
   methods: {
   methods: {
     async getList(date?: Date) {
     async getList(date?: Date) {
@@ -34,7 +45,7 @@ export default defineComponent({
           {
           {
             data: {
             data: {
               ...params,
               ...params,
-              studentId: state.user.data?.id,
+              studentId: state.user.data?.userId,
               teacherId: this.teacherId
               teacherId: this.teacherId
             }
             }
           }
           }

+ 4 - 0
src/student/teacher-dependent/components/single.module.less

@@ -73,3 +73,7 @@
   color: #1a1a1a;
   color: #1a1a1a;
   line-height: 22px;
   line-height: 22px;
 }
 }
+
+.videoGroup {
+  width: 90%;
+}

+ 120 - 34
src/student/teacher-dependent/components/single.tsx

@@ -1,9 +1,13 @@
 import SectionDetail from '@/business-components/section-detail'
 import SectionDetail from '@/business-components/section-detail'
 import ColVideo from '@/components/col-video'
 import ColVideo from '@/components/col-video'
 import request from '@/helpers/request'
 import request from '@/helpers/request'
-import { Button, Cell, Icon, Image } from 'vant'
+import { Button, Cell, Icon, Image, Popup } from 'vant'
 import { defineComponent } from 'vue'
 import { defineComponent } from 'vue'
 import styles from './single.module.less'
 import styles from './single.module.less'
+import { postMessage } from '@/helpers/native-message'
+import JoinChat from '../model/join-chat'
+
+import iconUploadPoster from '@common/images/icon_upload_poster.png'
 
 
 export const getAssetsHomeFile = (fileName: string) => {
 export const getAssetsHomeFile = (fileName: string) => {
   const path = `../images/${fileName}`
   const path = `../images/${fileName}`
@@ -19,6 +23,49 @@ export default defineComponent({
       default: {}
       default: {}
     }
     }
   },
   },
+  data() {
+    const query = this.$route.query
+    return {
+      videoStatus: false,
+      chatStatus: false,
+      teacherId: query.teacherId,
+      fansList: [],
+      chatItem: {},
+      videoItem: {}
+    }
+  },
+  async mounted() {
+    try {
+      const res = await request.post('/api-student/imGroup/queryTeacherGroup', {
+        data: {
+          type: 'FAN',
+          createUserId: this.teacherId
+        }
+      })
+      this.fansList = res.data || []
+    } catch {}
+  },
+  methods: {
+    async onDetail(item: any) {
+      // 申请入群
+      if (!item.hasWaitAuditFlag && !item.existFlag) {
+        this.chatStatus = true
+        this.chatItem = item
+        return
+      }
+
+      // 进入群聊天
+      if (item.existFlag) {
+        postMessage({
+          api: 'joinChatGroup',
+          content: {
+            type: 'multi', // single 单人 multi 多人
+            id: item.id
+          }
+        })
+      }
+    }
+  },
   render() {
   render() {
     const userInfo = this.userInfo
     const userInfo = this.userInfo
     return (
     return (
@@ -41,11 +88,14 @@ export default defineComponent({
           >
           >
             <div class={styles.videoList}>
             <div class={styles.videoList}>
               {userInfo.styleVideo.map((item: any) => (
               {userInfo.styleVideo.map((item: any) => (
-                <div class={styles.videoItem}>
-                  <Image
-                    src="https://daya.ks3-cn-beijing.ksyun.com/202204/T3JggS0.png"
-                    fit="cover"
-                  />
+                <div
+                  class={styles.videoItem}
+                  onClick={() => {
+                    this.videoStatus = true
+                    this.videoItem = item
+                  }}
+                >
+                  <Image src={iconUploadPoster} fit="cover" />
                   <Icon
                   <Icon
                     class={styles['icon-upload']}
                     class={styles['icon-upload']}
                     name={getAssetsHomeFile('icon_video.png')}
                     name={getAssetsHomeFile('icon_video.png')}
@@ -57,34 +107,70 @@ export default defineComponent({
           </SectionDetail>
           </SectionDetail>
         )}
         )}
 
 
-        <SectionDetail icon="fans" title="粉丝群" size={24} border={false}>
-          {[1, 2, 3].map(item => (
-            <Cell
-              center
-              class={styles.fansGroup}
-              v-slots={{
-                icon: () => (
-                  <Image
-                    src="https://daya.ks3-cn-beijing.ksyun.com/202204/T3JggS0.png"
-                    fit="cover"
-                    class={styles.fansImage}
-                  />
-                ),
-                title: () => (
-                  <div class={styles.fansTitle}>
-                    <div class={styles.title}>竖笛学习</div>
-                    <p class="van-ellipsis">李老师竖笛交流群李老师竖笛交流群</p>
-                  </div>
-                ),
-                default: () => (
-                  <Button type="primary" size="small" round>
-                    申请入群
-                  </Button>
-                )
-              }}
-            />
-          ))}
-        </SectionDetail>
+        {this.fansList && this.fansList.length > 0 && (
+          <SectionDetail icon="fans" title="粉丝群" size={24} border={false}>
+            {this.fansList.map((item: any) => (
+              <Cell
+                center
+                class={styles.fansGroup}
+                v-slots={{
+                  icon: () => (
+                    <Image
+                      src={item.img || getAssetsHomeFile('icon_fans.png')}
+                      fit="cover"
+                      class={styles.fansImage}
+                    />
+                  ),
+                  title: () => (
+                    <div class={styles.fansTitle}>
+                      <div class={styles.title}>{item.name}</div>
+                      <p class="van-ellipsis">{item.introduce}</p>
+                    </div>
+                  ),
+                  default: () => (
+                    <Button
+                      type="primary"
+                      size="small"
+                      round
+                      disabled={item.hasWaitAuditFlag}
+                      onClick={() => this.onDetail(item)}
+                    >
+                      {item.existFlag ? '去聊天' : ''}
+                      {item.hasWaitAuditFlag ? '审核中' : ''}
+                      {!item.hasWaitAuditFlag && !item.existFlag
+                        ? '申请入群'
+                        : ''}
+                    </Button>
+                  )
+                }}
+              />
+            ))}
+          </SectionDetail>
+        )}
+
+        <Popup
+          show={this.chatStatus}
+          position="bottom"
+          round
+          closeable
+          safe-area-inset-bottom
+          onClose={() => (this.chatStatus = false)}
+        >
+          <JoinChat
+            item={this.chatItem}
+            onClose={() => (this.chatStatus = false)}
+          />
+        </Popup>
+
+        <Popup
+          show={this.videoStatus}
+          round
+          class={styles.videoGroup}
+          closeable
+          onClose={() => (this.videoStatus = false)}
+        >
+          <ColVideo />
+        </Popup>
       </div>
       </div>
     )
     )
   }
   }

BIN
src/student/teacher-dependent/images/icon_fans.png


+ 52 - 0
src/student/teacher-dependent/model/join-chat.module.less

@@ -0,0 +1,52 @@
+.filterTitle {
+  font-size: 18px;
+  font-weight: 500;
+  color: #000000;
+  line-height: 25px;
+  text-align: center;
+  padding: 20px 0;
+}
+.fansGroup {
+  padding: 0 0 25px !important;
+  &:last-child {
+    padding-bottom: 12px !important;
+  }
+  :global {
+    .van-cell__title,
+    .van-cell__value {
+      flex: 1 auto;
+    }
+  }
+
+  .introduce {
+    font-size: 14px;
+    color: #999999;
+    line-height: 20px;
+    width: 260px;
+  }
+}
+
+.fansImage {
+  width: 42px;
+  height: 42px;
+  border-radius: 50%;
+  overflow: hidden;
+}
+
+.fansTitle {
+  padding-left: 12px;
+  font-size: 16px;
+  color: #1a1a1a;
+  line-height: 22px;
+}
+
+.joinContainer {
+  padding: 22px 14px;
+}
+
+.joinText {
+  font-size: 14px;
+  color: #999999;
+  border-radius: 10px;
+  border: 1px solid #dedede;
+}

+ 91 - 0
src/student/teacher-dependent/model/join-chat.tsx

@@ -0,0 +1,91 @@
+import { defineComponent } from 'vue'
+import styles from './join-chat.module.less'
+import { Button, Cell, Field, Image, Toast } from 'vant'
+import request from '@/helpers/request'
+
+export const getAssetsHomeFile = (fileName: string) => {
+  const path = `../images/${fileName}`
+  const modules = import.meta.globEager('../images/*')
+  return modules[path].default
+}
+
+export default defineComponent({
+  name: 'joinChat',
+  props: {
+    item: {
+      type: Object,
+      default: {}
+    },
+    onClose: {
+      type: Function,
+      default: () => {}
+    }
+  },
+  data() {
+    return {
+      desc: ''
+    }
+  },
+  methods: {
+    async onJoinChat() {
+      try {
+        await request.post('/api-student/imGroupMemberAudit/apply', {
+          data: {
+            groupId: this.item.id,
+            desc: this.desc
+          }
+        })
+        Toast('申请成功')
+        this.onClose && this.onClose()
+      } catch {}
+    }
+  },
+  render() {
+    return (
+      <>
+        <div class={[styles.filterTitle, 'van-hairline--bottom']}>申请入群</div>
+        <div class={styles.joinContainer}>
+          <Cell
+            center
+            class={styles.fansGroup}
+            border={false}
+            v-slots={{
+              icon: () => (
+                <Image
+                  src={this.item.img || getAssetsHomeFile('icon_fans.png')}
+                  fit="cover"
+                  class={styles.fansImage}
+                />
+              ),
+              title: () => (
+                <div class={styles.fansTitle}>
+                  <div class={styles.title}>{this.item.name}</div>
+                  <p class={['van-ellipsis', styles.introduce]}>{this.item.introduce}</p>
+                </div>
+              )
+            }}
+          />
+          <Field
+            type="textarea"
+            class={styles.joinText}
+            rows={2}
+            maxlength={200}
+            v-model={this.desc}
+            placeholder="请填写您的入群申请,会更快的被通过喔~"
+          />
+        </div>
+        <div class="btnGroup">
+          <Button
+            type="primary"
+            block
+            round
+            style={{ width: '70%', margin: '0 auto' }}
+            onClick={this.onJoinChat}
+          >
+            确认
+          </Button>
+        </div>
+      </>
+    )
+  }
+})

+ 1 - 1
src/student/teacher-dependent/teacher-home.tsx

@@ -29,7 +29,7 @@ export default defineComponent({
       userInfo: {} as any
       userInfo: {} as any
     }
     }
   },
   },
-  async mounted() {
+  async created() {
     try {
     try {
       const res = await request.get('/api-student/teacher/queryTeacherHome', {
       const res = await request.get('/api-student/teacher/queryTeacherHome', {
         params: {
         params: {

+ 6 - 0
src/student/trade/list/index.tsx

@@ -13,6 +13,7 @@ import {
 import { formatterDate } from '@/helpers/utils'
 import { formatterDate } from '@/helpers/utils'
 
 
 import iconTeacher from '@common/images/icon_teacher.png'
 import iconTeacher from '@common/images/icon_teacher.png'
+import request from '@/helpers/request'
 
 
 export default defineComponent({
 export default defineComponent({
   name: 'list',
   name: 'list',
@@ -31,6 +32,11 @@ export default defineComponent({
     }
     }
   },
   },
   methods: {
   methods: {
+    async getList() {
+      try {
+        const res = await request.get
+      } catch {}
+    },
     onDetail(item: any) {
     onDetail(item: any) {
       this.$router.push({
       this.$router.push({
         path: '/tradeDetail'
         path: '/tradeDetail'

+ 10 - 3
src/student/video-class/video-detail.tsx

@@ -32,9 +32,10 @@ export default defineComponent({
       const result = res.data || {}
       const result = res.data || {}
       const lessonGroup = result.lessonGroup || {}
       const lessonGroup = result.lessonGroup || {}
       this.userInfo = {
       this.userInfo = {
+        alreadyBuy: result.alreadyBuy,
         username: lessonGroup.username,
         username: lessonGroup.username,
         headUrl: lessonGroup.avatar,
         headUrl: lessonGroup.avatar,
-        buyNum: 0,
+        buyNum: lessonGroup.countStudent,
         id: lessonGroup.id,
         id: lessonGroup.id,
         lessonNum: lessonGroup.lessonCount,
         lessonNum: lessonGroup.lessonCount,
         lessonName: lessonGroup.lessonName,
         lessonName: lessonGroup.lessonName,
@@ -103,8 +104,14 @@ export default defineComponent({
 
 
         <Sticky offsetBottom={0} position="bottom">
         <Sticky offsetBottom={0} position="bottom">
           <div class={['btnGroup', styles.btnMore]}>
           <div class={['btnGroup', styles.btnMore]}>
-            <Button block round type="primary" onClick={this.onBuy}>
-              立即购买
+            <Button
+              block
+              round
+              type="primary"
+              onClick={this.onBuy}
+              disabled={this.userInfo.alreadyBuy}
+            >
+              {this.userInfo.alreadyBuy ? '已购买' : '立即购买'}
             </Button>
             </Button>
           </div>
           </div>
         </Sticky>
         </Sticky>

+ 2 - 2
src/teacher/layout/auth.tsx

@@ -46,9 +46,9 @@ export default defineComponent({
           const message = e.message
           const message = e.message
           console.log(message)
           console.log(message)
           if (message.indexOf('430') !== -1) {
           if (message.indexOf('430') !== -1) {
-            setLogout()
-          } else {
             setLoginError()
             setLoginError()
+          } else {
+            setLogout()
           }
           }
         }
         }
         this.loading = false
         this.loading = false

+ 9 - 7
src/views/order-detail/index.tsx

@@ -49,10 +49,10 @@ export default defineComponent({
       }
       }
       const users = state.user.data
       const users = state.user.data
       // 判断是否需要实名认证
       // 判断是否需要实名认证
-      // if (!users?.realName || !users?.idCard) {
-      //   this.popupShow = true
-      //   return
-      // }
+      if (!users?.realName || !users?.idCard) {
+        this.popupShow = true
+        return
+      }
       // return
       // return
       let result: any
       let result: any
       if (this.$refs.orderVideo && this.orderType == 'VIDEO') {
       if (this.$refs.orderVideo && this.orderType == 'VIDEO') {
@@ -87,15 +87,17 @@ export default defineComponent({
             <Icon name={iconTips} size={15} />
             <Icon name={iconTips} size={15} />
             温馨提示
             温馨提示
           </h3>
           </h3>
-
           <p>
           <p>
-            1、您支付的课酬费用将由平台收取 <br />
-            2、课程结束7天后,平台将单课时费用向老师结算
+            1、您支付的课程费用将由平台收取; <br />
+            2、陪练课、直播课课程结束后,平台将单课时费用向老师结算;
+            <br />
+            3、除直播课未达到开课人数外,其他服务一经购买不予退费。
           </p>
           </p>
         </div>
         </div>
 
 
         <ColProtocol
         <ColProtocol
           v-model={this.agreeStatus}
           v-model={this.agreeStatus}
+          showHeader
           style={{ paddingLeft: 0, paddingRight: 0 }}
           style={{ paddingLeft: 0, paddingRight: 0 }}
         />
         />
         <div class={styles.btnGroup}>
         <div class={styles.btnGroup}>

+ 34 - 50
src/views/order-detail/payment/index.tsx

@@ -49,7 +49,7 @@ export default defineComponent({
     }
     }
   },
   },
   unmounted() {
   unmounted() {
-    // removeListenerMessage('paymentOperation', this.onClose)
+    removeListenerMessage('paymentOperation', this.paymentOperation)
   },
   },
   methods: {
   methods: {
     onClose() {
     onClose() {
@@ -63,7 +63,7 @@ export default defineComponent({
           this.onCancel()
           this.onCancel()
         })
         })
     },
     },
-    async onCancel() {
+    async onCancel(noBack?: boolean) {
       try {
       try {
         await request.post('/api-student/userOrder/orderCancel', {
         await request.post('/api-student/userOrder/orderCancel', {
           data: {
           data: {
@@ -71,37 +71,12 @@ export default defineComponent({
           }
           }
         })
         })
         this.$emit('update:modelValue', false)
         this.$emit('update:modelValue', false)
-        this.$router.go(-1)
+        !noBack && this.$router.go(-1)
         this.onBackOut && this.onBackOut()
         this.onBackOut && this.onBackOut()
       } catch {}
       } catch {}
     },
     },
     async onSubmit() {
     async onSubmit() {
       // 支付...
       // 支付...
-      // const pt = this.payType
-      // ua = window.navigator.userAgent.toLowerCase()
-      // 判断当前浏览器
-      // if (ua.indexOf('micromessenger') != -1) {
-      //   // 微信浏览器
-      //   if (pt == 'zfb') {
-      //     this.pay_channel = 'alipay_qr'
-      //   } else if (pt == 'wx') {
-      //     this.pay_channel = 'wx_pub'
-      //   }
-      // } else if (ua.indexOf('alipayclient') != -1) {
-      //   // 支付宝浏览器
-      //   if (pt == 'zfb') {
-      //     this.pay_channel = 'alipay_wap'
-      //     // 支付宝 H5 支付
-      //   } else if (pt == 'wx') {
-      //     this.pay_channel = 'wx_pub'
-      //   }
-      // } else {
-      //   if (pt == 'zfb') {
-      //     this.pay_channel = 'alipay_qr'
-      //   } else if (pt == 'wx') {
-      //     this.pay_channel = 'wx_pub'
-      //   }
-      // }
       try {
       try {
         const res = await request.post('/api-student/userOrder/orderPay', {
         const res = await request.post('/api-student/userOrder/orderPay', {
           data: {
           data: {
@@ -117,31 +92,40 @@ export default defineComponent({
             payInfo: `alipays://platformapi/startapp?saId=10000007&qrcode=${res.data.pay_info}`
             payInfo: `alipays://platformapi/startapp?saId=10000007&qrcode=${res.data.pay_info}`
           }
           }
         })
         })
-
+        Toast.loading({
+          message: '支付中...',
+          forbidClick: true,
+          duration: 3000,
+          loadingType: 'spinner'
+        })
         // 唤起支付时状态
         // 唤起支付时状态
-        listenerMessage('paymentOperation', (res: any) => {
-          console.log(res)
-          if (res.status === 'success') {
-            Toast.loading({
-              message: '支付中...',
-              forbidClick: true,
-              duration: 1000,
-              loadingType: 'spinner',
-              onClose: () => {
-                this.$emit('update:modelValue', false)
-                this.$router.replace({
-                  path: '/tradeDetail',
-                  query: {
-                    orderNo: this.orderInfo.orderNo
-                  }
-                })
-              }
-            })
-          } else if (res.status === 'cancel' || res.status === 'fail') {
-            this.onCancel()
+        listenerMessage('paymentOperation', (res: any) =>
+          this.paymentOperation(res)
+        )
+      } catch {}
+    },
+    paymentOperation(res: any) {
+      if (res.status === 'success') {
+        Toast.clear()
+        this.$emit('update:modelValue', false)
+        this.$router.replace({
+          path: '/tradeDetail',
+          query: {
+            orderNo: this.orderInfo.orderNo
           }
           }
         })
         })
-      } catch {}
+      } else if (res.status === 'cancel') {
+        Toast.clear()
+        this.$emit('update:modelValue', false)
+      } else if (res.status === 'fail') {
+        Dialog.alert({
+          title: '提示',
+          message: '您尚未安装支付宝'
+        }).then(() => {
+          Toast.clear()
+          this.$emit('update:modelValue', false)
+        })
+      }
     }
     }
   },
   },
   render() {
   render() {

+ 8 - 3
src/views/order-detail/userAuth/index.tsx

@@ -3,6 +3,7 @@ import ColFieldGroup from '@/components/col-field-group'
 import ColHeader from '@/components/col-header'
 import ColHeader from '@/components/col-header'
 import request from '@/helpers/request'
 import request from '@/helpers/request'
 import { verifyIdCard } from '@/helpers/toolsValidate'
 import { verifyIdCard } from '@/helpers/toolsValidate'
+import { state } from '@/state'
 import { Button, CellGroup, Field, Form, Toast } from 'vant'
 import { Button, CellGroup, Field, Form, Toast } from 'vant'
 import { defineComponent } from 'vue'
 import { defineComponent } from 'vue'
 import styles from './index.module.less'
 import styles from './index.module.less'
@@ -29,13 +30,17 @@ export default defineComponent({
       try {
       try {
         await request.post('/api-auth/user/realNameAuth', {
         await request.post('/api-auth/user/realNameAuth', {
           data: {
           data: {
-            ...this.form
+            ...this.form,
+            save: true
           }
           }
         })
         })
         Toast('实名成功')
         Toast('实名成功')
-        // this.onSuccess()
+        state.user.data.realName = this.form.realName
+        state.user.data.idCard = this.form.idCardNo
+        setTimeout(() => {
+          this.onSuccess()
+        }, 500)
       } catch {}
       } catch {}
-      // verifyIdCard
     }
     }
   },
   },
   render() {
   render() {