更新记录
V1.2(2019-10-25) 下载此版本
解决抽奖后转盘消失的BUG
V1.1(2019-10-25) 下载此版本
使用canvas绘制轮盘
平台兼容性
懒的写了,大家下载示例工程,里面有完整的抽奖轮盘代码,只需替换后端接口数据即可。
-
根据后端要求替换调接口即可
-
转盘抽奖列表接口返回数据:
{ "code": 200, "data": { "awardsList": [ { "amount": 0, "diskColor": "#ffffff", "id": 8, "imageIndex": "awards_smile.png", "name": "谢谢参与", "remark": "谢谢参与", "type": 0, "winText": "很遗憾,未中奖", "image": "http://img.jxshoo.cn/awards_smile.png" }, { "amount": 4299, "diskColor": "#FBF0B0", "id": 7, "imageIndex": "awards_applewatch.png", "name": "AppleWatchS5", "remark": "AppleWatch S5", "type": 3, "winText": "恭喜您获得1部iPhoneXS 64G手机一台,请联系客服人员核实!", "image": "http://img.jxshoo.cn/awards_applewatch.png" }, { "amount": 1, "diskColor": "#ffffff", "id": 5, "imageIndex": "awards_redpack.png", "name": "1元\r\n现金红包", "remark": "1元现金红包", "type": 2, "winText": "恭喜您获得1元现金红包奖励!", "image": "http://img.jxshoo.cn/awards_redpack.png" }, { "amount": 9699, "diskColor": "#FBF0B0", "id": 6, "imageIndex": "awards_iponexs.png", "name": "iPhone\r\nXS 64G", "remark": "iPhoneXS 64G", "type": 3, "winText": "恭喜您获得1部iPhone\r\nXS 64G手机一台,请联系客服人员核实!", "image": "http://img.jxshoo.cn/awards_iponexs.png" }, { "amount": 5, "diskColor": "#ffffff", "id": 2, "imageIndex": "awards_integral.png", "name": "5积分", "remark": "5积分", "type": 1, "winText": "恭喜您获得5积分奖励!", "image": "http://img.jxshoo.cn/awards_integral.png" }, { "amount": 10, "diskColor": "#FBF0B0", "id": 4, "imageIndex": "awards_redpack.png", "name": "10元\r\n现金红包", "remark": "10元现金红包", "type": 2, "winText": "恭喜您获得10元现金红包奖励!", "image": "http://img.jxshoo.cn/awards_redpack.png" } ], "signInStatus": false, "times": "0" }, "message": "请求成功", "success": true }
-
获取抽中奖品接口返回数据:
{ "code": 200, "data": { times:0, awards:{ "diskColor": "#ffffff", "id": 8, "name": "谢谢参与", "winText": "很遗憾,未中奖" } }, "message": "请求成功", "success": true }
-
我的奖品接口返回数据:
{ "code": 200, "data": [ { "awardsId": 2, "awardsName": "5积分", "createTime": "2019-10-23 21:23:36" }, { "awardsId": 2, "awardsName": "5积分", "createTime": "2019-10-23 09:34:53" } ], "message": "请求成功", "success": true }