Mini program architecture

I don’t know how everyone writes mini programs. I was writing WeChat mini programs a few months ago. I created a structure, or framework, by myself. The native architecture of WeChat is like this ├── app.js ├── app.json ├── app.wxss ├── pages │ │── index │ │ ├── index.wxml │ │ ├── index.js │ │ ├── index.json │ │ └── index.wxss │ └── logs │ ├── logs.wxml │ └── logs.js └── utils ...

May 17, 2019 · 4 min · MoeJue

WeChat authorized login

Documentation: https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421135319 The authorized login of WeChat is similar to the authorized login of QQ, Sina and other platforms, and both adopt the OauthOAuth2.0 authentication method. There are two types of WeChat authorization: Silent authorization Pop-up authorization requires manual consent from the user. Explanation of the differences between the two scopes Web page authorization initiated with snsapi_base as the scope is used to obtain the openid of the user who enters the page, and is authorized silently and automatically jumps to the callback page. What the user perceives is that they directly enter the callback page (often a business page) Web page authorization initiated with snsapi_userinfo as the scope is used to obtain the user’s basic information. However, this kind of authorization requires the user to manually agree, and since the user has agreed, there is no need to pay attention, and the user’s basic information can be obtained after authorization. The “Interface for Obtaining User Basic Information” in the user management interface can obtain the user’s basic information based on the user’s OpenID only after the user interacts with the public account through messages or after the follow-up event is pushed. This interface, including other WeChat interfaces, requires the user (i.e. openid) to follow the official account before it can be called successfully. ...

April 5, 2019 · 6 min · MoeJue

WeChat JSAPI payment

I have been doing business related to WeChat some time ago. Although it is not a new technology, I have never had the opportunity to come into contact with it before. Then I stepped on some pitfalls and took the time to organize and record it. There are 7 types of WeChat payment, including: payment code payment, JSAPI payment, Native payment, APP payment, H5 payment, mini program payment, and face payment. WeChat JSAPI payment is used in this business: the user enters the merchant’s H5 page by scanning the QR code on WeChat, following the official account, etc., and calls JSSDK within WeChat to complete the payment. ...

March 30, 2019 · 7 min · MoeJue