Small programs step on the road, small programs step on the road
Some time ago, the company asked for a small program. Now it is still idle. Let's summarize the problems encountered in the small program.
There are provided document interfaces and developer tools, which always feel so smooth to complete, but After previewing on the mobile phone, there will always be such a problem:
1. background image problems
The size of the packaged applet must not exceed 1 MB. For this reason, the local image cannot be used, but the image tag can be used to display the image or convert the background image to base64, you can also use the image network address to save the image to the server, but it is troublesome to upload the image again every time the image is modified; base64 image encoding: if the image size is large, the encoding will be very long, but this is also a bit of a problem;
2. image problems: Generally, images in png format are used for page background images. However, in small programs, images in general format will be blurred as background images, therefore, vector image svg is selected for base64 Transcoding of the background image;
3. Data Interface: the applet requires that the interface must be an https request. The request domain name must be configured in the management background of the applet to upload the domain name. The development tool can be http;
4. navigation between pages: wx. navigateTo exists in the page jump of the applet.、
Wx. redirectTo, wx. switchTab, and wx. navigateBack. At the same time, the jump must not exceed five layers. The implementation of the jump is achieved through the bindtap click event or component navigator
<Navigator url = "redirect? Title = redirect "open-type =" redirect "hover-class =" other-navigator-hover "> open on the current page </navigator>
However, if you click it consecutively, the page will jump multiple times. At this time, my solution is to determine that only one click is allowed to perform the operation;
5. default prompt text in the text box: When the cursor moves to the text box and gets the focus, the text will flash by default, which is not solved;
6. When the text box is set to the password box: when the text box is set to the password box, type = "text". After the phone keyboard enters the number for the first time, it flashes to the letter keyboard. This is not solved;
7. button clicking effect: When hover-class = "none" is prompted in this document, no clicking effect is displayed, but this is not the case. When the button is set to hollow-out, there are still results, so you can leave it empty;
8. Message prompt box type: the applet only provides two types of message prompt box: success and loading. For some of the places that require prompt, it is always out of date, So you write one yourself;
9. layout of applets: rpx layout is used for the layout, which basically adapts to the size of most mobile phones, but small-screen mobile phones need to be specially adapted;
10. recording function: the recording format of the applet is silk and cannot be played on other playback controls. wx. playVoice can play locally cached audio files. Therefore, transcoding is required for uploading audio files. This is done in the background for transcoding.
Maybe that's all. My memory is not very good. In short, the overall framework of mini programs is still very good...