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
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
<template>
<div class="ultraman_wrap_bg">
<div class="ultraman_head_bg">
<img src="@/static/user/logo.png" alt="">
</div>
<div class="ultraman_user_blk">
<img class="ultraman_user_img" src="@/static/user/tpuciang.png" alt="">
<div class="ultraman_user_info">
<div class="ultraman_user_name">
{{ userInfo?.data == "true" ? userInfo?.nickName : "未实名" }}
<span v-if="userInfo?.data == 'true'">(已实名)</span>
<span v-else>(未实名)</span>
</div>
<div class="ultraman_user_code">账号:{{ formatPhone(userInfo?.phonenumber) }}</div>
<div class="ultraman_user_code" @click="handleCopy(userInfo?.yqm)">
习币推广码:{{ userInfo?.yqm || "000000" }}
</div>
</div>
</div>
<div class="ultraman_card_title">
<div class="ultraman_bank_detail">钱包详情</div>
<div class="ultraman_card_tag">
<span>查看更多</span>
<img src="@/static/user/jiantou.png" alt="">
</div>
</div>
<div class="ultraman_card_blk">
<div class="ultraman_card_item">
<div class="ultraman_card_name">我的习币</div>
<div class="ultraman_card_bot">
<div class="ultraman_card_num">{{ userInfo?.q5 || "0.00" }} 个</div>
<div class="ultraman_card_detail" @click="gomx(5)">
查看明细
<img src="@/static/user/chkan.png" alt="">
</div>
</div>
</div>
<div class="ultraman_card_hr"></div>
<div class="ultraman_card_item">
<div class="ultraman_card_name yps1">
<span>折算人民币</span>
<span style="color: red;">已抛售:{{ userInfo?.psjr || 0.00 }} 元</span>
</div>
<div class="ultraman_card_bot">
<div class="ultraman_card_num">{{ userInfo?.q5 * price || "0.00" }} 元</div>
<div class="ultraman_card_btns">
<div class="ultraman_card_btn ultraman_mglt" @click="handleClick('/user/paoshou')">
我要抛售
</div>
<div class="ultraman_card_btn" @click="handleClick('/user/paoshoudetail')">
抛售详情
</div>
</div>
</div>
</div>
</div>
<div class="ultraman_banner" @click="handleClick('/user/invite')">
<img src="@/static/user/hengfu.png" alt="">
</div>
<div class="ultraman_data_list">
<div class="ultraman_data_name">我的服务</div>
<div class="ultraman_list_box">
<div v-for="(item, index) in services" :key="index" class="ultraman_list_item" @click="handleClick(item.url)">
<img :src="item.icon" alt="">
<span>{{ item.name }}</span>
</div>
</div>
</div>
<div class="ultraman_data_hr"></div>
<div class="ultraman_data_list2">
<div class="ultraman_data_name">我的功能</div>
<div class="ultraman_list_box">
<div v-for="(item, index) in functions" :key="index" class="ultraman_list_item"
@click="handleClick(item.url, index === 1 ? 'kf' : '')">
<img :src="item.icon" alt="">
<span>{{ item.name }}</span>
</div>
</div>
</div>
<div class="ultraman_btn" @click="handleLogout">安全退出</div>
<div class="ultraman_foot">
<img src="@/static/xbgz/gongan.png" alt="">
</div>
<LandscapePopup ref="popup" :type="popupType" />
</div>
</template>
<script setup>
import { ref } from 'vue'
import { useRouter } from 'vue-router'
import { usePageHook } from '@/hooks/usePageHook';
import paoshouxiangqing from '@/static/user/paoshouxiangqing.png'
import gouzhi from '@/static/user/gouzhi.png'
import bangding from '@/static/user/bangding.png'
import shiming from '@/static/user/shiming.png'
import guanfnag from '@/static/user/guanfnag.png'
import wodetuandui from '@/static/user/wodetuandui.png'
import anquan from '@/static/user/anquan.png'
import kefu from '@/static/user/kefu.png'
import request from '@/utils/request'
const popup = ref(null)
const popupType = ref('app')
// Reactive state
const userInfo = ref({})
const kfurl = ref(sessionStorage.getItem('kfurl') || '')
const services = ref([
{
name: '邀请好友',
icon: paoshouxiangqing,
url: '/user/invite'
},
{
name: '购置详情',
icon: gouzhi,
url: '/xbgz/buylist'
},
{
name: '绑定银行卡',
icon: bangding,
url: '/user/mybankCard'
},
{
name: '实名认证',
icon: shiming,
url: '/user/shiming'
}
])
const functions = ref([
{
name: '安全中心',
icon: anquan,
url: '/user/anquan'
},
{
name: '在线客服',
icon: kefu,
url: kfurl.value
},
{
name: '官方群聊',
icon: guanfnag,
url: '/user/group'
},
{
name: '我的团队',
icon: wodetuandui,
url: '/user/myteam'
}
])
// Router
const router = useRouter()
const gomx = (type) => {
router.push(`/user/zjmx?type=${type}`)
}
// Methods
const formatPhone = (phone) => {
if (!phone) return ''
return phone.replace(/(\d{3})\d{4}(\d{4})/, '\$1****\$2')
}
const handleCopy = (code) => {
navigator.clipboard.writeText(code)
.then(() => {
showToast('推广码已复制')
console.log('推广码已复制')
})
.catch(err => {
console.error('复制失败:', err)
})
}
const handleClick = (url, flag) => {
if (flag === 'kf') {
if (url) {
window.location.href = url
} else {
router.push('/login')
showFailToast('客服链接错误,请重新登陆')
}
} else {
router.push(url)
}
}
const handleLogout = () => {
showConfirmDialog({
title: '提示',
message: '确定退出登录吗?',
confirmButtonText: '确定',
cancelButtonText: '取消',
}).then(() => {
sessionStorage.clear()
router.push('/login')
})
}
let price = ref(0)
function isWebView() {
// 检测是否在微信浏览器中
const isWechat = /MicroMessenger/i.test(navigator.userAgent);
// 检测是否在常见的移动浏览器中
const isMobileBrowser = (
/QQBrowser|UCBrowser|MiuiBrowser|Chrome|Firefox|Safari|Edge/i.test(navigator.userAgent) &&
!window.webkit?.messageHandlers &&
!window.JavascriptInterface
);
// 如果是微信或已知的移动浏览器,则认为不是 WebView
if (isWechat || isMobileBrowser) {
return false;
}
// 尝试调用 WebView 特有的方法或检查特有的对象
try {
return !!(
window.webkit?.messageHandlers || // iOS WKWebView
window.JavascriptInterface || // Android WebView
window._dsBridge || // DSBridge
window.WebViewJavascriptBridge || // 其他 WebView bridge
// 可以根据实际项目中 WebView 注入的对象进行添加
window.myWebViewBridge // 假设这是你的 WebView 注入的对象
);
} catch (e) {
return false;
}
}
usePageHook({
onPageShow: () => {
request.get('/yw1/list').then(res => {
price.value = res.data.length > 0 ? res.data[res.data.length - 1].a4 : 0
});
userInfo.value = JSON.parse(sessionStorage.getItem("userInfo") || "{}")
if (userInfo.value.data == 'true') {
if(!isWebView()){
popupType.value = 'app'
popup.value?.open()
}
} else {
popupType.value = 'shiming'
popup.value?.open()
}
}
});
</script>
<style scoped>
.yps1 {
position: relative;
}
.yps1 .yps {
position: absolute;
right: 0;
top: 0.05rem;
color: #E72931;
}
*,
*::before,
*::after {
margin: 0;
padding: 0;
box-sizing: border-box;
}
* {
box-sizing: border-box;
}
a {
text-decoration: none;
}
ul {
list-style: none;
list-style-type: none;
padding: 0;
margin: 0;
}
button,
input,
textarea,
select {
border: none;
outline: none;
background: none;
font: inherit;
}
/* 琛ㄦ牸鐨勮竟妗嗘竻闄� */
table {
border-collapse: collapse;
border-spacing: 0;
}
/* 鍥剧墖鐨勯粯璁よ竟璺濇竻闄� */
img {
display: block;
max-width: 100%;
}
.ultraman_wrap_bg {
width: 100%;
max-width: 550px;
min-height: 100vh;
margin: 0 auto;
padding-bottom: 30px;
background-position: center;
overflow: scroll;
background: url('@/static/user/beijing.png');
background-size: 100% 100%;
background-repeat: no-repeat;
/* 淇濈暀婊氬姩鍔熻兘 */
background-color: #fff;
}
.ultraman_wrap_bg::-webkit-scrollbar {
display: none;
/* 闅愯棌婊氬姩鏉� */
}
/* 椤堕儴 start ====================================================== */
.ultraman_head_bg {
width: 50%;
margin: 0 auto;
margin-top: 20px;
}
.ultraman_head_bg img {
width: 100%;
}
.ultraman_user_blk {
width: 88%;
margin: 0 auto;
margin-top: 20px;
color: #322c2b;
display: flex;
align-items: center;
}
.ultraman_user_img {
width: 60px;
border-radius: 50%;
}
.ultraman_user_info {
flex: 1;
margin-left: 12px;
}
.ultraman_user_name {
font-size: 17px;
font-weight: bold;
letter-spacing: 1px;
}
.ultraman_user_code {
font-size: 12px;
letter-spacing: 1px;
}
/* 椤堕儴 end ====================================================== */
.ultraman_card_title {
width: 88%;
margin: 0 auto;
margin-top: 20px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 20px 20px 20px;
background: url('@/static/user/qianbaoxiangqing.png');
background-size: 100% 100%;
background-repeat: no-repeat;
color: #fff;
}
.ultraman_bank_detail {
font-size: 16px;
font-weight: bold;
letter-spacing: 1px;
color: #fff;
}
.ultraman_card_tag {
display: flex;
align-items: center;
font-size: 12px;
letter-spacing: 1px;
}
.ultraman_card_tag img {
height: 10px;
margin-left: 3px;
}
.ultraman_card_blk {
width: 88%;
margin: 0 auto;
background-color: #fefefe;
padding: 15px;
border-radius: 15px;
margin-top: -15px;
}
.ultraman_card_item {
padding: 0 3px;
}
.ultraman_card_name {
font-size: 14px;
color: #a1a1a1;
letter-spacing: 1px;
display: flex;
align-items: center;
justify-content: space-between;
}
.ultraman_card_bot {
display: flex;
align-items: center;
justify-content: space-between;
}
.ultraman_card_num {
font-size: 19px;
font-weight: bold;
letter-spacing: 1px;
color: #464443;
}
.ultraman_card_detail {
margin-top: 8px;
display: flex;
align-items: center;
font-size: 12px;
color: #464443;
}
.ultraman_card_detail img {
height: 10px;
margin-left: 3px;
}
.ultraman_card_btns {
margin-top: 8px;
display: flex;
align-items: center;
justify-content: space-between;
}
.ultraman_card_btn {
color: #464443;
font-size: 12px;
border: 1px solid #b6b6b7;
padding: 2px 10px;
border-radius: 5px;
}
.ultraman_mglt {
margin-right: 10px
}
.ultraman_card_hr {
width: 100%;
height: 1px;
margin: 13px 0;
background-color: #eeeeef;
}
.ultraman_banner {
width: 88%;
margin: 0 auto;
margin-top: 16px;
}
.ultraman_banner img {
width: 100%;
}
.ultraman_data_list {
width: 88%;
margin: 0 auto;
margin-top: 16px;
background-color: #fefefe;
border-radius: 5px 5px 0 0;
padding: 25px 22px 20px 22px;
}
.ultraman_data_list2 {
width: 88%;
margin: 0 auto;
background-color: #fefefe;
border-radius: 0 0 5px 5px;
padding: 15px 22px 20px 22px;
}
.ultraman_data_name {
font-size: 16px;
font-weight: bold;
letter-spacing: 1px;
}
.ultraman_list_box {
margin-top: 14px;
display: flex;
align-items: center;
justify-content: space-between;
}
.ultraman_list_item {
width: 25%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
font-size: 12px;
color: #807e7d;
}
.ultraman_list_item img {
width: 78%;
margin-bottom: 6px;
}
.ultraman_data_hr {
height: 14px;
width: 88%;
margin: -2px auto;
background-color: #eeeeef;
}
.ultraman_btn {
height: 38px;
line-height: 38px;
text-align: center;
color: #fff;
width: 88%;
margin: 0 auto;
margin-top: 18px;
background: url('@/static/user/anquanntuichu.png');
background-size: 100% 100%;
background-repeat: no-repeat;
}
.ultraman_foot {
width: 68%;
margin: 0 auto;
margin-top: 20px;
}
.ultraman_foot img {
width: 100%;
}
</style>