Browse Source

feat:联盟店 即将上线 小程序分享

DaMowang 3 years ago
parent
commit
1bf80ed94d
4 changed files with 33 additions and 1 deletions
  1. 3 0
      src/main.js
  2. 7 1
      src/pages/partner/index.vue
  3. BIN
      src/static/img/upcoming.png
  4. 23 0
      src/utils/share.js

+ 3 - 0
src/main.js

@@ -12,6 +12,9 @@ Vue.prototype.$md5 = md5;
 import dayjs from 'dayjs';
 Vue.prototype.$day = dayjs;
 
+// 微信全局分享
+import share from '@/utils/share.js'
+Vue.mixin(share)
 
 import cof from '@/static/config/in';
 Vue.prototype.$cof = cof;

+ 7 - 1
src/pages/partner/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class='partner'>
-    
+    <img src="@/static/img/upcoming.png" class="upcoming" alt="" srcset="">
   </div>
 </template>
 <script>
@@ -20,4 +20,10 @@ export default {
 }
 </script>
 <style scoped lang='scss'>
+.upcoming{
+  width: 579rpx;
+  height: 338rpx;
+  margin-left: 11.4%;
+  margin-top: 30vh;
+}
 </style>

BIN
src/static/img/upcoming.png


+ 23 - 0
src/utils/share.js

@@ -0,0 +1,23 @@
+let userinfo = uni.getStorageSync("userinfo");
+export default {
+	data() {
+		return {
+			share: {
+				title: '让数字经济赋能美好生活',
+				path: '/pages/index/index?invite=' + userinfo.invite
+			}
+		}
+	},
+	onShareAppMessage(res) { //发送给朋友
+		return {
+			title: this.share.title,
+			path: this.share.path,
+		}
+	},
+	onShareTimeline(res) {//分享到朋友圈
+		return {
+			title: this.share.title,
+			path: this.share.path,
+		}
+	},
+}