Commit 54d93d341a54588ba6d632e9b20d7dbab2680bec

Authored by wangfan
1 parent 73beac15

录入调整

... ... @@ -58,6 +58,7 @@ Page({
timePickerMask:false,
pnumInputFocus:false,
pageMarginBottom:0,
},
/**
* 生命周期函数--监听页面加载
... ... @@ -474,6 +475,44 @@ Page({
this.setData({
pnumInputFocus:'focus'==e.type
})
}
},
inputFocusTime:0,
blurTime:0,
inputFocus(e){
console.log(e,this.inputFocusTime);
return;
if(e.timeStamp>this.inputFocusTime){
this.inputFocusTime=e.timeStamp;
if(e.type=='focus' && this.data.pageMarginBottom==0){
this.setData({
pageMarginBottom:300
})
setTimeout(res=>{
this.pageScrollToBottom();
},100)
}else{
if(this.blurTime>5){
this.blurTime=0;
this.setData({
pageMarginBottom:0
})
}else{
setTimeout(res=>{
this.blurTime+=1;
this.inputFocus(e);
},300)
}
}
}
},
pageScrollToBottom: function() {
wx.createSelectorQuery().select('#j_page').boundingClientRect(function(rect){
// 使页面滚动到底部
wx.pageScrollTo({
scrollTop: rect.bottom
})
}).exec()
},
})
\ No newline at end of file
... ...
<!--pages/book/b_addnew.wxml-->
<nav>录入订座信息</nav>
<view class="page">
<view class="page" style="margin-bottom: {{pageMarginBottom}}rpx;" id="j_page">
<view class="base-info">
<!--
<view class="section flex-lr date">
... ... @@ -62,7 +62,7 @@
</view>
</view>
</view>
<view class="section">
<view class="section" style="height: 90rpx;">
<view class="tab flex-lr">
<view class="tab flex-ll">
<view class="item-pnum {{form.pnum==item?'checked':''}}" wx:for="{{[6,7,8,9,10]}}" wx:key="pnum.key"
... ... @@ -180,6 +180,8 @@
<input placeholder="预订人姓名(必填)" placeholder-class="gray-font font34r" class="black-font font34r" maxlength="5" style="width:450rpx;" value="{{form.rname}}"
bindinput="selectedValue"
bindconfirm="selectedValue"
bindfocus="inputFocus"
bindblur="inputFocus"
data-key="rname"/>
<view class="book-info-grand flex-rr font28r gray-deep-font">
<block wx:for="{{grand}}" wx:key="grand.key">
... ... @@ -195,6 +197,8 @@
<input placeholder="顾客的要求(25字以内,选填)" placeholder-class="gray-font font34r" class="black-font font34r" maxlength="25" value="{{form.cusdem}}"
bindinput="selectedValue"
bindconfirm="selectedValue"
bindfocus="inputFocus"
bindblur="inputFocus"
data-key="cusdem"/>
</view>
</view>
... ...
/* pages/book/b_addnew.wxss */
.page{
width: 90%;
margin: 40rpx 5% 0;
margin: 20rpx 5% 0;
}
.base-info{
}
.section{
height: 110rpx;
line-height: 110rpx;
}
.section .label{
width: 60rpx;
... ... @@ -103,7 +101,6 @@
}
.tables{
height: 314rpx;
margin-top: 10rpx;
font-size: 30rpx;
}
.tables .title{
... ...