|
@@ -1,6 +1,13 @@
|
|
|
-import {getDataSet, getEventParam, isMobile, toast} from "../../utils/utils";
|
|
|
+import {
|
|
|
+ getDataSet,
|
|
|
+ getEventParam,
|
|
|
+ isMobile,
|
|
|
+ toast
|
|
|
+} from "../../utils/utils";
|
|
|
import User from "../../model/user";
|
|
|
import Route from "../../model/route";
|
|
|
+import Api from "../../model/api";
|
|
|
+import {logicStatus} from '../../model/enum';
|
|
|
|
|
|
Page({
|
|
|
data: {
|
|
@@ -9,8 +16,10 @@ Page({
|
|
|
verify: '',
|
|
|
},
|
|
|
isShowBack: true,
|
|
|
+ showRegister: false
|
|
|
},
|
|
|
onLoad: function (options) {
|
|
|
+ this.getRegsiterDisplayStatus();
|
|
|
},
|
|
|
async login(e) {
|
|
|
if (!isMobile(this.data.formData.phone)) {
|
|
@@ -24,8 +33,10 @@ Page({
|
|
|
}
|
|
|
await User.loginByPhone(this.data.formData);
|
|
|
const eventChannel = this.getOpenerEventChannel()
|
|
|
- if (eventChannel.emit){
|
|
|
- eventChannel.emit('login', {isLogin: true});
|
|
|
+ if (eventChannel.emit) {
|
|
|
+ eventChannel.emit('login', {
|
|
|
+ isLogin: true
|
|
|
+ });
|
|
|
}
|
|
|
wx.navigateBack();
|
|
|
},
|
|
@@ -36,7 +47,9 @@ Page({
|
|
|
await User.loginByWechat();
|
|
|
const eventChannel = this.getOpenerEventChannel()
|
|
|
if (eventChannel.emit) {
|
|
|
- eventChannel.emit('login', {isLogin: true});
|
|
|
+ eventChannel.emit('login', {
|
|
|
+ isLogin: true
|
|
|
+ });
|
|
|
}
|
|
|
wx.navigateBack();
|
|
|
},
|
|
@@ -49,8 +62,22 @@ Page({
|
|
|
back() {
|
|
|
const eventChannel = this.getOpenerEventChannel()
|
|
|
if (eventChannel.emit) {
|
|
|
- eventChannel.emit('login', {isLogin: false});
|
|
|
+ eventChannel.emit('login', {
|
|
|
+ isLogin: false
|
|
|
+ });
|
|
|
}
|
|
|
wx.navigateBack();
|
|
|
+ },
|
|
|
+ async getRegsiterDisplayStatus() {
|
|
|
+ let {
|
|
|
+ data
|
|
|
+ } = await Api.getPulishDict('sys_register_status');
|
|
|
+ if (data && data.length > 0) {
|
|
|
+ let status = data[0]['dictValue'];
|
|
|
+ let showRegister = logicStatus.YES == status;
|
|
|
+ this.setData({
|
|
|
+ showRegister
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
-});
|
|
|
+});
|