|
@@ -42,7 +42,6 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import {mapState, mapActions} from 'vuex'
|
|
|
import {Group, Cell} from 'vux'
|
|
|
import axios from 'axios'
|
|
|
import qs from 'qs'
|
|
@@ -52,7 +51,7 @@
|
|
|
return {
|
|
|
isActive: false,
|
|
|
isShow: -1,
|
|
|
- rechargeLists: this.$store.state.recharge.rechargeList,
|
|
|
+ rechargeLists: [],
|
|
|
rechargeItem: {},
|
|
|
otherAmount: ''
|
|
|
}
|
|
@@ -60,12 +59,12 @@
|
|
|
components: {
|
|
|
Group, Cell
|
|
|
},
|
|
|
- computed: {
|
|
|
- ...mapState({
|
|
|
- rechargeList: state => state.rechargeList
|
|
|
- })
|
|
|
- },
|
|
|
+ computed: {},
|
|
|
beforeCreate () {
|
|
|
+ // 获取充值卡列表
|
|
|
+ axios.get('o2o/recharge/rechargeList').then(res => {
|
|
|
+ this.rechargeLists = res.data.data
|
|
|
+ })
|
|
|
},
|
|
|
created () {
|
|
|
// console.log(this.rechargeLists)
|
|
@@ -89,9 +88,6 @@
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- ...mapActions([
|
|
|
- 'RECHARGELIST'
|
|
|
- ]),
|
|
|
btnRechargeList (item, index) {
|
|
|
if (index !== 4) {
|
|
|
this.otherAmount = ''
|
|
@@ -130,18 +126,15 @@
|
|
|
}
|
|
|
let payRecharge = {}
|
|
|
axios.post('o2o/recharge/addRechargeorder', qs.stringify(addRechargeOrder)).then(res => {
|
|
|
- console.log(res.data.success)
|
|
|
if (res.data.success) {
|
|
|
- this.$router.push({path: '/pay'})
|
|
|
+ payRecharge = {
|
|
|
+ user_id: res.data.data.user.$id,
|
|
|
+ pay_channel: 'wx_pub',
|
|
|
+ order_id: res.data.data._id.$id
|
|
|
+ }
|
|
|
+ this.$router.push({path: '/pay', query: {payRecharge: payRecharge}})
|
|
|
}
|
|
|
- payRecharge = {
|
|
|
- user_id: config.userId,
|
|
|
- pay_channel: 'wx_pub',
|
|
|
- order_id: res.data.data._id.$id
|
|
|
- }
|
|
|
- console.log(payRecharge)
|
|
|
})
|
|
|
-
|
|
|
// axios 1.创建充值卡订单 user_id: user.id, value:inputVal,
|
|
|
// 第二步
|
|
|
},
|