|
|
@@ -1,11 +1,12 @@
|
|
|
-let loginMsg = require("./login"),
|
|
|
- md5 = require("../../../utils/md5"),
|
|
|
- _Http = getApp().globalData.http,
|
|
|
- deleteMark = require("../../../utils/deleteMark"),
|
|
|
- downCount = null;
|
|
|
+let downCount = null;
|
|
|
|
|
|
Component({
|
|
|
- properties: {},
|
|
|
+ properties: {
|
|
|
+ language: {
|
|
|
+ type: Object,
|
|
|
+ value: {}
|
|
|
+ }
|
|
|
+ },
|
|
|
options: {
|
|
|
addGlobalClass: true
|
|
|
},
|
|
|
@@ -30,8 +31,8 @@ Component({
|
|
|
/* 获取验证码 */
|
|
|
getPassword() {
|
|
|
if (this.data.showText != "获取验证码") return;
|
|
|
- if (!deleteMark.CheckPhoneNumber(this.data.phonenumber)) return;
|
|
|
- _Http.getpassword({
|
|
|
+ if (!require("../../../utils/deleteMark").CheckPhoneNumber(this.data.phonenumber)) return;
|
|
|
+ getApp().globalData.http.getpassword({
|
|
|
"phonenumber": this.data.phonenumber,
|
|
|
"systemclient": "wechatsaletool"
|
|
|
}).then(res => {
|
|
|
@@ -48,6 +49,7 @@ Component({
|
|
|
let showText = this.data.showText;
|
|
|
if (showText == 0) {
|
|
|
clearInterval(downCount)
|
|
|
+ downCount = null;
|
|
|
showText = '获取验证码'
|
|
|
} else {
|
|
|
showText--
|
|
|
@@ -68,18 +70,16 @@ Component({
|
|
|
/* 验证是否允许登录 */
|
|
|
allowOrNot() {
|
|
|
getCurrentPages().forEach(v => {
|
|
|
- if (['pages/login/phone'].includes(v.__route__)) {
|
|
|
- v.setData({
|
|
|
- disabled: this.data.phonenumber.length == 0 || this.data.password.length == 0
|
|
|
- })
|
|
|
- }
|
|
|
+ if (['pages/login/phone'].includes(v.__route__)) v.setData({
|
|
|
+ disabled: this.data.phonenumber.length == 0 || this.data.password.length == 0
|
|
|
+ })
|
|
|
})
|
|
|
},
|
|
|
/* 处理登录 */
|
|
|
handleLogin() {
|
|
|
- _Http.plogin({
|
|
|
+ getApp().globalData.http.plogin({
|
|
|
"phonenumber": this.data.phonenumber,
|
|
|
- "password": md5.hexMD5(this.data.password),
|
|
|
+ "password": require("../../../utils/md5").hexMD5(this.data.password),
|
|
|
"systemclient": "wechatsaletool"
|
|
|
}).then(res => {
|
|
|
getCurrentPages()[0].setData({
|
|
|
@@ -92,8 +92,7 @@ Component({
|
|
|
wx.setStorageSync('loginMsg', {
|
|
|
phonenumber: (this.data.memory) ? this.data.phonenumber : ''
|
|
|
})
|
|
|
- loginMsg.loginMsg(res);
|
|
|
- console.log('是否为初始密码', res.remindchangepassword == 1)
|
|
|
+ require("./login").loginMsg(res);
|
|
|
getApp().globalData.remindchangepassword = res.remindchangepassword == 1;
|
|
|
})
|
|
|
},
|