xx 1 жил өмнө
parent
commit
5d28ce06c8

+ 25 - 23
assets/resources/prefabs/game_play_han_zi_zhao_bu_tong.prefab

@@ -3498,6 +3498,31 @@
     "btn_pause": {
       "__id__": 90
     },
+    "btn_look_video": {
+      "__id__": 25
+    },
+    "btn_tip": {
+      "__id__": 98
+    },
+    "progressbar": {
+      "__id__": 117
+    },
+    "lab_title": {
+      "__id__": 40
+    },
+    "lab_coin": {
+      "__id__": 12
+    },
+    "img_touch_err": null,
+    "action_node": null,
+    "sf_btn_start": {
+      "__uuid__": "f6f8bd72-42c0-4255-ba86-18e3768cfbcc@f9941",
+      "__expectedType__": "cc.SpriteFrame"
+    },
+    "sf_btn_pause": {
+      "__uuid__": "8c547ad0-497e-4b65-b588-3efb2dfdeed8@f9941",
+      "__expectedType__": "cc.SpriteFrame"
+    },
     "font_grid": {
       "__id__": 68
     },
@@ -3511,35 +3536,12 @@
       "__uuid__": "b426aee1-f11c-4484-a0a7-bc11b6e1b0a5",
       "__expectedType__": "cc.Prefab"
     },
-    "lab_title": {
-      "__id__": 40
-    },
-    "btn_tip": {
-      "__id__": 98
-    },
-    "lab_coin": {
-      "__id__": 12
-    },
-    "progressbar": {
-      "__id__": 117
-    },
     "bottom_item": {
       "__id__": 132
     },
     "left_item": {
       "__id__": 138
     },
-    "sf_btn_start": {
-      "__uuid__": "f6f8bd72-42c0-4255-ba86-18e3768cfbcc@f9941",
-      "__expectedType__": "cc.SpriteFrame"
-    },
-    "sf_btn_pause": {
-      "__uuid__": "8c547ad0-497e-4b65-b588-3efb2dfdeed8@f9941",
-      "__expectedType__": "cc.SpriteFrame"
-    },
-    "btn_look_video": {
-      "__id__": 25
-    },
     "_id": ""
   },
   {

+ 19 - 19
assets/resources/prefabs/game_play_mei_nv_zhao_xi_jie.prefab

@@ -3635,15 +3635,14 @@
     "btn_pause": {
       "__id__": 98
     },
-    "img": {
-      "__id__": 52
+    "btn_look_video": {
+      "__id__": 25
     },
-    "content": {
-      "__id__": 60
+    "btn_tip": {
+      "__id__": 106
     },
-    "component_item_prefab": {
-      "__uuid__": "23a0a7ba-49d4-4525-8e9d-2d400020677d",
-      "__expectedType__": "cc.Prefab"
+    "progressbar": {
+      "__id__": 125
     },
     "lab_title": {
       "__id__": 40
@@ -3651,15 +3650,12 @@
     "lab_coin": {
       "__id__": 12
     },
-    "btn_tip": {
-      "__id__": 106
-    },
-    "progressbar": {
-      "__id__": 125
-    },
     "img_touch_err": {
       "__id__": 140
     },
+    "action_node": {
+      "__id__": 146
+    },
     "sf_btn_start": {
       "__uuid__": "f6f8bd72-42c0-4255-ba86-18e3768cfbcc@f9941",
       "__expectedType__": "cc.SpriteFrame"
@@ -3668,14 +3664,18 @@
       "__uuid__": "8c547ad0-497e-4b65-b588-3efb2dfdeed8@f9941",
       "__expectedType__": "cc.SpriteFrame"
     },
-    "scroll_view": {
-      "__id__": 81
+    "img": {
+      "__id__": 52
     },
-    "action_node": {
-      "__id__": 146
+    "content": {
+      "__id__": 60
     },
-    "btn_look_video": {
-      "__id__": 25
+    "component_item_prefab": {
+      "__uuid__": "23a0a7ba-49d4-4525-8e9d-2d400020677d",
+      "__expectedType__": "cc.Prefab"
+    },
+    "scroll_view": {
+      "__id__": 81
     },
     "_id": ""
   },

+ 310 - 35
assets/resources/prefabs/game_play_shuang_tu_zhao_bu_tong.prefab

@@ -26,28 +26,34 @@
       },
       {
         "__id__": 184
+      },
+      {
+        "__id__": 190
+      },
+      {
+        "__id__": 196
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 190
+        "__id__": 202
       },
       {
-        "__id__": 192
+        "__id__": 204
       },
       {
-        "__id__": 194
+        "__id__": 206
       },
       {
-        "__id__": 196
+        "__id__": 208
       },
       {
-        "__id__": 198
+        "__id__": 210
       }
     ],
     "_prefab": {
-      "__id__": 200
+      "__id__": 212
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -4360,17 +4366,280 @@
     "targetOverrides": null,
     "nestedPrefabInstanceRoots": null
   },
+  {
+    "__type__": "cc.Node",
+    "_name": "action_node",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 191
+      },
+      {
+        "__id__": 193
+      }
+    ],
+    "_prefab": {
+      "__id__": 195
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": -187.5,
+      "y": -406,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_mobility": 0,
+    "_layer": 33554432,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": ""
+  },
   {
     "__type__": "cc.UITransform",
     "_name": "",
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
+      "__id__": 190
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 192
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 375,
+      "height": 812
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "99RekEad5L+oCV34/GIT/U"
+  },
+  {
+    "__type__": "cc.Widget",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 190
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 194
+    },
+    "_alignFlags": 45,
+    "_target": null,
+    "_left": 0,
+    "_right": 0,
+    "_top": 0,
+    "_bottom": 0,
+    "_horizontalCenter": 0,
+    "_verticalCenter": 0,
+    "_isAbsLeft": true,
+    "_isAbsRight": true,
+    "_isAbsTop": true,
+    "_isAbsBottom": true,
+    "_isAbsHorizontalCenter": true,
+    "_isAbsVerticalCenter": true,
+    "_originalWidth": 100,
+    "_originalHeight": 100,
+    "_alignMode": 2,
+    "_lockFlags": 0,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "715NnoWLVLi7d2xpjvKQ3A"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
       "__id__": 1
     },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "e70JiEg4VJP4zG9DbW665k",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "img_star_yellow",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 197
+      },
+      {
+        "__id__": 199
+      }
+    ],
+    "_prefab": {
+      "__id__": 201
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": -358.443,
+      "y": 0,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_mobility": 0,
+    "_layer": 33554432,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 196
+    },
     "_enabled": true,
     "__prefab": {
-      "__id__": 191
+      "__id__": 198
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 28,
+      "height": 26
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "b34mul0B9GwZGMgxevSMwp"
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 196
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 200
+    },
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_spriteFrame": {
+      "__uuid__": "d4f8fc75-3e05-4f35-ba00-f91752872731@f9941",
+      "__expectedType__": "cc.SpriteFrame"
+    },
+    "_type": 0,
+    "_fillType": 0,
+    "_sizeMode": 1,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_useGrayscale": false,
+    "_atlas": null,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "7dWSZ0TH5Hs7S0MYkqgSNp"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "e9j62PUi9JZrJPEpNXyfTi",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 203
     },
     "_contentSize": {
       "__type__": "cc.Size",
@@ -4398,7 +4667,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 193
+      "__id__": 205
     },
     "_alignFlags": 45,
     "_target": null,
@@ -4434,7 +4703,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 195
+      "__id__": 207
     },
     "_customMaterial": null,
     "_srcBlendFactor": 2,
@@ -4479,7 +4748,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 197
+      "__id__": 209
     },
     "btn_back": {
       "__id__": 3
@@ -4487,12 +4756,38 @@
     "btn_pause": {
       "__id__": 128
     },
-    "btn_amplify": {
-      "__id__": 158
+    "btn_look_video": {
+      "__id__": 25
     },
     "btn_tip": {
       "__id__": 136
     },
+    "progressbar": {
+      "__id__": 155
+    },
+    "lab_title": {
+      "__id__": 40
+    },
+    "lab_coin": {
+      "__id__": 12
+    },
+    "img_touch_err": {
+      "__id__": 184
+    },
+    "action_node": {
+      "__id__": 190
+    },
+    "sf_btn_start": {
+      "__uuid__": "f6f8bd72-42c0-4255-ba86-18e3768cfbcc@f9941",
+      "__expectedType__": "cc.SpriteFrame"
+    },
+    "sf_btn_pause": {
+      "__uuid__": "8c547ad0-497e-4b65-b588-3efb2dfdeed8@f9941",
+      "__expectedType__": "cc.SpriteFrame"
+    },
+    "btn_amplify": {
+      "__id__": 158
+    },
     "img_1": {
       "__id__": 62
     },
@@ -4508,31 +4803,11 @@
     "lab_amplify_status": {
       "__id__": 159
     },
-    "lab_coin": {
-      "__id__": 12
-    },
-    "lab_title": {
-      "__id__": 40
-    },
     "star_list": {
       "__id__": 46
     },
-    "img_touch_err": {
-      "__id__": 184
-    },
-    "progressbar": {
-      "__id__": 155
-    },
-    "sf_btn_start": {
-      "__uuid__": "f6f8bd72-42c0-4255-ba86-18e3768cfbcc@f9941",
-      "__expectedType__": "cc.SpriteFrame"
-    },
-    "sf_btn_pause": {
-      "__uuid__": "8c547ad0-497e-4b65-b588-3efb2dfdeed8@f9941",
-      "__expectedType__": "cc.SpriteFrame"
-    },
-    "btn_look_video": {
-      "__id__": 25
+    "effect": {
+      "__id__": 196
     },
     "_id": ""
   },
@@ -4550,7 +4825,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 199
+      "__id__": 211
     },
     "_id": ""
   },

+ 3 - 5
assets/script/dialog/fail.ts

@@ -17,18 +17,16 @@ export class fail extends Component {
         },this);
         this.btn_extend.on(Node.EventType.TOUCH_START,()=>{
             if(this.m_extend_call!=null){
-                this.m_extend_call()
+                this.m_extend_call(this)
             }
-            self.close();
         },this);
         this.btn_restart.on(Node.EventType.TOUCH_START,()=>{
             if(this.m_restart_call!=null){
-                this.m_restart_call()
+                this.m_restart_call(this)
             }
-            self.close();
         },this);
     }
-    close(){
+    public close(){
         this.node.removeFromParent();
     }
 

+ 8 - 18
assets/script/dialog/win.ts

@@ -19,35 +19,25 @@ export class win extends Component {
         },this);
         this.btn_ordinary.on(Node.EventType.TOUCH_START,()=>{
             if(this.m_ordinary_call!=null){
-                this.m_ordinary_call()
+                this.m_ordinary_call(this)
             }
-            self.close();
         },this);
         this.btn_double.on(Node.EventType.TOUCH_START,()=>{
             if(this.m_double_call!=null){
-                this.m_double_call()
+                this.m_double_call(this)
             }
-            self.close();
         },this);   
     }
-    close(){
+    public close(){
         this.node.removeFromParent();
     }
 
-    //双图找不同
-    public showZhaoBuTongView(reward:number,data:server_shuang_tu_zhao_bu_tong_data_item,ordinary_call,double_call){
-        this.m_double_call = double_call;
-        this.m_ordinary_call = ordinary_call;
-        this.lab_reward_number.getComponent(Label).string = "+ " +reward+"";
+    public showDoubleCoin(doubel_reward){
+        let reward = parseInt(this.lab_reward_number.getComponent(Label).string)
+        gameManager.instance.addCoinNumber(doubel_reward,this.lab_reward_number.getComponent(Label),reward,()=>{})
     }
-    //汉字找不同
-    public showHanZiView(reward:number,data:server_han_zi_zhao_bu_tong_data_item,ordinary_call,double_call){
-        this.m_double_call = double_call;
-        this.m_ordinary_call = ordinary_call;
-        this.lab_reward_number.getComponent(Label).string = "+ " +reward+"";
-    }
-    //美女找不同
-    public showMeiNvView(reward:number,data:server_mei_nv_zhao_xi_jie_data_item,ordinary_call,double_call){
+
+    public showView(reward:number,data:server_mei_nv_zhao_xi_jie_data_item,ordinary_call,double_call){
         this.m_double_call = double_call;
         this.m_ordinary_call = ordinary_call;
         this.lab_reward_number.getComponent(Label).string = "+ " +reward+"";

+ 211 - 0
assets/script/play_list/base_view.ts

@@ -0,0 +1,211 @@
+import { _decorator, Component, Label, Node, ProgressBar, Sprite, SpriteFrame } from 'cc';
+import { gameManager } from '../gameManager';
+import { ClientEvent } from '../framework/clientEvent';
+import { config } from '../config';
+import { SdkUtil } from '../framework/sdkUtil';
+import { fail } from '../dialog/fail';
+import { http } from '../http/http';
+import { Util } from '../framework/util';
+import { win } from '../dialog/win';
+import { tools } from '../tools';
+import { setting } from '../homepage/setting';
+const { ccclass, property } = _decorator;
+
+@ccclass('base_view')
+export class base_view extends Component {
+    @property(Node) btn_back:Node = null;
+    @property(Node) btn_pause:Node = null;
+    @property(Node) btn_look_video:Node = null;
+    @property(Node) btn_tip:Node = null;
+    @property(ProgressBar) progressbar:ProgressBar = null;
+    @property(Node) lab_title:Node = null;
+    @property(Node) lab_coin:Node = null;
+    @property(Node) img_touch_err:Node = null;
+    @property(Node) action_node:Node = null;
+    @property(SpriteFrame) sf_btn_start:SpriteFrame = null;
+    @property(SpriteFrame) sf_btn_pause:SpriteFrame = null;
+    protected time_count:number = 0;
+    protected time_all_count:number = 0;
+    protected err_node_1:Node = null;
+    protected isPause:boolean = false;
+    protected reward:number = 0;
+    protected isShowWin:boolean = false;
+    protected categoryid:number = -1;
+    protected m_data:any;
+
+
+    protected start(): void {
+        let self = this;
+        self.initUI()
+        this.btn_back.on(Node.EventType.TOUCH_START,()=>{
+            gameManager.playBtnSound()
+            self.close();
+        },this);
+        this.btn_look_video.on(Node.EventType.TOUCH_START,()=>{
+            SdkUtil.showVideoAd(config.rewardVideoAdUnitId.Earn_coins_AdUnitId,(res)=>{
+                if(res.isEnded){
+                    gameManager.add_coin(gameManager.get_deouble_reward_number())
+                    ClientEvent.dispatchEvent(config.EVENT_MSG.ON_CHANGE_COIN_NUMBER)
+                }
+            })
+        })
+        this.btn_tip.on(Node.EventType.TOUCH_START,()=>{
+            gameManager.playBtnSound()
+            this.onTipBtnClick();
+        },this);
+
+        this.btn_pause.on(Node.EventType.TOUCH_START,()=>{
+            self.isPause  = true;
+            self.btn_pause.getComponent(Sprite).spriteFrame = self.sf_btn_start;
+            gameManager.playBtnSound()
+            gameManager.addTopView(config.PREFAB_PATH.setting,(node:Node)=>{
+                node.getComponent(setting).show(()=>{
+                    self.btn_pause.getComponent(Sprite).spriteFrame = self.sf_btn_pause;
+                    self.isPause = false;
+                })
+            })
+        },this);
+        ClientEvent.on(config.EVENT_MSG.ON_CHANGE_COIN_NUMBER,this.onChangeCoinNumber.bind(this),this);
+    }
+    protected onDestroy(): void {
+        ClientEvent.off(config.EVENT_MSG.ON_CHANGE_COIN_NUMBER,this.onChangeCoinNumber.bind(this),this);
+    }
+    close(){
+        ClientEvent.dispatchEvent(config.EVENT_MSG.ON_BACK_HOME_VIEW);
+        this.node.removeFromParent();
+    }
+
+    onChangeCoinNumber(){
+        let num:number = parseInt(this.lab_coin.getComponent(Label).string);
+        gameManager.instance.addCoinNumber(this.reward,this.lab_coin.getComponent(Label),num,()=>{
+            this.lab_coin.getComponent(Label).string = gameManager.get_user_coin()+"";
+        })
+    }
+    /**
+        下一关 start
+     */
+    nextLevel(){
+        let is_have_next = gameManager.next_level(this.categoryid,(is_sync:boolean)=>{
+            if(is_sync){
+                let levels_item = gameManager.get_cur_level_by_categoryid(this.categoryid);
+                gameManager.showLoading();
+                gameManager.add_coin(this.reward);
+                ClientEvent.dispatchEvent(config.EVENT_MSG.ON_CHANGE_COIN_NUMBER);
+                http.get(config.static_url.levels_info(this.categoryid,levels_item.level),(err,data)=>{
+                    if(!err){
+                        let _data = JSON.parse(data)
+                        if(_data.code===config.MSG_CODE.SUCCESS){
+                            this.initView(_data.content,true);
+                        }
+                    }
+                })
+            }else{
+                gameManager.hideLoading()
+                tools.showDialogOne("请检查您的网络状态,重新连接",()=>{
+                    this.nextLevel()
+                })
+            }
+        })
+
+        if(!is_have_next){
+            tools.showToast("当前已是最后一关,敬请期待最新版本");
+        }
+    }
+
+
+    /**
+        下一关 end
+     */
+
+
+    /**
+        计时api start 
+     */
+    stop_time_count(){
+        this.unscheduleAllCallbacks()
+    }
+    start_time_count(time:number){
+        this.time_all_count = time;
+        let self = this;
+        this.time_count = 0;
+        self.progressbar.progress = 1;
+        this.schedule(()=>{
+            if(self.isPause){
+                return;
+            }
+            if(self.time_count<=self.time_all_count){
+                self.time_count+=1;
+                self.progressbar.progress = (self.time_all_count-self.time_count)/self.time_all_count;
+            }else{
+                self.showFail()
+                self.stop_time_count();
+            }
+            
+        },1)
+    }
+    error_sub_time(){
+        let self = this;
+        if( (self.time_count + self.m_data.wrong_time) >= self.time_all_count){
+            self.time_all_count = 0;
+        }else{
+            self.time_count += self.m_data.wrong_time;
+        }
+        self.progressbar.progress = (self.time_all_count-self.time_count)/self.time_all_count;
+    }
+    /**
+        计时api end 
+     */
+    showFail(){
+        gameManager.addUiView(config.PREFAB_PATH.fail,(node:Node)=>{
+            gameManager.playFailSoundByCategoryId(this.categoryid)
+            node.getComponent(fail).showView(this.m_data.extend_time,this.onFailExtendTimeClick.bind(this),this.onFailReStartClick.bind(this),this.m_data.ads_restart)
+        })
+    }
+    showWin(){
+        gameManager.addTopView(config.PREFAB_PATH.win,(node:Node)=>{
+            this.isShowWin = true;
+            gameManager.playWinSoundByCategoryId(this.categoryid)
+            node.getComponent(win).showView(this.reward,this.m_data,this.onWinOrdinaryClick.bind(this),this.onWinDoubleClick.bind(this));
+        });
+    }
+    onWinOrdinaryClick(win_view:win){
+        gameManager.playBtnSound()
+        this.nextLevel();
+        win_view.close()
+    }
+
+    onWinDoubleClick(win_view:win){
+        gameManager.playBtnSound()
+        let self = this;
+        let list = this.m_data.ads_fold.split(",");
+        let start = parseInt(list[0]);
+        let end = parseInt(list[1]);
+        this.reward *=  Util.getRandomInt(start,end);
+        SdkUtil.showVideoAd(config.rewardVideoAdUnitId.Super_double_AdUnitId,(res)=>{
+            if(res.isEnded){
+                self.nextLevel();
+                win_view.close()
+                win_view.showDoubleCoin(this.reward)
+            }
+        })
+    }
+
+    onFailExtendTimeClick(fail_view:fail){
+        gameManager.playBtnSound()
+        let self = this;
+        SdkUtil.showVideoAd(config.rewardVideoAdUnitId.Prolong_AdUnitId,(res)=>{
+            if(res.isEnded){
+                self.start_time_count(self.m_data.extend_time);
+                fail_view.close()
+            }
+        })
+       
+    }
+    protected onFailReStartClick(fail_view:fail): void{}
+    protected initView(data,isUpdate=false): void{}
+    protected initUI(): void{}
+    protected onTipBtnClick(): void{}
+    
+}
+
+

+ 9 - 0
assets/script/play_list/base_view.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.23",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "18723ef1-1f9e-4874-9bad-c50d82576778",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 4 - 1
assets/script/play_list/star_list.ts

@@ -16,13 +16,16 @@ export class star_list extends Component {
         }
     }
 
-    public showStartByNumber(show_star_number:number){
+    public showStartByNumber(show_star_number:number):Node{
+        let node:Node = null;
         for (let index = 0; index < this.node.children.length; index++) {
             const element = this.node.children[index];
             if(index<show_star_number){
                 element.getComponent(Sprite).spriteFrame = this.sf_yellow_start;
+                node = element;
             }
         }
+        return node;
     }
 }
 

+ 27 - 183
assets/script/play_list/zhaocha_component/view_game_play_mei_nv_zhao_xi_jie.ts

@@ -14,76 +14,21 @@ import { pause } from '../../dialog/pause';
 import { Util } from '../../framework/util';
 import { setting } from '../../homepage/setting';
 import { SdkUtil } from '../../framework/sdkUtil';
+import { base_view } from '../base_view';
 const { ccclass, property } = _decorator;
 
 @ccclass('view_game_play_mei_nv_zhao_xi_jie')
-export class view_game_play_mei_nv_zhao_xi_jie extends Component {
-    @property(Node) btn_back:Node;
-    @property(Node) btn_pause:Node;
+export class view_game_play_mei_nv_zhao_xi_jie extends base_view {
     @property(Node) img:Node;
     @property(Node) content:Node;
     @property(Prefab) component_item_prefab:Prefab;
-    @property(Node) lab_title:Node;
-    @property(Node) lab_coin:Node;
-    @property(Node) btn_tip:Node;
-    @property(ProgressBar) progressbar:ProgressBar;
     @property(Node) img_touch_err:Node;
-    @property(SpriteFrame) sf_btn_start:SpriteFrame;
-    @property(SpriteFrame) sf_btn_pause:SpriteFrame;
     @property(ScrollView) scroll_view:ScrollView;
-    @property(Node) action_node:Node;
-    @property(Node) btn_look_video:Node = null;
     private sfList:Map<number,SpriteFrame> = new Map;
-    private categoryid:number = config.PLAY_TYPE.MEI_NV_ZHAO_XI_JIE;
-    private m_data:server_mei_nv_zhao_xi_jie_data_item = null;
     private answer:mei_nv_pos[];
     private img_sf:SpriteFrame;
-    private time_count:number = 0;
-    private time_all_count:number = 0;
-    private err_node_1:Node = null;
-    private isPause:boolean = false;
-    private reward:number = 0;
-    private isShowWin:boolean = false;
-    start() {
-        let self = this;
-        this.btn_back.on(Node.EventType.TOUCH_START,()=>{
-            gameManager.playBtnSound();
-            self.close();
-        },this);
-        this.btn_tip.on(Node.EventType.TOUCH_START,()=>{
-            gameManager.playBtnSound();
-            if(gameManager.isTestUser()){
-                this.onTipBtnClick();
-            }else{
-                SdkUtil.showVideoAd(config.rewardVideoAdUnitId.Tip_AdUnitId,(res)=>{
-                    if(res.isEnded){
-                        self.onTipBtnClick();
-                    }
-                })
-            }
-            
-        },this);
-        this.btn_look_video.on(Node.EventType.TOUCH_START,()=>{
-            SdkUtil.showVideoAd(config.rewardVideoAdUnitId.Earn_coins_AdUnitId,(res)=>{
-                if(res.isEnded){
-                    gameManager.add_coin(gameManager.get_deouble_reward_number())
-                    ClientEvent.dispatchEvent(config.EVENT_MSG.ON_CHANGE_COIN_NUMBER)
-                }
-            })
-        })
-        this.btn_pause.on(Node.EventType.TOUCH_START,()=>{
-            self.isPause  = true;
-            self.btn_pause.getComponent(Sprite).spriteFrame = self.sf_btn_start;
-            gameManager.playBtnSound();
-            gameManager.addTopView(config.PREFAB_PATH.setting,(node:Node)=>{
-                node.getComponent(setting).show(()=>{
-                    self.btn_pause.getComponent(Sprite).spriteFrame = self.sf_btn_pause;
-                    self.isPause = false;
-                })
-            })
-        },this);
+    initUI() {
         this.img.on(Node.EventType.TOUCH_START,this.TOUCH_START_IMG_1.bind(this),this);
-        ClientEvent.on(config.EVENT_MSG.ON_CHANGE_COIN_NUMBER,this.onChangeCoinNumber.bind(this),this);
     }
 
     TOUCH_START_IMG_1(event: EventTouch){
@@ -100,27 +45,31 @@ export class view_game_play_mei_nv_zhao_xi_jie extends Component {
         }
     }
 
-    protected onDestroy(): void {
-        ClientEvent.off(config.EVENT_MSG.ON_CHANGE_COIN_NUMBER,this.onChangeCoinNumber.bind(this),this);
-    }
-    onChangeCoinNumber(){
-        let num:number = parseInt(this.lab_coin.getComponent(Label).string);
-        gameManager.instance.addCoinNumber(this.reward,this.lab_coin.getComponent(Label),num,()=>{
-            this.lab_coin.getComponent(Label).string = gameManager.get_user_coin()+"";
-        })
-    }
     onTipBtnClick(){
         let self  = this;
-        for (let index = 1; index < self.img.children.length; index++) {
-            const element = self.img.children[index];
-            if(!element.getComponent(circle).isFinish()){
-                element.getComponent(circle).blinkShow();
-                break;
+        let tip_call = ()=>{
+            for (let index = 1; index < self.img.children.length; index++) {
+                const element = self.img.children[index];
+                if(!element.getComponent(circle).isFinish()){
+                    element.getComponent(circle).blinkShow();
+                    break;
+                }
+                
             }
-            
+        }
+    
+        if(gameManager.isTestUser()){
+            tip_call();
+        }else{
+            SdkUtil.showVideoAd(config.rewardVideoAdUnitId.Tip_AdUnitId,(res)=>{
+                if(res.isEnded){
+                    tip_call();
+                }
+            })
         }
     }
     public initView(data:server_mei_nv_zhao_xi_jie_data_item,isUpdate=false){
+        this.categoryid = config.PLAY_TYPE.MEI_NV_ZHAO_XI_JIE;
         this.m_data = data;
         let count = 0;
         if(!isUpdate){
@@ -279,129 +228,24 @@ export class view_game_play_mei_nv_zhao_xi_jie extends Component {
             if(gameManager.isFinishAllLevel(this.categoryid)){
                 tools.showToast("当前已是最后一关,敬请期待最新版本");
             }else{
-                gameManager.addTopView(config.PREFAB_PATH.win,(node:Node)=>{
-                    this.isShowWin = true;
-                    gameManager.playWinSoundByCategoryId(this.categoryid)
-                    node.getComponent(win).showMeiNvView(this.reward,this.m_data,this.onWinOrdinaryClick.bind(this),this.onWinDoubleClick.bind(this));
-                });
+                this.showWin()
             }
 
         }
     }
-    error_sub_time(){
-        let self = this;
-        if( (self.time_count + self.m_data.wrong_time) >= self.time_all_count){
-            self.time_all_count = 0;
-        }else{
-            self.time_count += self.m_data.wrong_time;
-        }
-        self.progressbar.progress = (self.time_all_count-self.time_count)/self.time_all_count;
-    }
-
-    close(){
-        // this.decRefSf();
-        ClientEvent.dispatchEvent(config.EVENT_MSG.ON_BACK_HOME_VIEW);
-        this.node.removeFromParent();
-    }
-
-    nextLevel(){
-        let is_have_next = gameManager.next_level(this.categoryid,(is_sync:boolean)=>{
-            if(is_sync){
-                let levels_item = gameManager.get_cur_level_by_categoryid(this.categoryid);
-                gameManager.showLoading();
-                gameManager.add_coin(this.reward);
-                ClientEvent.dispatchEvent(config.EVENT_MSG.ON_CHANGE_COIN_NUMBER);
-                http.get(config.static_url.levels_info(this.categoryid,levels_item.level),(err,data)=>{
-                    if(!err){
-                        let _data = JSON.parse(data)
-                        if(_data.code===config.MSG_CODE.SUCCESS){
-                            this.initView(_data.content,true);
-                        }
-                    }
-                })
-            }else{
-                gameManager.hideLoading()
-                tools.showDialogOne("请检查您的网络状态,重新连接",()=>{
-                    this.nextLevel()
-                })
-            }
-        })
-
-        if(!is_have_next){
-            tools.showToast("当前已是最后一关,敬请期待最新版本");
-        }
-    }
-
-    stop_time_count(){
-        this.unscheduleAllCallbacks()
-    }
-    start_time_count(time:number){
-        this.time_all_count = time;
-        let self = this;
-        this.time_count = 0;
-        self.progressbar.progress = 1;
-        this.schedule(()=>{
-            if(self.isPause){
-                return;
-            }
-            if(self.time_count<=self.time_all_count){
-                self.time_count+=1;
-                self.progressbar.progress = (self.time_all_count-self.time_count)/self.time_all_count;
-            }else{
-                self.showFail()
-                self.stop_time_count();
-            }
-            
-        },1)
-    }
-
-    showFail(){
-        gameManager.addUiView(config.PREFAB_PATH.fail,(node:Node)=>{
-            gameManager.playFailSoundByCategoryId(this.categoryid)
-            node.getComponent(fail).showView(this.m_data.extend_time,this.onFailExtendTimeClick.bind(this),this.onFailReStartClick.bind(this),this.m_data.ads_restart)
-        })
-    }
-
-    onWinOrdinaryClick(){
-        gameManager.playBtnSound()
-        this.nextLevel();
-    }
-
-    onWinDoubleClick(){
-        gameManager.playBtnSound()
-        let self = this;
-        let list = this.m_data.ads_fold.split(",");
-        let start = parseInt(list[0]);
-        let end = parseInt(list[1]);
-        this.reward *=  Util.getRandomInt(start,end);
-        SdkUtil.showVideoAd(config.rewardVideoAdUnitId.Super_double_AdUnitId,(res)=>{
-            if(res.isEnded){
-                self.nextLevel();
-            }
-        })
-    }
-
-    onFailExtendTimeClick(){
-        gameManager.playBtnSound()
-        let self = this;
-        SdkUtil.showVideoAd(config.rewardVideoAdUnitId.Prolong_AdUnitId,(res)=>{
-            if(res.isEnded){
-                self.start_time_count(self.m_data.extend_time);
-            }
-        })
-       
-    }
-
-    onFailReStartClick(){
+  
+    onFailReStartClick(fail_view:fail){
         gameManager.playBtnSound()
         if(this.m_data.ads_restart==1){
             SdkUtil.showVideoAd(config.rewardVideoAdUnitId.Resume_AdUnitId,(res)=>{
                 if(res.isEnded){
                     this.initAnswerView();
                     this.initComponent();
+                    fail_view.close()
                 }
             })
         }else{
+            fail_view.close()
             this.initAnswerView();
             this.initComponent();
         }

+ 27 - 196
assets/script/play_list/zhaocha_font/view_game_play_han_zi_zhao_bu_tong.ts

@@ -5,98 +5,35 @@ import { gameManager } from '../../gameManager';
 import { tools } from '../../tools';
 import { font_grid_item } from './font_grid_item';
 import { fail } from '../../dialog/fail';
-import { http } from '../../http/http';
 import { win } from '../../dialog/win';
 import { ClientEvent } from '../../framework/clientEvent';
-import { AudioManager } from '../../framework/audioManager';
-import { pause } from '../../dialog/pause';
 import { Util } from '../../framework/util';
 import { PoolManager } from '../../framework/poolManager';
 import { setting } from '../../homepage/setting';
 import { SdkUtil } from '../../framework/sdkUtil';
+import { base_view } from '../base_view';
 const { ccclass, property } = _decorator;
 
 @ccclass('view_game_play_han_zi_zhao_bu_tong')
-export class view_game_play_han_zi_zhao_bu_tong extends Component {
-    @property(Node) btn_back:Node;
-    @property(Node) btn_pause:Node;
+export class view_game_play_han_zi_zhao_bu_tong extends base_view {
     @property(Node) font_grid:Node;
     @property(Node) left_pos:Node;
     @property(Node) bottom_pos:Node;
     @property(Prefab) item_prefab;
-    @property(Node) lab_title:Node;
-    @property(Node) btn_tip:Node;
-    @property(Node) lab_coin:Node;
-    @property(ProgressBar) progressbar:ProgressBar;
     @property(Node) bottom_item:Node;
     @property(Node) left_item:Node;
-    @property(SpriteFrame) sf_btn_start:SpriteFrame;
-    @property(SpriteFrame) sf_btn_pause:SpriteFrame;
-    @property(Node) btn_look_video:Node = null;
     private answer:font_grid_pos[];
     private default_img:SpriteFrame;
     private find_img:SpriteFrame;
     private d_img:SpriteFrame;
-    private categoryid:number = config.PLAY_TYPE.HAN_ZI_ZHAO_BU_TONG;
-    private m_data:server_han_zi_zhao_bu_tong_data_item = null;
-    private time_count:number = 0;
-    private time_all_count:number = 0;
-    private isPause:boolean = false;
-    private reward:number = 0;
-    private isShowWin:boolean = false;
-    start() {
-        let self = this;
-        this.btn_back.on(Node.EventType.TOUCH_START,()=>{
-            gameManager.playBtnSound()
-            self.close();
-        },this);
-        this.btn_tip.on(Node.EventType.TOUCH_START,()=>{
-            gameManager.playBtnSound()
-            if(gameManager.isTestUser()){
-                this.onTipBtnClick();
-            }else{
-                SdkUtil.showVideoAd(config.rewardVideoAdUnitId.Tip_AdUnitId,(res)=>{
-                    if(res.isEnded){
-                        self.onTipBtnClick();
-                    }
-                })
-            }
-        },this);
-        this.btn_look_video.on(Node.EventType.TOUCH_START,()=>{
-            SdkUtil.showVideoAd(config.rewardVideoAdUnitId.Earn_coins_AdUnitId,(res)=>{
-                if(res.isEnded){
-                    gameManager.add_coin(gameManager.get_deouble_reward_number())
-                    ClientEvent.dispatchEvent(config.EVENT_MSG.ON_CHANGE_COIN_NUMBER)
-                }
-            })
-        })
-        this.btn_pause.on(Node.EventType.TOUCH_START,()=>{
-            self.isPause  = true;
-            self.btn_pause.getComponent(Sprite).spriteFrame = self.sf_btn_start;
-            gameManager.playBtnSound()
-            gameManager.addTopView(config.PREFAB_PATH.setting,(node:Node)=>{
-                node.getComponent(setting).show(()=>{
-                    self.btn_pause.getComponent(Sprite).spriteFrame = self.sf_btn_pause;
-                    self.isPause = false;
-                })
-            })
-        },this);
+    initUI() {
         if(!PoolManager.instance.isHavePool(this.item_prefab)){
             PoolManager.instance.preloadPool(this.item_prefab,this.m_data.col*this.m_data.row)
         }
-        
-        ClientEvent.on(config.EVENT_MSG.ON_CHANGE_COIN_NUMBER,this.onChangeCoinNumber.bind(this),this);
-    }
-    protected onDestroy(): void {
-        ClientEvent.off(config.EVENT_MSG.ON_CHANGE_COIN_NUMBER,this.onChangeCoinNumber.bind(this),this);
-    }
-    onChangeCoinNumber(){
-        let num:number = parseInt(this.lab_coin.getComponent(Label).string);
-        gameManager.instance.addCoinNumber(this.reward,this.lab_coin.getComponent(Label),num,()=>{
-            this.lab_coin.getComponent(Label).string = gameManager.get_user_coin()+"";
-        })
     }
+
     public initView(data:server_han_zi_zhao_bu_tong_data_item,isUpdate=false){
+        this.categoryid = config.PLAY_TYPE.HAN_ZI_ZHAO_BU_TONG;
         this.m_data = data;
         let count = 0;
         if(!isUpdate){
@@ -138,14 +75,26 @@ export class view_game_play_han_zi_zhao_bu_tong extends Component {
     }
     onTipBtnClick(){
         let self  = this;
-        for (let index = 0; index < self.font_grid.children.length; index++) {
-            const element = self.font_grid.children[index];
-            if(!element.getComponent(font_grid_item).isFinish()&&element.getComponent(font_grid_item).isRight()){
-                element.getComponent(font_grid_item).blinkShow()
-                break;
+        let tip_call = ()=>{
+            for (let index = 0; index < self.font_grid.children.length; index++) {
+                const element = self.font_grid.children[index];
+                if(!element.getComponent(font_grid_item).isFinish()&&element.getComponent(font_grid_item).isRight()){
+                    element.getComponent(font_grid_item).blinkShow()
+                    break;
+                }
+                
             }
-            
         }
+        if(gameManager.isTestUser()){
+            tip_call();
+        }else{
+            SdkUtil.showVideoAd(config.rewardVideoAdUnitId.Tip_AdUnitId,(res)=>{
+                if(res.isEnded){
+                    tip_call();
+                }
+            })
+        }
+       
     }
     onGridItemClick(item:font_grid_item){
        if(item.isRight()&&!item.isFinish()){
@@ -162,27 +111,12 @@ export class view_game_play_han_zi_zhao_bu_tong extends Component {
             if(gameManager.isFinishAllLevel(this.categoryid)){
                 tools.showToast("当前已是最后一关,敬请期待最新版本");
             }else{
-                gameManager.addTopView(config.PREFAB_PATH.win,(node:Node)=>{
-                    this.isShowWin = true;
-                    gameManager.playWinSoundByCategoryId(this.categoryid);
-                    node.getComponent(win).showHanZiView(this.reward,this.m_data,this.onWinOrdinaryClick.bind(this),this.onWinDoubleClick.bind(this));
-                });
-             
+                this.showWin();
             }
            
        }
     }
 
-    error_sub_time(){
-        let self = this;
-        if( (self.time_count + self.m_data.wrong_time) >= self.time_all_count){
-            self.time_all_count = 0;
-        }else{
-            self.time_count += self.m_data.wrong_time;
-        }
-        self.progressbar.progress = (self.time_all_count-self.time_count)/self.time_all_count;
-    }
-
     checkAllAnswerFinish():boolean{
         let self = this;
         let answer_number = self.m_data.answer_number;
@@ -251,122 +185,19 @@ export class view_game_play_han_zi_zhao_bu_tong extends Component {
         }
         this.start_time_count(this.m_data.s_time)
     }
-    close(){
-        ClientEvent.dispatchEvent(config.EVENT_MSG.ON_BACK_HOME_VIEW);
-        this.node.removeFromParent();
-    }
-
-    start_time_count(time:number){
-        let self = this;
-        this.time_all_count = time;
-        this.time_count = 0;
-        self.progressbar.progress = 1;
-        this.schedule(()=>{
-            if(self.isPause){
-                return;
-            }
-            if(self.time_count<=self.time_all_count){
-                self.time_count+=1;
-                self.progressbar.progress = (self.time_all_count-self.time_count)/self.time_all_count;
-            }else{
-                self.showFail()
-                self.stop_time_count();
-            }
-            
-        },1)
-    }
-
-    showFail(){
-        gameManager.addUiView(config.PREFAB_PATH.fail,(node:Node)=>{
-            gameManager.playFailSoundByCategoryId(this.categoryid);
-            node.getComponent(fail).showView(this.m_data.extend_time,this.onFailExtendTimeClick.bind(this),this.onFailReStartClick.bind(this),this.m_data.ads_restart)
-        })
-    }
-
-    stop_time_count(){
-        this.unscheduleAllCallbacks()
-    }
-    nextLevel(){
-        let is_have_next = gameManager.next_level(this.categoryid,(is_sync:boolean)=>{
-            if(is_sync){
-                let levels_item = gameManager.get_cur_level_by_categoryid(this.categoryid);
-                gameManager.showLoading();
-                gameManager.add_coin(this.reward);
-                ClientEvent.dispatchEvent(config.EVENT_MSG.ON_CHANGE_COIN_NUMBER);
-                http.get(config.static_url.levels_info(this.categoryid,levels_item.level),(err,data)=>{
-    
-                    if(!err){
-                        let _data = JSON.parse(data)
-                        if(_data.code===config.MSG_CODE.SUCCESS){
-                            this.initView(_data.content,true);
-                        }
-                    }
-                })
-            }else{
-                gameManager.hideLoading()
-                tools.showDialogOne("请检查您的网络状态,重新连接",()=>{
-                    this.nextLevel()
-                })
-            }
-        })
-
-        if(!is_have_next){
-            tools.showToast("当前已是最后一关,敬请期待最新版本");
-        }
-    }
-    
-    onWinOrdinaryClick(){
-        gameManager.playBtnSound()
-        this.nextLevel();
-    }
-
-    onWinDoubleClick(){
-        gameManager.playBtnSound()
-        let self = this;
-        let list = this.m_data.ads_fold.split(",");
-        let start = parseInt(list[0]);
-        let end = parseInt(list[1]);
-        this.reward  *=  Util.getRandomInt(start,end);
-        SdkUtil.showVideoAd(config.rewardVideoAdUnitId.Super_double_AdUnitId,(res)=>{
-            if(res.isEnded){
-                self.nextLevel();
-            }
-        })
-    }
-
-    onFailExtendTimeClick(){
-        gameManager.playBtnSound()
-        let self = this;
-        SdkUtil.showVideoAd(config.rewardVideoAdUnitId.Prolong_AdUnitId,(res)=>{
-            if(res.isEnded){
-                self.start_time_count(self.m_data.extend_time);
-            }
-        })
-    }
-
-    onFailReStartClick(){
+    onFailReStartClick(fail_view:fail){
         gameManager.playBtnSound()
         let self = this;
         if(this.m_data.ads_restart==1){
             SdkUtil.showVideoAd(config.rewardVideoAdUnitId.Resume_AdUnitId,(res)=>{
                 if(res.isEnded){
                     self.initGrid()
+                    fail_view.close()
                 }
             })
         }else{
             self.initGrid()
-        }
-    }
-
-    decRefSf(){
-        let self = this;
-        if(self.default_img){
-            self.default_img.decRef()
-            self.default_img = null;
-        }
-        if(self.find_img){
-            self.find_img.decRef()
-            self.find_img = null;
+            fail_view.close()
         }
     }
 }

+ 46 - 195
assets/script/play_list/zhaocha_up_down/view_game_play_shuang_tu_zhao_bu_tong.ts

@@ -14,46 +14,26 @@ import { pause } from '../../dialog/pause';
 import { Util } from '../../framework/util';
 import { setting } from '../../homepage/setting';
 import { SdkUtil } from '../../framework/sdkUtil';
+import { base_view } from '../base_view';
 const { ccclass, property } = _decorator;
 
 @ccclass('view_game_play_shuang_tu_zhao_bu_tong')
-export class view_game_play_shuang_tu_zhao_bu_tong extends Component {
-    @property(Node) btn_back:Node;
-    @property(Node) btn_pause:Node;
+export class view_game_play_shuang_tu_zhao_bu_tong extends base_view {
     @property(Node) btn_amplify:Node;
-    @property(Node) btn_tip:Node;
     @property(Node) img_1:Node;
     @property(Node) img_2:Node;
     @property(Node) content_1:Node;
     @property(Node) content_2:Node;
     @property(Node) lab_amplify_status:Node;
-    @property(Node) lab_coin:Node;
-    @property(Node) lab_title:Node;
     @property(Node) star_list:Node;
-    @property(Node) img_touch_err:Node;
-    @property(ProgressBar) progressbar:ProgressBar;
-    @property(SpriteFrame) sf_btn_start:SpriteFrame;
-    @property(SpriteFrame) sf_btn_pause:SpriteFrame;
-    @property(Node) btn_look_video:Node = null;
-    private categoryid:number = config.PLAY_TYPE.YI_QI_ZHAO_CHA;
-    private m_data:server_shuang_tu_zhao_bu_tong_data_item = null;
+    @property(Node) effect:Node = null;
     private img_1_sf:SpriteFrame;
     private img_2_sf:SpriteFrame;
     private cur_amplify_status:number = 0;
-    private time_count:number = 0;
-    private time_all_count:number = 0;
-    private err_node_1:Node = null;
     private err_node_2:Node = null;
-    private isPause:boolean = false;
     private scale_multiple:number = 2;
-    private reward:number = 0;
-    private isShowWin:boolean = false;
-    start() {
+    initUI() {
         let self = this;
-        this.btn_back.on(Node.EventType.TOUCH_START,()=>{
-            gameManager.playBtnSound()
-            self.close();
-        },this);
         this.btn_amplify.on(Node.EventType.TOUCH_START,()=>{
             gameManager.playBtnSound()
             if(self.cur_amplify_status==0){
@@ -63,46 +43,10 @@ export class view_game_play_shuang_tu_zhao_bu_tong extends Component {
             }
             self.updateAmplifyStatus();
         },this);
-        this.btn_look_video.on(Node.EventType.TOUCH_START,()=>{
-            SdkUtil.showVideoAd(config.rewardVideoAdUnitId.Earn_coins_AdUnitId,(res)=>{
-                if(res.isEnded){
-                    gameManager.add_coin(gameManager.get_deouble_reward_number())
-                    ClientEvent.dispatchEvent(config.EVENT_MSG.ON_CHANGE_COIN_NUMBER)
-                }
-            })
-        })
-        this.btn_tip.on(Node.EventType.TOUCH_START,()=>{
-            gameManager.playBtnSound()
-            if(gameManager.isTestUser()){
-                if(self.cur_amplify_status==1){
-                    self.cur_amplify_status = 0;
-                    self.updateAmplifyStatus();
-                }
-                this.onTipBtnClick();
-            }else{
-                SdkUtil.showVideoAd(config.rewardVideoAdUnitId.Tip_AdUnitId,(res)=>{
-                    if(res.isEnded){
-                        self.onTipBtnClick();
-                    }
-                })
-            }
-        },this);
-
-        this.btn_pause.on(Node.EventType.TOUCH_START,()=>{
-            self.isPause  = true;
-            self.btn_pause.getComponent(Sprite).spriteFrame = self.sf_btn_start;
-            gameManager.playBtnSound()
-            gameManager.addTopView(config.PREFAB_PATH.setting,(node:Node)=>{
-                node.getComponent(setting).show(()=>{
-                    self.btn_pause.getComponent(Sprite).spriteFrame = self.sf_btn_pause;
-                    self.isPause = false;
-                })
-            })
-        },this);
 
         this.img_1.on(Node.EventType.TOUCH_END,this.TOUCH_START_IMG_1.bind(this),this);
         this.img_2.on(Node.EventType.TOUCH_END,this.TOUCH_START_IMG_2.bind(this),this);
-        ClientEvent.on(config.EVENT_MSG.ON_CHANGE_COIN_NUMBER,this.onChangeCoinNumber.bind(this),this);
+       
     }
 
     TOUCH_START_IMG_1(event: EventTouch){
@@ -133,12 +77,7 @@ export class view_game_play_shuang_tu_zhao_bu_tong extends Component {
         }
     }
 
-    onChangeCoinNumber(){
-        let num:number = parseInt(this.lab_coin.getComponent(Label).string);
-        gameManager.instance.addCoinNumber(this.reward,this.lab_coin.getComponent(Label),num,()=>{
-            this.lab_coin.getComponent(Label).string = gameManager.get_user_coin()+"";
-        })
-    }
+
 
     protected onDestroy(): void {
         ClientEvent.off(config.EVENT_MSG.ON_CHANGE_COIN_NUMBER,this.onChangeCoinNumber.bind(this),this);
@@ -166,15 +105,30 @@ export class view_game_play_shuang_tu_zhao_bu_tong extends Component {
     }
     onTipBtnClick(){
         let self  = this;
-        for (let index = 1; index < self.img_1.children.length; index++) {
-            const element = self.img_1.children[index];
-            if(!element.getComponent(circle).isFinish()){
-                element.getComponent(circle).blinkShow();
-                element.getComponent(circle).get_relative_node().blinkShow();
-                break;
+        let tip_call = ()=>{
+            for (let index = 1; index < self.img_1.children.length; index++) {
+                const element = self.img_1.children[index];
+                if(!element.getComponent(circle).isFinish()){
+                    element.getComponent(circle).blinkShow();
+                    element.getComponent(circle).get_relative_node().blinkShow();
+                    break;
+                }
             }
-            
         }
+        if(gameManager.isTestUser()){
+            if(self.cur_amplify_status==1){
+                self.cur_amplify_status = 0;
+                self.updateAmplifyStatus();
+            }
+            tip_call();
+        }else{
+            SdkUtil.showVideoAd(config.rewardVideoAdUnitId.Tip_AdUnitId,(res)=>{
+                if(res.isEnded){
+                    tip_call();
+                }
+            })
+        }
+    
     }
 
     onImg1Scroll(){
@@ -258,7 +212,18 @@ export class view_game_play_shuang_tu_zhao_bu_tong extends Component {
             relative_node.show()
             let count = this.getFinishNumber();
             gameManager.playRightSoundByCategoryId(this.categoryid);
-            this.star_list.getComponent(star_list).showStartByNumber(count);
+            let star = this.star_list.getComponent(star_list).showStartByNumber(count);
+            //
+            let parent = item.node.parent.name ==="img1"?this.img_1:this.img_2;
+            let new_node:Node = instantiate(this.effect);
+            let start_pos = new Vec3()
+            parent.getComponent(UITransform).convertToWorldSpaceAR(item.node.position,start_pos)
+
+            let end_pos =  this.star_list.getComponent(UITransform).convertToWorldSpaceAR(star.position)
+            new_node.parent = this.action_node;
+            new_node.position = start_pos;
+            // new_node.getComponent(component_item).hideMask();
+            tween(new_node).to(0.5, {position: end_pos}).removeSelf().start()
         }
 
         if(this.checkAllAnswerFinish()&&!this.isShowWin){
@@ -266,130 +231,30 @@ export class view_game_play_shuang_tu_zhao_bu_tong extends Component {
             if(gameManager.isFinishAllLevel(this.categoryid)){
                 tools.showToast("当前已是最后一关,敬请期待最新版本");
             }else{
-                gameManager.addTopView(config.PREFAB_PATH.win,(node:Node)=>{
-                    gameManager.playWinSoundByCategoryId(this.categoryid);
-                    this.isShowWin = true;
-                    node.getComponent(win).showZhaoBuTongView(this.reward,this.m_data,this.onWinOrdinaryClick.bind(this),this.onWinDoubleClick.bind(this));
-                });
+                this.showWin();
             }
 
         }
     }
 
-    error_sub_time(){
-        let self = this;
-        if( (self.time_count + self.m_data.wrong_time) >= self.time_all_count){
-            self.time_all_count = 0;
-        }else{
-            self.time_count += self.m_data.wrong_time;
-        }
-        self.progressbar.progress = (self.time_all_count-self.time_count)/self.time_all_count;
-    }
-
-    onWinOrdinaryClick(){
-        gameManager.playBtnSound()
-        this.nextLevel();
-    }
-
-    onWinDoubleClick(){
-        gameManager.playBtnSound()
-        let self = this;
-        let list = this.m_data.ads_fold.split(",");
-        let start = parseInt(list[0]);
-        let end = parseInt(list[1]);
-        this.reward  *= Util.getRandomInt(start,end);
-        SdkUtil.showVideoAd(config.rewardVideoAdUnitId.Super_double_AdUnitId,(res)=>{
-            if(res.isEnded){
-                self.nextLevel();
-            }
-        })
-    }
-
-    onFailExtendTimeClick(){
-        gameManager.playBtnSound()
-        let self = this;
-        SdkUtil.showVideoAd(config.rewardVideoAdUnitId.Prolong_AdUnitId,(res)=>{
-            if(res.isEnded){
-                self.start_time_count(self.m_data.extend_time);
-            }
-        })
-    }
-
-    onFailReStartClick(){
+    onFailReStartClick(fail_view:fail){
         gameManager.playBtnSound()
         let self = this;
         if(this.m_data.ads_restart==1){
             SdkUtil.showVideoAd(config.rewardVideoAdUnitId.Resume_AdUnitId,(res)=>{
                 if(res.isEnded){
                     self.initAnswerView()
+                    fail_view.close()
                 }
             })
         }else{
+            fail_view.close()
             self.initAnswerView()
         }
     }
 
-    nextLevel(){
-        let is_have_next = gameManager.next_level(this.categoryid,(is_sync:boolean)=>{
-            if(is_sync){
-                let levels_item = gameManager.get_cur_level_by_categoryid(this.categoryid);
-                gameManager.showLoading();
-                gameManager.add_coin(this.reward);
-                ClientEvent.dispatchEvent(config.EVENT_MSG.ON_CHANGE_COIN_NUMBER);
-                http.get(config.static_url.levels_info(this.categoryid,levels_item.level),(err,data)=>{
-    
-                    if(!err){
-                        let _data = JSON.parse(data)
-                        if(_data.code===config.MSG_CODE.SUCCESS){
-                            this.initView(_data.content,true);
-                        }
-                    }
-                })
-            }else{
-                gameManager.hideLoading()
-                tools.showDialogOne("请检查您的网络状态,重新连接",()=>{
-                    this.nextLevel()
-                })
-            }
-        })
-
-        if(!is_have_next){
-            tools.showToast("当前已是最后一关,敬请期待最新版本");
-        }
-    }
-
-    start_time_count(time:number){
-        this.time_all_count = time;
-        let self = this;
-        this.time_count = 0;
-        self.progressbar.progress = 1;
-        this.schedule(()=>{
-            if(self.isPause){
-                return;
-            }
-            if(self.time_count<=self.time_all_count){
-                self.time_count+=1;
-                self.progressbar.progress = (self.time_all_count-self.time_count)/self.time_all_count;
-            }else{
-                self.showFail()
-                self.stop_time_count();
-            }
-            
-        },1)
-    }
-
-    showFail(){
-        gameManager.addUiView(config.PREFAB_PATH.fail,(node:Node)=>{
-            gameManager.playFailSoundByCategoryId(this.categoryid);
-            node.getComponent(fail).showView(this.m_data.extend_time,this.onFailExtendTimeClick.bind(this),this.onFailReStartClick.bind(this),this.m_data.ads_restart)
-        })
-    }
-
-    stop_time_count(){
-        this.unscheduleAllCallbacks()
-    }
-
     public initView(data:server_shuang_tu_zhao_bu_tong_data_item,isUpdate=false){
+        this.categoryid = config.PLAY_TYPE.YI_QI_ZHAO_CHA;
         this.m_data = data;
         let count = 0;
         if(!isUpdate){
@@ -428,22 +293,8 @@ export class view_game_play_shuang_tu_zhao_bu_tong extends Component {
             call_back();
         })
     }
-    close(){
-        ClientEvent.dispatchEvent(config.EVENT_MSG.ON_BACK_HOME_VIEW);
-        this.node.removeFromParent();
-    }
+ 
 
-    decRefSf(){
-        let self = this;
-        if(self.img_1_sf){
-            self.img_1_sf.decRef()
-            self.img_1_sf = null;
-        }
-        if(self.img_2_sf){
-            self.img_2_sf.decRef()
-            self.img_2_sf = null;
-        }
-    }
 }