seaJs 模块中的html怎么绑定后台数据显示

zy2419 zy2419 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
seajs如何绑定后台数据啊
jsp页面中加载了seajs

window.onload = function() {
seajs.use('campus', function(campus) {});
}

campus.js 如下

define(function(require, exports, module) {
var iCard = require('iCard');
var Acard = new iCard({
id: 'app',
maxDistance: 50,
firstEl: '.view-1',
secondEl: '.view-2',
thirdEl: '.view-3',
gotoDuration: 0.3,
endDuration: 0.3,
resetDuration: 0.1,
fliterClass: '.detail-con',
swipeDirection: 'v',
AnimateType: 'ZakerSlide',
gotoAnimateType: 'ZakerSlide'
});

var card_1 = {
id: 'card_1',
html: '<section class="scene-5 scene">\
<div class="bg5">\
<section class="mapStore">\
<div class="mapTit"><img src="imgs/mapStore/map_tit.png"></div>\
</section>\
<section id="picScroll" class="picScroll">\
<div class="hd">\
<ul></ul>\
</div>\
<div class="bd">\
<ul>\
<li><div><img src="imgs/mapStore/cities/city01.jpg" alt=""/></div><p>上海</p><p>SHANG HAI</p></li>\
<li><div><img src="imgs/mapStore/cities/city02.jpg" alt=""/></div><p>北京</p><p>BEI JING</p></li>\
<li><div><img src="imgs/mapStore/cities/city03.jpg" alt=""/></div><p>广州</p><p>GUANG ZHOU</p></li>\
<li><div><img src="imgs/mapStore/cities/city04.jpg" alt=""/></div><p>深圳</p><p>SHEN ZHEN</p></li>\
<li><div><img src="imgs/mapStore/cities/city05.jpg" alt=""/></div><p>苏州</p><p>SU ZHOU</p></li>\
<li><div><img src="imgs/mapStore/cities/city06.jpg" alt=""/></div><p>南京</p><p>NAN JING</p></li>\
</ul>\
<ul>\
<li><div><img src="imgs/mapStore/cities/city07.jpg" alt=""/></div><p>杭州</p><p>HANG ZHOU</p></li>\
<li><div><img src="imgs/mapStore/cities/city08.jpg" alt=""/></div><p>宁波</p><p>NING BO</p></li>\
<li><div><img src="imgs/mapStore/cities/city09.jpg" alt=""/></div><p>温州</p><p>WEN ZHOU</p></li>\
</ul>\
</div>\
<span class="triangle_left"><img src="imgs/mapStore/triangle_l.png"/></span>\
<span class="triangle_right"><img src="imgs/mapStore/triangle_r.png"/></span>\
</section>\
</div>\
<div class="triangle"><img src="imgs/mapStore/triangle.png"/></div>\
<div id="map">\
<span class="about_exit"></span>\
<img src="imgs/mapStore/map.jpg" alt="" style="width: 100%"/>\
</div>\
</section>',
onload: function(card) {
TouchSlide({
slideCell:"#picScroll",
titCell:".hd ul",
effect:"leftLoop",
autoPage:true,
switchLoad:"_src"
});
$(".bd li").tap(function(){
$("#map").show().addClass("fadeIn");
})
$(".about_exit").bind("tap",function(){
$("#map").addClass("fadeOut");
setTimeout(function() {
$("#map").hide().removeClass("fadeIn fadeOut");
}, 800);
})
$(".refer_popup,#map").bind("touchmove",function(e){
e.preventDefault();
e.stopPropagation();
});
},
onLeft: function(card) {
}
};
.....

window.Acard = Acard;
Acard.add(card_1).add(card_2).add(card_3).add(card_4).add(card_5).add(card_6).add(card_7).add(card_8).init('card_1');

我要如何将card_1中的城市通过后台传过来的数据进行遍历输出啊?包括图片地址等。
...全文

相关推荐

评论
收藏 已收藏
分享
返回顶部
zy2419
JavaScript 87,983 成员 224,681 内容