This article describes how to switch the Tab page of the applet to update data. For more information about how to switch the Tab page of the applet to update data, see the following article, for more information, see
The applet Tab page switches to update data.
The applet is still in the beta phase, and the most inconvenient thing is that the official website is constantly updating. the functions written in the previous few days suddenly become unavailable several days later )_
The functional requirements are as follows:
On the home page, I click "more than 50 thousand". he will jump to the "buy a car" page and bring the "more than 50 thousand" filter condition to the "buy a car" page.
GlobalData: {currentLocation: 'Beijing', selectCondition: '', userInfo: null}
In globalData, except userInfo, the other two variables included in the applet are defined by me.
2. click "50 thousand or above" on the "homepage" and perform two operations.
First, modify the value of the global variable selectCondition.
Second, jump to the Buy a Car page
You need to write in. js on the homepage:
addSelectCondition:function(e){ var con=e.currentTarget.dataset.hi; app.globalData.selectCondition=con; console.log(app.globalData.selectCondition) wx.switchTab({ url: '../buycar/pickcar' }) }
This is the content of the entire function. before the console, it is to modify the value of the global variable.
The code jumps to the "buy a car" tab page and uses wx. switchTab.
3. get the global variable selectCondition in the onShow function on the buy a car page and assign the value to the variable we have already defined in data, in this way, you can call the value of "more than 50 thousand" in "buy a car ".
Success, Sasa Hua
Thank you for reading this article. I hope it will help you. thank you for your support for this site!
The preceding section describes how to switch the update data on the Tab page of the applet. For more information, see other related articles in the first PHP community!