lhl 3 роки тому
батько
коміт
1799de910e
2 змінених файлів з 22 додано та 5 видалено
  1. 9 1
      api/wallet.js
  2. 13 4
      pages/wallet/recharge.vue

+ 9 - 1
api/wallet.js

@@ -103,7 +103,15 @@ export function setBankInfo(data) {
 		data
 	});
 }
-
+
+// 获取充值金额列表
+export function getRechargeList(data) {
+	return request({
+		url: '/api/recharge/index',
+		method: 'get',
+		data
+	});
+}
 
 
 

+ 13 - 4
pages/wallet/recharge.vue

@@ -71,7 +71,7 @@
 import uniPopup from '@/components/uni-popup/uni-popup.vue';
 import { verification } from '@/api/merchant.js';
 import { getMoneyStyle } from '@/utils/rocessor.js';
-import { rechargeWechat } from '@/api/wallet.js';
+import { rechargeWechat, getRechargeList } from '@/api/wallet.js';
 import { mapState, mapMutations} from 'vuex';
 import { getUserInfo } from '@/api/login.js';
 export default {
@@ -83,7 +83,7 @@ export default {
 	},
 	data() {
 		return {
-			moneyList: [300, 200, 150, 100, 50],
+			moneyList: [],
 			choose: -1,
 			// #ifdef APP-PLUS
 			type: 'weixinapp',
@@ -108,7 +108,8 @@ export default {
 	onLoad(options) {
 		// #ifdef H5
 		this.weichatBsrowser = uni.getStorageSync('weichatBrowser');
-		// #endif
+		// #endif
+		this.getRechargeList()
 	},
 	computed: {
 		...mapMutations('user', ['setUserInfo', 'setOrderInfo']),
@@ -116,7 +117,15 @@ export default {
 		...mapState(['weichatObj'])
 		// #endif
 	},
-	methods: {
+	methods: {
+		getRechargeList() {
+			getRechargeList().then(({data}) => {
+				console.log(data,'getRechargeList')
+				data.recharge_quota.forEach(item => {
+					this.moneyList.push(item.price*1)
+				})
+			})
+		},
 		// 跳转
 		navTo(url) {
 			uni.navigateTo({