detail.vue
6.82 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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
<template>
<view class="mainbox">
<view class="topBg">
<view class="photobox">
<image class="photo" v-if="form.photo" :src="form.photo" mode='aspectFit'></image>
<view class="colorful" v-else>{{form.name?.slice(0,1)}}</view>
</view>
<view class="infoBox">
<view class="name">
{{form.name}}
</view>
<view class="flexbox">
<label>证件号:</label>
<text>{{ form.idcCode}}</text>
</view>
<view class="flexbox">
<label>会员编号:</label>
<text>{{ form.perCode}}</text>
</view>
<view class="flexbox">
<label>有效期:</label>
<text>{{ form.idcType==3?'--': form.validityDate?.slice(0,10)||'--' }}</text>
</view>
</view>
</view>
<!-- 会员证 -->
<view style="margin: 30rpx 0 0;" v-if="form.certStage!=0&&form.idcType!=3&&form.certStage!=2&&form.certStage!=1">
<view class="zhengBox">
<image v-if="form.certStage == 4" style="width: 600rpx; height: 380rpx;position: relative" :src="config.baseUrl_api+'/fs/static/icon/memberCardU.png'" :fit="fit" />
<image v-else style="width: 600rpx; height: 380rpx;position: relative" :src="config.baseUrl_api+'/fs/static/icon/memberCard.png'" :fit="fit" />
<view class="zhengbody" @contextmenu.prevent="youji">
<image mode="aspectFill" :src="(form.photo)" class="head"/>
<view class="memberNumber">{{ form.perCode }}</view>
<view class="birthday">{{ fileData(form.birth) }}</view>
<view class="phone">010-87188971</view>
<view class="service">https://www.taekwondo.org.cn/</view>
<view class="validity">{{ fileData(form.beginTime) +'-'+fileData(form.validityDate) }}</view>
<view class="nameC">
<view ref="content" class="content">{{ form.name }} </view>
</view>
</view>
</view>
</view>
<uni-list>
<uni-list-item title="姓名" :rightText="form.name" />
<uni-list-item title="证件类型" :rightText="cardType?.[form?.idcType]?.label" />
<uni-list-item title="证件号" :rightText="form.idcCode" />
<uni-list-item title="性别" :rightText="form.sex==0?'男':'女'" />
<uni-list-item title="会员编号" :rightText="form.perCode" />
<uni-list-item title="所属一级协会" :rightText="form.topAssName" />
<uni-list-item title="所属地区协会" :rightText="form.areaAssName" />
<uni-list-item title="注册团体会员" :rightText="form.memName" />
<uni-list-item title="缴费日期" :rightText="form.payDate||'--'" />
<uni-list-item title="出生日期" :rightText="form.birth?.slice(0,10)" />
<uni-list-item title="手机号码" :rightText="form.phone" />
<uni-list-item title="所在地区" :rightText="form.cityStr" />
<uni-list-item title="详细地址" :rightText="form.address||'--'" />
</uni-list>
</view>
<view class="height1"></view>
</template>
<script setup>
import * as api from '@/common/api.js'
import config from '@/config.js'
import {
onLoad,
onShow
} from '@dcloudio/uni-app';
import {
ref
} from 'vue'
const cardType = ref([{
label: '身份证',
value: '0'
},
{
label: '来往大陆(内地)通行证',
value: '1'
},
{
label: '中国护照',
value: '2'
},
{
label: '护照',
value: '3'
},
{
label: '其它',
value: '4'
}, {
label: '香港身份证',
value: '5'
}, {
label: '往来港澳台通行证',
value: '6'
}
])
const form = ref({})
const urlHref = ref()
onLoad((option) => {
console.log(option)
api.getInfo(option.perId).then(res => {
form.value = res.data
form.value.topAssName = form.value?.ancestorNameList?.[0]
form.value.areaAssName = form.value?.ancestorNameList?.[1]
form.value.memName = res.data.memName
if (form.value.cityId) {
getRegionsList(form.value.cityId)
}
if (form.value.photo && form.value.photo.indexOf('http') == -1) {
form.value.photo = config.baseUrl_api + form.value.photo
}
})
})
function getRegionsList(cityId) {
api.regionsList().then(res => {
for (var m of res.data) {
for (var n of m.children) {
for (var o of n.children) {
if (o.value == cityId) {
form.value.cityStr = m.text + n.text + o.text
}
}
}
}
})
}
function fileData(time) {
if (!time) return
const data = new Date(time.replace(/-/g, '/'))
const year = data.getFullYear()
const month = data.getMonth() + 1
const dates = data.getDate()
return year + '年' + month + '月' + dates + '日'
}
</script>
<style scoped lang="scss">
.flexbox {
width: 60%;
margin: 10rpx auto;
font-size: 28rpx;
align-items: center;
label {
color: #7b7f83;
width: 5em;
font-size: 24rpx;
}
}
.topBg {
background: #f5f5f5;
}
.infoBox {
padding: 1rpx 1rpx 30rpx;
.name {
font-size: 34rpx;
text-align: center;
}
}
.photobox {
position: relative;
padding: 30rpx 0 30rpx;
.photo {
width: 255rpx;
height: 318rpx;
background-color: #f4f4f4;
display: block;
margin: auto;
}
}
.height1 {
height: 1rpx
}
.mainbox {
margin: 30rpx 25rpx 60rpx;
box-shadow: 0 0 8rpx #ddd;
background: #FFFFFF;
border-radius: 15rpx;
:deep(.uni-list-item__content-title) {
color: #4C5359;
font-size: 30rpx;
font-weight: 300;
}
:deep(.uni-list-item__extra-text) {
color: #000;
font-size: 30rpx;
}
}
.colorful {
background-color: #007BDA;
width: 200rpx;
margin: auto;
height: 200rpx;
line-height: 200rpx;
font-size: 44rpx;
color: #fff;
text-align: center;
border-radius: 50%;
}
.zhengBox{
position: relative;width: 600rpx; height: 380rpx;margin:0 auto 30rpx;
.zhengbody{
.head{width: 114rpx;height: 114rpx;border-radius: 50%;position: absolute;left: 65rpx;top: 132rpx;}
.birthday{
position: absolute; top: 158rpx;left: 434rpx;
font-size: 16rpx;
color: #9f6a44;
}
.memberNumber{
position: absolute;top: 182rpx;left: 290rpx;
font-size: 19rpx;
color: #9f6a44;
font-weight: 600;
letter-spacing: 1px;
}
.phone{
position: absolute; top: 292rpx;left: 340rpx;
font-size: 16rpx;
color: #bc9060;
}
.service{
position: absolute;
top: 313rpx;
left: 340rpx;
font-size: 16rpx;
color: #bc9060;
}
.validity{
position: absolute;
top: 336rpx;
left: 340rpx;
font-size: 16rpx;
color: #bc9060;
}
.nameC{
position: absolute;
top: 146rpx;
left: 240rpx;
color: #9f6a44;
font-weight: 600;
line-height: 1;
}
.content{
width: 120rpx;
box-sizing: border-box;
display: flex;
align-items: center;
//white-space: nowrap;
overflow: hidden;
overflow-x: auto;
transform-origin: 0 55%;
white-space: nowrap;
}
}
}
</style>