From e0143ad80f9c78ac1eb1bd06782567ebffb67b8f Mon Sep 17 00:00:00 2001
From: zuoxiao <470321431@qq.com>
Date: 星期一, 04 十一月 2024 10:28:25 +0800
Subject: [PATCH] 充值金额从后台获取
---
pages/rechargeMoney/rechargMoney.js | 22 +++++++++++++++++++++-
pages/rechargeMoney/rechargMoney.wxml | 12 ++++++------
2 files changed, 27 insertions(+), 7 deletions(-)
diff --git a/pages/rechargeMoney/rechargMoney.js b/pages/rechargeMoney/rechargMoney.js
index 873f665..497a378 100644
--- a/pages/rechargeMoney/rechargMoney.js
+++ b/pages/rechargeMoney/rechargMoney.js
@@ -23,6 +23,7 @@
pageSize: 20, //鍏呭�艰褰曟瘡椤佃褰曟暟
loading: false, //鏄惁姝e湪鍔犺浇
hasMore: true,
+ moneyList:[]//鍏呭�奸噾棰�
},
/**
@@ -103,7 +104,7 @@
const data = {
sessionId: getApp().globalData.sessionId,
vcId: this.data.vcId, //铏氭嫙鍗D
- rechargeAmount: 1 //锛堝崟浣嶆槸鍒嗭級
+ rechargeAmount: this.data.moneyList[this.data.activeIndex]//锛堝崟浣嶆槸鍒嗭級
};
console.log("postCloseValaue" + data);
post({
@@ -210,5 +211,24 @@
this.setData({
allRechargeList: updatedList
});
+ },
+ //鑾峰彇閲戦
+ getMorneyList(){
+ const params = {
+ url: 'wx/virtual_card/gerRechargeProfiles'
+ };
+ get(params).then(data => {
+ this.setData({
+ moneyList: data.content ,
+ })
+ this.updateDisplayText();
+ }).catch(err => {
+ // 閿欒鍥炶皟
+ wx.showToast({
+ title: err.msg,
+ icon: 'error',
+ duration: 3000
+ })
+ });
}
})
\ No newline at end of file
diff --git a/pages/rechargeMoney/rechargMoney.wxml b/pages/rechargeMoney/rechargMoney.wxml
index 413765b..b260854 100644
--- a/pages/rechargeMoney/rechargMoney.wxml
+++ b/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">100</text>
+ <text class="money-number">{{moneyList[0].rechargeAmount}}</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">200</text>
+ <text class="money-number">{{moneyList[1].rechargeAmount}}</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">300</text>
+ <text class="money-number">{{moneyList[2].rechargeAmount}}</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">400</text>
+ <text class="money-number">{{moneyList[3].rechargeAmount}}</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">500</text>
+ <text class="money-number">{{moneyList[4].rechargeAmount}}</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">600</text>
+ <text class="money-number">{{moneyList[5].rechargeAmount}}</text>
<text class="money-label">鍏�</text>
</view>
</view>
--
Gitblit v1.8.0