浏览代码

小程序分享

lilei 4 年之前
父节点
当前提交
163c61e201
共有 2 个文件被更改,包括 12 次插入5 次删除
  1. 3 3
      project.config.json
  2. 9 2
      src/pages/index/index.vue

+ 3 - 3
project.config.json

@@ -7,11 +7,11 @@
 		"preloadBackgroundData": false,
 		"minified": true,
 		"newFeature": true,
-		"autoAudits": false,
 		"coverView": true,
+		"nodeModules": false,
+		"autoAudits": false,
 		"showShadowRootInWxmlPanel": true,
 		"scopeDataCheck": false,
-		"nodeModules": false,
 		"checkInvalidKey": true,
 		"checkSiteMap": true,
 		"uploadWithSourceMap": true,
@@ -29,7 +29,7 @@
 	"projectname": "zyyc-wxmini",
 	"simulatorType": "wechat",
 	"simulatorPluginLibVersion": {},
-	"libVersion": "2.7.2",
+	"libVersion": "2.14.1",
 	"condition": {
 		"search": {
 			"current": -1,

+ 9 - 2
src/pages/index/index.vue

@@ -166,9 +166,16 @@ export default {
   onShow() {
     this.checkLogin()
     this.getHd()
+    wx.showShareMenu({
+        withShareTicket: true,
+        menus: ['shareAppMessage', 'shareTimeline']
+    });
   },
-  onShareAppMessage: function () {
-
+  onShareAppMessage(res) {
+    console.log(res)
+  },
+  onShareTimeline(res) {
+    console.log(res)
   }
 };
 </script>