1、小程序中实现复制黏贴、打电话、扫码功能
<view bindlongtap='copy'>订单号:QF20120902093203023</view>
<button bindtap='call'>打电话</button>
<button bindtap='scan'>扫码</button>
Page({
// 复制黏贴
copy() {
wx.setClipboardData({
data: 'QF20120902093203023'
})
},
call() {
wx.makePhoneCall({
phoneNumber: '0755-89890909'
})
},
scan() {
wx.scanCode({
scanType: 'barCode',
success(res){
console.log('扫码结果', res)
}
})
}
})