lbdetails.html 20.9 KB
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 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533
<!DOCTYPE html>
<script type="text/javascript" src="__PUBLIC__/js/rem_new.js"></script>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width">
    <title>{$list.lbtitle}</title>
    <meta http-equiv="keywords" content="{$tpshop_config['shop_info_store_keyword']}"/>
    <meta name="description" content="{$tpshop_config['shop_info_store_desc']}"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0" />
    <meta name="format-detection" content="telephone=no"/>
    <meta name="format-detection" content="email=no"/>
    <meta name="format-detection" content="address=no;">
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="default"/>
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/public.css"/>
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/layer.css" />
    <!--<link rel="stylesheet" type="text/css" href="__STATIC__/css/category_list.css"/>-->
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/index.css"/>
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/libao.css"/>
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/appscript.css"/>
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/goods.css?v=__CSSVERSION__"/>
    <script type="text/javascript" src="__STATIC__/js/jquery.min.js"></script>
    <script type="text/javascript" src="__STATIC__/js/TouchSlide.1.1.js"></script>
    <script type="text/javascript" src="__STATIC__/js/jquery.json.js"></script>
    <script type="text/javascript" src="__STATIC__/js/touchslider.dev.js"></script>
    <script src="__PUBLIC__/js/global.js"></script>
    <script src="__PUBLIC__/js/mobile_common.js"></script>
    <script type="text/javascript" src="__STATIC__/js/layer.js"></script>

    <style type="text/css">
        .footer_nav ul li{  width:50%;}
        .noscroll,
        .noscroll body {overflow: hidden;}
        .noscroll body {position: relative;}
        .goods_no{font-size: 14px;color: #999999;margin-left: 10px;}
        /*修改 left,width   20170327*/
        .qqkefu {
            position: fixed; left: 20%;
            bottom: 50px; background-color: #fff;
            border: 1px #eee solid;width: 20%;z-index: 999;
        }
        .qqkefu ul li {
            border-bottom: 1px #eee solid;
            height: 45px;line-height: 45px;font-size: 16px;
            color: #666; width: 100%;text-align:center;
            background-position: .1rem center; overflow: hidden;
        }
        .nokill{background:#adadad;text-align: center; line-height: 50px; color: #fff}
        .bgimg{position: fixed; width: 47px; height: 47px; right: 15px; bottom: 62px; background-color:red; border-radius: 50%;}

        .dhead{text-align: center;height: .5rem;width: 100%;z-index: 9;position: absolute;top: 4.3rem;filter: Alpha(opacity=80);background-color: rgba(255, 255, 255, 0.8); line-height: .5rem;}
        .muse{border-radius: .05rem;}
        .fixed{background-color: rgba(192, 24, 44, 1);}
        .guize{ margin: 20% auto 0;
            height:7rem;}
        .guize .ldone{height: 1rem;width: 100%;}
        .guize .ldtwo{padding: .05rem;}
        .guize .ldthree{background-color: #000;height: 3.5rem;width: 3.5rem;margin: 0 auto;margin-top: .5rem;}
        .guize .ldfour{text-align: center;padding: .05rem;}
    </style>
</head>
<body style="background-color: #f1f1f1;">
<include file="public/navBall" />
<div class="libaopro" style="max-width: 720px; background-color: #fff">
    <div style="max-width: 720px;" class="f24 dhead cr" >
        <if condition="$mid">兑换结束时间:{$expdate|date='Y/m/d H:i:s',###}
            <else/>
            <if condition="$isstart">
                <if condition="$isstart eq 2">
                        活动已结束
                    <else/>
                    活动结束时间:{$list.endtime|date='Y/m/d H:i:s',###}
                </if>
                <else/>
                    活动开始时间:{$list.startime|date='Y/m/d H:i:s',###}
            </if>
        </if>
    </div>
    <img src="{:getImg($list.lburl)}" />
    <div class="pro_libao">
        <div class="name cut f3">{$list.lbtitle}
        </div>
        <if class="cr f36"><if condition="$list['lbprice'] neq 0.00">{$list['lbprice']}元<if condition="$list.lbintegral neq 0">/</if></if><if condition="$list.lbintegral neq 0">{$list.lbintegral}积分</if></div>
        <div class="c9 mt10"><if condition="$list.lbtype eq 1">可到线下门店进行兑换</if></div>
    </div>
    <!--礼包详情-->
    <div class="lbpro_list disfx">
        <ul>
            <empty name="$mid">
                <!--未购买详情-->
                <li class="borb1">
                    <span class="fxtwo tal">单品名称</span>
                    <span class="fxall"></span>
                    <span class="fxall">数量</span>
                </li>
                <volist name="list1" id="vo">
                    <li>
                        <span class="fxtwo tal cut">{$vo.goods_name}</span>
                        <span class="fxall"></span>
                        <span class="fxall">{$vo.goods_num}</span>
                    </li>
                </volist>

             <else/>
                <!--已购买详情-->
                <if condition="$list.codetype eq 0">
                    <li class="borb1">
                        <span class="fxtwo tal">单品名称</span>
                        <span class="fxall"></span>
                        <span class="fxall">数量</span>

                    </li>
                    <volist name="list1" id="vo">
                        <li>
                            <span class="fxtwo tal cut">{$vo.goods_name}</span>
                            <span class="fxall"></span>
                            <span class="fxall">{$vo.goods_num}</span>

                        </li>
                    </volist>
                <else/>
                    <li class="borb1">
                        <span class="fxtwo tal">单品名称</span>
                        <span class="fxall">总数量</span>
                        <span class="fxall">剩余数</span>
                        <span class="fxall"></span>
                    </li>
                    <volist name="list1" id="vo">
                        <li>
                            <span class="fxtwo tal cut">{$vo.goods_name}</span>
                            <span class="fxall">{$vo.goods_num}</span>
                            <span class="fxall">{$vo.alsonum}</span>
                            <if condition="$vo.alsonum">
                                <span class="fxall" onclick="showhxm(this,2);" data-id="{$vo.id}"><em class="btn_small moz_b8 moz_t8 muse" >使用</em></span>
                                <else/>
                                <span class="fxall" ><em class="btn_small moz_b8 moz_t8 muse" style="background-color: #999;">已领</em></span>
                            </if>

                        </li>
                    </volist>
                </if>


            </empty>


        </ul>

    </div>
    <div class="p20 disfx" style="position: fixed;bottom: 0;width: 100%; max-width: 720px;">
        <!--未购买详情-->
        <empty name="mid">

            <if condition="$isstart">
                <if condition="$isstart eq 2">
                    <span class="btn_big fxall ml20 moz_b8 moz_t8"  style="background-color:#ccc">活动已结束</span>
                    <else/>
                        <if condition="$list.lbintegral neq 0"><span class="btn_big fxall mr20 moz_b8 moz_t8" style=" background-color: #fe9f02;" onclick="transjifen(this);">立即兑换</span></if>
                        <if condition="$list['lbprice'] neq 0.00"><span class="btn_big fxall ml20 moz_b8 moz_t8" onclick="goumai(this);">立即购买</span></if>
                </if>
                <else/>
                <span class="btn_big fxall ml20 moz_b8 moz_t8"  style="background-color:#ccc">活动未开始</span>

            </if>
            <else/>
            <if condition="$list.codetype eq 0">
                <!--全商品使用-->
                <if condition="$isget eq 1">
                    <span class="btn_big fxall mr20 moz_b8 moz_t8"  style="background-color:#999; ">已领取:{$list1[0]['freebh']}</span>
                    <else/>
                    <span class="btn_big fxall mr20 moz_b8 moz_t8"  data-id="{$mid}" onclick="showhxm(this,1);">立即使用</span>
                </if>
            </if>
        </empty>



    </div>

</div>

<!--二维码-->
<div class="fixed" style=" display:none; "   onclick="javascript:$('.fixed,.guize').hide();">

    <div class="guize rel moz_b4 moz_t4" style="position: relative;display:none;">
        <div class="ldone" style=""><img src="" id="hxmtxm" style=" width: 100%;"></div>
        <div  class="ldtwo tac f30 lh50" id="hxmnumber">123456789546</div>
        <div class="ldthree" style=""><img src="" id="hxmewm" style=" width: 100%;"></div>
        <div class="ldfour">当前核销码仅限当面使用</div>
    </div>
</div>
<form action="/Mobile/Payment/getPay" method="post" name="points" id="points" style="display: none;">
    <input name="stoid" value="{$Think.request.stoid}" type="hidden">
    <input name="recharge_type" value="5" type="hidden">
    <input type="hidden" value="{$list.id}"  name="lbid" />


</form>

</body>
</html>
<!--正式环境要用https-->
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script type="text/javascript">

    var ShareTitle="{$list.lbtitle}";
    var ShareDesc="{$list.lbintro}";
    var wxstoid="{$Think.request.stoid}";
    var ShareImgUrl = "{:getImg($list.lburl)}";

    var ShareLink = location.href.split('#')[0]; //默认分享链接
    if(ShareLink.indexOf("?")!=-1) {
        ShareLink = changeURLArg(ShareLink, "code,state", "");
    }

    var is_distribut = "{$tpshop_config['is_distribut']}"; // 是否分销代理
    var user_id = "{$tpshop_config['user_id']}"; // 当前用户id

    // 如果已经登录了, 并且是分销商
    if(parseInt(user_id) > 0) {
        if (ShareLink.indexOf("?") != -1) {
            ShareLink = ShareLink + "&first_leader=" + user_id;
        }
        else {
            ShareLink = ShareLink + "?first_leader=" + user_id;
        }
    }

    $(function() {
        if(isWeiXin()){
            $.ajax({
                type : "POST",
                url:"/index.php?m=Mobile&c=Index&a=ajaxGetWxConfig&stoid="+wxstoid+"&t="+Math.random(),
                data:{'askUrl':encodeURIComponent(location.href.split('#')[0])},
                dataType:'JSON',
                success: function(res)
                {

                    wx.config({
                        debug: false,
                        appId: res.appId,
                        timestamp: res.timestamp,
                        nonceStr: res.nonceStr,
                        signature: res.signature,
                        jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareQZone', 'hideOptionMenu','addCard'] // 功能列表,我们要使用JS-SDK的什么功能
                    });

                    // config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在 页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready 函数中。
                    wx.ready(function(){
                        // 获取"分享到朋友圈"按钮点击状态及自定义分享内容接口
                        wx.onMenuShareTimeline({
                            title: ShareTitle, // 分享标题
                            link:ShareLink,
                            imgUrl:ShareImgUrl // 分享图标
                        });

                        // 获取"分享给朋友"按钮点击状态及自定义分享内容接口
                        wx.onMenuShareAppMessage({
                            title: ShareTitle, // 分享标题
                            desc: ShareDesc, // 分享描述
                            link:ShareLink,
                            imgUrl:ShareImgUrl // 分享图标
                        });
                        // 分享到QQ
                        wx.onMenuShareQQ({
                            title: ShareTitle, // 分享标题
                            desc: ShareDesc, // 分享描述
                            link:ShareLink,
                            imgUrl:ShareImgUrl // 分享图标
                        });
                        // 分享到QQ空间
                        wx.onMenuShareQZone({
                            title: ShareTitle, // 分享标题
                            desc: ShareDesc, // 分享描述
                            link:ShareLink,
                            imgUrl:ShareImgUrl // 分享图标
                        });

                    });
                },
                error:function(){
                    return false;
                }
            });
        }
    });
    function isWeiXin(){
        var ua = window.navigator.userAgent.toLowerCase();
        if(ua.match(/MicroMessenger/i) == 'micromessenger'){
            return true;
        }else{
            return false;
        }
    }



    //去掉某参数
    //arg 多个以,分开
    //arg_val 替换值
    function changeURLArg(url,arg,arg_val){
        var isgo=false;
        var arg1 = arg.split(",");//以逗号作为分隔字符串
        for (var e=0;e<arg1.length ;e++) {
            if (GetQueryString(arg1[e]) !=null) {
                isgo = true;
            }
        }
        if (isgo==true) {
            for (var i = 0; i < arg1.length; i++) {

                var pattern = arg1[i] + '=([^&]*)';
                var replaceText = arg_val;
                if (url.match(pattern)) {
                    var tmp = '/(' + arg1[i] + '=)([^&]*)/gi';
                    tmp = url.replace(eval(tmp), replaceText);
                    url = tmp;
                }
            }

            var newtmp = tmp;
            var tmp1 = tmp.split('?');

            if (tmp1.length >= 2) {
                if (tmp1[1] == "") {
                    newtmp = tmp1[0];
                }
                else {
                    //&&fff=111
                    var newtmp1 = "";
                    var tmp2 = tmp1[1].split('&');

                    for (var y = 0; y < tmp2.length; y++) {
                        if (tmp2[y] != "") {
                            if (newtmp1 == "") {
                                newtmp1 = tmp2[y];
                            }
                            else {
                                newtmp1 += "&" + tmp2[y];
                            }


                        }
                    }
                    if (newtmp1 != "") {
                        newtmp = tmp1[0] + "?" + newtmp1;
                    } else {
                        newtmp = tmp1[0];
                    }
                }
            } else {
                newtmp = tmp1[0];
            }
            return newtmp;
        }
        else
        {
            return url;
        }

    }

    //取某参数
    function GetQueryString(name)
    {
        var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if(r!=null)return  unescape(r[2]); return null;
    }
</script>

<script type="text/javascript">
    var getstoid = "<?php echo I('stoid')?>";
    var qqlist="{$tpshop_config['qqlist']}";
    var getmobile="{$user['mobile']}";
    var geterpvipid="{$user['erpvipid']}";


    /*--qq客服--*/
    function showQQList(){
        $(".qqkefu").fadeToggle();
    }

    //积分兑换
    function  transjifen(obj) {

        if (getmobile=="" || geterpvipid=="")
        {
            location.href="/Mobile/user/login/stoid/" + getstoid+"?oldurl=" + encodeURI(window.location.href);
            return false;
        }
        var lbid="{$list.id}";
        layer.open({
            content:'是否确定兑换礼包',
            btn:['确定','取消'],
            yes:function (index) {
                layer.closeAll();
              //  console.log('确定');
                $.ajax({
                    type: "POST",
                    url: "{:U('Mobile/Libao/libaoorder',array('stoid'=>$Think.request.stoid))}", //+tab,
                    data: "lbid="+lbid+"&paytype=1", // 你的formid
                    dataType: "json",
                    beforeSend:function()
                    {
                        layer.open({shadeClose: false,type: 2 ,content: '提交中…'});
                    },
                    success: function (data) {
                    layer.closeAll();
                        console.log(data.code);
                        if (data.code == 1) {
                            layer.open({
                                content: "兑换成功",
                                time: 2
                            });
                            setTimeout(function () {
                                location.href = "/Mobile/Payment/payment_success/stoid/" + getstoid+"/ptype/1.html";
                            }, 1000)
                        } else {
                            layer.open({
                                content: data.msg,
                                time: 2
                            });
//                        setTimeout(function () {
//                            //location.href = "/Mobile/Cart/cart4/orderno/" + data.result + "/stoid/" + getstoid;
//                            location.href = '/Mobile/Payment/getCode.html?orderno=' + data.result + '&stoid=' + getstoid;
//                        }, 1000)
                        }
                    }
                });
            },
//        no:function (index) {
//            console.log('取消');
//        }

        })
    }



    //微信购买
    function  goumai(obj) {

        if (getmobile=="" || geterpvipid=="")
        {
            location.href="/Mobile/user/login/stoid/" + getstoid+"?oldurl=" + encodeURI(window.location.href);
            return false;
        }
        var lbid="{$list.id}";
        layer.open({
            content:'是否确定购买礼包',
            btn:['确定','取消'],
            yes:function (index) {
                layer.closeAll();
               // console.log('确定');
                $.ajax({
                    type: "POST",
                    url: "{:U('Mobile/Libao/libaoorder',array('stoid'=>$Think.request.stoid))}", //+tab,
                    data: "lbid="+lbid+"&paytype=2", // 你的formid
                    dataType: "json",
                    success: function (data) {
//                    layer.close(ii);
                        console.log(data.code);
                        if (data.code == 1) {
                            $("#points").submit();
                        } else {
                            layer.open({
                                content: data.msg,
                                time: 2
                            });

                        }
                    }
                });
//                $("#points").submit();
            },
//        no:function (index) {
//            console.log('取消');
//        }

        })
    }


    //展示核销码
    function  showhxm(obj,t) {
        var id=$(obj).attr('data-id');
        var url="{:U('Mobile/Libao/getlibaohxm',array('stoid'=>$Think.request.stoid))}";
        if(id=="")
        {
            return false;
        }

        if(t==1){
            url="{:U('Mobile/Libao/getlibaohxm',array('stoid'=>$Think.request.stoid,'type'=>1))}";
        }
        $.ajax({
            type: "POST",
            url: url,
            data: "id="+id, // 你的formid
            dataType: "json",
            success: function (data) {
//                    layer.close(ii);
              //  console.log(data.code);
                if (data.code == 1) {
                    var img="/vendor/barcodegen/test_1D2.php?text="+data.msg;
                    var img1="/index.php?m=Home&c=Index&a=qr_code&data="+data.msg;
                    $('#hxmnumber').html(data.msg);
                    $('#hxmtxm').attr('src',img);
                    $('#hxmewm').attr('src',img1);
                    $('.fixed,.guize').show();
                } else {
                    layer.open({
                        content: data.msg,
                        time: 2
                    });
//                        setTimeout(function () {
//                            //location.href = "/Mobile/Cart/cart4/orderno/" + data.result + "/stoid/" + getstoid;
//                            location.href = '/Mobile/Payment/getCode.html?orderno=' + data.result + '&stoid=' + getstoid;
//                        }, 1000)
                }
            }
        });


    }


</script>

<!-- 微信浏览器 调用微信 分享js-->
<include file="public/wx_share"/>