فهرست منبع

Merge branch 'fine-music-score' into share-member

lex 2 سال پیش
والد
کامیت
e45f1d5f3b

+ 8 - 0
src/router/routes-common.ts

@@ -211,6 +211,14 @@ export const router = [
     meta: {
       title: '优惠券'
     }
+  },
+  {
+    path: '/previewProtocol',
+    name: 'previewProtocol',
+    component: () => import('@/views/preview-protocol/index'),
+    meta: {
+      title: '酷乐秀平台服务协议'
+    }
   }
 ]
 

+ 5 - 1
src/student/leaderboard/index.tsx

@@ -229,7 +229,11 @@ export default defineComponent({
                         {!item.rankingList.length && (
                           <Empty
                             image={IconEmtry}
-                            description="该曲目暂无排名喔~"
+                            description={`该${
+                              state.rankingMethod === 'TOTAL_SCORE'
+                                ? '声部'
+                                : '曲目'
+                            }暂无排名喔~`}
                           />
                         )}
                       </div>

+ 2 - 1
src/student/share-active/track-review-activity/index.tsx

@@ -263,6 +263,7 @@ export default defineComponent({
     async onOpenMusic() {
       try {
         const selectMusic = this.selectMusic
+        console.log(selectMusic, 'selectMusic')
         let evaluationId = ''
         // 判断是否是总分评测
         if (this.rankingMethod === 'TOTAL_SCORE') {
@@ -302,7 +303,7 @@ export default defineComponent({
             setting: JSON.stringify({
               mode: 'EVALUATING',
               resets: ['SPEED'],
-              difficulty: this.activeInfo.evaluationDifficulty,
+              difficulty: selectMusic.evaluationDifficulty,
               feeType: 'FREE',
               submitData: { evaluationId: this.selectMusic.evaluationId }
             })

+ 5 - 1
src/teacher/leaderboard/index.tsx

@@ -197,7 +197,11 @@ export default defineComponent({
                         {!item.rankingList.length && (
                           <Empty
                             image={IconEmtry}
-                            description="该曲目暂无排名喔~"
+                            description={`该${
+                              state.rankingMethod === 'TOTAL_SCORE'
+                                ? '声部'
+                                : '曲目'
+                            }暂无排名喔~`}
                           />
                         )}
                       </div>

+ 22 - 3
src/views/order-detail/index.tsx

@@ -45,7 +45,8 @@ export default defineComponent({
       paymentStatus: false,
       orderAmount: 0, // 订单金额,用于使用优惠券,余额,优惠等
       orderPrice: 0, // 支付金额,最后支付金额
-      dataLoading: true
+      dataLoading: true,
+      exists: false // 是否签署过用户注册协议
     }
   },
   unmounted() {
@@ -64,6 +65,7 @@ export default defineComponent({
     }
   },
   async mounted() {
+    await this.getUserRegisterProtocol()
     // 判断是否是曲目购买(只有智能陪练才会有入口),其它地方不会有入口
     this.dataLoading = true
     if (this.orderType == 'MUSIC' && this.id) {
@@ -105,8 +107,25 @@ export default defineComponent({
     }
   },
   methods: {
-    onAuthSuccess() {
+    async getUserRegisterProtocol() {
+      // 获取是否签署过《用户注册协议》
+      try {
+        const res = await request.get(
+          state.platformApi + '/sysUserContractRecord/checkContractSign',
+          {
+            params: {
+              contractType: 'REGISTER'
+            }
+          }
+        )
+        this.exists = res.data
+      } catch {
+        //
+      }
+    },
+    async onAuthSuccess() {
       this.popupShow = false
+      await this.getUserRegisterProtocol()
       this.onSubmit() // 实名成功后自动支付
     },
     async onSubmit() {
@@ -293,7 +312,7 @@ export default defineComponent({
           </>
         )}
         <ColPopup v-model={this.popupShow}>
-          <UserAuth onSuccess={this.onAuthSuccess} />
+          <UserAuth exists={this.exists} onSuccess={this.onAuthSuccess} />
         </ColPopup>
 
         <Popup

+ 35 - 0
src/views/order-detail/userAuth/index.module.less

@@ -7,4 +7,39 @@
     padding: 0 14px;
     padding-bottom: 15px;
   }
+
+  .colProtocol {
+    // display: flex;
+    // align-items: center;
+    font-size: 12px;
+    padding: 15px 14px;
+    color: #999;
+    .protocolText {
+      color: var(--van-primary);
+      line-height: 15px;
+    }
+
+    .boxStyle {
+      background: transparent !important;
+      width: 15px;
+      height: 15px;
+      border: transparent !important;
+    }
+    :global {
+      .van-checkbox {
+        display: inline-block;
+        align-items: inherit;
+        overflow: inherit;
+      }
+      .van-checkbox__icon {
+        height: 15px;
+        line-height: 15px;
+        display: inline-block;
+        vertical-align: middle;
+      }
+      .van-checkbox__label {
+        line-height: 15px;
+      }
+    }
+  }
 }

+ 57 - 5
src/views/order-detail/userAuth/index.tsx

@@ -4,8 +4,10 @@ import ColHeader from '@/components/col-header'
 import request from '@/helpers/request'
 import { verifyIdCard } from '@/helpers/toolsValidate'
 import { state } from '@/state'
-import { Button, CellGroup, Field, Form, Toast } from 'vant'
+import { Button, CellGroup, Checkbox, Field, Form, Icon, Toast } from 'vant'
 import { defineComponent } from 'vue'
+import activeButtonIcon from '@common/images/icon_checkbox.png'
+import inactiveButtonIcon from '@common/images/icon_checkbox_default.png'
 import styles from './index.module.less'
 
 export default defineComponent({
@@ -15,6 +17,10 @@ export default defineComponent({
       // 实名成功
       type: Function,
       default: () => {}
+    },
+    exists: {
+      type: Boolean,
+      default: false
     }
   },
   data() {
@@ -22,16 +28,29 @@ export default defineComponent({
       form: {
         realName: '',
         idCardNo: ''
-      }
+      },
+      checked: false
     }
   },
+  mounted() {
+    // exists
+    this.checked = this.checked || this.exists
+  },
   methods: {
     async onSubmit() {
       try {
-        await request.post('/api-auth/user/realNameAuth', {
+        if (!this.checked) {
+          Toast('请先阅读并同意《用户注册协议》')
+          return
+        }
+        const url =
+          state.platformType === 'STUDENT'
+            ? '/api-student/student/realNameAuth'
+            : '/api-teacher/teacher/realNameAuth'
+        await request.post(url, {
           data: {
             ...this.form,
-            save: true
+            contract: true
           }
         })
         Toast('实名成功')
@@ -41,6 +60,18 @@ export default defineComponent({
           this.onSuccess()
         }, 500)
       } catch {}
+    },
+    getContractDetail() {
+      // 查看协议
+      const client = state.platformType === 'STUDENT' ? 'student' : 'teacher'
+      postMessage({
+        api: 'openWebView',
+        content: {
+          url: `${location.origin}/${client}/#/previewProtocol`,
+          orientation: 1,
+          isHideTitle: false
+        }
+      })
     }
   },
   render() {
@@ -73,7 +104,28 @@ export default defineComponent({
             />
           </ColField>
         </ColFieldGroup>
-
+        <div class={styles.colProtocol}>
+          {!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>
+        </div>
         <div class={['btnGroup']}>
           <Button block round type="primary" native-type="submit">
             确定

+ 38 - 0
src/views/preview-protocol/index.tsx

@@ -0,0 +1,38 @@
+import request from '@/helpers/request'
+import { state } from '@/state'
+import { defineComponent } from 'vue'
+
+// 预览协议 - 原生实名认证使用
+export default defineComponent({
+  name: 'preview-protocol',
+  data() {
+    return {
+      protocolHTML: '' as any
+    }
+  },
+  async mounted() {
+    try {
+      // 判断是否有协议内容
+      if (!this.protocolHTML) {
+        const res = await request.get(
+          state.platformApi + '/sysUserContractRecord/queryContract',
+          {
+            params: {
+              contractType: 'REGISTER'
+            }
+          }
+        )
+        this.protocolHTML = res.data
+      }
+    } catch {
+      //
+    }
+  },
+  render() {
+    return (
+      <div id="mProtocol">
+        <div v-html={this.protocolHTML}></div>
+      </div>
+    )
+  }
+})