微信小程序 实战项目:
简易新闻制作
先看下效果:
实现思路数据全部是采用的本地数据,图片也是本地图片,因为苦逼的个人开发者,无法认证;toolbar四个现象:新闻,笑话,历史上的今天和主页,集中主页采用的是默认的页面,添加自己的一些内容;数据绑定,列表渲染,条件渲染和事件的使用;使用一些基础的View和text,部分API的使用;
代码结构
代码内容,主要看下配置
app.json 配置项列表
{ "pages": [ "pages/news/news", "pages/joke/joke", "pages/history/history", "pages/index/index" ], "window": { "navigationBarBackgroundColor": "#f85959", "navigationBarTextStyle": "white", "navigationBarTitleText": "微 看", "backgroundColor": "#FFFFFF", "backgroundTextStyle": "dark", "enablePullDownRefresh": true }, "tabBar": { "color": "#626567", "selectedColor": "#f85959", "backgroundColor": "#FBFBFB", "borderStyle": "white", "position": "bottom", "list": [ { "pagePath": "pages/news/news", "text": "新闻", "iconPath": "images/discovery.png", "selectedIconPath": "images/discovery_focus.png" }, { "pagePath": "pages/joke/joke", "text": "笑话", "iconPath": "images/ring.png", "selectedIconPath": "images/ring_focus.png" }, { "pagePath": "pages/history/history", "text": "历史", "iconPath": "images/chat.png", "selectedIconPath": "images/chat_focus.png" }, { "pagePath": "pages/index/index", "text": "主页", "iconPath": "images/index.png", "selectedIconPath": "images/index_focus.png" } ] }, "networkTimeout": { "request": 10000, "downloadFile": 10000 }, "debug": true }
具体配置使用方法请参考官网:
https://mp.weixin.qq.com/debug/wxadoc/dev/framework/config.html?t=201715
感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
狼山资源网 Copyright www.pvsay.com
暂无“微信小程序 实战程序简易新闻的制作”评论...