项目目录

hybrid有一般用来存放app项目的html文件
platforms用来存放各个平台需要用到的页面
page项目所有的页面都会放到page中
App.vue存放全局的样式,对全局的监听(检测更新,网络更新,初始化数据)等
manifest.json
pages.json
image.png

  1. {
  2. "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
  3. //想要那个页面在项目启动时就显示,就配置那个页面的地址
  4. {
  5. "path": "pages/index/index",
  6. "style": {
  7. //配置首页标题
  8. "navigationBarTitleText": "uni-app",
  9. "app-plus": {
  10. // 配置导航栏
  11. "titleNView": {
  12. // 导航栏搜索框
  13. "searchInput": {
  14. "align":"center",
  15. "backgroundColor":"#F5F4F2",
  16. "borderRadius":"4px",
  17. "disabled":true,
  18. "placeholder":"搜索帖子",
  19. "placeholderColor":"#6D6C67"
  20. },
  21. "buttons":[{
  22. "color":"#333333",
  23. "colorPressed":"#FD597C",
  24. "float":"right",
  25. "fontSize":"20px",
  26. "fontSrc":"/static/iconfont.ttf",
  27. //这里不能直接使用unicode 字符表示必须 '\u' 开头,如 "\ue123"(注意不能写成"\e123")
  28. "text":"\ue668"
  29. }]
  30. }
  31. }
  32. }
  33. }
  34. ],
  35. //全局的配置
  36. "globalStyle": {
  37. "navigationBarTextStyle": "black",
  38. //配置全局标题,如果单个页面也配置了对应的标题则,用该页面配置的标题
  39. "navigationBarTitleText": "uni-app",
  40. //导航(状态栏)背景颜色
  41. "navigationBarBackgroundColor": "#F8F8F8",
  42. "backgroundColor": "#F8F8F8"
  43. }
  44. }

image.pngimage.png

配置渐变式导航栏

  1. {
  2. "path" : "pages/topic-detail/topic-detail",
  3. "style" :
  4. {
  5. "app-plus": {
  6. "titleNView": {
  7. "type": "transparent",
  8. "buttons": [
  9. {
  10. // 配置右侧三个点菜单
  11. "type": "menu"
  12. }
  13. ]
  14. }
  15. }
  16. }
  17. }

页面的下拉刷新

“enablePullDownRefresh”: true

  1. {
  2. "path" : "pages/msg/msg",
  3. "style" :
  4. {
  5. "navigationBarTitleText": "消息列表",
  6. //设置页面的下拉刷新
  7. "enablePullDownRefresh": true
  8. "app-plus": {
  9. "titleNView": {
  10. "buttons": [
  11. {
  12. "color":"#333333",
  13. "colorPressed":"#FD597C",
  14. "float":"left",
  15. "fontSize":"20px",
  16. "fontSrc":"/static/iconfont.ttf",
  17. "text":"\ue611"
  18. },
  19. {
  20. "color":"#333333",
  21. "colorPressed":"#FD597C",
  22. "float":"right",
  23. "fontSize":"20px",
  24. "fontSrc":"/static/iconfont.ttf",
  25. "text":"\ue649"
  26. }
  27. ]
  28. }
  29. }
  30. }
  31. }