Explorar el Código

修复签到成功后界面没刷新问题

kaka hace 5 años
padre
commit
19ee6e3aad

+ 2 - 3
assets/script/game/module/sign/Sign.ts

@@ -97,10 +97,9 @@ export default class Sign extends cc.Component {
     /**
      * 拿奖励
      */
-    private getReward() {
+    private async getReward() {
         // 完成展示
-        gData.sign.signComplete();
-
+        await gData.sign.signComplete();
         const index_old = gData.sign.getItemIndexByCanSign();
         // 指定条目数据刷新
         this.tableview.resetItemData(index_old, gData.sign.list_data[index_old]);

BIN
build/jsb-link/assets/main/index.jsc


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
build/jsb-link/assets/resources/config.json


+ 136 - 12
build/jsb-link/js backups (useful for debugging)/main.index.js

@@ -18500,11 +18500,123 @@ t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, new n(
 var i, a = arguments.length, r = a < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, n) : o;
 if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(t, e, n, o); else for (var c = t.length - 1; c >= 0; c--) (i = t[c]) && (r = (a < 3 ? i(r) : a > 3 ? i(e, n, r) : i(e, n)) || r);
 return a > 3 && r && Object.defineProperty(e, n, r), r;
+}, r = this && this.__awaiter || function(t, e, n, o) {
+return new (n || (n = Promise))(function(i, a) {
+function r(t) {
+try {
+s(o.next(t));
+} catch (t) {
+a(t);
+}
+}
+function c(t) {
+try {
+s(o.throw(t));
+} catch (t) {
+a(t);
+}
+}
+function s(t) {
+t.done ? i(t.value) : (e = t.value, e instanceof n ? e : new n(function(t) {
+t(e);
+})).then(r, c);
+var e;
+}
+s((o = o.apply(t, e || [])).next());
+});
+}, c = this && this.__generator || function(t, e) {
+var n, o, i, a, r = {
+label: 0,
+sent: function() {
+if (1 & i[0]) throw i[1];
+return i[1];
+},
+trys: [],
+ops: []
+};
+return a = {
+next: c(0),
+throw: c(1),
+return: c(2)
+}, "function" == typeof Symbol && (a[Symbol.iterator] = function() {
+return this;
+}), a;
+function c(t) {
+return function(e) {
+return s([ t, e ]);
+};
+}
+function s(a) {
+if (n) throw new TypeError("Generator is already executing.");
+for (;r; ) try {
+if (n = 1, o && (i = 2 & a[0] ? o.return : a[0] ? o.throw || ((i = o.return) && i.call(o), 
+0) : o.next) && !(i = i.call(o, a[1])).done) return i;
+(o = 0, i) && (a = [ 2 & a[0], i.value ]);
+switch (a[0]) {
+case 0:
+case 1:
+i = a;
+break;
+
+case 4:
+r.label++;
+return {
+value: a[1],
+done: !1
+};
+
+case 5:
+r.label++;
+o = a[1];
+a = [ 0 ];
+continue;
+
+case 7:
+a = r.ops.pop();
+r.trys.pop();
+continue;
+
+default:
+if (!(i = r.trys, i = i.length > 0 && i[i.length - 1]) && (6 === a[0] || 2 === a[0])) {
+r = 0;
+continue;
+}
+if (3 === a[0] && (!i || a[1] > i[0] && a[1] < i[3])) {
+r.label = a[1];
+break;
+}
+if (6 === a[0] && r.label < i[1]) {
+r.label = i[1];
+i = a;
+break;
+}
+if (i && r.label < i[2]) {
+r.label = i[2];
+r.ops.push(a);
+break;
+}
+i[2] && r.ops.pop();
+r.trys.pop();
+continue;
+}
+a = e.call(t, r);
+} catch (t) {
+a = [ 6, t ];
+o = 0;
+} finally {
+n = i = 0;
+}
+if (5 & a[0]) throw a[1];
+return {
+value: a[0] ? a[1] : void 0,
+done: !0
+};
+}
 };
 Object.defineProperty(n, "__esModule", {
 value: !0
 });
-var r = t("../../../mk/system/JsbSystem"), c = t("../../data/AdData"), s = t("../../data/GameData"), l = cc._decorator, u = l.ccclass, p = l.property, d = function(t) {
+var s = t("../../../mk/system/JsbSystem"), l = t("../../data/AdData"), u = t("../../data/GameData"), p = cc._decorator, d = p.ccclass, h = p.property, f = function(t) {
 i(e, t);
 function e() {
 var e = null !== t && t.apply(this, arguments) || this;
@@ -18539,23 +18651,35 @@ e.prototype.clickReceiveReward = function() {
 mk.audio.playEffect("button");
 if (1 != gData.gameData.gameData.isSignInToday && gData.sign.haveSignDay()) {
 var t = gData.gameData.gameData.signInDay;
-if (gData.sign.c_sign[t].rewardType !== s.RewardType.rmb || gData.loginData.isAuth) {
-mk.ad.videoAdType = s.VideoAdType.Sign;
+if (gData.sign.c_sign[t].rewardType !== u.RewardType.rmb || gData.loginData.isAuth) {
+mk.ad.videoAdType = u.VideoAdType.Sign;
 mk.ad.watchAd(function(e) {
 mk.console.log("watchAD:" + e);
 if (e) {
-gData.adData.watchVideo(c.AdFun.sign);
-gData.sign.c_sign[t].rewardType === s.RewardType.rmb && mk.data.sendDataEvent(s.DataEventId.signWithDrawal, "签到提现成功");
+gData.adData.watchVideo(l.AdFun.sign);
+gData.sign.c_sign[t].rewardType === u.RewardType.rmb && mk.data.sendDataEvent(u.DataEventId.signWithDrawal, "签到提现成功");
 mk.ad.destroyNativeAd();
 }
 });
-} else r.default.WxAuth();
+} else s.default.WxAuth();
 }
 };
 e.prototype.getReward = function() {
-gData.sign.signComplete();
-var t = gData.sign.getItemIndexByCanSign();
+return r(this, void 0, void 0, function() {
+var t;
+return c(this, function(e) {
+switch (e.label) {
+case 0:
+return [ 4, gData.sign.signComplete() ];
+
+case 1:
+e.sent();
+t = gData.sign.getItemIndexByCanSign();
 this.tableview.resetItemData(t, gData.sign.list_data[t]);
+return [ 2 ];
+}
+});
+});
 };
 e.prototype.initBtnStyle = function() {
 if (0 == gData.gameData.gameData.isSignInToday && gData.sign.haveSignDay()) {
@@ -18572,17 +18696,17 @@ e.prototype.onClickClose = function() {
 mk.ad.destroyNativeAd();
 mk.ad.checkShowInterByChance();
 };
-a([ p({
+a([ h({
 type: cc.ScrollView,
 displayName: "滚动视图"
 }) ], e.prototype, "scroll_view", void 0);
-a([ p({
+a([ h({
 type: cc.Animation,
 displayName: "按钮_动画"
 }) ], e.prototype, "anim_btn", void 0);
-return a([ u ], e);
+return a([ d ], e);
 }(cc.Component);
-n.default = d;
+n.default = f;
 cc._RF.pop();
 }, {
 "../../../mk/system/JsbSystem": "JsbSystem",

+ 2 - 2
packages-hot-update/cfg.json

@@ -13,7 +13,7 @@
         "https://xcx-box.oss-cn-hangzhou.aliyuncs.com/hotgame/EasyEliminateTestT/baseRemote/",
         "https://xcx-box.oss-cn-hangzhou.aliyuncs.com/hotgame/EasyEliminateTest/baseRemoteTest/"
     ],
-    "buildTime": 1628761859347,
-    "genTime": 1628761859347,
+    "buildTime": 1628826489204,
+    "genTime": 1628826489204,
     "genVersion": null
 }

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio