效果图:

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]