瀏覽代碼

处理默认

lex 2 年之前
父節點
當前提交
ee8c3f65f4
共有 3 個文件被更改,包括 25 次插入2 次删除
  1. 1 1
      src/state.ts
  2. 22 0
      src/student/main.ts
  3. 2 1
      src/student/trade-record/component/paid-list.tsx

+ 1 - 1
src/state.ts

@@ -15,7 +15,7 @@ export const state = reactive({
     TEACHER: 'jmedu-teacher',
     SCHOOL: 'jmedu-school'
   },
-  platformApi: '/api-teacher' as '/api-student' | '/api-teacher' | '/api-school',
+  platformApi: '/api-student' as '/api-student' | '/api-teacher' | '/api-school',
   version: '', // 版本号 例如: 1.0.0
   ossUploadUrl: 'https://ks3-cn-beijing.ksyuncs.com/',
   musicCertStatus: false as boolean, // 是否音乐认证

+ 22 - 0
src/student/main.ts

@@ -8,6 +8,8 @@ import 'normalize.css'
 import '../styles/index.less'
 import { promisefiyPostMessage } from '@/helpers/native-message';
 import { setAuth } from './music-group/layout/utils';
+import { browser } from '@/helpers/utils';
+import { state } from '@/state';
 
 // 获取token
 promisefiyPostMessage({ api: 'getToken' }).then((res: any) => {
@@ -18,6 +20,26 @@ promisefiyPostMessage({ api: 'getToken' }).then((res: any) => {
   }
 })
 
+const paymentType = (window as any).paymentType // 浏览器设置
+if (browser().isTeacher || paymentType === 'TEACHER') {
+  state.platformType = 'TEACHER'
+} else if (browser().isStudent || paymentType === 'STUDENT') {
+  state.platformType = 'STUDENT'
+} else if (browser().isSchool || paymentType === 'SCHOOL') {
+  state.platformType = 'SCHOOL'
+} else {
+  state.platformType = 'STUDENT'
+}
+if (state.platformType === 'TEACHER') {
+  state.platformApi = '/api-teacher'
+} else if (state.platformType === 'SCHOOL') {
+  state.platformApi = '/api-school'
+} else if (state.platformType === 'STUDENT') {
+  state.platformApi = '/api-student'
+} else {
+  state.platformApi = '/api-student'
+}
+
 
 // import Vconsole from 'vconsole'
 // const vconsole = new Vconsole()

+ 2 - 1
src/student/trade-record/component/paid-list.tsx

@@ -242,7 +242,8 @@ export default defineComponent({
                 <Cell style={'padding: 0'}>
                   {{
                     title: () =>
-                      item.status === 'PAID' && (
+                      item.status === 'PAID' &&
+                      item.orderType === 'ORCHESTRA' && (
                         <Button
                           block
                           class={styles.refundBtn}