Quellcode durchsuchen

Merge branch 'master' of http://git.izouma.com/xiongzhu/jetour

panhui vor 5 Jahren
Ursprung
Commit
8c2c7b8761
3 geänderte Dateien mit 30 neuen und 6 gelöschten Zeilen
  1. 2 2
      src/main.js
  2. 9 2
      src/pages/ArticleDetail.vue
  3. 19 2
      src/pages/video.vue

+ 2 - 2
src/main.js

@@ -46,7 +46,7 @@ Vue.mixin({
         },
         share() {
             return {
-                title: '捷途JETOUR',
+                title: 'JETOUR捷途',
                 path: 'pages/home',
                 imageUrl: 'https://mr-yimishijie.oss-cn-hangzhou.aliyuncs.com/share.png'
             };
@@ -132,7 +132,7 @@ export default {
         window: {
             backgroundTextStyle: 'light',
             navigationBarBackgroundColor: '#fff',
-            navigationBarTitleText: '捷途JETOUR',
+            navigationBarTitleText: 'JETOUR捷途',
             navigationBarTextStyle: 'black'
         },
         usingComponents: {

+ 9 - 2
src/pages/ArticleDetail.vue

@@ -17,17 +17,24 @@
 </template>
 <script>
 export default {
+    onShareAppMessage(res) {
+        return {
+            title: this.info.articleKeyword,
+            path: 'pages/ArticleDetail?id=' + this.info.id,
+            imageUrl: this.info.thumbnail
+        };
+    },
     data() {
         return {
             info: '',
-            content: ''
+            content: '',
+            thumbnail: ''
         };
     },
     onShow() {
         this.$http.get(`https://www.jetour.com.cn/cmsapi/business/Article/get/${this.$mp.query.id}`).then(res => {
             this.content = res.data.articleContent.replace(/<img /g, '<img class="rich-text-img"');
             this.info = res.data;
-
             wx.setNavigationBarTitle({
                 title: res.data.articleType == '1' ? '新闻详情' : '活动详情'
             });

+ 19 - 2
src/pages/video.vue

@@ -36,14 +36,25 @@
 <script>
 import { mapState } from 'vuex';
 export default {
+    onShareAppMessage(res) {
+        return {
+            title: this.video.name,
+            path: 'pages/video?from=share&id=' + this.video.id,
+            imageUrl: this.video.thumbnail
+        };
+    },
     data() {
         return {
             height: 100,
             video: {},
             showTitle: true,
-            videoCtx: null
+            videoCtx: null,
+            from: ''
         };
     },
+    onShow() {
+        this.from = this.$mp.query.from;
+    },
     created() {
         this.height = wx.getSystemInfoSync().windowHeight;
         console.log(wx.getSystemInfoSync());
@@ -79,7 +90,13 @@ export default {
             this.showTitle = e.detail.show;
         },
         back() {
-            wx.navigateBack();
+            if (this.from === 'share') {
+                wx.switchTab({
+                    url: '/pages/home'
+                });
+            } else {
+                wx.navigateBack();
+            }
         }
     }
 };