From fbdc88616e509706c1f8a4559a6ac2f1761c4174 Mon Sep 17 00:00:00 2001 From: wsq <2744814898@qq.com> Date: Wed, 16 Nov 2022 22:48:43 +0800 Subject: [PATCH] 123 --- pages/index/OneDrive - 快捷方式.lnk | Bin 0 -> 724 bytes pages/index/index.js | 180 ++++++++++++++++++++++++ pages/index/index.json | 5 + pages/index/index.wxml | 43 ++++++ pages/index/index.wxss | 1 + 5 files changed, 229 insertions(+) create mode 100644 pages/index/OneDrive - 快捷方式.lnk create mode 100644 pages/index/index.js create mode 100644 pages/index/index.json create mode 100644 pages/index/index.wxml create mode 100644 pages/index/index.wxss diff --git a/pages/index/OneDrive - 快捷方式.lnk b/pages/index/OneDrive - 快捷方式.lnk new file mode 100644 index 0000000000000000000000000000000000000000..27c4c0f2fa2cb7e22d9a696ddcaf548240def568 GIT binary patch literal 724 zcmeZaU|?VrVFHp2340b=Ze2p|mtDXGQTCHV!qDdt)EIjOk}KfYi4zj4!c zhXws_#E-4JGx_JuEf&?OZv|&Bim`J2Qd>z#z8L5iP6mbrzCg1Lg9C!!8tlF0%+Tq+ z{Kp01CBSsKvEN=3=BGeB*-v> zkE+|>yGscy{m7KiGw<~pRiHQ*NCn6+psft(z6HsN0x`%U1_u!Fa@`qF{K^8EEFeBe zCmRs|uDM^=p8CztG7_SL4 zK&FWSF}hb`px%tZ>O!C;Ks_K2ZWPOPS=(FSvE0K!Z;5S156GDrKnzY1mXA-B7Fuh$ QHN0MX!Z*$00!SPN0MzQZ_y7O^ literal 0 HcmV?d00001 diff --git a/pages/index/index.js b/pages/index/index.js new file mode 100644 index 0000000..978b606 --- /dev/null +++ b/pages/index/index.js @@ -0,0 +1,180 @@ +// pages/index/index.js +import Toast from './@vant/weapp/toast/toast'; +var app=getApp(); +Page({ + + /** + * 页面的初始数据 + */ + + + onload: function (){ + + }, + data: { + user:"",//输入账号 + pwd:"",//输入密码 + default_user:"user",//默认账号 + default_pwd:"123456",//默认密码 + }, + //登录按钮 + log_on() + { + console.log("账号",this.data.user,this.data.pwd); + if(this.data.user==this.data.default_user&& this.data.pwd==this.data.default_pwd) + { + wx.reLaunch({ + url: '/pages/navigation/index/index', + }) + }else{ + Toast.fail('账号或密码错误'); + } + }, + //忘记密码 + forget() + { + + }, + + + //获取用户名 + getName(user) { + console.log('获取输入的用户名', user.detail.value) + this.setData({ + name: user.detail.value + }) + }, + //获取用户账号 + getZhangHao(user) { + console.log('获取输入的账号', user.detail.value) + this.setData({ + zhanghao: user.detail.value + }) + }, + // 获取密码 + getMiMa(pwd) { + console.log('获取输入的密码', pwd.detail.value) + this.setData({ + mima: pwd.detail.value + }) + }, + + + //注册 + zhuce() { + let name = this.data.name + let zhanghao = this.data.zhanghao + let mima = this.data.mima + console.log("点击了注册") + console.log("name", name) + console.log("zhanghao", zhanghao) + console.log("mima", mima) + //校验用户名 + if (name.length < 2) { + wx.showToast({ + icon: 'none', + title: '用户名至少2位', + }) + return + } + if (name.length > 10) { + wx.showToast({ + icon: 'none', + title: '用户名最多10位', + }) + return + } + //校验账号 + if (zhanghao.length < 4) { + wx.showToast({ + icon: 'none', + title: '账号至少4位', + }) + return + } + //校验密码 + if (mima.length < 4) { + wx.showToast({ + icon: 'none', + title: '密码至少4位', + }) + return + } + //注册功能的实现 + wx.cloud.database().collection('user').add({ + data: { + user:"",//账号 + pwd:"",//密码 + }, + success(res) { + console.log('注册成功', res) + wx.showToast({ + title: '注册成功', + }) + wx.navigateTo({ + url: '../login/login', + }) + }, + fail(res) { + console.log('注册失败', res) + } + }) + }, + + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/index/index.json b/pages/index/index.json new file mode 100644 index 0000000..93d84fa --- /dev/null +++ b/pages/index/index.json @@ -0,0 +1,5 @@ +{ + "usingComponents": {}, + "navigationBarTitleText":"" + +} \ No newline at end of file diff --git a/pages/index/index.wxml b/pages/index/index.wxml new file mode 100644 index 0000000..692c691 --- /dev/null +++ b/pages/index/index.wxml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 登 录 + + + 忘记密码? + 注册 + + + + + + + diff --git a/pages/index/index.wxss b/pages/index/index.wxss new file mode 100644 index 0000000..8c9372d --- /dev/null +++ b/pages/index/index.wxss @@ -0,0 +1 @@ +/* pages/index/index.wxss */