In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
In this article, the editor introduces in detail "how Mini Program can achieve the home jump back to the sharing page". The content is detailed, the steps are clear, and the details are handled properly. I hope that this "how Mini Program to achieve the home page jump back to the sharing page" article can help you solve your doubts. Let's follow the editor's ideas to slowly deepen, let's learn new knowledge.
Doing Mini Program development found that after the page is shared, it is difficult for users to find the situation of returning to the home page through the page they share. The official operation of Wechat is to click on the three points in the upper right corner and display it at the bottom of the phone to return to the home page. Many folk programs are to add a floating Home tag on the page.
Today I share another way. Please look at the .gif below
Have you noticed that there is a back button in the upper left corner? The principle is simple, on the page you want to share, configure your home page when sharing the configuration, and take the corresponding parameters, which can be obtained in the home page onLoad method. The code is as follows:
Const app = getApp ()
Page ({
Data: {
Motto: 'Hello World'
UserInfo: {}
HasUserInfo: false
CanIUse: wx.canIUse ('button.open-type.getUserInfo')
}
/ / event handling function
GoLogs: function () {
Wx.navigateTo ({
Url:'/ pages/logs/logs'
})
}
OnLoad: function (options) {
Console.log (options)
If (options.share_query) {
Wx.showLoading ({
Title:'I entered from the sharing page'
})
SetTimeout (function () {
Wx.hideLoading ()
Wx.navigateTo ({
Url:'/ pages/logs/logs'
})
}, 2000)
}
}
})
{{index + 1}}. {{log}}
Const app = getApp ()
Page ({
Data: {
Motto: 'Hello World'
UserInfo: {}
HasUserInfo: false
CanIUse: wx.canIUse ('button.open-type.getUserInfo')
}
/ / event handling function
GoLogs: function () {
Wx.navigateTo ({
Url:'/ pages/logs/logs'
})
}
OnLoad: function (options) {
Console.log (options)
/ / determine whether to share access
If (options.share_query) {
Wx.showLoading ({
Title:'I entered from the sharing page'
})
SetTimeout (function () {
Wx.hideLoading ()
Wx.navigateTo ({
Url:'/ pages/logs/logs'
})
}, 2000)
}
}
})
After reading this, the article "how to achieve Mini Program sharing page to return to the home page" has been introduced. If you want to master the knowledge of this article, you still need to practice and use it yourself. If you want to know more about related articles, welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.