creditCertification.vue
5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<template>
<v-layout id="CreditCertification" column justify-center align-center>
<v-flex>
<v-list class="listBlock" two-line>
<v-list-tile avatar >
<v-list-tile-avatar>
<v-icon class="avatarBlcok" color="blue">perm_identity</v-icon>
</v-list-tile-avatar>
<v-list-tile-content>
<v-list-tile-title>基础信息</v-list-tile-title>
<v-list-tile-sub-title>{{status.base.status}}{{status.base.status === '未填写' ? '' : `(${status.base.time})`}}</v-list-tile-sub-title>
</v-list-tile-content>
<v-list-tile-action>
<v-btn :class="status.base.status === '未填写' ? 'addBtn' : 'refreshBtn'" to="/basicInfo" >
{{status.base.status === '未填写' ? '填写' : '更新'}}
<v-icon right dark>{{status.base.status === '未填写' ? 'add' : 'autorenew'}}</v-icon>
</v-btn>
</v-list-tile-action>
</v-list-tile>
<v-divider></v-divider>
<v-list-tile avatar >
<v-list-tile-avatar>
<v-icon class="avatarBlcok" color="green">smartphone</v-icon>
</v-list-tile-avatar>
<v-list-tile-content>
<v-list-tile-title>运营商信息</v-list-tile-title>
<v-list-tile-sub-title>{{status.mobile.status}}{{status.mobile.status === '未采集' ? '' : `(${status.mobile.time})`}}</v-list-tile-sub-title>
</v-list-tile-content>
<v-list-tile-action>
<v-btn :class="status.mobile.status === '未采集' ? 'addBtn' : 'refreshBtn'" @click.native="toMobileGet">
{{status.mobile.status === '未采集' ? '填写' : '更新'}}
<v-icon right dark>{{status.mobile.status === '未采集' ? 'add' : 'autorenew'}}</v-icon>
</v-btn>
</v-list-tile-action>
</v-list-tile>
<v-divider></v-divider>
</v-list>
</v-flex>
<v-dialog v-model="dialogDisplay" persistent max-width="290">
<v-card class="hintDialog">
<v-card-title class="headline">提示</v-card-title>
<v-card-text class='dialogContent'>您还没有完成基础信息及运营商信息的提交,系统暂时无法生成您的信用报告</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="black" flat @click.native="dialogDisplay = false">知道了</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-card id="ConfirmBlock" >
<div class="targetConfirm">
<v-btn depressed class="btn-deep" @click="toReportPage">查看报告</v-btn>
</div>
</v-card>
<div id="FuckIphoneX"></div>
</v-layout>
</template>
<script>
import {wechatShareSetting} from '@/helper'
export default {
async asyncData({store, query, app, redirect}) {
let {data} = await app.$axios.get(`/credit/getStatus?userId=${store.state.user.id}`)
if (data.success) {
return {status: data.status}
} else {
store.dispatch('displayMessage', data.msg)
redirect(301, '/userCenter')
}
},
data:() => ({
dialogDisplay: false,
}),
beforeRouteLeave (to, from, next) {
if (to.name === "creditCertificationSuccess") {
next('/')
} else {
next()
}
},
head:() => ({
title: '信用认证'
}),
mounted() {
wechatShareSetting(this.$axios, this.$store)
},
methods: {
toMobileGet() {
if (this.status.base.status === '未填写') {
this.$router.push('/basicInfo?next=mobile')
} else {
window.location.replace('https://open.shujumohe.com/box/yys?box_token=65FF254FF4F4490BA633412666F07FFB&cb=https://www.51liuliang.cc/netiou/iou')
}
},
toReportPage() {
// if (this.status.mobile.status === '未采集' || this.status.base.status === '未填写') {
// this.dialogDisplay = true
// } else {
this.$router.push('/userRecord')
// }
}
}
}
</script>
<style lang="scss" scoped>
#CreditCertification {
.listBlock {
width: 100vw;
padding: 0;
.avatarBlcok {
background-color: #fff;
}
.addBtn {
background-color: #4CAF50;
}
.refreshBtn {
background-color: #2196F3;
}
}
#FuckIphoneX {
position: fixed;
bottom: 0;
width: 100%;
height: constant(safe-area-inset-bottom);
height: env(safe-area-inset-bottom);
background-color: #39424a;
}
#ConfirmBlock {
width: 100vw;
border-top: 1px solid #979797;
background-color: $toolbar-grey;
position: fixed;
bottom: 0;
text-align: right;
margin-bottom: constant(safe-area-inset-bottom);
margin-bottom: env(safe-area-inset-bottom);
button {
height: 2.5rem;
}
.btn-light {
background-color: $toolbar-grey;
color: $light-gold;
border: 1px solid $light-gold;
}
.btn-deep {
background-image: linear-gradient(-229deg, #DAB269 37%, #E7C78C 87%);
color: $toolbar-grey;
}
}
}
</style>