当前位置:网站首页>智能名片小程序名片详情页功能实现关键代码
智能名片小程序名片详情页功能实现关键代码
2022-04-23 06:42:00 【mon_star°】
智能名片小程序
名片详情页功能实现关键代码
一键复制信息功能
复制到剪贴板
wx.getClipboardData({
success (res){
console.log(res.data)
}
})
一键拨号功能
拨打电话
wx.makePhoneCall({
phoneNumber: '1340000' //仅为示例,并非真实的电话号码
})
定位导航功能
使用微信内置地图查看位置
wx.getLocation({
type: 'gcj02', //返回可以用于wx.openLocation的经纬度
success (res) {
const latitude = res.latitude
const longitude = res.longitude
wx.openLocation({
latitude,
longitude,
scale: 18
})
}
})
存入手机通讯录功能
添加手机通讯录联系人。用户可以选择将该表单以「新增联系人」或「添加到已有联系人」的方式,写入手机系统通讯录。
wx.addPhoneContact({
firstName: ifirstName,
mobilePhoneNumber: mobilePhoneNumber,
weChatNumber: weChatNumber,
organization: organization,
title: title,
addressStreet: addressStreet,
email: email
});
转发分享功能
页面内发起转发。通过给 button 组件设置属性 open-type="share",可以在用户点击按钮后触发 Page.onShareAppMessage 事件,相关组件:button。
onShareAppMessage: function () {
// return custom share data when user share.
},
版权声明
本文为[mon_star°]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_29528701/article/details/124343660
边栏推荐
- How does Apache Hudi accelerate traditional batch mode?
- 《内网安全攻防:渗透测试实战指南》读书笔记(七):跨域攻击分析及防御
- 云计算技能大赛 -- openstack私有云环境 第一部分
- String self generated code within a given range
- Post of experience in preparation for guarantee and research -- the 18th (2021) Central South planning department promoted the exemption to Zhejiang University Institute of Technology
- Ignis公链的NFT生态发展:Unicorn.art的捐赠开发之路
- Feign源码分析
- Intranet penetration series: dns2tcp of Intranet tunnel
- Online Safe Trajectory Generation For Quadrotors Using Fast Marching Method and Bernstein Basis Poly
- Go语学习笔记 - 语言接口 | 从零开始Go语言
猜你喜欢
随机推荐
1+x云计算中级--脚本搭建读写分离
[NLP notes] preliminary study on CRF principle
BUUCTF [ACTF2020 新生赛]Include1
从ES、MongoDB、Redis、RocketMQ出发谈分布式存储
一些靶场的学习记录:sqli-labs、upload-labs、XSS
How does Apache Hudi accelerate traditional batch mode?
BUUCTF [极客大挑战 2019]EasySQL1
Redis--为什么字符串emstr的字符串长度是44字节上限?
高精度焊接机械臂定位
Reptile learning notes, learning reptile, read this article is enough
一文了解系列,对web渗透的常见漏洞总结(持续更新)
vivo,硬件安全的爱与雷霆
Positioning and decoration style
SAP tr manual import system operation manual
SAP self created table log function is enabled
《内网安全攻防:渗透测试实战指南》读书笔记(五):域内横向移动分析及防御
LeetCode 1611. 使整数变为 0 的最少操作次数
Research on system and software security (2)
Sto with billing cross company inventory dump return
GUI,CLI与Unix哲学