摘要: 本文记载了如何在微信小程序里面实现下拉刷新,上拉加载更多 先开看一下界面 大致如此的界面吧。 这个Demo使用了微信的几个Api和事件,我先列出来。 1.wx.request (获取远程服务器的数据,可以理解成$.ajax) 2. scroll-view的两个事件 2.1 bindscrolltol 阅读全文
posted @ 2016-10-28 11:02 梦断难寻 阅读(34022) 评论(8) 推荐(2) 编辑
摘要: 这一篇就废话少一点,直接上代码吧,三个接口都是微信提供的。 index.js index.wxml 最后效果图 好了。文本介绍了三个接口的使用方式,具体怎么发挥,大家自行判断吧。 源码奉上 http://pan.baidu.com/s/1gfLpuKj 阅读全文
posted @ 2016-10-27 17:29 梦断难寻 阅读(4599) 评论(2) 推荐(0) 编辑
摘要: 微信小程序创建之后会生成一个项目模板,如下图所示(基本如此,但并不局限于此) 现在分别来说明一下每个文件及目录的意思 app.js 程序的入口文件,必须存在。 app.js是小程序的脚本代码。我们可以在这个文件中监听并处理小程序的生命周期函数、声明全局变量。调用框架提供的丰富的 API,如本例的同步 阅读全文
posted @ 2016-10-27 17:18 梦断难寻 阅读(6496) 评论(0) 推荐(0) 编辑
摘要: 个人的每一篇博文都谈不上有什么技术含量,只是为了帮助不熟悉微信小程序开发的自己及他人提供一下思路。谢谢,下面开始! PS: 因为本人没有小程序的内测资格,所以所有的开发及Demo都是无AppId的,如果哪位同学可以分享AppId,那感激不尽! 第一步 (下载开发工具) https://mp.weix 阅读全文
posted @ 2016-10-27 17:03 梦断难寻 阅读(72279) 评论(4) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2013-12-02 21:16 梦断难寻 阅读(598) 评论(0) 推荐(0) 编辑
摘要: 程序运行效果 ... 阅读全文
posted @ 2013-11-27 23:22 梦断难寻 阅读(1665) 评论(0) 推荐(0) 编辑
摘要: 使用partial关键字可以声明部分类, 部分类的作用是可以在多个文件中声明同一个类, 主要用于类比较大的时候进行拆分,或者xaml中使用也比较多。在下面创建了3个.cs文件,分别是 Name.cs Age.cs Sex.cs三个文件中都是在声明同一个类 MyClass 。 看代码。Name.csusing System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace ConsoleApplication1{ partial.. 阅读全文
posted @ 2012-10-29 22:58 梦断难寻 阅读(9037) 评论(3) 推荐(2) 编辑
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace ConsoleApplication1{ //对象初始化器简介: 1. 对象初始化器可以在对象声明的时候为其里面的字段或者属性赋值。 但是,需要赋值的字段或者属性必须是public 或 internal修饰符修饰的。 //下面对对象初始化器的演示 //此处声明一个类 class MyClass { publi... 阅读全文
posted @ 2012-10-29 22:31 梦断难寻 阅读(667) 评论(0) 推荐(0) 编辑
摘要: ExtensionProcedure.csusing System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;//扩展方法的声明方式 : 修饰符 static 返回类型 方法名 (this 需要添加方法的类 参数名 , 参数列表)如下: public static void Extension (this String s , string value)namespace ConsoleApplica... 阅读全文
posted @ 2012-10-29 22:04 梦断难寻 阅读(395) 评论(0) 推荐(0) 编辑
摘要: StrucrTest.csusing System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication11{ struct MyStruct // struct定义结构体的关键字. { private string name; private int age; private bool marriage; public MyStruct(string n,int a , bool ... 阅读全文
posted @ 2012-10-25 23:23 梦断难寻 阅读(422) 评论(0) 推荐(0) 编辑