|
@@ -516,36 +516,19 @@ class bonusexControl extends mobileControl
|
|
|
$tmp[$commonid] = $item;
|
|
|
}
|
|
|
|
|
|
- $summarys = [];
|
|
|
+ $goods_list = [];
|
|
|
foreach ($cids as $cid)
|
|
|
{
|
|
|
if(array_key_exists($cid,$tmp)) {
|
|
|
- $summarys[] = $this->simple_summary($tmp[$cid]);
|
|
|
+ $goods_list[] = $tmp[$cid];
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- return $summarys;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- private function simple_summary($goods_info)
|
|
|
- {
|
|
|
- $summary['goods_image'] = cthumb($goods_info['goods_image'],1280,$goods_info['store_id']);
|
|
|
- $summary['goods_name'] = $goods_info['goods_mobile_name'];
|
|
|
- $summary['goods_jingle'] = $goods_info['goods_jingle'];
|
|
|
- $summary['goods_price'] = intval($goods_info['goods_price'] * 100 + 0.5) / 100;
|
|
|
-
|
|
|
- $bonus_price = predeposit_helper::login_bonus_price($goods_info['goods_price'],$rates);
|
|
|
- $summary['bonus_price'] = intval($bonus_price * 100 + 0.5) / 100;
|
|
|
-
|
|
|
- $discount = intval($summary['bonus_price'] * 100 / $goods_info['goods_price'] + 0.5) / 100;
|
|
|
- $summary['discount'] = $discount * 10;
|
|
|
- $summary['price_diff'] = $goods_info['goods_price'] - $summary['bonus_price'];
|
|
|
-
|
|
|
- $goods_id = $goods_info['goods_id'];
|
|
|
- $summary['goods_url'] = BASE_SITE_URL . "/mobile/index.html?#/goods_detail?goods_id={$goods_id}";
|
|
|
+ $helper = new goods_helper();
|
|
|
+ $ret = $helper->summary($goods_list,$related_goods);
|
|
|
|
|
|
- return $summary;
|
|
|
+ return $ret['summary'];
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -717,10 +700,6 @@ function bonus_output_mine($output)
|
|
|
if($show_down) {
|
|
|
echo('<div class="prompt bouns_pro">');
|
|
|
echo("<p>红包已放至账户<span>{$mobile}</span></p>");
|
|
|
- echo('<p>登录APP即可使用</p>');
|
|
|
- echo('</div>');
|
|
|
- echo('<div class="link">');
|
|
|
- echo('<p><a href="javascript:void(0)" id="link"><span class="down_icon"></span>点击下载熊猫美妆APP</a></p>');
|
|
|
echo('</div>');
|
|
|
}
|
|
|
}
|
|
@@ -818,8 +797,10 @@ function bonus_output_bindedinfo($output)
|
|
|
$user_id = $bonus->user_id();
|
|
|
if(array_key_exists($user_id,$avatars)) {
|
|
|
$avatar = $avatars[$user_id]['avatar'];
|
|
|
+ $discount = intval($avatars[$user_id]['discount'] * 100 + 0.5);
|
|
|
} else {
|
|
|
$avatar = RESOURCE_SITE_URL . '/mobile/defimg/female.png';
|
|
|
+ $discount = 0;
|
|
|
}
|
|
|
|
|
|
echo('<div class="li">');
|
|
@@ -829,6 +810,11 @@ function bonus_output_bindedinfo($output)
|
|
|
|
|
|
echo('<div class="li_left">');
|
|
|
echo('<p class="p">' . $bonus->user_name() .'</p>');
|
|
|
+ if($discount !== 0) {
|
|
|
+ $discount = $discount / 100;
|
|
|
+ echo "<p class=\"prompt_s\">已累计节省{$discount}元</p>";
|
|
|
+ }
|
|
|
+
|
|
|
if(empty($bonus->user_comment()))
|
|
|
{
|
|
|
if($bonus->user_mobile() == $_SESSION['member_mobile']) {
|
|
@@ -899,6 +885,104 @@ function share_image($output)
|
|
|
return $share['img_url'];
|
|
|
}
|
|
|
|
|
|
+class tpl_goods
|
|
|
+{
|
|
|
+ private $mSummary;
|
|
|
+ public function reinit($summary) {
|
|
|
+ $this->mSummary = $summary;
|
|
|
+ }
|
|
|
+ public function base_info()
|
|
|
+ {
|
|
|
+ $country = $this->mSummary['brand_country'];
|
|
|
+ if(empty($country)) {
|
|
|
+ $str = "<p class=\"text_left goods_name\">{$this->mSummary['goods_mobile_name']}</p>";
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ $str = "<p class=\"text_left goods_name\">{$country}·{$this->mSummary['goods_mobile_name']}</p>";
|
|
|
+ }
|
|
|
+ $str .= "<p class=\"text_left desc\">{$this->mSummary['goods_jingle']}</p>";
|
|
|
+ return $str;
|
|
|
+ }
|
|
|
+ public function price()
|
|
|
+ {
|
|
|
+ $act_id = $this->mSummary['act_id'];
|
|
|
+ if($act_id > 0) {
|
|
|
+ return $this->groupbuy();
|
|
|
+ } else {
|
|
|
+ return $this->normal();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ private function normal()
|
|
|
+ {
|
|
|
+ $type = $this->discount_type();
|
|
|
+ if($type == 1) {
|
|
|
+ $discount = $this->mSummary['goods_price'] - $this->mSummary['price_diff'];
|
|
|
+ $str = "<span class=\"conserve\">立省{$discount}元</span>";
|
|
|
+ $str .= "<span class=\"look_btn center\">查看</span>";
|
|
|
+ } else {
|
|
|
+ $discount = $this->mSummary['bonus_price'] / $this->mSummary['goods_price'];
|
|
|
+ $str = "<span class=\"conserve\">{$discount}折</span>";
|
|
|
+ $str .= "<span class=\"look_btn center\">查看</span>";
|
|
|
+ }
|
|
|
+
|
|
|
+ $market_price = intval($this->mSummary['goods_price'] * 100 + 0.5) / 100;
|
|
|
+ $outstr = "<div class=\"f_left\">
|
|
|
+ <p class=\"text_left desc\">专柜价{$market_price}元</p>
|
|
|
+ <p class=\"text_left bonus_price\"><span class=\"bonus_icon\"></span>{$this->mSummary['bonus_price']}{$str}</p>
|
|
|
+ </div>";
|
|
|
+
|
|
|
+ return $outstr;
|
|
|
+ }
|
|
|
+
|
|
|
+ private function discount_type()
|
|
|
+ {
|
|
|
+ $price = $this->mSummary['goods_price'];
|
|
|
+ if($price > 100) {
|
|
|
+ return 1;
|
|
|
+ } else {
|
|
|
+ return 2;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ private function groupbuy()
|
|
|
+ {
|
|
|
+ $type = $this->discount_type();
|
|
|
+ if($type == 1) {
|
|
|
+ $discount = $this->mSummary['goods_price'] - $this->mSummary['price_diff'];
|
|
|
+ $str = "<span class=\"conserve\">立省{$discount}元</span>";
|
|
|
+ $str .= "<span class=\"look_btn center\">查看</span>";
|
|
|
+
|
|
|
+ } else {
|
|
|
+ $discount = $this->mSummary['bonus_price'] / $this->mSummary['goods_price'];
|
|
|
+ $str = "<span class=\"conserve\">{$discount}折</span>";
|
|
|
+ $str .= "<span class=\"look_btn center\">查看</span>";
|
|
|
+ }
|
|
|
+
|
|
|
+ $market_price = intval($this->mSummary['goods_price'] * 100 + 0.5) / 100;
|
|
|
+ $outstr = "<div class=\"f_left\">
|
|
|
+ <p class=\"text_left desc\">专柜价{$market_price}元</p>
|
|
|
+ <p class=\"text_left bonus_price\">¥{$this->mSummary['bonus_price']}{$str}</p>
|
|
|
+ </div>";
|
|
|
+
|
|
|
+ return $outstr;
|
|
|
+ }
|
|
|
+ public function showicon()
|
|
|
+ {
|
|
|
+ $act_id = $this->mSummary['act_id'];
|
|
|
+ if($act_id > 0) {
|
|
|
+ $str = "<div class=\"grab_icon\"></div>";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if($this->mSummary['is_new']) {
|
|
|
+ $str = "<span class=\"new_icon\"></span>";
|
|
|
+ } else {
|
|
|
+ $str = '';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return $str;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
function bonnus_out_goods($output)
|
|
|
{
|
|
|
$summarys = $output['summarys'];
|
|
@@ -906,33 +990,28 @@ function bonnus_out_goods($output)
|
|
|
|
|
|
|
|
|
echo '<div class="prompt text_left">
|
|
|
- <p class="pro">已达内买价的商品(去APP内部查看详情)</p>
|
|
|
+ <p class="pro">已达员工福利商品<span class="bonus_icon bonus_icon_m_l"></span><span class="prompt_d">红包价=专柜价-红包</span></p>
|
|
|
</div>';
|
|
|
|
|
|
+ $printer = new tpl_goods();
|
|
|
echo '<div class="goods_items">';
|
|
|
foreach ($summarys as $summary)
|
|
|
{
|
|
|
+ $printer->reinit($summary);
|
|
|
+
|
|
|
echo
|
|
|
"<div class='goods_box'>
|
|
|
<a href=\"{$summary['goods_url']}\" style=\"color:#7E7E7E\">
|
|
|
<div class='goods'>
|
|
|
<div>
|
|
|
- <img src=\"{$summary['goods_image']}\">
|
|
|
- </div>
|
|
|
+ <img src=\"{$summary['goods_image_url']}\">
|
|
|
+ </div>
|
|
|
<div class=\"goods_msg\">
|
|
|
- <p class=\"text_left goods_name\">{$summary['goods_name']}</p>
|
|
|
- <p class=\"text_left desc\">{$summary['goods_jingle']}</p>
|
|
|
+ {$printer->base_info()}
|
|
|
<div class=\"price_box\">
|
|
|
- <div class=\"f_left\">
|
|
|
- <p class=\"text_left desc\">专柜价{$summary['goods_price']}元</p>
|
|
|
- <p class=\"text_left bonus_price\"><span class=\"bonus_icon\"></span>{$summary['bonus_price']}</p>
|
|
|
- </div>
|
|
|
- <div class=\"f_right discount\">
|
|
|
- <p class=\"discounts_box\"><span class=\"discounts\">{$summary['discount']}</span>折</p>
|
|
|
- <p class=\"conserve\">立省{$summary['price_diff']}元</p>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class=\"badge\" style=\"background:#3CB638;\">新品</div>
|
|
|
+ {$printer->price()}
|
|
|
+ </div>
|
|
|
+ {$printer->showicon()}
|
|
|
</div>
|
|
|
</div>
|
|
|
</a>
|
|
@@ -945,16 +1024,16 @@ function bonus_out_rule()
|
|
|
{
|
|
|
echo
|
|
|
'<div class="prompt text_left">
|
|
|
- <p class="pro">红包细则</p>
|
|
|
+ <p class="pro">红包使用方法</p>
|
|
|
</div>
|
|
|
<div class="briefing text_left">
|
|
|
- <p>1. 丽人丽妆公司运营天猫上70多家化妆品品牌旗舰店。</p>
|
|
|
- <p><span style="float: left;margin-bottom: 1px;">2.</span> 双十一单日销售额达10亿,占天猫美妆市场一半以上,是<span style="color: red">天猫美妆的正品保障</span>。</p>
|
|
|
- <p><span style="float: left;margin-bottom: 1px;">3.</span> 熊猫美妆APP内所有化妆品均来自品牌官方,百分百正品,假一赔十。</p>
|
|
|
- <p><span style="float: left;margin-bottom: 1px;">4.</span> APP内专柜价与天猫旗舰店专柜价保持一致,APP内所有商品,都可享用红包,享受员工优惠。</p>
|
|
|
- <p>5. 红包可叠加使用。</p>
|
|
|
+ <p><span>1.</span> 在熊猫美妆APP或微商城中,购物即可使用。</p>
|
|
|
+ <p><span>3.</span> 购物时,红包可叠加使用。</p>
|
|
|
+ <p><span>2.</span> 也可以在APP中,把红包分享给亲友。</p>
|
|
|
+ <p><span>4.</span> 红包是丽人员工福利,请勿分享给非亲非故之人。</p>
|
|
|
+
|
|
|
<div class="center briefing_address">
|
|
|
- 公司地址:上海市徐汇区番禺路900号番禺大楼
|
|
|
+ 公司地址:上海市徐汇区番禺路876号
|
|
|
</div>
|
|
|
</div>';
|
|
|
}
|