微信小程序登录注册页面_云开发_调用云数据库
源代码下载https://download.csdn.net/download/lujiebin/11241027
1.界面展示
2.代码
1.云开发初始化
app js
//app.js
App({
onLaunch: function() {
//云开发初始化
wx.cloud.init({
env: 'ljb-7tdjm',
traceUser: true
})
}
})
云开发初始化,env为自己的云端环境ID
2.register页面
wxml
<!--pages/register/register.wxml-->
<view>
<i-input bind:change='inputName' maxlength="15" title="账号"
autofocus placeholder="请输入账号" />
<i-input bind:change='inputPassword' type="password"
maxlength="15" title="密码" autofocus placeholder="请输入密码" />
<i-button bindtap='register' type="success">注册</i-button>
</view>
js
let app = getApp();
//获取云数据库引用
const db = wx.cloud.database();
const admin = db.collection('adminlist');