垃圾分类特别火也不知道北京什么时候也开始执行,看见之前上海市民被灵魂拷问了以后垃圾真的不知道如何丢了,作为程序员就做一个小程序造福人类吧。
效果图:
一、全局的app.json和app.wxss加入了一点东西
App.json
{
"pages": [
"pages/index/index",
"pages/details/details",
"pages/logs/logs"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "WeChat",
"navigationBarTextStyle": "white",
"navigationStyle": "custom"
},
"sitemapLocation": "sitemap.json"
}
App.wxss
.bg{
position: absolute;
left:0;
top:0;
width:100%;
height: 100%;
}
二、下面就是首页的index.wxml、index.js、 index.wxss
index.wxml
<image class='bg' src='../img/bg.png'></image>
<view class='container'>
<view class='top'>
<text class='top-title'>你是什么垃圾</text>
<text class='top-more'>一键查询免烦恼,从我做起爱环保</text>
</view>
<view class='search'>
<view class='search-main'>
<ic