|
@@ -27,6 +27,16 @@
|
|
|
<van-col :span="24">查看消费记录和充值记录</van-col>
|
|
|
</van-row>
|
|
|
</van-row>
|
|
|
+
|
|
|
+ <van-loading
|
|
|
+ size="24px"
|
|
|
+ v-if="loading"
|
|
|
+ color="#fff"
|
|
|
+ vertical
|
|
|
+ style="z-index: 999999; position: fixed; top: 40%; left: 0; right: 0"
|
|
|
+ >加载中...</van-loading
|
|
|
+ >
|
|
|
+ <van-overlay :show="loading" style="z-index: 100; position: fixed" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -38,22 +48,46 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
user:undefined,
|
|
|
- type:undefined
|
|
|
+ type:undefined,
|
|
|
+ loading: false,
|
|
|
};
|
|
|
},
|
|
|
created(){
|
|
|
- localStorage.removeItem('type');
|
|
|
- localStorage.removeItem('user');
|
|
|
var url = window.location.href;
|
|
|
if(url.indexOf("token") > 1){
|
|
|
//("app进入")
|
|
|
if(this.getQueryVariable("token")){
|
|
|
- axios({//查询信息
|
|
|
+ if(localStorage.getItem("user")){
|
|
|
+
|
|
|
+ }else{
|
|
|
+ this.loading = true
|
|
|
+ }
|
|
|
+ this.userQuery()
|
|
|
+ }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进入")
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ //用户查询
|
|
|
+ userQuery(){
|
|
|
+ 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){
|
|
@@ -62,33 +96,20 @@ export default {
|
|
|
}else{
|
|
|
this.userNoAlert()
|
|
|
}
|
|
|
+ this.loading = false
|
|
|
})
|
|
|
}else if(res.data?.data?.cardId){
|
|
|
+ this.loading = false
|
|
|
Toast("用户卡号未绑定")
|
|
|
}else{
|
|
|
+ this.loading = false
|
|
|
this.userNoAlert()
|
|
|
}
|
|
|
}).catch(err =>{
|
|
|
+ this.loading = false
|
|
|
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进入")
|
|
|
- }
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- },
|
|
|
- methods: {
|
|
|
+ },
|
|
|
userNoAlert(){
|
|
|
Toast("当前账户初始流程中,请耐心等待或联系管理人员查询")
|
|
|
},
|
|
@@ -122,18 +143,25 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
balance(){
|
|
|
- if(localStorage.getItem("user")){
|
|
|
- this.$router.push({ path: "/balance"})
|
|
|
- }else{
|
|
|
- this.userNoAlert()
|
|
|
+ var url = window.location.href;
|
|
|
+ if(url.indexOf("token") >1){
|
|
|
+ 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()
|
|
|
+ var url = window.location.href;
|
|
|
+ if(url.indexOf("token") >1){
|
|
|
+ if(localStorage.getItem("user")){
|
|
|
+ this.$router.push({ path: "/record"})
|
|
|
+ }else{
|
|
|
+ this.userNoAlert()
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
};
|