当前位置:网站首页>Configure tabbar and request network data requests
Configure tabbar and request network data requests
2022-07-19 05:37:00 【One finger quicksand Q】
One 、 To configure tabBar
design sketch :
Code :app.json
"tabBar": {
"selectedColor": "green",
"position": "bottom",
"list": [
{
"pagePath": "pages/home/home",
"text": " home page ",
"iconPath": "/images/ home page .png",
"selectedIconPath": "/images/ home page (1).png"
},
{
"pagePath": "pages/message/message",
"text": " Information ",
"iconPath": "/images/ news .png",
"selectedIconPath": "/images/ news (1).png"
},
{
"pagePath": "pages/contact/contact",
"text": " Contact us ",
"iconPath": "/images/ Contact us .png",
"selectedIconPath": "/images/ Contact us (1).png"
}
]
},
Two 、 Network data request
skip request Legal domain name verification
Code :
home.wxml
<swiper indicator-dots='true' circular="true">
<swiper-item wx:for="{
{swiperList}}" wx:key="id">
<image src="{
{item.image}}"></image>
</swiper-item>
</swiper>
home.wxss
swiper {
height: 350rpx;
}
swiper image {
width: 100%;
height: 100%;
}
home.js
Page({
/**
* Initial data of the page
*/
data: {
swiperList: [],
},
/**
* Life cycle function -- Monitor page loading
*/
onLoad(options) {
this.getSwiperList()
},
getSwiperList() {
wx.request({
url: 'https://www.escook.cn/slides',
method: 'GET',
success: (res) => {
console.log(res);
this.setData({
swiperList: res.data
})
}
})
},
design sketch :
边栏推荐
猜你喜欢
mysql的使用
1. Neusoft cross border e-commerce warehouse demand specification document
MySQL学习笔记(5)——JOIN联表查询,自连接查询,分页和排序,子查询与嵌套查询
4. Neusoft cross border e-commerce data warehouse project - user behavior data acquisition channel construction of data acquisition channel construction (2022.6.1-2022.6.4)
Ambari2.7.5 integration es6.4.2
配置tabBar和request网络数据请求
LiveData浅析
2. Technology selection of Neusoft cross border e-commerce data warehouse project
Minor problems of GCC compiling C language in ubantu
[first launch in the whole network] one month later, we switched from MySQL dual master to master-slave
随机推荐
2. Technology selection of Neusoft cross border e-commerce data warehouse project
List and map
gradle自定义插件
对象转map
【全网首发】主线程异常会导致 JVM 退出?
1. Dongsoft Cross - Border E - commerce Data Warehouse Requirement specification document
Common (Consortium)
时间差计算
Object to map
电商用户行为实时分析系统(Flink1.10.1)
关于线程池中终止任务
Rxjs source code analysis (I) observable
正则替换group(n)内容
Some applications of special pointers
10问10答:你真的了解线程池吗?
MySQL--存储和游标
MySQL installation and configuration tutorial (super detailed)
【Bug解决】org.apache.ibatis.type.TypeException: The alias ‘xxxx‘ is already mapped to the value ‘xxx‘
共用(联合)体
Common methods of goframe error handling & use of error codes