What if WeChat Mini Programs loads the first page and bottom navigation as needed?

the first requirement is that when the page is loaded for the first time, it will verify whether it has been stored in the database. If it is saved, it will display indexA. If the database cannot find data, how can indexB, control the display? I can write both index on one page, and then make a judgment. Is there any other better way?

the second requirement is that there are five pages, and you only need to add bottom navigation to three pages. How do you do that?

ask thighs to give some ideas ~ ~ is WeChat Mini Programs"s


first question:

  1. can be judged in the background before the page is loaded, then get the value of indexA or indexB, and then bring it into the page program to print it out.
  2. can call the background through Ajax after the page is loaded, then get the value of indexA or indexB, and then update part of the page.

second question:
the best way is to use a template engine or daemon to load. Because you don't know what your daemon is, you can load it through a js like jquery, which is less efficient, but it's better than simplicity.

<html> 
  <head> 
    <script src="jquery.js"></script> 
    <script> 
    $(function(){
      $("-sharpincludedContent").load("b.html"); 
    });
    </script> 
  </head> 

  <body> 
     <div id="includedContent"></div>
  </body> 
</html>
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bf3f60-31eaf.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bf3f60-31eaf.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?