|
@@ -21,12 +21,11 @@ class webpushControl extends mobileHomeControl
|
|
|
public function fcodeOp()
|
|
|
{
|
|
|
$fc_id = intval($_GET['fc_id']);
|
|
|
- return self::outsuccess(['schema' => new wpush_fcode_tpl($fc_id)],"webpush/fcode",'wap');
|
|
|
+ return self::outsuccess(['tpl' => new wpush_fcode_tpl($fc_id)],"webpush/fcode",'wap');
|
|
|
}
|
|
|
|
|
|
public function bonusOp()
|
|
|
{
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -39,7 +38,7 @@ class wpush_fcode_tpl
|
|
|
$this->mFcode = $mod_fcode->getGoodsFCode(['fc_id' => $fc_id],true);
|
|
|
}
|
|
|
|
|
|
- public function schema() {
|
|
|
+ private function schema() {
|
|
|
$common_id = $this->mFcode['goods_commonid'];
|
|
|
$batch_code = $this->mFcode['batch_code'];
|
|
|
$mobile = $this->mFcode['mobile'];
|
|
@@ -48,4 +47,45 @@ class wpush_fcode_tpl
|
|
|
$schema = schema_helper::openurl("购物首单礼",$url);
|
|
|
return $schema;
|
|
|
}
|
|
|
+ private function summary()
|
|
|
+ {
|
|
|
+ $common_id = intval($this->mFcode['goods_commonid']);
|
|
|
+ $helper = new goods_helper(false);
|
|
|
+ $gids = commonid_helper::instance()->goods_ids($common_id);
|
|
|
+ $ret = $helper->get_spu($common_id,$gids[0],$err);
|
|
|
+
|
|
|
+ $summarys = $ret['summary'];
|
|
|
+ foreach ($summarys as $summary)
|
|
|
+ {
|
|
|
+ if($common_id == $summary['goods_commonid'])
|
|
|
+ return $summary;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function show()
|
|
|
+ {
|
|
|
+ $schema = $this->schema();
|
|
|
+ $summary = $this->summary();
|
|
|
+
|
|
|
+ $price = intval($summary['goods_price'] * 100 + 0.5) / 100;
|
|
|
+ $marketprice = intval($summary['goods_marketprice'] * 100 + 0.5) / 100;
|
|
|
+
|
|
|
+ $str = "<div class=\"push_content\">
|
|
|
+ <a href=\"{$schema}\" class=\"schema_link\">
|
|
|
+ <p class=\"push_label\">恭喜您获得新客专享礼</p>
|
|
|
+ <h3 class=\"push_title\">{$summary['goods_mobile_name']}</h3>
|
|
|
+ <div class=\"goods_img\">
|
|
|
+ <img src=\"{$summary['goods_image_url']}\" class=\"img\">
|
|
|
+ <div class=\"label\">
|
|
|
+ <p class=\"sale_price\">{$price}元购</p>
|
|
|
+ <p class=\"original_price\"><span>专柜价{$marketprice}</span></p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class=\"btn\"><span class=\"look_btn\">查看详情</span></div>
|
|
|
+ </a>
|
|
|
+ </div>";
|
|
|
+ return $str;
|
|
|
+ }
|
|
|
+
|
|
|
}
|