Browse Source

1、登录逻辑变更

2、登录页面UI去掉生份证和用户姓名
3、首页UI去掉车辆信息
master
chenxuhui 7 years ago
parent
commit
faac5830c3
5 changed files with 130 additions and 98 deletions
  1. +3
    -3
      pages/homePage/homePage.js
  2. +2
    -2
      pages/homePage/homePage.wxml
  3. +117
    -87
      pages/login/login.js
  4. +4
    -4
      pages/login/login.wxml
  5. +4
    -2
      pages/login/login.wxss

+ 3
- 3
pages/homePage/homePage.js View File

@ -18,11 +18,11 @@ Page({
transferURL = '/pages/orderList/orderList';
break;
// 车辆申请
case "2":
// case "2":
// transferURL = '/pages/myCars/myCars';
// 没有列表,直接进入车辆详情
transferURL = '/pages/myCars/carsDetail/carsDetail';
break;
// transferURL = '/pages/myCars/carsDetail/carsDetail';
// break;
// 销售出库
case "3":
transferURL = '/pages/saleOutStore/saleOutStore';


+ 2
- 2
pages/homePage/homePage.wxml View File

@ -9,10 +9,10 @@
<image src="/imgs/myOrder.png"></image>
<text class='text'>我的订单</text>
</view>
<view class="ico" catchtap='transBtnClicked' data-itemid='2'>
<!-- <view class="ico" catchtap='transBtnClicked' data-itemid='2'>
<image src="/imgs/carsApply.png"></image>
<text class='text'>我的车辆</text>
</view>
</view> -->
<view class="ico" catchtap='transBtnClicked' data-itemid='3'>
<image src="/imgs/outStore.png"></image>
<text class='text'>销售出库</text>


+ 117
- 87
pages/login/login.js View File

@ -21,11 +21,11 @@ var isBindWeixinPath = '/MainSystem/B3WeChatMiniProgram/Rpcs/CommonRpc/IsBindWei
// 直接请求青花瓷服务器获取绑定信息的返回
var bindPath = "/MainSystem/B3WeChatMiniProgram/Rpcs/CommonRpc/Bind";
var XuBindDriver = '/MainSystem/B3MiniProgramRpc/XuRpcs/Driver/AccountRpc/XuBindDriver'
// var XuBindDriver = '/MainSystem/B3MiniProgramRpc/XuRpcs/Driver/AccountRpc/XuBindDriver'
var bindByPhone = '/MainSystem/B3MiniProgramRpc/XuRpcs/Driver/AccountRpc/XuBindByPhone';
var GetDriverByIdCard = "/MainSystem/B3MiniProgramRpc/XuRpcs/Driver/AccountRpc/GetDriverByIdCard"
var GetDriverByOpenId = '/MainSystem/B3MiniProgramRpc/XuRpcs/Driver/AccountRpc/GetDriverByOpenId'
// 没有使用的接口?
// var isBindedPath = '/MainSystem/B3MiniProgramRpc/XuRpcs/Driver/AccountRpc/IsBinded';
var isBindedPath = '/MainSystem/B3MiniProgramRpc/XuRpcs/Driver/AccountRpc/IsBinded';
//获取openID 参数1、app.globalData.AppId 2、code
function getOpenId(successaction) {
@ -52,6 +52,23 @@ function IsBind(openid, successaction) {
})
}
/**
* 客户服务器判断是否绑定成功 参数openid
* 返回值phoneNum
* 成功调用是否关注公众号方法
*/
function IsBinded(openid) {
let method = isBindedPath;
let params = [openid];
network.transfer_request(method, params, function (res) {
if (res.result != "") {
app.globalData.Phone = res.result;
// 判断是否关注公众号
IsBindWeixinMP(app.globalData.Phone)
}
})
}
//绑定公众号 参数用户电话 返回true已关注 false未关注
function IsBindWeixinMP(phone) {
let method = isBindWeixinPath;
@ -91,10 +108,10 @@ Page({
app.globalData.CustomerId = this.data.customerList[this.data.customerIndex].ID;
},
// 姓名
getDriverName: function(e) {
app.globalData.UserName = e.detail.value
},
// // 姓名
// getDriverName: function(e) {
// app.globalData.UserName = e.detail.value
// },
// 手机号码
getPhone: function(e) {
@ -103,32 +120,32 @@ Page({
},
// 身份证
getIDCardNum: function(e) {
if (!app.globalData.CustomerId) {
wx: wx.showModal({
title: '提示',
content: '请先绑定客户',
});
return;
}
var that = this;
if (e.detail.value.length == 18) {
Idcard = e.detail.value;
var method = GetDriverByIdCard;
var params = [1, Idcard];
network.transfer_request(method, params, function(res) {
//res就是我们请求接口返回的数据
if (res.result != null) {
app.globalData.UserName = res.result.Name,
app.globalData.Phone = res.result.Telephone;
that.setData({
name: res.result.Name,
phoneNum: res.result.Telephone,
})
}
})
}
},
// getIDCardNum: function(e) {
// if (!app.globalData.CustomerId) {
// wx: wx.showModal({
// title: '提示',
// content: '请先绑定客户',
// });
// return;
// }
// var that = this;
// if (e.detail.value.length == 18) {
// Idcard = e.detail.value;
// var method = GetDriverByIdCard;
// var params = [1, Idcard];
// network.transfer_request(method, params, function(res) {
// //res就是我们请求接口返回的数据
// if (res.result != null) {
// app.globalData.UserName = res.result.Name,
// app.globalData.Phone = res.result.Telephone;
// that.setData({
// name: res.result.Name,
// phoneNum: res.result.Telephone,
// })
// }
// })
// }
// },
// 获取所有客户列表
choiceCustomer: function() {
@ -180,21 +197,21 @@ Page({
return false;
}
// 判断用户姓名
if (app.globalData.UserName == "") {
wx.showToast({
image: '/imgs/ddpc.png',
title: '用户姓名不能为空',
})
return false;
}
// if (app.globalData.UserName == "") {
// wx.showToast({
// image: '/imgs/ddpc.png',
// title: '用户姓名不能为空',
// })
// return false;
// }
// 判断身份证信息
if ((Idcard.length < 18) || (Idcard.length > 18)) {
wx.showToast({
image: '/imgs/ddpc.png',
title: '身份证号不正确',
})
return false;
}
// if ((Idcard.length < 18) || (Idcard.length > 18)) {
// wx.showToast({
// image: '/imgs/ddpc.png',
// title: '身份证号不正确',
// })
// return false;
// }
} else {
wx.showModal({
@ -202,46 +219,56 @@ Page({
content: '请给予权限,不涉及个人隐私',
showCancel: false,
})
return false;
}
wx.login({
success: function(res) {
var method = XuBindDriver;
var params = [{
// "Domain_ID": that.data.array[that.data.index].ID,
"Driver_Name": app.globalData.UserName,
"Phone": app.globalData.Phone,
"IdCard": Idcard,
"OpenId": app.globalData.OpenId,
"NickName": nickName,
"Sex": gender,
"Province": province,
"City": city,
"Country": country,
"HeadImgUrl": avatarUrl,
"UnionId": " "
}];
var transferParams = [{
"OpenId": app.globalData.OpenId,
"Phone": app.globalData.Phone,
"NickName": nickName,
"Sex": gender,
"Province": province,
"City": city,
"Country": country,
"HeadImgUrl": avatarUrl,
"UnionId": " ",
//请求新增参数
"AppId": app.globalData.AppId,
"CustomerId": that.data.customerList[that.data.customerIndex].ID,
}];
network.transfer_request(method, params, function(res) {
app.globalData.Phone = that.data.phoneNum;
that.bingDriverInTransferServer(transferParams, function(res) {
IsBindWeixinMP(app.globalData.Phone)
});
})
}
var method = bindByPhone;
let params = [{
"OpenId": app.globalData.OpenId,
"Phone": app.globalData.Phone,
"NickName": nickName,
"Sex": gender,
"Province": province,
"City": city,
"Country": country,
"HeadImgUrl": avatarUrl,
"UnionId": ""
}];
// var params = [{
// // "Domain_ID": that.data.array[that.data.index].ID,
// "Driver_Name": app.globalData.UserName,
// "Phone": app.globalData.Phone,
// "IdCard": Idcard,
// "OpenId": app.globalData.OpenId,
// "NickName": nickName,
// "Sex": gender,
// "Province": province,
// "City": city,
// "Country": country,
// "HeadImgUrl": avatarUrl,
// "UnionId": " "
// }];
var transferParams = [{
"OpenId": app.globalData.OpenId,
"Phone": app.globalData.Phone,
"NickName": nickName,
"Sex": gender,
"Province": province,
"City": city,
"Country": country,
"HeadImgUrl": avatarUrl,
"UnionId": " ",
//请求新增参数
"AppId": app.globalData.AppId,
"CustomerId": that.data.customerList[that.data.customerIndex].ID,
}];
network.transfer_request(method, params, function(res) {
app.globalData.Phone = that.data.phoneNum;
//绑定中转服务器客户对应信息 成功判断是否关注公众号
that.bingDriverInTransferServer(transferParams, function(res) {
IsBindWeixinMP(app.globalData.Phone)
});
})
},
@ -249,7 +276,9 @@ Page({
var that = this;
var method = bindPath;
network.requestLoading(method, params, function(res) {
successaction(res.result);
if (res.result == true) {
successaction();
}
});
},
@ -263,7 +292,8 @@ Page({
if (res == "") {
} else {
IsBindWeixinMP(app.globalData.Phone)
// 判断是否绑定成功 参数openid 返回值phoneNum
IsBinded(openid);
}
})
})


+ 4
- 4
pages/login/login.wxml View File

@ -11,21 +11,21 @@
</view>
<view class='lineView'></view>
<view class='customerChooseView'>
<!-- <view class='customerChooseView'>
<view class='keyView'>身份证号码</view>
<view class='valueView'>
<input class='imput_phone' bindinput='getIDCardNum' type='number' maxlength='18' placeholder='请输入身份证号码' placeholder-style='color:rgb(202, 202, 202)'></input>
</view>
</view>
<view class='lineView'></view>
<view class='lineView'></view> -->
<view class='customerChooseView'>
<!-- <view class='customerChooseView'>
<view class='keyView'>姓 名</view>
<view class='valueView'>
<input class='imput_phone' bindinput='getDriverName' type='text' placeholder='请输入姓名' placeholder-style='color:rgb(202, 202, 202)'></input>
</view>
</view>
<view class='lineView'></view>
<view class='lineView'></view> -->
<view class='customerChooseView'>
<view class='keyView'>手机号码</view>


+ 4
- 2
pages/login/login.wxss View File

@ -2,8 +2,10 @@
.containerView{
margin-left: 30rpx;
margin-right: 30rpx;
height: 480rpx;
margin-top: 25%;
/* height: 480rpx;
margin-top: 25%; */
height: 240rpx;
margin-top: 40%;
display: flex;
flex-direction: column;


Loading…
Cancel
Save