index.html 13.7 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/banner_01.jpg" alt="优品惠聚贵阳">
            </div>

            <div class="section feature background-green">
              <%_.each(features, function(feature, index){%>
                  <a href="<%=wap ? 'http://m.nong12.com/goods/getIntroductionPageById.do?pid='+feature.id : 'http://www.nong12.com/product/'+feature.id+'.html'%>" title="<%=feature.title%>"><img src="images/product/p_0_<%=index%>.jpg" alt="<%=feature.title%>"></a>
              <%})%>
            </div>

            <div class="section">
              <img src="images/main/header_01.jpg" alt="源于大自然的馈赠--优品汇聚贵阳">
            </div>

            <div class="section product background-green">
                <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/p_1_<%=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/header_02.jpg" alt="源于大自然的馈赠--优品汇聚贵阳"></a>
            </div>

            <div class="section product background-brown">
                <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/p_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/header_03.jpg" alt="源于大自然的馈赠--优品汇聚贵阳"></a>
            </div>

            <div class="section product background-pink">
                <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/p_3_<%=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=875"><img src="images/main/header_04.jpg" alt="源于大自然的馈赠--优品汇聚贵阳"></a>
            </div>

            <div class="section product background-deep-brown">
                <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/p_4_<%=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/header_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/p_5_<%=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/header_06.jpg" alt="源于大自然的馈赠--优品汇聚贵阳"></a>
            </div>
            <div class="section">
              <img src="images/main/header_07.jpg" alt="源于大自然的馈赠--优品汇聚贵阳">
            </div>

            <div class="section store">
                <%_.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">
                <a href="http://m.nong12.com/features/category.do?id=0&rid=875" title=""><img src="images/main/header_07.jpg" alt="优品惠聚贵阳"></a>
            </div>
            <div class="section">
                <img src="images/main/header_08.png" 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": "1000035401",
                    "title": "清热润燥化痰止咳"
                },{
                    "id": "1000033847",
                    "title": "品质鲜嫩营养丰富"
                },{
                    "id": "1000028869",
                    "title": "纯甜可口汁多肉嫩"
                },{
                    "id": "1000026170",
                    "title": "补气养血健脑安神"
                }],
                products:[
                    [{
                        "id": "1000049360",
                        "title": "蛇果 产地 美国"
                    },{
                        "id": "1000032288",
                        "title": "金枕榴莲 产地 泰国 "
                    },{
                        "id": "1000042993",
                        "title": "橙子 产地 南非"
                    },{
                        "id": "1000050859",
                        "title": "凤梨 产地台湾台北市"
                    },{
                        "id": "1000045249",
                        "title": "红心火龙果产地越南"
                    },{
                        "id": "1000045254",
                        "title": "牛油果 产地 美国"
                    },{
                        "id": "1000036394",
                        "title": "圣女果产地辽宁鞍山"
                    },{
                        "id": "1000051413",
                        "title": "玖红瓜产地山东"
                    }],
                    [{
                      "id": "1000035309",
                        "title": "茶树菇产地福建	"
                    },{
                        "id": "1000034813",
                        "title": "杏鲍菇产地贵州"
                    },{
                        "id": "1000034799",
                        "title": "蘑菇产地贵州"
                    },{
                        "id": "1000028440",
                        "title": "香菇 产地 河南"
                    }],
                    [{
                        "id": "1000048859",
                        "title": "红玫瑰产地美国"
                    },{
                        "id": "1000026162",
                        "title": "香蜜杨桃 产地海南"
                    },{
                        "id": "1000041069",
                        "title": "红提 产地贵州"
                    },{
                        "id": "1000029879",
                        "title": "山楂 产地山西	"
                    },
                    {
                        "id": "1000014330",
                        "title": "金桔 产地贵阳	"
                    },{
                        "id": "1000030883",
                        "title": "红心柚子 产地湖南"
                    },{
                        "id": "1000033951",
                        "title": "香蕉 产地云南西双版纳"
                    },{
                        "id": "1000026307",
                        "title": "蒙自石榴产地云南红河"
                    }],
                    [{
                        "id": "1000027058",
                        "title": "科果牌响水石板大米"
                    },{
                        "id": "1000034851",
                        "title": "鸡蛋 产地 云南曲靖市"
                    },{
                        "id": "1000040362",
                        "title": "芝麻油 产地贵州贵阳"
                    },{
                        "id": "1000044548",
                        "title": "干辣椒 产地贵州遵义"
                    }],
                    [{
                        "id": "1000049557",
                        "title": "瓜子 产地 内蒙古"
                    },{
                        "id": "1000040228",
                        "title": "板栗 产地 云南"
                    },{
                        "id": "1000049561",
                        "title": "开心果 产地 云南保山"
                    },{
                        "id": "1000039680",
                        "title": "花生 产地 贵州贵阳"
                    }]
                ],
                stores: [{
                    id:1385,
                    title: '名果汇'
                },{
                    id:110803,
                    title: '国洪梅鲜果店科果贵州总经销'
                },{
                    id:110517,
                    title: '贵阳易洁鲜果行'
                },{
                    id:1578,
                    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',
                    title: '沈阳地利'
                },{
                    'key':'%%E5%93%88%E5%B0%94%E6%BB%A8',
                    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>