Browse Source

【更新】:
1.游戏与应用智慧币连通;

youhaitao 2 years ago
parent
commit
9a8edc4eb9
25 changed files with 1663 additions and 508 deletions
  1. 3 0
      assets/main/SceneMain.ts
  2. BIN
      assets/res/downCount/res/img/coin.png
  3. 9 9
      assets/res/downCount/res/img/coin.png.meta
  4. 6 12
      assets/res/downCount/res/prefab/downCount.prefab
  5. BIN
      assets/res/luojigouFinish/res/img/back.png
  6. 38 0
      assets/res/luojigouFinish/res/img/back.png.meta
  7. BIN
      assets/res/luojigouFinish/res/img/coin0.png
  8. 11 11
      assets/res/luojigouFinish/res/img/coin0.png.meta
  9. BIN
      assets/res/luojigouFinish/res/img/coin1.png
  10. 38 0
      assets/res/luojigouFinish/res/img/coin1.png.meta
  11. BIN
      assets/res/luojigouFinish/res/img/狗爪子.png
  12. 1265 177
      assets/res/luojigouFinish/res/prefab/luojigouFinish.prefab
  13. 1 1
      assets/res/luojigouFinish/res/spine/success.meta
  14. 27 0
      assets/res/luojigouFinish/res/spine/success/sanxing.atlas
  15. 1 1
      assets/res/luojigouFinish/res/spine/success/sanxing.atlas.meta
  16. 0 0
      assets/res/luojigouFinish/res/spine/success/sanxing.json
  17. 2 2
      assets/res/luojigouFinish/res/spine/success/sanxing.json.meta
  18. BIN
      assets/res/luojigouFinish/res/spine/success/sanxing.png
  19. 10 10
      assets/res/luojigouFinish/res/spine/success/sanxing.png.meta
  20. 0 251
      assets/res/luojigouFinish/res/spine/success_dialog/游戏结算画面原画1.atlas
  21. 0 0
      assets/res/luojigouFinish/res/spine/success_dialog/游戏结算画面原画1.json
  22. BIN
      assets/res/luojigouFinish/res/spine/success_dialog/游戏结算画面原画1.png
  23. 183 28
      assets/res/luojigouFinish/src/LuojigouFinish.ts
  24. 3 0
      assets/src/common/Tools.ts
  25. 66 6
      assets/src/common/common.ts

+ 3 - 0
assets/main/SceneMain.ts

@@ -192,6 +192,9 @@ export default class Scene extends cc.Component {
         this.node.addChild(this.nodeShow, CConst.ZORDER_GAME);
         this.node.getChildByName('bg').active = true;
         this.resetBtnNext(true);
+        // 智慧币
+        let scriptFinish = this.nodeFinish.getComponent(GameFinish);
+        scriptFinish.initGameFinish();
     }
 
     /** 加载视频 先不去除游戏节点 */

BIN
assets/res/downCount/res/img/coin.png


+ 9 - 9
assets/res/downCount/res/img/coin.png.meta

@@ -1,6 +1,6 @@
 {
   "ver": "2.3.7",
-  "uuid": "deca073e-3717-41ce-b8f5-494c2ffb760d",
+  "uuid": "e4508cf3-0eab-431e-bb4a-37d3c18904cd",
   "importer": "texture",
   "type": "sprite",
   "wrapMode": "clamp",
@@ -14,20 +14,20 @@
   "subMetas": {
     "coin": {
       "ver": "1.0.6",
-      "uuid": "edf2f770-3d4f-46c0-8ec3-32a82fc114bc",
+      "uuid": "2899e4d8-66b4-4623-a579-24d67f5c4e95",
       "importer": "sprite-frame",
-      "rawTextureUuid": "deca073e-3717-41ce-b8f5-494c2ffb760d",
+      "rawTextureUuid": "e4508cf3-0eab-431e-bb4a-37d3c18904cd",
       "trimType": "auto",
       "trimThreshold": 1,
       "rotated": false,
       "offsetX": 0,
       "offsetY": 0,
-      "trimX": 1,
-      "trimY": 1,
-      "width": 124,
-      "height": 122,
-      "rawWidth": 126,
-      "rawHeight": 124,
+      "trimX": 0,
+      "trimY": 0,
+      "width": 60,
+      "height": 60,
+      "rawWidth": 60,
+      "rawHeight": 60,
       "borderTop": 0,
       "borderBottom": 0,
       "borderLeft": 0,

+ 6 - 12
assets/res/downCount/res/prefab/downCount.prefab

@@ -749,9 +749,7 @@
     ],
     "_srcBlendFactor": 1,
     "_dstBlendFactor": 771,
-    "_spriteFrame": {
-      "__uuid__": "edf2f770-3d4f-46c0-8ec3-32a82fc114bc"
-    },
+    "_spriteFrame": null,
     "_type": 0,
     "_sizeMode": 0,
     "_fillType": 0,
@@ -857,7 +855,7 @@
     "_srcBlendFactor": 1,
     "_dstBlendFactor": 771,
     "_spriteFrame": {
-      "__uuid__": "edf2f770-3d4f-46c0-8ec3-32a82fc114bc"
+      "__uuid__": "2899e4d8-66b4-4623-a579-24d67f5c4e95"
     },
     "_type": 0,
     "_sizeMode": 0,
@@ -1041,9 +1039,7 @@
     ],
     "_srcBlendFactor": 1,
     "_dstBlendFactor": 771,
-    "_spriteFrame": {
-      "__uuid__": "edf2f770-3d4f-46c0-8ec3-32a82fc114bc"
-    },
+    "_spriteFrame": null,
     "_type": 0,
     "_sizeMode": 0,
     "_fillType": 0,
@@ -1149,7 +1145,7 @@
     "_srcBlendFactor": 1,
     "_dstBlendFactor": 771,
     "_spriteFrame": {
-      "__uuid__": "edf2f770-3d4f-46c0-8ec3-32a82fc114bc"
+      "__uuid__": "2899e4d8-66b4-4623-a579-24d67f5c4e95"
     },
     "_type": 0,
     "_sizeMode": 0,
@@ -1333,9 +1329,7 @@
     ],
     "_srcBlendFactor": 1,
     "_dstBlendFactor": 771,
-    "_spriteFrame": {
-      "__uuid__": "edf2f770-3d4f-46c0-8ec3-32a82fc114bc"
-    },
+    "_spriteFrame": null,
     "_type": 0,
     "_sizeMode": 0,
     "_fillType": 0,
@@ -1441,7 +1435,7 @@
     "_srcBlendFactor": 1,
     "_dstBlendFactor": 771,
     "_spriteFrame": {
-      "__uuid__": "edf2f770-3d4f-46c0-8ec3-32a82fc114bc"
+      "__uuid__": "2899e4d8-66b4-4623-a579-24d67f5c4e95"
     },
     "_type": 0,
     "_sizeMode": 0,

BIN
assets/res/luojigouFinish/res/img/back.png


+ 38 - 0
assets/res/luojigouFinish/res/img/back.png.meta

@@ -0,0 +1,38 @@
+{
+  "ver": "2.3.7",
+  "uuid": "6b824671-815c-424a-ab14-f281a21ec02a",
+  "importer": "texture",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": true,
+  "genMipmaps": false,
+  "packable": true,
+  "width": 189,
+  "height": 108,
+  "platformSettings": {},
+  "subMetas": {
+    "back": {
+      "ver": "1.0.6",
+      "uuid": "0528662a-5b95-4746-ba10-a638617ce585",
+      "importer": "sprite-frame",
+      "rawTextureUuid": "6b824671-815c-424a-ab14-f281a21ec02a",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 0,
+      "trimY": 0,
+      "width": 189,
+      "height": 108,
+      "rawWidth": 189,
+      "rawHeight": 108,
+      "borderTop": 53,
+      "borderBottom": 53,
+      "borderLeft": 80,
+      "borderRight": 80,
+      "subMetas": {}
+    }
+  }
+}

BIN
assets/res/luojigouFinish/res/img/coin0.png


+ 11 - 11
assets/res/luojigouFinish/res/img/狗爪子.png.meta → assets/res/luojigouFinish/res/img/coin0.png.meta

@@ -1,22 +1,22 @@
 {
   "ver": "2.3.7",
-  "uuid": "ce0f6ef8-620b-47d9-888f-a88ea6d2eb12",
+  "uuid": "e5fec125-9bdf-4bf5-87ad-5a26b5c54b5f",
   "importer": "texture",
   "type": "sprite",
   "wrapMode": "clamp",
   "filterMode": "bilinear",
-  "premultiplyAlpha": false,
+  "premultiplyAlpha": true,
   "genMipmaps": false,
   "packable": true,
-  "width": 68,
-  "height": 72,
+  "width": 60,
+  "height": 60,
   "platformSettings": {},
   "subMetas": {
-    "狗爪子": {
+    "coin0": {
       "ver": "1.0.6",
-      "uuid": "f3cab3c9-62a4-4013-8c33-30f9d16e9a45",
+      "uuid": "a6eee542-92de-402d-87bf-17bcf0aa8856",
       "importer": "sprite-frame",
-      "rawTextureUuid": "ce0f6ef8-620b-47d9-888f-a88ea6d2eb12",
+      "rawTextureUuid": "e5fec125-9bdf-4bf5-87ad-5a26b5c54b5f",
       "trimType": "auto",
       "trimThreshold": 1,
       "rotated": false,
@@ -24,10 +24,10 @@
       "offsetY": 0,
       "trimX": 0,
       "trimY": 0,
-      "width": 68,
-      "height": 72,
-      "rawWidth": 68,
-      "rawHeight": 72,
+      "width": 60,
+      "height": 60,
+      "rawWidth": 60,
+      "rawHeight": 60,
       "borderTop": 0,
       "borderBottom": 0,
       "borderLeft": 0,

BIN
assets/res/luojigouFinish/res/img/coin1.png


+ 38 - 0
assets/res/luojigouFinish/res/img/coin1.png.meta

@@ -0,0 +1,38 @@
+{
+  "ver": "2.3.7",
+  "uuid": "603e582a-7261-4ee5-b39c-853af8bb0941",
+  "importer": "texture",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": true,
+  "genMipmaps": false,
+  "packable": true,
+  "width": 102,
+  "height": 102,
+  "platformSettings": {},
+  "subMetas": {
+    "coin1": {
+      "ver": "1.0.6",
+      "uuid": "23984f9b-e91d-4810-9635-8fc9d7902a64",
+      "importer": "sprite-frame",
+      "rawTextureUuid": "603e582a-7261-4ee5-b39c-853af8bb0941",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0.5,
+      "trimX": 1,
+      "trimY": 0,
+      "width": 100,
+      "height": 101,
+      "rawWidth": 102,
+      "rawHeight": 102,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

BIN
assets/res/luojigouFinish/res/img/狗爪子.png


File diff suppressed because it is too large
+ 1265 - 177
assets/res/luojigouFinish/res/prefab/luojigouFinish.prefab


+ 1 - 1
assets/res/luojigouFinish/res/spine/success_dialog.meta → assets/res/luojigouFinish/res/spine/success.meta

@@ -1,6 +1,6 @@
 {
   "ver": "1.1.3",
-  "uuid": "ada2484e-10a1-441a-bb6d-3342e51e7acc",
+  "uuid": "d1830cf9-5b43-4d06-8d41-940b630c7c1d",
   "importer": "folder",
   "isBundle": false,
   "bundleName": "",

+ 27 - 0
assets/res/luojigouFinish/res/spine/success/sanxing.atlas

@@ -0,0 +1,27 @@
+
+sanxing.png
+size: 472,220
+format: RGBA8888
+filter: Linear,Linear
+repeat: none
+a
+  rotate: false
+  xy: 430, 178
+  size: 40, 40
+  orig: 40, 40
+  offset: 0, 0
+  index: -1
+buliang
+  rotate: false
+  xy: 220, 8
+  size: 208, 210
+  orig: 216, 216
+  offset: 4, 4
+  index: -1
+liang2
+  rotate: false
+  xy: 2, 2
+  size: 216, 216
+  orig: 216, 216
+  offset: 0, 0
+  index: -1

+ 1 - 1
assets/res/luojigouFinish/res/spine/success_dialog/游戏结算画面原画1.atlas.meta → assets/res/luojigouFinish/res/spine/success/sanxing.atlas.meta

@@ -1,6 +1,6 @@
 {
   "ver": "1.0.3",
-  "uuid": "f728238d-98bf-4a0c-9076-429812c984ba",
+  "uuid": "18a20aba-1ea2-4e49-83a9-fb46bfccca28",
   "importer": "asset",
   "subMetas": {}
 }

File diff suppressed because it is too large
+ 0 - 0
assets/res/luojigouFinish/res/spine/success/sanxing.json


+ 2 - 2
assets/res/luojigouFinish/res/spine/success_dialog/游戏结算画面原画1.json.meta → assets/res/luojigouFinish/res/spine/success/sanxing.json.meta

@@ -1,9 +1,9 @@
 {
   "ver": "1.2.5",
-  "uuid": "8066bf5b-32e6-41e2-8446-0f2916cb191b",
+  "uuid": "c8cc8d31-7231-4c75-b5a2-c74cd2dc9b87",
   "importer": "spine",
   "textures": [
-    "8791f93c-3fba-4258-b1f4-2d36272f7cae"
+    "f02768fd-21c8-4345-8210-127faf4403a9"
   ],
   "scale": 1,
   "subMetas": {}

BIN
assets/res/luojigouFinish/res/spine/success/sanxing.png


+ 10 - 10
assets/res/luojigouFinish/res/spine/success_dialog/游戏结算画面原画1.png.meta → assets/res/luojigouFinish/res/spine/success/sanxing.png.meta

@@ -1,6 +1,6 @@
 {
   "ver": "2.3.7",
-  "uuid": "8791f93c-3fba-4258-b1f4-2d36272f7cae",
+  "uuid": "f02768fd-21c8-4345-8210-127faf4403a9",
   "importer": "texture",
   "type": "sprite",
   "wrapMode": "clamp",
@@ -8,15 +8,15 @@
   "premultiplyAlpha": false,
   "genMipmaps": false,
   "packable": true,
-  "width": 952,
-  "height": 776,
+  "width": 472,
+  "height": 220,
   "platformSettings": {},
   "subMetas": {
-    "游戏结算画面原画1": {
+    "sanxing": {
       "ver": "1.0.6",
-      "uuid": "52dbcb87-526c-4363-a4f7-810598b61bec",
+      "uuid": "a6f1f693-0049-4ce3-8eb6-21ab9e8c8761",
       "importer": "sprite-frame",
-      "rawTextureUuid": "8791f93c-3fba-4258-b1f4-2d36272f7cae",
+      "rawTextureUuid": "f02768fd-21c8-4345-8210-127faf4403a9",
       "trimType": "auto",
       "trimThreshold": 1,
       "rotated": false,
@@ -24,10 +24,10 @@
       "offsetY": 0,
       "trimX": 2,
       "trimY": 2,
-      "width": 948,
-      "height": 772,
-      "rawWidth": 952,
-      "rawHeight": 776,
+      "width": 468,
+      "height": 216,
+      "rawWidth": 472,
+      "rawHeight": 220,
       "borderTop": 0,
       "borderBottom": 0,
       "borderLeft": 0,

+ 0 - 251
assets/res/luojigouFinish/res/spine/success_dialog/游戏结算画面原画1.atlas

@@ -1,251 +0,0 @@
-
-游戏结算画面原画1.png
-size: 952,776
-format: RGBA8888
-filter: Linear,Linear
-repeat: none
-0k-AN
-  rotate: false
-  xy: 199, 23
-  size: 93, 57
-  orig: 93, 57
-  offset: 0, 0
-  index: -1
-Y-er
-  rotate: false
-  xy: 2, 6
-  size: 112, 74
-  orig: 112, 74
-  offset: 0, 0
-  index: -1
-Y-shoubi-kaixin
-  rotate: false
-  xy: 373, 22
-  size: 51, 58
-  orig: 51, 58
-  offset: 0, 0
-  index: -1
-Y-tui
-  rotate: false
-  xy: 902, 425
-  size: 23, 38
-  orig: 23, 38
-  offset: 0, 0
-  index: -1
-Y-yanjing2
-  rotate: false
-  xy: 902, 465
-  size: 45, 58
-  orig: 45, 58
-  offset: 0, 0
-  index: -1
-Y-yanjing3
-  rotate: false
-  xy: 407, 91
-  size: 7, 7
-  orig: 7, 7
-  offset: 0, 0
-  index: -1
-Z-yanjing3
-  rotate: false
-  xy: 407, 91
-  size: 7, 7
-  orig: 7, 7
-  offset: 0, 0
-  index: -1
-Y-yanjing4
-  rotate: false
-  xy: 373, 11
-  size: 25, 9
-  orig: 25, 9
-  offset: 0, 0
-  index: -1
-Y-yanjing4-1
-  rotate: true
-  xy: 762, 73
-  size: 40, 30
-  orig: 40, 30
-  offset: 0, 0
-  index: -1
-Z-yanjing4-1
-  rotate: true
-  xy: 762, 73
-  size: 40, 30
-  orig: 40, 30
-  offset: 0, 0
-  index: -1
-Z-er
-  rotate: false
-  xy: 797, 163
-  size: 94, 80
-  orig: 94, 80
-  offset: 0, 0
-  index: -1
-Z-shoubi-kaixin
-  rotate: true
-  xy: 762, 115
-  size: 76, 33
-  orig: 76, 33
-  offset: 0, 0
-  index: -1
-Z-tui
-  rotate: false
-  xy: 927, 425
-  size: 23, 38
-  orig: 23, 38
-  offset: 0, 0
-  index: -1
-Z-yanjing2
-  rotate: true
-  xy: 426, 3
-  size: 40, 53
-  orig: 40, 53
-  offset: 0, 0
-  index: -1
-Z-yanjing4
-  rotate: false
-  xy: 480, 89
-  size: 25, 9
-  orig: 25, 9
-  offset: 0, 0
-  index: -1
-anniu1
-  rotate: false
-  xy: 294, 9
-  size: 77, 71
-  orig: 77, 71
-  offset: 0, 0
-  index: -1
-anniu2
-  rotate: false
-  xy: 116, 2
-  size: 81, 78
-  orig: 81, 78
-  offset: 0, 0
-  index: -1
-beijing-
-  rotate: false
-  xy: 2, 221
-  size: 553, 553
-  orig: 569, 569
-  offset: 8, 8
-  index: -1
-bizui-kaixin
-  rotate: false
-  xy: 199, 7
-  size: 30, 14
-  orig: 30, 14
-  offset: 0, 0
-  index: -1
-bozi2
-  rotate: false
-  xy: 514, 4
-  size: 246, 187
-  orig: 246, 187
-  offset: 0, 0
-  index: -1
-chenggong-Z
-  rotate: true
-  xy: 902, 525
-  size: 249, 41
-  orig: 249, 41
-  offset: 0, 0
-  index: -1
-gutou
-  rotate: false
-  xy: 514, 201
-  size: 33, 18
-  orig: 33, 18
-  offset: 0, 0
-  index: -1
-piaodaishang-ZS
-  rotate: false
-  xy: 2, 82
-  size: 403, 137
-  orig: 403, 137
-  offset: 0, 0
-  index: -1
-piaodaixia-ZS
-  rotate: false
-  xy: 797, 245
-  size: 120, 178
-  orig: 120, 178
-  offset: 0, 0
-  index: -1
-weiba
-  rotate: false
-  xy: 797, 112
-  size: 64, 49
-  orig: 64, 49
-  offset: 0, 0
-  index: -1
-xingxing1-L
-  rotate: false
-  xy: 426, 45
-  size: 52, 53
-  orig: 52, 53
-  offset: 0, 0
-  index: -1
-xingxing1-M
-  rotate: true
-  xy: 794, 58
-  size: 52, 53
-  orig: 52, 53
-  offset: 0, 0
-  index: -1
-xingxing2-M
-  rotate: false
-  xy: 893, 187
-  size: 57, 56
-  orig: 57, 56
-  offset: 0, 0
-  index: -1
-xingxing3-L
-  rotate: true
-  xy: 762, 4
-  size: 52, 53
-  orig: 52, 53
-  offset: 0, 0
-  index: -1
-xingxing3-M
-  rotate: false
-  xy: 817, 3
-  size: 52, 53
-  orig: 52, 53
-  offset: 0, 0
-  index: -1
-xinhxing2-L
-  rotate: false
-  xy: 893, 129
-  size: 57, 56
-  orig: 57, 56
-  offset: 0, 0
-  index: -1
-yingzi-
-  rotate: true
-  xy: 557, 193
-  size: 230, 238
-  orig: 230, 238
-  offset: 0, 0
-  index: -1
-youxiban
-  rotate: false
-  xy: 407, 100
-  size: 105, 119
-  orig: 105, 119
-  offset: 0, 0
-  index: -1
-yuanxinghuizhang-BG
-  rotate: false
-  xy: 557, 425
-  size: 343, 349
-  orig: 343, 350
-  offset: 0, 1
-  index: -1
-zhangzui-kaixin
-  rotate: false
-  xy: 919, 399
-  size: 23, 24
-  orig: 23, 24
-  offset: 0, 0
-  index: -1

File diff suppressed because it is too large
+ 0 - 0
assets/res/luojigouFinish/res/spine/success_dialog/游戏结算画面原画1.json


BIN
assets/res/luojigouFinish/res/spine/success_dialog/游戏结算画面原画1.png


+ 183 - 28
assets/res/luojigouFinish/src/LuojigouFinish.ts

@@ -4,17 +4,6 @@ import NotifierCenter from "../../../src/webtcp/NotifierCenter";
 import common from "../../../src/common/common";
 import AudioManager from "../../../src/audioUitls/AudioManager";
 
-const EStarSkineMap = new Map([
-    [1, '1-Star'],
-    [2, '2-star'],
-    [3, '3-star']
-])
-
-enum ESuccessAni {
-    'success1' = 'success1',
-    'success2' = 'success2'
-}
-
 export interface PropsFinish {
     star: number, // 获得的星星数目
     audios?: cc.AudioClip[], // 音频路径
@@ -24,30 +13,196 @@ const { ccclass, property } = cc._decorator;
 @ccclass
 export default class LuojigouFinish extends cc.Component {
 
-    @property({ tooltip: '弹窗中的spine', type: sp.Skeleton })
-    SuccessSpine: sp.Skeleton = null;
+    @property({ tooltip: '节点', type: cc.Node })
+    nodeSuc: cc.Node = null;
+
+    @property({ tooltip: '节点', type: cc.Node })
+    nodeCoin: cc.Node = null;
+
+    @property({ tooltip: '节点', type: cc.Node })
+    nodeLimit: cc.Node = null;
+
+    dataQues = {
+        nodeSuc: {
+            spine: {
+                scale: 0,
+            },
+            score: {
+                opacity: 0,
+            },
+            coin: {
+                scale: 0,
+            },
+        },
+        nodeCoin: {
+            sign: {
+                scale: 0,
+            },
+            coin: {
+                position: cc.v3(0, 0, 0),
+                childScale: 0,
+            },
+        },
+        spineData: { idle: 'j', play_1: 'one', idle_1: 'one-j', play_2: 'two', idle_2: 'two-j', play_3: 'three', idle_3: 'three-j', },
+    };
+
+    protected start(): void {
+        this.initData();
+    }
+
+    initData() {
+        this.dataQues.nodeSuc.spine.scale = this.nodeSuc.getChildByName('spine').scale;
+        this.dataQues.nodeSuc.score.opacity = this.nodeSuc.getChildByName('score').opacity;
+        this.dataQues.nodeSuc.coin.scale = this.nodeSuc.getChildByName('coin').scale;
+        this.dataQues.nodeCoin.coin.position = this.nodeCoin.getChildByName('coin').position;
+        this.dataQues.nodeCoin.coin.childScale = this.nodeCoin.getChildByName('coin').getChildByName('icon0').scale;
+        this.dataQues.nodeCoin.sign.scale = this.nodeCoin.getChildByName('sign').scale;
+    };
+
+    updateUI() {
+        this.node.active = true;
+        this.nodeSuc.active = true;
+        this.nodeSuc.getChildByName('spine').active = true;
+        this.nodeSuc.getChildByName('spine').scale = this.dataQues.nodeSuc.spine.scale;
+        this.nodeSuc.getChildByName('score').active = false;
+        this.nodeSuc.getChildByName('score').opacity = this.dataQues.nodeSuc.score.opacity;
+        
+        this.nodeCoin.active = true;
+        this.nodeCoin.getChildByName('coin').active = false;
+        this.nodeCoin.getChildByName('coin').position = this.dataQues.nodeCoin.coin.position;
+        this.nodeCoin.getChildByName('sign').scale = this.dataQues.nodeCoin.sign.scale;
+        let arrCoinCoin = Tools.getArrByNode(this.nodeCoin.getChildByName('coin'), 'icon');
+        arrCoinCoin.forEach((item) => {
+            item.scale = this.dataQues.nodeSuc.coin.scale; 
+            item.position = cc.v3(0, 0, 0);
+        });
+    }
+
+    initGameFinish() {
+        this.node.active = true;
+        this.nodeSuc.active = false;
+        this.nodeLimit.active = false;
+        this.nodeCoin.active = true;
+        let itemScore = this.nodeCoin.getChildByName('score');
+        itemScore.getComponent(cc.Label).string = String(common.coinBase.data.userWisdomCoin);
+    }
 
     /**
      * @description 设置成功弹窗的动画
      * @description 星星数
      */
     setAnimation(props: PropsFinish): void {
-        common.httpReportdata();
-        common.setGameToLocal();
-        this.node.active = true;
-        const spine = this.SuccessSpine;
-        spine.setSkin(EStarSkineMap.get(props.star));
-        spine.timeScale = 0.8;
-        spine.setAnimation(0, ESuccessAni.success1, false);
-        spine.addAnimation(0, ESuccessAni.success2, true);
-        AudioManager.getInstance().playEffect('audio/star_' + props.star);
+        let coinData = common.coinBase.data;
+        let coinCur = coinData.userWisdomCoin;
+        let coinElse = coinData.remainderWisdomCoin;
+        let coinAdd = coinElse > props.star ? props.star : coinElse;
+        coinData.userWisdomCoin += coinAdd;
+        coinData.remainderWisdomCoin -= coinAdd;
+        common.httpReportCoin(coinAdd);// 数据上报-智慧币
+        common.httpReportdata();// 数据上报
+        common.setGameToLocal();// 修改本地数据
+
+        this.updateUI();
+        let sucSpine = this.nodeSuc.getChildByName('spine');
+        let sucCoin = this.nodeSuc.getChildByName('coin');
+        let coinCoin = this.nodeCoin.getChildByName('coin');
+        let coinSign = this.nodeCoin.getChildByName('sign');
+        let arrCoinCoin = Tools.getArrByNode(coinCoin, 'icon');
+        arrCoinCoin.forEach((item, index)=>{
+            item.active = index < props.star;
+        });
 
-        if (props.audios && props.audios.length > 0) {
-            Tools.playEffectArr(props.audios, this.closeLJGCard.bind(this));
-        }
-        else {
-            this.scheduleOnce(this.closeLJGCard.bind(this), 4);
-        }
+        let timeScale = 1.2;
+        let sucSke = sucSpine.getComponent(sp.Skeleton);
+        Tools.playAnimation(sucSke, this.dataQues.spineData['play_' + props.star], false, ()=>{
+            Tools.playAnimation(sucSke, this.dataQues.spineData['idle_' + props.star], true, null, timeScale);
+            // 分数变化
+            let funScore = () => {
+                if (coinAdd <= 0) {
+                    if (!this.nodeLimit.active) {
+                        this.nodeLimit.active = true;
+                        this.nodeLimit.opacity = 0;
+                        cc.Tween.stopAllByTarget(this.nodeLimit);
+                        cc.tween(this.nodeLimit).to(0.25, { opacity: 255 }).delay(1.0).to(0.25, { opacity: 0 }).call(() => {
+                            this.nodeLimit.active = false;
+                        }).start();
+                    }
+                }
+                else {
+                    coinCur++;
+                    coinAdd--;
+                    let itemScore = this.nodeCoin.getChildByName('score');
+                    itemScore.getComponent(cc.Label).string = String(coinCur);
+                    AudioManager.getInstance().playEffect('audio/good_touch');
+                }
+            };
+            // 金币移动
+            let funcMove = (star) => {
+                let curId = star - 1;
+                if (curId >= 0) {
+                    let item = arrCoinCoin[curId];
+                    let posGoal = Tools.getLocalPos(this.nodeCoin.getChildByName('sign'), item.parent);
+                    let opt = {
+                        p1: cc.v2(item.x, item.y),
+                        p2: cc.v2(posGoal.x, posGoal.y - 40),
+                        pTo: cc.v2(posGoal.x, item.y),
+                    };
+                    let time = Tools.getMoveTime(opt.p1, opt.p2, 1, 1250);
+                    cc.Tween.stopAllByTarget(item);
+                    let tw = cc.tween;
+                    tw(item)
+                        .parallel(
+                            tw().to(time, { scale: this.dataQues.nodeCoin.coin.childScale }),
+                            tw().bezierTo(time, opt.p1, opt.pTo, opt.p2).call(()=>{
+                                funScore();
+                                cc.Tween.stopAllByTarget(coinSign);
+                                coinSign.scale = 1.0;
+                                cc.tween(coinSign).to(0.15, {scale: 1.2}).to(0.075, {scale: 1.0}).start();
+                            }),
+                            tw().delay(time * 0.2).call(funcMove.bind(this, curId)),
+                        )
+                        .call(()=>{
+                            item.active = false;
+                        })
+                        .start();
+                }
+                else {
+                    if (props.audios && props.audios.length > 0) {
+                        Tools.playEffectArr(props.audios, this.closeLJGCard.bind(this));
+                    }
+                    else {
+                        this.scheduleOnce(this.closeLJGCard.bind(this), 4);
+                    }
+                }
+            };
+
+            cc.Tween.stopAllByTarget(sucSpine);
+            cc.tween(sucSpine).to(0.2, { scale: 0 }).call(() => {
+                sucSpine.active = false;
+                // 出现加分
+                let score = this.nodeSuc.getChildByName('score');
+                score.getChildByName('label').getComponent(cc.Label).string = '+' + props.star;
+                score.active = true;
+                score.opacity = 0;
+                cc.Tween.stopAllByTarget(score);
+                cc.tween(score).to(0.3, { opacity: 255 }).delay(0.6).to(0.3, { opacity: 255 }).call(() => {
+                    score.active = false;
+                }).start();
+                // 出现金币
+                coinCoin.active = true;
+                coinCoin.opacity = 0;
+                coinCoin.scale = 0;
+                coinCoin.position = Tools.getLocalPos(sucCoin, coinCoin.parent);
+                cc.Tween.stopAllByTarget(coinCoin);
+                cc.tween(coinCoin).delay(0.2).parallel(
+                    cc.tween().to(0.15, { scale: 1.3 }).to(0.075, { scale: 1.0 }),
+                    cc.tween().to(0.3, { opacity: 255 }),
+                ).delay(0.7).call(() => {
+                    funcMove(props.star);
+                }).start();
+            }).start();
+        }, timeScale);
+        AudioManager.getInstance().playEffect('audio/star_' + props.star);
     }
 
     /**

+ 3 - 0
assets/src/common/Tools.ts

@@ -430,6 +430,9 @@ class Tools {
             if (json.id) {
                 common.setCourseId(json.id);
             }
+            if (json.p) {
+                common.setCoinBase(json.p);
+            }
             console.log('网络地址信息:', JSON.stringify(json, null, 4));
         }
         return json;

+ 66 - 6
assets/src/common/common.ts

@@ -25,6 +25,7 @@ export class UitlData {
     modelId?: number;
     itemId?: string;
     id?: string;
+    p?: string;
 }
 
 class common {
@@ -38,15 +39,27 @@ class common {
         return this._instance;
     };
 
-    isDebug: boolean = false;
+    isDebug: boolean = true;
     project: string = "luojigou_yinliu";
     itemId: string = '';// 单级id
     courseId: string = ''; // 课程id
     huodongId: string = '';
     unitCur: number = 1;// 第几集,从1开始
-    pageCur: number = 1;// 第几个游戏,从1开始
+    pageCur: number = 2;// 第几个游戏,从1开始
     isCanPlayVideo = false;
-    attributeMap: any = {};// 内部形式为 { "0" : AttributeUtil } 
+    attributeMap: any = {};// 内部形式为 { "0" : AttributeUtil }
+    hostUrl: string = "https://open.api.luojigou.vip";
+    coinBase = {
+        submitUrl: "",
+        data: {
+            userWisdomCoin: 0,// 现有智慧币
+            remainderWisdomCoin: 0,// 剩余可获得智慧币
+        },
+        attach: {
+            id: "",
+            userId: "",
+        }
+    };// 智慧币需求参数
     urlToken: string = 'https://open.api.luojigou.vip/mall/mobile/common/verify/token';// 验证token的地址;
     urlOver: string = 'https://open.api.luojigou.vip/app/app/gameCourse/record';// 当前集游戏完结,上报地址;
     urlClass: string = 'https://luojigou.vip/ac/#/courseDetail';// 课程页
@@ -60,7 +73,7 @@ class common {
     setTimeStart() {
         this.timeStart = new Date().getTime();
     };
-    
+
     getItemId() {
         return this.itemId;
     };
@@ -80,6 +93,18 @@ class common {
         this.courseId = id;
     };
 
+    getCoinBase() {
+        return this.coinBase;
+    };
+
+    setCoinBase(base64) {
+        let str = decodeURIComponent(atob(base64));
+        let json = JSON.parse(str);
+        this.coinBase = Tools.clone(json);
+        this.coinBase.data.remainderWisdomCoin = 4;
+        console.log('coinBase: ', JSON.stringify(this.coinBase, null, 4));
+    };
+
     getUnitNum() {
         return this.unitCur > 0 ? this.unitCur : 1;
     };
@@ -172,7 +197,7 @@ class common {
         let length = attribute.config.length;
         let isFinish = page < length ? 0 : 1;
         let timeStart = this.getTimeStart();
-        let playTime = Math.ceil((new Date().getTime() - timeStart)*0.001);
+        let playTime = Math.ceil((new Date().getTime() - timeStart) * 0.001);
         // 组合地址
         let url = this.urlOver;
         url += '/' + this.getItemId();
@@ -195,8 +220,43 @@ class common {
         });
     }
 
+    /** 数据上报-智慧币 */
+    httpReportCoin(coinAdd: number): Promise<boolean> {
+        let timeStart = this.getTimeStart();
+        let playTime = Math.ceil((new Date().getTime() - timeStart) * 0.001);
+        let json = {
+            "data": {
+                "gameDuration": playTime,
+                "winWisdomCoin": coinAdd
+            },
+            "attach": {
+                "id": "",
+                "userId": ""
+            }
+        };
+        json.attach = Tools.clone(this.coinBase.attach);
+        console.log('数据上报-智慧币:', json);
+        return new Promise((resolve) => {
+            let headerJson = { 'Content-Type': 'application/json; charset=utf-8' };
+            let xhr = new XMLHttpRequest();
+            xhr.onreadystatechange = function () {
+                if (xhr.readyState === 4 && (xhr.status >= 200 && xhr.status < 300)) {
+                    resolve(true);
+                }
+            };
+            xhr.onerror = function () {
+                resolve(false);
+            }
+            xhr.open("POST", this.hostUrl + this.coinBase.submitUrl, true);
+            for (let key in headerJson) {
+                xhr.setRequestHeader(key, headerJson[key]);
+            }
+            xhr.send(JSON.stringify(json));
+        });
+    }
+
     /** 更换浏览器地址 */
-    httpReplaceUrl(url: string){
+    httpReplaceUrl(url: string) {
         window.location.href = url + '?id=' + this.getCourseId() + '&mode=luojigou';
         // window.location.replace(url);
     }

Some files were not shown because too many files changed in this diff