撥打手機號功能
wx.makePhoneCall({
phoneNumber: 'qipa250' //僅為示例,并非真實的電話號碼
})
一鍵復制信息功能
wx.getClipboardData({
success (res){
console.log(res.data)
}
})
復制到剪貼板
定位導航功能
wx.getLocation({
type: 'gcj02', //返回可以用于wx.openLocation的經(jīng)緯度
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
});
添加手機通訊錄聯(lián)系人。用戶可以選擇將該表單以「新增聯(lián)系人」或「添加到已有聯(lián)系人」的方式,寫入手機系統(tǒng)通訊錄。文章來源:http://www.zghlxwxcb.cn/news/detail-806469.html
轉(zhuǎn)發(fā)分享功能
頁面內(nèi)發(fā)起轉(zhuǎn)發(fā)。通過給 button 組件設置屬性 open-type=“share”,可以在用戶點擊按鈕后觸發(fā) Page.onShareAppMessage 事件,相關組件:button。文章來源地址http://www.zghlxwxcb.cn/news/detail-806469.html
/**
* 用戶點擊右上角分享
*/
onShareAppMessage(res) {
this.setData({
is_share: false,
container_top: 50,
})
console.log('res===', res);
//分享地址 路徑,傳遞參數(shù)到指定頁面。(為空則為當前頁面路徑)
let share_path = '/qipa250/pages/my-card/index?qipa=' + this.data.qipa+ "&tel=" + this.data.phone;
let share_title = this.data.nickname + '的名片,請惠存';
if (res.from == 'button') {
// 來自頁面內(nèi)轉(zhuǎn)發(fā)按鈕
return {
title: share_title,
path: share_path,
}
} else {
//否則是三個點
return {
title: share_title, //分享內(nèi)容(為空則為當前頁面文本)
path: share_path
};
}
}
到了這里,關于學習使用微信小程序?qū)崿F(xiàn)智能名片電子名片功能代碼的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!