Commit bf0c39da authored by 黄奎's avatar 黄奎

11

parent 091c9fa1
......@@ -17,7 +17,7 @@
<script>
import coupon from "@/components/coupons/coupons";
export default {
components: {
coupon,
......@@ -34,40 +34,18 @@
showLogin: true,
canIUseGetUserProfile: false,
msg: {},
isOpenAuth: 0, //是否开启强制授权
};
},
created() {
// this.pageinfo = uni.getStorageSync("basedata") ?
// uni.getStorageSync("basedata").auth_page : {};
// if (wx.getUserProfile) {
// 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;`;
let mallConfig = uni.getStorageSync("basedata");
if (mallConfig && mallConfig.mall && mallConfig.mall.setting && mallConfig.mall.setting.is_show_auth) {
this.isOpenAuth = mallConfig.mall.setting.is_show_auth;
}
this.getUserInfo()
},
methods: {
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({
title: "电脑端暂时不能获取用户信息,请转到手机端使用!",
icon: "none",
......@@ -114,47 +92,13 @@
that.getCode(obj);
},
fail() {
that.showDialog=false
that.showDialog = false
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() {
this.showDialog = false;
......@@ -164,7 +108,7 @@
getCode(obj) {
var that = this;
uni.showLoading({
title: "登录中",
title: "登录中.",
});
//这里请求接口
var OpenId = "";
......@@ -210,7 +154,6 @@
CounponPassword: CounponPassword,
KeyWord: KeyWord,
}
console.log("loginMsg", loginMsg);
that.request2({
url: "/api/AppletLogin/Login",
data: loginMsg,
......@@ -240,14 +183,16 @@
that.msg.Id = uid;
//HK 2023-10-31 新增
let b2bLoginParam = {
OpenId: loginMsg.OpenId
OpenId: res.data.OpenId
}
let b2bResult = {
accountId: 0,
customerId: 0,
customerInfoChildrenId:0,
realNameAuthentication: 0,
account: "",
name: mallUserName,
customerName: "",
photo: "",
secretKey: "",
token: "",
......@@ -261,46 +206,24 @@
customerType: 1, //直客,2-同行
directCustomerId: 0, //直客Id
}
//erp判断是否是同行
that.apipost("b2b_post_Login", b2bLoginParam, (erpRes) => {
if (erpRes.resultCode == 1) {
var tempdata = erpRes.data;
b2bResult.accountId = tempdata.accountId;
b2bResult.customerId = tempdata.customerId;
b2bResult.realNameAuthentication = tempdata.realNameAuthentication;
b2bResult.account = tempdata.account;
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;
that.apipost("LvXiaoYou_post_GetLvXiaoYouCustomerLogin", b2bLoginParam, b2bRes => {
var b2bData = b2bRes.data;
if (b2bRes.resultCode == 1) {
b2bResult.accountId = b2bData.accountId;
b2bResult.customerId = b2bData.customerId;
b2bResult.customerInfoChildrenId=b2bData.customerInfoChildrenId;
b2bResult.name = b2bData.name;
b2bResult.customerName = b2bData.customerName;
uni.setStorageSync('b2b_user', b2bResult)
}
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)
}
}, (error2) => {
});
}, (error) => {
console.log("error", error);
})
}, (error2) => {
if (that.isOpenAuth == 1) {
//未绑定的用户强制跳转到登录页面
uni.redirectTo({
url: '/pages/jiuzhai/bind_Customer'
})
}
});
}
}
);
......@@ -361,7 +284,7 @@
getCodeAli(obj) {
var that = this;
uni.showLoading({
title: "登录中",
title: "登录中..",
});
//这里请求接口
that.request2({
......
This diff is collapsed.
......@@ -105,7 +105,9 @@
<view class="triangle-up" :style="{ top: pagePaddingBottom }"></view>
</view>
<coupon v-if="showCoupons" :coupon-message="couponMessage" :cform="ComeFrom" @goLook="goLook" @closeBtn="closeBtn"></coupon>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth>
<template v-show="setting&&setting.is_show_auth==1">
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth>
</template>
<!-- <official-account></official-account> -->
<orderPopup v-if="showorder" :orderPopupdata="orderPopupdata" @gosalesvolume="gosalesvolume" @closeBtn="closeBtn_order"></orderPopup>
</view>
......@@ -428,10 +430,11 @@
add_top_app_show: 1,
});
}
this.setting = set;
this.add_show = uni.getStorageSync("add_top_app") ?
uni.getStorageSync("add_top_app").add_top_app_show :
1;
this.setting = set;
this.isShowBack();
let now = new Date();
......@@ -901,7 +904,7 @@
"&cityId=" +
that.cityId,
});
}
}
}, 500);
},
updateuserinfo(msg) {
......
......@@ -6,17 +6,17 @@
<view class="logo-text">旅小友</view>
</view>
<view class="login-form">
<view class="login-title">绑定同行</view>
<view class="login-title">同行登录</view>
<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')">
</view>
<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')">
</view>
<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>
......@@ -69,7 +69,7 @@
param.account = ''
param.password = ''
}
this.apipost("b2b_post_LvXiaoYouBindCustomer", param, (res) => {
this.apipost("b2b_post_LvXiaoYouBindCustomerInfo", param, (res) => {
if (res.resultCode == 1) {
//移除缓存=>跳转到首页重新登录
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