Article directory
build tabbar
page path
page name | path |
---|---|
front page | index |
Horizontal screen | horizontal |
Exquisite video | video |
search | search |
mine | mine |
Home Module
- const , let , var of es6
- Arrow function relationship
- Array splicing (merging)
tabs component
need
- Implement a custom component tabs
- The function is similar to the previous class package
Recommended components
Featured Big Picture
- Use the built-in applet to send asynchronous code requests to get data
- Cycle through to the page
month
- Use the built-in applet to send asynchronous code requests to get data
- Simple processing time format rendering to the page
popular
- Send an asynchronous request to get data and render the page
- paging function
- Use the scroll-view component to achieve partial scrolling of the page
- Use css calc to calculate container height
- Use throttle to control paging requests
- Use wx-showLoadding and wx-showToast to display friendly pages
classification module
need
- Send a request to get classification data
- Realize dynamic rendering of data
- Use the scroll-view tag to scroll the page
- Click on the category picture to jump to the category details page
Jump according to the id of the classified image
<navigator url="/pages/categoryDetail/categoryDetail?id=xxxxxxxxxxxxxxxx" >
</navigator>
Category details
business
- Reference custom tabs component
- Get the id on the url
- Splicing request parameters, sending requests to get data
- Implement pagination loading
- When clicking on the tabs title, resend the request to get the corresponding data
Home Module
album module
need
- Send a request, get album data, and complete page rendering
- Use scroll-view to implement pagination
- Click to enter the album details page
- Carry the current album data and store it in the global, which is convenient to obtain on the album details page
- Global Data``
getAPP().globalData.album=album;
album details
- Get album information in global data
- Get the album album according to the album information
- Implement top carousel map swiper
- Implement page scrolling and paging scroll-view
Exquisite video
need
- Send a request to get data page rendering
- Click on the picture to enter the video details page
- While jumping to the page, use the built-in global data sharing method getApp().globalData in the applet for data transfer
Video details
need
- Get the video data passed over from the previous page
- Get it in getApp()
- Render background images and videos
- Use css filter to achieve filter effect
- Use the video tag to implement video playback
- Binding download click event
- Use wx.downloadFile to download the video on the server into the cache
- Use wx.saveVideoToPhotosAlbum to download the video in the cache to the phone
Picture details
need
- Replace the parent container of all images with the navigator tag
- Set the jump path of the page to /pages/picture/picture
- At the same time, set the carried parameter as the path of the picture
- Binding the click event to realize the click download of the picture
- Use a function similar to downloading videos