Browse Source

还差登录

shaogen1995 8 tháng trước cách đây
mục cha
commit
8cfb393c13

+ 4 - 3
后台管理/src/pages/A2orderSet/A2timeFlag.tsx

@@ -15,11 +15,11 @@ type Props = {
 
 const arr = [
   {
-    name: '可预约',
+    name: '可预约',
     num: 1
   },
   {
-    name: '可预约',
+    name: '可预约',
     num: 0
   }
 ]
@@ -27,7 +27,8 @@ const arr = [
 function A2timeFlag({ info, closeFu }: Props) {
   const btnClick = useCallback(
     (val: number) => {
-      if (val === info.num) return MessageFu.info(`当前已经是${info.num ? '' : '不'}可预约状态!`)
+      if (val === info.num)
+        return MessageFu.info(`当前已经是${info.num ? '' : '不'}可预约状态!`)
       closeFu(val as 0)
     },
     [closeFu, info.num]

+ 2 - 2
后台管理/src/pages/A2orderSet/index.tsx

@@ -56,9 +56,9 @@ function A2orderSet() {
             className='A2tabCli'
           >
             {item[v.key as 'monday'] === 1
-              ? '可预约'
-              : item[v.key as 'monday'] === 0
               ? '不可预约'
+              : item[v.key as 'monday'] === 0
+              ? '可预约'
               : ''}
           </span>
         )

+ 14 - 12
后台管理/src/pages/A6record/index.tsx

@@ -42,18 +42,20 @@ function A6record() {
         title: '操作',
         render: (item: A6tableType) => (
           <>
-            <Button
-              size='small'
-              type='text'
-              onClick={() =>
-                setAuthId({
-                  id: item.id,
-                  status: item.status
-                })
-              }
-            >
-              审核
-            </Button>
+            {item.status === 0 ? (
+              <Button
+                size='small'
+                type='text'
+                onClick={() =>
+                  setAuthId({
+                    id: item.id,
+                    status: item.status
+                  })
+                }
+              >
+                审核
+              </Button>
+            ) : null}
 
             <MyPopconfirm txtK='删除' onConfirm={() => delTableFu(item.id)} />
           </>

+ 8 - 30
后台管理/src/pages/B2exhiLog/B2look.tsx

@@ -1,40 +1,21 @@
-import React, { useCallback, useEffect } from 'react'
+import React, { useCallback, useEffect, useState } from 'react'
 import styles from './index.module.scss'
 import { Button, Modal } from 'antd'
 import { B2_APIgetInfo } from '@/store/action/B2exhiLog'
+import { B2SonListType } from './type'
 
 type Props = {
   sId: number
   closeFu: () => void
 }
 
-const arr = [
-  {
-    id: 1,
-    name: '啊萨达萨达是',
-    phone: '18702025050',
-    identity: '421083199504071212'
-  },
-  {
-    id: 2,
-    name: '王大锤',
-    phone: '18702025050',
-    identity: '421083199504071212'
-  },
-  {
-    id: 3,
-    name: '小溺😥',
-    phone: '18702025050',
-    identity: '421083199504071212'
-  }
-]
-
 function B2look({ sId, closeFu }: Props) {
+  const [list, setList] = useState<B2SonListType[]>([])
+
   const getInfoFu = useCallback(async (id: number) => {
     const res = await B2_APIgetInfo(id)
     if (res.code === 0) {
-      // 待完善 接口数据不明确
-      console.log(123, res)
+      setList(JSON.parse(res.data.rtf))
     }
   }, [])
 
@@ -51,13 +32,11 @@ function B2look({ sId, closeFu }: Props) {
         [] // 设置footer为空,去掉 取消 确定默认按钮
       }
     >
-      <div className='B2row'>
+      <div className='B2row B2rowOne'>
         <div className='B2box'>
           <div className='B2boxll'>申请时间:</div>
           <div className='B2boxrr'>2024-10-30 09:59:05</div>
         </div>
-        {/* 待完善 */}
-        {/* <div className='B2box'>验证状态:</div> */}
         <div className='B2box'>
           <div className='B2boxll'>预约日期:</div>
           <div className='B2boxrr'>2024-10-30</div>
@@ -67,11 +46,10 @@ function B2look({ sId, closeFu }: Props) {
           <div className='B2boxll'>预约时段:</div>
           <div className='B2boxrr'>08:00-09:00</div>
         </div>
-        <br />
       </div>
 
-      {arr.map(item => (
-        <div className='B2row' key={item.id}>
+      {list.map((item, index) => (
+        <div className='B2row' key={index}>
           <div className='B2box'>
             <div className='B2boxll'>参观人姓名:</div>
             <div className='B2boxrr'>{item.name}</div>

+ 4 - 0
后台管理/src/pages/B2exhiLog/index.module.scss

@@ -21,6 +21,10 @@
         padding: 10px 0;
         border-bottom: 1px solid #ccc;
       }
+      .B2rowOne {
+        border-bottom: 2px solid var(--themeColor);
+        margin-bottom: 20px;
+      }
 
       .B2box {
         display: flex;

+ 9 - 0
后台管理/src/pages/B2exhiLog/type.d.ts

@@ -12,3 +12,12 @@ export type B2tableType = {
   time: string
   updateTime: string
 }
+
+export type B2SonListType = {
+  bookDate: string
+  bookId: string
+  identity: string
+  name: string
+  phone: string
+  time: string
+}

+ 9 - 9
展示端/src/pages/A3selectDay/index.tsx

@@ -55,8 +55,8 @@ function A3selectDay() {
         // if(dayjs())
 
         const noeXisoShi = Number(dayjs(Date.now()).format('HH'))
-        if (noeXisoShi >= 12) arr[0].shangNum = -1
-        if (noeXisoShi >= 17) arr[0].xiaNum = -1
+        if (noeXisoShi >= 12) arr[0].shangNum = 2
+        if (noeXisoShi >= 17) arr[0].xiaNum = 2
 
         setList(arr)
       }
@@ -79,7 +79,7 @@ function A3selectDay() {
 
     if (res.code === 0) {
       const flag = res.data.time.usable
-      if (flag === 0 && res.data.time[val] !== 0) setAcObj({ id: idCuo, AmPm: val })
+      if (flag === 0 && res.data.time[val] === 0) setAcObj({ id: idCuo, AmPm: val })
       else MessageFu.info('当前预约时段已满')
     }
   }, [])
@@ -96,7 +96,7 @@ function A3selectDay() {
                 <div
                   className='A3row'
                   key={item.id}
-                  hidden={item.shangNum <= 0 && item.xiaNum <= 0}
+                  hidden={item.shangNum !== 0 && item.xiaNum !== 0}
                 >
                   <div className='A3R1'>
                     {item.time} {item.txt}
@@ -106,20 +106,20 @@ function A3selectDay() {
                       onClick={() => AmPmclick(item.id, 'am')}
                       className={classNames(
                         item.id === acObj.id && acObj.AmPm === 'am' ? 'A3ac' : '',
-                        item.shangNum > 0 ? '' : 'myBtnNo'
+                        item.shangNum !== 0 ? 'myBtnNo' : ''
                       )}
                     >
-                      {item.shangNum < 0 ? '上午已超时' : '上午'}
-                      {item.shangNum ? '' : '(已满)'}
+                      上午
+                      {item.shangNum === 1 ? '(已满)' : item.shangNum === 2 ? '(已超时)' : ''}
                     </div>
                     <div
                       onClick={() => AmPmclick(item.id, 'pm')}
                       className={classNames(
                         item.id === acObj.id && acObj.AmPm === 'pm' ? 'A3ac' : '',
-                        item.xiaNum > 0 ? '' : 'myBtnNo'
+                        item.xiaNum !== 0 ? 'myBtnNo' : ''
                       )}
                     >
-                      下午{item.xiaNum ? '' : '(已满)'}
+                      下午{item.xiaNum !== 0 ? '(已满)' : ''}
                     </div>
                   </div>
                 </div>

+ 3 - 3
展示端/src/pages/A4selectCourse/A4look/index.tsx

@@ -44,12 +44,12 @@ function A4look({ info, closeFu }: Props) {
 
     let arr: string[] = []
     if (introRtfFlag) arr.push('课程简介')
-    if (teamRtfFlag) arr.push('教师简介')
+    if (teamRtfFlag) arr.push('授课团队')
     if (infoRtfFlag) arr.push('预约须知')
     setTopArr(arr)
 
     if (introRtfFlag) setTopAc('课程简介')
-    else if (teamRtfFlag) setTopAc('教师简介')
+    else if (teamRtfFlag) setTopAc('授课团队')
     else if (infoRtfFlag) setTopAc('预约须知')
   }, [info, txtChange])
 
@@ -58,7 +58,7 @@ function A4look({ info, closeFu }: Props) {
   const txtRes = useMemo(() => {
     const obj = {
       课程简介: txtChange(info.introRtf, 'txt'),
-      教师简介: txtChange(info.teamRtf, 'txt'),
+      授课团队: txtChange(info.teamRtf, 'txt'),
       预约须知: txtChange(info.infoRtf, 'txt')
     }
     return Reflect.get(obj, topAc)

+ 1 - 3
展示端/src/pages/A5order/index.module.scss

@@ -31,9 +31,7 @@
           & > p {
             padding-right: 20px;
             margin-bottom: 6px;
-            overflow: hidden;
-            text-overflow: ellipsis;
-            white-space: nowrap;
+
             & > span {
               font-weight: 700;
               color: var(--themeColor2);

+ 151 - 65
展示端/src/pages/A5order/index.tsx

@@ -7,23 +7,31 @@ import TextArea from 'antd/es/input/TextArea'
 import { EyeOutlined, CloseOutlined } from '@ant-design/icons'
 import MyPopconfirm from '@/components/MyPopconfirm'
 import { ImageViewer } from 'antd-mobile'
-import { domShowFu } from '@/utils/domShow'
+import { domShowFu, fileDomInitialFu } from '@/utils/domShow'
 import dayjs from 'dayjs'
 import htmlToPdf2 from '@/utils/htmlToPdf2'
 import { MessageFu } from '@/utils/message'
 import ZinfoPop from '@/components/ZinfoPop'
 import history from '@/utils/history'
 import { useParams } from 'react-router-dom'
-import { A5_APIgetInfo } from '@/store/action/all'
+import {
+  A5_APIgetInfo,
+  A5_APIgetTemplateUrl,
+  A5_APIsave,
+  API_upFile,
+  upFileFu
+} from '@/store/action/all'
+import { FileType } from '@/types'
+import { baseURL } from '@/utils/http'
 
 type FormType = {
   name: string
   phone: string
   ID: string
-  num1: null | number
-  num2: null | null
-  jigou: string
-  miaoshu: string
+  pcsStudent: null | number
+  pcsTeacher: null | null
+  unit: string
+  remark: string
 }
 
 function A5order() {
@@ -35,9 +43,9 @@ function A5order() {
     name: ''
   })
 
-  useEffect(() => {
-    console.log('获取参数', urlObj)
-  }, [urlObj])
+  // useEffect(() => {
+  //   console.log('获取参数', urlObj)
+  // }, [urlObj])
 
   const urlObjTemp: any = useParams()
 
@@ -57,18 +65,33 @@ function A5order() {
     getInfo()
   }, [getInfo])
 
-  useEffect(() => {
-    FormBoxRef.current?.setFieldsValue({
-      name: '王大锤',
-      phone: '18702025091',
-      ID: '421083199504071212',
-      num1: 3,
-      num2: null,
-      jigou: '机构机构',
-      miaoshu: ''
-    })
+  // 获取模板下载地址
+  const [templateUrl, setTemplateUrl] = useState('')
+
+  const getTemplateUrlFu = useCallback(async () => {
+    const res = await A5_APIgetTemplateUrl()
+    if (res.code === 0) {
+      const obj = JSON.parse(res.data.rtf)
+      setTemplateUrl(obj.filePath)
+    }
   }, [])
 
+  useEffect(() => {
+    getTemplateUrlFu()
+  }, [getTemplateUrlFu])
+
+  // useEffect(() => {
+  //   FormBoxRef.current?.setFieldsValue({
+  //     name: '王大锤',
+  //     phone: '18702025091',
+  //     identity: '421083199504071212',
+  //     pcsStudent: 3,
+  //     pcsTeacher: null,
+  //     unit: '机构机构',
+  //     remark: ''
+  //   })
+  // }, [])
+
   // 表单的ref
   const FormBoxRef = useRef<FormInstance>(null)
 
@@ -83,48 +106,105 @@ function A5order() {
     2: ''
   })
 
+  // 附件图片信息
+  const [fileObj, setFileObj] = useState({} as FileType)
+
   // 打开提示弹窗
   const [titPop, setTitPop] = useState('')
 
   //  通过校验点击确定
-  const onFinish = useCallback(async (values: FormType) => {
-    setTitPop('succ')
-
-    console.log(123, values)
-    // domShowFu('#AsyncSpinLoding', true)
-
-    // setText({
-    //   1: values.jigou.replaceAll(/(\n|\r|\r\n)/g, '<br />'),
-    //   2: values.miaoshu.replaceAll(/(\n|\r|\r\n)/g, '<br />')
-    // })
-
-    // const time = dayjs(new Date()).format('YYYY-MM-DD HH:mm')
-    // setTime(time)
-    // window.setTimeout(() => {
-    //   const dom = document.querySelector('.A5listMain') as HTMLDivElement
-    //   if (dom) {
-    //     const name = '预约申请单'
-
-    //     htmlToPdf2(dom, name, () => {
-    //       // 打开预约成功的弹窗
-    //       // setTime('')
-    //       // domShowFu('#AsyncSpinLoding', false)
-    //     })
-    //   } else {
-    //     MessageFu.warning('找不到元素!')
-    //     setTime('')
-    //     domShowFu('#AsyncSpinLoding', false)
-    //   }
-    // }, 500)
-  }, [])
+  const onFinish = useCallback(
+    async (values: FormType) => {
+      domShowFu('#AsyncSpinLoding', true)
 
-  const [fileUrl, setFileUrl] = useState({
-    src: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
-    name: ''
-  })
+      setText({
+        1: values.unit.replaceAll(/(\n|\r|\r\n)/g, '<br />'),
+        2: values.remark.replaceAll(/(\n|\r|\r\n)/g, '<br />')
+      })
+
+      const time = dayjs(new Date()).format('YYYY-MM-DD HH:mm')
+      setTime(time)
+      window.setTimeout(() => {
+        const dom = document.querySelector('.A5listMain') as HTMLDivElement
+        if (dom) {
+          const name = '预约申请单.pdf'
+
+          // 成功之后的回调
+          htmlToPdf2(dom, name, async myfile => {
+            domShowFu('#AsyncSpinLoding', false)
+            // 创建FormData对象
+            const fd = new FormData()
+            fd.append('type', 'doc')
+            fd.append('dirCode', 'orderDoc')
+            fd.append('moduleName', 'apply')
+            fd.append('isDb', 'true')
+            fd.append('file', myfile)
+
+            // for (var [a, b] of fd.entries()) {
+            //   console.log(a, b)
+            // }
+
+            try {
+              const res = await API_upFile(fd, 'wx/upload')
+              if (res.code === 0) {
+                const obj = {
+                  ...values,
+                  bookDate: urlObj.bookDate,
+                  bookTime: urlObj.bookTime,
+                  subjectName: urlObj.name,
+                  fileIds: res.data.id + '',
+                  pcsTeacher: values.pcsTeacher === null ? 0 : values.pcsTeacher
+                }
+
+                if (fileObj.id) obj.fileIds += `,${fileObj.id}`
+
+                const res2 = await A5_APIsave(obj)
+                if (res2.code === 0) {
+                  // 打开预约成功的弹窗
+                  setTitPop('succ')
+                } else setTime('')
+              }
+              fileDomInitialFu()
+            } catch (error) {
+              setTime('')
+              fileDomInitialFu()
+            }
+          })
+        } else {
+          MessageFu.warning('找不到元素!')
+          setTime('')
+          domShowFu('#AsyncSpinLoding', false)
+        }
+      }, 500)
+    },
+    [fileObj.id, urlObj]
+  )
+
+  const myInput = useRef<HTMLInputElement>(null)
+
+  // 上传图片
+  const handeUpPhoto = useCallback(async (e: React.ChangeEvent<HTMLInputElement>) => {
+    upFileFu(
+      e,
+      'wx/upload',
+      5,
+      ['image/jpeg', 'image/png'],
+      '.jpg,.png',
+      data => setFileObj(data),
+      { type: 'img', dirCode: 'orderImg', moduleName: 'apply', isDb: 'true' }
+    )
+  }, [])
 
   return (
     <div className={styles.A5order}>
+      <input
+        id='upInput'
+        type='file'
+        accept='.jpg,.png'
+        ref={myInput}
+        onChange={e => handeUpPhoto(e)}
+      />
+
       <TopCom txt='填写信息' />
       <div className={classNames('A5main')}>
         <div className='A5list'>
@@ -185,7 +265,7 @@ function A5order() {
 
                   <Form.Item
                     label='身份证号'
-                    name='ID'
+                    name='identity'
                     rules={[
                       { required: true, message: '请输入身份证号!' },
                       {
@@ -205,13 +285,13 @@ function A5order() {
 
                   <Form.Item
                     label='参观学生人数'
-                    name='num1'
+                    name='pcsStudent'
                     rules={[{ required: true, message: '请输入参观学生人数!' }]}
                   >
                     <InputNumber min={0} max={999} precision={0} placeholder='请输入数字' />
                   </Form.Item>
 
-                  <Form.Item className='A5llmove' label='随堂老师人数' name='num2'>
+                  <Form.Item className='A5llmove' label='随堂老师人数' name='pcsTeacher'>
                     <InputNumber
                       min={0}
                       max={999}
@@ -241,14 +321,14 @@ function A5order() {
                       <Form.Item
                         className='A5Text20'
                         label='所属机构'
-                        name='jigou'
+                        name='unit'
                         rules={[{ required: true, message: '请输入所属机构!' }]}
                         getValueFromEvent={e => e.target.value.replace(/\s+/g, '')}
                       >
                         <TextArea autoSize placeholder='请输入内容,不超过20个字' maxLength={20} />
                       </Form.Item>
 
-                      <Form.Item label='团队描述' name='miaoshu' className='A5Text'>
+                      <Form.Item label='团队描述' name='remark' className='A5Text'>
                         <TextArea
                           autoSize
                           maxLength={200}
@@ -267,13 +347,13 @@ function A5order() {
               </Form>
 
               {/* 第三个卡片 */}
-              <div className='A5lKa' hidden={!!time && !fileUrl}>
+              <div className='A5lKa' hidden={!!time && !fileObj.filePath}>
                 <div className='A5tit'>健康生活教育课程预约单</div>
 
                 {time ? null : (
                   <div className='A5LA1'>
                     预约单模板
-                    <a className='A5LA1btn' href='xxx' download='预约单模板'>
+                    <a className='A5LA1btn' href={baseURL + templateUrl} download='预约单模板'>
                       下载
                     </a>
                   </div>
@@ -285,22 +365,28 @@ function A5order() {
                       <p>上传填写结果</p>
                       <span>仅限jpg,png格式;大小不超过5M;最多1个文件</span>
                     </div>
-                    <div className='A5LA1btn' hidden={!!fileUrl}>
+                    <div
+                      className='A5LA1btn'
+                      onClick={() => myInput.current?.click()}
+                      hidden={!!fileObj.filePath}
+                    >
                       上传
                     </div>
                   </div>
                 )}
 
-                {fileUrl.src ? (
+                {fileObj.filePath ? (
                   <div className='A5file'>
-                    <img src={fileUrl.src} alt='' />
+                    <img src={baseURL + fileObj.filePath} alt='' />
                     {time ? null : (
                       <div className='A5file2'>
-                        <EyeOutlined onClick={() => ImageViewer.show({ image: fileUrl.src })} />
+                        <EyeOutlined
+                          onClick={() => ImageViewer.show({ image: baseURL + fileObj.filePath })}
+                        />
 
                         <MyPopconfirm
                           txtK='删除'
-                          onConfirm={() => setFileUrl({ src: '', name: '' })}
+                          onConfirm={() => setFileObj({} as FileType)}
                           Dom={<CloseOutlined className='clearCover' />}
                         />
                       </div>

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 39 - 82
展示端/src/pages/A6my/index.tsx


+ 19 - 0
展示端/src/pages/A6my/type.d.ts

@@ -12,3 +12,22 @@ export type A6tableType2 = {
   updateTime: string
   wxUserId: number
 }
+export type A6tableType1 = {
+  bookDate: string
+  bookTime: string
+  createTime: string
+  creatorName: string
+  fileIds: string
+  id: number
+  identity: string
+  name: string
+  pcsStudent: number
+  pcsTeacher: number
+  phone: string
+  remark: string
+  status: number
+  subjectName: string
+  unit: string
+  updateTime: string
+  wxUserId: number
+}

+ 10 - 48
展示端/src/pages/A8proof/index.tsx

@@ -10,8 +10,7 @@ import { CloudUploadOutlined, EyeOutlined, CloseOutlined } from '@ant-design/ico
 import MyPopconfirm from '@/components/MyPopconfirm'
 import { ImageViewer } from 'antd-mobile'
 import { MessageFu } from '@/utils/message'
-import { A8_APIsave, API_upFile } from '@/store/action/all'
-import { fileDomInitialFu } from '@/utils/domShow'
+import { A8_APIsave, upFileFu } from '@/store/action/all'
 import { FileType } from '@/types'
 import { baseURL } from '@/utils/http'
 
@@ -72,52 +71,15 @@ function A8proof() {
   // 上传
   const handeUpPhoto = useCallback(
     async (e: React.ChangeEvent<HTMLInputElement>) => {
-      if (e.target.files) {
-        // 拿到files信息
-        const filesInfo = e.target.files[0]
-        // console.log("-----", filesInfo.type);
-
-        // 校验格式
-        const type = ['image/jpeg', 'image/png', 'application/pdf']
-
-        if (!type.includes(filesInfo.type)) {
-          e.target.value = ''
-          return MessageFu.warning(`只支持.pdf,.jpg,.png格式!`)
-        }
-
-        const size = 5
-
-        // 校验大小
-        if (filesInfo.size > size * 1024 * 1024) {
-          e.target.value = ''
-          return MessageFu.warning(`最大支持${size}M!`)
-        }
-        // 创建FormData对象
-        const fd = new FormData()
-        fd.append('type', 'doc')
-        fd.append('dirCode', 'ProofDoc')
-        fd.append('moduleName', 'auth')
-        fd.append('isDb', 'true')
-        fd.append('file', filesInfo)
-
-        // if (filesInfo.size > 1 * 1024 * 1024) {
-        //   // 开启压缩图片
-        //   fd.append('isCompress', 'true')
-        // }
-
-        e.target.value = ''
-
-        try {
-          const res = await API_upFile(fd, 'wx/upload')
-          if (res.code === 0) {
-            MessageFu.success('上传成功!')
-            setFileArr([...fileArr, res.data])
-          }
-          fileDomInitialFu()
-        } catch (error) {
-          fileDomInitialFu()
-        }
-      }
+      upFileFu(
+        e,
+        'wx/upload',
+        5,
+        ['image/jpeg', 'image/png', 'application/pdf'],
+        '.pdf,.jpg,.png',
+        data => setFileArr([...fileArr, data]),
+        { type: 'doc', dirCode: 'ProofDoc', moduleName: 'auth', isDb: 'true' }
+      )
     },
     [fileArr]
   )

+ 29 - 48
展示端/src/pages/B2myz/index.tsx

@@ -1,53 +1,34 @@
-import React from 'react'
+import React, { useCallback, useEffect, useState } from 'react'
 import styles from './index.module.scss'
 import ZexhiBtn from '@/components/ZexhiBtn'
 
 import noImg from '@/assets/img/exhibit/no.png'
+import { B2_APIgetList } from '@/store/action/all'
+import { B2ListType, B2SonListType } from './type'
 
-const list = [
-  {
-    id: 1,
-    time1: '2024-12-19',
-    time2: '14:30-16:00',
+function B2myz() {
+  const [loding, setLoding] = useState(false)
 
-    son: [
-      {
-        id: 1.1,
-        name: '阿三大苏打是',
-        phone: '18702025050',
-        ID: '421083199504071216'
-      },
-      {
-        id: 1.2,
-        name: '阿三',
-        phone: '18702025050',
-        ID: '421083199504071216'
-      },
-      {
-        id: 1.3,
-        name: '王大锤',
-        phone: '18702025050',
-        ID: '421083199504071216'
-      }
-    ]
-  },
-  {
-    id: 2,
-    time1: '2024-12-39',
-    time2: '14:30-16:00',
+  const [list, setList] = useState<B2ListType[]>([])
 
-    son: [
-      {
-        id: 1.1,
-        name: '阿三大苏打是',
-        phone: '18702025050',
-        ID: '421083199504071216'
-      }
-    ]
-  }
-]
+  const getListFu = useCallback(async () => {
+    const res = await B2_APIgetList()
+    if (res.code === 0) {
+      setLoding(true)
+      setList(res.data)
+    }
+  }, [])
+
+  useEffect(() => {
+    getListFu()
+  }, [getListFu])
+
+  const sonList = useCallback((val: string) => {
+    let arr: B2SonListType[] = []
+    arr = JSON.parse(val)
+    return arr
+  }, [])
 
-function B2myz() {
   return (
     <div className={styles.B2myz}>
       <div className='B2main'>
@@ -58,27 +39,27 @@ function B2myz() {
                 <div className='B2row1'>
                   <p>
                     <span>预约日期:</span>
-                    {item.time1}
+                    {item.bookDate}
                   </p>
                   <p>
                     <span>入馆时间:</span>
-                    {item.time2}
+                    {item.time}
                   </p>
                 </div>
 
-                {item.son.map((item2, index2) => (
-                  <div className='B2row2' key={item2.id}>
+                {sonList(item.rtf).map((item2, index2) => (
+                  <div className='B2row2' key={index2}>
                     <div className='B2row2_1'>参观人信息{index2 + 1}</div>
                     <p>参观人姓名:{item2.name}</p>
                     <p>联系方式:{item2.phone}</p>
-                    <p>身份证号:{item2.ID}</p>
+                    <p>身份证号:{item2.identity}</p>
                   </div>
                 ))}
               </div>
             ))}
           </>
         ) : (
-          <div className='B2No'>
+          <div className='B2No' hidden={!loding}>
             <img src={noImg} alt='' />
             <p>暂无预约信息</p>
           </div>

+ 24 - 0
展示端/src/pages/B2myz/type.d.ts

@@ -0,0 +1,24 @@
+export type B2ListType = {
+  bookDate: string
+  bookId: string
+  createTime: string
+  creatorName: string
+  id: number
+  name: string
+  pcs: number
+  phone: string
+  rtf: string
+  status: number
+  time: string
+  updateTime: string
+  wxUserId: number
+}
+
+export type B2SonListType = {
+  bookDate: string
+  bookId: string
+  identity: string
+  name: string
+  phone: string
+  time: string
+}

+ 7 - 144
展示端/src/pages/B3start/index.tsx

@@ -5,149 +5,9 @@ import dayjs from 'dayjs'
 import getWeekList, { TimeChageResType } from '@/utils/timeChange'
 import classNames from 'classnames'
 import history from '@/utils/history'
-import { B1_APIgetInfoByDay } from '@/store/action/all'
+import { B1_APIgetInfoByDay, B3_APIgetList } from '@/store/action/all'
 import { B3ListApiType, B3TimeArrType } from './type'
 
-export const listTemp = [
-  {
-    createTime: '2024-05-06 17:59:02',
-    creatorId: 1,
-    creatorName: '',
-    friday: 100,
-    id: 9,
-    monday: 0,
-    saturday: 100,
-    sunday: 100,
-    thursday: 1,
-    time: '08:00-09:00',
-    tuesday: 20,
-    updateTime: '2024-12-13 16:50:32',
-    wednesday: 100
-  },
-  {
-    createTime: '2024-05-06 17:59:02',
-    creatorId: 1,
-    creatorName: '',
-    friday: 100,
-    id: 10,
-    monday: 0,
-    saturday: 100,
-    sunday: 100,
-    thursday: 100,
-    time: '09:00-10:00',
-    tuesday: 100,
-    updateTime: '2024-12-13 16:50:32',
-    wednesday: 100
-  },
-  {
-    createTime: '2024-05-06 17:59:02',
-    creatorId: 1,
-    creatorName: '',
-    friday: 100,
-    id: 11,
-    monday: 0,
-    saturday: 100,
-    sunday: 100,
-    thursday: 100,
-    time: '10:00-11:00',
-    tuesday: 100,
-    updateTime: '2024-12-13 16:50:32',
-    wednesday: 100
-  },
-  {
-    createTime: '2024-05-06 17:59:02',
-    creatorId: 1,
-    creatorName: '',
-    friday: 100,
-    id: 12,
-    monday: 0,
-    saturday: 100,
-    sunday: 100,
-    thursday: 100,
-    time: '11:00-12:00',
-    tuesday: 100,
-    updateTime: '2024-12-13 16:50:33',
-    wednesday: 100
-  },
-  {
-    createTime: '2024-05-06 17:59:02',
-    creatorId: 1,
-    creatorName: '',
-    friday: 100,
-    id: 13,
-    monday: 0,
-    saturday: 100,
-    sunday: 100,
-    thursday: 100,
-    time: '14:00-15:00',
-    tuesday: 100,
-    updateTime: '2024-12-13 16:50:33',
-    wednesday: 100
-  },
-  {
-    createTime: '2024-05-06 17:59:02',
-    creatorId: 1,
-    creatorName: '',
-    friday: 100,
-    id: 14,
-    monday: 0,
-    saturday: 9999,
-    sunday: 100,
-    thursday: 100,
-    time: '15:00-16:00',
-    tuesday: 100,
-    updateTime: '2024-12-13 16:50:33',
-    wednesday: 100
-  },
-  {
-    createTime: '2024-05-06 17:59:02',
-    creatorId: 1,
-    creatorName: '',
-    friday: 100,
-    id: 15,
-    monday: 0,
-    saturday: 100,
-    sunday: 100,
-    thursday: 100,
-    time: '16:00-17:00',
-    tuesday: 100,
-    updateTime: '2024-12-13 16:50:33',
-    wednesday: 100
-  },
-  {
-    createTime: '2024-05-06 17:59:02',
-    creatorId: 1,
-    creatorName: '',
-    friday: 100,
-    id: 16,
-    monday: 0,
-    saturday: 100,
-    sunday: 100,
-    thursday: 100,
-    time: '17:00-18:00',
-    tuesday: 100,
-    updateTime: '2024-12-13 16:50:33',
-    wednesday: 100
-  },
-  {
-    createTime: '2024-12-13 16:15:31',
-    creatorId: 1,
-    creatorName: '',
-    friday: 0,
-    id: 17,
-    monday: 998,
-    saturday: 100,
-    sunday: 100,
-    thursday: 100,
-    time: '02:01-05:04',
-    tuesday: 100,
-    updateTime: '2024-12-13 16:50:33',
-    wednesday: 100
-  }
-]
-
-// 待完善列表接口信息
-
 function B3start() {
   const [list, setList] = useState<B3ListApiType[]>([])
 
@@ -158,7 +18,8 @@ function B3start() {
     const res = await B1_APIgetInfoByDay(dayjs().format('YYYY-MM-DD'))
 
     if (res.code === 0) {
-      setTimeout(() => {
+      const res2 = await B3_APIgetList()
+      if (res2.code === 0) {
         let noTime: string = res.data.stopDate
         let noTimeArr = noTime.replaceAll('月', '.').replaceAll('日', '').split(',')
         noTimeArr = noTimeArr.map(v => dayjs().format('YYYY') + '.' + v)
@@ -173,8 +34,8 @@ function B3start() {
         setZhouArr(arrRes)
 
         setLoding(true)
-        setList(listTemp)
-      }, 100)
+        setList(res2.data)
+      }
     }
   }, [])
 
@@ -284,6 +145,8 @@ function B3start() {
     [nowTime]
   )
 
+  //
+
   return (
     <div className={styles.B3start}>
       <div className='B3main'>

+ 26 - 18
展示端/src/pages/B4form/index.tsx

@@ -1,8 +1,6 @@
 import React, { useCallback, useEffect, useRef, useState } from 'react'
 import styles from './index.module.scss'
 import { useParams } from 'react-router-dom'
-// 待完善 上个页面的数组接口
-import { listTemp } from '../B3start'
 import ZexhiBtn from '@/components/ZexhiBtn'
 import { Button, Form, FormInstance, Input } from 'antd'
 import ZinfoPop from '@/components/ZinfoPop'
@@ -11,15 +9,17 @@ import classNames from 'classnames'
 import { MessageFu } from '@/utils/message'
 import delImg from '@/assets/img/exhibit/del.png'
 import MyPopconfirm from '@/components/MyPopconfirm'
+import { B3_APIgetList, B4_APIsave } from '@/store/action/all'
+import { B3ListApiType } from '../B3start/type'
 
 function B4form() {
-  useEffect(() => {
-    FormBoxRef.current?.setFieldsValue({
-      name1: '王大锤',
-      phone1: '18702025091',
-      identity1: '421083199504071212'
-    })
-  }, [])
+  // useEffect(() => {
+  //   FormBoxRef.current?.setFieldsValue({
+  //     name1: '王大锤',
+  //     phone1: '18702025091',
+  //     identity1: '421083199504071212'
+  //   })
+  // }, [])
 
   // 获取路由参数
   const [urlObj, setUrlObj] = useState({
@@ -30,16 +30,24 @@ function B4form() {
 
   const urlObjTemp: any = useParams()
 
-  useEffect(() => {
-    const index = Number(urlObjTemp.index)
+  const getInfoFu = useCallback(async () => {
+    const res = await B3_APIgetList()
+    if (res.code === 0) {
+      const list: B3ListApiType[] = res.data
+      const index = Number(urlObjTemp.index)
 
-    setUrlObj({
-      bookDate: urlObjTemp.bookDate.replaceAll('_', '-'),
-      bookId: listTemp[index].id,
-      time: listTemp[index].time
-    })
+      setUrlObj({
+        bookDate: urlObjTemp.bookDate.replaceAll('_', '-'),
+        bookId: list[index].id,
+        time: list[index].time
+      })
+    }
   }, [urlObjTemp])
 
+  useEffect(() => {
+    getInfoFu()
+  }, [getInfoFu])
+
   // 表单的ref
   const FormBoxRef = useRef<FormInstance>(null)
 
@@ -82,8 +90,8 @@ function B4form() {
           identity: values[`identity${v.id}`]
         })
       })
-
-      setTitPop('succ')
+      const res = await B4_APIsave(arr)
+      if (res.code === 0) setTitPop('succ')
     },
     [formArr, urlObj]
   )

+ 1 - 1
展示端/src/pages/Z1login/index.tsx

@@ -50,7 +50,7 @@ function Z1login() {
       // 用户信息存到本地
       setTokenInfo({
         token:
-          'eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJvakpPdDZBc1MyTUhKSUFLMWtqSV9FTllyRnIwIiwibG9naW5UeXBlIjoid3giLCJpZCI6MSwidXNlck5hbWUiOiJvakpPdDZBc1MyTUhKSUFLMWtqSV9FTllyRnIwIiwiZXhwIjoxNzM0MzI2NTAwLCJyb2xlS2V5cyI6WyJ3ZWJfdXNlciJdLCJpYXQiOjE3MzQyNDAxMDAsImp0aSI6IjYwMTQ3MWI2LThiZDMtNGIyOC05OGQ0LTVkOGE3MjM3MjA2NiJ9.q94qvpZ0IjtW2CVyKgvgzE6jjRTizIClP1_FpxaUtfU'
+          'eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJvakpPdDZBc1MyTUhKSUFLMWtqSV9FTllyRnIwIiwibG9naW5UeXBlIjoid3giLCJpZCI6MSwidXNlck5hbWUiOiJvakpPdDZBc1MyTUhKSUFLMWtqSV9FTllyRnIwIiwiZXhwIjoxNzM0NDE2MDc1LCJyb2xlS2V5cyI6WyJ3ZWJfdXNlciJdLCJpYXQiOjE3MzQzMjk2NzUsImp0aSI6IjI5MjNlZmZhLWNjNDctNGExMy05Y2ZlLTZiMjA5ZjU3N2Y4OSJ9.8yAERk2x_H5jU3WilD9X1hXTTNkRdiBQGvgI7LVZNRg'
       })
       // 跳到首页
       MessageFu.success('登录成功!')

+ 96 - 1
展示端/src/store/action/all.ts

@@ -1,5 +1,6 @@
-import { domShowFu, progressDomFu } from '@/utils/domShow'
+import { domShowFu, fileDomInitialFu, progressDomFu } from '@/utils/domShow'
 import http from '@/utils/http'
+import { MessageFu } from '@/utils/message'
 
 /**
  * 获取当前日期的配置信息(发送当天日期拿不可预约日期)
@@ -32,6 +33,20 @@ export const A5_APIgetInfo = (id: number) => {
 }
 
 /**
+ * 课堂预约 获取 模板下载地址
+ */
+export const A5_APIgetTemplateUrl = () => {
+  return http.get('wx/subject/template')
+}
+
+/**
+ * 课堂预约 提交
+ */
+export const A5_APIsave = (data: any) => {
+  return http.post('wx/subject/apply', data)
+}
+
+/**
  * 团体认证 - 检查
  */
 export const A4_APIcheck = () => {
@@ -46,6 +61,13 @@ export const A8_APIsave = (data: any) => {
 }
 
 /**
+ * 我的申请-预约申请
+ */
+export const A6_APIgetListYuYue = () => {
+  return http.get('wx/my/apply')
+}
+
+/**
  * 我的申请-认证申请
  */
 export const A6_APIgetListRenZheng = () => {
@@ -69,6 +91,29 @@ export const B1_APIgetInfoByDay = (day: string) => {
 }
 
 /**
+ * 获取预约日期列表
+ */
+export const B3_APIgetList = () => {
+  return http.get('exhibition/subject/config')
+}
+
+/**
+ * 提交
+ */
+export const B4_APIsave = (data: any) => {
+  return http.post('exhibition/apply', data)
+}
+
+/**
+ * 我的预约列表
+ */
+export const B2_APIgetList = () => {
+  return http.get('exhibition/my/apply')
+}
+
+// --------------------------------------------
+
+/**
  * 上传封面图和附件
  */
 export const API_upFile = (data: any, url: string) => {
@@ -83,3 +128,53 @@ export const API_upFile = (data: any, url: string) => {
     }
   })
 }
+
+export const upFileFu = async (
+  e: React.ChangeEvent<HTMLInputElement>,
+  url: string, //接口地址
+  size: number, //文件大小限制
+  type: string[], //文件类型限制
+  errTit: string, //文件类型校验不通过的提示
+  callFu: (data: any) => void, //回调函数
+  formObj: any //给后端的其他信息
+) => {
+  if (e.target.files) {
+    // 拿到files信息
+    const filesInfo = e.target.files[0]
+    // 校验格式
+    if (!type.includes(filesInfo.type)) {
+      e.target.value = ''
+      return MessageFu.warning(`只支持${errTit}格式!`)
+    }
+    // 校验大小
+    if (filesInfo.size > size * 1024 * 1024) {
+      e.target.value = ''
+      return MessageFu.warning(`最大支持${size}M!`)
+    }
+    // 创建FormData对象
+    const fd = new FormData()
+    if (formObj) {
+      for (const k in formObj) {
+        fd.append(k, formObj[k])
+      }
+    }
+    fd.append('file', filesInfo)
+
+    e.target.value = ''
+
+    // for (var [a, b] of fd.entries()) {
+    //   console.log(a, b)
+    // }
+
+    try {
+      const res = await API_upFile(fd, url)
+      if (res.code === 0) {
+        MessageFu.success('上传成功!')
+        callFu(res.data)
+      }
+      fileDomInitialFu()
+    } catch (error) {
+      fileDomInitialFu()
+    }
+  }
+}

+ 5 - 8
展示端/src/utils/htmlToPdf2.ts

@@ -8,7 +8,7 @@ import JsPDF from 'jspdf'
  * @param  callBackFu   完成之后的回调函数
  * */
 
-function downloadPDF2(ele: HTMLDivElement, pdfName: string, callBackFu: () => void) {
+function downloadPDF2(ele: HTMLDivElement, pdfName: string, callBackFu: (file: any) => void) {
   const eleW = ele.offsetWidth // 获得该容器的宽
   const eleH = ele.offsetHeight // 获得该容器的高
 
@@ -86,16 +86,13 @@ function downloadPDF2(ele: HTMLDivElement, pdfName: string, callBackFu: () => vo
     // 获取pdf的base64
     const pdfBase64Str = pdf.output('datauristring')
     const myfile = dataURLtoFile(pdfBase64Str, pdfName) //调用一下下面的转文件流函数
+    // 成功之后的回调
+    callBackFu(myfile)
 
-    const formdata = new FormData()
-    formdata.append('file', myfile) // 文件对象
-
-    console.log('formData上传后端', formdata)
-
-    // 可动态生成(下载)
+    // -------------可动态生成(下载)
     // pdf.save(pdfName)
     // 成功之后的回调
-    callBackFu()
+    // callBackFu()
   })
 }