当前位置:网站首页>配置tabBar和request网络数据请求
配置tabBar和request网络数据请求
2022-07-17 05:09:00 【一指流沙q】
一、配置tabBar
效果图:

代码:app.json
"tabBar": {
"selectedColor": "green",
"position": "bottom",
"list": [
{
"pagePath": "pages/home/home",
"text": "首页",
"iconPath": "/images/首页.png",
"selectedIconPath": "/images/首页 (1).png"
},
{
"pagePath": "pages/message/message",
"text": "信息",
"iconPath": "/images/消息.png",
"selectedIconPath": "/images/消息 (1).png"
},
{
"pagePath": "pages/contact/contact",
"text": "联系我们",
"iconPath": "/images/联系我们.png",
"selectedIconPath": "/images/联系我们 (1).png"
}
]
},二、网络数据请求
跳过 request 合法域名校验

代码:
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({
/**
* 页面的初始数据
*/
data: {
swiperList: [],
},
/**
* 生命周期函数--监听页面加载
*/
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
})
}
})
},效果图:
边栏推荐
猜你喜欢

1.東軟跨境電商數倉需求規格說明文檔

5.数据采集通道搭建之业务分析

Using Flink SQL to fluidize market data 2: intraday var

Redis source code analysis dynamic string implementation (SDS)

Operation of C language files

Online software testing training institutions lemon class and itest AI platform achieves strategic cooperation

UML (use case diagram, class diagram, object diagram, package diagram)

一次全面的性能优化,从5秒优化到1秒

Spark core programming (4) -- spark operation architecture

面渣逆袭:线程池夺命连环十八问,面试官直夸我
随机推荐
MySQL installation and configuration tutorial (super detailed)
Pgsql与Oracle语法差异(SQL迁移记录)
写一个定时自检
What is the employment prospect of software testing? There is a large demand for talents and strong job stability
ETL tool -- kettle realizes simple data migration
5.1数据采集通道搭建之业务数据采集通道搭建
Common interview questions of operating system
C语言动态内存管理
常量与常量指针
The future of data Lakehouse - Open
C语言的高级操作
3. Neusoft cross border e-commerce data warehouse project architecture design
C语言文件的操作
Functions and parameters
Talk about the 8 pits of redis distributed lock
MYSQL基本语法字典
jvm学习
MySQL cache solution problem solving
利用IDE打jar包
跨域和处理跨域