Prechádzať zdrojové kódy

提现记录类型调整,存钱罐提现bug修复

薛鸿潇 5 rokov pred
rodič
commit
a7da06651d

+ 10 - 10
assets/resources/module/cashNormal/cashNormalItem.prefab

@@ -275,8 +275,8 @@
     ],
     "_srcBlendFactor": 770,
     "_dstBlendFactor": 771,
-    "_string": "签到提现",
-    "_N$string": "签到提现",
+    "_string": "提现类型",
+    "_N$string": "提现类型",
     "_fontSize": 32,
     "_lineHeight": 40,
     "_enableWrapText": true,
@@ -333,7 +333,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 117.38,
+      "width": 122.25,
       "height": 50.4
     },
     "_anchorPoint": {
@@ -385,8 +385,8 @@
     ],
     "_srcBlendFactor": 770,
     "_dstBlendFactor": 771,
-    "_string": "2021.03.05",
-    "_N$string": "2021.03.05",
+    "_string": "2020.00.00",
+    "_N$string": "2020.00.00",
     "_fontSize": 24,
     "_lineHeight": 40,
     "_enableWrapText": true,
@@ -495,8 +495,8 @@
     ],
     "_srcBlendFactor": 770,
     "_dstBlendFactor": 771,
-    "_string": "¥0.30元",
-    "_N$string": "¥0.30元",
+    "_string": "¥0.00元",
+    "_N$string": "¥0.00元",
     "_fontSize": 40,
     "_lineHeight": 40,
     "_enableWrapText": true,
@@ -553,7 +553,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 228.52,
+      "width": 242.34,
       "height": 37.8
     },
     "_anchorPoint": {
@@ -605,8 +605,8 @@
     ],
     "_srcBlendFactor": 770,
     "_dstBlendFactor": 771,
-    "_string": "红包码:AABBCC",
-    "_N$string": "红包码:AABBCC",
+    "_string": "红包码:ABCDEFG",
+    "_N$string": "红包码:ABCDEFG",
     "_fontSize": 30,
     "_lineHeight": 30,
     "_enableWrapText": true,

+ 1 - 1
assets/script/game/component/NumberAnim.ts

@@ -18,7 +18,7 @@ export default class NumberAnim extends cc.Component {
      * @param new_value 目标值
      */
     public setValue(new_value: number, toFixed: number = 0) {
-        if (!new_value || this.targetProgress == new_value) return;
+        if (this.targetProgress == new_value) return;
         this.toFixed = toFixed;
         this.len_target = new_value.toString().length;
         this.targetProgress = new_value;

+ 34 - 9
assets/script/game/data/module/CashNormalData.ts

@@ -16,13 +16,14 @@ export class CashNormalData extends Data {
             return;
         }
         console.log(response.data);
-        if (response.data.CashStatusList) {
-            response.data.CashStatusList.forEach(item_data => {
+        if (response.data) {
+            response.data.forEach(item_data => {
                 for (const key in item_data) {
-                    item_data[key] = parseInt(item_data[key])
+                    item_data[key] = parseInt(item_data[key]);
                 }
             });
-            this.list_data = response.data.CashStatusList;
+            this.list_data = response.data;
+            this.initReceipTotalRMB();
         }
     }
     /** 数据列表 */
@@ -46,8 +47,18 @@ export class CashNormalData extends Data {
         return this._receip_total_rmb;
     }
 
-    /** 提现类型 */
-    public cash_type = ['', 'BOSS提现', '每日提现', '夺宝提现', '钱庄提现', '招募任务提现', '每日招募提现', '累计招募提现', '', '彩蛋提现', '福袋提现', '福袋提现'];
+    /**
+     * 初始化提现总数
+     */
+    private initReceipTotalRMB() {
+        let temp_total_count = 0;
+        const count = this.list_data.length;
+        for (let i = 0; i < count; i++) {
+            temp_total_count += this.list_data[i].amount;
+        }
+        this.receip_total_rmb = temp_total_count;
+    }
+
 
     /** 客户端造 假数据 */
     private initTestData() {
@@ -81,6 +92,23 @@ export class CashNormalData extends Data {
         return new_list_data;
     }
 
+    // public cash_type = ['', 'BOSS提现', '每日提现', '夺宝提现', '钱庄提现', '招募任务提现', '每日招募提现', '累计招募提现', '', '彩蛋提现', '福袋提现', '福袋提现'];
+    /** 提现类型 */
+    public cash_type = {
+        1: '红包提现',// 常规提现
+        2: '每日提现',
+        3: '夺宝提现',
+        4: '富翁银行提现',
+        5: '裂变任务提现',
+        6: '裂变每日提现',
+        7: '裂变累计提现',
+        8: '彩蛋任务提现',
+        9: '常规彩蛋任务提现',
+        10: '福袋提现',// 视频红包提现
+        11: '大额福袋',// 视频红包提现(公众号)
+        12: '存钱罐提现',
+        13: '签到提现',// 现金提现
+    }
 }
 
 /**
@@ -101,7 +129,4 @@ export type TCashList = {
     CashMode: number,
     /** 红包码 */
     withdrawalCode: string,
-}
-export enum ECashType {
-    assss = 1,
 }

+ 6 - 5
assets/script/game/data/module/PigBankData.ts

@@ -36,14 +36,15 @@ export class PigBankData extends Data {
         }
 
         if (response.CashMode == 0) {//星云打款
-            // 打开提现到账界面
-            gData.receiptNotice.receip_rmb = gData.gameData.gameData.piggyBank;
-            gData.cashNormal.receip_total_rmb += gData.receiptNotice.receip_rmb;
-            mk.ui.openPanel('module/receiptNotice/receiptNotice');
         }
         else if (response.CashMode == 1) {//公众号打款
-
         }
+
+        // 打开提现到账界面
+        gData.receiptNotice.receip_rmb = gData.gameData.gameData.piggyBank;
+        gData.cashNormal.receip_total_rmb += gData.receiptNotice.receip_rmb;
+        mk.ui.openPanel('module/receiptNotice/receiptNotice');
+        gData.gameData.gameData.piggyBank = 0;
         gData.gameData.gameData.isWithdrawable = 0;
         gData.cashNormal.getRecord();// 请求新的提现记录
 

+ 1 - 1
assets/script/game/game/Game.ts

@@ -112,7 +112,7 @@ export default class Game extends cc.Component {
         // this.lbl_rmb.node.getComponent('NumberAnim').setValue(gData.gameData.gameData.piggyBank);
 
         const new_count = gData.gameData.gameData.piggyBank / 100;
-        if (new_count != 0 && this.lbl_rmb.string != new_count.toFixed(2)) {
+        if (this.lbl_rmb.string != new_count.toFixed(2)) {
             this.lbl_rmb.node.getComponent(NumberAnim).setValue(parseFloat(new_count.toFixed(2)), 2);
         }
         gData.gameData.init_coin = false;

+ 1 - 1
assets/script/game/module/cashNormal/CashNormal.ts

@@ -35,7 +35,7 @@ export default class CashNormal extends cc.Component {
      * 初始化累计提现
      */
     private initTotal() {
-        this.lbl_rmb_total.string = '¥' + gData.cashNormal.receip_total_rmb + '元';
+        this.lbl_rmb_total.string = '¥' + (gData.cashNormal.receip_total_rmb / 100).toFixed(2) + '元';
     }
 
     /**

+ 2 - 2
assets/script/game/module/cashNormal/CashNormalItem.ts

@@ -31,9 +31,9 @@ export default class CashNormalItem extends cc.Component {
     }
     private initStyle(item_data: TCashList) {
 
-        this.lbl_cash_type.string = gData.cashNormal.cash_type[item_data.cashType];
+        this.lbl_cash_type.string = gData.cashNormal.cash_type[item_data.cashType] || '未知类型';
         this.lbl_cash_time.string = mk.time.getNowDayString(item_data.applyTime * 1000);
         this.lbl_red_ma.string = item_data.withdrawalCode ? '红包码:' + item_data.withdrawalCode : '';
-        this.lbl_rmb_value.string = '¥' + item_data.amount + '元';
+        this.lbl_rmb_value.string = '¥' + (item_data.amount / 100).toFixed(2) + '元';
     }
 }