File: /www/wwwroot/ww.snodshop.com/Home/Lib/Action/WidgetsAction.class.php
<?php
defined('THINK_PATH') OR exit();
class WidgetsAction extends akmallAction{
public function form($request){
$page = strtolower(MODULE_NAME);
if($page=='order'){
$page = isset($_GET['tpl'])?trim($_GET['tpl']):'single';
}
$sn = trim($request['id']);
$akmallConfig = parent::akmallConfig();
$info = getCache('Item',array('sn'=>$sn));
$shipping = empty($info['shipping_id'])?array('id'=>0):getCache('Shipping',array('id'=>$info['shipping_id']));
$cookie = array();
if($akmallConfig['record_order']==1){$cookie = cookie('order');$cookie['region'] = explode(' ',$cookie['region']);}
$cookie['ac']=cookie('ac');
$cookie['uid']=cookie('uid');
if(in_array($page,array('index','item')) &&$request['page']!='detail'){
$template = array(
'options'=>$akmallConfig['order_options'],
'theme'=>$akmallConfig['system_theme'],
'show_notice'=>$akmallConfig['show_notice'],
);
}else{
$template = getCache('ItemTemplate',array('id'=>$info['id']),true);
$template['extend'] = json_decode($template['extend'],true);
if($template['template']){
$config = include('Home/Tpl/akmall/'.$template['template'].'/config.php');
$request['options'] = $config['TEMPLATE_OPTIONS'];
}
}
if(!empty($request['template'])) $template = $template['template'] = $request['template'];
$list = array(
'params'=>parent::getItemParams($template['options'],$request['options']),
'product'=>json_decode($info['params'],true),
'extends'=>json_decode($info['extends'],true),
'payment'=>parent::getakmallPayment($sn,'',explode(',', $info['appoint_payment'])), // 增加第三个参数是为指定显示支付方式 Jerry
'akmallConfig'=>$akmallConfig,
'cookie'=>$cookie,
'color'=>json_decode($template['color'],true),
'token'=>password($info['id'].get_client_ip()),
);
foreach($list['payment'] as $payment){$list['paymentDefault'] = $payment;break;}
extract($list);
$html = include("./Public/Common/akmall.form.{$template['theme']}.php");
if(!$html){
$tpl = isset($request['formTemplate'])?$request['formTemplate']:'order';
$html = include('./Public/Common/akmall.form.'.$tpl.'.php');
}
return $html;
}
public function comment($request,$num=1){
$sn = trim($request['id']);
$akmallConfig = parent::akmallConfig();
$info = getCache('Item',array('sn'=>$sn));
return include("./Public/Common/akmall.comment-{$num}.php");
}
public function scroll($request,$num=1){
$sn = trim($request['id']);
$akmallConfig = parent::akmallConfig();
$info = getCache('Item',array('sn'=>$sn));
return include("./Public/Common/akmall.scroll-{$num}.php");
}
}