钉钉开发
钉钉开发
1.钉钉开发点击事件onTap
前端
<view id="tapTest" data-hi="Dingtalk" onTap="tapName"> <view id="tapTestInner" data-hi="DingtalkInner"> Click me! </view> </view>
后端
Page({ tapName(event) { console.log(event) } })
控制台输出 event 信息如下
{ "type": "tap", "timeStamp": 1619083408000, "target": { "id": "tapTestInner", "dataset": { "hi": "Dingtalk" }, "targetDataset": { "hi": "DingtalkInner" } }, "currentTarget": { "id": "tapTest", "dataset": { "hi": "Dingtalk" } } }
钉钉调用接口(dd.httpRequest)
后端
dd.httpRequest({ url:"https://oapi.dingtalk.com/gettoken?appkey=123&appsecret=123", method: 'GET', success: function(info) { console.log(info.data); dd.alert({content:JSON.stringify(info)},"成功"); }, fail: function(res) { dd.alert("失败"); } })