shaogen1995 6 ماه پیش
والد
کامیت
4932ec9ad9

+ 11 - 7
后台管理/src/pages/A2orderSet/A2template.tsx

@@ -8,15 +8,19 @@ import { MessageFu } from '@/utils/message'
 
 type Props = {
   closeFu: () => void
+  type: '课程预约' | '团队认证'
 }
 
-function A2template({ closeFu }: Props) {
+function A2template({ closeFu, type }: Props) {
   // pdf的ref
   const ZupTxtRef = useRef<any>(null)
 
   // 获取设置
   const getEMfu = useCallback(async () => {
-    const res = await A2_APIgetConfig('cms/book/config/get', 13)
+    const res = await A2_APIgetConfig(
+      'cms/book/config/get',
+      type === '课程预约' ? 13 : 14
+    )
     if (res.code === 0) {
       // 设置附件
       const info = JSON.parse(res.data.rtf || '{}')
@@ -25,7 +29,7 @@ function A2template({ closeFu }: Props) {
         filePath: info.filePath || ''
       })
     }
-  }, [])
+  }, [type])
 
   useEffect(() => {
     getEMfu()
@@ -41,14 +45,14 @@ function A2template({ closeFu }: Props) {
     filePath = ZupTxtRefObj.filePath
 
     const res = await A2_APIsetConfig('cms/book/config/edit', {
-      id: 13,
+      id: type === '课程预约' ? 13 : 14,
       rtf: JSON.stringify({ fileName, filePath })
     })
     if (res.code === 0) {
-      MessageFu.success('设置预约单模板成功!')
+      MessageFu.success(`设置${type === '课程预约' ? '预约单' : '认证'}模板成功!`)
       closeFu()
     }
-  }, [closeFu])
+  }, [closeFu, type])
 
   return (
     <Modal
@@ -61,7 +65,7 @@ function A2template({ closeFu }: Props) {
     >
       {/* 附件 */}
       <div className='formRow'>
-        <div className='formLeft'>预约单模板:</div>
+        <div className='formLeft'>{type === '课程预约' ? '预约单' : '认证'}模板:</div>
         <div className='formRight'>
           <ZupOne
             ref={ZupTxtRef}

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

@@ -217,7 +217,9 @@ function A2orderSet() {
       ) : null}
 
       {/*预约单模板设置 */}
-      {template ? <A2template closeFu={() => setTemplate(false)} /> : null}
+      {template ? (
+        <A2template closeFu={() => setTemplate(false)} type='课程预约' />
+      ) : null}
     </div>
   )
 }

+ 1 - 1
后台管理/src/pages/A2orderSet/type.d.ts

@@ -17,7 +17,7 @@ export type A2listType = {
 
 export type A2NolistType = { id: string; time: string }
 
-export type A2NolistIdType = 10 | 11 | 12 | 13 | 15 | 16
+export type A2NolistIdType = 10 | 11 | 12 | 13 | 14 | 15 | 16
 
 export type A2setConfigType = 'cms/book/config/edit' | 'cms/configExhibition/setConfig'
 

+ 6 - 0
后台管理/src/pages/A4proveSuo/A4main/index.module.scss

@@ -1,6 +1,12 @@
 .A4main {
   background-color: #fff;
   border-radius: 10px;
+  :global {
+    .A4top {
+      padding: 15px 24px;
+      text-align: end;
+    }
+  }
 }
 
 // 审核页面的弹窗

+ 16 - 1
后台管理/src/pages/A4proveSuo/A4main/index.tsx

@@ -10,6 +10,7 @@ import MyPopconfirm from '@/components/MyPopconfirm'
 import { MessageFu } from '@/utils/message'
 import { A4tableC } from '@/utils/tableData'
 import A4auth from './A4auth'
+import A2template from '@/pages/A2orderSet/A2template'
 
 type Props = {
   type: 'live' | 'neighbour'
@@ -62,11 +63,20 @@ function A4main({ type }: Props) {
   // 点击审核
   const [authId, setAuthId] = useState(0)
 
+  const [template, setTemplate] = useState(false)
+
   return (
     <div className={styles.A4main}>
       <div className='pageTitle'>团队认证</div>
+
+      <div className='A4top'>
+        <Button type='primary' onClick={() => setTemplate(true)}>
+          认证单模板设置
+        </Button>
+      </div>
+
       <MyTable
-        yHeight={700}
+        yHeight={640}
         list={type === 'live' ? tableInfo1.list : tableInfo2.list}
         columnsTemp={A4tableC}
         lastBtn={tableLastBtn}
@@ -76,6 +86,11 @@ function A4main({ type }: Props) {
         onChange={(pageNum, pageSize) => setFromData({ ...fromData, pageNum, pageSize })}
       />
 
+      {/*认证模板设置 */}
+      {template ? (
+        <A2template closeFu={() => setTemplate(false)} type='团队认证' />
+      ) : null}
+
       {/* 点击审核 */}
       {authId ? (
         <A4auth sId={authId} closeFu={() => setAuthId(0)} editTableFu={getListFu} />

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

@@ -70,7 +70,7 @@ function A5order() {
   const [templateUrl, setTemplateUrl] = useState('')
 
   const getTemplateUrlFu = useCallback(async () => {
-    const res = await A5_APIgetTemplateUrl()
+    const res = await A5_APIgetTemplateUrl(13)
     if (res.code === 0) {
       const obj = JSON.parse(res.data.rtf)
       setTemplateUrl(obj.filePath)

+ 19 - 0
展示端/src/pages/A8proof/index.module.scss

@@ -93,6 +93,25 @@
             }
           }
         }
+        // 认证模板
+        .A8lKaDown {
+          display: flex;
+          justify-content: space-between;
+          align-items: center;
+          padding: 10px 20px;
+          .A8lKaDown1 {
+            font-weight: 700;
+          }
+          .A8lKaDown2 {
+            height: 40px;
+            padding: 0 20px;
+            line-height: 40px;
+            border-radius: 4px;
+            align-items: center;
+            color: #fff;
+            background-color: var(--themeColor2);
+          }
+        }
 
         .A8lKa2 {
           padding: 0;

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

@@ -10,7 +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, upFileFu } from '@/store/action/all'
+import { A5_APIgetTemplateUrl, A8_APIsave, upFileFu } from '@/store/action/all'
 import { FileType } from '@/types'
 import { baseURL } from '@/utils/http'
 
@@ -84,6 +84,21 @@ function A8proof() {
     [fileArr]
   )
 
+  // 获取模板下载地址
+  const [templateUrl, setTemplateUrl] = useState('')
+
+  const getTemplateUrlFu = useCallback(async () => {
+    const res = await A5_APIgetTemplateUrl(14)
+    if (res.code === 0) {
+      const obj = JSON.parse(res.data.rtf)
+      setTemplateUrl(obj.filePath)
+    }
+  }, [])
+
+  useEffect(() => {
+    getTemplateUrlFu()
+  }, [getTemplateUrlFu])
+
   return (
     <div className={styles.A8proof}>
       <input
@@ -144,6 +159,16 @@ function A8proof() {
               </Form.Item>
             </div>
 
+            {/* 中间的模板卡片 */}
+            {templateUrl ? (
+              <div className='A8lKa A8lKaDown'>
+                <div className='A8lKaDown1'>认证模板文件</div>
+                <a className='A8lKaDown2' href={baseURL + templateUrl} download='认证模板'>
+                  下载
+                </a>
+              </div>
+            ) : null}
+
             {/* 第二个卡片 */}
             <div className='A8lKa A8lKa2'>
               <div className='A8lKa2Top'>

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

@@ -247,7 +247,7 @@ function B4form() {
                   name='teamPcs'
                   rules={[{ required: true, message: '请输入参团人数!' }]}
                 >
-                  <InputNumber min={0} max={999} precision={0} placeholder='请输入数字' />
+                  <InputNumber min={1} max={999} precision={0} placeholder='请输入数字' />
                 </Form.Item>
 
                 <Form.Item label='团队描述' name='teamDesc' className='A5Text'>

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

@@ -35,8 +35,8 @@ export const A5_APIgetInfo = (id: number) => {
 /**
  * 课堂预约 获取 模板下载地址
  */
-export const A5_APIgetTemplateUrl = () => {
-  return http.get('wx/subject/template')
+export const A5_APIgetTemplateUrl = (id: number) => {
+  return http.get(`wx/subject/template/${id}`)
 }
 
 /**

+ 50 - 47
平板二维码扫码/src/pages/A3code/index.tsx

@@ -10,56 +10,61 @@ function A3code() {
 
   const [tit, setTit] = useState('正在尝试识别....')
 
+  // 异常扫码情况的处理
+  const errTitFu = useCallback((val: string) => {
+    codeReaderRef.current.reset()
+    setCodeErr(true)
+    setTit(val)
+  }, [])
+
   const didiRef = useRef<HTMLAudioElement>(null)
 
   const codeReaderRef = useRef(new BrowserMultiFormatReader())
 
-  const decodeFromInputVideoFunc = useCallback((firstDeviceId: string) => {
-    codeReaderRef.current.reset()
-    codeReaderRef.current.decodeFromInputVideoDeviceContinuously(
-      firstDeviceId,
-      'myVideo',
-      (result: any, err) => {
-        setTit('正在尝试识别...')
-        if (result && result.text) {
-          const txt: string = result.text
-          console.log('txt', txt)
-          if (txt) {
-            // 识别成功了,播放音频
-            if (didiRef.current) {
-              // 音频在播放中为 false
-              let flag = didiRef.current.paused
-
-              console.log('00', flag)
-
-              if (!flag) return
-              else {
-                didiRef.current.play()
-                didiRef.current.addEventListener('ended', () => {
-                  console.log('11播放完毕')
-
-                  if (txt.includes('HQ_CODE/')) {
-                    codeReaderRef.current.reset()
-                    const id = txt.split('/')[1]
-                    history.replace(`/codeSucc/${id}`)
-                  } else {
-                    codeReaderRef.current.reset()
-                    setCodeErr(true)
-                    setTit('二维码格式错误,请重试')
-                  }
-                })
+  const decodeFromInputVideoFunc = useCallback(
+    (firstDeviceId: string) => {
+      codeReaderRef.current.reset()
+      codeReaderRef.current.decodeFromInputVideoDeviceContinuously(
+        firstDeviceId,
+        'myVideo',
+        (result: any, err) => {
+          setTit('正在尝试识别...')
+          if (result && result.text) {
+            const txt: string = result.text
+            console.log('txt', txt)
+            if (txt) {
+              // 识别成功了,播放音频
+              if (didiRef.current) {
+                // 音频在播放中为 false
+                let flag = didiRef.current.paused
+
+                console.log('00', flag)
+
+                if (!flag) return
+                else {
+                  didiRef.current.play()
+                  didiRef.current.addEventListener('ended', () => {
+                    console.log('11播放完毕')
+
+                    if (txt.includes('HQ_CODE/')) {
+                      codeReaderRef.current.reset()
+                      const id = txt.split('/')[1]
+                      if (id) history.replace(`/codeSucc/${id}`)
+                      else errTitFu('参数错误')
+                    } else errTitFu('二维码格式错误,请重试')
+                  })
+                }
               }
             }
           }
+          if (err && !err) {
+            errTitFu('识别失败,请重试')
+          }
         }
-        if (err && !err) {
-          codeReaderRef.current.reset()
-          setCodeErr(true)
-          setTit('识别失败,请重试')
-        }
-      }
-    )
-  }, [])
+      )
+    },
+    [errTitFu]
+  )
 
   const openScan = useCallback(async () => {
     codeReaderRef.current
@@ -81,17 +86,15 @@ function A3code() {
         decodeFromInputVideoFunc(firstDeviceId)
       })
       .catch(err => {
-        codeReaderRef.current.reset()
-        setCodeErr(true)
-        setTit('识别失败,请重试')
+        errTitFu('识别失败,请重试')
       })
-  }, [decodeFromInputVideoFunc])
+  }, [decodeFromInputVideoFunc, errTitFu])
 
   useEffect(() => {
     openScan()
   }, [openScan])
 
-  // 重新扫描 刷页面
+  // 重新扫描 刷页面
   const newCode = useCallback(() => {
     window.location.reload()
   }, [])