Browse Source

修改键盘

master
mike 2 years ago
parent
commit
d17bd6b5de
  1. 3
      agentApp/components/cu-keyboard/cu-keyboard.vue
  2. 43
      agentApp/pages/payment/payment.vue

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

@ -1,5 +1,5 @@
<template>
<view class="key-container" @click="hide" v-show="showMask">
<view class="key-container" v-show="showMask">
<uni-transition :modeClass="['slide-bottom']" :show="show"
:styles="{height:'100vh'}"
:duration="duration">
@ -87,6 +87,7 @@ export default{
},
methods:{
close(){
return
this.show = false;
setTimeout(()=>{
this.showMask = false;

43
agentApp/pages/payment/payment.vue

@ -45,15 +45,15 @@
</view>
<view class="pc-aplay">
支付宝支付
微信支付
</view>
</view>
<view class="pac-link">
<view class="pac-link" @click="showDetail">
查看活动规则
</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"></cu-keyboard>
<cu-keyboard ref="cukeyboard" @change="change" @confirm="confirm" @hide="hide"></cu-keyboard>
</view>
</view>
</template>
@ -80,6 +80,15 @@ export default {
},
confirm() {
//this.show = false;
if(!this.checkMoney( this.amount)){
//alert("");
uni.showModal({
content:"请输入正确金额",
showCancel:false,
confirmText:"知道了"
})
return
}
console.log("pay:",this.amount)
},
cancel() {
@ -91,7 +100,33 @@ export default {
change(v){
console.log("change :",v)
this.amount = v
},
hide(){
},
checkMoney(val) {
//
var rechargeMoney = val;
var reg = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^0$)|(^\d\.\d{1,2}$)/;
if (rechargeMoney == "") {
return false;
} else if (rechargeMoney.trim() == "") {
return false;
} else if (!reg.test(rechargeMoney)){
return false;
} else if (rechargeMoney == 0){
return false;
} else {
return true;
}
},
showDetail(){
console.log("showDetail")
}
}
}
</script>
@ -102,7 +137,7 @@ export default {
}
.pam-content {
padding-top: 100rpx;
padding-top: 50rpx;
padding-left: 30rpx;
padding-right: 30rpx;

Loading…
Cancel
Save