ycm 2 년 전
부모
커밋
7893565944
2개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      pages/my/cashier/cashier.js
  2. 2 1
      pages/my/cashier/cashier.wxml

+ 1 - 1
pages/my/cashier/cashier.js

@@ -106,7 +106,7 @@ Page({
         var that=this;
         var no=that.data.price
         app.api.useApi(app.globalData.baseAppUrl + "api/recharge/charge", {
-            price: no,
+            price: no.toFixed(2),
       }, "post").then(function (res) {
           console.log(res)
           if (res.code != 200) {

+ 2 - 1
pages/my/cashier/cashier.wxml

@@ -1,4 +1,5 @@
 <!--pages/my/cashier/cashier.wxml-->
+<wxs module="tofix" src="../../../components/tool/decimal.wxs"></wxs>
 <van-icon name="arrow-left"  size="25px" custom-class="back" bind:click="back"/>
 <view class="topBox flex ju-c m-bottom-25">
     <view class="num">¥{{pageinfo.price}}</view>
@@ -29,5 +30,5 @@
 </view>
 
 <view class="footerNav ju-c flex">
-    <view class="btn btn-sky" bindtap="pay">支付{{price>0?price:pageinfo.price}}元</view>
+    <view class="btn btn-sky" bindtap="pay">支付{{price>0?tofix.toFix(price):tofix.toFix(pageinfo.price)}}元</view>
 </view>