Bladeren bron

修改一波

shaogen1995 6 maanden geleden
bovenliggende
commit
61b24a32ba

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

@@ -39,7 +39,7 @@ function A2xuZhi({ closeFu, getSrc, setSrc, sId }: Props) {
     const res = await A2_APIsetConfig(setSrc, { id: sId, rtf: rtf.val || '' })
 
     if (res.code === 0) {
-      MessageFu.success('设置预约须知成功!')
+      MessageFu.success(`设置${sId === 17 ? '场馆介绍' : '预约须知'}成功!`)
       closeFu()
     }
   }, [closeFu, sId, setSrc])
@@ -48,7 +48,7 @@ function A2xuZhi({ closeFu, getSrc, setSrc, sId }: Props) {
     <Modal
       wrapClassName={styles.A2xuZhi}
       open={true}
-      title='预约须知'
+      title={sId === 17 ? '场馆介绍' : '预约须知'}
       footer={
         [] // 设置footer为空,去掉 取消 确定默认按钮
       }

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

@@ -157,7 +157,8 @@ function A2orderSet() {
   // 3333333333------------- 邮箱地址---------结束E-Mail
 
   // 444444444------------- 预约须知---------开始
-  const [xuZhi, setXuZhi] = useState(false)
+  // 11:预约须知
+  const [configId, setConfigId] = useState(0)
   // 444444444------------- 预约须知---------结束
 
   // 555555555------------- 预约单模板设置---------开始
@@ -173,7 +174,7 @@ function A2orderSet() {
           邮箱设置
         </Button>
         &emsp;
-        <Button type='primary' onClick={() => setXuZhi(true)}>
+        <Button type='primary' onClick={() => setConfigId(11)}>
           预约须知设置
         </Button>
         &emsp;
@@ -207,12 +208,12 @@ function A2orderSet() {
       {emShow ? <A2EMail closeFu={() => setEmShow(false)} /> : null}
 
       {/*预约须知 */}
-      {xuZhi ? (
+      {configId ? (
         <A2xuZhi
           setSrc='cms/book/config/edit'
           getSrc='cms/book/config/get'
-          sId={11}
-          closeFu={() => setXuZhi(false)}
+          sId={configId as 11}
+          closeFu={() => setConfigId(0)}
         />
       ) : null}
 

+ 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 | 14 | 15 | 16
+export type A2NolistIdType = 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17
 
 export type A2setConfigType = 'cms/book/config/edit' | 'cms/configExhibition/setConfig'
 

+ 10 - 5
后台管理/src/pages/B1exhibit/index.tsx

@@ -68,7 +68,8 @@ function B1exhibit() {
   // 1111111111111不可预约日期--------------结束
 
   // 2222222222------------- 预约须知---------开始
-  const [xuZhi, setXuZhi] = useState(false)
+  // 17:场馆介绍 16:预约须知
+  const [configId, setConfigId] = useState(0)
   // 2222222222------------- 预约须知---------结束
 
   return (
@@ -79,7 +80,11 @@ function B1exhibit() {
           设置不可预约日期
         </Button>
         &emsp;
-        <Button type='primary' onClick={() => setXuZhi(true)}>
+        <Button type='primary' onClick={() => setConfigId(17)}>
+          场馆介绍设置
+        </Button>
+        &emsp;
+        <Button type='primary' onClick={() => setConfigId(16)}>
           设置预约需知
         </Button>
         &emsp;
@@ -105,12 +110,12 @@ function B1exhibit() {
       ) : null}
 
       {/*预约须知 */}
-      {xuZhi ? (
+      {configId ? (
         <A2xuZhi
           setSrc='cms/configExhibition/setConfig'
           getSrc='cms/configExhibition/getConfig'
-          sId={16}
-          closeFu={() => setXuZhi(false)}
+          sId={configId as 16}
+          closeFu={() => setConfigId(0)}
         />
       ) : null}
     </div>

+ 36 - 42
小程序入口_嵌套展示端/pages/download/index.js

@@ -9,26 +9,44 @@ Page({
   },
 
   backUrl() {
-    console.log(123456);
     wx.navigateBack({
       delta: 1
     })
   },
 
+  // 预览文件
+  lookFileFu(savedFilePath, that) {
+    wx.openDocument({ //微信打开文件
+      filePath: savedFilePath,
+      showMenu: true,
+      success: function (res) {
+        that.setData({
+          text: '预览成功,点击返回继续',
+        });
+      },
+      fail: function (err) {
+        wx.showToast({
+          title: '预览失败',
+          icon: 'error',
+          duration: 1500
+        })
+        that.setData({
+          text: '预览失败'
+        });
+      }
+    });
+  },
+
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad(o) {
-
     if (o.url) {
-
       wx.showLoading({
         title: '下载中', //提示文字
         mask: true, //是否显示透明蒙层,防止触摸穿透,默认:false  
       })
-
       let that = this;
-
       console.log('--------url路径', decodeURI(o.url));
       const url = decodeURI(o.url)
       wx.downloadFile({
@@ -40,45 +58,21 @@ Page({
             //定义本地的存储路径及名称
             filePath: wx.env.USER_DATA_PATH + '/' + Date.now() + '.pdf',
             success(res) {
-
-              console.log('pppppp', res);
-
+              // console.log('pppppp', res);
               const savedFilePath = res.savedFilePath;
-              
-              console.log('xxxx', savedFilePath);
-
-              that.setData({
-                text: '正在加载,预览成功后点击右上角即可保存(ios手机需要发送给文件助手后保存)'
-              });
-
-              setTimeout(() => {
-                wx.hideLoading()
-                wx.openDocument({ //微信打开文件
-
-                  filePath: savedFilePath,
-                  showMenu: true,
-                  success: function (res) {
-  
-                  
-  
-                    that.setData({
-                      text: '预览成功,点击返回继续',
-                    });
-                  },
-                  fail: function (err) {
-                    wx.showToast({
-                      title: '预览失败',
-                      icon: 'error',
-                      duration: 1500
-                    })
-                    that.setData({
-                      text: '预览失败'
-                    });
+              // console.log('xxxx', savedFilePath);
+              wx.hideLoading()
+              wx.showModal({
+                title: '即将预览文件',
+                content: '点击右上角即可保存(ios手机需要发送给文件助手后保存)',
+                success: function (res) {
+                  if (res.confirm) {
+                    that.lookFileFu(savedFilePath,that)
+                  } else {
+                    that.lookFileFu(savedFilePath,that)
                   }
-                });
-              }, 2000);
-
-          
+                }
+              });
 
             },
             fail(err) {

+ 26 - 126
展示端/src/components/ZselectCity/data.ts

@@ -2410,38 +2410,38 @@ export const cityArr = [
         cityType: '地级市'
       },
       {
-        label: '清远市',
-        value: '清远市',
+        label: '珠海市',
+        value: '珠海市',
         cityType: '县级市'
       },
       {
-        label: '韶关市',
-        value: '韶关市',
+        label: '汕头市',
+        value: '汕头市',
         cityType: '县级市'
       },
       {
-        label: '河源市',
-        value: '河源市',
+        label: '佛山市',
+        value: '佛山市',
         cityType: '县级市'
       },
       {
-        label: '梅州市',
-        value: '梅州市',
+        label: '韶关市',
+        value: '韶关市',
         cityType: '县级市'
       },
       {
-        label: '潮州市',
-        value: '潮州市',
+        label: '河源市',
+        value: '河源市',
         cityType: '县级市'
       },
       {
-        label: '汕头市',
-        value: '汕头市',
+        label: '梅州市',
+        value: '梅州市',
         cityType: '县级市'
       },
       {
-        label: '揭阳市',
-        value: '揭阳市',
+        label: '惠州市',
+        value: '惠州市',
         cityType: '县级市'
       },
       {
@@ -2450,21 +2450,11 @@ export const cityArr = [
         cityType: '县级市'
       },
       {
-        label: '惠州市',
-        value: '惠州市',
-        cityType: '县级市'
-      },
-      {
         label: '东莞市',
         value: '东莞市',
         cityType: '县级市'
       },
       {
-        label: '珠海市',
-        value: '珠海市',
-        cityType: '县级市'
-      },
-      {
         label: '中山市',
         value: '中山市',
         cityType: '县级市'
@@ -2475,133 +2465,43 @@ export const cityArr = [
         cityType: '县级市'
       },
       {
-        label: '佛山市',
-        value: '佛山市',
-        cityType: '县级市'
-      },
-      {
-        label: '肇庆市',
-        value: '肇庆市',
-        cityType: '县级市'
-      },
-      {
-        label: '云浮市',
-        value: '云浮市',
-        cityType: '县级市'
-      },
-      {
         label: '阳江市',
         value: '阳江市',
         cityType: '县级市'
       },
       {
-        label: '茂名市',
-        value: '茂名市',
-        cityType: '县级市'
-      },
-      {
         label: '湛江市',
         value: '湛江市',
         cityType: '县级市'
       },
       {
-        label: '英德市',
-        value: '英德市',
-        cityType: '县级市'
-      },
-      {
-        label: '连州市',
-        value: '连州市',
-        cityType: '县级市'
-      },
-      {
-        label: '乐昌市',
-        value: '乐昌市',
-        cityType: '县级市'
-      },
-      {
-        label: '南雄市',
-        value: '南雄市',
-        cityType: '县级市'
-      },
-      {
-        label: '兴宁市',
-        value: '兴宁市',
-        cityType: '县级市'
-      },
-      {
-        label: '普宁市',
-        value: '普宁市',
-        cityType: '县级市'
-      },
-      {
-        label: '陆丰市',
-        value: '陆丰市',
-        cityType: '县级市'
-      },
-      {
-        label: '恩平市',
-        value: '恩平市',
-        cityType: '县级市'
-      },
-      {
-        label: '台山市',
-        value: '台山市',
-        cityType: '县级市'
-      },
-      {
-        label: '开平市',
-        value: '开平市',
-        cityType: '县级市'
-      },
-      {
-        label: '鹤山市',
-        value: '鹤山市',
-        cityType: '县级市'
-      },
-      {
-        label: '四会市',
-        value: '四会市',
-        cityType: '县级市'
-      },
-      {
-        label: '罗定市',
-        value: '罗定市',
-        cityType: '县级市'
-      },
-      {
-        label: '阳春市',
-        value: '阳春市',
-        cityType: '县级市'
-      },
-      {
-        label: '化州市',
-        value: '化州市',
+        label: '茂名市',
+        value: '茂名市',
         cityType: '县级市'
       },
       {
-        label: '信宜市',
-        value: '信宜市',
+        label: '肇庆市',
+        value: '肇庆市',
         cityType: '县级市'
       },
       {
-        label: '高州市',
-        value: '高州市',
+        label: '清远市',
+        value: '清远市',
         cityType: '县级市'
       },
       {
-        label: '吴川市',
-        value: '吴川市',
+        label: '潮州市',
+        value: '潮州市',
         cityType: '县级市'
       },
       {
-        label: '廉江市',
-        value: '廉江市',
+        label: '揭阳市',
+        value: '揭阳市',
         cityType: '县级市'
       },
       {
-        label: '雷州市',
-        value: '雷州市',
+        label: '云浮市',
+        value: '云浮市',
         cityType: '县级市'
       }
     ]

+ 3 - 0
展示端/src/pages/B1exhibit/index.module.scss

@@ -60,6 +60,9 @@
       .B1btn3 {
         background-color: var(--themeColor3);
       }
+      .B1btn4 {
+        width: 100%;
+      }
     }
   }
 }

+ 62 - 19
展示端/src/pages/B1exhibit/index.tsx

@@ -1,20 +1,33 @@
-import React, { useCallback, useEffect, useState } from 'react'
+import React, { useCallback, useEffect, useRef, useState } from 'react'
 import styles from './index.module.scss'
 
 import topImg from '@/assets/img/exhibit/top.png'
 import history from '@/utils/history'
-import { B1_APIgetInfoByDay } from '@/store/action/all'
+import { API_getConfigById, B1_APIgetInfoByDay } from '@/store/action/all'
 import dayjs from 'dayjs'
 
 import backImg from '@/assets/img/back.png'
+import { domShowFu } from '@/utils/domShow'
+
+type TabType = '场馆介绍' | '预约须知'
 
 function B1exhibit() {
   const [txt, setTxt] = useState('')
 
+  const [txt0, setTxt0] = useState('')
+
   const getTxtFu = useCallback(async () => {
-    const res = await B1_APIgetInfoByDay(dayjs().format('YYYY-MM-DD'))
-    if (res.code === 0) {
-      let obj = JSON.parse(res.data.notice)
+    const res0 = await API_getConfigById(17)
+
+    if (res0.code === 0) {
+      console.log(123, res0)
+      let info = JSON.parse(res0.data.rtf)
+      setTxt0(info.txtArr[0].txt)
+    }
+
+    const res1 = await B1_APIgetInfoByDay(dayjs().format('YYYY-MM-DD'))
+    if (res1.code === 0) {
+      let obj = JSON.parse(res1.data.notice)
 
       setTxt(obj.txtArr[0].txt)
     }
@@ -24,30 +37,60 @@ function B1exhibit() {
     getTxtFu()
   }, [getTxtFu])
 
-  const toHomeHtml = useCallback(() => {
-    window.location.href = '/web/home.html'
+  // 切换 场馆介绍 预约须知
+  const [tab, setTab] = useState<TabType>('场馆介绍')
+
+  // tab切换
+  const tabCutFu = useCallback((val: TabType) => {
+    domShowFu('#AsyncSpinLoding', true)
+
+    if (B1ref.current) B1ref.current.scrollTop = 0
+    setTimeout(() => {
+      setTab(val)
+      domShowFu('#AsyncSpinLoding', false)
+    }, 500)
   }, [])
 
+  const toHomeHtml = useCallback(() => {
+    if (tab === '场馆介绍') window.location.href = '/web/home.html'
+    else tabCutFu('场馆介绍')
+  }, [tab, tabCutFu])
+
+  // 主盒子 滚动
+  const B1ref = useRef<HTMLDivElement>(null)
+
   return (
-    <div className={styles.B1exhibit + ' myTextBox'}>
+    <div className={styles.B1exhibit + ' myTextBox'} ref={B1ref}>
       <div className='B1top'>
         <img src={topImg} alt='' />
         <img className='B1topBack' src={backImg} alt='' onClick={toHomeHtml} />
       </div>
 
-      <h1 className='B1tit'>预约须知</h1>
-      <div className='B1txt' dangerouslySetInnerHTML={{ __html: txt }}></div>
-      <div className='B1btn'>
-        <div className='B1btn1' onClick={() => history.push('/exhiMy')}>
-          我的预约
-        </div>
-        <div className='B1btn2' onClick={() => history.push('/exhiStart/1')}>
-          个人预约
+      <h1 className='B1tit'>{tab}</h1>
+      <div
+        className='B1txt'
+        dangerouslySetInnerHTML={{ __html: tab === '场馆介绍' ? txt0 : txt }}
+      ></div>
+
+      {tab === '场馆介绍' ? (
+        <div className='B1btn'>
+          <div className='B1btn4' onClick={() => tabCutFu('预约须知')}>
+            进行预约
+          </div>
         </div>
-        <div className='B1btn3' onClick={() => history.push('/exhiStart/2')}>
-          团队预约
+      ) : (
+        <div className='B1btn'>
+          <div className='B1btn1' onClick={() => history.push('/exhiMy')}>
+            我的预约
+          </div>
+          <div className='B1btn2' onClick={() => history.push('/exhiStart/1')}>
+            个人预约
+          </div>
+          <div className='B1btn3' onClick={() => history.push('/exhiStart/2')}>
+            团队预约
+          </div>
         </div>
-      </div>
+      )}
     </div>
   )
 }

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

@@ -32,7 +32,10 @@ function B3start() {
 
       // 过了晚上8点 之后 列表显示8个
       const nowXiaoShi = dayjs().hour()
-      let xiaoShi8 = nowXiaoShi >= 20 ? 8 : 7
+      // let xiaoShi8 = nowXiaoShi >= 20 ? 8 : 7
+
+      // 取消晚上8点,按晚上12点来
+      let xiaoShi8 = nowXiaoShi >= 20 ? 7 : 7
 
       const arr = getWeekList(undefined, undefined, xiaoShi8)
 

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

@@ -132,6 +132,13 @@ export const API_login = (code: string) => {
   return http.get(`show/wx/mpLogin?code=${code}`)
 }
 
+/**
+ * 通过id获取配置
+ */
+export const API_getConfigById = (id: number) => {
+  return http.get(`wx/dict/detail/${id}`)
+}
+
 // --------------------------------------------
 
 /**

+ 2 - 2
平板二维码扫码/src/App.tsx

@@ -40,8 +40,8 @@ export default function App() {
         <React.Suspense fallback={<SpinLoding />}>
           <Switch>
             <Route path='/login' component={Login} />
-            <Route path='/code' component={A3code} />
-            <Route path='/codeSucc/:id' component={A3codeSucc} />
+            <AuthRoute path='/code' component={A3code} />
+            <AuthRoute path='/codeSucc/:id' component={A3codeSucc} />
             <AuthRoute path='/' component={A1list} />
           </Switch>
         </React.Suspense>

+ 30 - 0
平板二维码扫码/src/pages/A2look/index.module.scss

@@ -93,5 +93,35 @@
         background-color: #fff;
       }
     }
+    .A2noTime {
+      position: absolute;
+      top: 0;
+      left: 0;
+      width: 100%;
+      height: 100%;
+      transition: all 0.3s;
+      opacity: 0;
+      pointer-events: none;
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      background-color: rgba(0, 0, 0, 0.7);
+      & > div {
+        background-color: #fff;
+        padding: 30px 50px 40px;
+        border-radius: 6px;
+        & > p {
+          margin: 20px 0 30px;
+          font-size: 20px;
+        }
+        .A2noTimeBtn {
+          text-align: center;
+        }
+      }
+    }
+    .A2noTimeAc {
+      opacity: 1;
+      pointer-events: auto;
+    }
   }
 }

+ 32 - 2
平板二维码扫码/src/pages/A2look/index.tsx

@@ -3,6 +3,10 @@ import styles from './index.module.scss'
 import { A2SonListType } from './type'
 import { A1_APIgetInfo, A1_APIupdate } from '@/store/action/A1list'
 import { MessageFu } from '@/utils/message'
+import dayjs from 'dayjs'
+import classNames from 'classnames'
+import { Button } from 'antd'
+import history from '@/utils/history'
 
 type Props = {
   sId: number
@@ -23,6 +27,9 @@ function A2look({ sId, closeFu, type, upTable }: Props) {
     teamDesc: ''
   })
 
+  // 预约的时间不是当天
+  const [isNowDay, setIsNowDay] = useState(false)
+
   const getInfoFu = useCallback(
     async (id: number) => {
       const res = await A1_APIgetInfo(id)
@@ -36,6 +43,13 @@ function A2look({ sId, closeFu, type, upTable }: Props) {
 
         setInfo(res.data)
         setList(JSON.parse(res.data.rtf))
+
+        // 判断预约时间是不是当天
+        const orderDay = dayjs(res.data.bookDate).format('MM_DD')
+        const nowDay = dayjs().format('MM_DD')
+
+        // 不是当天的日期
+        if (orderDay !== nowDay) setIsNowDay(true)
       }
     },
     [closeFu, type, upTable]
@@ -127,9 +141,11 @@ function A2look({ sId, closeFu, type, upTable }: Props) {
       {/* 按钮 */}
       <div
         className='A1Lbtn'
-        style={{ justifyContent: type === '查看' ? 'center' : 'space-between' }}
+        style={{
+          justifyContent: type === '查看' || isNowDay ? 'center' : 'space-between'
+        }}
       >
-        {type === '查看' ? null : (
+        {type === '查看' || isNowDay ? null : (
           <div className='A1Lbtn1' onClick={() => updateFu(sId, 1)}>
             核销
           </div>
@@ -139,6 +155,20 @@ function A2look({ sId, closeFu, type, upTable }: Props) {
           {type === '查看' ? '返回' : '取消'}
         </div>
       </div>
+
+      {/* 预约时间不属于当天 */}
+      <div className={classNames('A2noTime', isNowDay ? 'A2noTimeAc' : '')}>
+        <div>
+          <h3>无法核销</h3>
+          <p>该二维码不属于今日预约,无法核销</p>
+          <div className='A2noTimeBtn'>
+            <Button onClick={() => history.replace('/')}>回到首页</Button>&emsp;
+            <Button type='primary' onClick={() => history.replace('/code')}>
+              继续扫码
+            </Button>
+          </div>
+        </div>
+      </div>
     </div>
   )
 }