WeChat applet todolist

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.