分享二次弹窗功能
This commit is contained in:
parent
f865b3bfea
commit
2cdee72fe1
File diff suppressed because it is too large
Load Diff
|
|
@ -565,6 +565,33 @@ export default class SceneManager extends cc.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
shareFriend() {
|
shareFriend() {
|
||||||
|
let shareTips = this.node.getChildByName("Game").getChildByName("Lose").getChildByName("share_tips");
|
||||||
|
let closeBtn = shareTips.getChildByName("closeBtn");
|
||||||
|
let shareBtn = shareTips.getChildByName("shareBtn");
|
||||||
|
let checkbox = shareTips.getChildByName("checkbox");
|
||||||
|
// let isCheckboxChecked = cc.sys.localStorage.getItem("share_checkbox_state");
|
||||||
|
let isCheckboxChecked = cc.fx.StorageMessage.getStorage("share_checkbox_state");
|
||||||
|
|
||||||
|
if (isCheckboxChecked == 0 || isCheckboxChecked == "" || isCheckboxChecked == null || isCheckboxChecked == undefined) {
|
||||||
|
shareTips.active = true;
|
||||||
|
} else {
|
||||||
|
this.shareFriend2();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
shareFriend2() {
|
||||||
|
let shareTips = this.node.getChildByName("Game").getChildByName("Lose").getChildByName("share_tips");
|
||||||
|
if (shareTips.active) {
|
||||||
|
shareTips.active = false;
|
||||||
|
let checkbox = shareTips.getChildByName("checkbox");
|
||||||
|
|
||||||
|
let checkboxSelect = 0;
|
||||||
|
if (checkbox.getComponent(cc.Toggle).isChecked) {
|
||||||
|
checkboxSelect = 1;
|
||||||
|
}
|
||||||
|
cc.fx.StorageMessage.setStorage("share_checkbox_state", checkboxSelect);
|
||||||
|
}
|
||||||
if (this.share_time) {
|
if (this.share_time) {
|
||||||
this.share_time = false;
|
this.share_time = false;
|
||||||
console.log("设置分享链接");
|
console.log("设置分享链接");
|
||||||
|
|
@ -579,8 +606,22 @@ export default class SceneManager extends cc.Component {
|
||||||
this.share_time = true;
|
this.share_time = true;
|
||||||
}, 5000);
|
}, 5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
shareClose() {
|
||||||
|
let shareTips = this.node.getChildByName("Game").getChildByName("Lose").getChildByName("share_tips");
|
||||||
|
if (shareTips.active) {
|
||||||
|
shareTips.active = false;
|
||||||
|
let checkbox = shareTips.getChildByName("checkbox");
|
||||||
|
|
||||||
|
let checkboxSelect = 0;
|
||||||
|
if (checkbox.getComponent(cc.Toggle).isChecked) {
|
||||||
|
checkboxSelect = 1;
|
||||||
|
}
|
||||||
|
cc.fx.StorageMessage.setStorage("share_checkbox_state", checkboxSelect);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
openLoad() {
|
openLoad() {
|
||||||
this.node.getChildByName("Loading").active = true;
|
this.node.getChildByName("Loading").active = true;
|
||||||
this.node.getChildByName("Loading").getChildByName("load").stopAllActions();
|
this.node.getChildByName("Loading").getChildByName("load").stopAllActions();
|
||||||
|
|
|
||||||
100
assets/UI/UI/pop/shareTips.plist
Normal file
100
assets/UI/UI/pop/shareTips.plist
Normal file
|
|
@ -0,0 +1,100 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>frames</key>
|
||||||
|
<dict>
|
||||||
|
<key>checkbox_1.png</key>
|
||||||
|
<dict>
|
||||||
|
<key>frame</key>
|
||||||
|
<string>{{1383,84},{70,72}}</string>
|
||||||
|
<key>offset</key>
|
||||||
|
<string>{-8,-4}</string>
|
||||||
|
<key>rotated</key>
|
||||||
|
<false/>
|
||||||
|
<key>sourceColorRect</key>
|
||||||
|
<string>{{3,8},{70,72}}</string>
|
||||||
|
<key>sourceSize</key>
|
||||||
|
<string>{92,80}</string>
|
||||||
|
</dict>
|
||||||
|
<key>checkbox_2.png</key>
|
||||||
|
<dict>
|
||||||
|
<key>frame</key>
|
||||||
|
<string>{{1383,2},{92,80}}</string>
|
||||||
|
<key>offset</key>
|
||||||
|
<string>{0,0}</string>
|
||||||
|
<key>rotated</key>
|
||||||
|
<false/>
|
||||||
|
<key>sourceColorRect</key>
|
||||||
|
<string>{{0,0},{92,80}}</string>
|
||||||
|
<key>sourceSize</key>
|
||||||
|
<string>{92,80}</string>
|
||||||
|
</dict>
|
||||||
|
<key>share_btn.png</key>
|
||||||
|
<dict>
|
||||||
|
<key>frame</key>
|
||||||
|
<string>{{825,2},{556,164}}</string>
|
||||||
|
<key>offset</key>
|
||||||
|
<string>{0,0}</string>
|
||||||
|
<key>rotated</key>
|
||||||
|
<false/>
|
||||||
|
<key>sourceColorRect</key>
|
||||||
|
<string>{{0,0},{556,164}}</string>
|
||||||
|
<key>sourceSize</key>
|
||||||
|
<string>{556,164}</string>
|
||||||
|
</dict>
|
||||||
|
<key>share_label_1.png</key>
|
||||||
|
<dict>
|
||||||
|
<key>frame</key>
|
||||||
|
<string>{{2,2},{821,222}}</string>
|
||||||
|
<key>offset</key>
|
||||||
|
<string>{0,0}</string>
|
||||||
|
<key>rotated</key>
|
||||||
|
<false/>
|
||||||
|
<key>sourceColorRect</key>
|
||||||
|
<string>{{0,0},{821,222}}</string>
|
||||||
|
<key>sourceSize</key>
|
||||||
|
<string>{821,222}</string>
|
||||||
|
</dict>
|
||||||
|
<key>share_label_2.png</key>
|
||||||
|
<dict>
|
||||||
|
<key>frame</key>
|
||||||
|
<string>{{1083,168},{416,39}}</string>
|
||||||
|
<key>offset</key>
|
||||||
|
<string>{0,0}</string>
|
||||||
|
<key>rotated</key>
|
||||||
|
<false/>
|
||||||
|
<key>sourceColorRect</key>
|
||||||
|
<string>{{0,0},{416,39}}</string>
|
||||||
|
<key>sourceSize</key>
|
||||||
|
<string>{416,39}</string>
|
||||||
|
</dict>
|
||||||
|
<key>share_tips.png</key>
|
||||||
|
<dict>
|
||||||
|
<key>frame</key>
|
||||||
|
<string>{{825,168},{256,66}}</string>
|
||||||
|
<key>offset</key>
|
||||||
|
<string>{0,0}</string>
|
||||||
|
<key>rotated</key>
|
||||||
|
<false/>
|
||||||
|
<key>sourceColorRect</key>
|
||||||
|
<string>{{0,0},{256,66}}</string>
|
||||||
|
<key>sourceSize</key>
|
||||||
|
<string>{256,66}</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>metadata</key>
|
||||||
|
<dict>
|
||||||
|
<key>format</key>
|
||||||
|
<integer>2</integer>
|
||||||
|
<key>realTextureFileName</key>
|
||||||
|
<string>shareTips.png</string>
|
||||||
|
<key>size</key>
|
||||||
|
<string>{1501,236}</string>
|
||||||
|
<key>smartupdate</key>
|
||||||
|
<string>$TexturePacker:SmartUpdate:86e111cd079412de87e96970da6800c8$</string>
|
||||||
|
<key>textureFileName</key>
|
||||||
|
<string>shareTips.png</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
151
assets/UI/UI/pop/shareTips.plist.meta
Normal file
151
assets/UI/UI/pop/shareTips.plist.meta
Normal file
|
|
@ -0,0 +1,151 @@
|
||||||
|
{
|
||||||
|
"ver": "1.2.6",
|
||||||
|
"uuid": "6f5b6d88-1f8c-445d-9b05-3c9130eeb42a",
|
||||||
|
"importer": "asset",
|
||||||
|
"rawTextureUuid": "c2194a4c-d9df-4582-a57b-a18c25592ea3",
|
||||||
|
"size": {
|
||||||
|
"width": 1501,
|
||||||
|
"height": 236
|
||||||
|
},
|
||||||
|
"type": "Texture Packer",
|
||||||
|
"subMetas": {
|
||||||
|
"checkbox_1.png": {
|
||||||
|
"ver": "1.0.6",
|
||||||
|
"uuid": "f45c1d81-1c53-428c-84b6-4e960bd18e35",
|
||||||
|
"importer": "sprite-frame",
|
||||||
|
"rawTextureUuid": "c2194a4c-d9df-4582-a57b-a18c25592ea3",
|
||||||
|
"trimType": "auto",
|
||||||
|
"trimThreshold": 1,
|
||||||
|
"rotated": false,
|
||||||
|
"offsetX": -8,
|
||||||
|
"offsetY": -4,
|
||||||
|
"trimX": 1383,
|
||||||
|
"trimY": 84,
|
||||||
|
"width": 70,
|
||||||
|
"height": 72,
|
||||||
|
"rawWidth": 92,
|
||||||
|
"rawHeight": 80,
|
||||||
|
"borderTop": 0,
|
||||||
|
"borderBottom": 0,
|
||||||
|
"borderLeft": 0,
|
||||||
|
"borderRight": 0,
|
||||||
|
"spriteType": "normal",
|
||||||
|
"subMetas": {}
|
||||||
|
},
|
||||||
|
"checkbox_2.png": {
|
||||||
|
"ver": "1.0.6",
|
||||||
|
"uuid": "9119b2ad-51a7-49f5-9ec1-19b417fa48c0",
|
||||||
|
"importer": "sprite-frame",
|
||||||
|
"rawTextureUuid": "c2194a4c-d9df-4582-a57b-a18c25592ea3",
|
||||||
|
"trimType": "auto",
|
||||||
|
"trimThreshold": 1,
|
||||||
|
"rotated": false,
|
||||||
|
"offsetX": 0,
|
||||||
|
"offsetY": 0,
|
||||||
|
"trimX": 1383,
|
||||||
|
"trimY": 2,
|
||||||
|
"width": 92,
|
||||||
|
"height": 80,
|
||||||
|
"rawWidth": 92,
|
||||||
|
"rawHeight": 80,
|
||||||
|
"borderTop": 0,
|
||||||
|
"borderBottom": 0,
|
||||||
|
"borderLeft": 0,
|
||||||
|
"borderRight": 0,
|
||||||
|
"spriteType": "normal",
|
||||||
|
"subMetas": {}
|
||||||
|
},
|
||||||
|
"share_btn.png": {
|
||||||
|
"ver": "1.0.6",
|
||||||
|
"uuid": "41891108-e581-4a49-bfdb-638f61d81d08",
|
||||||
|
"importer": "sprite-frame",
|
||||||
|
"rawTextureUuid": "c2194a4c-d9df-4582-a57b-a18c25592ea3",
|
||||||
|
"trimType": "auto",
|
||||||
|
"trimThreshold": 1,
|
||||||
|
"rotated": false,
|
||||||
|
"offsetX": 0,
|
||||||
|
"offsetY": 0,
|
||||||
|
"trimX": 825,
|
||||||
|
"trimY": 2,
|
||||||
|
"width": 556,
|
||||||
|
"height": 164,
|
||||||
|
"rawWidth": 556,
|
||||||
|
"rawHeight": 164,
|
||||||
|
"borderTop": 0,
|
||||||
|
"borderBottom": 0,
|
||||||
|
"borderLeft": 0,
|
||||||
|
"borderRight": 0,
|
||||||
|
"spriteType": "normal",
|
||||||
|
"subMetas": {}
|
||||||
|
},
|
||||||
|
"share_label_1.png": {
|
||||||
|
"ver": "1.0.6",
|
||||||
|
"uuid": "413333be-aed4-4ef6-9e60-de7bc58325bd",
|
||||||
|
"importer": "sprite-frame",
|
||||||
|
"rawTextureUuid": "c2194a4c-d9df-4582-a57b-a18c25592ea3",
|
||||||
|
"trimType": "auto",
|
||||||
|
"trimThreshold": 1,
|
||||||
|
"rotated": false,
|
||||||
|
"offsetX": 0,
|
||||||
|
"offsetY": 0,
|
||||||
|
"trimX": 2,
|
||||||
|
"trimY": 2,
|
||||||
|
"width": 821,
|
||||||
|
"height": 222,
|
||||||
|
"rawWidth": 821,
|
||||||
|
"rawHeight": 222,
|
||||||
|
"borderTop": 0,
|
||||||
|
"borderBottom": 0,
|
||||||
|
"borderLeft": 0,
|
||||||
|
"borderRight": 0,
|
||||||
|
"spriteType": "normal",
|
||||||
|
"subMetas": {}
|
||||||
|
},
|
||||||
|
"share_label_2.png": {
|
||||||
|
"ver": "1.0.6",
|
||||||
|
"uuid": "b21babd1-2cb3-461e-85c1-0760485da7e9",
|
||||||
|
"importer": "sprite-frame",
|
||||||
|
"rawTextureUuid": "c2194a4c-d9df-4582-a57b-a18c25592ea3",
|
||||||
|
"trimType": "auto",
|
||||||
|
"trimThreshold": 1,
|
||||||
|
"rotated": false,
|
||||||
|
"offsetX": 0,
|
||||||
|
"offsetY": 0,
|
||||||
|
"trimX": 1083,
|
||||||
|
"trimY": 168,
|
||||||
|
"width": 416,
|
||||||
|
"height": 39,
|
||||||
|
"rawWidth": 416,
|
||||||
|
"rawHeight": 39,
|
||||||
|
"borderTop": 0,
|
||||||
|
"borderBottom": 0,
|
||||||
|
"borderLeft": 0,
|
||||||
|
"borderRight": 0,
|
||||||
|
"spriteType": "normal",
|
||||||
|
"subMetas": {}
|
||||||
|
},
|
||||||
|
"share_tips.png": {
|
||||||
|
"ver": "1.0.6",
|
||||||
|
"uuid": "a453bc88-c3ae-47bb-a518-23332e2caf78",
|
||||||
|
"importer": "sprite-frame",
|
||||||
|
"rawTextureUuid": "c2194a4c-d9df-4582-a57b-a18c25592ea3",
|
||||||
|
"trimType": "auto",
|
||||||
|
"trimThreshold": 1,
|
||||||
|
"rotated": false,
|
||||||
|
"offsetX": 0,
|
||||||
|
"offsetY": 0,
|
||||||
|
"trimX": 825,
|
||||||
|
"trimY": 168,
|
||||||
|
"width": 256,
|
||||||
|
"height": 66,
|
||||||
|
"rawWidth": 256,
|
||||||
|
"rawHeight": 66,
|
||||||
|
"borderTop": 0,
|
||||||
|
"borderBottom": 0,
|
||||||
|
"borderLeft": 0,
|
||||||
|
"borderRight": 0,
|
||||||
|
"spriteType": "normal",
|
||||||
|
"subMetas": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
assets/UI/UI/pop/shareTips.png
Normal file
BIN
assets/UI/UI/pop/shareTips.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
15
assets/UI/UI/pop/shareTips.png.meta
Normal file
15
assets/UI/UI/pop/shareTips.png.meta
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
"ver": "2.3.7",
|
||||||
|
"uuid": "c2194a4c-d9df-4582-a57b-a18c25592ea3",
|
||||||
|
"importer": "texture",
|
||||||
|
"type": "raw",
|
||||||
|
"wrapMode": "clamp",
|
||||||
|
"filterMode": "bilinear",
|
||||||
|
"premultiplyAlpha": false,
|
||||||
|
"genMipmaps": false,
|
||||||
|
"packable": true,
|
||||||
|
"width": 1501,
|
||||||
|
"height": 236,
|
||||||
|
"platformSettings": {},
|
||||||
|
"subMetas": {}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user