Переглянути джерело

:bug: 修复无数据显示正在突击图片闪屏问题

zhanghe 6 роки тому
батько
коміт
c3ec59b7f5

+ 1 - 1
src/res/tpl/DataBuildingScene.tpl

@@ -1,3 +1,3 @@
 <div id="DataBuildingScene" fe-role="Switch">
-    <img id="building-pic-bg"  src="http://ljimgs.ai160.com/2b/app_resource/data_building.jpg" alt="数据正在建设中...">
+    <img id="building-pic-bg"  src="assets/img/default_bg.jpg" alt="">
 </div>

+ 3 - 1
src/stage/index/scene/DataBuildingScene.js

@@ -8,7 +8,9 @@ class DataBuildingScene extends scene {
     onCreate(data) {
   		this.setContentView(require('../../../res/tpl/DataBuildingScene.tpl'), {}, 'DataBuildingScene', {}, () => {
         if (data && data.bgUrl) {
-          document.getElementById('building-pic-bg').setAttribute('src', Consts.IMG_PATH + '/' + data.bgUrl);
+            document.getElementById('building-pic-bg').setAttribute('src', Consts.IMG_PATH + '/' + data.bgUrl);
+        } else {
+            document.getElementById('building-pic-bg').setAttribute('src', Consts.DATA_BUILDING);
         }
       });
     }

+ 3 - 0
src/util/Consts.js

@@ -14,6 +14,9 @@ class Consts {
 Consts.IMG_PATH = 'https://efunimgs.ai160.com';
 Consts.VIDEO_PATH = 'https://efunvideo.ai160.com';
 
+//数据正在突击中图片地址
+Consts.DATA_BUILDING = 'http://ljimgs.ai160.com/2b/app_resource/data_building.jpg';
+
 //图片/视频资源类型代号
 Consts.TYPE_VIDEO = 0;
 Consts.TYPE_IMAGE = 3;