提交 2f8fd703 authored 作者: GOD_ZYX's avatar GOD_ZYX

Merge remote-tracking branch 'origin/master' into enterprise

# Conflicts: # learnOnline/pages/index/index.wxml
...@@ -13,3 +13,10 @@ ...@@ -13,3 +13,10 @@
* 打开小程序 “微信开发者工具” 预览、调试、发布、上传都可以。 * 打开小程序 “微信开发者工具” 预览、调试、发布、上传都可以。
- `微信开发者工具`<a href="https://developers.weixin.qq.com/miniprogram/dev/devtools/download.html" target="_blank">下载地址</a> - `微信开发者工具`<a href="https://developers.weixin.qq.com/miniprogram/dev/devtools/download.html" target="_blank">下载地址</a>
- `微信开发者工具`<a href="https://developers.weixin.qq.com/miniprogram/dev/devtools/devtools.html?t=18090718" target="_blank">使用说明地址</a> - `微信开发者工具`<a href="https://developers.weixin.qq.com/miniprogram/dev/devtools/devtools.html?t=18090718" target="_blank">使用说明地址</a>
## 小程序审核
``` python
本系统是 内部付费人员使用,需要绑定手机号(你们肯定不愿意提供手机号)。但为了 照顾你们 测试人员,所以在 登录下方已经增加 “游客登录”入口,你测试 为啥不试试就给我拒绝了?
再次重申,我已经增加 “游客登录”入口,就是方便 你们测试人员测试使用。你为啥不用呢? 我已经申请过多次,多次出现这种情况,你们测试人员之间没有沟通吗?
麻烦以后你们测试之间 多沟通一下,不要再让我天天加备注解释,好吗?
```
\ No newline at end of file
const util = require('../../../utils/util.js')
/* 手机 验证码 相关内容 */
const BindAccount = {
/* 跳转 手机登录 */
phoneLogin: function () { this.setData({ 'bindaccount.isShow': "" }); this.setData({ 'bindphone.isShow': "on" }); },
/* 账号输入 离开 input blur事件监听 */
inputAccount: function (e) { this.setData({ 'bindaccount.account': e.detail.value }); },
/* 密码输入 离开 input blur事件监听 */
inputPwd: function (e) { this.setData({ 'bindaccount.pwd': e.detail.value }); },
/* 点击确定 */
accountConfirm: function (e) {
const _that = this, _bind = _that.data.bindaccount
/* 调用接口 - 使用账号登录 */
wx.request({
url: util.config.URL_PATH + '/tenant/user/account-login',
data: { username: _bind.account, password: _bind.pwd }, method: 'POST', header: { skey: wx.getStorageSync('userSession').sessionKey, tenant: 'sofia' },
success: function (res) {
if (res.statusCode && res.statusCode != 200) { wx.showToast({ title: res.data.message, icon: 'none' }); return; }
wx.hideToast()
/* 获取用户信息 */
wx.request({
url: util.config.URL_PATH + '/tenant/user/getinfo',
data: {}, method: 'GET', header: {
skey: wx.getStorageSync('userSession').sessionKey,
tenant: 'sofia'
},
success: res => {
if (res.statusCode != 200) { wx.showToast({ title: res.data.message, icon: 'none' }); return; }
let _userInfo = {
avatarUrl: res.data.avatar || _that.tempUserInfo.avatarUrl || '无',
nickName: res.data.nickname || _that.tempUserInfo.nickName || '无'
}
wx.setStorageSync('userInfo', _userInfo);
_that.setData({ userInfo: _userInfo, hasUserInfo: true })
_that.popupClose()
_that.goOutSite()
}
})
},
fail: function (res) { wx.hideToast(); wx.showToast({ title: res, icon: 'none' }); }
})
}
}
module.exports = {
BindAccount: BindAccount,
}
\ No newline at end of file
<template name="bindAccount">
<view wx:if="{{bindaccount.isShow}}" class="bind-account {{bindaccount.isShow}}">
<view class="box">
<view class="hdr">
<text>绑定账号</text>
<image src="./icons/user-close.png" bindtap="popupClose"></image>
</view>
<input maxlength="30" type="text" class="input-account" placeholder="输入账号" bindinput="inputAccount" bindblur="inputAccount" value="{{bindaccount.account}}" />
<input maxlength="30" type="text" password="true" class="input-pwd" placeholder="输入密码" bindinput="inputPwd" bindblur="inputPwd" value="{{bindaccount.pwd}}" />
<view class="confirm" bindtap="accountConfirm">确定</view>
<view class="other-login" bindtap="phoneLogin">手机号登录</view>
</view>
</view>
</template>
\ No newline at end of file
.bind-account { opacity: 0; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: -1; background: rgba(0, 0, 0, 0.6); }
.bind-account.on { opacity: 1; z-index: 999; }
.bind-account .box { position: absolute; left: 50%; top: 50%; padding: 40rpx; width: 630rpx; background: #fafafc; border-radius: 10rpx; font-size: 28rpx; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); }
.bind-account .box .hdr { display: block; width: 100%; height: 46rpx; overflow: hidden; margin-bottom: 40rpx; -webkit-box-sizing: border-box; box-sizing: border-box; }
.bind-account .box .hdr image { float: right; width: 46rpx; height: 46rpx; }
.bind-account .box .input-account { display: block; width: 100%; height: 90rpx; border: 1rpx solid #eee; border-radius: 10rpx; padding: 0 20rpx; -webkit-box-sizing: border-box; box-sizing: border-box; }
.bind-account .box .input-pwd { display: block; width: 100%; height: 90rpx; margin: 20rpx 0 40rpx 0; border: 1rpx solid #eee; border-radius: 10rpx; padding: 0 20rpx; -webkit-box-sizing: border-box; box-sizing: border-box; }
.bind-account .box .confirm { height: 90rpx; width: 100%; background: #4b0; color: #fff; line-height: 90rpx; text-align: center; border-radius: 10rpx; }
.bind-account .box .other-login { margin-top: 40rpx; line-height: 60rpx; text-align: center; color: #576b95; }
\ No newline at end of file
...@@ -9,7 +9,12 @@ const BindPhone = { ...@@ -9,7 +9,12 @@ const BindPhone = {
clearInterval(this.timer); // 关闭定时器 clearInterval(this.timer); // 关闭定时器
let bindphone = { isShow: '', getCode: true, countDown: 60, phone: '', code: '' } let bindphone = { isShow: '', getCode: true, countDown: 60, phone: '', code: '' }
this.setData({ 'bindphone': bindphone }) this.setData({ 'bindphone': bindphone })
/* 账号弹框关闭,也用这个方法 */
let bindaccount = { isShow: '', account: '', pwd: '' }
this.setData({ 'bindaccount': bindaccount })
}, },
/* 跳转 账号登录 */
accountLogin: function () { this.setData({ 'bindphone.isShow': "off" }); this.setData({ 'bindaccount.isShow': "on" }); },
/* 电话输入 离开 input blur事件监听 */ /* 电话输入 离开 input blur事件监听 */
inputPhone: function (e) { this.setData({ 'bindphone.phone': e.detail.value }); }, inputPhone: function (e) { this.setData({ 'bindphone.phone': e.detail.value }); },
/* 验证码输入 离开 input blur事件监听 */ /* 验证码输入 离开 input blur事件监听 */
......
...@@ -5,13 +5,14 @@ ...@@ -5,13 +5,14 @@
<text>绑定手机号</text> <text>绑定手机号</text>
<image src="./icons/user-close.png" bindtap="popupClose"></image> <image src="./icons/user-close.png" bindtap="popupClose"></image>
</view> </view>
<input maxlength="11" type='number' class="input-phone" placeholder="输入手机号" bindinput="inputPhone" bindblur="inputPhone" value="{{bindphone.phone}}" /> <input maxlength="11" type="number" class="input-phone" placeholder="输入手机号" bindinput="inputPhone" bindblur="inputPhone" value="{{bindphone.phone}}" />
<view class="box-verify"> <view class="box-verify">
<input maxlength="6" type='number' class="code" placeholder="输入验证码" bindinput="inputCode" bindblur="inputCode" value="{{bindphone.code}}" /> <input maxlength="6" type="number" class="code" placeholder="输入验证码" bindinput="inputCode" bindblur="inputCode" value="{{bindphone.code}}" />
<view wx:if="{{bindphone.getCode}}" class="button" bindtap="getCode">获取验证码</view> <view wx:if="{{bindphone.getCode}}" class="button" bindtap="getCode">获取验证码</view>
<view wx:else class="countdown">已发送({{bindphone.countDown}}s)</view> <view wx:else class="countdown">已发送({{bindphone.countDown}}s)</view>
</view> </view>
<view class="confirm" bindtap="codeConfirm">确定</view> <view class="confirm" bindtap="codeConfirm">确定</view>
<view class="other-login" bindtap="accountLogin">账号登录</view>
</view> </view>
</view> </view>
</template> </template>
\ No newline at end of file
.bind-phone { opacity: 0; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: -1; background: rgba(0, 0, 0, 0.6); } .bind-phone { opacity: 0; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: -1; background: rgba(0, 0, 0, 0.6); }
.bind-phone.on { opacity: 1; z-index: 999; } .bind-phone.on { opacity: 1; z-index: 999; }
.bind-phone .box { position: absolute; left: 50%; top: 50%; padding: 40rpx; width: 630rpx; height: 450rpx; background: #fafafc; border-radius: 10rpx; font-size: 28rpx; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); } .bind-phone .box { position: absolute; left: 50%; top: 50%; padding: 40rpx; width: 630rpx; background: #fafafc; border-radius: 10rpx; font-size: 28rpx; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); }
.bind-phone .box .hdr { display: block; width: 100%; height: 46rpx; overflow: hidden; margin-bottom: 40rpx; -webkit-box-sizing: border-box; box-sizing: border-box; } .bind-phone .box .hdr { display: block; width: 100%; height: 46rpx; overflow: hidden; margin-bottom: 40rpx; -webkit-box-sizing: border-box; box-sizing: border-box; }
.bind-phone .box .hdr image { float: right; width: 46rpx; height: 46rpx; } .bind-phone .box .hdr image { float: right; width: 46rpx; height: 46rpx; }
.bind-phone .box .input-phone { display: block; width: 100%; height: 90rpx; border: 1rpx solid #eee; border-radius: 10rpx; padding: 0 20rpx; -webkit-box-sizing: border-box; box-sizing: border-box; } .bind-phone .box .input-phone { display: block; width: 100%; height: 90rpx; border: 1rpx solid #eee; border-radius: 10rpx; padding: 0 20rpx; -webkit-box-sizing: border-box; box-sizing: border-box; }
...@@ -10,4 +10,5 @@ ...@@ -10,4 +10,5 @@
.bind-phone .box .box-verify .button { float: right; width: 220rpx; height: 90rpx; line-height: 90rpx; text-align: center; border: 1rpx solid #4b0; color: #4b0; border-radius: 10rpx; -webkit-box-sizing: border-box; box-sizing: border-box; } .bind-phone .box .box-verify .button { float: right; width: 220rpx; height: 90rpx; line-height: 90rpx; text-align: center; border: 1rpx solid #4b0; color: #4b0; border-radius: 10rpx; -webkit-box-sizing: border-box; box-sizing: border-box; }
.bind-phone .box .box-verify .countdown { float: right; width: 220rpx; height: 90rpx; line-height: 90rpx; text-align: center; background: #ccc; color: #fff; border-radius: 10rpx; -webkit-box-sizing: border-box; box-sizing: border-box; } .bind-phone .box .box-verify .countdown { float: right; width: 220rpx; height: 90rpx; line-height: 90rpx; text-align: center; background: #ccc; color: #fff; border-radius: 10rpx; -webkit-box-sizing: border-box; box-sizing: border-box; }
.bind-phone .box .confirm { height: 90rpx; width: 100%; background: #4b0; color: #fff; line-height: 90rpx; text-align: center; border-radius: 10rpx; } .bind-phone .box .confirm { height: 90rpx; width: 100%; background: #4b0; color: #fff; line-height: 90rpx; text-align: center; border-radius: 10rpx; }
\ No newline at end of file .bind-phone .box .other-login { margin-top: 40rpx; line-height: 60rpx; text-align: center; color: #576b95; }
\ No newline at end of file
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
const app = getApp() const app = getApp()
const util = require('../../utils/util.js') const util = require('../../utils/util.js')
const BindPhone = require('./bindPhone/bindPhone.js') const BindPhone = require('./bindPhone/bindPhone.js')
const BindAccount = require('./bindAccount/bindAccount.js')
Page({ Page({
data: { data: {
...@@ -11,7 +12,9 @@ Page({ ...@@ -11,7 +12,9 @@ Page({
hasUserInfo: false, hasUserInfo: false,
canIUse: wx.canIUse('button.open-type.getUserInfo'), canIUse: wx.canIUse('button.open-type.getUserInfo'),
// 绑定手机号 相关 // 绑定手机号 相关
bindphone: { isShow: '', getCode: true, countDown: 60, phone: '', code: '' } bindphone: { isShow: '', getCode: true, countDown: 60, phone: '', code: '' },
// 绑定账号 相关
bindaccount: { isShow: '', account: '', pwd: '' }
}, },
goOutSite: function () { goOutSite: function () {
// wx.navigateTo({ // wx.navigateTo({
...@@ -71,11 +74,17 @@ Page({ ...@@ -71,11 +74,17 @@ Page({
}); });
}, },
/* 手机号绑定 方法 */ /* 手机号绑定 方法 */
accountLogin: BindPhone.BindPhone.accountLogin,
timer: BindPhone.BindPhone.timer, timer: BindPhone.BindPhone.timer,
popupShow: BindPhone.BindPhone.popupShow, popupShow: BindPhone.BindPhone.popupShow,
popupClose: BindPhone.BindPhone.popupClose, popupClose: BindPhone.BindPhone.popupClose,
inputPhone: BindPhone.BindPhone.inputPhone, inputPhone: BindPhone.BindPhone.inputPhone,
inputCode: BindPhone.BindPhone.inputCode, inputCode: BindPhone.BindPhone.inputCode,
getCode: BindPhone.BindPhone.getCode, getCode: BindPhone.BindPhone.getCode,
codeConfirm: BindPhone.BindPhone.codeConfirm codeConfirm: BindPhone.BindPhone.codeConfirm,
/* 账号绑定 方法 */
phoneLogin: BindAccount.BindAccount.phoneLogin,
inputAccount: BindAccount.BindAccount.inputAccount,
inputPwd: BindAccount.BindAccount.inputPwd,
accountConfirm: BindAccount.BindAccount.accountConfirm
}) })
<!--index.wxml--> <!--index.wxml-->
<import src='bindPhone/bindPhone.wxml' /> <import src='bindPhone/bindPhone.wxml' />
<import src='bindAccount/bindAccount.wxml' />
<view class='container'> <view class='container'>
<image class='bg' src='./icons/bg.png' mode='aspectFill'></image> <image class='bg' src='./icons/bg.png' mode='aspectFill'></image>
<image class='logo' src='./icons/hd-logo.png' mode='aspectFit'></image> <image class='logo' src='./icons/hd-logo.png' mode='aspectFit'></image>
<view class='text'>清控紫荆课堂</view> <view class='text'>清控紫荆课堂</view>
<button class='btn' open-type='getUserInfo' bindgetuserinfo='getUserInfo'>登录</button> <button class='btn' open-type='getUserInfo' bindgetuserinfo='getUserInfo'>登录</button>
<!-- <view class='test-id' bindtap='guestLogin'>游客登录</view> --> <!-- <view class='test-id' bindtap='guestLogin'>游客登录</view> -->
<view class='userinfo'> <view class='userinfo'>
<!-- wx:if='{{!hasUserInfo && canIUse}}' --> <!-- wx:if='{{!hasUserInfo && canIUse}}' -->
<!-- <block wx:else> <!-- <block wx:else>
...@@ -15,4 +16,5 @@ ...@@ -15,4 +16,5 @@
</block> --> </block> -->
</view> </view>
<template is='bindPhone' data='{{bindphone}}'></template> <template is='bindPhone' data='{{bindphone}}'></template>
<template is='bindAccount' data='{{bindaccount}}'></template>
</view> </view>
\ No newline at end of file
/**index.wxss**/ /**index.wxss**/
@import "bindPhone/bindPhone.wxss"; @import "bindPhone/bindPhone.wxss";
@import "bindAccount/bindAccount.wxss";
.container { position: fixed; top: 0; left: 0; bottom: 0; right: 0; background: #e5e5e5; } .container { position: fixed; top: 0; left: 0; bottom: 0; right: 0; background: #e5e5e5; }
.container .bg { position: absolute; z-index: 0; top: 0; left: 0; width: 100%; height: 100%; } .container .bg { position: absolute; z-index: 0; top: 0; left: 0; width: 100%; height: 100%; }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论