diff --git a/common/js/config.js b/common/js/config.js
index b59aae9..be66c07 100644
--- a/common/js/config.js
+++ b/common/js/config.js
@@ -1,14 +1,14 @@
var config = {
// api请求地址
- baseUrl: 'https://zyhj.zoomtk.com/',
+ baseUrl: 'https://miaogou.cdlfjy.com/',
// 图片域名
- imgDomain: 'https://zyhj.zoomtk.com/',
+ imgDomain: 'https://miaogou.cdlfjy.com/',
// H5端域名
- h5Domain: 'https://zyhj.zoomtk.com/',
+ h5Domain: 'https://miaogou.cdlfjy.com/',
// 腾讯地图key
mpKey: '',
//客服地址
- webSocket : 'https://zyhj.zoomtk.com/',
+ webSocket : 'https://miaogou.cdlfjy.com/',
//本地端主动给服务器ping的时间, 0 则不开启 , 单位秒
pingInterval: 1500
};
diff --git a/components/ns-login/ns-login.vue b/components/ns-login/ns-login.vue
index e8e9947..7c291cd 100644
--- a/components/ns-login/ns-login.vue
+++ b/components/ns-login/ns-login.vue
@@ -1,8 +1,105 @@
+
+
+
+
+
+
+
+
+
@@ -119,11 +219,17 @@ export default {
authMobileData: {
iv: '',
encryptedData: ''
- }
+ },
+ // 承诺登录相关内容
+ promise_text: '',// 用户输入的承诺书
+ request_type: 'login',// 请求场景 register=注册 login=登录
+ popup_show: false,
+ is_checked: false,
};
},
options: { styleIsolation: 'shared' },
created() {
+ // 其他登录方式
this.getRegisterConfig();
// #ifdef H5
if (!uni.getStorageSync('token')) this.getCaptchaConfig();
@@ -182,6 +288,13 @@ export default {
});
},
open(url) {
+ // 判断:如果登录框未弹出 则弹出登录框
+ if(!this.popup_show){
+ this.$refs.completeInfoPopup.open();
+ return false;
+ }
+
+
if (url) this.url = url;
// #ifdef MP-WEIXIN
this.getCode((authData) => {
@@ -209,8 +322,14 @@ export default {
else this.$util.redirectTo('/pages_tool/login/login');
},
cancelCompleteInfo() {
- if (this.$refs.completeInfoPopup) this.$refs.completeInfoPopup.close();
- this.$store.commit('setBottomNavHidden', false); // 显示底部导航
+ // #ifdef MP-WEIXIN
+ this.$refs.subCompleteInfoPopup.close()
+ // #endif
+
+ // #ifndef MP-WEIXIN
+ if (this.$refs.completeInfoPopup) this.$refs.completeInfoPopup.close();
+ this.$store.commit('setBottomNavHidden', false); // 显示底部导航
+ // #endif
},
blurNickName(e) {
if (e.detail.value) this.nickName = e.detail.value;
@@ -483,10 +602,19 @@ export default {
key: 'authInfo',
data: data
});
- if (uni.getStorageSync('source_member')) data.source_member = uni.getStorageSync('source_member');
-
+ if (uni.getStorageSync('source_member')) data.source_member = uni.getStorageSync('source_member');
+ //let url = type === 'authLogin' ? '/api/login/auth' : '/api/login/authonlylogin';
+ let url = '/api/login/auth';
+ // 获取登录接口
+ if(this.registerConfig.promise){
+ data.promise_text = this.promise_text;
+ data.is_promise = 1;
+ data.request_type = this.request_type;
+ url = '/api/login/auth';
+ }
+ // 请求登录
this.$api.sendRequest({
- url: type == 'authLogin' ? '/api/login/auth' : '/api/login/authonlylogin',
+ url: url,
data,
success: res => {
if (res.code >= 0) {
@@ -497,13 +625,18 @@ export default {
this.$store.dispatch('getCartNumber');
this.$store.commit('setToken', res.data.token);
if (res.data.is_register) this.$refs.registerReward.open();
+
+ // #ifdef MP-WEIXIN
+ this.$refs.completeInfoPopup.close()
+ // #endif
this.cancelCompleteInfo();
}
});
setTimeout(() => {
uni.hideLoading();
}, 1000);
- } else if (res.code == -10016) {
+ }
+ else if (res.code == -10016) {
let register_error = res.message;
this.$api.sendRequest({
url: '/api/register/config',
@@ -526,6 +659,10 @@ export default {
} else {
uni.hideLoading();
this.$util.showToast({ title: res.message });
+
+ // #ifdef MP-WEIXIN
+ this.cancelCompleteInfo()
+ // #endif
}
},
fail: () => {
@@ -553,18 +690,52 @@ export default {
});
return;
}
- let authData = uni.getStorageSync('authInfo');
- if (authData) Object.assign(authData, {nickName: this.nickName, avatarUrl: this.headImg});
+ let authData = uni.getStorageSync('authInfo');
+ if (authData) Object.assign(authData, {nickName: this.nickName, avatarUrl: this.headImg});
uni.setStorageSync('authInfo', authData);
if (this.forceBindingMobileControl) this.bindMobile();
else this.authLogin(authData);
- }
+ },
+ // 承诺书 登录
+ promiseLogin(){
+ this.request_type = 'login';
+ this.getCode((authData) => {
+ this.authLogin(authData);
+ })
+ },
+ // 弹框状态改变
+ popupChange(e){
+ this.popup_show = e.show;
+ },
+ // 承诺书 注册 - 显示弹框
+ promiseRegisterShow(){
+ this.request_type = 'register';
+ this.$refs.registerPopup.open()
+ },
+ // 承诺书 注册 - 申请注册
+ promiseRegister(){
+ // 判断:是否同意协议内容
+ if(!this.is_checked){
+ this.$util.showToast({ title: '请同意协议后进行后续操作!' });
+ return false;
+ }
+ // 开始注册
+ this.$refs.registerPopup.close()
+ this.$refs.subCompleteInfoPopup.open();
+ },
+ // 同意协议状态变更
+ checkboxChange(e){
+ let values = e.detail.value;
+ this.is_checked = values.includes('agree');
+ }
+
}
};