coupon_list.html 13.6 KB
<script type="text/javascript" src="__PUBLIC__/js/rem_new.js"></script>
<!DOCTYPE html >
<html>
<head>
    <head>
        <meta charset="UTF-8">
        <title>{:I('title','抵用券列表')}_{$tpshop_config.shop_info_store_title}</title>

        <include file="public/header"/>
        <link rel="stylesheet" href="__STATIC__/css/user_index.css?v=__CSSVERSION__">
        <link rel="stylesheet" type="text/css" href="__STATIC__/css/public.css?v=__CSSVERSION__"/>
        <link rel="stylesheet" type="text/css" href="__STATIC__/swiper/css/swiper.min.css"/>
        <script type="text/javascript" src="__STATIC__/swiper/js/swiper.min.js"></script>
        <script type="text/javascript" src="__STATIC__/js/jquery.min.js"></script>
        <!--<script type="text/javascript" src="__STATIC__/js/my_msg.js"></script>-->
        <include file="public/my_msg"/>

        <style>
            .code {
                background: rgba(0, 0, 0, 0) url(__STATIC__/images/index/rect.png) no-repeat scroll center center / cover;
                height: 200px;
                margin: 20px auto;
                width: 200px;
            }

            .code img {
                height: 90%;
                margin: 5% auto;
                width: 90%;
            }

            .userhead {
                border-radius: 50%;
                position: absolute;
                right: -10px;
                top: 0;
                width: 20px;
                height: 20px;
                padding: 3px;
                background: #ea5551 url(__STATIC__/images/user/userhead.png) no-repeat scroll center center / 18px 13.2px;
                border: 2px solid #fff;
            }

            .erpapp {
                width: 100%;
                height: 50px;
                background-color: #ca3043;
            }

            .erpapp img {
                height: 30px;
                width: 30px;
                border-radius: 30px;
                margin: 10px;
                display: inline-block;
                vertical-align: top;
            }

            .erptext {
                color: #fff;
                line-height: 50px;
                width: 50%;
                display: inline-block;
                height: 50px;
            }

            .openapp {
                background-color: #fff;
                color: #c93145;
                border-radius: 5px;
                display: inline-block;
                margin: 12px;
                vertical-align: top;
                height: 25px;
                width: 70px;
                text-align: center;
                line-height: 25px;
                margin-right: 0;
                margin-left: 0;
                float: right;
                margin-right: 20px; ;
            }
          .coupon-left-money{
              height: 0.62rem;
              margin-top: 0.2rem;
              margin-bottom: 0.1rem;
          }


        </style>
        <!--<script src="__STATIC__/js/my_msg.js"></script>-->
        <include file="public/my_msg"/>
<body>

<div id="tbh5v0">
    <div class="user_com ">
        <!--二维码弹框-->
        <include file="public/qr_coed"/>
        <include file="public/popup"/>
        <!-- 优惠券头部 -->
        <div class="com_top">
            <img class="b_img" src="{:get_quan_list_img($Img)}" style="width: 100%;">
        </div>

        <div class="background">

            <foreach name="quan_list" item="v">
                <div id="q_item">
                    <div class="xc-coupon-frame flex jc_center ai_center">
                        <div class="coupon-frame flex rel">
                            <!-- 锯齿 -->
                            <div class="coupon-left  rel " style="background-color: {:setbgcolor($v.UseObjectType)}">
                                <!-- 锯齿 -->
                                <div class="circle-frame abs">
                                    <div class='circle circle-sawtooth'></div>
                                    <div class='circle circle-sawtooth'></div>
                                    <div class='circle circle-sawtooth'></div>
                                    <div class='circle circle-sawtooth'></div>
                                    <div class='circle circle-sawtooth'></div>
                                    <div class='circle circle-sawtooth'></div>
                                    <div class='circle circle-sawtooth'></div>
                                    <div class='circle circle-sawtooth'></div>
                                    <div class='circle circle-sawtooth'></div>
                                    <div class='circle circle-sawtooth'></div>
                                    <div class='circle circle-sawtooth'></div>
                                    <div class='circle circle-sawtooth'></div>
                                    <div class='circle circle-sawtooth'></div>
                                    <div class='circle circle-sawtooth'></div>
                                    <div class='circle circle-sawtooth'></div>
                                    <div class='circle circle-sawtooth'></div>
                                    <div class='circle circle-sawtooth'></div>
                                    <div class='circle circle-sawtooth'></div>
                                    <div class='circle circle-sawtooth'></div>
                                    <div class='circle circle-sawtooth'></div>
                                </div>

                                <if condition="$v.ObtainTimes">
                                    <div  class="white oval abs" style="background-color:{:setbgbackground($v.UseObjectType)}">
                                        <div class="xc-valuer">x<font class="residual_t">{$v.ObtainTimes}</font></div>
                                    </div>
                                </if>

                                <div class="white xc-money-frame">
                                    <div class="flex jc_center ai_bas coupon-left-money">
                                        <div class="xc-rmb-symbol "></div>
                                        <div class="xc-rmb-val">{$v.CashSum}</div>
                                    </div>

                                    <if condition="$v.BuySum gt 0">
                                        <div class="coupon-explain  t_c">
                                            满{$v.BuySum}元可用
                                        </div>
                                     <else/>
                                        <div class="coupon-explain t_c">
                                            无使用门槛
                                        </div>
                                    </if>
                                </div>
                            </div>
                            <div class="coupon-right flex jc_center ai_center rel">
                                <div class="coupon-annotation  flex">

                                    <div class="flex  top-frame">

                                        <div class="frame">
                                            <div class="coupon-wode ellipsis-2 ">
                                                <text class="xc-brand fs11 t_c disi"
                                                      style="background-color:{:setbgcolor($v.UseObjectType)}">
                                                    {:get_type_card($v.UseObjectType)}
                                                </text>

                                                <text class="fs022">{$v.PrivilegeName}</text>
                                            </div>
                                            <div class="coupon-time">
                                                {:date('Y-m-d')}至{$v.Validay}
                                            </div>
                                        </div>
                                    </div>

                                    <if condition="$v.Obtain gt 0">
                                        <div class="code-img" Id="{$v.Id}"  Validay="{$v.Validay}"  now="{:date('Y-m-d')}" onclick="hexiao_quan(this)">
                                            <img class="coupon-code" src='__STATIC__/images/weixin/user_r_code.png'></img>
                                        </div>
                                     <else/>
                                        <div class="code-img" Id="{$v.Id}"  Validay="{$v.Validay}"  isno="1" now="{:date('Y-m-d')}">
                                            <img class="coupon-code" src='__STATIC__/images/weixin/hui-ewm.png'></img>
                                        </div>
                                    </if>
                                </div>

                                <if condition="$v.ObtainTimes gt 0 || $v.SecondNo eq 0" ind>
                                    <div class="clik-get t_c white abs" onclick="ling_quan(this)"
                                          Id="{$v.Id}"  btainTimes="{$v.ObtainTimes}"  Obtain="{$v.Obtain}"
                                         style="background-color:{:setbgcolor($v.UseObjectType)}">
                                        立即领取
                                    </div>
                                <else/>
                                    <div class="clik-get t_c white abs  g_gray"onclick="have_received()">已领取</div>
                                </if>


                                <div id="show_remarks" class="abs flex  bottmo-explain" onclick="show_remarks(this)" style="justify-content: flex-end" >
                                    <div class="fs015 flex ai_center" >优惠券使用说明
                                        <div class="circle circle-size flex t-c jc_center">
                                            <div class="xc-jiantou" ></div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="xc-buttom" is_show="0">
                        <text id="instructions" class="fs020" value="{$v.Remark}">{:replay_huiche($v.Remark)}</text>
                    </div>
                </div>
            </foreach>
        </div>
    </div>

</div>
</div>

</body>
</html>
<include file="public/popup"/>
<script>
    // 已领取
    function  have_received(){
        show_pop_text("","已领取");
        return false;
    }

      var stoid="{$Think.request.stoid}";
      var user_id="{$tpshop_config['user_id']}";

      //--领取券要调用领券的接口---
      function ling_quan(ob) {
            var privilegeId=$(ob).attr("Id");
            var can_get = $(ob).attr('btainTimes');
            var Obtain = $(ob).attr('Obtain');

            var pre=$(ob).prev();

            if(can_get<=0){
                return false;
            }
            var url="{$mini_host}/api/weshop/users/grade/cash/insert";
            //url="http://172.20.3.102:8022"+url;
            var data={
                privilegeId:privilegeId,
                storeId:stoid,
                userId:user_id,
                operator:'微信商城'
            };

            var ii=layer.open({type:2, shadeClose: false});
            $.ajax({
              url:  url, data: data, type: "post",
              dataType: "json",
              success: function(res) {
                  layer.close(ii);
                  if(res.code==0){
                      my_msg("您已成功领取该券",1);
                      can_get--;
                      Obtain++;
                      $(ob).attr('btainTimes',can_get);
                      $(ob).attr('Obtain',Obtain);
                      $(ob).parent().prev().find(".oval").find(".xc-valuer").find(".residual_t").text(can_get);
                      if(can_get<=0){
                         $(ob).addClass("g_gray"); $(ob).text("已领取");
                         $(ob).parent().prev().find(".oval").remove();
                         $(ob).removeAttr("style");
                      }

                      if(pre.find(".code-img").attr("isno")=="1"){
                          pre.find(".code-img").attr("onclick","hexiao_quan(this);")
                          pre.find(".code-img").find('img').attr("src","__STATIC__/images/weixin/user_r_code.png");
                      }
                  }else{
                      my_msg(res.msg);
                  }
              }
           });
      }
      //--核销券---
      function hexiao_quan(ob) {

          var validay = $(ob).attr('Validay');
          var pId=$(ob).attr('Id');
          var now=$(ob).attr('now');

          var url="{$mini_host}/api/weshop/users/grade/cash/code/get";
          //url="http://172.20.3.102:8022"+url;

          var data={
              privilegeId:pId,
              storeId:stoid,
              userId:user_id};

          $.ajax({
              url:  url, data: data, type: "get",
              dataType: "json",
              success: function(res) {
                  if(res.code==0){
                      var  name= res.data.UseObjectName;
                      var quan_no=res.data.CashRepNo;
                      xc_text_qr_code(quan_no,0,now,validay,name);
                  }
              }
          });
      }
      //---显示下拉说明---

        function show_remarks(ob) {

          var obj=$(ob).parent().parent().parent().parent();
          var is_show=obj.find('.xc-buttom').attr("is_show");
          if(is_show=="0"){
              obj.find('.xc-buttom').show();
              obj.find('.xc-buttom').attr("is_show",1);
          }else{
              obj.find('.xc-buttom').hide();
              obj.find('.xc-buttom').attr("is_show",0);
          }
      }




</script>