uni-app h5打包部署到uniCloud前端网页托管服务 某个页面一直出现连接服务器超时 请点击屏幕重试
uni-app h5打包部署到uniCloud前端网页托管服务 某个页面一直出现连接服务器超时 请点击屏幕重试
| 信息类别 | 详情 |
|---|---|
| 产品分类 | uniapp/H5 |
| PC开发环境 | Mac |
| 操作系统版本 | 12.5 |
| HBuilderX类型 | 正式 |
| HBuilderX版本 | 4.08 |
| 浏览器平台 | 微信内置浏览器 |
| 浏览器版本 | v8.0.48 |
| 项目创建方式 | HBuilderX |
示例代码:
<template>
<view class="content">
<view class="main row">
<view>实名认证</view>
<view v-if="hasValue">(已认证不可更改)</view>
<view v-else>(认证后不可更改)</view>
</view>
<view class="plant">
休息休息;
</view>
<view class="line row-center">
<view class="left">
认证方式
</view>
<view class="right">
大陆居民身份证
</view>
</view>
<view class="cell row-center">
<view class="left">
真实姓名
</view>
<view class="right">
<input type="text" v-model="realName" placeholder="输入姓名">
</view>
</view>
<view class="cell row-center">
<view class="left">
身份证号
</view>
<view class="right">
<input type="idcard" maxlength="18" v-model="idCard" placeholder="输入身份证号">
</view>
</view>
<view class="btn mainBack" v-if="!hasValue" @click.stop="renzhenApi">
立即认证
</view>
<view class="btn mainBack" v-else style="background-color: #555;" @click.stop="showNotEnable">
立即认证
</view>
</view>
</template>
<script>
import {
decrypt,
encrypt
} from "@/utils/encrypt.js";
export default {
data() {
return {
realName: '',
idCard: '',
hasValue: false
}
},
onLoad() {
this._id = uni.getStorageSync('uid')
this.init()
},
methods: {
async init() {
const {
result
} = await uniCloud.database().collection("user-info-db").doc(this._id).field({
realName: true,
idCard: true,
realStatus: true,
}).get()
if (result.data && result.data.length > 0) {
this.realStatus = result.data[0].realStatus || 0
this.realName = result.data[0].realName || ''
this.idCard = result.data[0].idCard || ''
}
this.hasValue = this.realName.length > 0
},
showNotEnable() {
const that = this
uni.showModal({
title: "提示",
content: "已认证信息,不可更改,如有疑问,请联系客服",
confirmText: "添加客服微信",
cancelText: "知道了",
success: function(res) {
if (res.confirm) {
that.toKeFuPage()
}
}
})
},
toKeFuPage() {
},
processName(str) {
if (null != str && str != undefined) {
let star = '' //存放名字中间的*
//名字是两位的就取姓名首位+*
if (str.length <= 2) {
return str.substring(0, 1) + "*";
} else {
for (var i = 0; i < str.length - 2; i++) {
star = star + '*'
}
return str.substring(0, 1) + star + str.substring(str.length - 1, str.length);
}
}
},
}
}
</script>
<style scoped>
.content {
padding: 50rpx;
}
.main {
font-size: 50rpx;
font-weight: 600;
}
.plant {
margin-top: 10rpx;
font-size: 26rpx;
margin-bottom: 30rpx;
}
.line {
justify-content: space-between;
line-height: 100rpx;
}
.left {
font-size: 34rpx;
font-weight: 600;
}
.cell {
height: 100rpx;
border-bottom: 1rpx solid #555;
}
.cell .right {
margin-left: 20rpx;
}
.right {
font-size: 30rpx;
}
.cell .right input {
font-size: 34rpx;
width: 400rpx;
}
.btn {
width: 300rpx;
height: 80rpx;
line-height: 80rpx;
border-radius: 40rpx;
margin-left: 175rpx;
margin-top: 100rpx;
text-align: center;
color: #fff;
}
.toKeFu {
padding-top: 80rpx;
text-align: right;
font-size: 24rpx;
justify-content: flex-end;
}
</style>
操作步骤:
- 必现。
预期结果:
- 能正常打开这个页面
实际结果:
- 无法正常打开
bug描述:
现象:
- 在Chrome浏览器调试能正常打开。
- 部署到服务器,在微信浏览器内打开其他任何页均正常,唯独这一页打开异常。
- 经反复无脑尝试,发现 将方法 renzhenApi 全部注释掉,部署后,页面能正常打开,打开方法则页面异常。
- 网上搜了一堆,2020年都有人报出来了,希望快点解决,少点bug
更多关于uni-app h5打包部署到uniCloud前端网页托管服务 某个页面一直出现连接服务器超时 请点击屏幕重试的实战教程也可以访问 https://www.itying.com/category-93-b0.html
1 回复
更多关于uni-app h5打包部署到uniCloud前端网页托管服务 某个页面一直出现连接服务器超时 请点击屏幕重试的实战教程也可以访问 https://www.itying.com/category-93-b0.html
有可能是scss的问题,改用less可能就行了,如果不行,可以看看组件库用的是不是scss,如果是改成less也许就行了。

