Jelajahi Sumber

Merge branch 'master' of http://git.cc-lotus.info/live/web-live

lrf402788946 4 tahun lalu
induk
melakukan
d1af7b4a7f

+ 426 - 416
public/home.html

@@ -9,6 +9,8 @@
   <link rel="stylesheet" href="static/home/css/lib.css">
   <link rel="stylesheet" href="static/home/css/road.css">
   <link rel="stylesheet" href="static/home/css/index.css">
+  <script src="https://cdn.jsdelivr.net/npm/vue@2.6.12"></script>
+  <script src="https://cdn.staticfile.org/vue-resource/1.5.1/vue-resource.min.js"></script>
   <style>
     .canvas-stats {
       display: none;
@@ -24,40 +26,41 @@
     }
     .floating{
       width: 350px;
-      height: 150px;
+      height: 170px;
       background-image: url(./static/images/fuchuang.jpg);
       background-repeat: no-repeat;
-      background-size: 100%;
+      background-size: 100% 100%;
     }
-    .floatingInfo{
-      color: #F6FE6A;
+    .floating p:nth-child(1){
       text-align: center;
-      height: 150px;
-      padding: 10px 0;
-      font-size: 30px;
+      font-size: 20px;
       font-family: cursive;
-      text-shadow: 5px 5px 5px #000;
+      font-weight: bold;
+      /* -webkit-text-stroke: 1px #ffffff; */
+      padding: 10px 0;
+      color: #ffffff;
     }
-    .floatingInfo:hover{
-      cursor: pointer;
-      color: #76bdfe;
+    .floating p:nth-child(2){
+      text-align: center;
+      font-size: 32px;
+      font-family: cursive;
+      font-weight: bold;
+      -webkit-text-stroke: 1px #ffc900;
+      padding: 0px 20px 10px 20px;
+      color: #409eff;
     }
-    .floatingInfoSpan{
-      height: 150px;
-      padding: 10px 0;
-      text-shadow: 5px 5px 5px #000;
+    .floating p:nth-child(3){
+      text-align: center;
     }
-    .floatingInfoSpan span {
-      font-size: 16px;
+    .floating p:nth-child(3) button{
+      border: none;
+      padding: 5px 10px;
+      border-radius: 25px;
       color: #fff;
-      display: inline-block;
-      width: 100%;
-      padding: 3px 10px;
+      background: #409eff;
     }
-
-     .floatingInfoSpan span:hover{
+    .floating p:nth-child(3) button:hover{
       cursor: pointer;
-      color: #76bdfe;
     }
   </style>
 </head>
@@ -95,15 +98,10 @@
   <!-- 浮窗 -->
   <div id="floatingDiv" style="position:absolute;left:50px;top:60px;z-index: 9999;">
     <div id="a" onClick="javascript:this.parentNode.style.display='none';">关闭窗口</div>
-    <div class='floating' onclick="noticeBtn()">
-      <!-- <p id="floatingid" class='floatingInfo'></p> -->
-      <p class='floatingInfoSpan'>
-        <span>网站联系人:顾红伟</span>
-        <span>联系电话:</span>
-        <span>17319450324</span>
-        <span>微信号:</span>
-        <span>guhongwei324</span>
-      </p>
+    <div id="app" class='floating'>
+      <p>科技引领新发展 校地合作赢未来</p>
+      <p>{{info.title}}</p>
+      <p><button v-on:click="noticeBtn">展会入口</button></p>
     </div>
   </div>
   <!--流星-->
@@ -117,434 +115,446 @@
   <script src="static/home/js/stats.min.js"></script>
   <script src="static/home/js/three.min.js"></script>
   <script src="static/js/jquery-1.8.3.min.js"></script>
-  <script>
-    window.onload = function () {
-      $.ajax({
-        url:'/api/market/notice?isenable=1',
-        type:"GET",
-        contentType:'application/json',
-        success:function(res){
-          // console.log(res);
-          if(res.errcode =='0') {
-            if(res.data.length>0) {
-              var head = res.data[0];
-              $('#floatingid').text(head.title)
-            } 
-          }
+  <script type="text/javascript">
+    new Vue({
+      el: '#app',
+      data: {
+        info:{}
+      },
+      created() {
+        this.search();
+      },
+      computed: {},
+      methods: {
+        search(){
+          $.ajax({
+            url: '/api/live/v0/dock/index',
+            type: "GET",
+            contentType: 'application/json',
+            success:  (res)=> {
+              if (res.errcode == '0') {
+                let data=res.data.find(i=>i.room_id=='1008');
+                if (data) {
+                  this.$set(this, `info`, data);
+                }
+              }
+            },
+            error: function (e) {
+              console.error(e)
+            }
+          })
         },
-        error:function (e) {
-          console.error(e)
-        }
-      })
-    }
-    function ThreeJSCanvas(CANVAS_ID) {
-
-      var SCREEN_HEIGHT = Math.min(window.innerWidth, window.innerHeight);
-      var SCREEN_WIDTH = SCREEN_HEIGHT;
-      var SCREEN_ASPECT_RATIO = SCREEN_WIDTH / SCREEN_HEIGHT;
-      var canvas, container;
-
-      var container, loader, stats;
-      var renderer, camera, scene;
-      var raycaster, controls;
-
-      var ANIMATION_FRAME_LENGTH = 30,
-        INTERACT_DISTANCE = 2.5;
-      var objetArray = [],
-        animationQueue = [];
-
-      var color1 = [0 / 255, 110 / 255, 255 / 255],
-        color2 = [0 / 255, 255 / 255, 140 / 255];
-
-      var bitmap = [];
-      var BITMAP_SKIP = 1;
-
-      var fov = 90;
-      var cameraPos = [0, 0, 30];
-      var cameraLookAt = [0, 0, 0];
-      var viewHeight = 2 * Math.tan(THREE.Math.degToRad(fov / 2)) * cameraPos[2],
-        viewWidth = viewHeight * SCREEN_ASPECT_RATIO;
-      var mouse = new THREE.Vector3(10000, 10000, -1),
-        mouseScaled = new THREE.Vector3(10000, 10000, -1);
-
-      var frame = 0;
-
-      function init() {
-
-        // Global Variables
-        container = document.getElementById("canvas-container-" + CANVAS_ID);
-        canvas = document.getElementById("canvas-" + CANVAS_ID);
-        canvas.addEventListener('mousemove', onDocumentMouseMove, false);
-
-        loader = new THREE.JSONLoader();
-        stats = new Stats();
-        stats.domElement.classList.add("canvas-stats");
-        stats.domElement.id = "canvas-stats-" + CANVAS_ID;
-
-        /* If you are familiar with python and opencv
-           you can use this python script to generate custom bitmaps 
-           --------------------
-           https://git.io/vdBAu 
-           --------------------
-        */
-        var data = '#000000000000000000011110000000000000000000' +
-          '#000000000000000011111111110000000000000000' +
-          '#000000000000001111111111111100000000000000' +
-          '#000000000000011111111111111110000000000000' +
-          '#000000000000111111111111111111000000000000' +
-          '#000000000001111111111111111111100000000000' +
-          '#000000000011111111111111111111110000000000' +
-          '#000000000011111111111111111111110000000000' +
-          '#000000000111111111111111111111111000000000' +
-          '#000000000111111111111111111111111000000000' +
-          '#000000001111111111111111111111111100000000' +
-          '#000000001111111111111111111111111100000000' +
-          '#000000001111111111111111111111111100000000' +
-          '#000000001111111111111111111111111100000000' +
-          '#000000001111111111111111111111111100000000' +
-          '#000000000111111111111111111111111000000000' +
-          '#000000000111111111111111111111111000000000' +
-          '#000000000111111111111111111111111000000000' +
-          '#000000000011111111111111111111110000000000' +
-          '#000000000011111111111111111111110000000000' +
-          '#000000000001111111111111111111100000000000' +
-          '#000000000001111111111111111111100000000000' +
-          '#000000000000111111111111111111000000000000' +
-          '#000000000000111111111111111110000000000000' +
-          '#000000000000011111111111111110000000000000' +
-          '#000000000000001111111111111100000000000000' +
-          '#000000000000001111111111111100000000000000' +
-          '#000000000000001111111111111000000000000000' +
-          '#000000000000000111111111111000000000000000' +
-          '#000000000000000111111111111000000000000000' +
-          '#000000000000000111111111111000000000000000' +
-          '#000000000000000111111111111000000000000000' +
-          '#000000000000000011111111110000000000000000' +
-          '#000000000000000010000000010000000000000000' +
-          '#000000000000000011111111110000000000000000' +
-          '#000000000000000010000000010000000000000000' +
-          '#000000000000000011111111110000000000000000' +
-          '#000000000000000010000000010000000000000000' +
-          '#000000000000000011111111110000000000000000' +
-          '#000000000000000000100001000000000000000000' +
-          '#000000000000000000110011000000000000000000' +
-          '#000000000000000000011110000000000000000000';
-
-        for (var i = 0; i < data.length; i++) {
-          if (data[i] == '#') {
-            bitmap.push([]);
-          } else {
-            bitmap[bitmap.length - 1].push(data[i] - '0');
+        noticeBtn(){
+          if (this.info.status=='1') {
+            window.location.href = `/platlive/achieveLive/detail?id=${this.info.id}`
+          }else{
+            alert(`展会尚未开启,展会开始时间:${this.info.start_time}!`)
           }
+          
+        }
+      },
+    })
+</script>
+<script>
+  function ThreeJSCanvas(CANVAS_ID) {
+    var SCREEN_HEIGHT = Math.min(window.innerWidth, window.innerHeight);
+    var SCREEN_WIDTH = SCREEN_HEIGHT;
+    var SCREEN_ASPECT_RATIO = SCREEN_WIDTH / SCREEN_HEIGHT;
+    var canvas, container;
+
+    var container, loader, stats;
+    var renderer, camera, scene;
+    var raycaster, controls;
+
+    var ANIMATION_FRAME_LENGTH = 30,
+      INTERACT_DISTANCE = 2.5;
+    var objetArray = [],
+      animationQueue = [];
+
+    var color1 = [0 / 255, 110 / 255, 255 / 255],
+      color2 = [0 / 255, 255 / 255, 140 / 255];
+
+    var bitmap = [];
+    var BITMAP_SKIP = 1;
+
+    var fov = 90;
+    var cameraPos = [0, 0, 30];
+    var cameraLookAt = [0, 0, 0];
+    var viewHeight = 2 * Math.tan(THREE.Math.degToRad(fov / 2)) * cameraPos[2],
+      viewWidth = viewHeight * SCREEN_ASPECT_RATIO;
+    var mouse = new THREE.Vector3(10000, 10000, -1),
+      mouseScaled = new THREE.Vector3(10000, 10000, -1);
+
+    var frame = 0;
+
+    function init() {
+
+      // Global Variables
+      container = document.getElementById("canvas-container-" + CANVAS_ID);
+      canvas = document.getElementById("canvas-" + CANVAS_ID);
+      canvas.addEventListener('mousemove', onDocumentMouseMove, false);
+
+      loader = new THREE.JSONLoader();
+      stats = new Stats();
+      stats.domElement.classList.add("canvas-stats");
+      stats.domElement.id = "canvas-stats-" + CANVAS_ID;
+
+      /* If you are familiar with python and opencv
+          you can use this python script to generate custom bitmaps 
+          --------------------
+          https://git.io/vdBAu 
+          --------------------
+      */
+      var data = '#000000000000000000011110000000000000000000' +
+        '#000000000000000011111111110000000000000000' +
+        '#000000000000001111111111111100000000000000' +
+        '#000000000000011111111111111110000000000000' +
+        '#000000000000111111111111111111000000000000' +
+        '#000000000001111111111111111111100000000000' +
+        '#000000000011111111111111111111110000000000' +
+        '#000000000011111111111111111111110000000000' +
+        '#000000000111111111111111111111111000000000' +
+        '#000000000111111111111111111111111000000000' +
+        '#000000001111111111111111111111111100000000' +
+        '#000000001111111111111111111111111100000000' +
+        '#000000001111111111111111111111111100000000' +
+        '#000000001111111111111111111111111100000000' +
+        '#000000001111111111111111111111111100000000' +
+        '#000000000111111111111111111111111000000000' +
+        '#000000000111111111111111111111111000000000' +
+        '#000000000111111111111111111111111000000000' +
+        '#000000000011111111111111111111110000000000' +
+        '#000000000011111111111111111111110000000000' +
+        '#000000000001111111111111111111100000000000' +
+        '#000000000001111111111111111111100000000000' +
+        '#000000000000111111111111111111000000000000' +
+        '#000000000000111111111111111110000000000000' +
+        '#000000000000011111111111111110000000000000' +
+        '#000000000000001111111111111100000000000000' +
+        '#000000000000001111111111111100000000000000' +
+        '#000000000000001111111111111000000000000000' +
+        '#000000000000000111111111111000000000000000' +
+        '#000000000000000111111111111000000000000000' +
+        '#000000000000000111111111111000000000000000' +
+        '#000000000000000111111111111000000000000000' +
+        '#000000000000000011111111110000000000000000' +
+        '#000000000000000010000000010000000000000000' +
+        '#000000000000000011111111110000000000000000' +
+        '#000000000000000010000000010000000000000000' +
+        '#000000000000000011111111110000000000000000' +
+        '#000000000000000010000000010000000000000000' +
+        '#000000000000000011111111110000000000000000' +
+        '#000000000000000000100001000000000000000000' +
+        '#000000000000000000110011000000000000000000' +
+        '#000000000000000000011110000000000000000000';
+
+      for (var i = 0; i < data.length; i++) {
+        if (data[i] == '#') {
+          bitmap.push([]);
+        } else {
+          bitmap[bitmap.length - 1].push(data[i] - '0');
         }
+      }
 
-        container.appendChild(stats.domElement);
-
-        // Renderer
-        renderer = new THREE.WebGLRenderer({
-          alpha: true,
-          antialias: true,
-          canvas: canvas,
-        });
-        renderer.setClearColor(0x212121, 0);
-        renderer.setPixelRatio(window.devicePixelRatio);
-        renderer.shadowMap.enabled = true;
-        renderer.shadowMap.type = THREE.PCFSoftShadowMap;
-        renderer.setSize(SCREEN_WIDTH, SCREEN_HEIGHT);
-
-        // Camera and Controls
-        camera = new THREE.PerspectiveCamera(fov, SCREEN_ASPECT_RATIO, 0.1, 1000);
-        // camera = new THREE.OrthographicCamera(-viewWidth, viewWidth, viewHeight, -viewHeight, 1, 300);
-        camera.position.set(cameraPos[0], cameraPos[1], cameraPos[2]);
-        camera.lookAt(new THREE.Vector3(cameraLookAt[0], cameraLookAt[1], cameraLookAt[2]));
-        raycaster = new THREE.Raycaster();
-
-        // controls = new THREE.OrbitControls(camera);
-        // controls.rotateSpeed = 2.0;
-        // controls.zoomSpeed = 2.0;
-        // controls.enableZoom = true;
-        // controls.enablePan = true;
-        // controls.dampingFactor = 0.2;
-        // controls.addEventListener('change', render);
-
-        //Scene
-        scene = new THREE.Scene();
-
-
-        //Lights
-
-        // Making Object Array
-        var xOffset = -bitmap[0].length / (BITMAP_SKIP * 2);
-        var yOffset = bitmap.length / (BITMAP_SKIP * 2);
-        for (var i = 0; i < bitmap.length; i += BITMAP_SKIP) {
-          for (var j = 0; j < bitmap[i].length; j += BITMAP_SKIP) {
-            if (bitmap[i][j] == 1) {
-              planeGeometry = new THREE.PlaneGeometry(1, 1);
-              var circleGeometry = new THREE.CircleGeometry(1, 5);
-              var frac = i / bitmap.length;
-              // Materials
-              planeMaterial = new THREE.MeshBasicMaterial({
-                color: new THREE.Color(
-                  color1[0] * frac + color2[0] * (1 - frac),
-                  color1[1] * frac + color2[1] * (1 - frac),
-                  color1[2] * frac + color2[2] * (1 - frac)
-                ),
-                transparent: true,
-                opacity: THREE.Math.randFloat(0.4, 0.6),
-                side: THREE.DoubleSide
-              });
-
-              var circleMaterial = new THREE.MeshBasicMaterial({
-                color: new THREE.Color(1, 1, 1),
-                transparent: true,
-                opacity: THREE.Math.randFloat(0.8, 1),
-                side: THREE.DoubleSide
-              });
-
-              // Mesh
-              planeMesh = new THREE.Mesh(planeGeometry, planeMaterial);
-              planeMesh.position.set(xOffset + j / BITMAP_SKIP, yOffset - i / BITMAP_SKIP, 0);
-              var randWidth = THREE.Math.randFloat(0.6, 1.2);
-              var randHeight = randWidth
-              planeMesh.scale.set(randWidth, randHeight, 1);
-              scene.add(planeMesh);
-              objetArray.push([planeMesh, false]);
-
-
-              circleMesh = new THREE.Mesh(circleGeometry, circleMaterial);
-              circleMesh.position.set(xOffset + j / BITMAP_SKIP + THREE.Math.randFloat(-0.5, 0.5), yOffset - i / BITMAP_SKIP + THREE.Math.randFloat(-0.5, 0.5), 0.1);
-              var randRadius = THREE.Math.randFloat(0.05, 0.1);
-              circleMesh.scale.set(randRadius, randRadius, 1);
-              scene.add(circleMesh);
-              objetArray.push([circleMesh, false]);
-            }
+      container.appendChild(stats.domElement);
 
+      // Renderer
+      renderer = new THREE.WebGLRenderer({
+        alpha: true,
+        antialias: true,
+        canvas: canvas,
+      });
+      renderer.setClearColor(0x212121, 0);
+      renderer.setPixelRatio(window.devicePixelRatio);
+      renderer.shadowMap.enabled = true;
+      renderer.shadowMap.type = THREE.PCFSoftShadowMap;
+      renderer.setSize(SCREEN_WIDTH, SCREEN_HEIGHT);
+
+      // Camera and Controls
+      camera = new THREE.PerspectiveCamera(fov, SCREEN_ASPECT_RATIO, 0.1, 1000);
+      // camera = new THREE.OrthographicCamera(-viewWidth, viewWidth, viewHeight, -viewHeight, 1, 300);
+      camera.position.set(cameraPos[0], cameraPos[1], cameraPos[2]);
+      camera.lookAt(new THREE.Vector3(cameraLookAt[0], cameraLookAt[1], cameraLookAt[2]));
+      raycaster = new THREE.Raycaster();
+
+      // controls = new THREE.OrbitControls(camera);
+      // controls.rotateSpeed = 2.0;
+      // controls.zoomSpeed = 2.0;
+      // controls.enableZoom = true;
+      // controls.enablePan = true;
+      // controls.dampingFactor = 0.2;
+      // controls.addEventListener('change', render);
+
+      //Scene
+      scene = new THREE.Scene();
+
+
+      //Lights
+
+      // Making Object Array
+      var xOffset = -bitmap[0].length / (BITMAP_SKIP * 2);
+      var yOffset = bitmap.length / (BITMAP_SKIP * 2);
+      for (var i = 0; i < bitmap.length; i += BITMAP_SKIP) {
+        for (var j = 0; j < bitmap[i].length; j += BITMAP_SKIP) {
+          if (bitmap[i][j] == 1) {
+            planeGeometry = new THREE.PlaneGeometry(1, 1);
+            var circleGeometry = new THREE.CircleGeometry(1, 5);
+            var frac = i / bitmap.length;
+            // Materials
+            planeMaterial = new THREE.MeshBasicMaterial({
+              color: new THREE.Color(
+                color1[0] * frac + color2[0] * (1 - frac),
+                color1[1] * frac + color2[1] * (1 - frac),
+                color1[2] * frac + color2[2] * (1 - frac)
+              ),
+              transparent: true,
+              opacity: THREE.Math.randFloat(0.4, 0.6),
+              side: THREE.DoubleSide
+            });
+
+            var circleMaterial = new THREE.MeshBasicMaterial({
+              color: new THREE.Color(1, 1, 1),
+              transparent: true,
+              opacity: THREE.Math.randFloat(0.8, 1),
+              side: THREE.DoubleSide
+            });
+
+            // Mesh
+            planeMesh = new THREE.Mesh(planeGeometry, planeMaterial);
+            planeMesh.position.set(xOffset + j / BITMAP_SKIP, yOffset - i / BITMAP_SKIP, 0);
+            var randWidth = THREE.Math.randFloat(0.6, 1.2);
+            var randHeight = randWidth
+            planeMesh.scale.set(randWidth, randHeight, 1);
+            scene.add(planeMesh);
+            objetArray.push([planeMesh, false]);
+
+
+            circleMesh = new THREE.Mesh(circleGeometry, circleMaterial);
+            circleMesh.position.set(xOffset + j / BITMAP_SKIP + THREE.Math.randFloat(-0.5, 0.5), yOffset - i / BITMAP_SKIP + THREE.Math.randFloat(-0.5, 0.5), 0.1);
+            var randRadius = THREE.Math.randFloat(0.05, 0.1);
+            circleMesh.scale.set(randRadius, randRadius, 1);
+            scene.add(circleMesh);
+            objetArray.push([circleMesh, false]);
           }
+
         }
+      }
 
 
-        //Geometry 
+      //Geometry 
 
-        // Materials
+      // Materials
 
 
-        // Mesh
+      // Mesh
 
 
-        // Helpers
+      // Helpers
 
-        //Add Stuff to Scene
+      //Add Stuff to Scene
 
 
-      }
+    }
 
-      function animate() {
+    function animate() {
 
-        requestAnimationFrame(animate);
-        render();
-        stats.update();
-        // controls.update();
-        frame++;
-      }
+      requestAnimationFrame(animate);
+      render();
+      stats.update();
+      // controls.update();
+      frame++;
+    }
 
-      function render() {
+    function render() {
 
-        while (animationQueue.length > 0) {
-          var obj_index = animationQueue[0][0];
-          var ani_frame = animationQueue[0][1];
-          if (ani_frame > ANIMATION_FRAME_LENGTH) {
-            objetArray[obj_index][1] = false;
-            animationQueue.shift();
-          } else {
-            break;
-          }
+      while (animationQueue.length > 0) {
+        var obj_index = animationQueue[0][0];
+        var ani_frame = animationQueue[0][1];
+        if (ani_frame > ANIMATION_FRAME_LENGTH) {
+          objetArray[obj_index][1] = false;
+          animationQueue.shift();
+        } else {
+          break;
         }
+      }
 
-        for (var i = 0; i < objetArray.length; i++) {
-          var obj = objetArray[i][0];
-          var isAnimating = objetArray[i][1];
-          if (isAnimating == false) {
-            var px = obj.position.x;
-            var py = obj.position.y;
-            var dist = Math.sqrt(Math.pow(px - mouseScaled.x, 2) + Math.pow(py - mouseScaled.y, 2));
-            if (dist < INTERACT_DISTANCE) {
-              var startPosVector = obj.position.clone();
-              var mouseRepelVector = new THREE.Vector3().subVectors(startPosVector, mouseScaled).multiplyScalar(THREE.Math.randFloat(INTERACT_DISTANCE + 0.5, INTERACT_DISTANCE + 2) - dist);
-              var endPosVector = new THREE.Vector3().addVectors(startPosVector, mouseRepelVector);
-              animationQueue.push([i, 0, startPosVector, endPosVector]);
-              objetArray[i][1] = true;
-            }
+      for (var i = 0; i < objetArray.length; i++) {
+        var obj = objetArray[i][0];
+        var isAnimating = objetArray[i][1];
+        if (isAnimating == false) {
+          var px = obj.position.x;
+          var py = obj.position.y;
+          var dist = Math.sqrt(Math.pow(px - mouseScaled.x, 2) + Math.pow(py - mouseScaled.y, 2));
+          if (dist < INTERACT_DISTANCE) {
+            var startPosVector = obj.position.clone();
+            var mouseRepelVector = new THREE.Vector3().subVectors(startPosVector, mouseScaled).multiplyScalar(THREE.Math.randFloat(INTERACT_DISTANCE + 0.5, INTERACT_DISTANCE + 2) - dist);
+            var endPosVector = new THREE.Vector3().addVectors(startPosVector, mouseRepelVector);
+            animationQueue.push([i, 0, startPosVector, endPosVector]);
+            objetArray[i][1] = true;
           }
         }
-
-        for (var i = 0; i < animationQueue.length; i++) {
-          var obj = objetArray[animationQueue[i][0]][0];
-          var ani_frame = animationQueue[i][1];
-          var startPosVector = animationQueue[i][2];
-          var endPosVector = animationQueue[i][3];
-          var curPosVector = new THREE.Vector3();
-          var frac = 1 - Math.abs(ani_frame - (ANIMATION_FRAME_LENGTH / 2)) / (ANIMATION_FRAME_LENGTH / 2);
-          frac = easeOutQuad(frac);
-          curPosVector.lerpVectors(startPosVector, endPosVector, frac);
-
-          obj.position.x = curPosVector.x;
-          obj.position.y = curPosVector.y;
-          obj.position.z = curPosVector.z;
-          animationQueue[i][1] += 1;
-        }
-
-        mouse = new THREE.Vector3(10000, 10000, -2);
-        mouseScaled = new THREE.Vector3(10000, 10000, -2);
-
-        renderer.render(scene, camera);
       }
 
-      function onWindowResize() {
-        SCREEN_HEIGHT = Math.min(window.innerWidth, window.innerHeight);
-        SCREEN_WIDTH = SCREEN_HEIGHT;
-        SCREEN_ASPECT_RATIO = SCREEN_WIDTH / SCREEN_HEIGHT;
-        camera.aspect = SCREEN_ASPECT_RATIO;
-        camera.updateProjectionMatrix();
-        renderer.setSize(SCREEN_WIDTH, SCREEN_HEIGHT);
-        console.log(SCREEN_WIDTH + "x" + SCREEN_HEIGHT)
+      for (var i = 0; i < animationQueue.length; i++) {
+        var obj = objetArray[animationQueue[i][0]][0];
+        var ani_frame = animationQueue[i][1];
+        var startPosVector = animationQueue[i][2];
+        var endPosVector = animationQueue[i][3];
+        var curPosVector = new THREE.Vector3();
+        var frac = 1 - Math.abs(ani_frame - (ANIMATION_FRAME_LENGTH / 2)) / (ANIMATION_FRAME_LENGTH / 2);
+        frac = easeOutQuad(frac);
+        curPosVector.lerpVectors(startPosVector, endPosVector, frac);
+
+        obj.position.x = curPosVector.x;
+        obj.position.y = curPosVector.y;
+        obj.position.z = curPosVector.z;
+        animationQueue[i][1] += 1;
       }
 
-      function onDocumentMouseMove(event) {
+      mouse = new THREE.Vector3(10000, 10000, -2);
+      mouseScaled = new THREE.Vector3(10000, 10000, -2);
 
-        var rect = canvas.getBoundingClientRect();
+      renderer.render(scene, camera);
+    }
 
-        mouse.x = event.clientX - rect.left;
-        mouse.y = event.clientY - rect.top;
+    function onWindowResize() {
+      SCREEN_HEIGHT = Math.min(window.innerWidth, window.innerHeight);
+      SCREEN_WIDTH = SCREEN_HEIGHT;
+      SCREEN_ASPECT_RATIO = SCREEN_WIDTH / SCREEN_HEIGHT;
+      camera.aspect = SCREEN_ASPECT_RATIO;
+      camera.updateProjectionMatrix();
+      renderer.setSize(SCREEN_WIDTH, SCREEN_HEIGHT);
+      console.log(SCREEN_WIDTH + "x" + SCREEN_HEIGHT)
+    }
 
-        mouseScaled.x = mouse.x * viewWidth / SCREEN_WIDTH - viewWidth / 2;
-        mouseScaled.y = -mouse.y * viewHeight / SCREEN_HEIGHT + viewHeight / 2;
+    function onDocumentMouseMove(event) {
 
-      }
+      var rect = canvas.getBoundingClientRect();
 
-      function sigmoid(t) {
-        return 1 / (1 + Math.pow(Math.E, -t));
-      }
-
-      // no easing, no acceleration
-      function linear(t) {
-        return t;
-      }
-      // accelerating from zero velocity
-      function easeInQuad(t) {
-        return t * t;
-      }
-      // decelerating to zero velocity
-      function easeOutQuad(t) {
-        return t * (2 - t);
-      }
-      // acceleration until halfway, then deceleration
-      function easeInOutQuad(t) {
-        return t < .5 ? 2 * t * t : -1 + (4 - 2 * t) * t;
-      }
-      // accelerating from zero velocity 
-      function easeInCubic(t) {
-        return t * t * t;
-      }
-      // decelerating to zero velocity 
-      function easeOutCubic(t) {
-        return (--t) * t * t + 1;
-      }
-      // acceleration until halfway, then deceleration 
-      function easeInOutCubic(t) {
-        return t < .5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;
-      }
-      // accelerating from zero velocity 
-      function easeInQuart(t) {
-        return t * t * t * t;
-      }
-      // decelerating to zero velocity 
-      function easeOutQuart(t) {
-        return 1 - (--t) * t * t * t;
-      }
-      // acceleration until halfway, then deceleration
-      function easeInOutQuart(t) {
-        return t < .5 ? 8 * t * t * t * t : 1 - 8 * (--t) * t * t * t;
-      }
-      // accelerating from zero velocity
-      function easeInQuint(t) {
-        return t * t * t * t * t;
-      }
-      // decelerating to zero velocity
-      function easeOutQuint(t) {
-        return 1 + (--t) * t * t * t * t;
-      }
-      // acceleration until halfway, then deceleration 
-      function easeInOutQuint(t) {
-        return t < .5 ? 16 * t * t * t * t * t : 1 + 16 * (--t) * t * t * t * t;
-      }
+      mouse.x = event.clientX - rect.left;
+      mouse.y = event.clientY - rect.top;
 
-      //Event Handlers
-      window.addEventListener("resize", onWindowResize);
+      mouseScaled.x = mouse.x * viewWidth / SCREEN_WIDTH - viewWidth / 2;
+      mouseScaled.y = -mouse.y * viewHeight / SCREEN_HEIGHT + viewHeight / 2;
 
+    }
 
-      init();
-      animate();
+    function sigmoid(t) {
+      return 1 / (1 + Math.pow(Math.E, -t));
+    }
 
+    // no easing, no acceleration
+    function linear(t) {
+      return t;
+    }
+    // accelerating from zero velocity
+    function easeInQuad(t) {
+      return t * t;
+    }
+    // decelerating to zero velocity
+    function easeOutQuad(t) {
+      return t * (2 - t);
+    }
+    // acceleration until halfway, then deceleration
+    function easeInOutQuad(t) {
+      return t < .5 ? 2 * t * t : -1 + (4 - 2 * t) * t;
+    }
+    // accelerating from zero velocity 
+    function easeInCubic(t) {
+      return t * t * t;
+    }
+    // decelerating to zero velocity 
+    function easeOutCubic(t) {
+      return (--t) * t * t + 1;
+    }
+    // acceleration until halfway, then deceleration 
+    function easeInOutCubic(t) {
+      return t < .5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;
+    }
+    // accelerating from zero velocity 
+    function easeInQuart(t) {
+      return t * t * t * t;
+    }
+    // decelerating to zero velocity 
+    function easeOutQuart(t) {
+      return 1 - (--t) * t * t * t;
+    }
+    // acceleration until halfway, then deceleration
+    function easeInOutQuart(t) {
+      return t < .5 ? 8 * t * t * t * t : 1 - 8 * (--t) * t * t * t;
+    }
+    // accelerating from zero velocity
+    function easeInQuint(t) {
+      return t * t * t * t * t;
+    }
+    // decelerating to zero velocity
+    function easeOutQuint(t) {
+      return 1 + (--t) * t * t * t * t;
+    }
+    // acceleration until halfway, then deceleration 
+    function easeInOutQuint(t) {
+      return t < .5 ? 16 * t * t * t * t * t : 1 + 16 * (--t) * t * t * t * t;
     }
 
-    ThreeJSCanvas(1);
-  </script>
-  <script>
-    function noticeBtn() {
-      // window.location.href="../platlive/notice/index"
+    //Event Handlers
+    window.addEventListener("resize", onWindowResize);
+
+
+    init();
+    animate();
+
+  }
+  ThreeJSCanvas(1);
+</script>
+<script>
+  var xin = true,
+      yin = true;
+    var step = 2;
+    var delay = 10;
+    var $obj;
+    $(function () {
+      $obj = $('#floatingDiv');
+      var time = window.setInterval('move()', delay);
+      $obj.mouseover(function () {
+        clearInterval(time);
+      });
+      $obj.mouseout(function () {
+        time = window.setInterval('move()', delay);
+      });
+    });
+
+    function move() {
+      var left = $obj.offset().left;
+      // console.log(left);
+      var top = $obj.offset().top;
+      var L = (T = 0); //左边界和顶部边界
+      var R = $(window).width() - $obj.width(); // 右边界
+      var B = $(window).height() - $obj.height(); //下边界
+
+      //难点:怎样判断广告的4个边框有没有超出可视化范围!
+      if (left < L) {
+        xin = true; // 水平向右移动
       }
-  </script>
-  <script>
-    var xin = true,
+      if (left > R) {
+        xin = false;
+      }
+      if (top < T) {
         yin = true;
-      var step = 2;
-      var delay = 10;
-      var $obj;
-      $(function () {
-        $obj = $('#floatingDiv');
-        var time = window.setInterval('move()', delay);
-        $obj.mouseover(function () {
-          clearInterval(time);
-        });
-        $obj.mouseout(function () {
-          time = window.setInterval('move()', delay);
-        });
-      });
-
-      function move() {
-        var left = $obj.offset().left;
-        // console.log(left);
-        var top = $obj.offset().top;
-        var L = (T = 0); //左边界和顶部边界
-        var R = $(window).width() - $obj.width(); // 右边界
-        var B = $(window).height() - $obj.height(); //下边界
-
-        //难点:怎样判断广告的4个边框有没有超出可视化范围!
-        if (left < L) {
-          xin = true; // 水平向右移动
-        }
-        if (left > R) {
-          xin = false;
-        }
-        if (top < T) {
-          yin = true;
-        }
-        if (top > B) {
-          yin = false;
-        }
-        //根据有没有超出范围来确定广告的移动方向
-        left += step * (xin == true ? 1 : -1);
-        top += step * (yin == true ? 1 : -1);
-        // 给div 元素重新定位
-        $obj.offset({
-          top: top,
-          left: left,
-        });
       }
+      if (top > B) {
+        yin = false;
+      }
+      //根据有没有超出范围来确定广告的移动方向
+      left += step * (xin == true ? 1 : -1);
+      top += step * (yin == true ? 1 : -1);
+      // 给div 元素重新定位
+      $obj.offset({
+        top: top,
+        left: left,
+      });
+    }
 
-  </script>
+</script>
 </body>
-<!-- layui -->
 <script type="text/javascript" src="static/home/lib/layui/layui.all.js"></script>
-
 </html>

+ 40 - 13
src/views/achieveLive/detail/chatData.vue

@@ -20,8 +20,17 @@
                 <el-input v-model="text"></el-input>
               </el-col>
               <el-col :span="10" class="btn">
-                <el-button type="primary" size="mini" @click="sendMessage">发送</el-button>
-                <el-button type="primary" size="mini">快捷发言</el-button>
+                <el-col :span="12">
+                  <el-button type="primary" size="mini" @click="sendMessage">发送</el-button>
+                </el-col>
+                <el-col :span="12">
+                  <el-popover placement="top" trigger="click">
+                    <el-col :span="24">
+                      <p class="text" v-for="(item, index) in textList" :key="index" @click="textBtn(item.name)">{{ item.name }}</p>
+                    </el-col>
+                    <el-button slot="reference" type="primary" size="mini">快捷发言</el-button>
+                  </el-popover>
+                </el-col>
               </el-col>
             </el-col>
           </el-tab-pane>
@@ -32,7 +41,8 @@
 </template>
 
 <script>
-const _ = require('lodash');
+var moment = require('moment');
+import _ from 'lodash';
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: dockChat } = createNamespacedHelpers('dockChat');
 export default {
@@ -45,16 +55,10 @@ export default {
   data: function() {
     return {
       active: 'first',
-      list: [
-        {
-          send_time: '2020-12-12 12:00:00',
-          sender_name: '发言人',
-          content: '发言内容发言内容发言内容发言内容发言内容发言内容发言内容发言内容',
-        },
-        { send_time: '2020-12-12 12:00:00', sender_name: '发言人', content: '发言内容' },
-      ],
+      list: [],
       // 发言内容
       text: '',
+      textList: [{ name: '欢迎欢迎' }, { name: '科技创新' }, { name: '大咖云集' }],
     };
   },
   async created() {
@@ -74,17 +78,26 @@ export default {
     async sendMessage() {
       if (this.text != '') {
         const content = _.cloneDeep(this.text);
-        const obj = { content, dock_id: this.id, sender_id: this.user.id, sender_name: this.user.name };
+        let obj = {};
+        if (this.user) {
+          obj = { content, dock_id: this.id, sender_id: this.user.id, sender_name: this.user.name };
+        } else {
+          obj = { content, dock_id: this.id, sender_id: this.getData(), sender_name: this.getData() + '游客' };
+        }
         const check = Object.values(obj).every(f => f);
         if (!check) {
           this.$message.error('发言所需信息不全,请联系管理人员');
           return;
         }
         const res = await this.create(obj);
-        this.$checkRes(res, null, res.errmsg || '发言失败');
+        this.$checkRes(res, null, '发言成功' || '发言失败');
         this.$set(this, 'text', '');
       } else this.$message.error('请输入信息后发送');
     },
+    textBtn(text) {
+      this.$set(this, `text`, text);
+      this.sendMessage();
+    },
     channel() {
       if (!this.id) {
         console.warn('未获取到展会信息,无法进行订阅');
@@ -101,6 +114,11 @@ export default {
         this.list.push(body);
       }
     },
+    // 获取时间戳
+    getData() {
+      let date = moment(new Date()).valueOf();
+      if (date) return date;
+    },
   },
   computed: {
     ...mapState(['user']),
@@ -159,4 +177,13 @@ export default {
     margin: 0 0 10px 0;
   }
 }
+.text {
+  text-align: center;
+  padding: 5px 0;
+  border-bottom: 1px dashed #ccc;
+}
+.text:hover {
+  cursor: pointer;
+  color: #409eff;
+}
 </style>

+ 27 - 15
src/views/achieveLive/detail/productData.vue

@@ -13,8 +13,8 @@
                   <p class="textOver">联系人{{ item.contacts }}</p>
                 </el-col>
                 <el-col :span="24" class="down">
-                  <el-button size="mini" type="primary" @click="achieveDetailBtn(item)">详情</el-button>
-                  <el-button size="mini" type="success" @click="achievetransBtn(item)">对接</el-button>
+                  <el-button size="mini" type="primary" @click="detail(item, '1')">详情</el-button>
+                  <el-button size="mini" type="success" @click="trans(item, '1')">对接</el-button>
                 </el-col>
               </el-col>
             </el-col>
@@ -22,7 +22,7 @@
               <el-button type="primary" size="mini" @click="moreBtn('1')">查看更多项目</el-button>
             </el-col>
           </el-tab-pane>
-          <el-tab-pane label="科技需求" name="second" disabled>
+          <el-tab-pane label="科技需求" name="second">
             <el-col :span="24" class="second">
               <el-col :span="5" class="techolList" v-for="(item, index) in techolList" :key="index">
                 <el-col :span="24" class="top">
@@ -30,8 +30,8 @@
                   <p class="textOver">领域:{{ item.field }}</p>
                 </el-col>
                 <el-col :span="24" class="down">
-                  <el-button size="mini" type="primary">详情</el-button>
-                  <el-button size="mini" type="success">对接</el-button>
+                  <el-button size="mini" type="primary" @click="detail(item, '0')">详情</el-button>
+                  <el-button size="mini" type="success" @click="trans(item, '0')">对接</el-button>
                 </el-col>
               </el-col>
             </el-col>
@@ -42,21 +42,26 @@
         </el-tabs>
       </el-col>
     </el-row>
-    <el-dialog title="技术成果详情" :visible.sync="dialog" width="55%" :before-close="handleClose">
-      <detailInfo :form="info" :showBtn="false"></detailInfo>
+    <el-dialog title="技术成果详情" :visible.sync="dialog" width="50%" :before-close="handleClose">
+      <achieveInfo :form="info" :showBtn="false"></achieveInfo>
+    </el-dialog>
+    <el-dialog title="科技需求详情" :visible.sync="twoDialog" width="50%" :before-close="handleClose">
+      <techolInfo :form="info" :showBtn="false"></techolInfo>
     </el-dialog>
   </div>
 </template>
 
 <script>
-import detailInfo from '../product/detailInfo.vue';
+import achieveInfo from '../product/achieveInfo.vue';
+import techolInfo from '../product/techolInfo.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: dock } = createNamespacedHelpers('dock');
 export default {
   name: 'productData',
   props: {},
   components: {
-    detailInfo,
+    achieveInfo,
+    techolInfo,
   },
   data: function() {
     return {
@@ -71,6 +76,9 @@ export default {
       // 技术成果详情
       dialog: false,
       info: {},
+      // 科技需求详情
+      twoDialog: false,
+      twoinfo: {},
     };
   },
   async created() {
@@ -90,18 +98,22 @@ export default {
     moreBtn(type) {
       this.$router.push({ path: '/achieveLive/product/index', query: { dock_id: this.id, type } });
     },
-    // 成果详情
-    achieveDetailBtn(data) {
+    // 详情
+    detail(data, type) {
       this.$set(this, `info`, data);
-      this.dialog = true;
+      // 科技需求
+      if (type == '0') this.twoDialog = true;
+      // 技术成果
+      else if (type == '1') this.dialog = true;
     },
-    // 成果对接
-    achievetransBtn(data) {
-      this.$router.push({ path: '/achieveLive/product/detail', query: { dock_id: this.id, id: data._id } });
+    // 对接
+    trans(data, type) {
+      this.$router.push({ path: '/achieveLive/product/detail', query: { dock_id: this.id, id: data._id, type: data.type } });
     },
     // 取消查看
     handleClose() {
       this.dialog = false;
+      this.twoDialog = false;
     },
   },
   computed: {

+ 2 - 2
src/views/achieveLive/product/detailInfo.vue

@@ -1,5 +1,5 @@
 <template>
-  <div id="detailInfo">
+  <div id="achieveInfo">
     <el-row>
       <el-col :span="24" class="main">
         <el-col :span="24" class="top">
@@ -183,7 +183,7 @@ import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: personRoom } = createNamespacedHelpers('personRoom');
 const { mapActions: transaction } = createNamespacedHelpers('transaction');
 export default {
-  name: 'detailInfo',
+  name: 'achieveInfo',
   props: {
     form: { type: Object },
     showBtn: { type: Boolean, default: () => true },

+ 9 - 3
src/views/achieveLive/product/detail.vue

@@ -10,7 +10,8 @@
                 <el-button type="primary" size="mini" @click="back">返回活动首页</el-button>
               </el-col>
               <el-col :span="24">
-                <detailInfo :form="info"></detailInfo>
+                <techolInfo :form="info" v-if="type == '0'"></techolInfo>
+                <achieveInfo :form="info" v-else-if="type == '1'"></achieveInfo>
               </el-col>
             </el-col>
           </div>
@@ -22,7 +23,8 @@
 
 <script>
 import subTop from '../parts/subTop.vue';
-import detailInfo from '../product/detailInfo.vue';
+import achieveInfo from '../product/achieveInfo.vue';
+import techolInfo from '../product/techolInfo.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: dock } = createNamespacedHelpers('dock');
 const { mapActions: product } = createNamespacedHelpers('product');
@@ -34,7 +36,8 @@ export default {
   props: {},
   components: {
     subTop,
-    detailInfo,
+    achieveInfo,
+    techolInfo,
   },
   data: function() {
     return {
@@ -73,6 +76,9 @@ export default {
     id() {
       return this.$route.query.id;
     },
+    type() {
+      return this.$route.query.type;
+    },
   },
   watch: {},
 };

+ 2 - 2
src/views/achieveLive/product/index.vue

@@ -76,7 +76,7 @@ export default {
       }
       if (this.type == '0') {
         // 科技需求
-        res = await this.productQuery({ skip, limit, type: '0', dock_id: this.dock_id, ...info });
+        let res = await this.productQuery({ skip, limit, type: '0', dock_id: this.dock_id, ...info });
         if (this.$checkRes(res)) this.$set(this, `list`, res.data);
         this.$set(this, `total`, res.total);
       } else {
@@ -88,7 +88,7 @@ export default {
     },
     // 对接
     toCheck({ data }) {
-      this.$router.push({ path: '/achieveLive/product/detail', query: { dock_id: this.dock_id, id: data._id } });
+      this.$router.push({ path: '/achieveLive/product/detail', query: { dock_id: this.dock_id, id: data._id, type: data.type } });
     },
     // 返回
     back() {

+ 329 - 0
src/views/achieveLive/product/techolInfo.vue

@@ -0,0 +1,329 @@
+<template>
+  <div id="techolInfo">
+    <el-row>
+      <el-col :span="24" class="main">
+        <el-col :span="24" class="top">
+          <el-col :span="7" class="left" v-if="form.image != ''">
+            <el-carousel trigger="click" height="305px" :autoplay="false">
+              <el-carousel-item v-for="(item, index) in form.image" :key="index">
+                <el-image :src="item.url" style="width:99%;height:345px;border: 1px solid #ccc;"></el-image>
+              </el-carousel-item>
+            </el-carousel>
+          </el-col>
+          <el-col :span="7" v-else class="achieveImage">
+            <p>紧急程度</p>
+            <p><el-rate v-model="value" disabled :max="max" :texts="texts" :colors="colors"> </el-rate></p>
+          </el-col>
+          <el-col :span="17" class="right">
+            <el-col :span="24" class="name textOver">
+              {{ form.name || '暂无' }}
+            </el-col>
+            <el-col :span="24">
+              <el-col :span="4" class="otherInfo textOver">
+                需求方
+              </el-col>
+              <el-col :span="20" class="otherInfo textOver">
+                {{ form.company }}
+                <el-link v-if="form.companyweb != null || ''" :href="form.companyweb" :underline="false" target="_blank">({{ form.companyweb }})</el-link>
+              </el-col>
+            </el-col>
+            <el-col :span="12">
+              <el-col :span="8" class="otherInfo textOver">
+                所属领域
+              </el-col>
+              <el-col :span="16" class="otherInfo textOver">
+                {{ form.field || '暂无' }}
+              </el-col>
+            </el-col>
+            <el-col :span="12">
+              <el-col :span="8" class="otherInfo textOver">
+                合作方式
+              </el-col>
+              <el-col :span="16" class="otherInfo textOver">
+                {{ form.cooperation ? form.cooperation : '暂无' }}
+              </el-col>
+            </el-col>
+            <el-col :span="12">
+              <el-col :span="8" class="otherInfo textOver">
+                紧急程度
+              </el-col>
+              <el-col :span="16" class="otherInfo textOver"> {{ form.demand || '暂无' }} </el-col>
+            </el-col>
+            <el-col :span="12">
+              <el-col :span="8" class="otherInfo textOver">
+                投资预算
+              </el-col>
+              <el-col :span="16" class="otherInfo textOver"> {{ form.budget || '暂无' }} </el-col>
+            </el-col>
+            <el-col :span="12">
+              <el-col :span="8" class="otherInfo textOver">
+                联系人
+              </el-col>
+              <el-col :span="16" class="otherInfo textOver">
+                {{ form.contacts || '暂无' }}
+              </el-col>
+            </el-col>
+            <el-col :span="12">
+              <el-col :span="8" class="otherInfo textOver">
+                QQ/微信
+              </el-col>
+              <el-col :span="16" class="otherInfo textOver">
+                {{ form.qqwx || '暂无' }}
+              </el-col>
+            </el-col>
+            <el-col :span="24">
+              <el-col :span="4" class="otherInfo textOver">
+                联系电话
+              </el-col>
+              <el-col :span="20" class="otherInfo textOver">
+                {{ getphone(form.phone) || '暂无' }}
+              </el-col>
+            </el-col>
+            <el-col :span="24">
+              <el-col :span="4" class="otherInfo textOver">
+                电子邮箱
+              </el-col>
+              <el-col :span="20" class="otherInfo textOver">
+                {{ form.email || '暂无' }}
+              </el-col>
+            </el-col>
+          </el-col>
+        </el-col>
+        <el-col :span="24" class="down">
+          <el-col :span="24" class="downInfo">
+            <el-col :span="4" class="tit">
+              <h2>需求说明</h2>
+            </el-col>
+            <el-col :span="20" class="info">
+              {{ form.requirementdesc || '暂无' }}
+            </el-col>
+          </el-col>
+          <el-col :span="24" class="downInfo">
+            <el-col :span="4" class="tit">
+              <h2>预期目标</h2>
+            </el-col>
+            <el-col :span="20" class="info">
+              {{ form.expect || '暂无' }}
+            </el-col>
+          </el-col>
+          <el-col :span="24" class="downInfo">
+            <el-col :span="4" class="tit">
+              <h2>需求现状</h2>
+            </el-col>
+            <el-col :span="20" class="info">
+              {{ form.present || '暂无' }}
+            </el-col>
+          </el-col>
+          <el-col :span="24" class="downInfo">
+            <el-col :span="4" class="tit">
+              <h2>合作要求</h2>
+            </el-col>
+            <el-col :span="20" class="info">
+              {{ form.condition || '暂无' }}
+            </el-col>
+          </el-col>
+        </el-col>
+        <el-col :span="24" class="anniu" v-if="showBtn">
+          <el-button type="primary" size="mini" @click="btnPhone()">交流洽谈</el-button>
+          <el-button type="success" size="mini" @click="onSubmit()">供求对接</el-button>
+        </el-col>
+      </el-col>
+    </el-row>
+    <el-dialog title="对接" :visible.sync="dialogTableVisible" destroy-on-close>
+      <chat :room="room"></chat>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import chat from '@c/chat.vue';
+import _ from 'lodash';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: personRoom } = createNamespacedHelpers('personRoom');
+const { mapActions: transaction } = createNamespacedHelpers('transaction');
+export default {
+  name: 'techolInfo',
+  props: {
+    form: { type: Object },
+    showBtn: { type: Boolean, default: () => true },
+  },
+  components: { chat },
+  data: function() {
+    return {
+      value: 2,
+      max: 3,
+      colors: ['#ff0000', '#ff0000', '#ff0000'],
+      texts: ['一般', '紧急', '长期'],
+      // 对接
+      dialogTableVisible: false,
+      room: {},
+    };
+  },
+  created() {
+    console.log(this.form);
+  },
+  methods: {
+    ...personRoom(['create']),
+    ...transaction({ getTran: 'query', createTran: 'create' }),
+    async btnPhone() {
+      if (!this.room.id) {
+        //TODO 请求房间号
+        let obj = {};
+        if (!_.get(this.user, 'id')) {
+          // this.$message.error('游客身份无法与卖家对话,请先注册');
+          this.$message({
+            dangerouslyUseHTMLString: true,
+            message: '<strong><a href="http://broadcast.waityou24.cn/live/login" style="color:red;">游客身份无法与卖家对话,请先注册</a></strong>',
+            type: 'error',
+          });
+          return;
+        } else {
+          obj.p1_id = this.user.id;
+          obj.p1 = this.user.name;
+        }
+        if (!this.form.user_id) {
+          this.$message.error('缺少卖家信息,请联系卖家或管理员');
+          return;
+        } else {
+          obj.p2_id = this.form.user_id;
+          obj.p2 = this.form.contacts;
+        }
+        let res = await this.create(obj);
+        if (this.$checkRes(res)) {
+          this.$set(this, `room`, res.data);
+        }
+      }
+      this.dialogTableVisible = true;
+    },
+    //供求对接
+    async onSubmit() {
+      const data = _.cloneDeep(this.form);
+      const obj = {
+        dock_id: this.dock_id,
+        supplier: _.get(data, 'user_id'),
+        s_name: _.get(data, 'contacts'),
+        s_phone: _.get(data, 'phone'),
+        product_id: _.get(data, 'id'),
+        product: _.get(data, 'name'),
+        demander: _.get(this.user, 'id'),
+        d_name: _.get(this.user, 'name'),
+        d_phone: _.get(this.user, 'phone'),
+      };
+      if (obj.demander === obj.supplier) {
+        this.$message.error('您不能对自己的成果进行对接!');
+        return;
+      }
+      const list = await this.getTran({ product_id: obj.product_id, demander: obj.demander, dock_id: this.dock_id });
+      if (list.total > 0) {
+        this.$message.warning('您已申请供求对接,无需再次申请!');
+        return;
+      }
+      const res = await this.createTran(obj);
+      this.$checkRes(res, '对接成功', res.errmsg || '对接失败');
+    },
+    // 隐藏手机号
+    getphone(value) {
+      if (value == undefined) {
+        return '暂无';
+      } else {
+        if (value.length === 11) {
+          let start = value.slice(0, 4);
+          let end = value.slice(-3);
+          return `${start}****${end}`;
+        } else {
+          return value;
+        }
+      }
+    },
+    searchdegre() {
+      if (this.form.degreeurgency == '一般') this.$set(this, `value`, 1);
+      else if (this.form.degreeurgency == '紧急') this.$set(this, `value`, 2);
+      else if (this.form.degreeurgency == '长期') this.$set(this, `value`, 3);
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    dock_id() {
+      return this.$route.query.dock_id;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    form: {
+      deep: true,
+      immediate: true,
+      handler(val) {
+        this.searchdegre();
+      },
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  .top {
+    height: 315px;
+    overflow: hidden;
+    .right {
+      padding: 0 0 0 10px;
+      .name {
+        font-size: 18px;
+        font-weight: bold;
+        padding: 10px;
+        border: 1px solid #ccc;
+        text-align: center;
+      }
+      .otherInfo {
+        padding: 10px;
+        font-size: 16px;
+        border: 1px solid #ccc;
+      }
+    }
+  }
+  .down {
+    margin: 0 0 15px 0;
+    .downInfo {
+      border: 1px solid #ccc;
+      .tit {
+        height: 150px;
+        line-height: 150px;
+        text-align: center;
+        border-right: 1px solid #ccc;
+      }
+      .info {
+        font-size: 16px;
+        padding: 10px;
+        min-height: 150px;
+      }
+    }
+  }
+  .anniu {
+    text-align: center;
+    /deep/.el-button {
+      margin: 0 10px;
+    }
+  }
+  .achieveImage {
+    height: 305px;
+    overflow: hidden;
+    p:nth-child(1) {
+      font-size: 25px;
+      text-align: left;
+      padding: 10px 0;
+    }
+    p:nth-child(2) {
+      margin: 60px 0 0 0;
+      text-align: center;
+      .el-rate__icon {
+        font-size: 60px;
+      }
+    }
+  }
+}
+/deep/.el-rate__icon {
+  font-size: 60px;
+}
+</style>

+ 1 - 0
src/views/admin/live/achieve/interview.vue

@@ -95,6 +95,7 @@ export default {
   methods: {
     ...interview(['query', 'create', 'update', 'delete']),
     async search({ skip = 0, limit = 10, ...info } = {}) {
+      info.dock_id = this.user.id;
       const res = await this.query({ skip, limit, ...info });
       if (this.$checkRes(res)) {
         this.$set(this, `list`, res.data);

+ 0 - 13
src/views/market/list/detail-model/model-5.vue

@@ -16,21 +16,8 @@
             </el-carousel>
           </el-col>
           <el-col :span="7" v-else class="achieveImage">
-            <!-- <el-image :src="achievezb" style="height:305px;"></el-image>
-            <el-col :span="24" class="company textOver">
-              {{ data.company }}
-            </el-col>
-            <el-col :span="24" class="aName">
-              {{ data.name }}
-            </el-col>
-            <el-col :span="24" class="a-brief">{{ data.requirementdesc }}</el-col>
-            <el-col :span="24" class="cont">
-              <el-col :span="24" class="a-field">领域:{{ data.field }}</el-col>
-              <el-col :span="24" class="a-contacts">联系人:{{ data.contacts }}</el-col>
-            </el-col> -->
             <p>紧急程度</p>
             <p><el-rate v-model="value" disabled :max="max" :texts="texts" :colors="colors"> </el-rate></p>
-            <!-- <p>{{ data.degreeurgency || '暂无' }}</p> -->
           </el-col>
           <el-col :span="17" class="right">
             <el-col :span="24" class="name textOver">