new tpl_wpush_fcode($fc_id,$this->price_calcer())],"webpush/fcode",'wap'); } public function updateOp() { return self::outsuccess(['tpl' => new tpl_wpush_update()],"webpush/fcode",'wap'); } public function bonusOp() { } } class tpl_wpush_fcode { private $mFcode; private $mPriceCalcer; public function __construct($fc_id,bonus\IPriceCalculate $price_calcer) { $this->mPriceCalcer = $price_calcer; $mod_fcode = Model('goods_fcode'); $this->mFcode = $mod_fcode->getGoodsFCode(['fc_id' => $fc_id],true); } private function schema() { $common_id = $this->mFcode['goods_commonid']; $batch_code = $this->mFcode['batch_code']; $mobile = $this->mFcode['mobile']; $url = BASE_SITE_URL . "/mobile/index.php?act=fcode&op=index&common_id={$common_id}&batch_code={$batch_code}&mobile={$mobile}"; $schema = schema_helper::openurl("购物首单礼",$url); return $schema; } private function summary() { $common_id = intval($this->mFcode['goods_commonid']); $helper = new goods_helper($this->mPriceCalcer,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 = "

恭喜您获得新客专享礼

{$summary['goods_mobile_name']}

{$price}元购

天猫价{$marketprice}

查看详情
"; return $str; } } class tpl_wpush_update { public function __construct() { } public function show() { $head_img = RESOURCE_SITE_URL . "/mobile/push/update/head_img.png"; echo "
升级到新版本
"; echo "
"; $tips = $this->tips(); $i = 1; foreach ($tips as $tip) { echo "

{$i}.{$tip}

"; ++$i; } echo "
立即升级
"; } private function tips() { $tips = $GLOBALS['setting_config']['mobile_update_tips']; $artips = explode('#',$tips); return $artips; } }