Commit bf0c39da authored by 黄奎's avatar 黄奎

11

parent 091c9fa1
...@@ -34,40 +34,18 @@ ...@@ -34,40 +34,18 @@
showLogin: true, showLogin: true,
canIUseGetUserProfile: false, canIUseGetUserProfile: false,
msg: {}, msg: {},
isOpenAuth: 0, //是否开启强制授权
}; };
}, },
created() { created() {
// this.pageinfo = uni.getStorageSync("basedata") ? let mallConfig = uni.getStorageSync("basedata");
// uni.getStorageSync("basedata").auth_page : {}; if (mallConfig && mallConfig.mall && mallConfig.mall.setting && mallConfig.mall.setting.is_show_auth) {
// if (wx.getUserProfile) { this.isOpenAuth = mallConfig.mall.setting.is_show_auth;
// this.canIUseGetUserProfile = true; }
// }
// // #ifdef MP-ALIPAY
// this.canIUseGetUserProfile = true;
// // #endif
// let x = this.pageinfo.hotspot;
// let y = this.pageinfo.hotspot_cancel;
// this.sureStyle = `height:${x.height}rpx;width:${x.width}rpx;left:${x.left}rpx;top:${x.top}rpx;`;
// this.cancelStyle = `height:${y.height}rpx;width:${y.width}rpx;left:${y.left}rpx;top:${y.top}rpx;`;
this.getUserInfo() this.getUserInfo()
}, },
methods: { methods: {
getoldUser() { getoldUser() {
//旧的 兼容电脑端
//4.27注释掉 给予新的提示不能在电脑端登录
// var that = this;
// uni.login({
// provider: 'weixin',
// success: function (loginRes) {
// // 获取用户信息
// uni.getUserInfo({
// provider: 'weixin',
// success: function (infoRes) {
// that.getUserInfo(infoRes)
// }
// });
// }
// });
uni.showToast({ uni.showToast({
title: "电脑端暂时不能获取用户信息,请转到手机端使用!", title: "电脑端暂时不能获取用户信息,请转到手机端使用!",
icon: "none", icon: "none",
...@@ -114,47 +92,13 @@ ...@@ -114,47 +92,13 @@
that.getCode(obj); that.getCode(obj);
}, },
fail() { fail() {
that.showDialog=false that.showDialog = false
uni.showToast({ uni.showToast({
title:'微信登录失败' title: '微信登录失败'
}) })
} }
}) })
// uni.getProvider({
// service: "oauth",
// success: function(res) {
// if (~res.provider.indexOf("weixin")) {
// uni.login({
// provider: "weixin",
// success: (res) => {
// //这里请求接口
// let obj = {
// Source: 1,
// OpenId: "",
// Name: info.userInfo.nickName,
// Photo: info.userInfo.avatarUrl,
// Gender: info.userInfo.gender,
// Moblie: "",
// SuperiorId: 0,
// code: res.code,
// };
// that.getCode(obj);
// },
// fail: () => {
// uni.showToast({
// title: "微信登录授权失败",
// icon: "none",
// });
// },
// });
// } else {
// uni.showToast({
// title: "请先安装微信或升级版本",
// icon: "none",
// });
// }
// },
// });
}, },
close() { close() {
this.showDialog = false; this.showDialog = false;
...@@ -164,7 +108,7 @@ ...@@ -164,7 +108,7 @@
getCode(obj) { getCode(obj) {
var that = this; var that = this;
uni.showLoading({ uni.showLoading({
title: "登录中", title: "登录中.",
}); });
//这里请求接口 //这里请求接口
var OpenId = ""; var OpenId = "";
...@@ -210,7 +154,6 @@ ...@@ -210,7 +154,6 @@
CounponPassword: CounponPassword, CounponPassword: CounponPassword,
KeyWord: KeyWord, KeyWord: KeyWord,
} }
console.log("loginMsg", loginMsg);
that.request2({ that.request2({
url: "/api/AppletLogin/Login", url: "/api/AppletLogin/Login",
data: loginMsg, data: loginMsg,
...@@ -240,14 +183,16 @@ ...@@ -240,14 +183,16 @@
that.msg.Id = uid; that.msg.Id = uid;
//HK 2023-10-31 新增 //HK 2023-10-31 新增
let b2bLoginParam = { let b2bLoginParam = {
OpenId: loginMsg.OpenId OpenId: res.data.OpenId
} }
let b2bResult = { let b2bResult = {
accountId: 0, accountId: 0,
customerId: 0, customerId: 0,
customerInfoChildrenId:0,
realNameAuthentication: 0, realNameAuthentication: 0,
account: "", account: "",
name: mallUserName, name: mallUserName,
customerName: "",
photo: "", photo: "",
secretKey: "", secretKey: "",
token: "", token: "",
...@@ -261,47 +206,25 @@ ...@@ -261,47 +206,25 @@
customerType: 1, //直客,2-同行 customerType: 1, //直客,2-同行
directCustomerId: 0, //直客Id directCustomerId: 0, //直客Id
} }
//erp判断是否是同行 that.apipost("LvXiaoYou_post_GetLvXiaoYouCustomerLogin", b2bLoginParam, b2bRes => {
that.apipost("b2b_post_Login", b2bLoginParam, (erpRes) => { var b2bData = b2bRes.data;
if (erpRes.resultCode == 1) { if (b2bRes.resultCode == 1) {
var tempdata = erpRes.data; b2bResult.accountId = b2bData.accountId;
b2bResult.accountId = tempdata.accountId; b2bResult.customerId = b2bData.customerId;
b2bResult.customerId = tempdata.customerId; b2bResult.customerInfoChildrenId=b2bData.customerInfoChildrenId;
b2bResult.realNameAuthentication = tempdata.realNameAuthentication; b2bResult.name = b2bData.name;
b2bResult.account = tempdata.account; b2bResult.customerName = b2bData.customerName;
b2bResult.name = tempdata.name;
b2bResult.photo = tempdata.photo;
b2bResult.secretKey = tempdata.secretKey;
b2bResult.token = tempdata.token;
b2bResult.groupId = tempdata.groupId;
b2bResult.isMember = tempdata.isMember;
b2bResult.createBy = tempdata.createBy;
b2bResult.EmLoginMobile = tempdata.EmLoginMobile;
b2bResult.contactNumber = tempdata.contactNumber;
b2bResult.salesBaseInfo = tempdata.salesBaseInfo;
b2bResult.count = tempdata.count;
b2bResult.customerType = 2;
}
uni.setStorageSync('b2b_user', b2bResult)
}, (failed) => {
that.apipost("LvXiaoYouLogin_post", b2bLoginParam, b2cRes => {
var b2cData = b2cRes.data;
if (b2cRes.resultCode == 1) {
b2bResult.directCustomerId = b2cData.directCustomerId;
b2bResult.name = b2cData.name;
b2bResult.customerType = 1;
b2bResult.token = b2cData.token;
b2bResult.photo = b2cData.photo;
b2bResult.contactNumber=b2cData.moblie;
uni.setStorageSync('b2b_user', b2bResult) uni.setStorageSync('b2b_user', b2bResult)
} }
}, (error2) => { }, (error2) => {
if (that.isOpenAuth == 1) {
}); //未绑定的用户强制跳转到登录页面
}, (error) => { uni.redirectTo({
console.log("error", error); url: '/pages/jiuzhai/bind_Customer'
}) })
} }
});
}
} }
); );
}, },
...@@ -361,7 +284,7 @@ ...@@ -361,7 +284,7 @@
getCodeAli(obj) { getCodeAli(obj) {
var that = this; var that = this;
uni.showLoading({ uni.showLoading({
title: "登录中", title: "登录中..",
}); });
//这里请求接口 //这里请求接口
that.request2({ that.request2({
......
This diff is collapsed.
...@@ -105,7 +105,9 @@ ...@@ -105,7 +105,9 @@
<view class="triangle-up" :style="{ top: pagePaddingBottom }"></view> <view class="triangle-up" :style="{ top: pagePaddingBottom }"></view>
</view> </view>
<coupon v-if="showCoupons" :coupon-message="couponMessage" :cform="ComeFrom" @goLook="goLook" @closeBtn="closeBtn"></coupon> <coupon v-if="showCoupons" :coupon-message="couponMessage" :cform="ComeFrom" @goLook="goLook" @closeBtn="closeBtn"></coupon>
<template v-show="setting&&setting.is_show_auth==1">
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth> <auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth>
</template>
<!-- <official-account></official-account> --> <!-- <official-account></official-account> -->
<orderPopup v-if="showorder" :orderPopupdata="orderPopupdata" @gosalesvolume="gosalesvolume" @closeBtn="closeBtn_order"></orderPopup> <orderPopup v-if="showorder" :orderPopupdata="orderPopupdata" @gosalesvolume="gosalesvolume" @closeBtn="closeBtn_order"></orderPopup>
</view> </view>
...@@ -428,10 +430,11 @@ ...@@ -428,10 +430,11 @@
add_top_app_show: 1, add_top_app_show: 1,
}); });
} }
this.setting = set;
this.add_show = uni.getStorageSync("add_top_app") ? this.add_show = uni.getStorageSync("add_top_app") ?
uni.getStorageSync("add_top_app").add_top_app_show : uni.getStorageSync("add_top_app").add_top_app_show :
1; 1;
this.setting = set;
this.isShowBack(); this.isShowBack();
let now = new Date(); let now = new Date();
......
...@@ -6,17 +6,17 @@ ...@@ -6,17 +6,17 @@
<view class="logo-text">旅小友</view> <view class="logo-text">旅小友</view>
</view> </view>
<view class="login-form"> <view class="login-form">
<view class="login-title">绑定同行</view> <view class="login-title">同行登录</view>
<view class="login-item"> <view class="login-item">
<input type="text" v-model="msg.account" placeholder="请输入的同业账号" :class="{'focus':currentFocus=='account'}" @blur="changeCurrentFocus('')" <input type="text" v-model="msg.account" placeholder="请输入的同业账号" :class="{'focus':currentFocus=='account'}" @blur="changeCurrentFocus('')"
@focus="changeCurrentFocus('account')"> @focus="changeCurrentFocus('account')">
</view> </view>
<view class="login-item"> <view class="login-item">
<input type="password" v-model="msg.password" placeholder="请输入的登录密码" :class="{'focus':currentFocus=='pwd'}" @blur="changeCurrentFocus('')" <input type="password" v-model="msg.password" placeholder="请输入的登录密码" :class="{'focus':currentFocus=='pwd'}" @blur="changeCurrentFocus('')"
@focus="changeCurrentFocus('pwd')"> @focus="changeCurrentFocus('pwd')">
</view> </view>
<view class="login-item"> <view class="login-item">
<view @click="loginByAccount" class="login-btn" :class="{'disable':msg.account==''||msg.password==''}">绑定</view> <view @click="loginByAccount" class="login-btn" :class="{'disable':msg.account==''||msg.password==''}">登录</view>
</view> </view>
</view> </view>
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
param.account = '' param.account = ''
param.password = '' param.password = ''
} }
this.apipost("b2b_post_LvXiaoYouBindCustomer", param, (res) => { this.apipost("b2b_post_LvXiaoYouBindCustomerInfo", param, (res) => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
//移除缓存=>跳转到首页重新登录 //移除缓存=>跳转到首页重新登录
uni.removeStorageSync('b2b_user') uni.removeStorageSync('b2b_user')
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment