Explorar o código

refactor: 修改全局分享默认配置,移除默认分享图

统一调整所有分享场景的默认分享标题为“云飞智控”,并将默认分享图片路径置空,避免使用固定默认图
leo hai 1 mes
pai
achega
aa26325173
Modificáronse 3 ficheiros con 9 adicións e 8 borrados
  1. 2 2
      App.vue
  2. 2 2
      main.js
  3. 5 4
      util/shareMixin.js

+ 2 - 2
App.vue

@@ -54,9 +54,9 @@
 	  // 全局分享给朋友
 	  onShareAppMessage() {
 	    return {
-	      title: '分享标题',
+	      title: '云飞智控',
 	      path: '/pages/index/index',
-	      imageUrl: '/static/logo.png'
+	      imageUrl: ''
 	    }
 	  }
 	}

+ 2 - 2
main.js

@@ -108,7 +108,7 @@ Vue.mixin({
       return {
         title: this.shareTitle || '云飞智控',
         path: this.sharePath || '/pages/index/index',
-        imageUrl: this.shareImage || '/static/logo.png'
+        imageUrl: this.shareImage || ''
       }
     },
     
@@ -116,7 +116,7 @@ Vue.mixin({
       return {
         title: this.timelineTitle || '云飞智控',
         query: this.timelineQuery || '',
-        imageUrl: this.timelineImage || '/static/logo.png'
+        imageUrl: this.timelineImage || ''
       }
     },
   // 如果需要,也可以在created中赋值,但上面这样直接赋值也可以,因为mixin的data会在每个组件创建时合并

+ 5 - 4
util/shareMixin.js

@@ -10,17 +10,18 @@ export default {
   
   onShareAppMessage() {
     return {
-      title: this.shareTitle || '默认分享标题',
+      title: this.shareTitle || '云飞智控',
       path: this.sharePath || '/pages/index/index',
-      imageUrl: this.shareImage || '/static/share.png'
+      imageUrl: this.shareImage || ''
     }
   },
   
+  // 朋友圈
   onShareTimeline() {
     return {
-      title: this.timelineTitle || '默认朋友圈标题',
+      title: this.timelineTitle || '云飞智控',
       query: this.timelineQuery || '',
-      imageUrl: this.timelineImage || '/static/share.png'
+      imageUrl: this.timelineImage || ''
     }
   },