|
@@ -5,21 +5,21 @@
|
|
|
一卡通
|
|
|
</van-row>
|
|
|
<van-row class="contentBox">
|
|
|
- <van-row @click="$router.push('/balance')" v-if="user">
|
|
|
+ <van-row @click="balance" v-if="user">
|
|
|
<van-image
|
|
|
:src="require('../../assets/image/balance.png')"
|
|
|
/>
|
|
|
<van-col :span="24">账户余额</van-col>
|
|
|
<van-col :span="24">个人账户余额信息</van-col>
|
|
|
</van-row>
|
|
|
- <van-row @click="$router.push('/amount')">
|
|
|
+ <van-row @click="amount">
|
|
|
<van-image
|
|
|
:src="require('../../assets/image/recharge.png')"
|
|
|
/>
|
|
|
<van-col :span="24">充值</van-col>
|
|
|
<van-col :span="24">对余额进行充值</van-col>
|
|
|
</van-row>
|
|
|
- <van-row @click="$router.push('/record')" v-if="user">
|
|
|
+ <van-row @click="record" v-if="user">
|
|
|
<van-image
|
|
|
:src="require('../../assets/image/record.png')"
|
|
|
/>
|
|
@@ -33,6 +33,7 @@
|
|
|
<script>
|
|
|
import axios from "axios";
|
|
|
import { getNowTime } from "@/assets/js/dataFormate";
|
|
|
+import { Toast } from "vant";
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -41,60 +42,58 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
created(){
|
|
|
+ localStorage.removeItem('type');
|
|
|
+ localStorage.removeItem('user');
|
|
|
var url = window.location.href;
|
|
|
- if(this.getQueryVariable("token") || url.indexOf("token") >1 ){
|
|
|
+ if(url.indexOf("token") >1){
|
|
|
console.log("app进入")
|
|
|
- this.user = "0001T11000000000V6UQ"
|
|
|
- localStorage.removeItem('type');
|
|
|
- // localStorage.removeItem('user');
|
|
|
- // axios({
|
|
|
- // method: 'get',
|
|
|
- // url: 'https://smartpark.caih.com/zkxt/api/thirdparty/v1/user/getZkUserByCipher?cipher=' + "10C5E9787553EBB4962F5299B2C051B4A15F3010563E8B1604213F174397786CA49117EB5658C1965210DDFF56F5E730424B786B2670D78C6EB27DDE9EC42F6376519441B0D1B9FCF70BE7DF9D9813E49C5C8919F7F931CEFCD4BF440CEE3C412ADE7F7C2933FDB7FFBF21D7ECAEE3238C93248038AC77CBE50BB91DA9EB00C4ACCDA4D8F1951F5922F5338BEDEDE723",
|
|
|
- // timeout: 10000,
|
|
|
- // }).then(res =>{
|
|
|
-
|
|
|
- // localStorage.setItem("user", "0001T11000000000V6UQ")
|
|
|
- // if(!localStorage.getItem("balance")){
|
|
|
- // this.cardBalance()
|
|
|
- // }
|
|
|
- // }).catch(err =>{
|
|
|
- // console.log(err)
|
|
|
- // });
|
|
|
- localStorage.setItem("user", "0001T11000000000V6UQ")
|
|
|
- if(!localStorage.getItem("balance")){
|
|
|
- this.cardBalance()
|
|
|
- }
|
|
|
-
|
|
|
+ // this.getQueryVariable("token") = "0001T11000000001QZAE"
|
|
|
+ // if(this.getQueryVariable("token")){
|
|
|
+ // axios({//查询信息
|
|
|
+ // method: 'get',
|
|
|
+ // url: 'https://smartpark.caih.com/zkxt/api/thirdparty/v1/user/getZkUserByCipher?cipher=' + this.getQueryVariable("token"),
|
|
|
+ // timeout: 10000,
|
|
|
+ // }).then(res =>{
|
|
|
+ // if(res.data?.data?.id){
|
|
|
+ // axios.get(`/dxtop/staff/one?id=${res.data.data.id}`).then(res2 => { //验证充值信息是否同步
|
|
|
+ // if(res2.data.data){
|
|
|
+ this.user = "0001T11000000001QZAE"
|
|
|
+ localStorage.setItem("user", this.user)
|
|
|
+ // }else{
|
|
|
+ // this.userNoAlert()
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // }else if(res.data?.data?.cardId){
|
|
|
+ // Toast("用户卡号未绑定")
|
|
|
+ // }else{
|
|
|
+ // this.userNoAlert()
|
|
|
+ // }
|
|
|
+ // }).catch(err =>{
|
|
|
+ // this.userNoAlert()
|
|
|
+ // });
|
|
|
+ // }else{
|
|
|
+ // console.log("app进入")
|
|
|
+ // Toast(this.getQueryVariable("无token传入!"))
|
|
|
+ // }
|
|
|
}else if(this.getQueryVariable("type")){
|
|
|
console.log("扫码游客进入")
|
|
|
localStorage.removeItem('type');
|
|
|
localStorage.removeItem('user');
|
|
|
localStorage.setItem("type",this.type)
|
|
|
}else{
|
|
|
- // localStorage.removeItem('user');
|
|
|
- // localStorage.removeItem('type');
|
|
|
- // console.log("无user、type进入")
|
|
|
-
|
|
|
- console.log("app进入")
|
|
|
- localStorage.removeItem('type');
|
|
|
-
|
|
|
localStorage.removeItem('user');
|
|
|
- localStorage.setItem("user", "0001T11000000000V6UQ")
|
|
|
- this.user = "0001T11000000000V6UQ"
|
|
|
- if(!localStorage.getItem("balance")){
|
|
|
- this.cardBalance()
|
|
|
- }
|
|
|
-
|
|
|
+ localStorage.removeItem('type');
|
|
|
+ console.log("无user、type进入")
|
|
|
}
|
|
|
- // localStorage.setItem("user", "0001T11000000000V6UQ")
|
|
|
-
|
|
|
-
|
|
|
},
|
|
|
mounted() {
|
|
|
},
|
|
|
methods: {
|
|
|
- cardBalance(){
|
|
|
- axios.get('/dxtop/staff/one?id=0001T11000000000V6UQ').then(res => {
|
|
|
+ userNoAlert(){
|
|
|
+ Toast("当前账户初始流程中,请耐心等待或联系管理人员查询")
|
|
|
+ },
|
|
|
+ cardBalance(){ //余额
|
|
|
+ axios.get(`/dxtop/staff/one?id=${localStorage.getItem("user")}`).then(res => {
|
|
|
axios.get(`/dxtop/staff/cardBalance`,{params:{"card":res.data.data.cardId}}).then(res2 => { //res.data.data.cardId
|
|
|
let msgFlag =undefined
|
|
|
axios.get(`/dxtop/msglog/one`,{params:{"id":res2.data.msg}}).then(res3 => {//res.msg
|
|
@@ -129,7 +128,7 @@ export default {
|
|
|
Toast("用户未录入充值系统")
|
|
|
})
|
|
|
},
|
|
|
- getQueryVariable(variable){
|
|
|
+ getQueryVariable(variable){//参数获取
|
|
|
//window.location.search.substring(1);
|
|
|
var query = window.location.hash.substring(3);
|
|
|
var vars = query.split("&");
|
|
@@ -146,6 +145,32 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
return(false);
|
|
|
+ },
|
|
|
+ amount(){
|
|
|
+ var url = window.location.href;
|
|
|
+ if(url.indexOf("token") >1){
|
|
|
+ if(localStorage.getItem("user")){
|
|
|
+ this.$router.push({ path: "/amount"})
|
|
|
+ }else{
|
|
|
+ this.userNoAlert()
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ this.$router.push({ path: "/amount"})
|
|
|
+ }
|
|
|
+ },
|
|
|
+ balance(){
|
|
|
+ if(localStorage.getItem("user")){
|
|
|
+ this.$router.push({ path: "/balance"})
|
|
|
+ }else{
|
|
|
+ this.userNoAlert()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ record(){
|
|
|
+ if(localStorage.getItem("user")){
|
|
|
+ this.$router.push({ path: "/record"})
|
|
|
+ }else{
|
|
|
+ this.userNoAlert()
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
};
|