ソースを参照

提现bug修复

薛鸿潇 5 年 前
コミット
664e055d22

+ 6 - 3
assets/script/game/data/module/RedBagCashData.ts

@@ -35,7 +35,7 @@ export class RedBagCashData extends Data {
     /** 配置表数据 */
     public c_data: Array<CDataType> = [];
 
-    private _cash_bar: number = 0;
+    private _cash_bar: number = 1;
     /** 提现进度 */
     set cash_bar(value: number) {
         this._cash_bar = value;
@@ -59,8 +59,11 @@ export class RedBagCashData extends Data {
         let response = await mk.http.sendData('cashUsual', data);
         if (response.errcode != 0) {
             mk.tip.pop(response.errmsg);
+            mk.console.logSingle('提现index', cash_index);
+            mk.console.logSingle('提现错误内容:', response);
             return;
         }
+        cc.log('红包提现成功')
         let r_data = response.data;
         if (r_data.CashMode == 0) {//星云打款
         }
@@ -90,7 +93,7 @@ export class RedBagCashData extends Data {
         const l_count = this.c_data.length;
         let index = 0;
         for (let i = 0; i < l_count; i++) {
-            if (this.c_data[index].index <= gData.redBagCash.cash_bar) {
+            if (this.c_data[index].index < gData.redBagCash.cash_bar) {
                 let item_data = this.c_data.splice(index, 1);
                 this.c_data.push(item_data[0]);
                 index--;
@@ -144,7 +147,7 @@ export class RedBagCashData extends Data {
         const redbag_count = gData.gameData.gameData.redMoney;
         const d_count = this.c_data.length;
         for (let i = 0; i < d_count; i++) {
-            if (this.c_data[i].index <= gData.redBagCash.cash_bar) continue;// 已提现
+            if (this.c_data[i].index < gData.redBagCash.cash_bar) continue;// 已提现
             if (redbag_count >= this.c_data[i].type_value) return true;// 可提现
         }
         return false;

+ 1 - 2
assets/script/game/module/redBagCash/RedBagCashItem.ts

@@ -48,7 +48,7 @@ export default class RedBagCashItem extends cc.Component {
         rmb_value = rmb_value > 1 ? rmb_value : parseFloat(rmb_value.toFixed(2))
         this.lbl_rmb_value.string = rmb_value + '元';
 
-        if (this.item_data.index <= gData.redBagCash.cash_bar) {
+        if (this.item_data.index < gData.redBagCash.cash_bar) {
             // 已提现
             this.node_none.active = true;
             this.node_lock.active = false;
@@ -78,7 +78,6 @@ export default class RedBagCashItem extends cc.Component {
             return;
         }
         gData.redBagCash.cashOP();
-        cc.log('红包现成功')
     }
 
 }