wjx 3 yıl önce
ebeveyn
işleme
d62b61f283

+ 4 - 4
.umirc.js

@@ -3,10 +3,10 @@ export default {
   targets: {
     ie: 11,
   },
-  links: [ { rel: 'icon', href: 'http://questnet.cn/image/logo2.png',  }, ],
-  title:'趣程官网',
+  links: [{ rel: 'icon', href: 'http://questnet.cn/image/logo2.png', },],
+  title: '趣程官网',
   metas: [
-    {name: 'referrer', content: 'no-referrer'}
+    { name: 'referrer', content: 'no-referrer' }
   ],
   routes: [
     { path: '/', component: '@/pages/Home/index' },
@@ -14,5 +14,5 @@ export default {
     { path: '/introduce', component: '@/pages/Introduce/index' },
     { path: '/staffStyle', component: '@/pages/staffStyle/index' },
     { path: '/contact', component: '@/pages/ContactUs/index' }
-  ]
+  ],
 }

BIN
src/image/1.jpg


+ 0 - 0
src/image/6D11A1D9-4A4E-488B-B963-369E429C98D2.png → src/image/6D11A1D9-4A4E-488B-B963-369E429C98D2.jpg


BIN
src/image/d1.jpg


+ 53 - 0
src/pages/Home/index.jsx

@@ -61,8 +61,61 @@ export default class Home extends React.Component {
       }, 500);
     }
     /* 如果不是 dva 2.0 请删除 end */
+    // 预加载图片
+    ["http://questnet.cn/image/trophy/a.png",
+      "http://questnet.cn/image/trophy/b.png",
+      "http://questnet.cn/image/trophy/c.png",
+      "http://questnet.cn/image/trophy/d.png",
+      "http://questnet.cn/image/trophy/e.png",
+      "http://questnet.cn/image/trophy/f.png",
+      "http://questnet.cn/image/trophy/g.png",
+      "http://questnet.cn/image/trophy/h.png",
+      "http://questnet.cn/image/trophy/i.png",
+      "http://questnet.cn/image/trophy/j.png",
+      "http://questnet.cn/image/trophy/k.png",
+      "http://questnet.cn/image/trophy/l.png",
+      "http://questnet.cn/image/trophy/m.png",
+      "http://questnet.cn/image/sr/1.png",
+      "http://questnet.cn/image/sr/2.png",
+      "http://questnet.cn/image/sr/3.png",
+      "http://questnet.cn/image/sr/4.png",
+      "http://questnet.cn/image/sr/5.png",
+      "http://questnet.cn/image/sr/6.png",
+      "http://questnet.cn/image/sr/7.png",
+      "http://questnet.cn/image/sr/8.png",
+      "http://questnet.cn/image/sr/9.png",
+      "http://questnet.cn/image/sr/10.png",
+      "http://questnet.cn/image/sr/11.png",
+      "http://questnet.cn/image/sr/12.png",
+      "http://questnet.cn/image/sr/13.png",
+      "http://questnet.cn/image/sr/14.png",
+      "http://questnet.cn/image/sr/15.png",
+      "http://questnet.cn/image/sthd/21.png",
+      "http://questnet.cn/image/sthd/22.png",
+      "http://questnet.cn/image/sthd/23.png",
+      "http://questnet.cn/image/sthd/24.png",
+      "http://questnet.cn/image/sthd/25.png",
+      "http://questnet.cn/image/sthd/26.png",
+      "http://questnet.cn/image/sthd/27.png",
+      "http://questnet.cn/image/sthd/28.png",
+      "http://questnet.cn/image/sthd/29.png",
+      "http://questnet.cn/image/sthd/30.png",
+      "http://questnet.cn/image/sthd/31.png",
+      "http://questnet.cn/image/sthd/32.png",
+      "http://questnet.cn/image/sthd/33.png",
+      "http://questnet.cn/image/sthd/34.png",
+      "http://questnet.cn/image/sthd/35.png"].forEach((v, idx, arr) => {
+        let img = new Image();
+        img.src = v;
+        img.onload = () => {
+          arr.successLength = (arr.successLength || 0) + 1;
+          console.log(`进度:${arr.successLength / arr.length}`)
+        }
+      })
   }
 
+
+
   render() {
     const children = [
       <Nav0

+ 3 - 2
src/pages/StaffStyle/Activities.jsx

@@ -1,6 +1,6 @@
 import QueueAnim from 'rc-queue-anim';
 import PropTypes from 'prop-types';
-
+import { Image } from 'antd';
 
 let dataArray = [
     { image: 'http://questnet.cn/image/sthd/21.png' },
@@ -54,7 +54,8 @@ class Activities extends React.Component {
                             if(this.props.isMobile && index + 1 === 15) {
                                 return null
                             }
-                            return <img src={item.image} key={index}/>
+                            return <Image src={item.image} key={index} preview={false}/>
+                            // return <img src={item.image} key={index}/>
                         })
                     }
                 </QueueAnim>

+ 2 - 16
src/pages/StaffStyle/Banner2.jsx

@@ -5,34 +5,20 @@ import 'rc-banner-anim/assets/index.css';
 const videos = ['http://questnet.cn/image/1.mp4', 'http://questnet.cn/image/2.mp4', 'http://questnet.cn/image/3.mp4']
 function Banner(props) {
   const { isMobile, ...prop } = props;
-  const refVideo = React.useRef(null)
   const [curr, setCurr] = React.useState(0)  // 播放的哪条视频
 
-  React.useEffect(() => {
-    if(refVideo) {
-      console.log(1111, refVideo);
-      // refVideo.current.addEventListener('ended', () => { //结束
-      //   console.log("播放结束");
-      // }, false);
-    }
-  }, [refVideo])
-
   const endenHandle = React.useCallback(()=>{
     if(curr + 1 >= videos.length) {
       setCurr(0)
     }else{
       setCurr(curr + 1)
     }
-    if(refVideo) {
-      refVideo.current.play()
-    }
-  },[curr, refVideo])
+  },[curr])
 
   return (
     <div {...prop} className="Banner2_0_sty">
       <div className='home-header__video-bg'>
-        {/* poster="https://overwatch.nosdn.127.net/1/assets/img/pages/home/header-video-poster.jpg" */}
-        <video id="pc-video" muted="muted" ref={refVideo} autoPlay="autoplay" playsInline="playsinline" loop="loop" controls={true} webkit-playsinline="webkit-playsinline" x5-playsinline="x5-playsinline" poster={require('../../image/IMG_072912.jpg')}>
+        <video id="pc-video" muted="muted" autoPlay playsInline="playsinline" loop="loop" controls={true} webkit-playsinline="webkit-playsinline" x5-playsinline="x5-playsinline" poster={require('../../image/IMG_072912.jpg')}>
           <source src={videos[curr]} type="video/mp4" />
         </video>
         {/* {

+ 2 - 2
src/pages/StaffStyle/Birthday.jsx

@@ -53,8 +53,8 @@ class PicDetailsDemo extends React.Component {
                             if(this.props.isMobile && index + 1 === 15) {
                                 return null
                             }
-                            // return <Image src={item.image} key={index} />
-                            return <img src={item.image} key={index}/>
+                            return <Image src={item.image} key={index} preview={false}/>
+                            // return <img src={item.image} key={index}/>
                         })
                     }
                 </QueueAnim>

+ 1 - 1
src/pages/StaffStyle/index.jsx

@@ -74,7 +74,7 @@ export default class Home extends React.Component {
           <h1>员工活动</h1>
           <div>
             <div>
-              <img src={require('../../image/6D11A1D9-4A4E-488B-B963-369E429C98D2.png')} />
+              <img src={require('../../image/1.jpg')} />
               <h3>公司团建</h3>
               <p>趣程在每年的六七月份,面向员工组织公司团建,可以强身健体、增进员工与员工之间的感情。</p>
             </div>

+ 2 - 2
src/pages/StaffStyle/less/edit.less

@@ -96,7 +96,7 @@
   justify-content: space-between;
   flex-wrap: wrap;
   margin: 0 auto 40px;
-  img{
+  .ant-image{
     width: 19%;
     margin-bottom: 20px;
   }
@@ -105,7 +105,7 @@
 @media screen and (max-width: 767px) {
   .pic-details-demo-image-wrapper {
     margin: 0 10px;
-    img{
+    .ant-image{
       width: 48%;
     }
   }