Ver código fonte

修复转发菜单显示问题

cc12458 1 ano atrás
pai
commit
e63379bfa2
1 arquivos alterados com 4 adições e 4 exclusões
  1. 4 4
      miniprogram/pages/home/home.ts

+ 4 - 4
miniprogram/pages/home/home.ts

@@ -5,6 +5,8 @@ import { login } from "../../lib/logic";
 const { shared, Easing, timing } = wx.worklet
 const offset = shared(0);
 
+const menus = ['shareAppMessage', 'shareTimeline'];
+
 // pages/home/home.ts
 import { getPatients, healthReportMethod, healthIndexMethod, getSolarTerms, getShortScienceList, getPatientDescription } from "./request";
 import { toCertificationPage } from "./router";
@@ -16,16 +18,14 @@ Page({
     DraggableSheetBehavior('.draggable-sheet-wrapper'),
   ],
   onLoad() {
-    // wx.showShareMenu({
-    //   withShareTicket: true,
-    //   menus: ['shareAppMessage', 'shareTimeline']
-    // });
     this.initFabAnimated();
   },
   onShow() {
+    wx.showShareMenu({ withShareTicket: true, menus }).then();
     this.load();
   },
   onHide() {
+    wx.hideShareMenu({menus}).then();
     offset.value = timing(0, { duration: 100, easing: (<any>Easing).linear }, () => { 'worklet' });
   },
   onShareAppMessage(opts): WechatMiniprogram.Page.ICustomShareContent {