Browse Source

登录页界面优化

master
chenxuhui 7 years ago
parent
commit
dc0f485c19
6 changed files with 22 additions and 34 deletions
  1. +0
    -6
      pages/login/login.js
  2. +3
    -6
      pages/login/login.wxml
  3. +13
    -5
      pages/login/login.wxss
  4. +1
    -1
      pages/statementOfAccount/statementOfAccount.wxml
  5. +4
    -4
      pages/statementOfAccount/statementOfAccount.wxss
  6. +1
    -12
      utils/net.js

+ 0
- 6
pages/login/login.js View File

@ -66,9 +66,7 @@ function IsBindWeixinMP(phone) {
Page({ Page({
data: { data: {
//用户信息
userInfo: "", userInfo: "",
//新增选择客户
array: [{ array: [{
ID: 0, ID: 0,
Name: "请选择所属客户" Name: "请选择所属客户"
@ -163,10 +161,6 @@ Page({
CustomerId: that.data.array[that.data.index].ID, CustomerId: that.data.array[that.data.index].ID,
}]; }];
var storageCustomerID = that.data.array[that.data.index].ID; var storageCustomerID = that.data.array[that.data.index].ID;
// wx.setStorage({
// key: 'CustomerId',
// data: storageCustomerID,
// })
app.globalData.CustomerId = storageCustomerID; app.globalData.CustomerId = storageCustomerID;
// 先绑定客户服务器 // 先绑定客户服务器


+ 3
- 6
pages/login/login.wxml View File

@ -1,19 +1,16 @@
<image class='img1' src='/imgs/tuceng.png'> <image class='img1' src='/imgs/tuceng.png'>
</image> </image>
<view class='view2' wx:if="{{showCustomerChoise}}">
<picker class='customerPicker' mode="selector" range="{{array}}" value="{{array[index].Name}}" range-key="Name" bindchange="listenerPickerSelected">
<view class="view2">
<picker class="{{index==0 ? 'pickerPlaceHolder' : 'pickerSelected'}}" mode="selector" range="{{array}}" value="{{array[index].Name}}" range-key="Name" bindchange="listenerPickerSelected">
<text>{{array[index].Name}}</text> <text>{{array[index].Name}}</text>
</picker> </picker>
</view> </view>
<view class='view2'> <view class='view2'>
<input class='input' placeholder='请输入手机号' type='number' bindinput="phoneNum" maxlength="11"></input>
<input class='input' placeholder='请输入手机号' placeholder-style='color: #999' type='number' bindinput="phoneNum" maxlength="11"></input>
</view> </view>
<!-- <button class='denglu' >获取授权</button> -->
<button open-type="getUserInfo" bindgetuserinfo="getUserInfo" class='denglu'>绑定</button> <button open-type="getUserInfo" bindgetuserinfo="getUserInfo" class='denglu'>绑定</button>
<!-- <button catchtap='bindPublicNumber' class='denglu'>关注公众号</button> -->
<official-account class="wxmp"></official-account> <official-account class="wxmp"></official-account>

+ 13
- 5
pages/login/login.wxss View File

@ -9,12 +9,20 @@ page {
margin-top: 20%; margin-top: 20%;
} }
.customerPicker {
width: 100%;
.pickerPlaceHolder {
text-align: center;
height: 40px; height: 40px;
background: #EAF1F8;
line-height: 40px; line-height: 40px;
color: #999;
}
.pickerSelected {
text-align: center; text-align: center;
background: #fafafa;
height: 40px;
line-height: 40px;
background: #EAF1F8;
color: black;
} }
.view2 { .view2 {
@ -33,7 +41,7 @@ page {
.input { .input {
text-align: center; text-align: center;
height: 40px; height: 40px;
background: #fafafa;
background: #EAF1F8;
} }
.denglu { .denglu {
@ -41,7 +49,7 @@ page {
margin-top: 10%; margin-top: 10%;
width: 90%; width: 90%;
margin-right: 5%; margin-right: 5%;
background: #2e8cf5;
background: #f98b29;
color: #fff; color: #fff;
} }


+ 1
- 1
pages/statementOfAccount/statementOfAccount.wxml View File

@ -7,7 +7,7 @@
</view> </view>
<view class='listContainer'> <view class='listContainer'>
<block wx:for="{{list}}" wx:key="item" wx:for-index="idx">
<block wx:for="{{list}}" wx:for-item="item" wx:key="item" wx:for-index="idx">
<template is="statementTemplate" data="{{item,idx}}" /> <template is="statementTemplate" data="{{item,idx}}" />
</block> </block>
</view> </view>


+ 4
- 4
pages/statementOfAccount/statementOfAccount.wxss View File

@ -28,20 +28,20 @@ page{
} }
.header{ .header{
height: 60px;
height: 70px;
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
/* border-bottom: 1rpx solid #ccc; */
} }
.headerSectionTop{ .headerSectionTop{
/* height: 50%; */ /* height: 50%; */
height: 30px;
height: 40px;
width: 100%; width: 100%;
line-height: 30px;
line-height: 40px;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
border-bottom: 1rpx solid #ccc;
} }
.headerSectionBottom{ .headerSectionBottom{


+ 1
- 12
utils/net.js View File

@ -16,8 +16,6 @@ function previousRequestLoading(method, params, successaction) {
'params': params 'params': params
}; };
var baseUrl = app.globalData.BaseUrl; var baseUrl = app.globalData.BaseUrl;
console.log("params == " + params);
console.log("method == " + method);
wx.request({ wx.request({
url: baseUrl, url: baseUrl,
data: data, data: data,
@ -38,7 +36,6 @@ function previousRequestLoading(method, params, successaction) {
} }
}, },
fail: function(res) { fail: function(res) {
console.log(res)
wx.showModal({ wx.showModal({
title: '执行出错', title: '执行出错',
content: res, content: res,
@ -55,20 +52,13 @@ function requestLoading(method, params, successaction) {
wx.showLoading({ wx.showLoading({
title: "加载中", title: "加载中",
}) })
//{"DecryptCookie":"","CustomerId":1,"Method":"/MainSystem/MainSystem/Auth/Login","Data":["栾慧",""]}
var newData = { var newData = {
// 客户和司机不添加cookie请求
"DecryptCookie": "",//EasyAuth=72335493ecb14015be2db57fc364dc84
// 小程序所在客户ID(仙坛,万福,和美)
"DecryptCookie": "",
"CustomerId": app.globalData.CustomerId, "CustomerId": app.globalData.CustomerId,
// 代替url原来后边拼接的方式,提取到data内
"AppendUrlString": "?appid=" + app.globalData.AppId + "&phone=" + app.globalData.Phone, "AppendUrlString": "?appid=" + app.globalData.AppId + "&phone=" + app.globalData.Phone,
// 请求路径
"Method": method, "Method": method,
// 请求数据
"Data": params, "Data": params,
}; };
// 中转服务器地址
var baseUrl = app.globalData.TranferBaseUrl; var baseUrl = app.globalData.TranferBaseUrl;
wx.request({ wx.request({
url: baseUrl, url: baseUrl,
@ -90,7 +80,6 @@ function requestLoading(method, params, successaction) {
} }
}, },
fail: function(res) { fail: function(res) {
console.log(res)
wx.showModal({ wx.showModal({
title: '执行出错', title: '执行出错',
content: res, content: res,


Loading…
Cancel
Save