Browse Source

修改支付页面可以点击,修改键盘高度

master
mike 2 years ago
parent
commit
8c56d1a198
  1. 31
      agentApp/components/cu-keyboard/cu-keyboard.vue
  2. 18
      agentApp/pages/payment/payment.vue

31
agentApp/components/cu-keyboard/cu-keyboard.vue

@ -1,8 +1,8 @@
<template>
<view class="key-container" v-show="showMask">
<uni-transition :modeClass="['slide-bottom']" :show="show"
<view class="key-container">
<!-- <uni-transition :modeClass="['slide-bottom']" :show="show"
:styles="{height:'100vh'}"
:duration="duration">
:duration="duration"> -->
<view class="key-content" @click.stop>
<slot></slot>
<view class="key-box block flex">
@ -34,9 +34,10 @@
</view>
</view>
</view>
<view class="end-box" :style="'height:'+safeHeight+'px'"></view>
</view>
</uni-transition>
</view>
<!-- </uni-transition>-->
</view>
</template>
<script>
@ -62,6 +63,10 @@ export default{
type:String,
default:'付款'
},
safeHeight:{
type:Number,
default:0
},
confirmStyle:{
type:Object,
default:()=>{
@ -209,8 +214,8 @@ export default{
}
.key-container{
position: fixed;
bottom: 0;
top:0;
bottom: 0;
//top:0;
left:0;
right:0;
.key-content{
@ -279,5 +284,15 @@ export default{
}
}
}
.end-box{
// position: fixed;
// left: 0;
// right: 0;
// bottom: 0;
// padding-bottom: constant(safe-area-inset-bottom);
// padding-bottom: env(safe-area-inset-bottom);
// margin-bottom: constant(safe-area-inset-bottom);
// margin-bottom: env(safe-area-inset-bottom);
//height: 40rpx;
}
</style>

18
agentApp/pages/payment/payment.vue

@ -31,7 +31,7 @@
</view>
<view class="num">
<input type="text" class="pr-num" v-model="amount" placeholder="请输入金额"
<input type="text" class="pr-num" disabled v-model="amount" placeholder="请输入金额"
placeholder-style="color: #cfcfcf;" />
</view>
</view>
@ -56,7 +56,7 @@
</view>
</view>
<!-- <u-keyboard confirmText="1" mode="number" :closeOnClickOverlay="true" @close="close" :show="show" @confirm="confirm" @cancel="cancel"></u-keyboard> -->
<cu-keyboard ref="cukeyboard" @change="change" @confirm="confirm" @hide="hide"></cu-keyboard>
<cu-keyboard ref="cukeyboard" @change="change" @confirm="confirm" @hide="hide" :safeHeight="safeHeight"></cu-keyboard>
</view>
</view>
</template>
@ -77,7 +77,8 @@
name: '加载中...',
address: '',
logo: ''
}
},
safeHeight:0
}
},
onReady() {
@ -86,6 +87,16 @@
onLoad() {
this.payment_code = uni.getStorageSync('payment_code')
this.getMerchantInfo()
let info = uni.getSystemInfoSync()
// alert(info.safeArea.bottom)
// alert(info.screenHeight)
// alert(info.safeArea.height)
if(info.screenHeight!=info.safeArea.bottom){
this.safeHeight = 20;
}
},
methods: {
getMerchantInfo() {
@ -188,6 +199,7 @@
</script>
<style lang="scss">
.uni-page-body {
background: #ededed;
}

Loading…
Cancel
Save