You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
< template >
< view class = "page2" >
< image src = "@/static/page2-bg.png" class = "bkg" alt = "" / >
< view class = "page2-wrap" >
< image src = "/static/logo.png" class = "logo" > < / image >
< view class = "page2-wrap_content" >
< image src = "/static/page2-title.png" class = "page2-wrap_title" > < / image >
< view class = "page2-wrap_text" >
< image src = "/static/page2-content.png" class = "page2-wrap_text_img" > < / image >
< view class = "content" >
< view class = "number" > 您是第 < text class = "highlight" > { { total } } < / text > 个关心关爱孤独症儿童的 “ 星 ” 朋友 ! < / view >
< view class = "slogan" > 守护 “ 星 ” 宝 , 成为 “ 星 ” 友 , 有爱不孤独 ! < / view >
< / view >
< / view >
< / view >
< / view >
< / view >
< / template >
< script >
export default {
data ( ) {
return {
total : '-' ,
}
} ,
mounted ( ) {
this . loadData ( )
} ,
methods : {
async loadData ( ) {
let userInfo = uni . getStorageSync ( 'gdz_lifeData' ) ? uni . getStorageSync ( 'gdz_lifeData' ) . vuex _user : false
console . log ( "userInfo" , userInfo )
if ( userInfo ) {
this . total = userInfo ? userInfo . top _department _id : '-'
} else {
// 如果数据不存在,可以选择再次尝试获取或者显示加载中提示
setTimeout ( ( ) => {
this . loadData ( ) ; // 递归尝试获取数据
} , 1000 ) ;
}
}
}
}
< / script >
< style lang = "scss" scoped >
. page2 {
width : 100 vw ;
height : 100 vh ;
position : relative ;
. bkg {
width : 100 vw ;
height : 100 vh ;
position : absolute ;
top : 0 ;
left : 0 ;
}
& - wrap {
width : 100 vw ;
height : 100 vh ;
overflow : scroll ;
position : absolute ;
top : 0 ;
left : 0 ;
padding - bottom : 350 rpx ;
. logo {
width : 415 rpx ;
height : 82 rpx ;
margin : 65 rpx 0 0 35 rpx ;
}
& _content {
margin - top : 60 rpx ;
}
& _title {
width : 540 rpx ;
height : 81 rpx ;
display : block ;
margin : 0 auto ;
margin - bottom : 65 rpx ;
}
& _text {
width : 732 rpx ;
height : 567 rpx ;
display : block ;
margin : 0 auto ;
position : relative ;
& _img {
width : 732 rpx ;
height : 567 rpx ;
display : block ;
margin : 0 auto ;
}
. content {
width : 570 rpx ;
display : block ;
margin : 0 auto ;
position : absolute ;
top : 240 rpx ;
left : 100 rpx ;
color : # 6 f6f6f ;
font - size : 32 rpx ;
. number {
line - height : 2 ;
text - indent : 2 em ;
. highlight {
color : # e54545 ;
font - weight : bold ;
margin : 0 10 rpx ;
}
}
. slogan {
display : block ;
margin - top : 20 rpx ;
text - indent : 2 em ;
}
}
}
}
}
/* 当屏幕宽度小于 320px 时 */
@ media ( max - width : 320 px ) {
. content {
font - size : 24 rpx ! important ;
}
}
/* 当屏幕宽度大于 414px 时 */
// @media (min-width: 414px) {
// .content {
// font-size: 32rpx;
// }
// }
< / style >