index.html 10.7 KB
<!DOCTYPE html>
<html>
  <head>
    <meta charset=utf-8>
    <meta name=viewport content="width=device-width,initial-scale=1,user-scalable=0">
    <title>拼团购</title>
    <style>
      * {
        margin: 0;
        padding: 0;
        font-size: 14px;
      }

      body,
      html {
        background: #f2f2f2;
        color:#333; 
      }
      .activeBox{
        background:#fff;
        height:100%;
        width: auto;
        border-top:1px solid #fff;

    }
    .active{
        margin:0 20px;
        width:auto;
        background:url(../../static/images/peizhi.png) no-repeat left center;
        background-size:100%;
        height:100px;
        margin-top:20px;
        text-align:center;
        overflow:hidden;
        padding-bottom: 25px;
    }

    .title{
        font-size:20px;
        font-weight:500;
        display:flex;
        justify-content:center;
        margin-top: 50px;
    }
    .icon img{
        width: 18px;
        height: 18px;
        margin-right: 10px;
        margin-top: 5px;
    }
    .addActive{
        font-size: 20px;
    }
    .order{
        width:auto;
        height:100%;
        background:#fff;
        
    }
    .orderTitle{
        margin:0;
        margin-top:8px;
        text-indent:20px;
        border-top: 1px solid #f2f2f2;
        border-bottom: 1px solid #f2f2f2;
        line-height:45px;
    }
    .orderMessage{
        width:80px;
        height:80px;
        
    }
    .orderMessage img{
        width: 100%;
        height: 100%;
    }
    .orderBox{
        padding:60px 0;
        display: flex;
        justify-content: center;
    }
    .display{
        display: none;
    }
    .noOrder{
        font-size:14px;
        text-indent: 13px;
        margin-top: 15px;
    }  
    .ul{
        border:1px solid #000;
    }
    .sonOrder{
        background:#fff;
        display: none;
        border-top: 2px solid #f2f2f2;
        padding: 15px 0;
        
    }
    .display{
        display: none;
    }
    .show{
        display: block;
    }
    .sonOrder p{
        margin: 0 20px;
        height: 30px;
        font-size: 12px;
    }
    .sonOrder span{
        line-height: 35px;
        font-size: 12px;
    }
    .orderList{
        margin: 10px 0;
        background: #fff;
        padding: 25px 0;
        position: relative;
    }
    .orderList p{
        margin: 0 20px;
    }
    .orderList p,span{
        min-height: 30px;
        font-size: 14px;
    }
    .orderList-title{
        font-weight: 600;
        margin-right: 15px;
        margin-top: 25px;
    }
    .orderNmae{
        color:#999999;
        font-size: 14px;
    }
    .orderList img{
        width: 90px;
        height: 24px;
        position: absolute;
        right: 17px;
    }
    .date{
        padding-bottom: 5px;
    }
    .return{
        color: #FF9A33;
    }
    .down {
        display: inline-block;
        border-top: 2px solid;
        border-right: 2px solid;
        width: 10px;
        height: 10px;
        border-color: #999999;
        transform: rotate(134deg);
        margin: 5px auto auto 50%;
        position: absolute;
        bottom: 10px;
    }
    .up{
        display: inline-block;
        border-top: 2px solid;
        border-right: 2px solid;
        width: 10px;
        height: 10px;
        border-color: #999999;
        transform: rotate(-45deg);
        margin: 5px auto auto 50%;
        position: absolute;
        bottom: 10px;
    }
    .orderList a{
        position: absolute;
        right: 20px;
        width: 90px;
        height: 24px;
    }   
    </style>
  </head>
  <body>
    <div class="page_wrapper">
    <div class='activeBox'>
        <div class='active' >
            <div class="title">
               <p class="icon"> <img th:src='@{/static/images/bianji.png}'/></p>
               <p class='addActive'>添加配置活动</p>
            </div>
        </div>
        <div class='order' >
            <p class='orderTitle'>销售订单</p>
            <div class='orderBox display'>
                <div class='orderMessage'>
                    <p><img th:src='@{/static/images/zanwu.png}'/></p>
                    <p class='noOrder'>暂无订单</p>
                </div>
            </div>
        </div>
        
    </div> 
    <div class="orderDetail">
        <!-- <div class="orderList">
            <p>
                <span>4G直播记录仪</span>
                <span>199</span>
            </p>
            
            <p>
                <span>记单量合计:</span>
                <span>15套</span>
            </p>
            <p>
                <span>订单总额:</span>
                <span>199</span>
            </p>
            <p>
                <span>手机号码:</span>
                <span>199</span>
            </p>
            <p>
                <span>返还补贴:</span>
                <span>199</span>
                <span>
                    <img th:src='@{/static/images/lijlianxi.png}'/>
                </Span>
            </p>
            <div class='sonOrder'>
                <p>
                    <span>订单编号:</span>
                    <span>15套</span>
                </p>
                <p>
                    <span>订单数量:</span>
                    <span>199</span>
                </p>
                <p>
                    <span>采购时间</span>
                    <span>199</span>
                </p>
            </div>
        </div> -->
    </div>
    

      

    </div>
  </body>
  <script type="text/javascript" th:src="@{/static/js/common/jquery.min.js}"></script>
  <script type="text/javascript" th:src="@{/static/layer_mobile/layer.js}"></script>
  <script type="text/javascript" th:src="@{/static/js/leftTime.min.js}"></script>
  <script type="text/javascript">
     $(function() {

      var inquiryDetail = {};
      /**
       * 绑定event事件
       */
        $('.orderDetail').on('click', '.orderList', function(event){
           	if($(this).children('.sonOrder').is('.show')){
            	$(this).children(".sonOrder").removeClass("show");
            	$(this).children(".btn").removeClass("up");
           	}else{
            	$(this).children(".sonOrder").addClass("show");
            	$(this).children(".btn").addClass("up");
           	}
        });
        $('.title').on('click', function() {
            location.href = '/web-dj-mobile/groupbuy/to/create/activity'
        })
      var mLoading = layer.open({
          type: 2,
          content: '加载中'
        });
      $.ajax({
        type: 'GET',
        url: '/web-dj-mobile/groupbuy/merchant/order/get',
        dataType: 'json',
        success: function(res) {
        layer.close(mLoading)
        if (res.returnCode == 0) {
            var data = []
            data = res.data
            for(var i=0;i<=data.length;i++){
                var packages = data[i].packages
                var productName = [];
                for(var k in packages){
                    productName.push(packages[k].productCount+'件'+ packages[k].productName)
                }
                data[i].productName = productName.join('+');
                var htmladd=''
                htmladd +='<div class="orderList">';
                    htmladd +='<p>';
                        htmladd +='<span class="orderList-title">'+data[i].activityName+'</span>'; 
                    htmladd +='</p>';
                    htmladd +='<p class="orderNmae">'+data[i].productName+'</p>';
                    htmladd +='<p>';
                        htmladd +='<span>记单量合计:</span>'; 
                        htmladd +='<span>'+data[i].orderNumber+'套</span>';
                    htmladd +='</p>';
                    htmladd +='<p>';
                        htmladd +='<span>订单总额:</span>'; 
                        htmladd +='<span>'+data[i].orderAmount+'元</span>';
                    htmladd +='</p>';
                    htmladd +='<p>';
                        htmladd +='<span>手机号码:</span>'; 
                        htmladd +='<span>'+data[i].phone+'</span>';
                    htmladd +='</p>';  
                    htmladd +='<p>';
                        htmladd +='<span >返回补贴:</span>'; 
                        htmladd +='<span class="return">'+data[i].rebateAmount+'元</span>';
                        htmladd +='<span><img src="../../static/images/lijlianxi.png"/><a href="tel:'+data[i].phone+'"/></span>';
                      
                    htmladd +='</p>'; 
                    htmladd +='<div class="btn down"></div>'; 
                htmladd +='</div>';        
                $('.orderDetail').append(htmladd)
                if(data[i].subOrders){
                    var subOrders = data[i].subOrders
                    for(var j=0; j<subOrders.length; j++){
                        if(data[i].id==subOrders[j].parentOrderId){
                            $('.orderList').eq(i).append('<div class="sonOrder"><p><span>订单编号:</span><span>'+subOrders[j].orderId+'</span></p><p><span>采购数量:</span><span>'+subOrders[j].orderNumber+'</span></p><p class="date"><span>采购时间:</span><span>'+new Date(subOrders[j].updatedDate).format('yyyy-MM-dd HH:mm:ss')+'</span></p></div>')
                        }else{
                            return 
                        }
                        
                    }
                }
            }
            
        } else {
            layer.open({
            content: res.message || '出错了,请联系管理员',
            btn: '关闭'
            });
        }
        }
    })

    })
    
    Date.prototype.format = function(formatStr)   
		{   
		    var str = formatStr;   
		    var Week = ['日','一','二','三','四','五','六'];  
		  
		    str=str.replace(/yyyy|YYYY/,this.getFullYear());   
		    str=str.replace(/yy|YY/,(this.getYear() % 100)>9?(this.getYear() % 100).toString():'0' + (this.getYear() % 100));   
		  
		    str=str.replace(/MM/,this.getMonth()>9?this.getMonth().toString():'0' + this.getMonth());   
		    str=str.replace(/M/g,this.getMonth());   
		  
		    str=str.replace(/w|W/g,Week[this.getDay()]);   
		  
		    str=str.replace(/dd|DD/,this.getDate()>9?this.getDate().toString():'0' + this.getDate());   
		    str=str.replace(/d|D/g,this.getDate());   
		  
		    str=str.replace(/hh|HH/,this.getHours()>9?this.getHours().toString():'0' + this.getHours());   
		    str=str.replace(/h|H/g,this.getHours());   
		    str=str.replace(/mm/,this.getMinutes()>9?this.getMinutes().toString():'0' + this.getMinutes());   
		    str=str.replace(/m/g,this.getMinutes());   
		  
		    str=str.replace(/ss|SS/,this.getSeconds()>9?this.getSeconds().toString():'0' + this.getSeconds());   
		    str=str.replace(/s|S/g,this.getSeconds());   
		  
		    return str;   
		} 
  </script>
</html>