|
@@ -14,7 +14,7 @@
|
|
|
<view class="xian"></view>
|
|
|
<view class="moneyBtn-box">
|
|
|
<view class="moneyBtn" v-for="(item, index) in moneyList" :class="{ current: choose == index }"
|
|
|
- :key="index" @click="changemoney(item.price, index,item.id)">{{ item.price }}元</view>
|
|
|
+ :key="index" @click="changemoney(item, index,item.id)">{{ item*1 }}元</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
@@ -56,6 +56,7 @@
|
|
|
} from '@/utils/rocessor.js';
|
|
|
import {
|
|
|
rechargeWechat,
|
|
|
+ getRechargePrice
|
|
|
} from '@/api/wallet.js';
|
|
|
import {
|
|
|
mapState,
|
|
@@ -73,17 +74,7 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- moneyList: [{
|
|
|
- price: '300'
|
|
|
- }, {
|
|
|
- price: '200'
|
|
|
- }, {
|
|
|
- price: '150'
|
|
|
- }, {
|
|
|
- price: '100'
|
|
|
- }, {
|
|
|
- price: '50'
|
|
|
- }],
|
|
|
+ moneyList: [],
|
|
|
choose: -1,
|
|
|
// #ifdef APP-PLUS
|
|
|
type: 'weixinapp',
|
|
@@ -110,6 +101,7 @@
|
|
|
// #ifdef H5
|
|
|
this.weichatBsrowser = uni.getStorageSync('weichatBrowser');
|
|
|
// #endif
|
|
|
+ this.loadData()
|
|
|
},
|
|
|
computed: {
|
|
|
|
|
@@ -130,6 +122,14 @@
|
|
|
tabRadio(e) {
|
|
|
this.type = e;
|
|
|
},
|
|
|
+ loadData() {
|
|
|
+ getRechargePrice().then(({
|
|
|
+ data
|
|
|
+ }) => {
|
|
|
+ console.log(data);
|
|
|
+ this.moneyList = data
|
|
|
+ })
|
|
|
+ },
|
|
|
// 提交
|
|
|
confirm() {
|
|
|
let obj = this;
|
|
@@ -232,36 +232,9 @@
|
|
|
})
|
|
|
this.$refs.popup.close();
|
|
|
},
|
|
|
- //获取订单列表
|
|
|
- loadData(source) {
|
|
|
- console.log(source);
|
|
|
- //这里是将订单挂载到tab列表下
|
|
|
- let index = this.tabCurrentIndex;
|
|
|
- let navItem = this.navList[index];
|
|
|
- let state = navItem.state;
|
|
|
- if (source === 'tabChange' && navItem.loaded === true) {
|
|
|
- //tab切换只有第一次需要加载数据
|
|
|
- return;
|
|
|
- }
|
|
|
- if (navItem.loadingType === 'loading') {
|
|
|
- //防止重复加载
|
|
|
- return;
|
|
|
- }
|
|
|
- navItem.loadingType = 'loading';
|
|
|
- setTimeout(() => {
|
|
|
- let orderList = [];
|
|
|
- orderList.forEach(item => {
|
|
|
- navItem.orderList.push(item);
|
|
|
- });
|
|
|
- //loaded新字段用于表示数据加载完毕,如果为空可以显示空白页
|
|
|
- this.$set(navItem, 'loaded', true);
|
|
|
- //判断是否还有数据, 有改为 more, 没有改为noMore
|
|
|
- navItem.loadingType = 'more';
|
|
|
- }, 600);
|
|
|
- },
|
|
|
changemoney(item, index, id) {
|
|
|
this.choose = index;
|
|
|
- this.money = item;
|
|
|
+ this.money = item * 1;
|
|
|
this.chooseId = id
|
|
|
}
|
|
|
}
|