模块PHP代码中添加HTML代码,例如:
店铺二维码 <img src="<?=getErcode($_shop->id,90,4)?>"/></div>商品二维码 <img src="<?=getErcode($item['id'],70,2)?>
<img src="<?=getErcode($_shop->id,90,4)?>"/></div>
<img src="<?=getErcode($item['id'],70,2)?>
(二维码数据:1为集市商品,2为天猫商品,3为集市店铺,4为天猫店铺,5为微淘)
//生成二维码 function getErcode($erId, $widthHeight = "90", $type = "1") { switch($type){ case 1: $code = 'type=ci&item_id='.$erId.'&v=1';break; case 2: $code = 'v=1&type=bi&item_id='.$erId;break; case 3: $code = 'type=cs&shop_id='.$erId.'&v=1';break; case 4: $code = 'v=1&type=bs&shop_id='.$erId;break; case 5: $code = 'type=we&we_id='.$erId.'&v=1';break; default: $code = 'type=ci&item_id='.$erId.'&v=1'; } $imgsrc = 'http://gqrcode.alicdn.com/img?'.$code.'&w='.$widthHeight.'&h='.$widthHeight; return $imgsrc; }
本站装修模板和素材资源均来源于网络,如果有图片侵犯了您的产权,请联系我们,我们尽快处理。 管理员邮箱:2903619511@qq.com
Copyright 2025 © xsheji.com All Rights Reserved 湘ICP备14014746号-3