


Let’s first take a look at the content of the official documentation:
The official documentation says that by setting the attribute open-type="share" to the button component, the user can The Page.onShareAppMessage event is triggered after clicking the button. Related components: button.
Official website documentation: https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html
In the first case, click the mini program to forward
Do not add parameters
//转发 onShareAppMessage: function() { let users = wx.getStorageSync('user'); if (res.from === 'button') {} return { title: '转发', path: '/pages/index/index', success: function(res) {} } }
Add parameters
//转发 onShareAppMessage: function() { let users = wx.getStorageSync('user'); if (res.from === 'button') {} return { title: '转发', path: '/pages/index/index?from_uid=' + users.id, success: function(res) {} } }
Second type: Share
onShareAppMessage: function (res) { if (res.from === 'button') { } return { title: '转发', path: '/pages/index/community/topic/topic', success: function (res) { console.log('成功', res) } } }Add parameters
//转发 onShareAppMessage: function (res) { if (res.from === 'button') { } return { title: '转发', path: '/pages/index/community/topic/topic?jsonStr=' + this.data.list, success: function (res) { console.log('成功', res) } } }
The above is the detailed content of How to perform forwarding operations within the mini program page. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

WebStorm Mac version
Useful JavaScript development tools
