当前位置:网站首页>小程序调用扫描二维码功能并跳转到二维码指定的路径
小程序调用扫描二维码功能并跳转到二维码指定的路径
2022-04-22 05:54:00 【陈君扬】
一、wxml 代码
<button class='tip-text2' style="margin-top:2%;color:#fff" bindtap='scanCode' mode='widthFix'>扫码</button>
二、js代码
scanCode: function () {
var that = this;
wx.scanCode({ //扫描API
onlyFromCamera: true,
scanType: ['barCode', 'qrCode'],
success(res) { //扫描成功
var scanCodeMsg = res.path; //获取二维码的路径信息
console.log(scanCodeMsg) //输出二维码信息
wx.redirectTo({ //调转到相应页面
url: '/' + scanCodeMsg,
});
wx.showToast({
title: '成功',
duration: 1000
})
}
})
},
三、官方概述




版权声明
本文为[陈君扬]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_36216193/article/details/93866096
边栏推荐
- 优秀 | 九州云入选首届混合云大会优秀案例及产业全景图
- PostgreSQL 13.3、12.7、11.12、10.17和9.6.22发布了!
- 开源数据库管理系统现在比商业产品更受欢迎
- Method of querying cumulative value in MySQL
- The server prints the request / response of the Jersey restful request
- 九州云Edge MEP作为典型产品入选《中国边缘云研究》报告
- Pgbouncer最佳实践:系列四
- Distributed ID
- 使用PG_STAT_REPLICATION监视复制
- 数美科技受邀参加信通院内容治理标签研讨会
猜你喜欢

数美科技受邀参加信通院内容治理标签研讨会

Partition of MySQL database

servlet3.0+事件驱动实现高性能长轮询

九州云获颁“2021年度企业”荣誉奖

Official announcement | skyline officially joined the official openstack module

SSM source topic

风靡IT圈的史诗级漏洞log4j2的产生原理及复现

使用PG_STAT_REPLICATION监视复制

Hit the pain point directly, Kyushu cloud 5g private network helps FAW Fusheng intelligent logistics construction

Distributed transaction solution Seata
随机推荐
Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location: “/?k=“
为PostgreSQL的表自动添加分区
Kyushu cloud was selected into the list of 36 krypton enterprises with the most potential to land on the science and innovation board
Evaluation of the first Avalon 1246-85t chassis with large computing power and low power consumption
Redis数据类型使用场景
Mysql 根据某一列的值 循环添加序号
数美科技荣获《银行家》“十佳智能风控管理创新奖”
自定义限流框架
有一份@九州云OFFER在等你
A problem caused by MySQL gap lock
The difference between hash mode and history mode
SSM源码专题
Jasmine X4 tutorial instructions, graphic explanation tutorial
ITS智能服务优秀企业年度榜单出炉,九州云荣获“2021信创运维10强”
倒计时一个月,PGConf.Asia2021亚洲大会最新前瞻,有哪些值得关注的亮点?
携手强化「内容审核」能力,融云与数美科技达成战略合作!
Openinfra live | Kyushu yunhuang Shuquan was elected track chair and brought wonderful theme sharing
MYSQL聚簇索引
grpc长连接keepalive
Asynchronous programming & concurrent asyncio