index.html 12.2 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">
              <a href="http://m.nong12.com/features/category.do?id=0&shopSource=1&rid=875">
                <img src="images/main/banner_01.jpg" alt="寒风来袭--暖心哈达">
              </a>
            </div>


            <div class="section product background-red">
                <ul>
                    <%_.each(products[0], function(product, index){%>
                        <li>
                        <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/product/product_0_<%=index%>.jpg" alt="<%=product.title%>"></a>
                        </li>
                    <%})%>
                </ul>
            </div>

            <div class="section">
                <a href="http://m.nong12.com/features/category.do?id=0&shopSource=1&rid=571"><img src="images/main/banner_02.jpg" alt="寒风来袭--暖心哈达"></a>
            </div>


            <div class="section product background-green">
                <ul>
                    <%_.each(products[1], function(product, index){%>
                        <li>
                        <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/product/product_1_<%=index%>.jpg" alt="<%=product.title%>"></a>
                        </li>
                    <%})%>
                </ul>
            </div>

            <div class="section">
                <a href="http://m.nong12.com/features/category.do?id=0&rid=961"><img src="images/main/banner_03.jpg" alt="寒风来袭--暖心哈达"></a>
            </div>


            <div class="section product background-blue">
                <ul>
                    <%_.each(products[2], function(product, index){%>
                        <li>
                        <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/product/product_2_<%=index%>.jpg" alt="<%=product.title%>"></a>
                        </li>
                    <%})%>
                </ul>
            </div>

            <div class="section">
                <a href="http://m.nong12.com/features/category.do?id=0"><img src="images/main/banner_04.jpg" alt="寒风来袭--暖心哈达"></a>
            </div>

            <div class="section product background-orange">
                <ul>
                    <%_.each(products[3], function(product, index){%>
                        <li>
                        <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/product/product_3_<%=index%>.jpg" alt="<%=product.title%>"></a>
                        </li>
                    <%})%>
                </ul>
            </div>

            <div class="section">
                <a href="http://m.nong12.com/features/category.do?id=0&rid=1009"><img src="images/main/banner_05.jpg" alt="寒风来袭--暖心哈达"></a>
            </div>

            <div class="section product background-deep-red">
                <ul>
                    <%_.each(products[4], function(product, index){%>
                        <li>
                        <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/product/product_4_<%=index%>.jpg" alt="<%=product.title%>"></a>
                        </li>
                    <%})%>
                </ul>
            </div>

            <div class="section">
                <a href="http://m.nong12.com/shop/storelist.do?type=0&key=%E5%BA%97%E9%93%BA"><img src="images/main/banner_06.jpg" alt="寒风来袭--暖心哈达"></a>
            </div>


            <div class="section store background-light-blue">
                <%_.each(stores, function(store, index){%>
                    <a href="<%='http://m.nong12.com/shop/storedetail.do?id='+store.id%>" title="<%=store.title%>"><img src="images/store/store_0_<%=index%>.jpg" alt="<%=store.title%>"></a>
                <%})%>
            </div>


            <div class="section">
                <img src="images/main/banner_07.jpg" alt="鲜香优质--沈阳专场">
            </div>

            <div class="section market">
                <dl class="clearfix">
                    <%_.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 class="section footer">
                <a href="http://static.nong12.com/static/app.html" title="app下载"><img src="images/main/footer.jpg" alt="app下载"></a>
            </div>
        </div>
        <a href="#" class="m-to-top"></a>
    </script>
    <script>
    $(function() {
        var Topic = {
            wap: false,
            data: {
                // features:[{
                //     "id": "1000025750",
                //     "title": "沃特芒产地四川攀枝花"
                // },{
                //     "id": "1000025603",
                //     "title": "柚子 产地 福建"
                // },{
                //     "id": "1000030238",
                //     "title": "蜜桔"
                // }],
                products:[
                    [{
                        "id": "1000023118",
                        "title": "火龙果"
                    },{
                        "id": "1000025635",
                        "title": "奇异果"
                    },{
                        "id": "1000030579",
                        "title": "香梨"
                    },{
                        "id": "1000055966",
                        "title": "苹果"
                    },{
                        "id": "1000047580",
                        "title": "金桔"
                    },{
                        "id": "1000055973",
                        "title": "蜜瓜"
                    }],
                    [{
                        "id": "1000056016",
                        "title": "菜花"
                    },{
                        "id": "1000056004",
                        "title": "穿心莲"
                    },{
                        "id": "1000056019",
                        "title": "百合"
                    },{
                        "id": "1000053925",
                        "title": "黄瓜"
                    },{
                        "id": "1000053680",
                        "title": "秋葵"
                    },{
                        "id": "1000055539",
                        "title": "西红柿"
                    }],
                    [{
                        "id": "1000054113",
                        "title": "冰鲜海参"
                    },{
                        "id": "1000054115",
                        "title": "冰鲜鲍鱼"
                    },{
                        "id": "1000053615",
                        "title": "扇贝"
                    },{
                        "id": "1000032531",
                        "title": "上脑"
                    },{
                        "id": "1000028775",
                        "title": "肋条"
                    },{
                        "id": "1000032541",
                        "title": "牛腩"
                    }],
                    [{
                        "id": "1000034601",
                        "title": "大米"
                    },{
                        "id": "1000019890",
                        "title": "酱油"
                    }],
                    [{
                        "id": "1000026847",
                        "title": "和田枣"
                    },{
                        "id": "1000046912",
                        "title": "芒果干"
                    }]
                ],
                stores: [{
                    id:22785,
                    title: '肖军水果批发总汇'
                },{
                    id:24883,
                    title: '史婷婷果业'
                },{
                    id:18137,
                    title: '绿晟园基地'
                },{
                    id:18029,
                    title: '三文鱼海川时代鲜'
                },{
                    id:24239,
                    title: 'hy牛羊肉'
                },{
                    id:24649,
                    title: '哈尔滨尚瑞昌商贸有限公司'
                },{
                    id:27631,
                    title: '哈达杨波干果批发行'
                },{
                    id:30319,
                    title: '哈达昌盛调料'
                },{
                    id:114855,
                    title: '娟子吃货店'
                }],

                markets: [{
                    'key':'%E5%AF%BF%E5%85%89',
                    title: '山东寿光地利'
                },{
                    'key':'%E7%89%A1%E4%B8%B9%E6%B1%9F',
                    title: '牡丹江牡达'
                },{
                    'key':'%E9%BD%90%E9%BD%90%E5%93%88%E5%B0%94',
                    title: '齐齐哈尔哈达'
                },{
                    'key':'%E6%B2%88%E9%98%B3%E5%9C%B0%E5%88%A9',
                    title: '沈阳地利'
                },{
                    'key':'%E8%B4%B5%E9%98%B3',
                    title: '贵阳地利'
                },{
                    'key':'%E5%9B%9B%E5%B7%9D',
                    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>