WeChat applets implement cache for setting up and read caches according to different IDs

This article is based on different IDs, which is a synchronous cache:

Jonnums.count is the data returned by the interface is the total number of registrations

NewNumber’s new registration total number – Cache last registration total number = new registration number


ONLOAD: Function Options) {var this; var ActivityId = Options.ActivityID; // Registration Form counting wx.Request ({URL: Domain + ‘/ ActivityJoin / SelectJoinCount’, Data: {ActivityId: ActivityId}, Method: ‘Get’ , success: function (res) {var jonNums = res.data; var newNumber = jonNums.count – wx.getStorageSync ( ‘jonNumsed’ + activityId) // Get cache wx.setStorageSync ( ‘jonNumsed’ + activityId, jonNums.count) ; // Set the cache if (jonnums.count) {activityid} jonnums.joincount = jonnums.count; That.SetData ({NEWNUMBER: NEWNUMBER, Jonnums: jonnums})}}}}}}}}}
 Thank you for reading, I hope to help everyone, thank you for your support of this site!   
© Copyright Notice
Just support it if you like
comment Grab the couch

Please log in to comment