zhibin před 6 roky
rodič
revize
5d4de014d9

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 1
dist/index.html


+ 2 - 0
index.html

@@ -19,5 +19,7 @@
   <body>
     <div id="app"></div>
     <!-- built files will be auto injected -->
+    <script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
+    <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
   </body>
 </html>

+ 2 - 2
src/main.js

@@ -9,8 +9,8 @@ import router from './router'
 Vue.config.productionTip = false
 Vue.prototype.$bus = new Vue()
 
-// axios.defaults.baseURL = '/newOfficialapi/'
-axios.defaults.baseURL = 'http://www.4dage.com/newOfficialapi/'
+axios.defaults.baseURL = '/newOfficialapi/'
+// axios.defaults.baseURL = 'http://www.4dage.com/newOfficialapi/'
 
 let language = ({ 'en': 2, 'cn': 1 })['cn']
 axios.interceptors.request.use(function (config) {

+ 1 - 1
src/pages/about/index.vue

@@ -59,7 +59,7 @@
               <ul>
                 <li>四维时代与德国人工智能研究中( DFKI ) 合作成立中德人工智能研究院(CGAII), 目前有中德专家团队成员约200人 , 团队成员均为来自DFKI以及四维时代的高级研究员。</li>
                 <li>创始人及高管人员均为欧洲海归博士及国内名校高材生,研发团 队具有丰富的技术开发与项目运营经验。</li>
-                <li>每年举办中德人工智能大会,为中德科研交流与产业落地打造国</li>
+                <li>每年举办中德人工智能大会,为中德科研交流与产业落地打造国际化平台。</li>
               </ul>
             </div>
           </div>

+ 1 - 1
src/pages/about/style.css

@@ -60,7 +60,7 @@
 }
 
 .join-list li {
-  font-size: 0.933em;
+  font-size: 14px;
   color: #6c6c6c;
   line-height: 2em;
   list-style: disc

+ 14 - 0
src/pages/home/index.vue

@@ -359,9 +359,23 @@ export default {
   methods: {
     prev (ev) {
       this.isMobile && ev.preventDefault()
+    },
+    async getNews () {
+      let {content} = (await this.$http.get('/home_news', {params: {language: global.language}})).data
+      this.news.data = content.map(data => {
+        return {
+          link: '#/information/news/' + data.nid,
+          image: data.cover,
+          maker: '',
+          title: data.title,
+          content: JSON.parse(data.text).map(t => '<p>' + t + '</p>').join('')
+        }
+      })
     }
   },
   mounted () {
+    this.getNews()
+
     let adapt = (mx, cls, doms) => {
       if (document.documentElement.clientWidth >= mx) {
         for (let dom of doms) {

+ 36 - 2
src/pages/information/media.vue

@@ -10,7 +10,7 @@
     <!-- <div class="content"> -->
       <!-- <p>此媒体资料库里的所有图片只供获认可的媒体代表作发放新闻之用。使用图片时,请标明图片来源为四维时代官方网站。任何人未经四维时代书面同意,不得使用该图片做任何其他用途</p> -->
     <!-- </div> -->
-    <div v-for="(data, key) in ms" :key="key" class="ms-item clear" :class="'ms-item-'+key" v-show="index === key">
+    <div v-for="(data, key) in ms" :key="key" class="ms-item clear" :class="'ms-item-'+key" v-show="index === key" v-if="showMs">
       <div v-for="(item, i) in data" :key="i">
         <img :src="item.img" alt="">
         <p>{{item.text || '给这张图娶个题目'}}</p>
@@ -122,7 +122,8 @@ export default {
           {img: 'http://video.cgaii.com/new4dage/images/images/new_3m_7.jpg', text: '展厅'},
           {img: 'http://video.cgaii.com/new4dage/images/images/new_3m_8.jpg', text: '展厅'}
         ]
-      ]
+      ],
+      showMs: false
     }
   },
   methods: {
@@ -131,8 +132,41 @@ export default {
         ev.preventDefault()
         return alert('请在其他浏览器打开再执行此操作')
       }
+    },
+    async getMedias () {
+      this.showMs = false
+      let {content} = (await this.$http.get('/media', {params: {language: global.language}})).data
+
+      this.ms[0] = content.filter(data => data.type === 1).map(data => {
+        return {
+          img: data.cover,
+          zip: data.zip,
+          text: data.text
+        }
+      })
+
+      this.ms[1] = content.filter(data => data.type === 2).map(data => {
+        return {
+          img: data.cover,
+          zip: data.zip,
+          text: data.text
+        }
+      })
+
+      this.ms[2] = content.filter(data => data.type === 3).map(data => {
+        return {
+          img: data.cover,
+          zip: data.zip,
+          text: data.text
+        }
+      })
+
+      this.showMs = true
     }
   },
+  mounted () {
+    this.getMedias()
+  },
   components: {Slide}
 }
 </script>

+ 9 - 0
src/pages/information/news/details.vue

@@ -9,6 +9,7 @@
 
 <script>
 import browser from '@/util/browser'
+import share from '@/util/share'
 
 export default {
   data () {
@@ -19,6 +20,14 @@ export default {
   },
   async mounted () {
     let result = (await this.$http.get('/news/' + this.$route.params.id)).data.content
+
+    share({
+      title: result.title,
+      imgUrl: result.cover,
+      link: location.href,
+      desc: result.brief
+    })
+
     this.article = result
   }
 }

+ 1 - 1
src/pages/layout/footer.vue

@@ -31,7 +31,7 @@
         </div>
         <p><span>商务合作</span>sales@4dage.com</p>
         <p><span>媒体采访</span>pr@4dage.com</p>
-        <p><span>联系电话</span>400-6698-025</p>
+        <p><span>联系电话</span>0756-6996790</p>
         <a href="http://show.4dage.com/brochure" target="_blank">下载四维时代企业介绍</a>
       </div>
       <div class="relevant">

+ 84 - 0
src/util/share.js

@@ -0,0 +1,84 @@
+let isload = false
+let wx = global.wx
+
+function toConfigure () {
+  return new Promise((resolve, reject) => {
+    global.$.ajax({
+      url: '//www.4dage.com/wechat/jssdk/share',
+      type: 'get',
+      data: {
+        uri: location.href.split('#')[0],
+        name: '四维开发测试'
+      },
+      dataType: 'jsonp',
+      jsonpCallback: 'success_jsonp',
+      success: function (data, textStatus) {
+        wx.config({
+          debug: false,
+          appId: data.appId,
+          timestamp: data.timestamp,
+          nonceStr: data.nonceStr,
+          signature: data.signature,
+          jsApiList: ['checkJsApi', 'onMenuShareTimeline',
+            'onMenuShareAppMessage', 'onMenuShareQQ',
+            'onMenuShareWeibo', 'hideMenuItems',
+            'showMenuItems', 'hideAllNonBaseMenuItem',
+            'showAllNonBaseMenuItem', 'translateVoice',
+            'startRecord', 'stopRecord', 'onRecordEnd',
+            'playVoice', 'pauseVoice', 'stopVoice',
+            'uploadVoice', 'downloadVoice', 'chooseImage',
+            'previewImage', 'uploadImage', 'downloadImage',
+            'getNetworkType', 'openLocation', 'getLocation',
+            'hideOptionMenu', 'showOptionMenu', 'closeWindow',
+            'scanQRCode', 'chooseWXPay',
+            'openProductSpecificView', 'addCard', 'chooseCard',
+            'openCard']
+        })
+        resolve()
+      },
+      error: function (XMLHttpRequest, textStatus, errorThrown) {
+        reject(new Error('jsonp.error:' + textStatus))
+      }
+    })
+  })
+}
+
+function setup ({ title, link, imgUrl, desc }) {
+  imgUrl = imgUrl.trim()
+  if (!(imgUrl.indexOf('http') === 0)) {
+    if (imgUrl.indexOf('//') === 0) {
+      imgUrl = 'https:' + imgUrl
+    } else {
+      imgUrl = location.origin + imgUrl
+    }
+  }
+  let defaultFn = () => { }
+  let defaultChar = ''
+  wx.onMenuShareTimeline({ title, link, imgUrl, desc })
+  wx.onMenuShareAppMessage({ title, desc, link, imgUrl, type: defaultChar, dataUrl: defaultChar })
+  wx.onMenuShareWeibo({ title, desc, link, imgUrl, success: defaultFn, cancel: defaultFn })
+  wx.onMenuShareQZone({ title, desc, link, imgUrl, success: defaultFn, cancel: defaultFn })
+  wx.onMenuShareQQ({ title, desc, link, imgUrl, success: defaultFn, cancel: defaultFn })
+  wx.error(function (e) { })
+}
+
+export default async (args) => {
+  // 需要引入 https://res.wx.qq.com/open/js/jweixin-1.2.0.js
+  if (typeof wx !== 'undefined') {
+    if (!isload) {
+      await toConfigure()
+      await new Promise(resolve => {
+        wx.ready(function () {
+          isload = true
+          resolve(1)
+        })
+
+        setTimeout(() => {
+          isload = true
+          resolve()
+        }, 1000)
+      })
+    }
+    setup(args)
+  }
+}