Commit 54d93d341a54588ba6d632e9b20d7dbab2680bec

Authored by wangfan
1 parent 73beac15

录入调整

@@ -58,6 +58,7 @@ Page({ @@ -58,6 +58,7 @@ Page({
58 58
59 timePickerMask:false, 59 timePickerMask:false,
60 pnumInputFocus:false, 60 pnumInputFocus:false,
  61 + pageMarginBottom:0,
61 }, 62 },
62 /** 63 /**
63 * 生命周期函数--监听页面加载 64 * 生命周期函数--监听页面加载
@@ -474,6 +475,44 @@ Page({ @@ -474,6 +475,44 @@ Page({
474 this.setData({ 475 this.setData({
475 pnumInputFocus:'focus'==e.type 476 pnumInputFocus:'focus'==e.type
476 }) 477 })
477 - } 478 + },
  479 + inputFocusTime:0,
  480 + blurTime:0,
  481 + inputFocus(e){
  482 + console.log(e,this.inputFocusTime);
  483 + return;
  484 + if(e.timeStamp>this.inputFocusTime){
  485 + this.inputFocusTime=e.timeStamp;
  486 + if(e.type=='focus' && this.data.pageMarginBottom==0){
  487 + this.setData({
  488 + pageMarginBottom:300
  489 + })
  490 + setTimeout(res=>{
  491 + this.pageScrollToBottom();
  492 + },100)
  493 + }else{
  494 + if(this.blurTime>5){
  495 + this.blurTime=0;
  496 + this.setData({
  497 + pageMarginBottom:0
  498 + })
  499 + }else{
  500 + setTimeout(res=>{
  501 + this.blurTime+=1;
  502 + this.inputFocus(e);
  503 + },300)
  504 + }
478 505
  506 + }
  507 +
  508 + }
  509 + },
  510 + pageScrollToBottom: function() {
  511 + wx.createSelectorQuery().select('#j_page').boundingClientRect(function(rect){
  512 + // 使页面滚动到底部
  513 + wx.pageScrollTo({
  514 + scrollTop: rect.bottom
  515 + })
  516 + }).exec()
  517 + },
479 }) 518 })
1 <!--pages/book/b_addnew.wxml--> 1 <!--pages/book/b_addnew.wxml-->
2 <nav>录入订座信息</nav> 2 <nav>录入订座信息</nav>
3 -<view class="page"> 3 +<view class="page" style="margin-bottom: {{pageMarginBottom}}rpx;" id="j_page">
4 <view class="base-info"> 4 <view class="base-info">
5 <!-- 5 <!--
6 <view class="section flex-lr date"> 6 <view class="section flex-lr date">
@@ -62,7 +62,7 @@ @@ -62,7 +62,7 @@
62 </view> 62 </view>
63 </view> 63 </view>
64 </view> 64 </view>
65 - <view class="section"> 65 + <view class="section" style="height: 90rpx;">
66 <view class="tab flex-lr"> 66 <view class="tab flex-lr">
67 <view class="tab flex-ll"> 67 <view class="tab flex-ll">
68 <view class="item-pnum {{form.pnum==item?'checked':''}}" wx:for="{{[6,7,8,9,10]}}" wx:key="pnum.key" 68 <view class="item-pnum {{form.pnum==item?'checked':''}}" wx:for="{{[6,7,8,9,10]}}" wx:key="pnum.key"
@@ -180,6 +180,8 @@ @@ -180,6 +180,8 @@
180 <input placeholder="预订人姓名(必填)" placeholder-class="gray-font font34r" class="black-font font34r" maxlength="5" style="width:450rpx;" value="{{form.rname}}" 180 <input placeholder="预订人姓名(必填)" placeholder-class="gray-font font34r" class="black-font font34r" maxlength="5" style="width:450rpx;" value="{{form.rname}}"
181 bindinput="selectedValue" 181 bindinput="selectedValue"
182 bindconfirm="selectedValue" 182 bindconfirm="selectedValue"
  183 + bindfocus="inputFocus"
  184 + bindblur="inputFocus"
183 data-key="rname"/> 185 data-key="rname"/>
184 <view class="book-info-grand flex-rr font28r gray-deep-font"> 186 <view class="book-info-grand flex-rr font28r gray-deep-font">
185 <block wx:for="{{grand}}" wx:key="grand.key"> 187 <block wx:for="{{grand}}" wx:key="grand.key">
@@ -195,6 +197,8 @@ @@ -195,6 +197,8 @@
195 <input placeholder="顾客的要求(25字以内,选填)" placeholder-class="gray-font font34r" class="black-font font34r" maxlength="25" value="{{form.cusdem}}" 197 <input placeholder="顾客的要求(25字以内,选填)" placeholder-class="gray-font font34r" class="black-font font34r" maxlength="25" value="{{form.cusdem}}"
196 bindinput="selectedValue" 198 bindinput="selectedValue"
197 bindconfirm="selectedValue" 199 bindconfirm="selectedValue"
  200 + bindfocus="inputFocus"
  201 + bindblur="inputFocus"
198 data-key="cusdem"/> 202 data-key="cusdem"/>
199 </view> 203 </view>
200 </view> 204 </view>
1 /* pages/book/b_addnew.wxss */ 1 /* pages/book/b_addnew.wxss */
2 .page{ 2 .page{
3 width: 90%; 3 width: 90%;
4 - margin: 40rpx 5% 0; 4 + margin: 20rpx 5% 0;
5 } 5 }
6 .base-info{ 6 .base-info{
7 7
8 } 8 }
9 .section{ 9 .section{
10 height: 110rpx; 10 height: 110rpx;
11 - line-height: 110rpx;  
12 -  
13 } 11 }
14 .section .label{ 12 .section .label{
15 width: 60rpx; 13 width: 60rpx;
@@ -103,7 +101,6 @@ @@ -103,7 +101,6 @@
103 } 101 }
104 .tables{ 102 .tables{
105 height: 314rpx; 103 height: 314rpx;
106 - margin-top: 10rpx;  
107 font-size: 30rpx; 104 font-size: 30rpx;
108 } 105 }
109 .tables .title{ 106 .tables .title{