Applet todolist
WeixinApp applet toDoList
List page
There are some problems when adding a simple list page and Data
SetData has some problems when clearing user interaction pages.
InputA is an input box. When submitting data, you need to clear the data in the form. setData cannot be cleared.
Add data
Use wx. setStorageSync (KEY, DATA ).
try { wx.setStorageSync('key', 'value')} catch (e) {}
Delete data
Use wx. removeStorageSync (KEY)
try { wx.removeStorageSync('key')} catch (e) { // Do something when catch error}
Details page
The routing mechanism is used.
View
Modular Testing
Some ES syntax is used.
Wx. request
Wx. request initiates an https request. A small program can have only five network request connections at the same time.
When testing wx. request.
Wx. request post parameter passed. The developer server cannot obtain the Parameter
// This sentence is not suitable for embedding in php. Header ('access-Control-Allow-Origin: * '); // some parameters may need to be configured on the nginx server for small programs to call
Basically, get is fine. (There are no problems with url parameters)
Other APIs are not tested and are not used much. If necessary, perform tests again.
Var count = 0var maxRequest = 100var getRequest = function () {wx. request ({// This domain name must be configured with url: 'https: // test.com/t/wxRes', // only for example, not the actual interface address success: function (res) {count ++ if (count <maxRequest) {getRequest () }}, fail: function (res) {console. log (res) }}// https request for (var I = 0; I <5; I ++) {getRequest ()} // if it is directly for10 times, there must be an error. Here we can only for5 times
I found a problem during the test. Post Data fails. After reading the document, we can draw a conclusion. You need to add a piece of code