文档地址
https://developers.weixin.qq.com/miniprogram/dev/demo.html?t=1477656485442
或者参考:
https://www.w3cschool.cn/weixinapp/weixinapp-qa.html
开发者工具
https://dldir1.qq.com/WechatWebDev/1.0.0/201808101/wechat_devtools_1.02.1808101_x64.exe
注册小程序
jixierxy520@126.com / raoxiaoya520
APPID:wx89137bb28d7cd3e6
APPSECRET:beb19f75c692e3fd46e716f75310c562
普通编译默认首页,因为开发者工具每次刷新(编译)都是先进入首页的,在开发时很不方便,选择添加编译模式可以设置默认打开其他页面,
可以直接在开发者工具中编辑,然后ctrl+s保存即可看效果。
Bindtap=”add”添加事件
1、API请求
调用服务端接口
调试本地接口是,设置不校验合法域名
wx.request()接口
2、基础库兼容
不同基础库的api会有所差异,使用前可以先判断一下
比如:
If( wx.setClipboardData ){
wx.setClipboardData({
data: 'data',
success: function(res) {
wx.getClipboardData({
success: function(res) {
console.log(res.data) // data
}
})
}
})
}else{
wx.showModal({
title: '提示',
content: '您的微信版本太低,请升级。',
})
}
或者
wx.canIUse( ‘setClipboardData’ )
3、不同页面传值
url传值
跳转到:
wx.navigateTo({
url: ‘/pages/details/detail?key=value’;
})
在detail页面的js中可以通过options变量来查看
onLoad: function(){
console.log(options);
}
全局变量传值:
app.js中
globalData: {
name: ‘King’
}
在页面的js中
app.globalData.name;
也可以修改
app.globalData.name = ‘Tom’;
缓存传值:10M
wx.setStorageSync('logs', ‘hahaha’);
获取
wx.getStorageSync('logs');
学习:
微信小程序从零开始开发步骤(一)搭建开发环境https://www.jianshu.com/p/0ff8c3b2f59f微信小程序从零开始开发步骤(二)创建小程序页面https://www.jianshu.com/p/fe0db14e2869微信小程序从零开始开发步骤(三)底部导航栏https://www.jianshu.com/p/89a63dc99839微信小程序从零开始开发步骤(四)自定义分享的功能https://www.jianshu.com/p/65d9bdb8051d微信小程序从零开始开发步骤(五)轮播图https://www.jianshu.com/p/bc3261557031微信小程序从零开始开发步骤(六)4种页面跳转的方法https://www.jianshu.com/p/01a5a6a0fdb9微信小程序从零开始开发步骤(七)引入外部js 文件https://www.jianshu.com/p/5f2cde64d7f2微信小程序从零开始开发步骤(八)引入框架WeUI:https://www.jianshu.com/p/fd423b6e17be
经典小程序源码及其下载地址
1:我要圣诞帽项目地址:https://github.com/jasscia/ChristmasHat项目下载:ChristmasHat-master.zip
2:微信小程序精品Demo:掌故
项目地址:https://github.com/Gesangs/PhoneStory项目下载:PhoneStory-master.zip
3:微信小程序Demo:简约睡眠Music
项目地址:https://github.com/shajinyang/BeautyAudio项目下载:BeautyAudio-master.zip
4:微信小程序Demo:运势小程序项目地址:https://github.com/panyefan/wxfortune项目下载:wxfortune-master.zip
5:微信小程序demo:仿微信朋友圈, 带前后台交互前台下载地址:微博友圈_POST.zip
6:微信小程序精品demo:跑马灯,左侧菜单,抽屉层,加载动画项目地址:https://github.com/youzouzou/wxapp项目下载:wxapp-master.zip
7:微信小程序学习用demo:订单管理,浮层菜单,页面设计
项目地址:https://github.com/GavinCarter1991/wx-onePro项目下载:wx-onePro-master.zip
8:小程序支付详解+源码(客户端+服务端)源码下载地址:小程序微信支付.zip
9:微信小程序demo:电商模板,购物车模板项目地址:https://github.com/fangliu520/wxbestcake项目下载:wxbestcake-master.zip
10:精品完整demo:摇一摇,二维码项目地址及下载:前端项目地址:https://github.com/7insummer/orange-can项目下载:orange-can-master.zip
后端项目地址:https://github.com/7insummer/orange-can-server项目下载:orange-can-server-master.zip
小程序项目实例大全
https://blog.csdn.net/jlsdzhj/article/details/80647682
如何在小程序里面放入企业官网
https://www.jianshu.com/p/d32efd69073f