const app = getApp()
Page({
data: {
scene:[],
},
bindViewTap() {
},
onLoad() {
wx.request({
url: 'https://api-v2.chuangkit.com/mobile/main/getMainMiniProgramHomeInfo.do',
success: res=>{
console.log(res);
this.setData({
scene:res.data.body.data.scene.slice(0,8),
})
}
})
},
getUserProfile(e) {
},
getUserInfo(e) {
}
})
<view class="container">
<view class="search">
<input type="text"
placeholder="20000+ 免费模板任你搜索"
placeholder-style="color:#90EE90"></input>
<image src="/image/search.png"></image>
</view>
<view class="scene">
<view wx:for="{{scene}}" wx:key="index">
<image src="{{item.thumbUrl}}"></image>
<text>{{item.name}}</text>
</view>
</view>
</view>
.search{
position: relative;
}
input{
text-align: center;
background-color: #f8f8f8;
margin: 30rpx;
height: 80rpx;
line-height: 80rpx;
border-radius: 40rpx;
font-size: 30rpx;
}
.search image{
position: absolute;
width: 30rpx;
height: 30rpx;
top: 25rpx;
left: 130rpx;
}
{
"entryPagePath": "pages/index/index",
"pages":[
"pages/index/index",
"pages/design/design",
"pages/mine/mine"
],
"window":{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#90EE90",
"navigationBarTitleText": "创客贴",
"navigationBarTextStyle":"black"
},
"tabBar": {
"list":[{
"pagePath":"pages/index/index",
"text":"Home",
"iconPath":"/image/index.png",
"selectedIconPath":"/image/index-active.png"
},
{
"pagePath":"pages/design/design",
"text":"Design",
"iconPath":"/image/design.png",
"selectedIconPath":"/image/design-active.png"
},
{
"pagePath":"pages/mine/mine",
"text":"User",
"iconPath":"/image/mine.png",
"selectedIconPath":"/image/mine-active.png"
}]
},
"style": "v2",
"sitemapLocation": "sitemap.json"
}