<div class="my-client" th:each="customer : ${listData}">
    <div class="weui-cell weui-cell_access" th:onclick="'goToUrl(\'' + @{/customer/customerdetail(customerId=${customer.id})} + '\')'">
        <div class="weui-cell__hd" th:with="customerName=${customer.name}">
            <p class="tu-text"
               th:text="${#strings.substring(customerName,0,#strings.length(customerName)>3?3:#strings.length(customerName))}"></p>
        </div>
        <div class="weui-cell__bd">
            <p th:switch="${customer.traceStatus}">
                <span>
                    <a th:href="|tel:${customer.phone}|" class="my-client__tel" th:text="${customer.phone}"></a>
                </span>
                <span class="my-client__span" th:case="'1'">有效</span>
                <span class="my-client__span" th:case="'2'">已购</span>
                <span class="my-client__span" th:case="'3'">我购</span>
                <span class="my-client__span" th:case="'4'">暂缓</span>
            </p>
            <p class="my-client__tag" th:switch="${customer.buyIntention}">
                <span><i class="iconfont">&#xe6ea;</i><span th:text="${customer.managerName}"></span></span>
                <span th:case="'1'"><i class="iconfont">&#xe684;</i>A</span>
                <span th:case="'2'"><i class="iconfont">&#xe684;</i>B</span>
                <span th:case="'3'"><i class="iconfont">&#xe684;</i>C</span>
                <span th:case="'4'"><i class="iconfont">&#xe684;</i>D</span>
                <span th:case="'5'"><i class="iconfont">&#xe684;</i>E</span>
                <span th:case="''"><i class="iconfont">&#xe684;</i>待定</span>
            </p>
        </div>
        <span class="collect" th:attr="data=${customer.id}">
            <i th:class="${customer.star} == 1? 'iconfont icon-collect-on' : 'iconfont icon-collect'"
               th:onclick="'javascript:toggleCollect(this,\'' +${customer.starUserId}+'\',\'' +${customer.star}+'\',\'' +${customer.managerId}+'\');'"></i>
        </span>
        <div class="weui-cell__ft"
             th:onclick="'goToUrl(\'' + @{/customer/customerdetail(customerId=${customer.id})} + '\')'"></div>
    </div>
    <!--<c:if test="${customer.lids.selected nq 1}">-->
        <!--<div id="alltag" class="bor-t">-->
            <!--<div class="center" >-->
                <!--<span th:each="label: ${customer.lids}" class="all-tag-item gray" th:data="${label.colorId}" th:attr="dataIndex=${label.labelId}" th:content="${label.labelId}"><p th:text="${label.labelName}"></p></span>-->
            <!--</div>-->
        <!--</div>-->
    <!--</c:if>-->
    <c:if test="${customer.lids.size >1}">
        <div id="alltag" class="all_tag bor-t">
            <div class="center" >
                <span th:each="label: ${customer.lids}" class="all-tag-item gray" th:data="${label.colorId}" th:attr="dataIndex=${label.labelId}" th:content="${label.labelId}"><p th:text="${label.labelName}"></p></span>
            </div>
        </div>
    </c:if>

    <p class="my-client__desc capture" th:text="${customer.content}"></p>
    <div class="weui-flex my-client__bd">
        <!--<a th:href="'javascript:goToUrl(\'' + @{/project/visitrecord(customerId=${customer.id},buyIntention=${customer.buyIntention})} + '\')'"-->
           <!--class="weui-flex__item"><i class="iconfont">&#xe611;</i>回访记录</a>-->
        <!--<a th:href="'javascript:goToUrl(\'' + @{/project/projectcustomers(customerId=${customer.id})} + '\')'"-->
           <!--class="weui-flex__item"><i-->
                <!--class="iconfont">&#xe614;</i>-->
            <!--<span style="position: relative;">约看记录-->
                <!--<span th:class="${customer.newFlag} == 1? 'weui-badge weui-badge_dot' : ''"></span>-->
            <!--</span>-->
        <!--</a>-->
        <a th:href="'javascript:goToUrl(\'' + @{/project/addvisit(customerId=${customer.id},buyIntention=${customer.buyIntention})} + '\')'"
           class="weui-flex__item"><i
                class="iconfont">&#xe60f;</i>添加回访</a>
        <a href="javascript:;" th:onclick="'projectShow('+${customer.id}+')'"   class="weui-flex__item"><i class="iconfont">&#xe775;</i>约看客户</a>
    </div>
    <input type="hidden" id="labelId" name="labelId" th:value="${labelId}" />
</div>

<script type="text/javascript">
    $(function () {
        var tags = document.getElementsByClassName("all-tag-item");
        if(tags != undefined && tags != ''){
            for(var i=0;i<tags.length;i++){
                var value = tags[i].attributes.data.value;
                if(value == 1){
                    tags[i].className = "all-tag-item gray active"
                }
                if(value == 2){
                    tags[i].className = "all-tag-item red active"
                }
                if(value == 3){
                    tags[i].className = "all-tag-item orange active"
                }
                if(value == 4){
                    tags[i].className = "all-tag-item green active"
                }
                if(value == 5){
                    tags[i].className = "all-tag-item blue active"
                }
                if(value == 6){
                    tags[i].className = "all-tag-item darkblue active"
                }
                if(value == 7){
                    tags[i].className = "all-tag-item zi active"
                }
            }
        }
    });

</script>
