Forráskód Böngészése

福利功能:与服务端调试

wuwangdong 4 éve
szülő
commit
7383df5cad

+ 5 - 5
assets/resources/module/blessingBag/blessingBag.prefab

@@ -1227,7 +1227,7 @@
     "asset": {
       "__uuid__": "94760687-648e-4d1f-ac2f-169b0dc625d9"
     },
-    "fileId": "8aM7YI6AdJJJai7iLNSF2J",
+    "fileId": "a28EGmqkNLhaACIsqY1Dqv",
     "sync": false
   },
   {
@@ -1357,7 +1357,7 @@
     "asset": {
       "__uuid__": "94760687-648e-4d1f-ac2f-169b0dc625d9"
     },
-    "fileId": "59Neqn9A5NQafPD2f4XCW3",
+    "fileId": "a6jVO8ApVDraZIMUdbmEv9",
     "sync": false
   },
   {
@@ -1487,7 +1487,7 @@
     "asset": {
       "__uuid__": "94760687-648e-4d1f-ac2f-169b0dc625d9"
     },
-    "fileId": "daXujAoNJIgJUKH1D/Y4Yi",
+    "fileId": "b8DiLjwRxNboMRbF//9URv",
     "sync": false
   },
   {
@@ -9044,7 +9044,7 @@
     "asset": {
       "__uuid__": "94760687-648e-4d1f-ac2f-169b0dc625d9"
     },
-    "fileId": "c39OUl89tIIro6nWc7Htpv",
+    "fileId": "31p4gFgFlFtr/ErXza3pAA",
     "sync": false
   },
   {
@@ -9153,7 +9153,7 @@
     "asset": {
       "__uuid__": "94760687-648e-4d1f-ac2f-169b0dc625d9"
     },
-    "fileId": "acm8RDiqFEUIN9LVahxjoh",
+    "fileId": "a7Hw3V0mRGfLgDT5Ujkfwn",
     "sync": false
   },
   {

+ 14 - 6
assets/script/game/data/GameData.ts

@@ -77,12 +77,7 @@ export class GameData {
         mk.console.logSingle("getInfoCrypt", response.data);
         this.initPlayerProp(response.data)
         this.initProps(response.data.gameUserData);
-        gData.guideData.init();
-        gData.guideWeakData.init();
-        gData.moduleData.forEach(element => {
-            element.init();
-        });
-
+       
         data = {};
         response = await mk.http.sendData('user/adShowConfig', data);
         if (response.errcode != 0) {
@@ -91,6 +86,19 @@ export class GameData {
         this.adShowConfig = response.data;
         mk.console.logSingle("user/adShowConfig", response.data);
 
+        data = {};
+        response = await mk.http.sendData('welFare/getUserWelFareTaskInfo', data);
+        if (response.errcode != 0) {
+            return;
+        }
+        this.gameData.userTuCaoInfo = response.data.userWelFareTaskInfo;
+        mk.console.logSingle("welFare/getUserWelFareTaskInfo", response.data);
+        gData.guideData.init();
+        gData.guideWeakData.init();
+        gData.moduleData.forEach(element => {
+            element.init();
+        });
+
         gData.adData.setFullInterShowStr();
 
         this.dataFinish = true;

+ 11 - 13
assets/script/game/data/module/BlessingBagData.ts

@@ -47,10 +47,8 @@ export class BlessingBagData extends Data {
      * @param type 打开红包类型 1 大额红包 2 任务红包
      * @param num  红包金额
     */
-    OpenTaskRbPanel(taskRbNum: number, redMoneyId: number, type: number, num: number) {
+    OpenTaskRbPanel(redMoneyId: number, num: number) {
         this.taskRbId = redMoneyId;
-        this.taskRbNum = taskRbNum;
-        this.rbType = type;
         this.rbNum = num;
         this.init_openRb = true;
     }
@@ -66,16 +64,16 @@ export class BlessingBagData extends Data {
         * 免费加进度
         * @param cb 提现回调
        */
-    async HttpNoAdProgress() {
-        let data = {};
-        let response = await mk.http.sendData('tuCaoRedMoney/noNeedVideo', data);
+    async addProgress() {
+        let data = {"updateType": this.videoRbData.isVideo};
+        let response = await mk.http.sendData('/welFare/updateWelFareTask', data);
 
         if (response.errcode != 0) {
             return;
         }
 
         this.isPlayAniUpdate = true;
-        this.videoRbData = response.data.UserRedMoneyInfo;
+        this.videoRbData = response.data.userWelFareTaskInfo;
     }
 
     /**
@@ -101,19 +99,19 @@ export class BlessingBagData extends Data {
      * @param cb 提现回调
     */
     async HttpCashTask() {
-        let data = { redMoneyId: this.taskRbId };
-        let response = await mk.http.sendData('tuCaoRedMoney/gearCash', data);
+        let data = { Id: this.taskRbId };
+        let response = await mk.http.sendData('welFare/welFareCash', data);
 
         if (response.errcode != 0) {
             return null;
         }
 
         this.isPlayAniUpdate = false;
-        this.videoRbData = response.data.UserRedMoneyInfo;
+        this.videoRbData = response.data.userWelFareTaskInfo;
 
-        const rewardNum = Math.round(gData.blessingBag.taskRbNum * 100);
-        gData.receiptNotice.receip_rmb = rewardNum;
-        gData.cashNormal.receip_total_rmb += gData.receiptNotice.receip_rmb;
+        //const rewardNum = Math.round(gData.blessingBag.rbNum * 100);
+        gData.receiptNotice.receip_rmb = gData.blessingBag.rbNum;
+        //gData.cashNormal.receip_total_rmb += gData.receiptNotice.receip_rmb;
         //mk.ui.openPanel('module/receiptNotice/receiptNotice');
         mk.ui.openPanel('module/newNotice/newNotice');
 

+ 41 - 85
assets/script/game/module/blessingBag/BlessingBag.ts

@@ -72,6 +72,7 @@ export default class BlessingBag extends cc.Component {
 
     @property(cc.Node)
     node_xiabiao: cc.Node = null;
+
     @property(TableView)
     tableview: TableView = null;
 
@@ -100,7 +101,8 @@ export default class BlessingBag extends cc.Component {
         }
 
         if (gData.blessingBag.init_openRb) {
-            this.OpenRbPanel(gData.blessingBag.rbType, gData.blessingBag.rbNum);
+            //this.OpenRbPanel(gData.blessingBag.taskRbId, gData.blessingBag.rbNum);
+            gData.blessingBag.HttpCashTask();
         }
     }
 
@@ -110,87 +112,27 @@ export default class BlessingBag extends cc.Component {
     }
 
     UpdateInfo() {
-        // let data = gData.blessingBag.videoRbData;
-        // if (!data) {
-        //     return
-        // }
-
-        // this.targetProgress = data.cumulativeAmount;
-
-        // //this.txtBigDelta.node.active = data.showTask != 1;
-        // //this.txtBigTask.node.active = data.showTask == 1;
-        // this.txtTipAd.string = data.showTask == 1 ? "提现中..." : "<b>满<color=#FFE00C>" + data.requestAmount + "元</color>可提现</b>";
-        // //this.txtBigDelta.string = "<outline color=#8C1010 width=4><b>每次视频额外奖励<color=#FFE00C>" + data.videoAmountPerTime + "元</color></b></outline>";
-        // //this.txtBigTask.string = "<outline color=#8C1010 width=4>金额已达标,完成<color=#4EB7FF>观看视频</color>任务可到账"
-        //     + "\n观看视频次数:<color=#FFE00C>" + data.taskVideoWatchTime + "/" + data.taskVideoTime + "</color>,连续观看天数:<color=#FFE00C>" + data.taskVideoWatchDay + "/" + data.taskVideoDay + "</color></outline>"
-
-        // this.txtRemaindAdNum.string = "<color=#FDFCF5>今日剩余次数:</c><color=#FFE533>" + data.videoTime + "</color>";
-        // this.adIcon.active = data.needToWatchTheVideo == 1;
-
-        // if (gData.blessingBag.isPlayAniUpdate) {
-        //     if (this.lastNum < data.cumulativeAmount) {
-        //         //let world_pos = this.btnCash.parent.convertToWorldSpaceAR(this.btnCash.getPosition());
-        //         // mk.fly.PlayCoinAnim(1, 10, this.btnAd, '', () => {
-        //         //     this.aniBigAdBtn.setCurrentTime(0);
-        //         //     this.aniBigAdBtn.play();
-        //         // });
-        //         this.txtAddEft.node.setPosition(cc.v2(0, 380));
-        //         this.txtAddEft.string = "+" + data.videoAmountPerTime + "元";
-        //         this.txtAddEft.node.stopAllActions();
-        //         this.txtAddEft.node.scale = 0;
-        //         this.txtAddEft.node.opacity = 255;
-        //         this.txtAddEft.node.active = true;
-
-        //         let a0 = cc.delayTime(0.8);
-        //         let a1t = cc.sequence(cc.scaleTo(0.15, 1.2), cc.scaleTo(0.15, 1));
-        //         let a1a = cc.spawn(cc.moveBy(0.3, cc.v2(0, 30)), a1t);
-        //         let a2 = cc.delayTime(0.5);
-        //         let a3 = cc.fadeOut(0.15);
-        //         let a4 = cc.callFunc(() => {
-        //             //this.txtBigNum.string = data.cumulativeAmount + "元";
-        //             this.PlayMoneyAni(0.2);
-        //             this.txtAddEft.node.active = false;
-        //         });
-        //         this.txtAddEft.node.runAction(cc.sequence(a0, a1a, a2, a3, a4));
-
-        //     } else {
-        //         this.txtBigNum.string = data.cumulativeAmount.toFixed(2) + "元";
-        //         this.lastNum = data.cumulativeAmount;
-        //     }
-        // } else {
-        //     this.txtBigNum.string = data.cumulativeAmount.toFixed(2) + "元";
-        //     this.lastNum = data.cumulativeAmount;
-        // }
-
-
-        // if (this.adrbArray.length < 4) {
-        //     this.adrbArray = [];
-
-        //     for (let i = 0; i < data.redMonies.length; i++) {
-        //         let obj = {
-        //             data: data.redMonies[i],
-        //             isPlayAniUpdate: gData.blessingBag.isPlayAniUpdate,
-        //             isPlayInitAni: this.isPlayInitAni
-        //         }
-        //         this.adrbArray.push(obj);
-        //     }
-        //     this.itemContent.emit('srollview-init', this.adrbArray);
-        // } else
-         {
-            this.adrbArray = [{data:1}, {data:1}, {data:1}, {data:1}, {data:1}, {data:1}, {data:1}, {data:1}, {data:1}, {data:1}];
-
-            // for (let i = 0; i < data.redMonies.length; i++) {
-            //     let obj = {
-            //         data: data.redMonies[i],
-            //         isPlayAniUpdate: gData.blessingBag.isPlayAniUpdate,
-            //         isPlayInitAni: this.isPlayInitAni
-            //     }
-            //     this.adrbArray.push(obj);
-            // }
-            //刷新
+        let data = gData.blessingBag.videoRbData;
+        if (!data) {
+            return
+        }
+                
+        this.txtRemaindAdNum.string = "<color=#FDFCF5>今日剩余次数:</c><color=#FFE533>" + data.leftVideoTimes + "</color>";
+        this.adIcon.active = data.isVideo != 1;
+
+        if (this.adrbArray.length < 4) {
+            this.adrbArray = [];
+
+            for (let i = 0; i < data.welFareTaskList.length; i++) {
+                let obj = {
+                    data: data.welFareTaskList[i],
+                    isPlayAniUpdate: gData.blessingBag.isPlayAniUpdate,
+                    isPlayInitAni: this.isPlayInitAni
+                }
+                this.adrbArray.push(obj);
+            }
             this.itemContent.emit('srollview-init', this.adrbArray);
 
-             
             cc.tween(this.node).delay(0.2).call(()=>{
                 let allItem = this.tableview.getFrontPositionItemByCount(5);
                 
@@ -201,6 +143,19 @@ export default class BlessingBag extends cc.Component {
                     cc.tween(allItem[i]).delay(i*0.1).by(0.3, {y: 600}, cc.easeSineOut()).start();
                 }
             }).start();
+        } else {
+            this.adrbArray = [];
+
+            for (let i = 0; i < data.welFareTaskList.length; i++) {
+                let obj = {
+                    data: data.welFareTaskList[i],
+                    isPlayAniUpdate: gData.blessingBag.isPlayAniUpdate,
+                    isPlayInitAni: this.isPlayInitAni
+                }
+                this.adrbArray.push(obj);
+            }
+            //刷新
+            this.itemContent.emit('srollview-update', this.adrbArray);
         }
 
         this.isPlayInitAni = false;
@@ -255,16 +210,17 @@ export default class BlessingBag extends cc.Component {
             JsbSystem.WxAuth();
             return;
         }
-        if (gData.blessingBag.videoRbData.needToWatchTheVideo != 1) {
+        if (gData.blessingBag.videoRbData.isVideo == 1) {
             //免费加进度
-            gData.blessingBag.HttpNoAdProgress();
+            gData.blessingBag.addProgress();
         } else {
-            if (gData.blessingBag.videoRbData.videoTime > 0) {
+            if (gData.blessingBag.videoRbData.leftVideoTimes > 0) {
                 mk.ad.videoAdType = VideoAdType.Fudai;
                 mk.ad.watchAd((success: boolean) => {
                     mk.console.log("watchAD:" + success);
                     if (success) {
-                        gData.adData.watchVideo(AdFun.bigCash)
+                        gData.blessingBag.addProgress();
+                        //gData.adData.watchVideo(AdFun.bigCash)
                     }
                 });
             } else {
@@ -282,7 +238,7 @@ export default class BlessingBag extends cc.Component {
      * @param num  红包金额
     */
     OpenRbPanel(type: number, num: number) {
-        this.rbPanelType = type;
+        //this.rbPanelType = type;
         // this.txtRbNum.string = num + "元";
         // this.nodeRb.active = true;
         // this.rbOpenBtn.active = true;

+ 21 - 22
assets/script/game/module/blessingBag/BlessingBagItem.ts

@@ -40,17 +40,16 @@ export default class BlessingBagItem extends cc.Component{
      * @param data item数据
      */
     public async setItemData(bData) {
-        //this.Init(bData.data, bData.isPlayAniUpdate, bData.isPlayInitAni);
+        this.Init(bData.data, bData.isPlayAniUpdate, bData.isPlayInitAni);
     }
 
     Init(data: any, isPlayAni: boolean = false, isPlayInitAni: boolean = false) {
         this.data = data;
-        this.txtNum.string = data.redMoney + "元";
-        this.txtTip.string = "<b><color=#F89800>" + data.redMoney + "元</c><color = #BB6738>提现进度</c></b>";
+        this.txtNum.string = data.redMoney/100 + "元";
+        this.txtTip.string = "<b><color=#F89800>" + data.redMoney/100 + "元</c><color = #BB6738>提现进度</c></b>";
         this.btnCashed.active = data.status == 2;
         this.btnCanCash.active = data.status == 1;
         this.btnNoFinish.active = data.status == 0;
-
         if (isPlayAni) {
             this.scheduleOnce(() => {
                 this.PlayNumAni(0.3);
@@ -67,20 +66,20 @@ export default class BlessingBagItem extends cc.Component{
                     .start();
             }, 0.3);
         } else {
-            this.txtSlider.string = data.progressRate + "%";
-            this.slider.fillRange = data.progressRate * 0.01;
-            this.lastNum = data.progressRate;
+            this.txtSlider.string = (data.progressRate*100).toFixed(2) + "%";
+            this.slider.fillRange = data.progressRate;
+            this.lastNum = data.progressRate *100;
         }
     }
 
     update(dt) {
-        //this.UpdateAniFrame(dt);
+        this.UpdateAniFrame(dt);
     }
 
     PlayNumAni(time: number) {
         this.totalTime = time;
-        this.delta = (this.data.progressRate - this.lastNum) / time;
-        this.deltaTime = time / (this.data.progressRate - this.lastNum);
+        this.delta = (this.data.progressRate*100 - this.lastNum) / time;
+        this.deltaTime = time / (this.data.progressRate*100 - this.lastNum);
         this.curValue = this.lastNum;
         this.curTime = 0;
         this.isPlayAni = true;
@@ -88,8 +87,8 @@ export default class BlessingBagItem extends cc.Component{
 
     PlayInitNumAni(time: number) {
         this.totalTime = time;
-        this.delta = (this.data.progressRate - 0) / time;
-        this.deltaTime = time / (this.data.progressRate - 0);
+        this.delta = (this.data.progressRate*100 - 0) / time;
+        this.deltaTime = time / (this.data.progressRate*100 - 0);
         this.curValue = 0;
         this.curTime = 0;
 
@@ -100,14 +99,14 @@ export default class BlessingBagItem extends cc.Component{
         if (this.curTime < this.totalTime) {
             this.curTime += this.deltaTime;
             this.curValue += this.delta * this.deltaTime;
-            if (this.curValue >= this.data.progressRate) {
-                this.curValue = this.data.progressRate;
+            if (this.curValue >= this.data.progressRate*100) {
+                this.curValue = this.data.progressRate*100;
             }
         } else {
             this.curTime = this.totalTime;
             this.unschedule(this.UpdateAni);
-            this.curValue = this.data.progressRate;
-            this.lastNum = this.data.progressRate;
+            this.curValue = this.data.progressRate*100;
+            this.lastNum = this.data.progressRate*100;
         }
         this.txtSlider.string = this.curValue.toFixed(2) + "%";
         this.slider.fillRange = this.curValue * 0.01;
@@ -118,10 +117,10 @@ export default class BlessingBagItem extends cc.Component{
             if (this.curTime < this.totalTime) {
                 this.curTime += dt;
                 this.curValue += this.delta * dt;
-                if (this.curValue >= this.data.progressRate) {
+                if (this.curValue >= this.data.progressRate *100) {
                     this.isPlayAni = false;
-                    this.curValue = this.data.progressRate;
-                    this.lastNum = this.data.progressRate;
+                    this.curValue = this.data.progressRate * 100;
+                    this.lastNum = this.data.progressRate * 100;
                 }
                 //if (this.data.redMoneyId == 1) {
                 //console.log("-->CurValue:" + this.curValue);
@@ -130,8 +129,8 @@ export default class BlessingBagItem extends cc.Component{
                 this.isPlayAni = false;
                 this.curTime = this.totalTime;
                 //this.unschedule(this.UpdateAni);
-                this.curValue = this.data.progressRate;
-                this.lastNum = this.data.progressRate;
+                this.curValue = this.data.progressRate * 100;
+                this.lastNum = this.data.progressRate * 100;
             }
             this.txtSlider.string = this.curValue.toFixed(2) + "%";
             this.slider.fillRange = this.curValue * 0.01;
@@ -153,7 +152,7 @@ export default class BlessingBagItem extends cc.Component{
     Click_CanCashBtn() {
         mk.audio.playEffect("button");
         console.log("clicked canCash");
-        gData.blessingBag.OpenTaskRbPanel(this.data.redMoney, this.data.redMoneyId, 2, this.data.redMoney);
+        gData.blessingBag.OpenTaskRbPanel( this.data.Id, this.data.redMoney);
     }
 
     Click_NoFinishBtn() {

+ 2 - 2
assets/script/mk/system/AdSystem.ts

@@ -36,9 +36,9 @@ export default class AdSystem {
             this.ifShowAd = gData.gameData.configs.ServerConfig.ifShowAd == '1';
         }
         else {
-            // this.ifShowAd = false;
+            this.ifShowAd = false;
             //test
-            this.ifShowAd = gData.gameData.configs.ServerConfig.ifShowAd == '1';
+            //this.ifShowAd = gData.gameData.configs.ServerConfig.ifShowAd == '1';
         }
 
         //初始化Topon广告SDK

+ 1 - 0
assets/script/mk/system/HttpSystem.ts

@@ -19,6 +19,7 @@ export default class HttpSystem {
         data.appVersion = gData.appData.appVersion;
         data.tfChannel = gData.appData.tfChannel;
         data.versioncfg = gData.appData.version;
+        data.tfSubChannel = 0;
         encode = mk.encrypt.encrypt(JSON.stringify(data), gData.loginData.sessionKey, gData.appData.appId);
         dataN = {
             "uin": gData.loginData.uin,