index.html 6.82 KB
<!DOCTYPE html>
<html lang="en">

<head>
    <meta name="viewport" content="user-scalable=0, width=device-width, initial-scale=1.0,  minimum-scale=1.0, maximum-scale=1.0">
    <meta content="telephone=no" name="format-detection" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>寿光物流园六周年庆典</title>
    <link rel="stylesheet" href="css/topic.css">
</head>

<body>
    <div class="m-page"></div>
    <script src="js/jquery-2.1.3.min.js"></script>
    <script src="js/underscore-min.js"></script>
    <script type="text/template" id="contentTpl">
        <%if(wap){%>
            <header class="m-header header-light">
                <div class="head">
                    <a href="javascript:history.go(-1);" class="lt-bar m-icon icon-back">返回</a>
                    <h1>寿光物流园六周年庆典</h1>
                    <!-- <a href="#" class="rt-bar text">分享</a> -->
                </div>
            </header>
        <%}%>
        <div class="nf_main">
            <!-- 顶部banner -->
            <div class="section"><img src="images/main/topic_01.jpg" alt="寿光物流园六周年庆典"></div>
            <!-- 商品 -->
            <div class="section">
                <%_.each(products, function(product, index){%>
                    <a href="<%=wap ? 'http://m.nong12.com/goods/getIntroductionPageById.do?pid='+product.id : 'http://www.nong12.com/product/'+product.id+'.html'%>" title="<%=product.title%>"><img src="images/main/topic_0<%=index+2%>.jpg" alt="<%=product.title%>"></a>
                <%})%>
            </div>
            <!-- 口碑店铺 -->
            <div class="section"><img src="images/main/topic_10.jpg" alt=""></div>
            <div class="section store">
                <ul>
                    <%_.each(stores, function(store, index){%>
                        <li>
                            <a href="<%='http://m.nong12.com/shop/storedetail.do?id='+store.id%>" title="<%=store.title%>"><img src="images/product/p_0<%=index+1%>.jpg" alt="<%=store.title%>"></a>
                        </li>
                    <%})%>
                </ul>
            </div>
            <!-- 热门批发店铺 -->
            <div class="section"><img src="images/main/topic_12.jpg" alt=""></div>
            <div class="section footer">
                <dl class="market clearfix">
                    <dt>
                        <a href="http://static.nong12.com/static/app.html"><img src="images/main/code.jpg" alt=""></a>
                    </dt>
                    <%_.each(markets, function(market){%>
                        <dd><a href="http://m.nong12.com/goods/searchByKeyword.do?type=0&key=<%=market.key%>"><%=market.title%></a></dd>
                    <%})%>
                </dl>
            </div>
        </div>
        <a href="#" class="m-to-top"></a>
    </script>
    <script>
    $(function() {
        var Topic = {
            wap: false,
            data: {
                products: [{
                    "id": "1000031584",
                    "title": "白萝卜 产地 山东青岛市"
                }, {
                    "id": "1000028380",
                    "title": "甘蓝产地山东潍坊市"
                }, {
                    "id": "1000006850",
                    "title": "大冬瓜 产地广东"
                }, {
                    "id": "1000000054",
                    "title": "白菜花产地福建厦门市"
                }, {
                    "id": "1000033453",
                    "title": "西兰花 产地 浙江"
                }, {
                    "id": "1000009812",
                    "title": "南瓜产地山东潍坊市"
                }, {
                    "id": "1000027298",
                    "title": "芋头 产地 山东潍坊市"
                }, {
                    "id": "1000015994",
                    "title": "尖椒产地山东潍坊市"
                }],
                stores: [{
                    id:1139,
                    title: '寿光小毅蔬菜批发'
                },{
                    id:1017,
                    title: '马氏白萝卜'
                },{
                    id:1071,
                    title: '寿光利财蔬菜批发'
                },{
                    id:1014,
                    title: '寿光小纪果蔬有限公司'
                },{
                    id:4424,
                    title: '寿光葛兰蔬菜'
                },{
                    id:3951,
                    title: '寿光王有才蔬菜'
                },{
                    id:1013,
                    title: '寿光德刚菜业'
                },{
                    id:5592,
                    title: '寿光夏伟华蒜苔专卖蔬菜公司'
                }],
                markets: [{
                    'key':'%E7%89%A1%E4%B8%B9%E6%B1%9F',
                    title: '牡丹江牡达'
                },{
                    'key':'%E8%B4%B5%E9%98%B3',
                    title: '贵阳地利'
                },{
                    'key':'%E6%B2%88%E9%98%B3',
                    title: '沈阳地利'
                },{
                    'key':'%%E5%93%88%E5%B0%94%E6%BB%A8',
                    title: '哈尔滨哈达'
                },{
                    'key':'%E5%9B%9B%E5%B7%9D',
                    title: '四川聚合'
                },{
                    'key':'%E9%BD%90%E9%BD%90%E5%93%88%E5%B0%94',
                    title: '齐齐哈尔哈达'
                }]
            },
            initialize: function() {
                this.bindEvents();
                this.render();
            },
            bindEvents: function() {
                $(document).on('touchstart', '.m-to-top', function(e) {
                    e.preventDefault();
                    $('body').animate({
                        scrollTop: 0
                    }, 300);
                });
            },
            getParameterByName: function(name) {
                name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
                var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
                    results = regex.exec(location.search);
                return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
            },
            render: function() {
                var _this = this,
                    source = this.getParameterByName('source');

                if (source != '' && source.length > 0) {
                    if (source && source.toLowerCase() == 'wap') {
                        this.wap = true;
                    }
                }
                this.data.wap = this.wap;
                $('.m-page').html(_.template($('#contentTpl').html())(this.data));
            }
        };
        Topic.initialize();
    });
    </script>
</body>

</html>