当前位置:网站首页>Douban scoring applet Part-3
Douban scoring applet Part-3
2022-07-04 01:27:00 【MAOpasX】
List of articles
One 、 primary coverage
The main page “ Movie theater hit ”、“ Recent hit series ”、“ Recent popular variety shows ” Module real data implementation ( Pass the dead data we originally wrote artificially API The interface becomes live )
Cinematic effect pictures :

Two 、wx:key
1、 Debugger warning
Before we finish Douban scoring applet Part-2 after , You can find that the debugger jumps out of the yellow warning , Let us in stars.wxml Add... While rendering the star image wx:key This attribute is used to improve performance

well , Now the pressure comes wx:key, You can see List rendering in wechat official documents wx:key, You can also simply see the following figure , In other words, provide a keyword , Prove that it is unique , Will not be dynamically changed , At present, it can be understood as our ID card , One for one

Here we might as well adopt the second method , Join in *this To avoid warnings

2、 URL usage warning
When we don't bind the corresponding website online applet , These websites are considered unsafe , So in advance Local settings Check this item in

3、 ... and 、 Single layout implementation
1、API Interface
On the home page index.js file ,onLoad() Function, we write
establish that Variables are convenient for us to use Page Data in the page
wx.request( Specific to see Official wechat documents -wx.request) Make a request to the website , By default, we will join url, Fill in here API
①API? Specific to see Official wechat documents -API, It's an interface , We need to use it to get real data
②(;д;) there API The website is provided by others , There is no sharing here
success() Indicates a successful request to , Inside res It's a random value

2、 Search data
We found that subject_collection_items It's the data we need ( The bid winner in the figure is another , Let everyone know data There are other things in it )

3、 Definition movies Variable
We will res.data.subject_collection_items Value assigned to movies, Simple writing

4、 Save the data
Save the obtained information in data in

5、index.wxml File layout
At that time, we copied four copies, and we can delete them all , Just keep one , Add wx:for Rendering movies This list , and movies There are five groups of values , So it will be repeated five times .wx:key The corresponding setting is the title of the default item

6、index.wxml Cinema hot layout
Put the original artificially set cover address 、 Movie title 、 Modify the movie score , In this way, other data can be used universally

Four 、 The overall layout
1、 home page index.js file
Let's consider the data of popular dramas and variety shows , Just make the movie theater popular wx.request Copy , Conduct API And variable name can be modified ( Hot shows :tvs Variable ; variety show :shows Variable )

2、index.wxml file
Corresponding , We're on the front page wxml Add these two new modules to the file ( from modelGroup Start copying ) Then make corresponding modification

5、 ... and 、 design sketch
1、 design sketch 1
2、 design sketch 
6、 ... and 、 ending
This time we have realized the basic layout of the main page , Next time we will optimize accordingly
If you have any questions , You are welcome to point out ~ ヾ(◍°∇°◍)ノ゙
边栏推荐
- C import Xls data method summary IV (upload file de duplication and database data De duplication)
- 求esp32C3板子连接mssql方法
- 基于.NetCore开发博客项目 StarBlog - (14) 实现主题切换功能
- Introduction to unity shader essentials reading notes Chapter III unity shader Foundation
- leetcode 121 Best Time to Buy and Sell Stock 买卖股票的最佳时机(简单)
- 长文综述:大脑中的熵、自由能、对称性和动力学
- swagger中响应参数为Boolean或是integer如何设置响应描述信息
- CesiumJS 2022^ 源码解读[8] - 资源封装与多线程
- The force deduction method summarizes the single elements in the 540 ordered array
- Solution of cursor thickening
猜你喜欢

【.NET+MQTT】.NET6 环境下实现MQTT通信,以及服务端、客户端的双边消息订阅与发布的代码演示

GUI application: socket network chat room

Force buckle day32

【.NET+MQTT】. Net6 environment to achieve mqtt communication, as well as bilateral message subscription and publishing code demonstration of server and client
![Cesiumjs 2022^ source code interpretation [8] - resource encapsulation and multithreading](/img/d2/99932660298b4a4cddd7e5e69faca1.png)
Cesiumjs 2022^ source code interpretation [8] - resource encapsulation and multithreading

在寻求人类智能AI的过程中,Meta将赌注押向了自监督学习

TP5 automatic registration hook mechanism hook extension, with a complete case

A-Frame虚拟现实开发入门

Weekly open source project recommendation plan

Windos10 reinstallation system tutorial
随机推荐
【.NET+MQTT】.NET6 环境下实现MQTT通信,以及服务端、客户端的双边消息订阅与发布的代码演示
MySQL -- Introduction and use of single line functions
MPLS experiment
How to set the response description information when the response parameter in swagger is Boolean or integer
Hash table, string hash (special KMP)
The force deduction method summarizes the single elements in the 540 ordered array
Solution to the problem that jsp language cannot be recognized in idea
Future源码一观-JUC系列
【.NET+MQTT】. Net6 environment to achieve mqtt communication, as well as bilateral message subscription and publishing code demonstration of server and client
Print diamond pattern
Is Shengang securities company as safe as other securities companies
ES6 deletes an attribute in all array objects through map, deconstruction and extension operators
Trading software programming
【.NET+MQTT】.NET6 环境下实现MQTT通信,以及服务端、客户端的双边消息订阅与发布的代码演示
How to use AHAS to ensure the stability of Web services?
How can enterprises optimize the best cost of cloud computing?
Decompile and modify the non source exe or DLL with dnspy
1-redis architecture design to use scenarios - four deployment and operation modes (Part 1)
机器学习基础:用 Lasso 做特征选择
AI 助力艺术设计抄袭检索新突破!刘芳教授团队论文被多媒体顶级会议ACM MM录用