增加发送短信的图形验证码功能
This commit is contained in:
parent
e736b930d1
commit
20886ecf78
@ -41,8 +41,8 @@
|
|||||||
},
|
},
|
||||||
"_scale": {
|
"_scale": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
"x": 0.4469148552288877,
|
"x": 0.11809926614295294,
|
||||||
"y": 0.4469148552288877,
|
"y": 0.11809926614295294,
|
||||||
"z": 1
|
"z": 1
|
||||||
},
|
},
|
||||||
"_quat": {
|
"_quat": {
|
||||||
@ -646,6 +646,9 @@
|
|||||||
"inviteMenuPrefab": {
|
"inviteMenuPrefab": {
|
||||||
"__uuid__": "bdf9cd55-9cf3-4bf8-b902-2431701b3d6c"
|
"__uuid__": "bdf9cd55-9cf3-4bf8-b902-2431701b3d6c"
|
||||||
},
|
},
|
||||||
|
"infoMenuPrefab2": {
|
||||||
|
"__uuid__": "14e28457-5820-4f5b-a685-e9a9083b336c"
|
||||||
|
},
|
||||||
"rulePrefab": {
|
"rulePrefab": {
|
||||||
"__uuid__": "de027dd7-a186-4797-b332-2f6e2603d165"
|
"__uuid__": "de027dd7-a186-4797-b332-2f6e2603d165"
|
||||||
},
|
},
|
||||||
@ -656,6 +659,7 @@
|
|||||||
"__uuid__": "6c21a659-0cc4-49e6-a4b6-9697e946aaa1"
|
"__uuid__": "6c21a659-0cc4-49e6-a4b6-9697e946aaa1"
|
||||||
},
|
},
|
||||||
"topMenu": null,
|
"topMenu": null,
|
||||||
|
"partsY": [],
|
||||||
"_id": "caqu3+UstJ+6Bc+xrIMgmV"
|
"_id": "caqu3+UstJ+6Bc+xrIMgmV"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -26,21 +26,21 @@
|
|||||||
"__id__": 10
|
"__id__": 10
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__id__": 57
|
"__id__": 58
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_active": true,
|
"_active": true,
|
||||||
"_level": 1,
|
"_level": 1,
|
||||||
"_components": [
|
"_components": [
|
||||||
{
|
{
|
||||||
"__id__": 68
|
"__id__": 69
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__id__": 69
|
"__id__": 70
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_prefab": {
|
"_prefab": {
|
||||||
"__id__": 70
|
"__id__": 71
|
||||||
},
|
},
|
||||||
"_opacity": 255,
|
"_opacity": 255,
|
||||||
"_color": {
|
"_color": {
|
||||||
@ -346,18 +346,18 @@
|
|||||||
"__id__": 11
|
"__id__": 11
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__id__": 47
|
"__id__": 48
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_active": true,
|
"_active": true,
|
||||||
"_level": 3,
|
"_level": 3,
|
||||||
"_components": [
|
"_components": [
|
||||||
{
|
{
|
||||||
"__id__": 55
|
"__id__": 56
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_prefab": {
|
"_prefab": {
|
||||||
"__id__": 56
|
"__id__": 57
|
||||||
},
|
},
|
||||||
"_opacity": 255,
|
"_opacity": 255,
|
||||||
"_color": {
|
"_color": {
|
||||||
@ -432,11 +432,11 @@
|
|||||||
"_level": 4,
|
"_level": 4,
|
||||||
"_components": [
|
"_components": [
|
||||||
{
|
{
|
||||||
"__id__": 45
|
"__id__": 46
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_prefab": {
|
"_prefab": {
|
||||||
"__id__": 46
|
"__id__": 47
|
||||||
},
|
},
|
||||||
"_opacity": 255,
|
"_opacity": 255,
|
||||||
"_color": {
|
"_color": {
|
||||||
@ -833,7 +833,7 @@
|
|||||||
"_useOriginalSize": true,
|
"_useOriginalSize": true,
|
||||||
"_string": "",
|
"_string": "",
|
||||||
"_N$string": "",
|
"_N$string": "",
|
||||||
"_fontSize": 20,
|
"_fontSize": 30,
|
||||||
"_lineHeight": 40,
|
"_lineHeight": 40,
|
||||||
"_enableWrapText": false,
|
"_enableWrapText": false,
|
||||||
"_N$file": null,
|
"_N$file": null,
|
||||||
@ -973,10 +973,10 @@
|
|||||||
"_N$backgroundImage": {
|
"_N$backgroundImage": {
|
||||||
"__uuid__": "ed4c60fd-a3c0-4565-a0e9-9a7d82b14c7a"
|
"__uuid__": "ed4c60fd-a3c0-4565-a0e9-9a7d82b14c7a"
|
||||||
},
|
},
|
||||||
"_N$returnType": 0,
|
"_N$returnType": 2,
|
||||||
"_N$inputFlag": 5,
|
"_N$inputFlag": 5,
|
||||||
"_N$inputMode": 6,
|
"_N$inputMode": 3,
|
||||||
"_N$fontSize": 20,
|
"_N$fontSize": 30,
|
||||||
"_N$lineHeight": 40,
|
"_N$lineHeight": 40,
|
||||||
"_N$fontColor": {
|
"_N$fontColor": {
|
||||||
"__type__": "cc.Color",
|
"__type__": "cc.Color",
|
||||||
@ -994,7 +994,7 @@
|
|||||||
"b": 187,
|
"b": 187,
|
||||||
"a": 255
|
"a": 255
|
||||||
},
|
},
|
||||||
"_N$maxLength": 8,
|
"_N$maxLength": 11,
|
||||||
"_N$stayOnTop": false,
|
"_N$stayOnTop": false,
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
@ -1359,7 +1359,7 @@
|
|||||||
"_useOriginalSize": true,
|
"_useOriginalSize": true,
|
||||||
"_string": "",
|
"_string": "",
|
||||||
"_N$string": "",
|
"_N$string": "",
|
||||||
"_fontSize": 20,
|
"_fontSize": 30,
|
||||||
"_lineHeight": 40,
|
"_lineHeight": 40,
|
||||||
"_enableWrapText": false,
|
"_enableWrapText": false,
|
||||||
"_N$file": null,
|
"_N$file": null,
|
||||||
@ -1501,8 +1501,8 @@
|
|||||||
},
|
},
|
||||||
"_N$returnType": 0,
|
"_N$returnType": 0,
|
||||||
"_N$inputFlag": 5,
|
"_N$inputFlag": 5,
|
||||||
"_N$inputMode": 6,
|
"_N$inputMode": 2,
|
||||||
"_N$fontSize": 20,
|
"_N$fontSize": 30,
|
||||||
"_N$lineHeight": 40,
|
"_N$lineHeight": 40,
|
||||||
"_N$fontColor": {
|
"_N$fontColor": {
|
||||||
"__type__": "cc.Color",
|
"__type__": "cc.Color",
|
||||||
@ -1520,7 +1520,7 @@
|
|||||||
"b": 187,
|
"b": 187,
|
||||||
"a": 255
|
"a": 255
|
||||||
},
|
},
|
||||||
"_N$maxLength": 8,
|
"_N$maxLength": 6,
|
||||||
"_N$stayOnTop": false,
|
"_N$stayOnTop": false,
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
@ -1548,10 +1548,13 @@
|
|||||||
"_components": [
|
"_components": [
|
||||||
{
|
{
|
||||||
"__id__": 43
|
"__id__": 43
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__id__": 44
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_prefab": {
|
"_prefab": {
|
||||||
"__id__": 44
|
"__id__": 45
|
||||||
},
|
},
|
||||||
"_opacity": 255,
|
"_opacity": 255,
|
||||||
"_color": {
|
"_color": {
|
||||||
@ -1626,6 +1629,59 @@
|
|||||||
"_atlas": null,
|
"_atlas": null,
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.Button",
|
||||||
|
"_name": "",
|
||||||
|
"_objFlags": 0,
|
||||||
|
"node": {
|
||||||
|
"__id__": 42
|
||||||
|
},
|
||||||
|
"_enabled": true,
|
||||||
|
"transition": 0,
|
||||||
|
"pressedColor": {
|
||||||
|
"__type__": "cc.Color",
|
||||||
|
"r": 211,
|
||||||
|
"g": 211,
|
||||||
|
"b": 211,
|
||||||
|
"a": 255
|
||||||
|
},
|
||||||
|
"hoverColor": {
|
||||||
|
"__type__": "cc.Color",
|
||||||
|
"r": 255,
|
||||||
|
"g": 255,
|
||||||
|
"b": 255,
|
||||||
|
"a": 255
|
||||||
|
},
|
||||||
|
"duration": 0.1,
|
||||||
|
"zoomScale": 1.2,
|
||||||
|
"clickEvents": [],
|
||||||
|
"_N$interactable": true,
|
||||||
|
"_N$enableAutoGrayEffect": false,
|
||||||
|
"_N$normalColor": {
|
||||||
|
"__type__": "cc.Color",
|
||||||
|
"r": 214,
|
||||||
|
"g": 214,
|
||||||
|
"b": 214,
|
||||||
|
"a": 255
|
||||||
|
},
|
||||||
|
"_N$disabledColor": {
|
||||||
|
"__type__": "cc.Color",
|
||||||
|
"r": 124,
|
||||||
|
"g": 124,
|
||||||
|
"b": 124,
|
||||||
|
"a": 255
|
||||||
|
},
|
||||||
|
"_N$normalSprite": null,
|
||||||
|
"_N$pressedSprite": null,
|
||||||
|
"pressedSprite": null,
|
||||||
|
"_N$hoverSprite": null,
|
||||||
|
"hoverSprite": null,
|
||||||
|
"_N$disabledSprite": null,
|
||||||
|
"_N$target": {
|
||||||
|
"__id__": 42
|
||||||
|
},
|
||||||
|
"_id": ""
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"__type__": "cc.PrefabInfo",
|
"__type__": "cc.PrefabInfo",
|
||||||
"root": {
|
"root": {
|
||||||
@ -1685,21 +1741,21 @@
|
|||||||
},
|
},
|
||||||
"_children": [
|
"_children": [
|
||||||
{
|
{
|
||||||
"__id__": 48
|
"__id__": 49
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_active": true,
|
"_active": true,
|
||||||
"_level": 4,
|
"_level": 4,
|
||||||
"_components": [
|
"_components": [
|
||||||
{
|
{
|
||||||
"__id__": 52
|
"__id__": 53
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__id__": 53
|
"__id__": 54
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_prefab": {
|
"_prefab": {
|
||||||
"__id__": 54
|
"__id__": 55
|
||||||
},
|
},
|
||||||
"_opacity": 255,
|
"_opacity": 255,
|
||||||
"_color": {
|
"_color": {
|
||||||
@ -1751,21 +1807,21 @@
|
|||||||
"_name": "New Label",
|
"_name": "New Label",
|
||||||
"_objFlags": 0,
|
"_objFlags": 0,
|
||||||
"_parent": {
|
"_parent": {
|
||||||
"__id__": 47
|
"__id__": 48
|
||||||
},
|
},
|
||||||
"_children": [],
|
"_children": [],
|
||||||
"_active": true,
|
"_active": true,
|
||||||
"_level": 5,
|
"_level": 5,
|
||||||
"_components": [
|
"_components": [
|
||||||
{
|
{
|
||||||
"__id__": 49
|
"__id__": 50
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__id__": 50
|
"__id__": 51
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_prefab": {
|
"_prefab": {
|
||||||
"__id__": 51
|
"__id__": 52
|
||||||
},
|
},
|
||||||
"_opacity": 255,
|
"_opacity": 255,
|
||||||
"_color": {
|
"_color": {
|
||||||
@ -1817,7 +1873,7 @@
|
|||||||
"_name": "",
|
"_name": "",
|
||||||
"_objFlags": 0,
|
"_objFlags": 0,
|
||||||
"node": {
|
"node": {
|
||||||
"__id__": 48
|
"__id__": 49
|
||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"_srcBlendFactor": 1,
|
"_srcBlendFactor": 1,
|
||||||
@ -1842,7 +1898,7 @@
|
|||||||
"_name": "",
|
"_name": "",
|
||||||
"_objFlags": 0,
|
"_objFlags": 0,
|
||||||
"node": {
|
"node": {
|
||||||
"__id__": 48
|
"__id__": 49
|
||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"_color": {
|
"_color": {
|
||||||
@ -1871,7 +1927,7 @@
|
|||||||
"_name": "",
|
"_name": "",
|
||||||
"_objFlags": 0,
|
"_objFlags": 0,
|
||||||
"node": {
|
"node": {
|
||||||
"__id__": 47
|
"__id__": 48
|
||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"_srcBlendFactor": 770,
|
"_srcBlendFactor": 770,
|
||||||
@ -1899,7 +1955,7 @@
|
|||||||
"_name": "",
|
"_name": "",
|
||||||
"_objFlags": 0,
|
"_objFlags": 0,
|
||||||
"node": {
|
"node": {
|
||||||
"__id__": 47
|
"__id__": 48
|
||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"transition": 0,
|
"transition": 0,
|
||||||
@ -1943,7 +1999,7 @@
|
|||||||
"hoverSprite": null,
|
"hoverSprite": null,
|
||||||
"_N$disabledSprite": null,
|
"_N$disabledSprite": null,
|
||||||
"_N$target": {
|
"_N$target": {
|
||||||
"__id__": 47
|
"__id__": 48
|
||||||
},
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
@ -2006,21 +2062,21 @@
|
|||||||
},
|
},
|
||||||
"_children": [
|
"_children": [
|
||||||
{
|
{
|
||||||
"__id__": 58
|
"__id__": 59
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__id__": 62
|
"__id__": 63
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_active": true,
|
"_active": true,
|
||||||
"_level": 3,
|
"_level": 3,
|
||||||
"_components": [
|
"_components": [
|
||||||
{
|
{
|
||||||
"__id__": 66
|
"__id__": 67
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_prefab": {
|
"_prefab": {
|
||||||
"__id__": 67
|
"__id__": 68
|
||||||
},
|
},
|
||||||
"_opacity": 255,
|
"_opacity": 255,
|
||||||
"_color": {
|
"_color": {
|
||||||
@ -2072,21 +2128,21 @@
|
|||||||
"_name": "menu_close_btn",
|
"_name": "menu_close_btn",
|
||||||
"_objFlags": 0,
|
"_objFlags": 0,
|
||||||
"_parent": {
|
"_parent": {
|
||||||
"__id__": 57
|
"__id__": 58
|
||||||
},
|
},
|
||||||
"_children": [],
|
"_children": [],
|
||||||
"_active": true,
|
"_active": true,
|
||||||
"_level": 4,
|
"_level": 4,
|
||||||
"_components": [
|
"_components": [
|
||||||
{
|
{
|
||||||
"__id__": 59
|
"__id__": 60
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__id__": 60
|
"__id__": 61
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_prefab": {
|
"_prefab": {
|
||||||
"__id__": 61
|
"__id__": 62
|
||||||
},
|
},
|
||||||
"_opacity": 255,
|
"_opacity": 255,
|
||||||
"_color": {
|
"_color": {
|
||||||
@ -2138,7 +2194,7 @@
|
|||||||
"_name": "",
|
"_name": "",
|
||||||
"_objFlags": 0,
|
"_objFlags": 0,
|
||||||
"node": {
|
"node": {
|
||||||
"__id__": 58
|
"__id__": 59
|
||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"_srcBlendFactor": 770,
|
"_srcBlendFactor": 770,
|
||||||
@ -2166,7 +2222,7 @@
|
|||||||
"_name": "",
|
"_name": "",
|
||||||
"_objFlags": 0,
|
"_objFlags": 0,
|
||||||
"node": {
|
"node": {
|
||||||
"__id__": 58
|
"__id__": 59
|
||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"transition": 0,
|
"transition": 0,
|
||||||
@ -2210,7 +2266,7 @@
|
|||||||
"hoverSprite": null,
|
"hoverSprite": null,
|
||||||
"_N$disabledSprite": null,
|
"_N$disabledSprite": null,
|
||||||
"_N$target": {
|
"_N$target": {
|
||||||
"__id__": 58
|
"__id__": 59
|
||||||
},
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
@ -2230,21 +2286,21 @@
|
|||||||
"_name": "New Label",
|
"_name": "New Label",
|
||||||
"_objFlags": 0,
|
"_objFlags": 0,
|
||||||
"_parent": {
|
"_parent": {
|
||||||
"__id__": 57
|
"__id__": 58
|
||||||
},
|
},
|
||||||
"_children": [],
|
"_children": [],
|
||||||
"_active": true,
|
"_active": true,
|
||||||
"_level": 4,
|
"_level": 4,
|
||||||
"_components": [
|
"_components": [
|
||||||
{
|
{
|
||||||
"__id__": 63
|
"__id__": 64
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__id__": 64
|
"__id__": 65
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_prefab": {
|
"_prefab": {
|
||||||
"__id__": 65
|
"__id__": 66
|
||||||
},
|
},
|
||||||
"_opacity": 255,
|
"_opacity": 255,
|
||||||
"_color": {
|
"_color": {
|
||||||
@ -2296,7 +2352,7 @@
|
|||||||
"_name": "",
|
"_name": "",
|
||||||
"_objFlags": 0,
|
"_objFlags": 0,
|
||||||
"node": {
|
"node": {
|
||||||
"__id__": 62
|
"__id__": 63
|
||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"_srcBlendFactor": 1,
|
"_srcBlendFactor": 1,
|
||||||
@ -2321,7 +2377,7 @@
|
|||||||
"_name": "",
|
"_name": "",
|
||||||
"_objFlags": 0,
|
"_objFlags": 0,
|
||||||
"node": {
|
"node": {
|
||||||
"__id__": 62
|
"__id__": 63
|
||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"_color": {
|
"_color": {
|
||||||
@ -2350,7 +2406,7 @@
|
|||||||
"_name": "",
|
"_name": "",
|
||||||
"_objFlags": 0,
|
"_objFlags": 0,
|
||||||
"node": {
|
"node": {
|
||||||
"__id__": 57
|
"__id__": 58
|
||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"_srcBlendFactor": 770,
|
"_srcBlendFactor": 770,
|
||||||
@ -2420,14 +2476,23 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"closeBtn": {
|
"closeBtn": {
|
||||||
"__id__": 58
|
"__id__": 59
|
||||||
},
|
},
|
||||||
"submitBtn": {
|
"submitBtn": {
|
||||||
"__id__": 47
|
"__id__": 48
|
||||||
|
},
|
||||||
|
"captchaBtn": {
|
||||||
|
"__id__": 42
|
||||||
},
|
},
|
||||||
"resultPrefab": {
|
"resultPrefab": {
|
||||||
"__uuid__": "50fc505c-5051-4781-84b8-6bdf8254ed17"
|
"__uuid__": "50fc505c-5051-4781-84b8-6bdf8254ed17"
|
||||||
},
|
},
|
||||||
|
"mobileInput": {
|
||||||
|
"__id__": 25
|
||||||
|
},
|
||||||
|
"captchaInput": {
|
||||||
|
"__id__": 40
|
||||||
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
3209
assets/resources/prefabs/info_menu_input.prefab
Normal file
3209
assets/resources/prefabs/info_menu_input.prefab
Normal file
File diff suppressed because it is too large
Load Diff
7
assets/resources/prefabs/info_menu_input.prefab.meta
Normal file
7
assets/resources/prefabs/info_menu_input.prefab.meta
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"ver": "1.0.0",
|
||||||
|
"uuid": "14e28457-5820-4f5b-a685-e9a9083b336c",
|
||||||
|
"optimizationPolicy": "AUTO",
|
||||||
|
"asyncLoadAssets": false,
|
||||||
|
"subMetas": {}
|
||||||
|
}
|
@ -1,3 +1,5 @@
|
|||||||
|
let webapi = require('./utils/webapi');
|
||||||
|
let stringUtil = require('./utils/string.util');
|
||||||
cc.Class({
|
cc.Class({
|
||||||
extends: cc.Component,
|
extends: cc.Component,
|
||||||
|
|
||||||
@ -10,9 +12,29 @@ cc.Class({
|
|||||||
default: null,
|
default: null,
|
||||||
type: cc.Node
|
type: cc.Node
|
||||||
},
|
},
|
||||||
|
captchaBtn: {
|
||||||
|
default: null,
|
||||||
|
type: cc.Node
|
||||||
|
},
|
||||||
resultPrefab: {
|
resultPrefab: {
|
||||||
default: null,
|
default: null,
|
||||||
type: cc.Prefab
|
type: cc.Prefab
|
||||||
|
},
|
||||||
|
mobileInput: {
|
||||||
|
default: null,
|
||||||
|
type: cc.EditBox
|
||||||
|
},
|
||||||
|
captchaInput: {
|
||||||
|
default: null,
|
||||||
|
type: cc.EditBox
|
||||||
|
},
|
||||||
|
codeInput: {
|
||||||
|
default: null,
|
||||||
|
type: cc.EditBox
|
||||||
|
},
|
||||||
|
codeImg: {
|
||||||
|
default: null,
|
||||||
|
type: cc.Sprite
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -20,11 +42,32 @@ cc.Class({
|
|||||||
|
|
||||||
onLoad () {
|
onLoad () {
|
||||||
let self = this;
|
let self = this;
|
||||||
|
if (this.top.needCode) {
|
||||||
|
this.showCaptchaInput();
|
||||||
|
this.codeImg.node.on('click', function () {
|
||||||
|
self.showCaptchaInput();
|
||||||
|
})
|
||||||
|
}
|
||||||
this.closeBtn.on('click', function () {
|
this.closeBtn.on('click', function () {
|
||||||
self.node.removeFromParent(true);
|
self.node.removeFromParent(true);
|
||||||
});
|
});
|
||||||
this.submitBtn.on('click', function () {
|
this.submitBtn.on('click', function () {
|
||||||
self.showResultView();
|
let mobile = self.mobileInput.string;
|
||||||
|
});
|
||||||
|
this.captchaBtn.on('click', function () {
|
||||||
|
console.log(self.mobileInput.string);
|
||||||
|
let mobile = self.mobileInput.string;
|
||||||
|
if (!stringUtil.checkMobile(mobile)) {
|
||||||
|
alert('请输入有效的手机号码。');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
webapi.sendSms(mobile)
|
||||||
|
.then(res => {
|
||||||
|
console.log(res);
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.log(err);
|
||||||
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -35,5 +78,19 @@ cc.Class({
|
|||||||
let result = cc.instantiate(this.resultPrefab);
|
let result = cc.instantiate(this.resultPrefab);
|
||||||
this.top.node.addChild(result, 11);
|
this.top.node.addChild(result, 11);
|
||||||
this.node.removeFromParent(true);
|
this.node.removeFromParent(true);
|
||||||
|
},
|
||||||
|
|
||||||
|
showCaptchaInput() {
|
||||||
|
let self = this;
|
||||||
|
cc.loader.load({
|
||||||
|
url: webapi.captchaUrl()+'?'+new Date(),
|
||||||
|
type: 'jpg'
|
||||||
|
}, function (err, texture) {
|
||||||
|
if (err) {
|
||||||
|
console.log('load avatar error === ', err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
self.codeImg.spriteFrame = new cc.SpriteFrame(texture);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -36,6 +36,10 @@ cc.Class({
|
|||||||
default: null,
|
default: null,
|
||||||
type: cc.Prefab
|
type: cc.Prefab
|
||||||
},
|
},
|
||||||
|
infoMenuPrefab2: {
|
||||||
|
default: null,
|
||||||
|
type: cc.Prefab
|
||||||
|
},
|
||||||
rulePrefab: {
|
rulePrefab: {
|
||||||
default: null,
|
default: null,
|
||||||
type: cc.Prefab
|
type: cc.Prefab
|
||||||
@ -52,14 +56,15 @@ cc.Class({
|
|||||||
default: null,
|
default: null,
|
||||||
type: cc.Node
|
type: cc.Node
|
||||||
},
|
},
|
||||||
partsY: []
|
partsY: [],
|
||||||
|
needCode: true
|
||||||
},
|
},
|
||||||
|
|
||||||
// LIFE-CYCLE CALLBACKS:
|
// LIFE-CYCLE CALLBACKS:
|
||||||
|
|
||||||
onLoad () {
|
onLoad () {
|
||||||
let self = this;
|
let self = this;
|
||||||
http.get('http://192.168.100.228:7456/res/import/4d/4d364e42-855d-4e28-abe4-0221d8b6c47b.json', {} )
|
http.get('http://192.168.100.228/activity/api/index', {} )
|
||||||
.then(res => {
|
.then(res => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
})
|
})
|
||||||
@ -124,7 +129,12 @@ cc.Class({
|
|||||||
this.topMenu.active = false;
|
this.topMenu.active = false;
|
||||||
},
|
},
|
||||||
showInfoMenu() {
|
showInfoMenu() {
|
||||||
let infoMenu = cc.instantiate(this.infoMenuPrefab);
|
let infoMenu;
|
||||||
|
if (this.needCode) {
|
||||||
|
infoMenu = cc.instantiate(this.infoMenuPrefab2);
|
||||||
|
} else {
|
||||||
|
infoMenu = cc.instantiate(this.infoMenuPrefab);
|
||||||
|
}
|
||||||
infoMenu.getComponent('infoMenu').top = this;
|
infoMenu.getComponent('infoMenu').top = this;
|
||||||
this.node.addChild(infoMenu, 11);
|
this.node.addChild(infoMenu, 11);
|
||||||
},
|
},
|
||||||
|
@ -7,8 +7,14 @@ const get = (url, header) => {
|
|||||||
|
|
||||||
const post = (url, data, header) => {
|
const post = (url, data, header) => {
|
||||||
header = header || {};
|
header = header || {};
|
||||||
header['Content-Type'] = 'application/json';
|
let formStr = '';
|
||||||
return Ajax(url, 'POST', data, header)
|
let i = 0;
|
||||||
|
for(let key in data) {
|
||||||
|
if (i ++ > 0) formStr += '&';
|
||||||
|
formStr += (key + '=' + data[key]);
|
||||||
|
}
|
||||||
|
header['Content-Type'] = 'application/x-www-form-urlencoded';
|
||||||
|
return Ajax(url, 'POST', formStr, header)
|
||||||
};
|
};
|
||||||
|
|
||||||
const Ajax = (url, method, data, header) => {
|
const Ajax = (url, method, data, header) => {
|
||||||
|
11
assets/scripts/utils/string.util.js
Normal file
11
assets/scripts/utils/string.util.js
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
export default {
|
||||||
|
checkMobile(mobile) {
|
||||||
|
return /^1\d{10}$/.test(mobile);
|
||||||
|
},
|
||||||
|
checkAuthCode(code) {
|
||||||
|
return /^\d{6}$/.test(code);
|
||||||
|
},
|
||||||
|
checkCaptcheCode(code) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
9
assets/scripts/utils/string.util.js.meta
Normal file
9
assets/scripts/utils/string.util.js.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"ver": "1.0.5",
|
||||||
|
"uuid": "d71687dd-e39a-4e7f-97e4-6fc499fea404",
|
||||||
|
"isPlugin": false,
|
||||||
|
"loadPluginInWeb": true,
|
||||||
|
"loadPluginInNative": true,
|
||||||
|
"loadPluginInEditor": false,
|
||||||
|
"subMetas": {}
|
||||||
|
}
|
17
assets/scripts/utils/webapi.js
Normal file
17
assets/scripts/utils/webapi.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
var http = require('./http');
|
||||||
|
|
||||||
|
const baseUrl = 'http://192.168.100.228';
|
||||||
|
export default {
|
||||||
|
sendSms: (mobile, captcha) => {
|
||||||
|
let data = {mobile: mobile};
|
||||||
|
if (captcha) {
|
||||||
|
data['captcha'] = captcha;
|
||||||
|
}
|
||||||
|
|
||||||
|
let url = baseUrl + '/activity/api/send_sms';
|
||||||
|
return http.post(url, data);
|
||||||
|
},
|
||||||
|
captchaUrl: () => {
|
||||||
|
return baseUrl + '/captcha/ch/login'
|
||||||
|
}
|
||||||
|
}
|
9
assets/scripts/utils/webapi.js.meta
Normal file
9
assets/scripts/utils/webapi.js.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"ver": "1.0.5",
|
||||||
|
"uuid": "c750bf25-4ad4-4de7-b570-efcb5f8a7f6f",
|
||||||
|
"isPlugin": false,
|
||||||
|
"loadPluginInWeb": true,
|
||||||
|
"loadPluginInNative": true,
|
||||||
|
"loadPluginInEditor": false,
|
||||||
|
"subMetas": {}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user