效果图:

list.var代码:

$tagstr=dp_InfoTag($r['classid'],$r['id'],'| ',5);
$a=explode('|',$r[hangye]);
foreach($a as $key=>$val)
{
    if($key>0 && $key<(count($a)-1))
   {
        $colorimg.=''.$val.'';
    }
}
$fr=explode("|",$r[hangye]);
$zhe=round(($r[jiage]/$r[yuanjia])*10,1);
$sheng=($r[yuanjia]-$r[jiage]);
$listtemp='
<div class="layui-col-xs4 filter-list-item">
<a href="[!--titleurl--]">
        <div class="text-pic" style="background-images:url([!--titlepic--])"><img src="[!--titlepic--]"></div>
</a>
        <div class="text-info">

              <h1><a href="[!--titleurl--]">'.get_hangye_zw($fr[1]).'[!--title--]</a></h1>
<ul class="jglist">
              <li> <span style="text-decoration:line-through"><i class="fa fa-diamond"></i> [!--yuanjia--]点</span> </li>
              <li> <span>折扣:</span><span> '.$zhe.'折 </span> </li>
              <li> <span>节省:</span><span> '.$sheng.'点 </span> </li>
              <li> <span><i class="fa fa-diamond"></i> [!--jiage--]点</span> </li>
            </ul>
<a href="[!--titleurl--]" target="_blank"><span class="buybtn"><i class="fa fa-plus-square"></i> 查看详情</span></a>
<a href="[!--titleurl--]" target="_blank"><span class="buybtn2"><i class="fa fa-desktop"></i> 查看演示</span></a>

        </div>
    </div>
';

首页灵动标签内计算参考代码:

[e:loop={9,6,0,1,'','newstime DESC'}]
        <div class="layui-col-xs4 home-center-product-item"> 
         <div class="product-wrap"> 
          <div class="product-info"> 
           <a href="<?=$bqr['titleurl']?>" title="<?=$bqr['title']?>" target="_blank"> 
            <div class="product-titlepic">
             <img src="<?=$bqr['titlepic']?>" onerror="this.onerror='';src='<?=$bqr['titlepic']?>'" />
            </div> 
 </a> 
          </div> 
<div class="text-info">

              <h1><a href="<?=$bqr['titleurl']?>"><?=$bqr['title']?></a></h1>
<ul class="jglist">
              <li> <span style="text-decoration:line-through"><i class="fa fa-diamond"></i> <?=$bqr['yuanjia']?> 点</span> </li>

              <li> <span>省:</span><span><?=$bqr['yuanjia']-$bqr['jiage']?> 点</span> </li>
              <li> <span><?=round(($bqr['jiage']/$bqr['yuanjia'])*10,1)?> 折</span> </li>
              <li> <span><!--<i class="fa fa-diamond"></i>--> 售:<?=$bqr['jiage']?> 点</span> </li>
            </ul>
<a href="<?=$bqr['titleurl']?>" target="_blank"><span class="buybtn"><i class="fa fa-plus-square"></i> 查看详情</span></a>
<a href="<?=$bqr['pcurl']?>" target="_blank"><span class="buybtn2"><i class="fa fa-desktop"></i> 查看演示</span></a>

        </div>
         </div> 
        </div> 
[/e:loop]
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。