{"id":21558317,"url":"https://github.com/doublespout/wx_widget_sdk","last_synced_at":"2025-03-18T03:28:45.336Z","repository":{"id":10792334,"uuid":"13062573","full_name":"DoubleSpout/wx_widget_sdk","owner":"DoubleSpout","description":"wx_widget_sdk","archived":false,"fork":false,"pushed_at":"2013-12-29T12:40:44.000Z","size":252,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-25T10:50:09.938Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DoubleSpout.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-09-24T11:37:30.000Z","updated_at":"2013-12-29T12:40:45.000Z","dependencies_parsed_at":"2022-09-01T21:02:29.116Z","dependency_job_id":null,"html_url":"https://github.com/DoubleSpout/wx_widget_sdk","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DoubleSpout%2Fwx_widget_sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DoubleSpout%2Fwx_widget_sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DoubleSpout%2Fwx_widget_sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DoubleSpout%2Fwx_widget_sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DoubleSpout","download_url":"https://codeload.github.com/DoubleSpout/wx_widget_sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244149281,"owners_count":20406340,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-24T08:14:33.006Z","updated_at":"2025-03-18T03:28:45.317Z","avatar_url":"https://github.com/DoubleSpout.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"#wx_widget_sdk[![Build Status](https://travis-ci.org/DoubleSpout/wx_widget_sdk.png?branch=master)](https://travis-ci.org/DoubleSpout/wx_widget_sdk)\r\n================\r\n#安装方法：\r\n\t\tnpm imstall wx_widget_sdk\r\n\r\n#使用方法：\r\n##初始化：\r\n\r\n\t\tvar sdk = require('wx_widget_sdk');\r\n\t\tvar _clientId = \"5245790aad1f453aae73a2a1\"\r\n\t\tvar _clientKey = \"10856caf8733f3466ebc7c9198dead0b\"\r\n\t\tvar _gourpId = \"52457954ad1f453aae73a2a3\"\r\n\t\tvar _voteId = \"5245795fad1f453aae73a2a4\"\r\n\t\tvar _host = \"http://127.0.0.1:8080\";\r\n\r\n\t\tvar sdkIns = sdk.create({\r\n\t\t\t\t\tclientId:_clientId,\r\n\t\t\t\t\tclientKey:_clientKey,\r\n\t\t\t\t\twidgetHost:_host\r\n\t\t\t\t});\r\n\r\n##注册应用用户:\r\n\r\n\t\tvar uobj = {\r\n\t\t\tname:\"joymap\",\r\n\t\t\tappuserid:\"123456\",\r\n\t\t\tmobile:\"13333333333\",\r\n\t\t\tregip:\"127.0.0.1\"\r\n\t\t}\r\n\t\tsdkIns.registUser(uobj, function(err,obj){\r\n\t\t\t//do something\r\n\t\t})\r\n\r\n##获取应用用户信息:\r\n\r\n\t\tsdkIns.getUserInfo(app_user_id, function(err,obj){\r\n\t\t\t//do something\t\t\t\t\t\t\t\t\r\n\t\t})\r\n\r\n##获取某次投票信息\r\n\r\n\t\tsdkIns.getVote(_gourpId, function(err,obj){\r\n\t\t\t\t//do something\r\n\t\t})\r\n\r\n##用户发起一次投票\r\n\r\n\t\tsdkIns.createVote(app_user_id, _voteId, ipaddress, function(err,obj){\r\n\t\t\t//do something\r\n\t\t})\r\n\r\n##查询某一用户，在这次投票的情况，他投过几票，投了什么：\r\n\r\n\t\tsdkIns.getUserVoteByGroup(user_id, _gourpId, function(err,obj){\r\n\t\t\t\t//do something\r\n\t\t})\r\n\r\n##注册平台用户\r\n\r\n\t\tvar uobj = {\r\n\t\t\tmobile:\"13333333333\",\r\n\t\t\tpassword:\"123456\",\r\n\t\t\tappuserid:\"123456\", //可选，如果有则会去绑定\r\n\t\t\tregip:\"127.0.0.1\",\r\n\t\t\tagent:\"mac\"\r\n\t\t}\r\n\t\tsdkIns.registPlatUser(uboj, function(err,obj){\r\n\t\t\t//do something\r\n\t\t})\t\t\r\n\t\t\r\n##如果app用户绑定了平台用户，则根据appuserid查找绑定用户的信息：\r\n\r\n\t\tsdkIns.getPlatUserInfoByAppUserId(appuid, function(err,obj){\r\n\t\t\t\t//do something\r\n\t\t})\r\n\t\t\r\n##绑定平台用户和app用户：\r\n\r\n\t\tsdkIns.platUserBind(mobile,pwd,appuid, function(err,obj){\r\n\t\t\t\t//do something\r\n\t\t})\r\n\t\t\r\n##平台用户登录：\r\n\r\n\t\tsdkIns.platUserLogin(mobile,pwd,appuid, function(err,obj){\r\n\t\t\t\t//do something\r\n\t\t})\r\n\t\t\r\n##根据token获取用户信息：\r\n\r\n\t\tsdkIns.getPlatUserInfoByToken(mobile,pwd,appuid, function(err,obj){\r\n\t\t\t\t//do something\r\n\t\t})\r\n\t\t\r\n##用户开始猜图的答题活动，将返回题目给用户：\r\n\r\n\t\tsdkIns.getPuzzle(mpuzzleid, appuid, function(err,obj){\r\n\t\t\t\t//do something\r\n\t\t})\r\n\r\n##用户进行猜图活动，回答某一个题目：\r\n\r\n\t\tsdkIns.answerPuzzle(puzzleid, uid, recordid, questionid, key, function(err,obj){\r\n\t\t\t\t//do something\r\n\t\t})\r\n\r\n##用户进行猜图活动，获得某一个题目的提示：\r\n\r\n\t\tsdkIns.getQuesstionTips(puzzleid, recordid, questionid, tipspos, function(err,obj){\r\n\t\t\t\t//do something\r\n\t\t})\r\n\r\n##获得某次猜图活动的奖品：\r\n\r\n\t\tsdkIns.getPuzzlePrize(puzzleid, uid, function(err,obj){\r\n\t\t\t\t//do something\r\n\t\t})\r\n\r\n##用户猜图游戏做完后，选择奖品获得奖品：\r\n\r\n\t\tsdkIns.obtainPrize(puzzleid, uid, recordid, recordip, prizeid, function(err,obj){\r\n\t\t\t\t//do something\r\n\t\t})\r\n\r\n##用户猜图游戏做完后，获得用户的奖品记录：\r\n\r\n\t\tsdkIns.getUserPrizeRecord(puzzleid, uid, function(err,obj){\r\n\t\t\t\t//do something\r\n\t\t})\r\n\r\n##获得用户猜图游戏的答题记录：\r\n\r\n\t\tsdkIns.getUserPuzzleRecord(puzzleid, uid, function(err,obj){\r\n\t\t\t\t//do something\r\n\t\t})\r\n\r\n##获得某次抽奖活动的信息：\r\n\r\n\t\tsdkIns.getLotteryInfo(lotteryid, uid, function(err,obj){\r\n\t\t\t\t//do something\r\n\t\t})\r\n\r\n##用户开始某次抽奖活动的抽奖：\r\n\r\n\t\tsdkIns.startLottery(lotteryid, uid, recordip, function(err,obj){\r\n\t\t\t\t//do something\r\n\t\t})\r\n\r\n##获得用户的抽奖活动的得奖记录：\r\n\r\n\t\tsdkIns.getLotteryRecord(lotteryid, uid, function(err,obj){\r\n\t\t\t\t//do something\r\n\t\t})\r\n\r\n##获得某次抽奖活动的奖品列表：\r\n\r\n\t\tsdkIns.getLotteryPrize(lotteryid, uid, function(err,obj){\r\n\t\t\t\t//do something\r\n\t\t})\r\n\r\n##获得获得某次抽奖活动用户的抽奖次数，包括总次数和当前时间间隔次数：\r\n\r\n\t\tsdkIns.userLotteryCount(lotteryid, uid, function(err,obj){\r\n\t\t\t\t//do something\r\n\t\t})\r\n\r\n##创建一个金数据表单：\r\n\r\n\t\tsdkIns.createForm(formname, formdata, uid, function(err,obj){\r\n\t\t\t\t//do something\r\n\t\t})\r\n\r\n\r\n#测试命令：\r\nnode ./test/run.js ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoublespout%2Fwx_widget_sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoublespout%2Fwx_widget_sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoublespout%2Fwx_widget_sdk/lists"}