Commit ec0811ad authored by 李维's avatar 李维

测试IOS家长验证

parent 35224b3d
...@@ -166,6 +166,31 @@ export default class NewClass extends middleLayerBase { ...@@ -166,6 +166,31 @@ export default class NewClass extends middleLayerBase {
payloading.active = false; payloading.active = false;
} }
// 家长验证
parentProtect(callback) {
const parentProtectNode = cc.find(`middleLayer/iosActiveLayer/parent_protect`);
const num1Node = cc.find("/num1", parentProtectNode);
const num2Node = cc.find("/num2", parentProtectNode);
const okBtn = cc.find("/active", parentProtectNode);
const input = cc.find("/result", parentProtectNode).getComponent(cc.EditBox);
const num1 = Math.ceil(Math.random() * 10);
const num2 = Math.ceil(Math.random() * 10);
const res = num1 * num2;
cc.find(`num_${num1}`, num1Node).active = true;
cc.find(`num_${num2}`, num2Node).active = true;
okBtn.on("click", ()=>{
const activeCode = input.textLabel.string;
if(activeCode == res + "") {
callback && callback()
} else {
this.showTips("验证失败,请重试");
}
})
}
// 购买 // 购买
async buy(product) { async buy(product) {
// 苹果支付 // 苹果支付
...@@ -1179,23 +1204,35 @@ export default class NewClass extends middleLayerBase { ...@@ -1179,23 +1204,35 @@ export default class NewClass extends middleLayerBase {
}); });
buttonOnClick(cc.find('active_bg/1_5_product/card/buy', iosActiveWin), (btn) => { buttonOnClick(cc.find('active_bg/1_5_product/card/buy', iosActiveWin), (btn) => {
this.parentProtect(()=>{
this.buy(btn.product); this.buy(btn.product);
})
}); });
buttonOnClick(cc.find('active_bg/one_level_product/level1/buy', iosActiveWin), (btn) => { buttonOnClick(cc.find('active_bg/one_level_product/level1/buy', iosActiveWin), (btn) => {
this.parentProtect(()=>{
this.buy(btn.product); this.buy(btn.product);
})
}); });
buttonOnClick(cc.find('active_bg/one_level_product/level2/buy', iosActiveWin), (btn) => { buttonOnClick(cc.find('active_bg/one_level_product/level2/buy', iosActiveWin), (btn) => {
this.parentProtect(()=>{
this.buy(btn.product); this.buy(btn.product);
})
}); });
buttonOnClick(cc.find('active_bg/one_level_product/level3/buy', iosActiveWin), (btn) => { buttonOnClick(cc.find('active_bg/one_level_product/level3/buy', iosActiveWin), (btn) => {
this.parentProtect(()=>{
this.buy(btn.product); this.buy(btn.product);
})
}); });
buttonOnClick(cc.find('active_bg/one_level_product/level4/buy', iosActiveWin), (btn) => { buttonOnClick(cc.find('active_bg/one_level_product/level4/buy', iosActiveWin), (btn) => {
this.parentProtect(()=>{
this.buy(btn.product); this.buy(btn.product);
})
}); });
buttonOnClick(cc.find('active_bg/one_level_product/level5/buy', iosActiveWin), (btn) => { buttonOnClick(cc.find('active_bg/one_level_product/level5/buy', iosActiveWin), (btn) => {
this.parentProtect(()=>{
this.buy(btn.product); this.buy(btn.product);
})
}); });
buttonOnClick(cc.find('buy_status_win/active_btn', iosActiveWin), (btn) => { buttonOnClick(cc.find('buy_status_win/active_btn', iosActiveWin), (btn) => {
......
{
"ver": "1.1.2",
"uuid": "e83267e2-633f-4b45-bc61-124fc3cc6438",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "a1021109-7685-4b9d-8fc3-793ae39ec5d1",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "5c1091ff-c551-410d-9f61-55b641b3b4db",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 100,
"height": 100,
"platformSettings": {},
"subMetas": {
"num_0": {
"ver": "1.0.4",
"uuid": "719c2cc2-a893-41ca-a5bc-c0fc98732ca8",
"rawTextureUuid": "5c1091ff-c551-410d-9f61-55b641b3b4db",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": -0.5,
"trimX": 16,
"trimY": 18,
"width": 68,
"height": 65,
"rawWidth": 100,
"rawHeight": 100,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "3c8c8b7a-cd81-4b8d-ab38-cdde23856ebf",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 100,
"height": 100,
"platformSettings": {},
"subMetas": {
"num_1": {
"ver": "1.0.4",
"uuid": "03002c18-3c8f-44fe-a9e4-350b0200f685",
"rawTextureUuid": "3c8c8b7a-cd81-4b8d-ab38-cdde23856ebf",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0.5,
"offsetY": 2.5,
"trimX": 19,
"trimY": 16,
"width": 63,
"height": 63,
"rawWidth": 100,
"rawHeight": 100,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "1e39acd9-ffe4-46c1-b8b3-7727cac04865",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 100,
"height": 100,
"platformSettings": {},
"subMetas": {
"num_2": {
"ver": "1.0.4",
"uuid": "04e678ae-4482-4ae4-9cad-242399efe73e",
"rawTextureUuid": "1e39acd9-ffe4-46c1-b8b3-7727cac04865",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 1.5,
"trimX": 18,
"trimY": 15,
"width": 64,
"height": 67,
"rawWidth": 100,
"rawHeight": 100,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "8746f491-d4d4-4e65-a63f-43c4288201ae",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 100,
"height": 100,
"platformSettings": {},
"subMetas": {
"num_3": {
"ver": "1.0.4",
"uuid": "83ae6773-7a38-48ac-bf6b-0f9add4a1df8",
"rawTextureUuid": "8746f491-d4d4-4e65-a63f-43c4288201ae",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 3.5,
"trimX": 16,
"trimY": 15,
"width": 68,
"height": 63,
"rawWidth": 100,
"rawHeight": 100,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "36764900-e24c-4ce0-8f94-06ca8ef31234",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 100,
"height": 100,
"platformSettings": {},
"subMetas": {
"num_4": {
"ver": "1.0.4",
"uuid": "a66f63a4-4c98-421e-9b9d-39951aa91e5f",
"rawTextureUuid": "36764900-e24c-4ce0-8f94-06ca8ef31234",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0.5,
"offsetY": -1.5,
"trimX": 23,
"trimY": 22,
"width": 55,
"height": 59,
"rawWidth": 100,
"rawHeight": 100,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "90c598dc-532c-4c91-ae43-3894cfe4a275",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 100,
"height": 100,
"platformSettings": {},
"subMetas": {
"num_5": {
"ver": "1.0.4",
"uuid": "3c54d786-242c-4d39-89f4-39ecbfc70f18",
"rawTextureUuid": "90c598dc-532c-4c91-ae43-3894cfe4a275",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -0.5,
"offsetY": 1.5,
"trimX": 16,
"trimY": 16,
"width": 67,
"height": 65,
"rawWidth": 100,
"rawHeight": 100,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "5d472208-638e-4b5d-aa34-8346bded444c",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 100,
"height": 100,
"platformSettings": {},
"subMetas": {
"num_6": {
"ver": "1.0.4",
"uuid": "81e16339-0d44-432f-b562-83528486a597",
"rawTextureUuid": "5d472208-638e-4b5d-aa34-8346bded444c",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 2.5,
"offsetY": 1.5,
"trimX": 22,
"trimY": 16,
"width": 61,
"height": 65,
"rawWidth": 100,
"rawHeight": 100,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "9cbf212d-d9d7-4185-b8c8-a112e3f53ed9",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 100,
"height": 100,
"platformSettings": {},
"subMetas": {
"num_7": {
"ver": "1.0.4",
"uuid": "1195ee94-a270-4057-a8da-5d1156cb3458",
"rawTextureUuid": "9cbf212d-d9d7-4185-b8c8-a112e3f53ed9",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0.5,
"offsetY": 1,
"trimX": 17,
"trimY": 16,
"width": 67,
"height": 66,
"rawWidth": 100,
"rawHeight": 100,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "847602e6-ba08-461b-b7fe-487558da46af",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 100,
"height": 100,
"platformSettings": {},
"subMetas": {
"num_8": {
"ver": "1.0.4",
"uuid": "fc050120-075f-4885-ad52-b3f41c7e6aa9",
"rawTextureUuid": "847602e6-ba08-461b-b7fe-487558da46af",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -2.5,
"offsetY": 1.5,
"trimX": 16,
"trimY": 16,
"width": 63,
"height": 65,
"rawWidth": 100,
"rawHeight": 100,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "104cfa33-1d8b-4db7-8653-0762963f3e13",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 100,
"height": 100,
"platformSettings": {},
"subMetas": {
"num_9": {
"ver": "1.0.4",
"uuid": "90775fc0-cdd4-4c20-a887-1d0b03d28248",
"rawTextureUuid": "104cfa33-1d8b-4db7-8653-0762963f3e13",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 1,
"offsetY": 1.5,
"trimX": 17,
"trimY": 16,
"width": 68,
"height": 65,
"rawWidth": 100,
"rawHeight": 100,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
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