沙盘演示系统应用的微信小程序
zuoxiao
2024-11-04 578e51b21621b2f2426721ee91e8be33eff41cac
将返回的充值金额转换成元
2个文件已修改
24 ■■■■■ 已修改文件
pages/rechargeMoney/rechargMoney.js 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/rechargeMoney/rechargMoney.wxml 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/rechargeMoney/rechargMoney.js
@@ -219,10 +219,16 @@
      url: 'wx/virtual_card/gerRechargeProfiles'
    };
    get(params).then(data => {
      this.setData({
        moneyList:  data.content ,
      const updatedList=   data.content.map(item=>{
        let money=item.rechargeAmount/100;
        return {
          ...item,
          money
        };
      })
      this.updateDisplayText();
      this.setData({
        moneyList: updatedList ,
      })
    }).catch(err => {
      // 错误回调
      wx.showToast({
pages/rechargeMoney/rechargMoney.wxml
@@ -17,19 +17,19 @@
    <view class="row">
      <view class="item{{activeIndex === 0 ? 'active' : ''}}" bindtap="handleMoneyWrapperTap" data-index="0">
        <view class="money-wrapper">
          <text class="money-number">{{moneyList[0].rechargeAmount}}</text>
          <text class="money-number">{{moneyList[0].money}}</text>
          <text class="money-label">元</text>
        </view>
      </view>
      <view class="item{{activeIndex === 1 ? 'active' : ''}}" bindtap="handleMoneyWrapperTap" data-index="1">
        <view class="money-wrapper">
          <text class="money-number">{{moneyList[1].rechargeAmount}}</text>
          <text class="money-number">{{moneyList[1].money}}</text>
          <text class="money-label">元</text>
        </view>
      </view>
      <view class="item{{activeIndex === 2 ? 'active' : ''}}" bindtap="handleMoneyWrapperTap" data-index="2">
        <view class="money-wrapper">
          <text class="money-number">{{moneyList[2].rechargeAmount}}</text>
          <text class="money-number">{{moneyList[2].money}}</text>
          <text class="money-label">元</text>
        </view>
      </view>
@@ -37,19 +37,19 @@
    <view class="row">
      <view class="item{{activeIndex === 3 ? 'active' : ''}}" bindtap="handleMoneyWrapperTap" data-index="3">
        <view class="money-wrapper">
          <text class="money-number">{{moneyList[3].rechargeAmount}}</text>
          <text class="money-number">{{moneyList[3].money}}</text>
          <text class="money-label">元</text>
        </view>
      </view>
      <view class="item{{activeIndex === 4 ? 'active' : ''}}" bindtap="handleMoneyWrapperTap" data-index="4">
        <view class="money-wrapper">
          <text class="money-number">{{moneyList[4].rechargeAmount}}</text>
          <text class="money-number">{{moneyList[4].money}}</text>
          <text class="money-label">元</text>
        </view>
      </view>
      <view class="item{{activeIndex === 5 ? 'active' : ''}}" bindtap="handleMoneyWrapperTap" data-index="5">
        <view class="money-wrapper">
          <text class="money-number">{{moneyList[5].rechargeAmount}}</text>
          <text class="money-number">{{moneyList[5].money}}</text>
          <text class="money-label">元</text>
        </view>
      </view>