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

feat:引到广告位,无数据时候不展示

zhangsiya 11 місяців тому
батько
коміт
2577652c2d

+ 2 - 1
src/web/staticres/js/guide-intro-dialog.js

@@ -12,13 +12,14 @@ function GuideIntroDialog () {
                 codes: codes
             }
             _this.$dialog.modal('hide')
+           _this.$dialog.find('.content-iframe').attr('src', '')
             $.ajax({
                 type: 'post',
                 url: '/publicapply/free/getJyAdList',
                 contentType: 'application/json',
                 data: JSON.stringify(params),
                 success: function (r) {
-                    if (r.error_code === 0 && r.data && r.data["pc-guide"] && r.data["pc-guide"].length > 0) {
+                    if (r.error_code === 0 && r.data && r.data["pc-guide"] && $.isArray(r.data[_this.ad]) && r.data["pc-guide"].length > 0) {
                         _this.$dialog.find('.content-iframe').attr('src', _this.iframeUrl)
                         _this.$dialog.modal('show')
                     }

+ 1 - 1
src/web/templates/frontRouter/pc/pure/sess/guide-intro-dialog-content.html

@@ -125,7 +125,7 @@
                         contentType: 'application/json',
                         data: JSON.stringify(params),
                         success: function (r) {
-                            if (r.error_code === 0 && r.data && $.isArray(r.data[_this.ad]) && r.data[_this.ad]) {
+                            if (r.error_code === 0 && r.data && $.isArray(r.data[_this.ad]) && r.data[_this.ad] && r.data[_this.ad].length > 0) {
                                 var adList = r.data[_this.ad]
                                 _this.imageList = adList
                             }