Authored by 郝肖肖

电子票接口

... ... @@ -523,4 +523,66 @@ class CartData
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(API_URL, $param);
}
/**
* 电子票添加和查询
* @param int $uid 用户ID
* @param type int $productSku 产品sku
* @param type int $buyNumber 购买数量,范围1-4
* @param type int $yohoNum yoho币
* @return type []
*/
public static function addTicket($uid, $productSku, $buyNumber, $yohoNum = 0)
{
$param = Yohobuy::param();
$param['method'] = 'app.shopping.submitTicket';
$param['uid'] = intval($uid);
$param['product_sku'] = intval($productSku);
$param['buy_number'] = intval($buyNumber);
//yoho币转换成元,1yoho币等于一分钱
if (isset($yohoNum) && $yohoNum > 0) {
$param['use_yoho_coin'] = $yohoNum / 100;
}
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(API_URL, $param);
}
/**
* 电子票下单
* @param type int $uid 用户ID
* @param type int $productSku 产品sku
* @param type int $buyNumber 购买数量,范围1-4
* @param type string $mobile 手机号码
* @param type int $yohoNum yoho币
* @return type []
*/
public static function submitTicket($uid, $productSku, $buyNumber, $mobile, $yohoNum = 0)
{
$param = Yohobuy::param();
$param['method'] = 'app.shopping.submitTicket';
$param['uid'] = intval($uid);
$param['product_sku'] = intval($productSku);
$param['buy_number'] = intval($buyNumber);
$param['mobile'] = $mobile;
//yoho币转换成元,1yoho币等于一分钱
if (isset($yohoNum) && $yohoNum > 0) {
$param['use_yoho_coin'] = $yohoNum / 100;
}
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(API_URL, $param);
}
/**
* 根据订单号获取电子票二维码
* @param type $orderCode
* @return type
*/
public static function getQrByOrderCode($orderCode)
{
$param = Yohobuy::param();
$param['method'] = 'app.SpaceOrders.getQrByOrderCode';
$param['order_code'] = intval($orderCode);
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(API_URL, $param);
}
}
... ...
... ... @@ -152,16 +152,19 @@
<div class="trade-content">
<div id="type-chose" class="type-chose">
{{#if isTicket}}
<div class="chose-color row clearfix">
<div class="chose-ticket chose-color row clearfix">
<span class="title pull-left">选日期:</span>
<ul class="colors pull-left clearfix">
{{#each colors}}
<li class="{{#if focus}}focus{{/if}} {{#if disable}}disable{{/if}} pull-left" title="{{title}}" data-color="{{name}}" data-total="{{total}}">
<img src="{{src}}">
</li>
{{/each}}
</ul>
<div class="size-wrapper pull-left">
<ul class="colors pull-left clearfix">
{{#each colors}}
<li class="{{#if focus}}focus{{/if}} {{#if disable}}disable{{/if}} pull-left" title="{{title}}" data-color="{{name}}" data-total="{{total}}">
{{name}}
</li>
{{/each}}
</ul>
</div>
</div>
<div class="chose-size row clearfix">
<span class="title pull-left">
选区域:
... ... @@ -169,8 +172,9 @@
<div id="sizes" class="size-wrapper pull-left">
{{#each colors}}
<ul class="size{{#unless focus}} hide{{/unless}}">
{{!-- 电子门票data-num最多可以买4张 --}}
{{#each size}}
<li {{#unless num}}class="disable"{{/unless}} data-sku="{{sku}}" data-num="{{num}}" data-name="{{name}}">{{name}}</li>
<li {{#unless num}}class="disable"{{/unless}} data-sku="{{sku}}" data-num="4" data-name="{{name}}">{{name}}</li>
{{/each}}
<span class="size-warn warn-tip hide">
... ...
... ... @@ -256,7 +256,7 @@
}
}
.chose-size {
.chose-size, .chose-ticket {
font-size: 12px;
.title {
... ...
... ... @@ -70,7 +70,7 @@ class ItemModel
}
//电子门票
$goodsInfo['isTicket'] = TRUE;
$goodsInfo['isTicket'] = $baseInfo['isTicket'] = TRUE;
// 商品价格
if (isset($baseInfo['productPriceBo'])) {
... ... @@ -1010,6 +1010,10 @@ class ItemModel
$skuGoods = array();//sku商品
$defaultImage = '';//默认图
$chooseSkuFlag = false;//选中sku状态
//摸拟数据
$dates = array('9月16 12:30','9月17 12:30','9月18 12:30','9月19 12:30','9月20 12:30','9月21 全天可用','9月13 12:30');
$areas = array();
if (!empty($baseInfo['goodsList'])) {
$goodsGroup = array();
foreach ($baseInfo['goodsList'] as $pos => $value) {
... ... @@ -1022,14 +1026,17 @@ class ItemModel
//商品列表
$goodsGroup = array(
'productSkc' => $value['productSkc'],
'src' => Images::getImageUrl($value['colorImage'], 40, 40),
'title' => trim($baseInfo['productName']).' '.$value['colorName'],
'name' => $value['colorName'],
'name' => $dates[$pos % 7],
'focus'=> false,
'total' => 0,
'thumbs' => array(),
'size' => array(),
);
//不是门票的要显示图片
if (empty($baseInfo['isTicket'])) {
$goodsGroup['src'] = Images::getImageUrl($value['colorImage'], 40, 40);
}
foreach ($value['goodsImagesList'] as $goods) {
if(!empty($goods['imageUrl'])) {
... ...