diff --git a/api/user.js b/api/user.js index 7bcb0ca..3527554 100644 --- a/api/user.js +++ b/api/user.js @@ -20,6 +20,8 @@ const modifyMobile = (params) => mPost(`/uec/user/modify/mobile`, params, config const getUserInfo = (params) => mGet('/uec/get/user-info', params, config) const updateUserInfo = (params) => mPost('/uec/user/update/user-info', params, config) const verifyCode = (code, params) => mGet(`/uec/verify/qrcode${code}`, params, config) +const bindingAdmin = (params) => mPost(`/uec/bind/primary-account`, params, config) +const bindingAccount = (params) => mPost(`/uec/apply/to/be/emplyee/of/enterprise`, params, config) // **************************************************************************************************************************************** // /authorize/by-wechat-applet小程序登录 @@ -187,5 +189,7 @@ export { loginWechat, setPassword, modifyMobile, - verifyCode + verifyCode, + bindingAdmin, + bindingAccount } \ No newline at end of file diff --git a/pages/login/index.js b/pages/login/index.js index cbc993b..aae0c75 100644 --- a/pages/login/index.js +++ b/pages/login/index.js @@ -1,6 +1,6 @@ //获取应用实例 import Dialog from '../../components/dialog/dialog' -import { config, wechatApplet, loginWechat, postCaptcha, loginCaptcha, loginPwd, verifyCode } from "../../api/user" +import { config, wechatApplet, loginWechat, postCaptcha, loginCaptcha, loginPwd, verifyCode, bindingAdmin, bindingAccount } from "../../api/user" import { sconfig, loginToken, getBaseInfo } from "../../api/saas" const util = require('../../utils/util') const storage = require('../../utils/storage') @@ -108,7 +108,7 @@ Page({ } } else if(this.data.metaData){ // 这里要进行账号的绑定,对工厂进行绑定;或者进行申请操作; - this.handMetaData() + this.setData({metaData: this.data.metaData }) } else { wx.hideLoading() this.setData({ loging: false}) @@ -174,6 +174,8 @@ Page({ if ((/^1\d{10}$/.test(e.detail.value)) && e.detail.value.length == 11) { this.setData({ mobileEnable: true }) } + } else if ('userName' == e.target.id) { + this.setData({ ['form.userName']: e.detail.value }) } if ((/^1\d{10}$/.test(this.data.form.account)) && this.data.form.account.length == 11) { if (this.data.type == 1 && !util.isEmpty(this.data.form.captcha)) { @@ -281,7 +283,7 @@ Page({ this.setData({ loging: false}) }) }, - handMetaData: function(){ + submitForm: function(){ if(this.data.metaData.qrPage == '/page/index/yaoqing'){ bindingAdmin(this.data.metaData).then(result => { wx.hideLoading() diff --git a/pages/login/index.wxml b/pages/login/index.wxml index 296e9f6..c6c6757 100644 --- a/pages/login/index.wxml +++ b/pages/login/index.wxml @@ -3,7 +3,18 @@ - + + 欢迎您使用千鸟跟单王! + + 现邀请您成为{{metaData.name}}的管理员 + + + 现邀请您成为{{metaData.name}}的员工 + + + + 手机号码 @@ -39,8 +50,10 @@ + 提交 提交 + bind:click="registAccount" wx:elif="{{ regist }}">登录 同意