Commit 2ca60968 by 梁建民

js

parent 5c123ccf
...@@ -48,10 +48,16 @@ const actions = { ...@@ -48,10 +48,16 @@ const actions = {
loginCheck({commit}, payload) { loginCheck({commit}, payload) {
Services.loginCheck().then((res) => { Services.loginCheck().then((res) => {
let data = res.data; let data = res.data;
if (payload.is_jump) {
if(data.err_code == 11010){
window.location.href='/h5/view/'
}
} else {
commit({ commit({
type: 'loginCheck', type: 'loginCheck',
data: data data: data
}); });
}
}).catch(function (err) { }).catch(function (err) {
console.log('网络出现问题,请重试'); console.log('网络出现问题,请重试');
}); });
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
import Vue from 'vue'; import Vue from 'vue';
import {mapState} from 'vuex' import {mapState} from 'vuex'
import Header from '@/views/common/Header.vue'; import Header from '@/views/common/Header.vue';
import { Popup } from 'vant'; import {Popup} from 'vant';
Vue.use(Popup); Vue.use(Popup);
...@@ -54,33 +54,35 @@ ...@@ -54,33 +54,35 @@
meaushow: true meaushow: true
} }
}, },
beforeRouteEnter(to, from, next) {
next(vm => {
vm.$store.dispatch({
type: 'loginCheck',
is_jump: true
});
})
},
computed: { computed: {
...mapState({ ...mapState({
walletInfoData: state => state.wallet.walletInfoData walletInfoData: state => state.wallet.walletInfoData
}) })
}, },
watch: {
// $route(to,from){
// this.$store.dispatch({
// type: 'getWalletInfo',
// })
// }
},
created() { created() {
this.$store.dispatch({ this.$store.dispatch({
type: 'getWalletInfo' type: 'getWalletInfo'
}) })
}, },
methods: { methods: {
withdraw(){ withdraw() {
if(this.walletInfoData.wallet_status == 1){ //钱包状态:1启用,-1未启用,-2锁定 if (this.walletInfoData.wallet_status == 1) {
//钱包状态:1启用,-1未启用,-2锁定
this.$router.push({path: '/wallet/withdraw'}); this.$router.push({path: '/wallet/withdraw'});
} }
}, },
activate(){ activate() {
this.$router.push({path: '/wallet/activate'}); this.$router.push({path: '/wallet/activate'});
}, },
recharge(){ recharge() {
this.$router.push({path: '/wallet/recharge'}); this.$router.push({path: '/wallet/recharge'});
} }
}, },
......
...@@ -37,7 +37,8 @@ ...@@ -37,7 +37,8 @@
import {mapState} from 'vuex' import {mapState} from 'vuex'
import Header from '@/views/common/Header.vue'; import Header from '@/views/common/Header.vue';
import {RadioGroup, Radio, Cell, CellGroup} from 'vant'; import {RadioGroup, Radio, Cell, CellGroup} from 'vant';
import { productionUrlApi } from '../../api/index' import {productionUrlApi} from '../../api/index'
console.log(productionUrlApi) console.log(productionUrlApi)
Vue.use(RadioGroup).use(Radio).use(Cell).use(CellGroup); Vue.use(RadioGroup).use(Radio).use(Cell).use(CellGroup);
...@@ -60,7 +61,7 @@ ...@@ -60,7 +61,7 @@
}, },
watch: { watch: {
amountRechargeID(value) { amountRechargeID(value) {
if(value){ if (value) {
if (this.radio == 1) { //微信支付 if (this.radio == 1) { //微信支付
this.$store.dispatch({ this.$store.dispatch({
type: 'payTodo', type: 'payTodo',
...@@ -70,10 +71,10 @@ ...@@ -70,10 +71,10 @@
site_type: 2, site_type: 2,
order_id: value order_id: value
}); });
}else if (this.radio == 2) { //支付宝支付 } else if (this.radio == 2) { //支付宝支付
window.location.href = productionUrlApi + "pay/todo?pay_code=alipay&rescue=1&types=1&site_type=2&order_id="+value; window.location.href = productionUrlApi + "pay/todo?pay_code=alipay&rescue=1&types=1&site_type=2&order_id=" + value;
}else if (this.radio == 3) { //中国银联 } else if (this.radio == 3) { //中国银联
window.location.href = productionUrlApi + "pay/todo?pay_code=unionpay&rescue=1&types=1&pay_mode=2&order_id="+value; window.location.href = productionUrlApi + "pay/todo?pay_code=unionpay&rescue=1&types=1&pay_mode=2&order_id=" + value;
} }
} }
} }
...@@ -85,7 +86,7 @@ ...@@ -85,7 +86,7 @@
}, },
methods: { methods: {
recharge() { //充值 recharge() { //充值
if(this.inputNum !== ''){ if (this.inputNum !== '') {
console.log(this.radio) console.log(this.radio)
//充值申请 //充值申请
......
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment