Skip to content

Commit

Permalink
修改bug
Browse files Browse the repository at this point in the history
  • Loading branch information
闫士博 committed Jul 10, 2018
1 parent cbdeee5 commit 39d0ad8
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 12 deletions.
34 changes: 29 additions & 5 deletions h5/js/pay.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
var mainfun = {
offernum:0,
jineval:0,
paytext:"",
inputval:"",
paytype:0,
init:function(){
this.handle();
},
Expand Down Expand Up @@ -47,11 +47,20 @@
});

$("#paylays .choosetype").bind("click",function(){
var type = $(this).attr("_type");
mainfun.paytype = type;
$("#paylays .choosetype").find(".radio").removeClass("hover");
$(this).find(".radio").addClass("hover");

});
$("#pays").bind("click",function(){

//mainfun.paytype 0储蓄支付 1微信支付
var money = $("span.spanjines").eq(0).text();
if(money == ""){
alert("请输入金额");
}
alert("支付类型:"+mainfun.paytype)
alert("支付金额:"+money)
});
$("#nav p").bind("click",function(){
var index = $(this).index();
Expand Down Expand Up @@ -81,7 +90,12 @@
$("#keyboardlays .keyfirm").bind("click",function(){
$("#keyboardlays").animate({
"bottom":'-466px'
},300)
},300);

if(that.inputval.charAt(that.inputval.length - 1)== "."){
that.inputval = parseInt(that.inputval);
$("#jine").val(that.inputval);
}
var jine = that.inputval - that.offernum;
if(jine>0){
$("span.spanjines").text(jine+"元");
Expand All @@ -98,9 +112,19 @@

$("#keyboardlays .key").bind("click",function(){
var val = $(this).text();
that.inputval = that.inputval + val;
$("#jine").val(that.inputval);
var inputval = that.inputval + val;
if(val == "." && that.inputval.indexOf(".") == -1 && that.inputval !== ""){
that.inputval = that.inputval + val;
$("#jine").val(that.inputval);
}else if(/^\d+(\.\d{1,2})?$/.test(inputval)){
that.inputval = inputval;
$("#jine").val(inputval);
}
});

$("#bindmember").bind("click",function(){
alert("绑定会员");
})
}
}

Expand Down
8 changes: 4 additions & 4 deletions h5/pay.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<span></span>
</div>
<p class="add-remarks" id="addRemarks">添加备注</p>
<div class="offers">
<div class="offers" style="display: none">
<p class="tips">以下优惠不可同享</p>
<ul class="offers-ul" id="offers-ul">
<li id="choosecoupon">
Expand All @@ -37,7 +37,7 @@
</ul>
</div>
<p class="submit" id="submit">确认买单<span class="spanjines"></span></p>

<p class="submit" id="bindmember">绑定会员</p>
<!-- 黑色透明蒙层 -->
<div class="overlays" id="overlays"></div>

Expand Down Expand Up @@ -145,13 +145,13 @@
<!-- 支付弹层 -->
<div class="paylays" id="paylays">
<p class="title"><span>×</span>确认支付</p>
<div class="chuzhi choosetype">
<div class="chuzhi choosetype" _type="0">
<span class="word"></span>
<p class="jine">储值(余额300.32元)</p>
<span class="radio hover"></span>
</div>
<p class="ptitle">支付方式</p>
<div class="wxbox choosetype">
<div class="wxbox choosetype" _type="1">
<span class="wxicon"></span>
<p class="jine">微信支付</p>
<span class="radio"></span>
Expand Down
3 changes: 0 additions & 3 deletions xfz/pages/my/my.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,10 @@
<view class="myhd">
<image src="../../images/my/icon1.png" style="width: 34rpx;height: 30rpx;"></image>
<text>我的红包</text>
<image class="arrow-right" src="../../images/arrow.png"></image>
</view>
<view class="myhd">
<image src="../../images/my/icon2.png" style="width: 31rpx;height: 29rpx;"></image>
<text>我的计次卡</text>
<image class="arrow-right" src="../../images/arrow.png"></image>
</view>
<view class="myhd" bindtap="toconsume">
<image src="../../images/my/icon3.png" style="width: 30rpx;height: 30rpx;"></image>
Expand All @@ -55,6 +53,5 @@
<view class="myhd">
<image src="../../images/my/icon4.png" style="width: 30rpx;height: 24rpx;"></image>
<text>我的发票</text>
<image class="arrow-right" src="../../images/arrow.png"></image>
</view>
</view>

0 comments on commit 39d0ad8

Please sign in to comment.