小程序资料

小程序账号 2792426034@qq.com

学习地址 https://www.jianshu.com/p/97ef4d952ea2

AppID(小程序ID) wx3c228e355bdb598a

简易教程 基础

app.wxss 小程序公共样式表

#### wxss使view填充整个页面
但是在微信小程序中根节点是page,所以我们需要对page赋值height:100%,再对其中的view赋值100%即可


page {
  height: 100%;
  background-color: #b6d5ed;
}
#### 通用样色
  .container {
  height: 50%;
  width: 50%;
  background-color: rebeccapurple;
}  

app.json 小程序公共设置

{
 ###### 设置页面路径
  "pages":[ 
    "pages/index/index",
    "pages/logs/logs"
  ],
 ###### 用于设置小程序的状态栏、导航条、标题、窗口背景色。
  "window":{ 

    "backgroundTextStyle":"light",       背景文本风格
    "navigationBarBackgroundColor": "#fff",
    "navigationBarTitleText": "微信",
    "navigationBarTextStyle":"black",  
    "backgroundColor": "#eeeeee"     窗口的背景色,下拉时的底部背景
},
###### tabBar 设置
 "tabBar": {
    "borderStyle": "white",   tabbar上边框的颜色, 仅支持 black/white
    "color": "#000000",    tab 上的文字默认颜色
    "selectedColor": "#ff5800",    tab 上的文字选中时的颜色
    "list": [
      {
        "pagePath": "pages/home/home",
        "text": "首页",
        "iconPath": "image/homeNoSelect.png",    图片路径
        "selectedIconPath": "image/homeSelect.png"    选中时的图片路径
      },
      {
        "pagePath": "pages/category/category",
        "text": "分类",
        "iconPath": "image/categoryNoSelect.png",
        "selectedIconPath": "image/categorySelect.png"
      }
    ]
  },
###### 可以设置各种网络请求的超时时间
"networkTimeout": {
    "request": 15000,    请求超时时间
    "downloadFile": 15000  下载超时时间
  },
###### 发者工具中开启 debug 模式
"debug": true
app.js
App({
  onLaunch: function () {
    

  },

  /*********** 全局data **************/
  globalData: {
    ClientId: 'https7e6d0aa52ced8c2f6150c259ada51401',
    ClientSecret: '710ae677b55612f545557dd43bac0ed9',
  },

  /*********** 自定义data **************/
  myData: {
    userName: "longma"
  },
})
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容