智能名片小程序

名片详情页性能实现要害代码

一键复制信息性能

复制到剪贴板

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.  },



智能名片小程序名片详情页性能实现要害代码