lex 2 years ago
parent
commit
defa5c3df8

+ 58 - 21
src/components/col-calendar/index.tsx

@@ -5,7 +5,7 @@ import dayjs from 'dayjs'
 import styles from './index.module.less'
 import IconArrow from '@/common/images/icon_arrow.png'
 import IconClock from '@/common/images/icon_clock.png'
-import { ElMessage } from 'element-plus'
+import { ElButton, ElDialog, ElMessage } from 'element-plus'
 
 export default defineComponent({
   name: 'calendar',
@@ -250,31 +250,68 @@ export default defineComponent({
             // 'bottom-info': (date: any) => <span>{date.type}</span>
           }}
         />
-
-        <Popup show={this.show} class={styles.calenderPopup}>
+        <ElDialog
+          modelValue={this.show}
+          onUpdate:modelValue={e => (this.show = e)}
+          class={styles.calenderPopup}
+        >
           <div class={styles.popup}>
             <div class={styles.title}>
-              {/* <Button
-                type="primary"
+              <span>{this.selectDayTitle}</span>
+            </div>
+
+            <div class={styles.container}>
+              {this.dayList.map((item: any) => (
+                <div>
+                  <Tag
+                    round
+                    class={[styles.tag, item.checked ? styles.active : '']}
+                    size="large"
+                    plain
+                    onClick={() => this.onSelectDay(item)}
+                  >
+                    {item.start}~{item.end}
+                  </Tag>
+                </div>
+              ))}
+              {this.dayList.length <= 0 && (
+                <div class={styles.noDay}>
+                  <Image src={IconClock} class={styles.clock} fit="cover" />
+                  <span>今日已约满</span>
+                </div>
+              )}
+            </div>
+
+            <div class={[styles.dayBtn, 'flex']}>
+              <ElButton
+                round
                 plain
-                style={{ border: 0 }}
-                size="small"
-                disabled={this.isPrevDay}
-                onClick={this.onPrevDay}
+                style={{ width: '33.33%', marginRight: '10px' }}
+                onClick={() => {
+                  this.show = false
+                  this.selectDays = []
+                }}
               >
-                上一日
-              </Button> */}
-              <span>{this.selectDayTitle}</span>
-              {/* <Button
+                取消
+              </ElButton>
+              <ElButton
                 type="primary"
-                plain
-                style={{ border: 0 }}
-                size="small"
-                disabled={this.isNextDay}
-                onClick={this.onNextDay}
+                round
+                disabled={!(this.selectDays.length > 0)}
+                onClick={() => {
+                  this.selectDay && this.selectDay(this.selectDays)
+                  this.show = false
+                }}
               >
-                下一日
-              </Button> */}
+                确认
+              </ElButton>
+            </div>
+          </div>
+        </ElDialog>
+        {/* <Popup show={this.show} class={styles.calenderPopup}>
+          <div class={styles.popup}>
+            <div class={styles.title}>
+              <span>{this.selectDayTitle}</span>
             </div>
 
             <div class={styles.container}>
@@ -325,7 +362,7 @@ export default defineComponent({
               </Button>
             </div>
           </div>
-        </Popup>
+        </Popup> */}
       </>
     )
   }

+ 4 - 1
src/helpers/request.ts

@@ -31,16 +31,19 @@ let initRequest = false
 
 request.interceptors.request.use(
   (url, options: any) => {
+    console.log(url)
     initRequest = options.initRequest || false
     const Authorization = getAuth() || ''
     const authHeaders: any = {}
+    console.log(/open/gi.test(url))
     if (
       Authorization &&
       ![
         '/api-auth/usernameLogin',
         '/api-auth/smsLogin',
         '/api-auth/code/sendSms'
-      ].includes(url)
+      ].includes(url) &&
+      !/open/gi.test(url)
     ) {
       authHeaders.Authorization = Authorization
     }

+ 1 - 1
src/views/user-info/live-operation/course-content/index.tsx

@@ -236,7 +236,7 @@ export default defineComponent({
             />
           </div>
 
-          <div class={[styles.arrangeCell, '!my-3']}>
+          <div class={[styles.arrangeCell, '!my-4']}>
             <div class={styles.rTitle}>
               <span>已选择课程时间</span>
             </div>

+ 0 - 2
src/views/user-info/live-operation/course-info/index.tsx

@@ -341,8 +341,6 @@ export default defineComponent({
             type="primary"
             class="!w-40 !h-[38px]"
             onClick={() => {
-              // createState.active = 1
-              // return
               ;(this as any).$refs.form.validate(async (valid: boolean) => {
                 if (valid) {
                   createState.active = 1

+ 4 - 4
src/views/user-info/live-operation/createState.ts

@@ -10,7 +10,7 @@ export const basePlan = {
 const original = () => {
   return {
     subjectList: [], // 声部列表
-    active: 0,
+    active: 2,
     rate: 0,
     minutes: [] as any,
     tabIndex: 1,
@@ -26,10 +26,10 @@ const original = () => {
       name: '',
       subjectId: null as any,
       courseIntroduce: '',
-      courseNum: null as any,
+      courseNum: 4 as any,
       singleCourseMinutes: 0,
-      singleMins: null as any,
-      freeMinutes: 0,
+      singleMins: 25 as any,
+      freeMinutes: 5,
       coursePrice: null as any,
       salesStartDate: '',
       salesEndDate: '',