Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hss01248/wxapp-devFrame
小程序基本的开发框架抽取
https://github.com/hss01248/wxapp-devFrame
Last synced: 3 months ago
JSON representation
小程序基本的开发框架抽取
- Host: GitHub
- URL: https://github.com/hss01248/wxapp-devFrame
- Owner: hss01248
- License: apache-2.0
- Created: 2016-11-08T03:36:09.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2016-11-09T08:58:46.000Z (almost 8 years ago)
- Last Synced: 2024-07-17T06:44:21.708Z (4 months ago)
- Language: JavaScript
- Size: 509 KB
- Stars: 158
- Watchers: 10
- Forks: 38
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-github-wechat-app - wxapp-devFrame - 小程序基本的开发框架 (开发框架)
- awesome-github-wechat-weapp - wxapp-devFrame - 小程序基本的开发框架 (开发框架)
README
# wxapp-devFrame
小程序基本的开发框架# 提供的封装
## 网络访问的二次封装
内部部分字段需要根据自己具体项目进行修改
netUtil.buildRequest(page,urlTail,params,callback)//必须的参数和回调
.setXxx(xxx)//额外的设置,链式调用
...
.send();//最终发出请求的动作
## 页面状态管理loading页面,空白页面,错误页面
```
//wxml里引用模板:直接拷贝这段代码
//js里,page的data中加字段:
netStateBean: new netUtil.netStateBean()
//网络回调处控制显示:netUtil
showLoadingDialog(that)
showContent(that)
showErrorPage(that,msg)
showEmptyPage(that)
```# 下拉刷新和上拉加载更多的ui和api
# 纯listview和gridview页面的高度封装
>只需要配置页面url,请求参数,返回的数据每个item字段的处理,wxml里写item的布局即可.无需关心页面状态,刷新和加载更多的ui和数据拼接.
![index](index.jpg)
![gridview](gridview.jpg)
![lv](lv.jpg)
# blog
[程序基本开发框架的搭建](http://www.jianshu.com/p/d7e574e78bea )