# qq.modifyGroupCalendar(Object object)

修改群日历,基础库1.13.0开始支持,暂时仅被邀请的商户可使用此接口。其中 path 参数在基础库1.15.0开始支持。

仅群管理员可以调用。

QQ mac版本:暂不支持

QQ windows版本:暂不支持

# 参数

# Object object
属性 类型 默认值 必填 说明
entryDataHash string 是 群信息hash值,可由getLaunchOptionsSync或qq.onAppShow获得
eventId string 是 qq.addGroupCalendar成功之后获取到的enventId
startTime number 是 事件开始时间的unix时间戳(不能早于当前时间)
endTime number 是 事件结束时间的unix时间戳(不能早于当前时间,事件持续时间endTime - startTime不能超过7天)
remindTime number 是 事件提醒时间的unix时间戳,remindTime=0代表不提醒。(不能晚于结束时间endTime,不能早于当前时间)
title string 是 事件标题
desc string 是 事件描述
path string 是 日历跳转路径(小程序页面路径)
extra string 否 扩展字段
sig string 否 第三方签名
success function 否 接口调用成功的回调函数
fail function 否 接口调用失败的回调函数
complete function 否 接口调用结束的回调函数(调用成功、失败都会执行)

object.success 回调函数

参数

Object res

属性 类型 说明
eventId string 事件id

object.fail 回调函数

参数

Object res

属性 类型 说明
errCode number 错误码
errMsg string 错误信息

错误码对照表待补充

# 示例代码


let launchInfo = qq.getLaunchOptionsSync()
let { entryDataHash } = launchInfo
// 注意,当小程序切后台后,再打开 entryDataHash 可能会改变,可用 qq.onAppShow 监听小程序切前台事件获取最新的 entryDataHash
qq.onAppShow(function(res){
    entryDataHash = res.entryDataHash
})

qq.modifyCalendar({
    entryDataHash: entryDataHash,
    eventId: '89652802_1583225347567099',
    startTime: Math.floor(+new Date() / 1000) + 3600,
    endTime: Math.floor(+new Date() / 1000) + 7200,
    remindTime: Math.floor(+new Date() / 1000) + 1800,
    title: 'hello-modified',
    desc: 'world-modified',
    path: 'pages/index/index',
    success(res) {
        console.log('success');
        console.log(res);
    },
    fail(res) {
        console.log('fail');
        console.log(res);
    }
})

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27