goods1.phtml 2.99 KB
<?php 
$imgSize = '290x388';

foreach ($params['match_list'] as $productID => $_productInfo) {
	$productInfo = $_productInfo['attrs'];
	$price = QINProduct_Models_Price_Client::getPrice($productID);
	if(empty($price)){
		continue;
	}
	$goodsList = QINProduct_Models_Goods_Client::getValidGoodsByProduct($productID);
	if(empty($goodsList)){
		continue;
	}
	$storage = QINProduct_Models_Storage_Client::getTotalStorageByProductId($productID);
	$selectColor = empty($params['params']['color']) ? 0:  $params['params']['color'];
	$showGoods = QLibView_Sidebar::selectGoodsByColor($goodsList,$selectColor);
	
	$product = QINProduct_Models_Product_Client::getOneProduct($productID,'max');
	
	$cnAlphabet = $product['cn_alphabet'];
	$showUrl = QLibConfigs_Static::$siteUrl . QINLib_Utils::getProductUrl($productID, $showGoods['id'], $cnAlphabet);
	$showProductImg = QINLib_Images::QFSImage($showGoods['color_image'], 'goodsimg', $imgSize, 2);
	$yohood = QINProduct_Models_Activities_Link_Client::getActivitiesBySkn($product['erp_product_id'], 1);
	
?>
    <li><b>
        <a href="<?php echo $showUrl;?>" class="goodsListPic">
            <?php if (!empty($yohood)) {?>
            <div id="yohood-tag"><img src="http://static.yohobuy.com/m/v1/img/weixin/yohood_03.png" width="52"/></div>
            <?php }?>
            <img class="lazy" src="http://static.yohobuy.com/images/space.gif" data-original="<?php echo $showProductImg;?>" alt="<?php echo $product['product_name'];?>" width="100%" />
            <div class="absolute goods-tag-big">
		  	<?php
                if(($product['shelve_time'] + 86400 * 14) >= time()){?><div class="clear goods-tag-new"><span class="left">新品到着!</span><span class="right">NEW</span></div><?php }?>
                <?php if($productInfo['promotion_discount'] < 0.5){?><div class="clear goods-tag-sale"><span class="left">打折商品!</span><span class="right">SALE</span></div><?php }?>
                <?php if($product['is_advance'] == 'Y'){?><div class="clear goods-tag-presale"><span class="left">预售商品!</span><span class="right">SALE</span></div><?php }?>
                <?php if($storage <= 2){?><div class="clear goods-tag-tobeout"><span class="left">即将售磬!</span><span class="right">FEW</span></div><?php }?>
                <?php if($product['is_limited'] == 'Y'){?><div class="clear goods-tag-limit"><span class="left">限量!</span><span class="right">LIMITED</span></div><?php }?>
		    </div>
        </a>
        
        
        <p class="goodsListTitle">
            <a href="<?php echo $showUrl;?>">
                <?php print Q_Utils_String::format()->mbSubstr( $product['product_name'],28);?>
            </a>
        </p>
        
        <p class="goodsListPrice">
        <?php if ($price['market_price'] != $price['sales_price']) {?>
        	<span class="mark-price">原价:</span><a class="line"><?php echo $price['list_market_price'];?></a>
        <?php }?>
            <span class="sale-price"><?php echo $price['list_sales_price'];?></span>
        </p></b>
    </li>
<?php }?>