Commit aca2a2bb authored by 苏尧华's avatar 苏尧华

sdk文档修改

parent 46ab5f16
define({ "api": [
{
"group": "A",
"name": "init__v1_006___sdk_____________sdk_WeChatLogin_______sdk_WeChatLogin__d_____var_config1___sdk_getConfig1____if_config1_hz2__1_________xxx_active___true__xxx_addClickListener_________var_d___sdk_getButtonConfig__hz2____________________sdk_navigateToMiniProgram_d________else_____________",
"type": "",
"url": "",
"name": "ABC",
"type": "sdk说明",
"url": "分组A中的方法都是游戏中基本必用的,分组B中的方法是常用的数据存储、获取和事件埋点上报,分组C的方法很少调用",
"title": "ABC(sdk说明必看)",
"success": {
"examples": [
{
"title": "示例:",
"content": "//A",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "A"
},
{
"group": "C",
"name": "Get",
"type": "Get",
"url": "发起网络请求",
"title": "Get(发起Get请求)",
"group": "A",
"name": "WeChatLoginNoAuth",
"type": "无授权登陆",
"url": "微信登录WeChatLoginNoAuth对外提供新增、授权、登陆调用以及初始化",
"title": "WeChatLoginNoAuth(无授权登录)",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "String",
"type": "function",
"optional": false,
"field": "url",
"description": "<p>请求地址</p>"
"field": "callback",
"description": "<p>登录回调</p>"
}
]
}
},
"examples": [
{
"title": "示例:",
"content": "sdk.WeChatLoginNoAuth((userData)=>{\n console.log(userData);\n})",
"type": "json"
}
],
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "A"
},
{
"group": "A",
"name": "WxAuthLoginOpacity",
"type": "微信授权",
"url": "微信授权登录,将透明图片附着在游戏中功能按钮之上,点击弹出授权按钮",
"title": "WxAuthLoginOpacity(授权)",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "Object",
"optional": true,
"field": "obj",
"description": "<p>传递按钮位置信息 width height left top</p>"
}
]
}
},
"examples": [
{
"title": "示例:",
"content": "var obj = {\n width: 100,\n height: 200,\n left: 100,\n top: 100\n}\nsdk.WxAuthLoginOpacity(obj,function(userInfo){\n sdk.log(userInfo);\n})",
"type": "json"
}
],
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "A"
},
{
"group": "A",
"name": "createImage",
"type": "显示网络图片",
"url": "微信小游戏加载图片",
"title": "createImage(显示图片)",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "cc.Sprite",
"optional": false,
"field": "reqData",
"description": "<p>请求参数</p>"
"field": "sprite",
"description": "<p>显示图片的Sprite</p>"
},
{
"group": "Parameter",
"type": "Object",
"type": "String",
"optional": false,
"field": "callback",
"description": "<p>不存在返回null</p>"
"field": "url",
"description": "<p>需要加载的图片地址</p>"
},
{
"group": "Parameter",
"type": "callback",
"optional": true,
"field": "cb",
"description": "<p>图片加载回调,成功回调参数值为图片纹理,失败回调参数值为null</p>"
},
{
"group": "Parameter",
"type": "Boolean",
"optional": true,
"field": "cache",
"description": "<p>是否缓存纹理</p>"
}
]
}
......@@ -45,21 +122,40 @@ define({ "api": [
"examples": [
{
"title": "示例:",
"content": "sdk.Get(\"https://xxx.xxx\", { user_id: user_id }, function (d) {\n console.log(d)\n});",
"content": "\nsdk.createImage(itemNode.getComponent(cc.Sprite), imageUrl, null , true);//缓存图片\nsdk.createImage(itemNode.getComponent(cc.Sprite), imageUrl, null , false);//不缓存图片",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
"groupTitle": "A"
},
{
"group": "C",
"name": "Post",
"type": "Post",
"url": "发起网络请求",
"title": "Post(发起Post请求)",
"group": "A",
"name": "error",
"type": "console",
"url": "console.error封装",
"title": "error(打印error信息)",
"success": {
"examples": [
{
"title": "示例:",
"content": "//sdk.debug游戏入口初始化一次即可\nsdk.debug = true;\nsdk.error(1111)",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "A"
},
{
"group": "A",
"name": "getButtonConfig",
"type": "数据存储",
"url": "数据存储",
"title": "getButtonConfig(获取按钮配置)视频或分享切换",
"parameter": {
"fields": {
"Parameter": [
......@@ -67,16 +163,66 @@ define({ "api": [
"group": "Parameter",
"type": "String",
"optional": false,
"field": "url",
"description": "<p>请求地址</p>"
"field": "buttonKey",
"description": "<p>按钮的键值 比如 hz2 hz3</p>"
}
]
}
},
"success": {
"examples": [
{
"title": "示例:",
"content": "\nvar d = sdk.getButtonConfig2(\"xxx\",1);\n//特别说明:对于视频分享切换的解析返回的json为:\n//{\"type\":\"share\",\"count\":5,\"left_count\":3,\"use_count\":2,\"next\":\"key_1\"}\n//技术获取之后根据d.type判断类型然后做响应处理就可以了;\nif(d.type=='share')\n{\n //凋起分享\n sdk.shareAppMessage({type: 1,query: \"\",success:xxx,fail:xxx });\n}else\n{\n //凋起视频\n\n adSdk.videoSuccess = function(){\n //视频看完处理逻辑\n this.successFunction();\n };\n adSdk.videoFail = function(){\n //视频未看完处理逻辑\n this.failFunction();`\n };\n adSdk.videoError = function(){\n //视频凋起失败处理逻辑,要么就是广告id没有或者是调起视频广告太频繁微信限制调起,这里一般都会改成去调起分享\n this.errorFunction();\n };\n var videoAd = adSdk.createVideoAd(1,videoAdUnitId);\n videoAd.load().then(() => videoAd.show());\n \n}\n//如果多个视频广告id(videoAdUnitId)的情况,通过后台技术配置Config2获取对应的视频广告id,比如:sdk.getConfig2().videoAdUnitId1 或者sdk.getConfig2().videoAdUnitId2",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "A"
},
{
"group": "A",
"name": "getConfig1",
"type": "运营配置",
"url": "游戏后台配置信息,运营人员使用的通用配置开关",
"title": "getConfig1(运营配置)",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "Object",
"optional": false,
"field": "reqData",
"description": "<p>请求参数</p>"
"field": "callback",
"description": "<p>不存在返回null</p>"
}
]
}
},
"success": {
"examples": [
{
"title": "示例:",
"content": "var d = sdk.getConfig1();",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "A"
},
{
"group": "A",
"name": "getConfig2",
"type": "程序配置",
"url": "游戏后台配置信息,程序员使用的游戏数据开关,可随便自定义数据:例如复活次数等",
"title": "getConfig2(程序配置)",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "Object",
......@@ -91,163 +237,272 @@ define({ "api": [
"examples": [
{
"title": "示例:",
"content": "sdk.Post(sdk.ip + sdk.common, { user_id: user_id }, function (d) {\n console.log(d)\n});",
"content": "var d = sdk.getConfig2();",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
"groupTitle": "A"
},
{
"group": "C",
"name": "Screenshot",
"type": "微信小游戏截图保存",
"url": "微信小游戏截图保存",
"title": "Screenshot(截图)",
"group": "A",
"name": "getUser",
"type": "获取本地用户信息",
"url": "获取本地用户信息(登录成功后,会在本地存储用户信息)",
"title": "getUser(获取用户信息)",
"success": {
"examples": [
{
"title": "示例:",
"content": "//.摄像机组件、回调\nsdk.Screenshot((d)=>{\n if(d){\n console.log(\"图片保存成功:\", d)\n }else{\n console.log(\"图片保存失败:\", d)\n }\n})",
"content": "//.不存在返回null\nvar user = sdk.getUser();",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
"groupTitle": "A"
},
{
"group": "C",
"name": "WeChatLogin",
"type": "新增、授权、登陆",
"url": "微信登录 WeChatLogin 对外提供新增、授权、登陆调用以及初始化",
"title": "注意v1.006版本sdk 只需要调用登录就可以了不在需要调用init了,sdk内部已经做了init操作了",
"group": "A",
"name": "init",
"type": "初始化",
"url": "从v1.006版本的sdk已经废弃改方法,只需要调用sdk.WeChatLoginNoAuth方法就可以了",
"title": "init(初始化)",
"deprecated": {
"content": "从v1.006版本的sdk已经废弃改方法,只需要调用 (#A:WeChatLoginNoAuth)方法就可以了"
},
"success": {
"examples": [
{
"title": "示例:",
"content": "sdk.WeChatLoginNoAuth((d)=>{\n var config1 = sdk.getConfig1();\n if(config1.hz2==1)\n {\n //显示\n xxx.active = true;\n xxx.addClickListener(() => {\n var d = sdk.getButtonConfig('hz2');\n //跳转到对应的小程序或者游戏\n sdk.navigateToMiniProgram(d);\n });\n }else\n {\n //隐藏\n }\n\n});",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "A"
},
{
"group": "A",
"name": "log",
"type": "console",
"url": "console.log封装",
"title": "log(打印log信息)",
"success": {
"examples": [
{
"title": "示例:",
"content": "sdk.WeChatLogin((d)=>{\n var config1 = sdk.getConfig1();\n if(config1.hz2==1)\n {\n //显示\n xxx.active = true;\n \n xxx.addClickListener(() => {\n var d = sdk.getButtonConfig('hz2');\n //跳转到对应的小程序或者游戏\n sdk.navigateToMiniProgram(d);\n });\n }else\n {\n //隐藏\n }\n\n});",
"content": "//sdk.debug游戏入口初始化一次即可\nsdk.debug = true;\nsdk.log(1111)",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
"groupTitle": "A"
},
{
"group": "C",
"name": "WxAuthLoginOpacity___________________________",
"group": "A",
"name": "onShareAppMessage",
"type": "分享",
"url": "注册微信右上角分享,游戏初始化就可以调用了",
"title": "onShareAppMessage(分享)",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "Object",
"type": "int",
"optional": false,
"field": "type",
"defaultValue": "0",
"description": "<p>后台自定义的分享类型;例如:0:右上角分享、1:普通分享 2:分享加金币</p>"
},
{
"group": "Parameter",
"type": "int",
"optional": false,
"field": "specialFlag",
"defaultValue": "0",
"description": "<p>特殊标记,例如0:默认、1:邀新好友、2:邀旧好友</p>"
},
{
"group": "Parameter",
"type": "int",
"optional": false,
"field": "rewardFlag",
"defaultValue": "xxx",
"description": "<p>活动或者道具id</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": true,
"field": "obj",
"description": "<p>传递按钮位置信息 width height left top</p>"
"field": "title",
"description": "<p>转发标题</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": true,
"field": "imageUrl",
"description": "<p>转发显示图片的链接</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": true,
"field": "query",
"description": "<p>必须是 key1=val1&amp;key2=val2 的格式。</p>"
},
{
"group": "Parameter",
"type": "callback",
"optional": true,
"field": "success",
"description": "<p>成功回调</p>"
},
{
"group": "Parameter",
"type": "callback",
"optional": true,
"field": "fail",
"description": "<p>失败回调</p>"
},
{
"group": "Parameter",
"type": "callback",
"optional": true,
"field": "cancel",
"description": "<p>点击取消分享按钮回调</p>"
}
]
}
},
"type": "微信授权",
"url": "微信授权登录",
"title": "WxAuthLoginOpacity(授权)不对外提供调用",
"success": {
"examples": [
{
"title": "示例:",
"content": "sdk.shareAppMessage({type: 1,query: \"\",success:xxx,cancel:xxx,fail:xxx,rewardFlag:'' });",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
"groupTitle": "A"
},
{
"group": "C",
"name": "checkUpdate",
"type": "检测版本更新",
"url": "微信小游戏(冷启动的时候会检查,如果有更新则会重启小游戏进行更新)",
"title": "checkUpdate(版本更新)",
"group": "A",
"name": "setUserCloudStorage",
"type": "主域上报数据",
"url": "对用户托管数据进行写数据操作,子域排行榜的数据来源,允许同时写多组KV数据",
"title": "setUserCloudStorage(主域上报数据)",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "Object",
"optional": false,
"field": "kvDataList",
"description": "<p>发送给子域的消息</p>"
}
]
}
},
"success": {
"examples": [
{
"title": "示例:",
"content": "sdk.checkUpdate();",
"content": "var kvDataList = [{key: 'score',value: 100}];\nsdk.setUserCloudStorage(kvDataList,function(res){\n sdk.log(res);\n})",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
"groupTitle": "A"
},
{
"group": "C",
"name": "createImage",
"type": "显示网络图片",
"url": "微信小游戏加载图片",
"title": "createImage(显示图片)",
"group": "A",
"name": "shareAppMessage",
"type": "分享",
"url": "主动拉起微信分享",
"title": "shareAppMessage(分享)",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "cc.Sprite",
"type": "int",
"optional": false,
"field": "sprite",
"description": "<p>显示图片的Sprite</p>"
"field": "type",
"defaultValue": "1",
"description": "<p>后台自定义的分享类型;例如:0:右上角分享、1:普通分享 2:分享加金币</p>"
},
{
"group": "Parameter",
"type": "String",
"type": "int",
"optional": false,
"field": "url",
"description": "<p>需要加载的图片地址</p>"
"field": "specialFlag",
"defaultValue": "0",
"description": "<p>特殊标记,例如0:默认、1:邀新好友、2:邀旧好友</p>"
},
{
"group": "Parameter",
"type": "int",
"optional": false,
"field": "rewardFlag",
"defaultValue": "xxx",
"description": "<p>活动或者道具id</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": true,
"field": "title",
"description": "<p>转发标题</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": true,
"field": "imageUrl",
"description": "<p>转发显示图片的链接</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": true,
"field": "query",
"description": "<p>必须是 key1=val1&amp;key2=val2 的格式。</p>"
},
{
"group": "Parameter",
"type": "callback",
"optional": false,
"field": "cb",
"description": "<p>图片加载回调,成功回调参数值为图片纹理,失败回调参数值为null</p>"
"optional": true,
"field": "success",
"description": "<p>成功回调</p>"
},
{
"group": "Parameter",
"type": "Boolean",
"optional": false,
"field": "cache",
"description": "<p>是否缓存纹理</p>"
}
]
}
},
"success": {
"examples": [
{
"title": "示例:",
"content": "或\nsdk.createImage(itemNode.getComponent(cc.Sprite), imageUrl, null , true);",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
"type": "callback",
"optional": true,
"field": "fail",
"description": "<p>失败回调</p>"
},
{
"group": "C",
"name": "createOrder",
"type": "数据存储",
"url": "创建订单",
"title": "createOrder(存)",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "int",
"optional": false,
"field": "cash",
"description": "<p>订单金额,当前提现的订单金额</p>"
"type": "callback",
"optional": true,
"field": "cancel",
"description": "<p>点击取消分享按钮回调</p>"
}
]
}
......@@ -256,21 +511,21 @@ define({ "api": [
"examples": [
{
"title": "示例:",
"content": "sdk.createOrder(10,null)",
"content": "sdk.shareAppMessage({type: 1,query: \"\",success:xxx,cancel:xxx,fail:xxx,rewardFlag:'xxx' });",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
"groupTitle": "A"
},
{
"group": "C",
"group": "B",
"name": "formatTime",
"type": "",
"url": "数据获取",
"title": "formatTime ()",
"type": "时间格式化",
"url": "对时间格式化",
"title": "formatTime (时间格式化)",
"parameter": {
"fields": {
"Parameter": [
......@@ -309,10 +564,10 @@ define({ "api": [
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
"groupTitle": "B"
},
{
"group": "C",
"group": "B",
"name": "gameStart",
"type": "数据存储",
"url": "数据存储",
......@@ -341,14 +596,14 @@ define({ "api": [
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
"groupTitle": "B"
},
{
"group": "C",
"name": "getButtonConfig",
"type": "数据存储",
"group": "B",
"name": "getFromServer",
"type": "getFromServer",
"url": "数据存储",
"title": "getButtonConfig(取)",
"title": "getFromServer(取用户服务器数据)",
"parameter": {
"fields": {
"Parameter": [
......@@ -356,38 +611,50 @@ define({ "api": [
"group": "Parameter",
"type": "String",
"optional": false,
"field": "buttonKey",
"description": "<p>按钮的键值 比如 hz2 hz3</p>"
"field": "dataKey",
"description": "<p></p>"
},
{
"group": "Parameter",
"type": "int",
"type": "String",
"optional": false,
"field": "isCount",
"description": "<p>值为1或者0 1:表示本次调用使用次数加一;0:表示本次调用使用次数不发生变化</p>"
"field": "dataType",
"description": "<p>数据类型 首字母大学的驼峰形式,例如:ShareGroup 或者 ShareLimit</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "data",
"description": "<p>特殊情况下需要传递额外数据状况,一般不传递</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "callback",
"description": "<p>回调</p>"
}
]
}
},
"success": {
"examples": [
{
"title": "示例:",
"content": "var d = sdk.getButtonConfig2(\"xxx\",1);\n特别说明:对于视频分享切换的解析返回的json为:\n{\"type\":\"share\",\"count\":5,\"left_count\":3,\"use_count\":2,\"next\":\"key_1\"}\n技术获取之后根据d.type判断类型然后做响应处理就可以了;\nif(d.type=='share')\n{\n //凋起分享\n sdk.shareAppMessage({type: 1,query: \"\",success:xxx,fail:xxx });\n}else\n{\n //凋起视频\n\n adSdk.videoSuccess = function(){\n //视频看完处理逻辑\n this.successFunction();\n };\n adSdk.videoFail = function(){\n //视频未看完处理逻辑\n this.failFunction();`\n };\n adSdk.videoError = function(){\n //视频凋起失败处理逻辑,要么就是广告id没有或者是调起视频广告太频繁微信限制调起,这里一般都会改成去调起分享\n this.errorFunction();\n };\n var videoAd = adSdk.createVideoAd(1,videoAdUnitId);\n videoAd.load().then(() => videoAd.show());\n \n}\n//如果多个视频广告id(videoAdUnitId)的情况,通过后台技术配置Config2获取对应的视频广告id,比如:sdk.getConfig2().videoAdUnitId1 或者sdk.getConfig2().videoAdUnitId2",
"title": "示例:",
"content": "sdk.getFromServer(\"testKey\",\"TestData\",null,(d)=>{\n console.log(\"获取返回\",d.key3);\n });",
"type": "json"
}
]
},
],
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
"groupTitle": "B"
},
{
"group": "C",
"name": "getButtonConfig",
"group": "B",
"name": "getItem",
"type": "数据存储",
"url": "数据存储",
"title": "getButtonConfig(取)",
"title": "getItem(取)",
"parameter": {
"fields": {
"Parameter": [
......@@ -395,8 +662,15 @@ define({ "api": [
"group": "Parameter",
"type": "String",
"optional": false,
"field": "buttonKey",
"description": "<p>按钮的键值 比如 hz2 hz3</p>"
"field": "key",
"description": "<p>键</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "value",
"description": "<p>值</p>"
}
]
}
......@@ -405,30 +679,49 @@ define({ "api": [
"examples": [
{
"title": "示例:",
"content": "var d = sdk.getButtonConfig(\"hz2\");\n特别说明:对于视频分享切换的解析返回的json为:\n{\"type\":\"share\",\"count\":5,\"left_count\":3,\"use_count\":2,\"next\":\"key_1\"}\n技术获取之后根据d.type判断类型然后做响应处理就可以了;",
"content": "var nick = sdk.getItem(\"nick\")",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
"groupTitle": "B"
},
{
"group": "C",
"name": "getConfig1",
"type": "运营配置",
"url": "游戏后台配置信息,运营人员使用的通用配置开关",
"title": "getConfig1(运营配置)",
"group": "B",
"name": "getServerTime",
"type": "数据获取",
"url": "获取服务器时间,一般用于时间比较严谨的场景",
"title": "getServerTime (取服务器时间)",
"success": {
"examples": [
{
"title": "示例:",
"content": "sdk.getServerTime((d)=>{\n if(d.c==1){\n console.log(\"获取返回\",d.nowTime);\n }\n });",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "B"
},
{
"group": "B",
"name": "removeItem",
"type": "数据存储",
"url": "数据存储",
"title": "removeItem(删)",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "Object",
"type": "String",
"optional": false,
"field": "callback",
"description": "<p>不存在返回null</p>"
"field": "key",
"description": "<p></p>"
}
]
}
......@@ -437,30 +730,37 @@ define({ "api": [
"examples": [
{
"title": "示例:",
"content": "var d = sdk.getConfig1();",
"content": "sdk.removeItem(\"nick\")",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
"groupTitle": "B"
},
{
"group": "C",
"name": "getConfig2",
"type": "程序配置",
"url": "游戏后台配置信息,程序员使用的游戏数据开关,可随便自定义数据:例如复活次数等",
"title": "getConfig2(程序配置)",
"group": "B",
"name": "sceneEnd",
"type": "数据存储",
"url": "数据存储",
"title": "sceneEnd(存) 玩家结束游戏场景调用",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "Object",
"type": "String",
"optional": false,
"field": "callback",
"description": "<p>不存在返回null</p>"
"field": "sceneName",
"description": "<p>场景名称,比如:第1关,第2关,厨房,矿坑,如果有调用setSceneEvent 两个传递场景名称必须要一样</p>"
},
{
"group": "Parameter",
"type": "JSON",
"optional": false,
"field": "extraData",
"description": "<p>额外数据,如果是正常结束可以传递 从哪里退出的场景,比如:正常退出 或者 返回按钮退出</p>"
}
]
}
......@@ -469,30 +769,37 @@ define({ "api": [
"examples": [
{
"title": "示例:",
"content": "var d = sdk.getConfig2();",
"content": "sdk.sceneEnd('第1关','返回按钮退出',(d)=>{\n console.log(\"场景回调\",d);\n})",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
"groupTitle": "B"
},
{
"group": "C",
"name": "getConfig3",
"type": "运营配置",
"url": "游戏后台配置信息,运营人员使用的通用配置开关",
"title": "相关按钮根据时间来配置以及跳转方式按钮属性getConfig3(运营配置)",
"group": "B",
"name": "setItem",
"type": "set",
"url": "数据存储",
"title": "setItem(存)",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "Object",
"type": "String",
"optional": false,
"field": "callback",
"description": "<p>不存在返回null</p>"
"field": "key",
"description": "<p>键</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "value",
"description": "<p>值</p>"
}
]
}
......@@ -501,30 +808,51 @@ define({ "api": [
"examples": [
{
"title": "示例:",
"content": "var d = sdk.getConfig3();",
"content": "sdk.setItem(\"nick\",\"hello\")",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
"groupTitle": "B"
},
{
"group": "C",
"name": "getConfig4",
"type": "技术程序控制",
"url": "游戏服务端控制一些需要服务端判断的比如:ip地区配置,getConfig4(技术程序)",
"title": "",
"group": "B",
"name": "setSceneEvent",
"type": "数据存储",
"url": "数据存储,一般用于事件埋点上报",
"title": "setSceneEvent(存) 将事件信息发送到乐玩服务器记录",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "Object",
"type": "String",
"optional": false,
"field": "callback",
"description": "<p>不存在返回null</p>"
"field": "sceneName",
"description": "<p>场景名称,比如:第1关,第2关,厨房,矿坑</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "eventName",
"description": "<p>事件名称,比如:点击、加载、触摸、移动</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "eventId",
"description": "<p>事件ID 通常谢按钮的英文或者中文名字,比如:首页-开始闯关</p>"
},
{
"group": "Parameter",
"type": "JSON",
"optional": false,
"field": "params",
"description": "<p>参数相关</p>"
}
]
}
......@@ -533,21 +861,21 @@ define({ "api": [
"examples": [
{
"title": "示例:",
"content": "var d = sdk.getConfig4();",
"content": "sdk.setSceneEvent(\"第一关\",\"点击\",\"首页-开始闯关\",{'uid':'8975621'},null)",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
"groupTitle": "B"
},
{
"group": "C",
"name": "getFromServer",
"type": "getFromServer",
"group": "B",
"name": "setToServer",
"type": "setToServer",
"url": "数据存储",
"title": "getFromServer(获取)",
"title": "setToServer(存用户服务器数据)",
"parameter": {
"fields": {
"Parameter": [
......@@ -563,51 +891,65 @@ define({ "api": [
"type": "String",
"optional": false,
"field": "dataType",
"description": "<p>数据类型 首字母大学的驼峰形式,例如:ShareGroup 或者 ShareLimit</p>"
"description": "<p>数据类型,首字母大学的驼峰形式,例如:ShareGroup 或者 ShareLimit</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "data",
"description": "<p>特殊情况下需要传递额外数据状况,一般不传递</p>"
"description": "<p>需要保存的数据</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "callback",
"description": "<p>回调</p> <p>sdk.getFromServer(&quot;testKey&quot;,&quot;TestData&quot;,null,(d)=&gt;{ console.log(&quot;获取返回&quot;,d.key3); });</p>"
"field": "expireTime",
"description": "<p>过期时间 单位(秒),0:默认一天;-1:永不失效(10年);</p> <p>注意:dataKey和dataType共同确定一个数据的key值,也就是说 如果同样传递key111但是如果dataType不一样,sdk会认为是不同的两个数据key</p>"
}
]
}
},
"examples": [
{
"title": "示例:",
"content": "var data = {'key3':'test'};\nsdk.setToServer(\"testKeyttt3\",\"TestData\",data,3600);",
"type": "json"
}
],
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
"groupTitle": "B"
},
{
"group": "C",
"name": "getItem",
"type": "数据存储",
"url": "数据存储",
"title": "getItem(取)",
"name": "Get",
"type": "Get",
"url": "发起网络请求",
"title": "Get(发起Get请求)",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "String",
"type": "String",
"optional": false,
"field": "url",
"description": "<p>请求地址</p>"
},
{
"group": "Parameter",
"type": "Object",
"optional": false,
"field": "key",
"description": "<p></p>"
"field": "reqData",
"description": "<p>请求参数</p>"
},
{
"group": "Parameter",
"type": "String",
"type": "Object",
"optional": false,
"field": "value",
"description": "<p></p>"
"field": "callback",
"description": "<p>不存在返回null</p>"
}
]
}
......@@ -616,7 +958,7 @@ define({ "api": [
"examples": [
{
"title": "示例:",
"content": "var nick = sdk.getItem(\"nick\")",
"content": "sdk.Get(\"https://xxx.xxx\", { user_id: user_id }, function (d) {\n console.log(d)\n});",
"type": "json"
}
]
......@@ -627,10 +969,10 @@ define({ "api": [
},
{
"group": "C",
"name": "getLocalCache",
"type": "数据存储",
"url": "数据存储",
"title": "getLocalCache(取)",
"name": "Post",
"type": "Post",
"url": "发起网络请求",
"title": "Post(发起Post请求)",
"parameter": {
"fields": {
"Parameter": [
......@@ -638,8 +980,22 @@ define({ "api": [
"group": "Parameter",
"type": "String",
"optional": false,
"field": "key",
"description": "<p>键</p>"
"field": "url",
"description": "<p>请求地址</p>"
},
{
"group": "Parameter",
"type": "Object",
"optional": false,
"field": "reqData",
"description": "<p>请求参数</p>"
},
{
"group": "Parameter",
"type": "Object",
"optional": false,
"field": "callback",
"description": "<p>不存在返回null</p>"
}
]
}
......@@ -648,7 +1004,7 @@ define({ "api": [
"examples": [
{
"title": "示例:",
"content": "var nick = sdk.getLocalCache(\"nick\")",
"content": "sdk.Post(sdk.ip + sdk.common, { user_id: user_id }, function (d) {\n console.log(d)\n});",
"type": "json"
}
]
......@@ -659,15 +1015,15 @@ define({ "api": [
},
{
"group": "C",
"name": "getServerTime",
"type": "数据存储",
"url": "数据获取",
"title": "getServerTime (取)",
"name": "Screenshot",
"type": "微信小游戏截图保存",
"url": "微信小游戏截图保存",
"title": "Screenshot(截图)",
"success": {
"examples": [
{
"title": "示例:",
"content": "sdk.getServerTime((d)=>{\n if(d.c==1){\n console.log(\"获取返回\",d.nowTime);\n }\n });",
"content": "//.摄像机组件、回调\nsdk.Screenshot((d)=>{\n if(d){\n console.log(\"图片保存成功:\", d)\n }else{\n console.log(\"图片保存失败:\", d)\n }\n})",
"type": "json"
}
]
......@@ -678,15 +1034,18 @@ define({ "api": [
},
{
"group": "C",
"name": "getUser",
"type": "获取本地用户信息",
"url": "获取本地用户信息(登录成功后,会在本地存储用户信息)",
"title": "getUser(获取用户信息)",
"name": "WeChatLogin",
"type": "新增、授权、登陆",
"url": "微信登录WeChatLogin对外提供新增、授权、登陆调用以及初始化",
"title": "WeChatLogin(微信登录)",
"deprecated": {
"content": "外部废弃调用该方法, use now (#A:WeChatLoginNoAuth)"
},
"success": {
"examples": [
{
"title": "示例:",
"content": "//.不存在返回null\nvar user = sdk.getUser();",
"content": "sdk.WeChatLogin((d)=>{\n var config1 = sdk.getConfig1();\n if(config1.hz2==1)\n {\n //显示\n xxx.active = true;\n \n xxx.addClickListener(() => {\n var d = sdk.getButtonConfig('hz2');\n //跳转到对应的小程序或者游戏\n sdk.navigateToMiniProgram(d);\n });\n }else\n {\n //隐藏\n }\n\n});",
"type": "json"
}
]
......@@ -697,15 +1056,15 @@ define({ "api": [
},
{
"group": "C",
"name": "moneyAmount",
"type": "数据获取",
"url": "获取用户金额",
"title": "moneyAmount(获取)",
"name": "checkUpdate",
"type": "检测版本更新",
"url": "微信小游戏(冷启动的时候会检查,如果有更新则会重启小游戏进行更新)",
"title": "checkUpdate(版本更新)非必要",
"success": {
"examples": [
{
"title": "示例:",
"content": "sdk.moneyAmount(null)",
"content": "sdk.checkUpdate();",
"type": "json"
}
]
......@@ -716,15 +1075,28 @@ define({ "api": [
},
{
"group": "C",
"name": "moneyAmount",
"name": "createOrder",
"type": "数据存储",
"url": "获得或者减少钱(分为单位)",
"title": "",
"url": "创建订单",
"title": "createOrder(创建订单)",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "int",
"optional": false,
"field": "cash",
"description": "<p>订单金额,当前提现的订单金额</p>"
}
]
}
},
"success": {
"examples": [
{
"title": "示例:",
"content": "sdk.operateMoney({type:'add',way:'redPacket',cash:50},null)",
"content": "sdk.createOrder(10,null)",
"type": "json"
}
]
......@@ -735,49 +1107,38 @@ define({ "api": [
},
{
"group": "C",
"name": "navigateToMiniProgram",
"type": "",
"url": "跳转到小程序或者小游戏注意有时间限定",
"title": "navigateToMiniProgram",
"name": "getButtonConfig",
"type": "数据存储",
"url": "数据存储",
"title": "getButtonConfig(取)",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "json",
"optional": false,
"field": "config",
"description": "<p>json包含app_id,path,extraData,env_version</p>"
},
{
"group": "Parameter",
"type": "fucntion",
"optional": false,
"field": "success",
"description": "<p>成功返回</p>"
},
{
"group": "Parameter",
"type": "fucntion",
"type": "String",
"optional": false,
"field": "fail",
"description": "<p>失败返回</p>"
"field": "buttonKey",
"description": "<p>按钮的键值 比如 hz2 hz3</p>"
},
{
"group": "Parameter",
"type": "fucntion",
"type": "int",
"optional": false,
"field": "complete",
"description": "<p>完成返回</p>"
"field": "isCount",
"description": "<p>值为1或者0 1:表示本次调用使用次数加一;0:表示本次调用使用次数不发生变化</p>"
}
]
}
},
"deprecated": {
"content": "废弃,外部替代使用为 (#A:getButtonConfig)"
},
"success": {
"examples": [
{
"title": "示例:",
"content": "var d = sdk.getButtonConfig('hz2');\nsdk.navigateToMiniProgram(d);",
"content": "var d = sdk.getButtonConfig2(\"xxx\",1);\n特别说明:对于视频分享切换的解析返回的json为:\n{\"type\":\"share\",\"count\":5,\"left_count\":3,\"use_count\":2,\"next\":\"key_1\"}\n技术获取之后根据d.type判断类型然后做响应处理就可以了;\nif(d.type=='share')\n{\n //凋起分享\n sdk.shareAppMessage({type: 1,query: \"\",success:xxx,fail:xxx });\n}else\n{\n //凋起视频\n\n adSdk.videoSuccess = function(){\n //视频看完处理逻辑\n this.successFunction();\n };\n adSdk.videoFail = function(){\n //视频未看完处理逻辑\n this.failFunction();`\n };\n adSdk.videoError = function(){\n //视频凋起失败处理逻辑,要么就是广告id没有或者是调起视频广告太频繁微信限制调起,这里一般都会改成去调起分享\n this.errorFunction();\n };\n var videoAd = adSdk.createVideoAd(1,videoAdUnitId);\n videoAd.load().then(() => videoAd.show());\n \n}\n//如果多个视频广告id(videoAdUnitId)的情况,通过后台技术配置Config2获取对应的视频广告id,比如:sdk.getConfig2().videoAdUnitId1 或者sdk.getConfig2().videoAdUnitId2",
"type": "json"
}
]
......@@ -788,19 +1149,19 @@ define({ "api": [
},
{
"group": "C",
"name": "onMessage",
"type": "主域监听子域发送的消息",
"url": "主域监听子域发送的消息",
"title": "onMessage(监听消息)",
"name": "getConfig3",
"type": "运营配置",
"url": "游戏后台配置信息,运营人员使用的通用配置开关,相关按钮根据时间来配置以及跳转方式按钮属性",
"title": "getConfig3(运营配置)",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "callback",
"type": "Object",
"optional": false,
"field": "callback",
"description": "<p>回调函数</p>"
"description": "<p>不存在返回null</p>"
}
]
}
......@@ -809,7 +1170,7 @@ define({ "api": [
"examples": [
{
"title": "示例:",
"content": "sdk.onMessage((d)=>{\n console.log(d)\n})",
"content": "var d = sdk.getConfig3();",
"type": "json"
}
]
......@@ -820,78 +1181,19 @@ define({ "api": [
},
{
"group": "C",
"name": "onShareAppMessage",
"type": "分享",
"url": "注册微信右上角分享",
"title": "onShareAppMessage(分享)",
"name": "getConfig4",
"type": "技术程序控制",
"url": "游戏服务端控制一些需要服务端判断的比如:ip地区配置,getConfig4(技术程序)",
"title": "",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "int",
"optional": false,
"field": "type",
"defaultValue": "0",
"description": "<p>后台自定义的分享类型;例如:0:右上角分享、1:普通分享 2:分享加金币</p>"
},
{
"group": "Parameter",
"type": "int",
"optional": false,
"field": "specialFlag",
"defaultValue": "0",
"description": "<p>特殊标记,例如0:默认、1:邀新好友、2:邀旧好友</p>"
},
{
"group": "Parameter",
"type": "int",
"type": "Object",
"optional": false,
"field": "rewardFlag",
"defaultValue": "xxx",
"description": "<p>活动或者道具id</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": true,
"field": "title",
"description": "<p>转发标题</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": true,
"field": "imageUrl",
"description": "<p>转发显示图片的链接</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": true,
"field": "query",
"description": "<p>必须是 key1=val1&amp;key2=val2 的格式。</p>"
},
{
"group": "Parameter",
"type": "callback",
"optional": true,
"field": "success",
"description": "<p>成功回调</p>"
},
{
"group": "Parameter",
"type": "callback",
"optional": true,
"field": "fail",
"description": "<p>失败回调</p>"
},
{
"group": "Parameter",
"type": "callback",
"optional": true,
"field": "cancel",
"description": "<p>点击取消分享按钮回调</p>"
"field": "callback",
"description": "<p>不存在返回null</p>"
}
]
}
......@@ -900,7 +1202,7 @@ define({ "api": [
"examples": [
{
"title": "示例:",
"content": "sdk.shareAppMessage({type: 1,query: \"\",success:xxx,cancel:xxx,fail:xxx,rewardFlag:'' });",
"content": "var d = sdk.getConfig4();",
"type": "json"
}
]
......@@ -911,10 +1213,10 @@ define({ "api": [
},
{
"group": "C",
"name": "postMessage",
"type": "主域向子域发送消息",
"url": "主域向子域发送消息",
"title": "postMessage(发送消息)",
"name": "getLocalCache",
"type": "数据存储",
"url": "数据存储,取setLocalCache方法存的数据",
"title": "getLocalCache(取)",
"parameter": {
"fields": {
"Parameter": [
......@@ -922,8 +1224,8 @@ define({ "api": [
"group": "Parameter",
"type": "String",
"optional": false,
"field": "msg",
"description": "<p>发送给子域的消息</p>"
"field": "key",
"description": "<p></p>"
}
]
}
......@@ -932,7 +1234,7 @@ define({ "api": [
"examples": [
{
"title": "示例:",
"content": "sdk.postMessage(\"hello\")",
"content": "var nick = sdk.getLocalCache(\"nick\")",
"type": "json"
}
]
......@@ -943,28 +1245,44 @@ define({ "api": [
},
{
"group": "C",
"name": "removeItem",
"name": "init_api",
"type": "初始化",
"url": "初始化ip",
"title": "init_api",
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
},
{
"group": "C",
"name": "moneyAmount",
"type": "数据存储",
"url": "数据存储",
"title": "removeItem(删)",
"parameter": {
"fields": {
"Parameter": [
"url": "获得或者减少钱(分为单位)",
"title": "operateMoney(获得或者减少钱)",
"success": {
"examples": [
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "key",
"description": "<p>键</p>"
"title": "示例:",
"content": "sdk.operateMoney({type:'add',way:'redPacket',cash:50},null)",
"type": "json"
}
]
}
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
},
{
"group": "C",
"name": "moneyAmount",
"type": "数据获取",
"url": "获取用户金额",
"title": "moneyAmount(获取用户金额)",
"success": {
"examples": [
{
"title": "示例:",
"content": "sdk.removeItem(\"nick\")",
"content": "sdk.moneyAmount(null)",
"type": "json"
}
]
......@@ -975,65 +1293,40 @@ define({ "api": [
},
{
"group": "C",
"name": "sceneEnd",
"type": "数据存储",
"url": "数据存储",
"title": "sceneEnd(存) 玩家结束游戏场景调用",
"name": "navigateToMiniProgram",
"type": "跳转到小程序",
"url": "跳转到小程序或者小游戏注意有时间限定",
"title": "navigateToMiniProgram(跳转到小程序)",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "String",
"type": "json",
"optional": false,
"field": "sceneName",
"description": "<p>场景名称,比如:第1关,第2关,厨房,矿坑,如果有调用setSceneEvent 两个传递场景名称必须要一样</p>"
"field": "config",
"description": "<p>json包含app_id,path,extraData,env_version</p>"
},
{
"group": "Parameter",
"type": "JSON",
"type": "fucntion",
"optional": false,
"field": "extraData",
"description": "<p>额外数据,如果是正常结束可以传递 从哪里退出的场景,比如:正常退出 或者 返回按钮退出</p>"
}
]
}
},
"success": {
"examples": [
{
"title": "示例:",
"content": "sdk.sceneEnd('第1关','返回按钮退出',(d)=>{\n console.log(\"场景回调\",d);\n})",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
"field": "success",
"description": "<p>成功返回</p>"
},
{
"group": "C",
"name": "sceneStart",
"type": "数据存储",
"url": "数据存储",
"title": "sceneStart(存) 玩家进场景界面开始调用",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "String",
"type": "fucntion",
"optional": false,
"field": "sceneName",
"description": "<p>场景名称,比如:第1关,第2关,厨房,矿坑,如果有调用setSceneEvent 两个传递场景名称必须要一样</p>"
"field": "fail",
"description": "<p>失败返回</p>"
},
{
"group": "Parameter",
"type": "JSON",
"type": "fucntion",
"optional": false,
"field": "extraData",
"description": "<p>额外数据,可以传递从哪里进入场景,比如:正常进入 或者 奖励进入</p>"
"field": "complete",
"description": "<p>完成返回</p>"
}
]
}
......@@ -1042,7 +1335,7 @@ define({ "api": [
"examples": [
{
"title": "示例:",
"content": "sdk.sceneStart('第1关','正常进入',null)",
"content": "var d = sdk.getButtonConfig('hz2');\nsdk.navigateToMiniProgram(d);",
"type": "json"
}
]
......@@ -1053,26 +1346,19 @@ define({ "api": [
},
{
"group": "C",
"name": "setItem",
"type": "set",
"url": "数据存储",
"title": "setItem(存)",
"name": "onMessage",
"type": "主域监听子域发送的消息",
"url": "主域监听子域发送的消息",
"title": "onMessage(监听消息)",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "key",
"description": "<p>键</p>"
},
{
"group": "Parameter",
"type": "String",
"type": "callback",
"optional": false,
"field": "value",
"description": "<p></p>"
"field": "callback",
"description": "<p>回调函数</p>"
}
]
}
......@@ -1081,7 +1367,7 @@ define({ "api": [
"examples": [
{
"title": "示例:",
"content": "sdk.setItem(\"nick\",\"hello\")",
"content": "sdk.onMessage((d)=>{\n console.log(d)\n})",
"type": "json"
}
]
......@@ -1092,10 +1378,10 @@ define({ "api": [
},
{
"group": "C",
"name": "setLocalCache",
"type": "set",
"url": "数据存储",
"title": "setLocalCache(存)",
"name": "postMessage",
"type": "主域向子域发送消息",
"url": "主域向子域发送消息",
"title": "postMessage(发送消息)",
"parameter": {
"fields": {
"Parameter": [
......@@ -1103,22 +1389,8 @@ define({ "api": [
"group": "Parameter",
"type": "String",
"optional": false,
"field": "key",
"description": "<p>键</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "value",
"description": "<p>值</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "expireTime",
"description": "<p>过期时间单位(秒)</p>"
"field": "msg",
"description": "<p>发送给子域的消息</p>"
}
]
}
......@@ -1127,7 +1399,7 @@ define({ "api": [
"examples": [
{
"title": "示例:",
"content": "sdk.setLocalCache(\"nick\",\"hello\")",
"content": "sdk.postMessage(\"hello\")",
"type": "json"
}
]
......@@ -1138,10 +1410,10 @@ define({ "api": [
},
{
"group": "C",
"name": "setSceneEvent",
"name": "sceneStart",
"type": "数据存储",
"url": "数据存储",
"title": "setEvent(存) 将事件信息发送到乐玩服务器记录",
"title": "sceneStart(存) 玩家进场景界面开始调用",
"parameter": {
"fields": {
"Parameter": [
......@@ -1150,28 +1422,14 @@ define({ "api": [
"type": "String",
"optional": false,
"field": "sceneName",
"description": "<p>场景名称,比如:第1关,第2关,厨房,矿坑</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "eventName",
"description": "<p>事件名称,比如:点击、加载、触摸、移动</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "eventId",
"description": "<p>事件ID 通常谢按钮的英文或者中文名字,比如:首页-开始闯关</p>"
"description": "<p>场景名称,比如:第1关,第2关,厨房,矿坑,如果有调用setSceneEvent 两个传递场景名称必须要一样</p>"
},
{
"group": "Parameter",
"type": "JSON",
"optional": false,
"field": "params",
"description": "<p>参数相关</p>"
"field": "extraData",
"description": "<p>额外数据,可以传递从哪里进入场景,比如:正常进入 或者 奖励进入</p>"
}
]
}
......@@ -1180,7 +1438,7 @@ define({ "api": [
"examples": [
{
"title": "示例:",
"content": "sdk.setSceneEvent(\"第一关\",\"点击\",\"首页-开始闯关\",{'uid':'8975621'},null)",
"content": "sdk.sceneStart('第1关','正常进入',null)",
"type": "json"
}
]
......@@ -1191,10 +1449,10 @@ define({ "api": [
},
{
"group": "C",
"name": "setToServer",
"type": "setToServer",
"url": "数据存储",
"title": "setToServer(存)",
"name": "setLocalCache",
"type": "set",
"url": "数据存储,有时效的数据可以调用该方法存",
"title": "setLocalCache(存)",
"parameter": {
"fields": {
"Parameter": [
......@@ -1202,33 +1460,35 @@ define({ "api": [
"group": "Parameter",
"type": "String",
"optional": false,
"field": "dataKey",
"field": "key",
"description": "<p>键</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "dataType",
"description": "<p>数据类型,首字母大学的驼峰形式,例如:ShareGroup 或者 ShareLimit</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "data",
"description": "<p>需要保存的数据</p>"
"field": "value",
"description": "<p>值</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "expireTime",
"description": "<p>过期时间 单位(秒),0:默认一天;-1:永不失效(10年);</p> <p>注意:dataKey和dataType共同确定一个数据的key值,也就是说 如果同样传递key111但是如果dataType不一样,sdk会认为是不同的两个数据key</p> <p>var data = {'key3':'test'}; sdk.setToServer(&quot;testKeyttt3&quot;,&quot;TestData&quot;,data,3600);</p>"
"description": "<p>过期时间单位(秒)</p>"
}
]
}
},
"success": {
"examples": [
{
"title": "示例:",
"content": "sdk.setLocalCache(\"nick\",\"hello\")",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
......@@ -1281,91 +1541,10 @@ define({ "api": [
},
{
"group": "C",
"name": "shareAppMessage",
"type": "分享",
"url": "主动拉起微信分享",
"title": "shareAppMessage(分享)",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "int",
"optional": false,
"field": "type",
"defaultValue": "1",
"description": "<p>后台自定义的分享类型;例如:0:右上角分享、1:普通分享 2:分享加金币</p>"
},
{
"group": "Parameter",
"type": "int",
"optional": false,
"field": "specialFlag",
"defaultValue": "0",
"description": "<p>特殊标记,例如0:默认、1:邀新好友、2:邀旧好友</p>"
},
{
"group": "Parameter",
"type": "int",
"optional": false,
"field": "rewardFlag",
"defaultValue": "xxx",
"description": "<p>活动或者道具id</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": true,
"field": "title",
"description": "<p>转发标题</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": true,
"field": "imageUrl",
"description": "<p>转发显示图片的链接</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": true,
"field": "query",
"description": "<p>必须是 key1=val1&amp;key2=val2 的格式。</p>"
},
{
"group": "Parameter",
"type": "callback",
"optional": true,
"field": "success",
"description": "<p>成功回调</p>"
},
{
"group": "Parameter",
"type": "callback",
"optional": true,
"field": "fail",
"description": "<p>失败回调</p>"
},
{
"group": "Parameter",
"type": "callback",
"optional": true,
"field": "cancel",
"description": "<p>点击取消分享按钮回调</p>"
}
]
}
},
"success": {
"examples": [
{
"title": "示例:",
"content": "sdk.shareAppMessage({type: 1,query: \"\",success:xxx,cancel:xxx,fail:xxx,rewardFlag:'xxx' });",
"type": "json"
}
]
},
"name": "setWeChatListener",
"type": "全局监听",
"url": "微信小游戏显示和隐藏的监听事件,无需手动调用,不对外提供使用",
"title": "setWeChatListener(游戏显示和隐藏监听)",
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
......@@ -1420,8 +1599,8 @@ define({ "api": [
"group": "C",
"name": "uploadSceneEvent",
"type": "数据存储",
"url": "数据存储",
"title": "uploadSceneEvent(存) 将事件信息发送到乐玩服务器记录",
"url": "将事件信息发送到乐玩服务器记录",
"title": "uploadSceneEvent(将事件信息发送到乐玩服务器记录)",
"parameter": {
"fields": {
"Parameter": [
......@@ -1430,11 +1609,21 @@ define({ "api": [
"type": "JsonArray",
"optional": false,
"field": "eventJsonArray",
"description": "<p>要上传的json数组 sdk.uploadSceneEvent(null,'游戏结束',null) //游戏上传场景数据 sdk.uploadSceneEvent(jsonArray,'',null) //将要上传的数据传递过来</p>"
"description": "<p>要上传的json数组</p>"
}
]
}
},
"deprecated": {
"content": "废弃,sdk内部调用,外部一般调用这个方法即可 (#B:setSceneEvent)"
},
"examples": [
{
"title": "示例:",
"content": "sdk.uploadSceneEvent(null,'游戏结束',null) //游戏上传场景数据\nsdk.uploadSceneEvent(jsonArray,'',null) //将要上传的数据传递过来",
"type": "json"
}
],
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
......
[
{
"group": "A",
"name": "init__v1_006___sdk_____________sdk_WeChatLogin_______sdk_WeChatLogin__d_____var_config1___sdk_getConfig1____if_config1_hz2__1_________xxx_active___true__xxx_addClickListener_________var_d___sdk_getButtonConfig__hz2____________________sdk_navigateToMiniProgram_d________else_____________",
"type": "",
"url": "",
"name": "ABC",
"type": "sdk说明",
"url": "分组A中的方法都是游戏中基本必用的,分组B中的方法是常用的数据存储、获取和事件埋点上报,分组C的方法很少调用",
"title": "ABC(sdk说明必看)",
"success": {
"examples": [
{
"title": "示例:",
"content": "//A",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "A"
},
{
"group": "C",
"name": "Get",
"type": "Get",
"url": "发起网络请求",
"title": "Get(发起Get请求)",
"group": "A",
"name": "WeChatLoginNoAuth",
"type": "无授权登陆",
"url": "微信登录WeChatLoginNoAuth对外提供新增、授权、登陆调用以及初始化",
"title": "WeChatLoginNoAuth(无授权登录)",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "String",
"type": "function",
"optional": false,
"field": "url",
"description": "<p>请求地址</p>"
"field": "callback",
"description": "<p>登录回调</p>"
}
]
}
},
"examples": [
{
"title": "示例:",
"content": "sdk.WeChatLoginNoAuth((userData)=>{\n console.log(userData);\n})",
"type": "json"
}
],
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "A"
},
{
"group": "A",
"name": "WxAuthLoginOpacity",
"type": "微信授权",
"url": "微信授权登录,将透明图片附着在游戏中功能按钮之上,点击弹出授权按钮",
"title": "WxAuthLoginOpacity(授权)",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "Object",
"optional": true,
"field": "obj",
"description": "<p>传递按钮位置信息 width height left top</p>"
}
]
}
},
"examples": [
{
"title": "示例:",
"content": "var obj = {\n width: 100,\n height: 200,\n left: 100,\n top: 100\n}\nsdk.WxAuthLoginOpacity(obj,function(userInfo){\n sdk.log(userInfo);\n})",
"type": "json"
}
],
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "A"
},
{
"group": "A",
"name": "createImage",
"type": "显示网络图片",
"url": "微信小游戏加载图片",
"title": "createImage(显示图片)",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "cc.Sprite",
"optional": false,
"field": "reqData",
"description": "<p>请求参数</p>"
"field": "sprite",
"description": "<p>显示图片的Sprite</p>"
},
{
"group": "Parameter",
"type": "Object",
"type": "String",
"optional": false,
"field": "callback",
"description": "<p>不存在返回null</p>"
"field": "url",
"description": "<p>需要加载的图片地址</p>"
},
{
"group": "Parameter",
"type": "callback",
"optional": true,
"field": "cb",
"description": "<p>图片加载回调,成功回调参数值为图片纹理,失败回调参数值为null</p>"
},
{
"group": "Parameter",
"type": "Boolean",
"optional": true,
"field": "cache",
"description": "<p>是否缓存纹理</p>"
}
]
}
......@@ -45,21 +122,40 @@
"examples": [
{
"title": "示例:",
"content": "sdk.Get(\"https://xxx.xxx\", { user_id: user_id }, function (d) {\n console.log(d)\n});",
"content": "\nsdk.createImage(itemNode.getComponent(cc.Sprite), imageUrl, null , true);//缓存图片\nsdk.createImage(itemNode.getComponent(cc.Sprite), imageUrl, null , false);//不缓存图片",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
"groupTitle": "A"
},
{
"group": "C",
"name": "Post",
"type": "Post",
"url": "发起网络请求",
"title": "Post(发起Post请求)",
"group": "A",
"name": "error",
"type": "console",
"url": "console.error封装",
"title": "error(打印error信息)",
"success": {
"examples": [
{
"title": "示例:",
"content": "//sdk.debug游戏入口初始化一次即可\nsdk.debug = true;\nsdk.error(1111)",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "A"
},
{
"group": "A",
"name": "getButtonConfig",
"type": "数据存储",
"url": "数据存储",
"title": "getButtonConfig(获取按钮配置)视频或分享切换",
"parameter": {
"fields": {
"Parameter": [
......@@ -67,16 +163,66 @@
"group": "Parameter",
"type": "String",
"optional": false,
"field": "url",
"description": "<p>请求地址</p>"
"field": "buttonKey",
"description": "<p>按钮的键值 比如 hz2 hz3</p>"
}
]
}
},
"success": {
"examples": [
{
"title": "示例:",
"content": "\nvar d = sdk.getButtonConfig2(\"xxx\",1);\n//特别说明:对于视频分享切换的解析返回的json为:\n//{\"type\":\"share\",\"count\":5,\"left_count\":3,\"use_count\":2,\"next\":\"key_1\"}\n//技术获取之后根据d.type判断类型然后做响应处理就可以了;\nif(d.type=='share')\n{\n //凋起分享\n sdk.shareAppMessage({type: 1,query: \"\",success:xxx,fail:xxx });\n}else\n{\n //凋起视频\n\n adSdk.videoSuccess = function(){\n //视频看完处理逻辑\n this.successFunction();\n };\n adSdk.videoFail = function(){\n //视频未看完处理逻辑\n this.failFunction();`\n };\n adSdk.videoError = function(){\n //视频凋起失败处理逻辑,要么就是广告id没有或者是调起视频广告太频繁微信限制调起,这里一般都会改成去调起分享\n this.errorFunction();\n };\n var videoAd = adSdk.createVideoAd(1,videoAdUnitId);\n videoAd.load().then(() => videoAd.show());\n \n}\n//如果多个视频广告id(videoAdUnitId)的情况,通过后台技术配置Config2获取对应的视频广告id,比如:sdk.getConfig2().videoAdUnitId1 或者sdk.getConfig2().videoAdUnitId2",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "A"
},
{
"group": "A",
"name": "getConfig1",
"type": "运营配置",
"url": "游戏后台配置信息,运营人员使用的通用配置开关",
"title": "getConfig1(运营配置)",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "Object",
"optional": false,
"field": "reqData",
"description": "<p>请求参数</p>"
"field": "callback",
"description": "<p>不存在返回null</p>"
}
]
}
},
"success": {
"examples": [
{
"title": "示例:",
"content": "var d = sdk.getConfig1();",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "A"
},
{
"group": "A",
"name": "getConfig2",
"type": "程序配置",
"url": "游戏后台配置信息,程序员使用的游戏数据开关,可随便自定义数据:例如复活次数等",
"title": "getConfig2(程序配置)",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "Object",
......@@ -91,163 +237,272 @@
"examples": [
{
"title": "示例:",
"content": "sdk.Post(sdk.ip + sdk.common, { user_id: user_id }, function (d) {\n console.log(d)\n});",
"content": "var d = sdk.getConfig2();",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
"groupTitle": "A"
},
{
"group": "C",
"name": "Screenshot",
"type": "微信小游戏截图保存",
"url": "微信小游戏截图保存",
"title": "Screenshot(截图)",
"group": "A",
"name": "getUser",
"type": "获取本地用户信息",
"url": "获取本地用户信息(登录成功后,会在本地存储用户信息)",
"title": "getUser(获取用户信息)",
"success": {
"examples": [
{
"title": "示例:",
"content": "//.摄像机组件、回调\nsdk.Screenshot((d)=>{\n if(d){\n console.log(\"图片保存成功:\", d)\n }else{\n console.log(\"图片保存失败:\", d)\n }\n})",
"content": "//.不存在返回null\nvar user = sdk.getUser();",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
"groupTitle": "A"
},
{
"group": "C",
"name": "WeChatLogin",
"type": "新增、授权、登陆",
"url": "微信登录 WeChatLogin 对外提供新增、授权、登陆调用以及初始化",
"title": "注意v1.006版本sdk 只需要调用登录就可以了不在需要调用init了,sdk内部已经做了init操作了",
"group": "A",
"name": "init",
"type": "初始化",
"url": "从v1.006版本的sdk已经废弃改方法,只需要调用sdk.WeChatLoginNoAuth方法就可以了",
"title": "init(初始化)",
"deprecated": {
"content": "从v1.006版本的sdk已经废弃改方法,只需要调用 (#A:WeChatLoginNoAuth)方法就可以了"
},
"success": {
"examples": [
{
"title": "示例:",
"content": "sdk.WeChatLoginNoAuth((d)=>{\n var config1 = sdk.getConfig1();\n if(config1.hz2==1)\n {\n //显示\n xxx.active = true;\n xxx.addClickListener(() => {\n var d = sdk.getButtonConfig('hz2');\n //跳转到对应的小程序或者游戏\n sdk.navigateToMiniProgram(d);\n });\n }else\n {\n //隐藏\n }\n\n});",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "A"
},
{
"group": "A",
"name": "log",
"type": "console",
"url": "console.log封装",
"title": "log(打印log信息)",
"success": {
"examples": [
{
"title": "示例:",
"content": "sdk.WeChatLogin((d)=>{\n var config1 = sdk.getConfig1();\n if(config1.hz2==1)\n {\n //显示\n xxx.active = true;\n \n xxx.addClickListener(() => {\n var d = sdk.getButtonConfig('hz2');\n //跳转到对应的小程序或者游戏\n sdk.navigateToMiniProgram(d);\n });\n }else\n {\n //隐藏\n }\n\n});",
"content": "//sdk.debug游戏入口初始化一次即可\nsdk.debug = true;\nsdk.log(1111)",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
"groupTitle": "A"
},
{
"group": "C",
"name": "WxAuthLoginOpacity___________________________",
"group": "A",
"name": "onShareAppMessage",
"type": "分享",
"url": "注册微信右上角分享,游戏初始化就可以调用了",
"title": "onShareAppMessage(分享)",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "Object",
"type": "int",
"optional": false,
"field": "type",
"defaultValue": "0",
"description": "<p>后台自定义的分享类型;例如:0:右上角分享、1:普通分享 2:分享加金币</p>"
},
{
"group": "Parameter",
"type": "int",
"optional": false,
"field": "specialFlag",
"defaultValue": "0",
"description": "<p>特殊标记,例如0:默认、1:邀新好友、2:邀旧好友</p>"
},
{
"group": "Parameter",
"type": "int",
"optional": false,
"field": "rewardFlag",
"defaultValue": "xxx",
"description": "<p>活动或者道具id</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": true,
"field": "obj",
"description": "<p>传递按钮位置信息 width height left top</p>"
"field": "title",
"description": "<p>转发标题</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": true,
"field": "imageUrl",
"description": "<p>转发显示图片的链接</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": true,
"field": "query",
"description": "<p>必须是 key1=val1&amp;key2=val2 的格式。</p>"
},
{
"group": "Parameter",
"type": "callback",
"optional": true,
"field": "success",
"description": "<p>成功回调</p>"
},
{
"group": "Parameter",
"type": "callback",
"optional": true,
"field": "fail",
"description": "<p>失败回调</p>"
},
{
"group": "Parameter",
"type": "callback",
"optional": true,
"field": "cancel",
"description": "<p>点击取消分享按钮回调</p>"
}
]
}
},
"type": "微信授权",
"url": "微信授权登录",
"title": "WxAuthLoginOpacity(授权)不对外提供调用",
"success": {
"examples": [
{
"title": "示例:",
"content": "sdk.shareAppMessage({type: 1,query: \"\",success:xxx,cancel:xxx,fail:xxx,rewardFlag:'' });",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
"groupTitle": "A"
},
{
"group": "C",
"name": "checkUpdate",
"type": "检测版本更新",
"url": "微信小游戏(冷启动的时候会检查,如果有更新则会重启小游戏进行更新)",
"title": "checkUpdate(版本更新)",
"group": "A",
"name": "setUserCloudStorage",
"type": "主域上报数据",
"url": "对用户托管数据进行写数据操作,子域排行榜的数据来源,允许同时写多组KV数据",
"title": "setUserCloudStorage(主域上报数据)",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "Object",
"optional": false,
"field": "kvDataList",
"description": "<p>发送给子域的消息</p>"
}
]
}
},
"success": {
"examples": [
{
"title": "示例:",
"content": "sdk.checkUpdate();",
"content": "var kvDataList = [{key: 'score',value: 100}];\nsdk.setUserCloudStorage(kvDataList,function(res){\n sdk.log(res);\n})",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
"groupTitle": "A"
},
{
"group": "C",
"name": "createImage",
"type": "显示网络图片",
"url": "微信小游戏加载图片",
"title": "createImage(显示图片)",
"group": "A",
"name": "shareAppMessage",
"type": "分享",
"url": "主动拉起微信分享",
"title": "shareAppMessage(分享)",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "cc.Sprite",
"type": "int",
"optional": false,
"field": "sprite",
"description": "<p>显示图片的Sprite</p>"
"field": "type",
"defaultValue": "1",
"description": "<p>后台自定义的分享类型;例如:0:右上角分享、1:普通分享 2:分享加金币</p>"
},
{
"group": "Parameter",
"type": "String",
"type": "int",
"optional": false,
"field": "url",
"description": "<p>需要加载的图片地址</p>"
"field": "specialFlag",
"defaultValue": "0",
"description": "<p>特殊标记,例如0:默认、1:邀新好友、2:邀旧好友</p>"
},
{
"group": "Parameter",
"type": "int",
"optional": false,
"field": "rewardFlag",
"defaultValue": "xxx",
"description": "<p>活动或者道具id</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": true,
"field": "title",
"description": "<p>转发标题</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": true,
"field": "imageUrl",
"description": "<p>转发显示图片的链接</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": true,
"field": "query",
"description": "<p>必须是 key1=val1&amp;key2=val2 的格式。</p>"
},
{
"group": "Parameter",
"type": "callback",
"optional": false,
"field": "cb",
"description": "<p>图片加载回调,成功回调参数值为图片纹理,失败回调参数值为null</p>"
"optional": true,
"field": "success",
"description": "<p>成功回调</p>"
},
{
"group": "Parameter",
"type": "Boolean",
"optional": false,
"field": "cache",
"description": "<p>是否缓存纹理</p>"
}
]
}
},
"success": {
"examples": [
{
"title": "示例:",
"content": "或\nsdk.createImage(itemNode.getComponent(cc.Sprite), imageUrl, null , true);",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
"type": "callback",
"optional": true,
"field": "fail",
"description": "<p>失败回调</p>"
},
{
"group": "C",
"name": "createOrder",
"type": "数据存储",
"url": "创建订单",
"title": "createOrder(存)",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "int",
"optional": false,
"field": "cash",
"description": "<p>订单金额,当前提现的订单金额</p>"
"type": "callback",
"optional": true,
"field": "cancel",
"description": "<p>点击取消分享按钮回调</p>"
}
]
}
......@@ -256,21 +511,21 @@
"examples": [
{
"title": "示例:",
"content": "sdk.createOrder(10,null)",
"content": "sdk.shareAppMessage({type: 1,query: \"\",success:xxx,cancel:xxx,fail:xxx,rewardFlag:'xxx' });",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
"groupTitle": "A"
},
{
"group": "C",
"group": "B",
"name": "formatTime",
"type": "",
"url": "数据获取",
"title": "formatTime ()",
"type": "时间格式化",
"url": "对时间格式化",
"title": "formatTime (时间格式化)",
"parameter": {
"fields": {
"Parameter": [
......@@ -309,10 +564,10 @@
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
"groupTitle": "B"
},
{
"group": "C",
"group": "B",
"name": "gameStart",
"type": "数据存储",
"url": "数据存储",
......@@ -341,14 +596,14 @@
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
"groupTitle": "B"
},
{
"group": "C",
"name": "getButtonConfig",
"type": "数据存储",
"group": "B",
"name": "getFromServer",
"type": "getFromServer",
"url": "数据存储",
"title": "getButtonConfig(取)",
"title": "getFromServer(取用户服务器数据)",
"parameter": {
"fields": {
"Parameter": [
......@@ -356,38 +611,50 @@
"group": "Parameter",
"type": "String",
"optional": false,
"field": "buttonKey",
"description": "<p>按钮的键值 比如 hz2 hz3</p>"
"field": "dataKey",
"description": "<p></p>"
},
{
"group": "Parameter",
"type": "int",
"type": "String",
"optional": false,
"field": "isCount",
"description": "<p>值为1或者0 1:表示本次调用使用次数加一;0:表示本次调用使用次数不发生变化</p>"
"field": "dataType",
"description": "<p>数据类型 首字母大学的驼峰形式,例如:ShareGroup 或者 ShareLimit</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "data",
"description": "<p>特殊情况下需要传递额外数据状况,一般不传递</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "callback",
"description": "<p>回调</p>"
}
]
}
},
"success": {
"examples": [
{
"title": "示例:",
"content": "var d = sdk.getButtonConfig2(\"xxx\",1);\n特别说明:对于视频分享切换的解析返回的json为:\n{\"type\":\"share\",\"count\":5,\"left_count\":3,\"use_count\":2,\"next\":\"key_1\"}\n技术获取之后根据d.type判断类型然后做响应处理就可以了;\nif(d.type=='share')\n{\n //凋起分享\n sdk.shareAppMessage({type: 1,query: \"\",success:xxx,fail:xxx });\n}else\n{\n //凋起视频\n\n adSdk.videoSuccess = function(){\n //视频看完处理逻辑\n this.successFunction();\n };\n adSdk.videoFail = function(){\n //视频未看完处理逻辑\n this.failFunction();`\n };\n adSdk.videoError = function(){\n //视频凋起失败处理逻辑,要么就是广告id没有或者是调起视频广告太频繁微信限制调起,这里一般都会改成去调起分享\n this.errorFunction();\n };\n var videoAd = adSdk.createVideoAd(1,videoAdUnitId);\n videoAd.load().then(() => videoAd.show());\n \n}\n//如果多个视频广告id(videoAdUnitId)的情况,通过后台技术配置Config2获取对应的视频广告id,比如:sdk.getConfig2().videoAdUnitId1 或者sdk.getConfig2().videoAdUnitId2",
"title": "示例:",
"content": "sdk.getFromServer(\"testKey\",\"TestData\",null,(d)=>{\n console.log(\"获取返回\",d.key3);\n });",
"type": "json"
}
]
},
],
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
"groupTitle": "B"
},
{
"group": "C",
"name": "getButtonConfig",
"group": "B",
"name": "getItem",
"type": "数据存储",
"url": "数据存储",
"title": "getButtonConfig(取)",
"title": "getItem(取)",
"parameter": {
"fields": {
"Parameter": [
......@@ -395,8 +662,15 @@
"group": "Parameter",
"type": "String",
"optional": false,
"field": "buttonKey",
"description": "<p>按钮的键值 比如 hz2 hz3</p>"
"field": "key",
"description": "<p>键</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "value",
"description": "<p>值</p>"
}
]
}
......@@ -405,30 +679,49 @@
"examples": [
{
"title": "示例:",
"content": "var d = sdk.getButtonConfig(\"hz2\");\n特别说明:对于视频分享切换的解析返回的json为:\n{\"type\":\"share\",\"count\":5,\"left_count\":3,\"use_count\":2,\"next\":\"key_1\"}\n技术获取之后根据d.type判断类型然后做响应处理就可以了;",
"content": "var nick = sdk.getItem(\"nick\")",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
"groupTitle": "B"
},
{
"group": "C",
"name": "getConfig1",
"type": "运营配置",
"url": "游戏后台配置信息,运营人员使用的通用配置开关",
"title": "getConfig1(运营配置)",
"group": "B",
"name": "getServerTime",
"type": "数据获取",
"url": "获取服务器时间,一般用于时间比较严谨的场景",
"title": "getServerTime (取服务器时间)",
"success": {
"examples": [
{
"title": "示例:",
"content": "sdk.getServerTime((d)=>{\n if(d.c==1){\n console.log(\"获取返回\",d.nowTime);\n }\n });",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "B"
},
{
"group": "B",
"name": "removeItem",
"type": "数据存储",
"url": "数据存储",
"title": "removeItem(删)",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "Object",
"type": "String",
"optional": false,
"field": "callback",
"description": "<p>不存在返回null</p>"
"field": "key",
"description": "<p></p>"
}
]
}
......@@ -437,30 +730,37 @@
"examples": [
{
"title": "示例:",
"content": "var d = sdk.getConfig1();",
"content": "sdk.removeItem(\"nick\")",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
"groupTitle": "B"
},
{
"group": "C",
"name": "getConfig2",
"type": "程序配置",
"url": "游戏后台配置信息,程序员使用的游戏数据开关,可随便自定义数据:例如复活次数等",
"title": "getConfig2(程序配置)",
"group": "B",
"name": "sceneEnd",
"type": "数据存储",
"url": "数据存储",
"title": "sceneEnd(存) 玩家结束游戏场景调用",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "Object",
"type": "String",
"optional": false,
"field": "callback",
"description": "<p>不存在返回null</p>"
"field": "sceneName",
"description": "<p>场景名称,比如:第1关,第2关,厨房,矿坑,如果有调用setSceneEvent 两个传递场景名称必须要一样</p>"
},
{
"group": "Parameter",
"type": "JSON",
"optional": false,
"field": "extraData",
"description": "<p>额外数据,如果是正常结束可以传递 从哪里退出的场景,比如:正常退出 或者 返回按钮退出</p>"
}
]
}
......@@ -469,30 +769,37 @@
"examples": [
{
"title": "示例:",
"content": "var d = sdk.getConfig2();",
"content": "sdk.sceneEnd('第1关','返回按钮退出',(d)=>{\n console.log(\"场景回调\",d);\n})",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
"groupTitle": "B"
},
{
"group": "C",
"name": "getConfig3",
"type": "运营配置",
"url": "游戏后台配置信息,运营人员使用的通用配置开关",
"title": "相关按钮根据时间来配置以及跳转方式按钮属性getConfig3(运营配置)",
"group": "B",
"name": "setItem",
"type": "set",
"url": "数据存储",
"title": "setItem(存)",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "Object",
"type": "String",
"optional": false,
"field": "callback",
"description": "<p>不存在返回null</p>"
"field": "key",
"description": "<p>键</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "value",
"description": "<p>值</p>"
}
]
}
......@@ -501,30 +808,51 @@
"examples": [
{
"title": "示例:",
"content": "var d = sdk.getConfig3();",
"content": "sdk.setItem(\"nick\",\"hello\")",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
"groupTitle": "B"
},
{
"group": "C",
"name": "getConfig4",
"type": "技术程序控制",
"url": "游戏服务端控制一些需要服务端判断的比如:ip地区配置,getConfig4(技术程序)",
"title": "",
"group": "B",
"name": "setSceneEvent",
"type": "数据存储",
"url": "数据存储,一般用于事件埋点上报",
"title": "setSceneEvent(存) 将事件信息发送到乐玩服务器记录",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "Object",
"type": "String",
"optional": false,
"field": "callback",
"description": "<p>不存在返回null</p>"
"field": "sceneName",
"description": "<p>场景名称,比如:第1关,第2关,厨房,矿坑</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "eventName",
"description": "<p>事件名称,比如:点击、加载、触摸、移动</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "eventId",
"description": "<p>事件ID 通常谢按钮的英文或者中文名字,比如:首页-开始闯关</p>"
},
{
"group": "Parameter",
"type": "JSON",
"optional": false,
"field": "params",
"description": "<p>参数相关</p>"
}
]
}
......@@ -533,21 +861,21 @@
"examples": [
{
"title": "示例:",
"content": "var d = sdk.getConfig4();",
"content": "sdk.setSceneEvent(\"第一关\",\"点击\",\"首页-开始闯关\",{'uid':'8975621'},null)",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
"groupTitle": "B"
},
{
"group": "C",
"name": "getFromServer",
"type": "getFromServer",
"group": "B",
"name": "setToServer",
"type": "setToServer",
"url": "数据存储",
"title": "getFromServer(获取)",
"title": "setToServer(存用户服务器数据)",
"parameter": {
"fields": {
"Parameter": [
......@@ -563,51 +891,65 @@
"type": "String",
"optional": false,
"field": "dataType",
"description": "<p>数据类型 首字母大学的驼峰形式,例如:ShareGroup 或者 ShareLimit</p>"
"description": "<p>数据类型,首字母大学的驼峰形式,例如:ShareGroup 或者 ShareLimit</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "data",
"description": "<p>特殊情况下需要传递额外数据状况,一般不传递</p>"
"description": "<p>需要保存的数据</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "callback",
"description": "<p>回调</p> <p>sdk.getFromServer(&quot;testKey&quot;,&quot;TestData&quot;,null,(d)=&gt;{ console.log(&quot;获取返回&quot;,d.key3); });</p>"
"field": "expireTime",
"description": "<p>过期时间 单位(秒),0:默认一天;-1:永不失效(10年);</p> <p>注意:dataKey和dataType共同确定一个数据的key值,也就是说 如果同样传递key111但是如果dataType不一样,sdk会认为是不同的两个数据key</p>"
}
]
}
},
"examples": [
{
"title": "示例:",
"content": "var data = {'key3':'test'};\nsdk.setToServer(\"testKeyttt3\",\"TestData\",data,3600);",
"type": "json"
}
],
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
"groupTitle": "B"
},
{
"group": "C",
"name": "getItem",
"type": "数据存储",
"url": "数据存储",
"title": "getItem(取)",
"name": "Get",
"type": "Get",
"url": "发起网络请求",
"title": "Get(发起Get请求)",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "String",
"type": "String",
"optional": false,
"field": "url",
"description": "<p>请求地址</p>"
},
{
"group": "Parameter",
"type": "Object",
"optional": false,
"field": "key",
"description": "<p></p>"
"field": "reqData",
"description": "<p>请求参数</p>"
},
{
"group": "Parameter",
"type": "String",
"type": "Object",
"optional": false,
"field": "value",
"description": "<p></p>"
"field": "callback",
"description": "<p>不存在返回null</p>"
}
]
}
......@@ -616,7 +958,7 @@
"examples": [
{
"title": "示例:",
"content": "var nick = sdk.getItem(\"nick\")",
"content": "sdk.Get(\"https://xxx.xxx\", { user_id: user_id }, function (d) {\n console.log(d)\n});",
"type": "json"
}
]
......@@ -627,10 +969,10 @@
},
{
"group": "C",
"name": "getLocalCache",
"type": "数据存储",
"url": "数据存储",
"title": "getLocalCache(取)",
"name": "Post",
"type": "Post",
"url": "发起网络请求",
"title": "Post(发起Post请求)",
"parameter": {
"fields": {
"Parameter": [
......@@ -638,8 +980,22 @@
"group": "Parameter",
"type": "String",
"optional": false,
"field": "key",
"description": "<p>键</p>"
"field": "url",
"description": "<p>请求地址</p>"
},
{
"group": "Parameter",
"type": "Object",
"optional": false,
"field": "reqData",
"description": "<p>请求参数</p>"
},
{
"group": "Parameter",
"type": "Object",
"optional": false,
"field": "callback",
"description": "<p>不存在返回null</p>"
}
]
}
......@@ -648,7 +1004,7 @@
"examples": [
{
"title": "示例:",
"content": "var nick = sdk.getLocalCache(\"nick\")",
"content": "sdk.Post(sdk.ip + sdk.common, { user_id: user_id }, function (d) {\n console.log(d)\n});",
"type": "json"
}
]
......@@ -659,15 +1015,15 @@
},
{
"group": "C",
"name": "getServerTime",
"type": "数据存储",
"url": "数据获取",
"title": "getServerTime (取)",
"name": "Screenshot",
"type": "微信小游戏截图保存",
"url": "微信小游戏截图保存",
"title": "Screenshot(截图)",
"success": {
"examples": [
{
"title": "示例:",
"content": "sdk.getServerTime((d)=>{\n if(d.c==1){\n console.log(\"获取返回\",d.nowTime);\n }\n });",
"content": "//.摄像机组件、回调\nsdk.Screenshot((d)=>{\n if(d){\n console.log(\"图片保存成功:\", d)\n }else{\n console.log(\"图片保存失败:\", d)\n }\n})",
"type": "json"
}
]
......@@ -678,15 +1034,18 @@
},
{
"group": "C",
"name": "getUser",
"type": "获取本地用户信息",
"url": "获取本地用户信息(登录成功后,会在本地存储用户信息)",
"title": "getUser(获取用户信息)",
"name": "WeChatLogin",
"type": "新增、授权、登陆",
"url": "微信登录WeChatLogin对外提供新增、授权、登陆调用以及初始化",
"title": "WeChatLogin(微信登录)",
"deprecated": {
"content": "外部废弃调用该方法, use now (#A:WeChatLoginNoAuth)"
},
"success": {
"examples": [
{
"title": "示例:",
"content": "//.不存在返回null\nvar user = sdk.getUser();",
"content": "sdk.WeChatLogin((d)=>{\n var config1 = sdk.getConfig1();\n if(config1.hz2==1)\n {\n //显示\n xxx.active = true;\n \n xxx.addClickListener(() => {\n var d = sdk.getButtonConfig('hz2');\n //跳转到对应的小程序或者游戏\n sdk.navigateToMiniProgram(d);\n });\n }else\n {\n //隐藏\n }\n\n});",
"type": "json"
}
]
......@@ -697,15 +1056,15 @@
},
{
"group": "C",
"name": "moneyAmount",
"type": "数据获取",
"url": "获取用户金额",
"title": "moneyAmount(获取)",
"name": "checkUpdate",
"type": "检测版本更新",
"url": "微信小游戏(冷启动的时候会检查,如果有更新则会重启小游戏进行更新)",
"title": "checkUpdate(版本更新)非必要",
"success": {
"examples": [
{
"title": "示例:",
"content": "sdk.moneyAmount(null)",
"content": "sdk.checkUpdate();",
"type": "json"
}
]
......@@ -716,15 +1075,28 @@
},
{
"group": "C",
"name": "moneyAmount",
"name": "createOrder",
"type": "数据存储",
"url": "获得或者减少钱(分为单位)",
"title": "",
"url": "创建订单",
"title": "createOrder(创建订单)",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "int",
"optional": false,
"field": "cash",
"description": "<p>订单金额,当前提现的订单金额</p>"
}
]
}
},
"success": {
"examples": [
{
"title": "示例:",
"content": "sdk.operateMoney({type:'add',way:'redPacket',cash:50},null)",
"content": "sdk.createOrder(10,null)",
"type": "json"
}
]
......@@ -735,49 +1107,38 @@
},
{
"group": "C",
"name": "navigateToMiniProgram",
"type": "",
"url": "跳转到小程序或者小游戏注意有时间限定",
"title": "navigateToMiniProgram",
"name": "getButtonConfig",
"type": "数据存储",
"url": "数据存储",
"title": "getButtonConfig(取)",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "json",
"optional": false,
"field": "config",
"description": "<p>json包含app_id,path,extraData,env_version</p>"
},
{
"group": "Parameter",
"type": "fucntion",
"optional": false,
"field": "success",
"description": "<p>成功返回</p>"
},
{
"group": "Parameter",
"type": "fucntion",
"type": "String",
"optional": false,
"field": "fail",
"description": "<p>失败返回</p>"
"field": "buttonKey",
"description": "<p>按钮的键值 比如 hz2 hz3</p>"
},
{
"group": "Parameter",
"type": "fucntion",
"type": "int",
"optional": false,
"field": "complete",
"description": "<p>完成返回</p>"
"field": "isCount",
"description": "<p>值为1或者0 1:表示本次调用使用次数加一;0:表示本次调用使用次数不发生变化</p>"
}
]
}
},
"deprecated": {
"content": "废弃,外部替代使用为 (#A:getButtonConfig)"
},
"success": {
"examples": [
{
"title": "示例:",
"content": "var d = sdk.getButtonConfig('hz2');\nsdk.navigateToMiniProgram(d);",
"content": "var d = sdk.getButtonConfig2(\"xxx\",1);\n特别说明:对于视频分享切换的解析返回的json为:\n{\"type\":\"share\",\"count\":5,\"left_count\":3,\"use_count\":2,\"next\":\"key_1\"}\n技术获取之后根据d.type判断类型然后做响应处理就可以了;\nif(d.type=='share')\n{\n //凋起分享\n sdk.shareAppMessage({type: 1,query: \"\",success:xxx,fail:xxx });\n}else\n{\n //凋起视频\n\n adSdk.videoSuccess = function(){\n //视频看完处理逻辑\n this.successFunction();\n };\n adSdk.videoFail = function(){\n //视频未看完处理逻辑\n this.failFunction();`\n };\n adSdk.videoError = function(){\n //视频凋起失败处理逻辑,要么就是广告id没有或者是调起视频广告太频繁微信限制调起,这里一般都会改成去调起分享\n this.errorFunction();\n };\n var videoAd = adSdk.createVideoAd(1,videoAdUnitId);\n videoAd.load().then(() => videoAd.show());\n \n}\n//如果多个视频广告id(videoAdUnitId)的情况,通过后台技术配置Config2获取对应的视频广告id,比如:sdk.getConfig2().videoAdUnitId1 或者sdk.getConfig2().videoAdUnitId2",
"type": "json"
}
]
......@@ -788,19 +1149,19 @@
},
{
"group": "C",
"name": "onMessage",
"type": "主域监听子域发送的消息",
"url": "主域监听子域发送的消息",
"title": "onMessage(监听消息)",
"name": "getConfig3",
"type": "运营配置",
"url": "游戏后台配置信息,运营人员使用的通用配置开关,相关按钮根据时间来配置以及跳转方式按钮属性",
"title": "getConfig3(运营配置)",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "callback",
"type": "Object",
"optional": false,
"field": "callback",
"description": "<p>回调函数</p>"
"description": "<p>不存在返回null</p>"
}
]
}
......@@ -809,7 +1170,7 @@
"examples": [
{
"title": "示例:",
"content": "sdk.onMessage((d)=>{\n console.log(d)\n})",
"content": "var d = sdk.getConfig3();",
"type": "json"
}
]
......@@ -820,78 +1181,19 @@
},
{
"group": "C",
"name": "onShareAppMessage",
"type": "分享",
"url": "注册微信右上角分享",
"title": "onShareAppMessage(分享)",
"name": "getConfig4",
"type": "技术程序控制",
"url": "游戏服务端控制一些需要服务端判断的比如:ip地区配置,getConfig4(技术程序)",
"title": "",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "int",
"optional": false,
"field": "type",
"defaultValue": "0",
"description": "<p>后台自定义的分享类型;例如:0:右上角分享、1:普通分享 2:分享加金币</p>"
},
{
"group": "Parameter",
"type": "int",
"optional": false,
"field": "specialFlag",
"defaultValue": "0",
"description": "<p>特殊标记,例如0:默认、1:邀新好友、2:邀旧好友</p>"
},
{
"group": "Parameter",
"type": "int",
"type": "Object",
"optional": false,
"field": "rewardFlag",
"defaultValue": "xxx",
"description": "<p>活动或者道具id</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": true,
"field": "title",
"description": "<p>转发标题</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": true,
"field": "imageUrl",
"description": "<p>转发显示图片的链接</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": true,
"field": "query",
"description": "<p>必须是 key1=val1&amp;key2=val2 的格式。</p>"
},
{
"group": "Parameter",
"type": "callback",
"optional": true,
"field": "success",
"description": "<p>成功回调</p>"
},
{
"group": "Parameter",
"type": "callback",
"optional": true,
"field": "fail",
"description": "<p>失败回调</p>"
},
{
"group": "Parameter",
"type": "callback",
"optional": true,
"field": "cancel",
"description": "<p>点击取消分享按钮回调</p>"
"field": "callback",
"description": "<p>不存在返回null</p>"
}
]
}
......@@ -900,7 +1202,7 @@
"examples": [
{
"title": "示例:",
"content": "sdk.shareAppMessage({type: 1,query: \"\",success:xxx,cancel:xxx,fail:xxx,rewardFlag:'' });",
"content": "var d = sdk.getConfig4();",
"type": "json"
}
]
......@@ -911,10 +1213,10 @@
},
{
"group": "C",
"name": "postMessage",
"type": "主域向子域发送消息",
"url": "主域向子域发送消息",
"title": "postMessage(发送消息)",
"name": "getLocalCache",
"type": "数据存储",
"url": "数据存储,取setLocalCache方法存的数据",
"title": "getLocalCache(取)",
"parameter": {
"fields": {
"Parameter": [
......@@ -922,8 +1224,8 @@
"group": "Parameter",
"type": "String",
"optional": false,
"field": "msg",
"description": "<p>发送给子域的消息</p>"
"field": "key",
"description": "<p></p>"
}
]
}
......@@ -932,7 +1234,7 @@
"examples": [
{
"title": "示例:",
"content": "sdk.postMessage(\"hello\")",
"content": "var nick = sdk.getLocalCache(\"nick\")",
"type": "json"
}
]
......@@ -943,28 +1245,44 @@
},
{
"group": "C",
"name": "removeItem",
"name": "init_api",
"type": "初始化",
"url": "初始化ip",
"title": "init_api",
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
},
{
"group": "C",
"name": "moneyAmount",
"type": "数据存储",
"url": "数据存储",
"title": "removeItem(删)",
"parameter": {
"fields": {
"Parameter": [
"url": "获得或者减少钱(分为单位)",
"title": "operateMoney(获得或者减少钱)",
"success": {
"examples": [
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "key",
"description": "<p>键</p>"
"title": "示例:",
"content": "sdk.operateMoney({type:'add',way:'redPacket',cash:50},null)",
"type": "json"
}
]
}
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
},
{
"group": "C",
"name": "moneyAmount",
"type": "数据获取",
"url": "获取用户金额",
"title": "moneyAmount(获取用户金额)",
"success": {
"examples": [
{
"title": "示例:",
"content": "sdk.removeItem(\"nick\")",
"content": "sdk.moneyAmount(null)",
"type": "json"
}
]
......@@ -975,65 +1293,40 @@
},
{
"group": "C",
"name": "sceneEnd",
"type": "数据存储",
"url": "数据存储",
"title": "sceneEnd(存) 玩家结束游戏场景调用",
"name": "navigateToMiniProgram",
"type": "跳转到小程序",
"url": "跳转到小程序或者小游戏注意有时间限定",
"title": "navigateToMiniProgram(跳转到小程序)",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "String",
"type": "json",
"optional": false,
"field": "sceneName",
"description": "<p>场景名称,比如:第1关,第2关,厨房,矿坑,如果有调用setSceneEvent 两个传递场景名称必须要一样</p>"
"field": "config",
"description": "<p>json包含app_id,path,extraData,env_version</p>"
},
{
"group": "Parameter",
"type": "JSON",
"type": "fucntion",
"optional": false,
"field": "extraData",
"description": "<p>额外数据,如果是正常结束可以传递 从哪里退出的场景,比如:正常退出 或者 返回按钮退出</p>"
}
]
}
},
"success": {
"examples": [
{
"title": "示例:",
"content": "sdk.sceneEnd('第1关','返回按钮退出',(d)=>{\n console.log(\"场景回调\",d);\n})",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
"field": "success",
"description": "<p>成功返回</p>"
},
{
"group": "C",
"name": "sceneStart",
"type": "数据存储",
"url": "数据存储",
"title": "sceneStart(存) 玩家进场景界面开始调用",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "String",
"type": "fucntion",
"optional": false,
"field": "sceneName",
"description": "<p>场景名称,比如:第1关,第2关,厨房,矿坑,如果有调用setSceneEvent 两个传递场景名称必须要一样</p>"
"field": "fail",
"description": "<p>失败返回</p>"
},
{
"group": "Parameter",
"type": "JSON",
"type": "fucntion",
"optional": false,
"field": "extraData",
"description": "<p>额外数据,可以传递从哪里进入场景,比如:正常进入 或者 奖励进入</p>"
"field": "complete",
"description": "<p>完成返回</p>"
}
]
}
......@@ -1042,7 +1335,7 @@
"examples": [
{
"title": "示例:",
"content": "sdk.sceneStart('第1关','正常进入',null)",
"content": "var d = sdk.getButtonConfig('hz2');\nsdk.navigateToMiniProgram(d);",
"type": "json"
}
]
......@@ -1053,26 +1346,19 @@
},
{
"group": "C",
"name": "setItem",
"type": "set",
"url": "数据存储",
"title": "setItem(存)",
"name": "onMessage",
"type": "主域监听子域发送的消息",
"url": "主域监听子域发送的消息",
"title": "onMessage(监听消息)",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "key",
"description": "<p>键</p>"
},
{
"group": "Parameter",
"type": "String",
"type": "callback",
"optional": false,
"field": "value",
"description": "<p></p>"
"field": "callback",
"description": "<p>回调函数</p>"
}
]
}
......@@ -1081,7 +1367,7 @@
"examples": [
{
"title": "示例:",
"content": "sdk.setItem(\"nick\",\"hello\")",
"content": "sdk.onMessage((d)=>{\n console.log(d)\n})",
"type": "json"
}
]
......@@ -1092,10 +1378,10 @@
},
{
"group": "C",
"name": "setLocalCache",
"type": "set",
"url": "数据存储",
"title": "setLocalCache(存)",
"name": "postMessage",
"type": "主域向子域发送消息",
"url": "主域向子域发送消息",
"title": "postMessage(发送消息)",
"parameter": {
"fields": {
"Parameter": [
......@@ -1103,22 +1389,8 @@
"group": "Parameter",
"type": "String",
"optional": false,
"field": "key",
"description": "<p>键</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "value",
"description": "<p>值</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "expireTime",
"description": "<p>过期时间单位(秒)</p>"
"field": "msg",
"description": "<p>发送给子域的消息</p>"
}
]
}
......@@ -1127,7 +1399,7 @@
"examples": [
{
"title": "示例:",
"content": "sdk.setLocalCache(\"nick\",\"hello\")",
"content": "sdk.postMessage(\"hello\")",
"type": "json"
}
]
......@@ -1138,10 +1410,10 @@
},
{
"group": "C",
"name": "setSceneEvent",
"name": "sceneStart",
"type": "数据存储",
"url": "数据存储",
"title": "setEvent(存) 将事件信息发送到乐玩服务器记录",
"title": "sceneStart(存) 玩家进场景界面开始调用",
"parameter": {
"fields": {
"Parameter": [
......@@ -1150,28 +1422,14 @@
"type": "String",
"optional": false,
"field": "sceneName",
"description": "<p>场景名称,比如:第1关,第2关,厨房,矿坑</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "eventName",
"description": "<p>事件名称,比如:点击、加载、触摸、移动</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "eventId",
"description": "<p>事件ID 通常谢按钮的英文或者中文名字,比如:首页-开始闯关</p>"
"description": "<p>场景名称,比如:第1关,第2关,厨房,矿坑,如果有调用setSceneEvent 两个传递场景名称必须要一样</p>"
},
{
"group": "Parameter",
"type": "JSON",
"optional": false,
"field": "params",
"description": "<p>参数相关</p>"
"field": "extraData",
"description": "<p>额外数据,可以传递从哪里进入场景,比如:正常进入 或者 奖励进入</p>"
}
]
}
......@@ -1180,7 +1438,7 @@
"examples": [
{
"title": "示例:",
"content": "sdk.setSceneEvent(\"第一关\",\"点击\",\"首页-开始闯关\",{'uid':'8975621'},null)",
"content": "sdk.sceneStart('第1关','正常进入',null)",
"type": "json"
}
]
......@@ -1191,10 +1449,10 @@
},
{
"group": "C",
"name": "setToServer",
"type": "setToServer",
"url": "数据存储",
"title": "setToServer(存)",
"name": "setLocalCache",
"type": "set",
"url": "数据存储,有时效的数据可以调用该方法存",
"title": "setLocalCache(存)",
"parameter": {
"fields": {
"Parameter": [
......@@ -1202,33 +1460,35 @@
"group": "Parameter",
"type": "String",
"optional": false,
"field": "dataKey",
"field": "key",
"description": "<p>键</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "dataType",
"description": "<p>数据类型,首字母大学的驼峰形式,例如:ShareGroup 或者 ShareLimit</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "data",
"description": "<p>需要保存的数据</p>"
"field": "value",
"description": "<p>值</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "expireTime",
"description": "<p>过期时间 单位(秒),0:默认一天;-1:永不失效(10年);</p> <p>注意:dataKey和dataType共同确定一个数据的key值,也就是说 如果同样传递key111但是如果dataType不一样,sdk会认为是不同的两个数据key</p> <p>var data = {'key3':'test'}; sdk.setToServer(&quot;testKeyttt3&quot;,&quot;TestData&quot;,data,3600);</p>"
"description": "<p>过期时间单位(秒)</p>"
}
]
}
},
"success": {
"examples": [
{
"title": "示例:",
"content": "sdk.setLocalCache(\"nick\",\"hello\")",
"type": "json"
}
]
},
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
......@@ -1281,91 +1541,10 @@
},
{
"group": "C",
"name": "shareAppMessage",
"type": "分享",
"url": "主动拉起微信分享",
"title": "shareAppMessage(分享)",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "int",
"optional": false,
"field": "type",
"defaultValue": "1",
"description": "<p>后台自定义的分享类型;例如:0:右上角分享、1:普通分享 2:分享加金币</p>"
},
{
"group": "Parameter",
"type": "int",
"optional": false,
"field": "specialFlag",
"defaultValue": "0",
"description": "<p>特殊标记,例如0:默认、1:邀新好友、2:邀旧好友</p>"
},
{
"group": "Parameter",
"type": "int",
"optional": false,
"field": "rewardFlag",
"defaultValue": "xxx",
"description": "<p>活动或者道具id</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": true,
"field": "title",
"description": "<p>转发标题</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": true,
"field": "imageUrl",
"description": "<p>转发显示图片的链接</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": true,
"field": "query",
"description": "<p>必须是 key1=val1&amp;key2=val2 的格式。</p>"
},
{
"group": "Parameter",
"type": "callback",
"optional": true,
"field": "success",
"description": "<p>成功回调</p>"
},
{
"group": "Parameter",
"type": "callback",
"optional": true,
"field": "fail",
"description": "<p>失败回调</p>"
},
{
"group": "Parameter",
"type": "callback",
"optional": true,
"field": "cancel",
"description": "<p>点击取消分享按钮回调</p>"
}
]
}
},
"success": {
"examples": [
{
"title": "示例:",
"content": "sdk.shareAppMessage({type: 1,query: \"\",success:xxx,cancel:xxx,fail:xxx,rewardFlag:'xxx' });",
"type": "json"
}
]
},
"name": "setWeChatListener",
"type": "全局监听",
"url": "微信小游戏显示和隐藏的监听事件,无需手动调用,不对外提供使用",
"title": "setWeChatListener(游戏显示和隐藏监听)",
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
......@@ -1420,8 +1599,8 @@
"group": "C",
"name": "uploadSceneEvent",
"type": "数据存储",
"url": "数据存储",
"title": "uploadSceneEvent(存) 将事件信息发送到乐玩服务器记录",
"url": "将事件信息发送到乐玩服务器记录",
"title": "uploadSceneEvent(将事件信息发送到乐玩服务器记录)",
"parameter": {
"fields": {
"Parameter": [
......@@ -1430,11 +1609,21 @@
"type": "JsonArray",
"optional": false,
"field": "eventJsonArray",
"description": "<p>要上传的json数组 sdk.uploadSceneEvent(null,'游戏结束',null) //游戏上传场景数据 sdk.uploadSceneEvent(jsonArray,'',null) //将要上传的数据传递过来</p>"
"description": "<p>要上传的json数组</p>"
}
]
}
},
"deprecated": {
"content": "废弃,sdk内部调用,外部一般调用这个方法即可 (#B:setSceneEvent)"
},
"examples": [
{
"title": "示例:",
"content": "sdk.uploadSceneEvent(null,'游戏结束',null) //游戏上传场景数据\nsdk.uploadSceneEvent(jsonArray,'',null) //将要上传的数据传递过来",
"type": "json"
}
],
"version": "0.0.0",
"filename": "assets/llewan-weixin-sdk/sdk.js",
"groupTitle": "C"
......
......@@ -7,7 +7,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
"time": "2019-05-29T08:26:20.144Z",
"time": "2019-05-29T13:32:46.949Z",
"url": "http://apidocjs.com",
"version": "0.17.7"
}
......
......@@ -7,7 +7,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
"time": "2019-05-29T08:26:20.144Z",
"time": "2019-05-29T13:32:46.949Z",
"url": "http://apidocjs.com",
"version": "0.17.7"
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment