admin
2018-12-25 4cb15e222cd7d099d533ccbeb7f9a8cd99bf180c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>栏目详情</title>
        <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
        <!--<link rel="stylesheet" type="text/css" href="../css/style.css"/>-->
    </head>
    <style>
        h1,
h2,
h3,
h4,
h5,
h6,
strong{
    font-weight: normal;
}
h1,
h2,
h3,
h4,
h5,
h6,
p,
ul,
ol{
    margin: 0;
    font-weight: normal;
}
ul,
ol{
    list-style: none;
    padding: 0;
}
a {
    text-decoration: none;
    color: #777777;
    font-size: 12px;
}
a:focus{
    background: transparent;
}
a:focus {
  outline: none;
}
a:active{
     -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
body{
    background: #EFEFEF;
    font-family: "微软雅黑";
    margin: 0;
}
 
.rich_media_title{
    margin: 0px !important;
}
.titlePic{
    width: 100%;
    overflow: hidden;
    margin:0px;
    background: #fff;
}
.titlePic img{
    width: 100%;
    float: left;
}
.title{
    background: white;
    padding-top: 40px;
    padding-bottom: 4px;
}
.line {
    border-top: 1px solid #EFEFEF;
    height: 1px;
    position: relative;
}
.line h5 {
    background: white;
    display: inline-block;
    width: 160px;
    text-align: center;
    font-size: 15px;
    color: #888;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-left: -80px;
    margin-top: -11px;
}
/*分享图标*/
 
.cont-icon {
    overflow: hidden;
    box-sizing: border-box;
    padding: 5px;
    padding-top: 4px;
}
 
.cont-icon li {
    width: 20%;
    /*border: 1px solid forestgreen;*/
    padding: 5px;
    float: left;
    box-sizing: border-box;
}
 
.cont-icon li a {
    display: inline-block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}
 
.cont-icon li:first-of-type a {
    background: url(../img/wx.png) no-repeat bottom;
    background-size: 70% 70%;
}
 
.cont-icon li:nth-of-type(2) a {
    background: url(../img/qqq.png) no-repeat bottom;
    background-size: 70% 70%;
}
 
.cont-icon li:nth-of-type(3) a {
    background: url(../img/pyq.png) no-repeat bottom;
    background-size: 70% 70%;
}
 
.cont-icon li:nth-of-type(4) a {
    background: url(../img/kj.png) no-repeat bottom;
    background-size: 70% 70%;
}
 
.cont-icon li:nth-of-type(5) a {
    background: url(../img/wb.png) no-repeat bottom;
    background-size: 70% 70%;
}
/*商品详情*/
.goods{
    background: white;
    margin-top: 10px;
}
.goods h5{
    line-height: 40px;
    font-size: 15px;
    color: #333;
    text-align: center;
}
.goods ul{
    display: flex;
    flex-wrap: wrap;
    box-sizing: border-box;
    border-top:1px solid #EFEFEF;
}
.goods li{
    width: 50%;
    box-sizing: border-box;
    padding: 5px;
    border-bottom: 1px solid #EFEFEF;
}
.goods li a{
    display: inline-block;
    padding: 5px;
    width: 100%;
    color: #333;
    font-size: 14px;
    box-sizing: border-box;
}
.goods li:nth-of-type(odd){
    border-right:1px solid #EFEFEF;
}
.goods li img{
    width: 100%;
    border-radius: 10px;
}
 
.goods li p:first-of-type{
    line-height: 26px;
    overflow: hidden;
    font-size: 14px;
     text-overflow: ellipsis;
     display: -webkit-box;
     -webkit-line-clamp: 2;
     -webkit-box-orient: vertical;
}
.icon{
    display: inline-block;
    background: #FF3083;
    text-align: center;    
    padding: 0 6px;
    font-size: 12px;
    border-radius: 4px;
    color: #fff;
    line-height: 20px;
    margin-right: 14px;
}
.icon.tb{
    background: #FF4400;
}
 
.icon.tm{
    background: #FF3083;
}
 
.goods li p:nth-of-type(2){
    padding: 6px 0;
    padding-bottom: 0;
    font-size: 18px;
    color: #FF3044;
    font-weight: bold;
}
.goods li p:nth-of-type(2) span{
    font-size: 14px;
    font-weight: normal;
}
.goods li p:nth-of-type(3){
    font-size: 12px;
    color: #FF3044;
    line-height: 26px;
    overflow: hidden;
}
.goods li p:nth-of-type(3) span:first-of-type{
    color: #999;
    /*margin-right: 12px;*/
    text-decoration: line-through;
    float: left;
    
}
.goods li p:nth-of-type(3) span:last-of-type{
    float: right;
}
.goods li p:last-of-type{
    padding-top: 6px;
    overflow: hidden;
    font-size: 12px;
}
.fl{
    float: left;
    color: #888;
    font-size: 13px;
}
.fr{
    display: inline-block;
    float: right;
    background: #F8B551;
    color: #fff;
    border-radius: 4px;
    padding: 1px 4px 2px 4px;
}
.zdy{
    background-color: white;
}
.zdy img{
    max-width: 88%;
    height:auto;
    margin: auto;
}
    </style>
    <body>
     <div id="test"></div> 
        <div class="page">
            <div class="titlePic">
                <img src="../img/dufa.jpg"/>
            </div>
            <div class="zdy">
                
            </div>
            <div class="title" style="display: none;">
                <div class="line">
                    <h5>分享给朋友</h5>
                </div>
                <ul class="cont-icon">
                    <li>
                        <a href="#"></a>
                    </li>
                    <li>
                        <a href="#"></a>
                    </li>
                    <li>
                        <a href="#"></a>
                    </li>
                    <li>
                        <a href="#"></a>
                    </li>
                    <li>
                        <a href="#"></a>
                    </li>
                </ul>
            </div>
            <div class="goods">
                <h5>编辑推荐</h5>
                <ul class="content">
                </ul>
            </div>
        </div>
        <div class="muban muban1" style="display: none;">
            <li>
                <a href="javascript:;">
                    <img class="min-pic"/>
                    <p class="gtitle"><span class="icon tb">淘宝</span></p>
                    <p class="qprice"><span>券后价¥</span></p>
                    <p class="zprice"><span>¥99</span><span></span></p>
                    <p class="yx">
                        <span class="fl"></span>
                        <span class="fr">优惠券</span>
                    </p>
                </a>
            </li>
        </div>
        <div class="muban muban2" style="display: none;">
            <li>
                <a href="javascript:;">
                    <img class="min-pic" src="http://img.alicdn.com/bao/uploaded/i4/37834516/TB2WAsilHFlpuFjy0FgXXbRBVXa_!!37834516.jpg"/>
                    <p class="gtitle"><span class="icon tb">淘宝</span></p>
                    <p class="qprice"><span>¥</span></p>
                    <p class="zprice"></p>
                    <p class="yx">
                        <span class="fl">月销1019</span>
                    </p>
                </a>
            </li>
        </div>
    </body>
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
    <script type="text/javascript" src="../js/base64.js"></script>
    <script type="text/javascript" src="//g.alicdn.com/mtb/lib-applink/0.3.4/??callApp.js,linksdk.js"></script>
    <script type="text/javascript">
    var falg = false;
    $(function(){
        
        var agent = navigator.userAgent;
//        $("#test").text(agent);
        var index1 = agent.indexOf("QQ");
        var index2 = agent.indexOf("Windows");
        var index3 = agent.indexOf("360");
        var index4 = agent.indexOf("UCBrowser");
        var index5 = agent.indexOf("MicroMessenger");
        var index6 = agent.indexOf("Weibo");
        var index7 = agent.indexOf("Firefox");
        
        if(index1 >= 0 || index2 >= 0 || index3 >= 0 || index4 >= 0 || index5 >= 0 || index6 >= 0 || index7 >= 0){
            falg=true;
            $.getScript("../js/tbsdk.js");
        }
        
        
        var id = getArgsFromHref(location.href,"id");
        
        $.post("../getRecommendSectionDetail",{"id":id},function(data){
            if(data.code==0){
                setData(data.data);
            }
        },'json');
        
        $.post("../getRecommendSectionGoodsList",{"id":id},function(data){
            if(data.code==0){
                setGoodsData(data.data);
            }
        },'json');
        
    });
    
    function setGoodsData(data){
        var goodsList = data.goodsList;
        var goodsHtml1 = $(".muban1").html();
        var goodsHtml2 = $(".muban2").html();
        var base64 = new Base64();
        for (var ii=0;ii<goodsList.length;ii++) {
            var tb = goodsList[ii];
            var auctionId= tb.auctionId;
            var pictUrl = tb.pictUrl;
            var url = tb.auctionUrl;
            var title= tb.title;
            var shopType = tb.shopType;
            var xl = tb.biz30day;
            var entitle=base64.encode(title);
            if(tb.showType==3 || tb.showType==1){
                $(".content").append(goodsHtml1);
                var $curli = $(".content li:last-child");
                var quanPrice = tb.quanPrice;
                $curli.find("a").attr("href","yestv://getgoodsdetail#"+auctionId+"#"+url+"#"+entitle);
                $curli.find("img").attr("src",pictUrl);
                
                if(shopType==2){
                    $curli.find(".icon").removeClass("tb");
                    $curli.find(".icon").addClass("tm");
                    $curli.find(".icon").text("天猫");
                }
                $curli.find(".gtitle span").after(title);
                $curli.find(".qprice span").after(quanPrice);
                $curli.find(".zprice span").text("¥"+tb.zkPrice);
                //$curli.find(".zprice span:last-of-type").text("返利红包:¥"+tb.taoBaoHongBaoInfo.hongbao);
                $curli.find(".zprice span:last-of-type").text("");
                if(xl >= 10000){
                    xl = (xl/10000).toFixed(2)+"万";
                }
                $curli.find(".yx .fl").text("月销"+xl);
            }else{
                $(".content").append(goodsHtml2);
                var $curli = $(".content li:last-child");
                    $curli.find("a").attr("href","yestv://getgoodsdetail#"+auctionId+"#"+url+"#"+entitle);
                $curli.find("img").attr("src",pictUrl);
                if(shopType==2){
                    $curli.find(".icon").removeClass("tb");
                    $curli.find(".icon").addClass("tm");
                    $curli.find(".icon").text("天猫");
                }
                $curli.find(".gtitle span").after(title);
                $curli.find(".qprice span").after(tb.zkPrice);
                //$curli.find(".zprice").text("返利红包:¥"+tb.taoBaoHongBaoInfo.hongbao);
                $curli.find(".zprice").text("");
                if(xl >= 10000){
                    xl = (xl/10000).toFixed(2)+"万";
                }
                $curli.find(".yx .fl").text("月销"+xl);
            }
            if(falg){
                 $(".content a").eq(ii).bind("click",function(){
                    window.BC_SDK.goTaoke({
                          tkUrl : url,
                          params : {
                            pid: "mm_106929643_20324269_73400452", // 淘客必填
                          }
                        });
                    return false;
                }); 
            }
            
            $('.cont-icon li a').height($('.cont-icon li a').width());
        }
    }
    
    function setData(data){
        var picUrl = data.picUrl;
        var html = data.html;
//        $(".titlePic").attr("href",picUrl);
        $(".titlePic img").attr("src",picUrl);
        $(".zdy").append(html);
    }
    
    
    function getArgsFromHref(sHref, sArgName) {
    var args = sHref.split("?");
    var retval = "";
 
    if(args[0] == sHref) /*参数为空*/ {
        return retval; /*无需做任何处理*/
    }
    var str = args[1];
    args = str.split("&");
    for(var i = 0; i < args.length; i++) {
        str = args[i];
        var arg = str.split("=");
        if(arg.length <= 1) continue;
        if(arg[0] == sArgName) retval = arg[1];
    }
    return retval;
}
    </script>
</html>