Get the App
SLTechnology News&Howtos  ›  Development  › 

How to realize the sharing function of Mini Program

Shulou Source: shulou.com Published: 2022-06-01 06:36:48 10月03日 Update

The editor of this article introduces in detail "how to achieve Mini Program sharing function". The content is detailed, the steps are clear, and the details are handled properly. I hope this article "how to achieve Mini Program sharing function" can help you solve your doubts. Let's follow the editor's ideas to learn new knowledge.

WXML code

Kim Pig Farm sharing

Js code

OnShareAppMessage: function (ops) {if (ops.from = 'button') {/ / from the on-page forwarding button console.log (ops.target)} return {title:' xx Mini Program', path: 'pages/index/index', success: function (res) {/ / forwarded console.log ("forwarded successfully:" + JSON.stringify (res)) }, fail: function (res) {/ / forwarding failed console.log ("forwarding failed:" + JSON.stringify (res));}

Callback result:

Callback type errMsg indicates that successshareAppMessage:ok forwarding succeeded. FailshareAppMessage:fail cancel user canceled forwarding failshareAppMessage:fail (detail message) forwarding failure. Detail message is the detailed failure information read here. This article "how to implement Mini Program sharing function" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it before you can understand it. If you want to know more about related articles, Welcome to the industry information channel.

Tags: Programs functions success articles code content appropriateness information pig farms ideas buttons new knowledge more steps users knowledge knowledge points articles types details Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Docker Linux Apple Xiaomi