首页 > 其他分享 >钉钉开发

钉钉开发

时间:2023-02-03 14:36:48浏览次数:41  
标签:info httpRequest 123 dd 开发 hi event

钉钉开发

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("失败");
      } 
    })

 

标签:info,httpRequest,123,dd,开发,hi,event
From: https://www.cnblogs.com/mvpbest/p/17089170.html

相关文章