1
0
mirror of https://shylinux.com/x/ContextOS synced 2025-04-25 16:58:06 +08:00
ContextOS/usr/librarys/weixin.js
2019-06-10 09:47:45 +08:00

44 lines
1.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

function scan(event, cb) {
wx.scanQRCode({
needResult: 1,
scanType: ["qrCode", "barCode"],
desc: "what",
success: function(res) {
cb(res.resultStr)
},
fail: function(res) {
alert(res.errMsg)
},
})
}
function close() {
wx.closeWindow({
success: function(res) {
alert(res.resultStr)
},
fail: function(res) {
alert(res.errMsg)
},
})
}
function choose() {
wx.chooseImage({
count: 1, // 默认9
sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
success: function (res) {
var localIds = res.localIds; // 返回选定照片的本地ID列表localId可以作为img标签的src属性显示图片
},
fail: function(res) {
alert(res.errMsg)
},
});
}
function wopen(event) {
wx.openAddress({success: function(res) {
context.Command("show", res)
}})
}