| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <title>Document</title>
- </head>
- <body>
- <button id="btn">子页面按钮-触发彩蛋</button>
- <button id="hidden">隐藏右测图标</button>
- <button id="show">显示右测图标</button>
- </body>
- <script>
- window.sonGetListFu = (val, code) => {
- console.log('子页面接受父页面传过来的数据,', val, code)
- // [
- // // 数据格式
- // {
- // imgUrl:
- // 'https://xxxxxx',
- // flag: true, 表示彩蛋已经解锁
- // name: '第一天-三级任务1',
- // id: '08c636aa444d4f6ba4a048370848febe',
- // sort: 1 拿sort当id
- // }
- // ...
- // ]
- }
- window.sonEggUpFu = id => {
- console.log('子页面接受父页面-关闭彩蛋', id)
- }
- const btnDom = document.querySelector('#btn')
- btnDom.onclick = () => {
- // 传sort
- window.parent.FaStrikeEggFu(1)
- window.parent.FaStrikeEggFu(1)
- window.parent.FaStrikeEggFu(1)
- window.parent.FaStrikeEggFu(1)
- }
- const hiddenDom = document.querySelector('#hidden')
- hiddenDom.onclick = () => {
- window.parent.FaIconStateFu(false)
- }
- const showDom = document.querySelector('#show')
- showDom.onclick = () => {
- window.parent.FaIconStateFu(true)
- }
- </script>
- </html>
|