In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly shows you how to do when you call wx.login () in the development of WeChat Mini Programs. The content is simple and clear. I hope it can help you solve your doubts. Here, let me take you to study and learn how to do when you call wx.login () in the development of WeChat Mini Programs.
Many WeChat Mini Programs developers will encounter such a situation, when calling wx.login (), there is no response on some IOS, so how to solve this situation?
The response results are as follows:
According to the analysis results, we know that the login interface has been in the pending state. If the timeout time is added, it can be triggered in the complate callback.
Then why is the login method always pending?
Found a new component in the page.
This component is used to display Wechat's "avatar" and "nickname". In line with the principle of "give it a try, what if it is possible", decisively delete the component and run it again. OK, amazing hi!
Before calling the wx.login () method, I used the open-data tag to render the "avatar" and "nickname", but why use the component first and then GG? Maybe Wechat rendering has its own thread. My method of use violates Wechat's rendering mechanism and leads to thread blocking (I guess ha).
Looking back, ha, before landing, I played up the profile picture and nickname, the rhythm is not like this; just like the police check ID card, before you swipe the machine, you know what your name is, where you live, it's not scientific, right?
Therefore, to display the open-type component of the avatar and nickname, it must be rendered after calling the API of wx.login (); knowing why, it is very simple to define a variable isLogin to record whether wx.login () has called let isLogin = false wx.login ({success: function (res) {if (res.code) {/ / initiate a network request isLogin = true;}).
Then bind the isLogin to the data object of the page, I won't write it, and then on the page, just use wx:if to judge.
HiShop Mini Program tool provides various types of mall / store Mini Program production, visual editing in 1 second to generate 5 steps online. By dragging, splicing module layout Mini Program Mall page, WYSIWYG, only need art to make a beautiful mall.
What is the advantage of Mini Program Mini Program compared with developers, Mini Program is less difficult to develop, can save development and operating costs, so that developers can quickly develop a Mini Program. And Mini Program can be easily obtained and spread in Wechat, which can meet the basic life applications, in line with life services offline stores and non-rigid needs of low-frequency applications. For users, it can save time cost and mobile phone memory space, and have excellent use experience at the same time.
The above is about "what to do when you call wx.login () in WeChat Mini Programs's development?" if this article is helpful to you and think it is well written, please share it with your friends to learn new knowledge. If you want to know more about it, please pay more attention to 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.