惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Blog of Author Tim Ferriss
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
云风的 BLOG
云风的 BLOG
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
P
Palo Alto Networks Blog
D
Docker
H
Hackread – Cybersecurity News, Data Breaches, AI and More
S
Schneier on Security
Engineering at Meta
Engineering at Meta
I
InfoQ
L
LangChain Blog
Cyberwarzone
Cyberwarzone
T
Tenable Blog
WordPress大学
WordPress大学
P
Privacy & Cybersecurity Law Blog
罗磊的独立博客
Apple Machine Learning Research
Apple Machine Learning Research
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Jina AI
Jina AI
C
CERT Recently Published Vulnerability Notes
Scott Helme
Scott Helme
博客园 - 三生石上(FineUI控件)
酷 壳 – CoolShell
酷 壳 – CoolShell
Know Your Adversary
Know Your Adversary
D
Darknet – Hacking Tools, Hacker News & Cyber Security
The Last Watchdog
The Last Watchdog
Last Week in AI
Last Week in AI
Cloudbric
Cloudbric
S
SegmentFault 最新的问题
爱范儿
爱范儿
Application and Cybersecurity Blog
Application and Cybersecurity Blog
博客园 - 叶小钗
AI
AI
T
Tor Project blog
I
Intezer
T
Threatpost
www.infosecurity-magazine.com
www.infosecurity-magazine.com
V
Visual Studio Blog
N
News and Events Feed by Topic
Latest news
Latest news
S
Security Affairs
博客园 - Franky
Microsoft Security Blog
Microsoft Security Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
B
Blog RSS Feed
C
Cybersecurity and Infrastructure Security Agency CISA
Hugging Face - Blog
Hugging Face - Blog
小众软件
小众软件
S
Securelist

博客园 - 微宇宙

js-金额相加 小程序- 字符数据换行 antd-输入框去掉光晕 大屏缩放布局 大屏显示 echarts - 原型的方向盘动画 小程序- 自定义导航栏组件封装 小程序-echart动画git仓库 小程序- 隐私协议完善 小程序- 日期picker样式问题 echart - 折线图显示设置 echart - 移动端提示内容无阴影 echart 柱状图 - 零界点 正负方向展示 小程序 - 导航栏 图标设置 小程序 - 错误问题记录 react项目全屏功能 react-大屏显示antd浮窗 React andt库设置主题色彩 React闭包陷阱 git 操作 小程序 - 订阅消息通知 小程序-分包 mysql安装使用 redis安装使用 echart 格式化水平坐标 tooltip数据 小程序-模板用法 工作代码规范 小程序-锚链接 小程序-菜单tabbar设置 小程序-分享功能 小程序-树形结构 array数组 js 小程序-标题自定义设置 小程序-图表 小程序-拨打电话
小程序-登录验证码的加载方式
微宇宙 · 2026-01-14 · via 博客园 - 微宇宙

在登录 输入手机号,发送验证码,image 元素设置 src 链接传参带上时 time 间戳,保证每次点击验证码的框,都实时加载验证码。

// src = 'http://*******?time=123124334534' 
<view>
  <image style="width: 200px; height: 200px; background-color: #eeeeee;" mode="{{item.mode}}" src="{{src}}"></image>
</view>

如果遇到网络错误,加载不出来图片,可能是一个空白区域。

可以在图片加载的时候,做一个图片监听事件:

一个是 监听错误的事件 binderror;

一个是 监听加载的事件 bindload;

然后 给父级设置一个class类,在网络错误时,显示这个class类的伪类 :after{},反之成功加载不显示这个class类。

// src = 'http://*******?time=123124334534' 
<view class="isShow ? 'imgTxt' : '' ">
  <image style="width: 200px; height: 200px; background-color: #eeeeee;" mode="{{item.mode}}" src="{{src}}" bindload="bindload" binderror="binderror"></image>
</view>

bindload (){}
binderror (){}
'
.imgTxt image:after{
  content: '加载中'
  position: absolute;
  bacckground: #aaa;
}