1. 程式人生 > >小程序-demo:天氣預報

小程序-demo:天氣預報

tle mpi ack fine option ted nav 2.0.8 -s

ylbtech-小程序-demo:天氣預報

1.返回頂部
1、app.js
//app.js
App({
  //系統事件
  onLaunch: function () {//小程序初始化事件
    var that=this;
    //調用API從本地緩存中獲取數據
    that.curid = wx.getStorageSync(‘curid‘) || that.curid;//API:獲取本地緩存,若不存在設置為全局屬性
    that.setlocal(‘curid‘, that.curid);//調用全局方法
  },

  /******************************************************
*/ //自定義全局方法 setlocal:function(id,val){ wx.setStorageSync(id, val);//API:設置本地緩存 }, //自定義全局屬性 curid:"CN101010100", version:"1.0" })
2、app.json
{
  "pages":[
    "pages/weather/weather",
    "pages/city/city"
  ],
  "window":{
    "navigationBarBackgroundColor": "#000",
    "navigationBarTitleText": "天氣預報",
    
"navigationBarTextStyle":"#fff", "backgroundColor":"#666", "backgroundTextStyle":"light", "enablePullDownRefresh":true }, "tabBar": { "color": "#666", "selectedColor": "#56abe4", "backgroundColor": "#ddd", "borderStyle":"black", "list": [{ "pagePath": "pages/weather/weather",
"iconPath": "images/tabbar/weather1.png", "selectedIconPath": "images/tabbar/weather2.png", "text": "天氣預報" }, { "pagePath": "pages/city/city", "iconPath": "images/tabbar/city1.png", "selectedIconPath": "images/tabbar/city2.png", "text": "設置城市" }], "position":"buttom" } }
3、app.wxss
/**app.wxss**/
.container {margin: 0; padding: 0;}
.title{font-size: 14px; font-weight: bold;}
4、project.config.json
{
    "description": "項目配置文件。",
    "packOptions": {
        "ignore": []
    },
    "setting": {
        "urlCheck": true,
        "es6": true,
        "postcss": true,
        "minified": true,
        "newFeature": true
    },
    "compileType": "miniprogram",
    "libVersion": "2.0.8",
    "appid": "wx7d22ab7088f2db6a",
    "projectname": "tianqi",
    "isGameTourist": false,
    "condition": {
        "search": {
            "current": -1,
            "list": []
        },
        "conversation": {
            "current": -1,
            "list": []
        },
        "game": {
            "currentL": -1,
            "list": []
        },
        "miniprogram": {
            "current": -1,
            "list": []
        }
    }
}
5、pages 6、images 7、
2. pages返回頂部
1、 a) b) c) d) e) 2、 a) b) c) d) e) 3、 a) b) c) d) e) 4、 a) b) c) d) e) 5、 a) b) c) d) e) 6、
3.返回頂部
6、 a) b) c) d) e)
4.返回頂部
5.返回頂部
6.返回頂部
7.返回頂部
8.返回頂部
9.返回頂部
10.返回頂部
11.返回頂部
技術分享圖片 作者:ylbtech
出處:http://ylbtech.cnblogs.com/
本文版權歸作者和博客園共有,歡迎轉載,但未經作者同意必須保留此段聲明,且在文章頁面明顯位置給出原文連接,否則保留追究法律責任的權利。

小程序-demo:天氣預報