Giter Club home page Giter Club logo

wxapp-devframe's Introduction

wxapp-devFrame

小程序基本的开发框架

提供的封装

网络访问的二次封装

内部部分字段需要根据自己具体项目进行修改

netUtil.buildRequest(page,urlTail,params,callback)//必须的参数和回调
.setXxx(xxx)//额外的设置,链式调用
...
.send();//最终发出请求的动作

页面状态管理

loading页面,空白页面,错误页面

		//wxml里引用模板:直接拷贝这段代码
		<!--状态管理模板-->
        <import src="../../template/pagestate.wxml"/>
        <view >
            <template is="pagestate" data="{{...netStateBean}}"/>
        </view>
		
		
		//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

gridview

lv

blog

程序基本开发框架的搭建

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.