当前位置:网站首页>Member management applet actual development 07 page Jump
Member management applet actual development 07 page Jump
2022-07-01 00:26:00 【Low code preacher】
In the previous section, we introduced the life cycle functions and custom methods in low code , In this section, we introduce the page Jump in low code .
Page Jump
It is relatively simple to realize page Jump in low code , Add behavior directly to the component , Call the jump method of the platform . Open the editor of the application , Select the button component we set , Modify the text content of the component .

After the button text content is modified, we can add behavior to the button , Set it to jump to the page after clicking . In order to set the target page, we can first create two pages , The home page of the merchant side and the home page of the customer side . Click on the top left + No. create new page , Enter the page name and id .
After the page is created, we can set the click event . Select the button component , Find the behavior in the property panel on the right . Click on Clicking time , In the pop-up interface, select the page to jump , Just set the page to jump 
Get users openid
We just jump to the above page , Before jumping, we need to get the user's openid. Combined with the basic knowledge we introduced earlier , You need to call the custom connector when the applet starts to get openid.
Click on the menu bar in the upper left corner , Select low code editor
Paste the following code into the global lifecycle function
/** * It can be done by app Get or modify the global application Variable state Etc * The details can be console.info In the editor Console Panel for more information * if necessary async-await, Please before the method async **/
export default {
async onAppLaunch(launchOpts) {
//console.log('---------> LifeCycle onAppLaunch', launchOpts)
const result = await app.cloud.callConnector({
name: 'getopenid_dopqiuw',
methodName: 'getopenid',
params: {
}, // Methods into the reference
});
console.log(result)
},
onAppShow(appShowOpts) {
//console.log('---------> LifeCycle onAppShow', appShowOpts)
},
onAppHide() {
//console.log('---------> LifeCycle onAppHide')
},
onAppError(options) {
//console.log('---------> LifeCycle onAppError', options)
},
onAppPageNotFound(options) {
//console.log('---------> LifeCycle onAppPageNotFound', options)
},
onAppUnhandledRejection(options) {
//console.log('---------> LifeCycle onAppUnhandledRejection', options)
}
}
After the save , We can see that the console has output appid,openid It needs to take effect in the applet 
Now there's a problem with getting openid Where do you want to deposit it ? We can define a global variable to store . Click the variable in the navigation bar , Create a global variable openid
After the variable is defined, we can copy the path of the variable , Assign value in the life cycle function 
Final code :
/** * It can be done by app Get or modify the global application Variable state Etc * The details can be console.info In the editor Console Panel for more information * if necessary async-await, Please before the method async **/
export default {
async onAppLaunch(launchOpts) {
//console.log('---------> LifeCycle onAppLaunch', launchOpts)
const result = await app.cloud.callConnector({
name: 'getopenid_dopqiuw',
methodName: 'getopenid',
params: {
}, // Methods into the reference
});
console.log(result)
app.dataset.state.openid = result.openid
console.log(app.dataset.state.openid)
},
onAppShow(appShowOpts) {
//console.log('---------> LifeCycle onAppShow', appShowOpts)
},
onAppHide() {
//console.log('---------> LifeCycle onAppHide')
},
onAppError(options) {
//console.log('---------> LifeCycle onAppError', options)
},
onAppPageNotFound(options) {
//console.log('---------> LifeCycle onAppPageNotFound', options)
},
onAppUnhandledRejection(options) {
//console.log('---------> LifeCycle onAppUnhandledRejection', options)
}
}
How to check the specific effect ? Click the Publish button on the navigation bar , Select the applet to be published as an experience version 
How to debug small programs ? First open your applet , Click the icon of three points in the upper right corner 
In the pop-up window, select the development and debugging menu 
After clicking, a... Will appear in the lower right corner of the applet vConsole The icon 
Click this icon to see the debugging window , We usually use in our code console.log The printed information will appear here . Skillfully use console.log Printing variable information is also the basic skill of development , Basically, you can solve most problems by printing information .
Well, that's all for this section , Follow the above steps to try it for yourself . If you feel useful, remember to praise 、 Follow and comment . See you next time .
边栏推荐
- Is it safe to choose mobile phone for stock trading account opening in Guangzhou?
- Bridge emqx cloud data to AWS IOT through the public network
- Explain kubernetes backup and recovery tools velero | learn more about carina series phase III
- 1. crawler's beautifulsoup parsing library & online parsing image verification code
- 1175. 质数排列 / 剑指 Offer II 104. 排列的数目
- Software engineering best practices - project requirements analysis
- The programmer's girlfriend gave me a fatigue driving test
- 2022-2028 global ethylene oxide scrubber industry research and trend analysis report
- 什么是SRM系统,如何规范公司内部采购流程
- How to specify the number of cycles in JSTL- How to loop over something a specified number of times in JSTL?
猜你喜欢

Teach you how to use Hal library to get started -- become a lighting master

2022-2028 global carbon fiber room scraper system industry research and trend analysis report

IFLYTEK active competition summary! (12)

深入理解 Jetpack Compose 内核:SlotTable 系统

1. crawler's beautifulsoup parsing library & online parsing image verification code

The full technology stack, full scene and full role cloud native series training was launched to help enterprises build a hard core cloud native technology team

Detailed explanation of conv2d -- use in arrays and images

Wordpress blog uses volcano engine veimagex for static resource CDN acceleration (free)

76 page comprehensive solution 2022 for smart Logistics Park (download attached)

Introduction to ES6 promise, new features of ES7 and es8 async and await
随机推荐
2022-2028 global 3D printing ASA consumables industry research and trend analysis report
In depth understanding of jetpack compose kernel: slottable system
composer
Advanced mathematical modeling
NATs cluster deployment
2022-2028 global encrypted external hard disk industry research and trend analysis report
The programmer's girlfriend gave me a fatigue driving test
Analysis of 8253a register
Netease cloud sign in lottery? That year I could sign in for 365 days. No? Look.
1175. Disposition des nombres premiers / échange de doigts II 104. Nombre de permutations
Shell multitasking to download video at the same time
What is SRM system and how to standardize the internal procurement process of the company
New trend of embedded software development: Devops
What is the fastest way to import data from HDFS to Clickhouse? Spark is imported through JDBC or HDFS
Vmware16 installing win11 virtual machine (the most complete step + stepping on the pit)
IFLYTEK active competition summary! (12)
需求评审,测试人员应该发挥怎样的价值?两分钟让你不再懵逼
Introduction to ES6 promise, new features of ES7 and es8 async and await
Matlab saves triangulation results as STL files
Tide - rust web framework based on async STD