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 >
< view class = "loginBack" >
< view class = "formregion" >
< view class = "logo" >
< image :src ="define" class = "define" mode = "scaleToFill" > < / image >
< / view >
< / view >
< uni -load -more status = "loading" / >
< / view >
<!-- < view class = "padd" >
< view class = "margin-bottom text-center margin-top" >
< image class = "t-img padding-xl" src = "/static/image/nonet.png" > < / image >
< view class = "text-center t-full padding-xl" >
无法连接网络 , 请检查网络并刷新重试 .
< / view >
< / view >
< button class = "cu-btn block bg-blue lg" style = "margin-top:100upx;width:300upx; margin-left:auto;margin-right:auto" @click ="tocheck" >
< text class = "text-white" > 检查网络 < / text >
< / button >
< / view > -- >
< / view >
< / view >
< / template >
< script >
import { ifnonet } from '../../utils/utils.js' ;
export default {
data ( ) {
return {
define : require ( "@/static/image/logo.png" ) ,
contentText : {
contentdown : ' ' ,
contentrefresh : ' ' ,
contentnomore : ' '
}
} ;
} ,
onLoad ( ) {
var that = this ;
if ( ! ifnonet ( ) ) {
// 如果网络联通, 重启动app
// #ifdef APP-PLUS
//连接成功重启app
plus . runtime . restart ( ) ;
// #endif
}
else {
setInterval ( function ( ) {
that . tocheck ( ) ;
} , 360 ) ;
}
} ,
onBackPress ( options ) {
if ( options . from === 'backbutton' ) {
// 来自顶部菜单的返回按钮
// 在这里处理你的逻辑
console . log ( '返回按钮被点击' ) ;
// 返回 true 表示阻止默认行为,返回 false 则不阻止
if ( ifnonet ( ) ) {
// 无网络阻止返回
return true ;
}
else {
// 有网格重启app
// #ifdef APP-PLUS
//连接成功重启app
plus . runtime . restart ( ) ;
// #endif
return false ;
}
}
else {
// 其他场景的返回事件
return false ;
}
} ,
methods : {
tocheck ( ) {
if ( ifnonet ( ) ) {
// uni.showToast({
// title: '网络连接异常!请再次刷新重试!',
// icon:'none',
// duration: 2000
// });
}
else {
// #ifdef APP-PLUS
//连接成功重启app
plus . runtime . restart ( ) ;
// #endif
}
}
}
}
< / script >
< style >
page {
height : 100 Vh ;
width : 100 vw ;
background : # f5f5f5 ;
}
. loginBack {
height : 100 vh ;
padding : 20 % 50 rpx 200 rpx 50 rpx ;
width : 100 % ;
background : linear - gradient ( 180 deg , # a4ceff 0 % , # ffffff 100 % ) ;
overflow : hidden ;
}
. formregion {
width : 100 % ;
padding : 253 rpx 40 rpx ;
border - radius : 10 px ;
position : relative ;
display : block ;
overflow : hidden ;
}
. logo {
position : absolute ;
top : 50 rpx ;
left : 0 ;
width : 100 % ;
display : flex ;
flex - direction : column ;
align - items : center ;
justify - content : center ;
}
. define {
width : 150 rpx ;
height : 150 rpx ;
}
. t - full {
width : 100 % ;
}
. t - img {
width : 300 upx ;
height : 300 upx ;
margin - left : auto ;
}
. tx {
position : relative ;
overflow : hidden ;
width : 100 % ;
height : 150 upx ;
}
. txgd {
position : absolute ;
right : 20 upx ;
top : 10 upx ;
}
. ltx {
position : relative ;
overflow : hidden ;
width : 100 % ;
height : 80 upx ;
line - height : 80 upx ;
}
. ltxn {
position : relative ;
overflow : hidden ;
margin - top : 20 upx ;
width : 100 % ;
height : 160 upx ;
line - height : 160 upx ;
}
. fright {
position : absolute ;
right : 20 upx ;
top : 0 ;
}
. cu - form - group . title {
min - width : calc ( 4 em + 15 px ) ;
}
. padd {
padding : 20 upx ;
}
. cu - padd - bottom {
margin - bottom : 20 upx ;
}
. iconimg {
width : 280 upx ;
height : auto ;
margin : 28 upx 16 upx 0 0 ;
}
< / style >