Commit 2ca60968 by 梁建民

js

parent 5c123ccf
......@@ -48,10 +48,16 @@ const actions = {
loginCheck({commit}, payload) {
Services.loginCheck().then((res) => {
let data = res.data;
commit({
type: 'loginCheck',
data: data
});
if (payload.is_jump) {
if(data.err_code == 11010){
window.location.href='/h5/view/'
}
} else {
commit({
type: 'loginCheck',
data: data
});
}
}).catch(function (err) {
console.log('网络出现问题,请重试');
});
......@@ -62,7 +68,7 @@ const actions = {
searchModel: ''
}
Services.customsrService(params).then((res) => {
}).catch(function (err) {
console.log('网络出现问题,请重试');
});
......
......@@ -8,7 +8,7 @@
<p class="text-2 lineBlock"><span class="text-3">{{walletInfoData.wallet_balance}}</span></p>
<p class="text-4 lineBlock"><a href="/v3/help">常见问题 ></a></p>
</div>
<div class="balance-handle">
<div class="balance-handle">
<span class="withdraw" :class="walletInfoData.wallet_status !== 1 ? 'gray' : ''" @click="withdraw">提现</span>
<span v-if="walletInfoData.wallet_status == 1" class="recharge" @click="recharge">充值</span>
<span v-else class="recharge activate" @click="activate">激活</span>
......@@ -39,55 +39,57 @@
</template>
<script>
import Vue from 'vue';
import {mapState} from 'vuex'
import Header from '@/views/common/Header.vue';
import { Popup } from 'vant';
import Vue from 'vue';
import {mapState} from 'vuex'
import Header from '@/views/common/Header.vue';
import {Popup} from 'vant';
Vue.use(Popup);
Vue.use(Popup);
export default {
name: 'wallet',
data() {
return {
title: "我的钱包",
meaushow: true
}
},
computed: {
...mapState({
walletInfoData: state => state.wallet.walletInfoData
})
},
watch: {
// $route(to,from){
// this.$store.dispatch({
// type: 'getWalletInfo',
// })
// }
},
created() {
this.$store.dispatch({
type: 'getWalletInfo'
})
},
methods: {
withdraw(){
if(this.walletInfoData.wallet_status == 1){ //钱包状态:1启用,-1未启用,-2锁定
this.$router.push({path: '/wallet/withdraw'});
}
},
activate(){
this.$router.push({path: '/wallet/activate'});
},
recharge(){
this.$router.push({path: '/wallet/recharge'});
}
},
components: {
Header
export default {
name: 'wallet',
data() {
return {
title: "我的钱包",
meaushow: true
}
},
beforeRouteEnter(to, from, next) {
next(vm => {
vm.$store.dispatch({
type: 'loginCheck',
is_jump: true
});
})
},
computed: {
...mapState({
walletInfoData: state => state.wallet.walletInfoData
})
},
created() {
this.$store.dispatch({
type: 'getWalletInfo'
})
},
methods: {
withdraw() {
if (this.walletInfoData.wallet_status == 1) {
//钱包状态:1启用,-1未启用,-2锁定
this.$router.push({path: '/wallet/withdraw'});
}
},
activate() {
this.$router.push({path: '/wallet/activate'});
},
recharge() {
this.$router.push({path: '/wallet/recharge'});
}
},
components: {
Header
}
}
</script>
<style scoped>
......
......@@ -33,73 +33,74 @@
</template>
<script>
import Vue from 'vue';
import {mapState} from 'vuex'
import Header from '@/views/common/Header.vue';
import {RadioGroup, Radio, Cell, CellGroup} from 'vant';
import { productionUrlApi } from '../../api/index'
console.log(productionUrlApi)
import Vue from 'vue';
import {mapState} from 'vuex'
import Header from '@/views/common/Header.vue';
import {RadioGroup, Radio, Cell, CellGroup} from 'vant';
import {productionUrlApi} from '../../api/index'
Vue.use(RadioGroup).use(Radio).use(Cell).use(CellGroup);
console.log(productionUrlApi)
export default {
name: 'WalletRecharge',
data() {
return {
title: "钱包充值",
meaushow: true,
inputNum: this.$route.query.amount || '',
radio: '1'
}
},
computed: {
...mapState({
walletInfoData: state => state.wallet.walletInfoData,
amountRechargeID: state => state.wallet.amountRechargeID
})
},
watch: {
amountRechargeID(value) {
if(value){
if (this.radio == 1) { //微信支付
this.$store.dispatch({
type: 'payTodo',
pay_code: 'wxpay',
rescue: 1,
types: 1,
site_type: 2,
order_id: value
});
}else if (this.radio == 2) { //支付宝支付
window.location.href = productionUrlApi + "pay/todo?pay_code=alipay&rescue=1&types=1&site_type=2&order_id="+value;
}else if (this.radio == 3) { //中国银联
window.location.href = productionUrlApi + "pay/todo?pay_code=unionpay&rescue=1&types=1&pay_mode=2&order_id="+value;
}
}
}
},
created() {
Vue.use(RadioGroup).use(Radio).use(Cell).use(CellGroup);
export default {
name: 'WalletRecharge',
data() {
return {
title: "钱包充值",
meaushow: true,
inputNum: this.$route.query.amount || '',
radio: '1'
}
},
computed: {
...mapState({
walletInfoData: state => state.wallet.walletInfoData,
amountRechargeID: state => state.wallet.amountRechargeID
})
},
watch: {
amountRechargeID(value) {
if (value) {
if (this.radio == 1) { //微信支付
this.$store.dispatch({
type: 'getWalletInfo'
});
},
methods: {
recharge() { //充值
if(this.inputNum !== ''){
console.log(this.radio)
type: 'payTodo',
pay_code: 'wxpay',
rescue: 1,
types: 1,
site_type: 2,
order_id: value
});
} else if (this.radio == 2) { //支付宝支付
window.location.href = productionUrlApi + "pay/todo?pay_code=alipay&rescue=1&types=1&site_type=2&order_id=" + value;
} else if (this.radio == 3) { //中国银联
window.location.href = productionUrlApi + "pay/todo?pay_code=unionpay&rescue=1&types=1&pay_mode=2&order_id=" + value;
}
}
}
},
created() {
this.$store.dispatch({
type: 'getWalletInfo'
});
},
methods: {
recharge() { //充值
if (this.inputNum !== '') {
console.log(this.radio)
//充值申请
this.$store.dispatch({
type: 'walletRecharge',
amount: this.inputNum
});
}
}
},
components: {
Header
//充值申请
this.$store.dispatch({
type: 'walletRecharge',
amount: this.inputNum
});
}
}
},
components: {
Header
}
}
</script>
<style scoped>
......
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