Authored by 郝肖肖

merage yohoCoin

... ... @@ -259,7 +259,7 @@ class CartData
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(API_URL, $param);
return Yohobuy::get('http://192.168.102.205:8080/gateway/', $param);
}
/**
... ... @@ -303,7 +303,7 @@ class CartData
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(API_URL, $param);
return Yohobuy::get('http://192.168.102.205:8080/gateway/', $param);
}
/**
... ... @@ -568,7 +568,7 @@ class CartData
}
$param['client_secret'] = Sign::getSign($param);
$data = Yohobuy::get(API_URL, $param);
$data = Yohobuy::get('http://192.168.102.205:8080/gateway/', $param);
//展览票不显示区域,上面要求的。@高扬、@徐洪云,2016/7/6
if (isset($data['data']) && !empty($data['data']['goods_list'])) {
... ...
... ... @@ -368,22 +368,47 @@
</dl>
{{/if}}
<dl class="play-bi-pan pan">
<dt>使用有货币支付</dt>
<dt class="{{#unless yohoCoinCompute.yohoCoinClick}}not-btn{{/unless}}">
<span class="not-btn-tip red {{#if yohoCoinCompute.yohoCoinClick}}hide{{/if}}">抱歉,您的订单实付款不满足有货币使用条件</span>使用有货币支付
</dt>
<dd>
<div class="play-pan">
<div class="strong">
使用有货币:
<input type="text" class="textbox" id="biprice" data-bi="{{ownYohoCoin}}" value="0" /> 个
</div>
<p >
您目前有有货币 <em class="strong">{{ownYohoCoin}}</em> 个
</p>
<p class="errbitip red"></p>
<div class="btn-group clearfix">
<input type="button" class="ok" value="确定" id="bisubmit"/>
<input type="button" class="cancel cancel-bi" value="取消"/>
</div>
</div>
<div class="errbitip red"></div>
<ul class="play-pan" id="biprice" data-yoho-coin-num={{yohoCoinCompute.yohoCoinNum}} data-yoho-coin-click={{yohoCoinCompute.yohoCoinClick}}>
<li>
<div class="float-left num-list-width">
有货币满<span class="sign-amount num-limit-coin">{{yohoCoinCompute.yoho_coin_pay_rule.num_limit}}</span>个即可使用,每次使用有货币为<span class="sign-amount num-limit-coin">{{yohoCoinCompute.yoho_coin_pay_rule.num_limit}}</span>的整数倍
</div>
<div class="float-right yoho-coin-help">?
<div class="yoho-coin-help-dialog hide">
<span class="arrow-up"></span>
<div class="yoho-coin-help-dialog-title">有货币使用条件:</div>
<div class="yoho-coin-help-dialog-content">
<ul>
<li>1.订单金额大于20元(含20元)</li>
<li>2.有货币数量大于<span class="num-limit-coin">{{yohoCoinCompute.yoho_coin_pay_rule.num_limit}}</span>个(含<span class="num-limit-coin">{{yohoCoinCompute.yoho_coin_pay_rule.num_limit}}</span>个)</li>
<li>3.每笔支付不得超过应付金额{{yohoCoinCompute.yoho_coin_pay_rule.max_pay_rate_desc}}</li>
<li>备注:使用有货币数量为<span class="num-limit-coin">{{yohoCoinCompute.yoho_coin_pay_rule.num_limit}}的整数倍,100有货币抵1元。</li>
</ul>
</div>
</div>
</div>
</li>
<li>
您当前共有有货币<span class="sign-amount totalYohoCoinNum">{{yohoCoinCompute.totalYohoCoinNum}}</span>个,可用<span class="sign-amount yohoCoinNum">{{yohoCoinCompute.yohoCoinNum}}</span> 个
</li>
<li>
本次使用有货币<span class="sign-amount yohoCoinNum">{{yohoCoinCompute.yohoCoinNum}}</span>个 抵扣<span class="sign-amount yohoCoin">¥{{yohoCoinCompute.yohoCoin}}</span>
</li>
<li>
<div class="float-left btn-group clearfix">
<input type="button" class="ok" value="确定" id="bisubmit"/>
<input type="button" class="cancel cancel-bi" value="取消"/>
</div>
<div class="float-right">
<a class="yoho-coin-help-link" href="/help/?category_id=87" target="_blank">有货币使用规则?</a>
</div>
</li>
</ul>
</dd>
</dl>
... ...
... ... @@ -112,22 +112,47 @@
</ul>
<dl class="play-bi-pan pan">
<dt>使用有货币支付</dt>
<dt class="{{#unless yohoCoinCompute.yohoCoinClick}}not-btn{{/unless}}">
<span class="not-btn-tip red {{#if yohoCoinCompute.yohoCoinClick}}hide{{/if}}">抱歉,您的订单实付款不满足有货币使用条件</span>使用有货币支付
</dt>
<dd>
<div class="play-pan">
<div class="strong">
使用有货币:
<input type="text" class="textbox" id="biprice" data-bi="{{ownYohoCoin}}" value="0" />
</div>
<p >
您目前有有货币 <em class="strong">{{ownYohoCoin}}</em>
</p>
<p class="errbitip red"></p>
<div class="btn-group clearfix">
<input type="button" class="ok" value="确定" id="bisubmit"/>
<input type="button" class="cancel cancel-bi" value="取消"/>
</div>
</div>
<div class="errbitip red"></div>
<ul class="play-pan" id="biprice" data-yoho-coin-num={{yohoCoinCompute.yohoCoinNum}} data-yoho-coin-click={{yohoCoinCompute.yohoCoinClick}}>
<li>
<div class="float-left num-list-width">
有货币满<span class="sign-amount num-limit-coin">{{yohoCoinCompute.yoho_coin_pay_rule.num_limit}}</span>个即可使用,每次使用有货币为<span class="sign-amount num-limit-coin">{{yohoCoinCompute.yoho_coin_pay_rule.num_limit}}</span>的整数倍
</div>
<div class="float-right yoho-coin-help">?
<div class="yoho-coin-help-dialog hide">
<span class="arrow-up"></span>
<div class="yoho-coin-help-dialog-title">有货币使用条件:</div>
<div class="yoho-coin-help-dialog-content">
<ul>
<li>1.订单金额大于20元(含20元)</li>
<li>2.有货币数量大于<span class="num-limit-coin">{{yohoCoinCompute.yoho_coin_pay_rule.num_limit}}</span>个(含<span class="num-limit-coin">{{yohoCoinCompute.yoho_coin_pay_rule.num_limit}}</span>个)</li>
<li>3.每笔支付不得超过应付金额{{yohoCoinCompute.yoho_coin_pay_rule.max_pay_rate_desc}}</li>
<li>备注:使用有货币数量为<span class="num-limit-coin">{{yohoCoinCompute.yoho_coin_pay_rule.num_limit}}的整数倍,100有货币抵1元。</li>
</ul>
</div>
</div>
</div>
</li>
<li>
您当前共有有货币<span class="sign-amount totalYohoCoinNum">{{yohoCoinCompute.totalYohoCoinNum}}</span>个,可用<span class="sign-amount yohoCoinNum">{{yohoCoinCompute.yohoCoinNum}}</span>
</li>
<li>
本次使用有货币<span class="sign-amount yohoCoinNum">{{yohoCoinCompute.yohoCoinNum}}</span>个 抵扣<span class="sign-amount yohoCoin"{{yohoCoinCompute.yohoCoin}}</span>
</li>
<li>
<div class="float-left btn-group clearfix">
<input type="button" class="ok" value="确定" id="bisubmit"/>
<input type="button" class="cancel cancel-bi" value="取消"/>
</div>
<div class="float-right">
<a class="yoho-coin-help-link" href="/help/?category_id=87" target="_blank">有货币使用规则?</a>
</div>
</li>
</ul>
</dd>
</dl><!--/play-bi-pan pan-->
</div><!--/play-right-->
... ...
... ... @@ -9,7 +9,8 @@ var $ = require('yoho.jquery'),
$receiptInfoSaveBtn = $('.receipt-info .save-receipt'),
$receiptInfoCancelBtn = $('.receipt-info .cancel-receipt'),
$eReceiptBtn = $('.receipt-type .e-receipt'),
$paperReceiptBtn = $('.receipt-type .paper-receipt');
$paperReceiptBtn = $('.receipt-type .paper-receipt'),
$yohoCoinHelp = $('.yoho-coin-help');
var address = require('./address'),
... ... @@ -112,6 +113,10 @@ var Order = {
var pan = $(this).parent('dl.pan');
if ($(this).hasClass('not-btn')) {
return false;
}
if (pan.find('dd').is(':hidden')) {
c.winShow(pan);
... ... @@ -272,15 +277,21 @@ var Order = {
e.$toPay.html((data.last_order_amount).toFixed(2));
//有货币清零状态更新
$('#biprice').val(accMul(100, data.use_yoho_coin));
if (~~data.use_yoho_coin === 0) {
$('.errbitip').text('');
} else {
$('.errbitip').text('抵扣' + data.use_yoho_coin.toFixed(2) + '元');
$('dl.play-bi-pan').find('dt').removeClass('not-btn');
$('.not-btn-tip').addClass('hide');
if (!data.yohoCoinCompute.yohoCoinClick) {
//不可以使用状态
$('dl.play-bi-pan').find('dt').addClass('not-btn');
$('.not-btn-tip').removeClass('hide');
}
$('#biprice').data('.yoho-coin-click', data.yohoCoinCompute.yohoCoinClick);
$('#biprice').find('.num-limit-coin').html(data.yohoCoinCompute.yoho_coin_pay_rule.num_limit);
$('#biprice').find('.totalYohoCoinNum').html(data.yohoCoinCompute.totalYohoCoinNum);
$('#biprice').find('.yohoCoinNum').html(data.yohoCoinCompute.yohoCoinNum);
$('#biprice').find('.yohoCoin').html(data.yohoCoinCompute.yohoCoin);
//使用的红包
envelopesVal = e.$useEnvelopesInput.data('all') - data.use_red_envelopes;
if (~~data.use_red_envelopes > 0) {
e.$useEnvelopes.find('span').html('-¥' + data.use_red_envelopes.toFixed(2));
e.$useEnvelopes.find('input').attr('data-use', data.use_red_envelopes);
... ... @@ -378,7 +389,7 @@ var Order = {
var $juangroupInput = $('.play-juan.is-select input[name="juangroup"]:checked');
var expressVal = $('.express-list input[name="carriagegroup"]:checked').val();
var biVal = $('#biprice.is-select').val();
var biVal = $('#biprice.is-select').data('yoho-coin-num') * 1;
var codeVal = $juangroupInput.val();
var cartType = $('.address-manage').attr('cart-type');
var redEnvelopes = $('.use-envelopes input:checked').attr('data-use');
... ... @@ -462,9 +473,11 @@ var Order = {
e.$loading.show();
options = {
type: 'POST',
url: '/cart/index/orderCompute',
data: d,
success: function(data) {
... ... @@ -497,18 +510,18 @@ var Order = {
// 优惠券修改
$(document).on('click', '.juan-modify', function() {
var $pan = $('.play-juan-pan');
c.winShow($pan);
c.winShow($('.play-juan-pan'));
});
e.$biok.click(function() {
var pan = $(this).parents('dl.pan');
var juanText;
if (!$('#biprice').data('yoho-coin-click')) {
$('.errbitip').html('抱歉,您的订单实付款不满足有货币使用条件');
return true;
}
$('#biprice').addClass('is-select');
getSelectData(function(d) {
... ... @@ -517,43 +530,33 @@ var Order = {
juanText = $('.play-juan input[value="' + d.couponCode + '"]').next().text();
}
//if (d.yohoCoin * 1 === 0) {
if (!/^\d+$/.test(d.yohoCoin + '') || d.yohoCoin * 1 === 0) {
if (d.yohoCoin * 1 <= 0) {
$('.errbitip').html('请输入一个正整数');
$('#biprice').removeClass('is-select');
return false;
}
} else if (d.yohoCoin * 1 > $('.play-pan em').text() * 1) {
$('.errbitip').html('您的有货币不足');
$('#biprice').removeClass('is-select');
} else {
e.$loading.show();
options = {
type: 'POST',
url: '/cart/index/orderCompute',
data: d,
success: function(data) {
e.$loading.hide();
e.$loading.show();
options = {
type: 'POST',
url: '/cart/index/orderCompute',
data: d,
success: function(data) {
if (data.code === 200) {
e.$loading.hide();
u.render(data.data, juanText);
c.winHide(pan);
if (data.code === 200) {
//$('.play-bi-pan dt').hide();
u.render(data.data, juanText);
c.winHide(pan);
} else {
$('.errbitip').html(data.message);
$('#biprice').removeClass('is-select');
}
} else {
$('.errbitip').html(data.message);
$('#biprice').removeClass('is-select');
}
};
$.ajax(options);
}
}
};
$.ajax(options);
});
});
... ... @@ -567,20 +570,6 @@ var Order = {
c.winShow($pan);
});
e.$bp.keyup(function() {
var val = $(this).val();
//if (val * 1 < 0 || val.indexOf('.') > 0) {
if (!/^\d+$/.test(val + '')) {
e.$errorTip.html('请输入一个正整数');
} else if (val * 1 > $(this).data('bi') * 1) {
e.$errorTip.html('您的有货币不足');
} else {
e.$errorTip.html('抵扣' + (val / 100).toFixed(2) + '元');
}
});
// 取消yoho 币
$('.cancel-bi').click(function() {
... ... @@ -788,6 +777,7 @@ $('.why').click(function() {
$('#differentBag').click(function() {
return false;
});
$(document).click(function() {
$('#differentBag').hide();
});
... ... @@ -1058,3 +1048,10 @@ $('#input-mobile').bind('input propertychange', function() {
// 订单确认页默认埋点
window.addPoint('YB_SC_ORDER_ENSURE');
//有货币帮助弹框
$yohoCoinHelp.hover(function() {
$(this).find('.yoho-coin-help-dialog').removeClass('hide');
}, function() {
$(this).find('.yoho-coin-help-dialog').addClass('hide');
});
... ...
... ... @@ -33,6 +33,7 @@ var TicketCat = {
$toPay: $('.ticket-play em'),
$errorTip: $('.errbitip'),
$tbody: $('table tbody', '.pay-wapper'),
$yohoCoinHelp: $('.yoho-coin-help'),
//门票js
$showTicketMobile: $('.show-ticket-mobile'),
... ... @@ -147,6 +148,10 @@ var TicketCat = {
el.$pan.find('dt').click(function() {
var pan = $(this).parent('dl.pan');
if ($(this).hasClass('not-btn')) {
return false;
}
if (pan.find('dd').is(':hidden')) {
c.winShow(pan);
$(this).addClass('active');
... ... @@ -161,33 +166,35 @@ var TicketCat = {
var pan = $(this).parents('dl.pan');
var selectData = {};
if (!$('#biprice').data('yoho-coin-click')) {
$('.errbitip').html('抱歉,您的订单实付款不满足有货币使用条件');
return true;
}
$('#biprice').addClass('is-select');
selectData = _this.getSelectData();
if (!/^\d+$/.test(selectData.yohoCoin + '') || selectData.yohoCoin * 1 === 0) {
if (selectData.yohoCoin * 1 <= 0) {
$('.errbitip').html('请输入一个正整数');
$('#biprice').removeClass('is-select');
} else if (selectData.yohoCoin * 1 > $('.play-pan em').text() * 1) {
$('.errbitip').html('您的有货币不足');
$('#biprice').removeClass('is-select');
} else {
el.$loading.show();
$.ajax({
type: 'POST',
url: '/cart/index/setTicket',
data: selectData,
success: function(data) {
el.$loading.hide();
if (data.code === 200) {
_this.render(data.data);
c.winHide(pan);
} else {
$('.errbitip').html(data.message);
$('#biprice').removeClass('is-select');
}
}
});
return false;
}
el.$loading.show();
$.ajax({
type: 'POST',
url: '/cart/index/setTicket',
data: selectData,
success: function(data) {
el.$loading.hide();
if (data.code === 200) {
_this.render(data.data);
c.winHide(pan);
} else {
$('.errbitip').html(data.message);
$('#biprice').removeClass('is-select');
}
}
});
});
// 修改有货币
... ... @@ -280,6 +287,12 @@ var TicketCat = {
});
});
//有货币帮助弹框
el.$yohoCoinHelp.hover(function() {
$(this).find('.yoho-coin-help-dialog').removeClass('hide');
}, function() {
$(this).find('.yoho-coin-help-dialog').addClass('hide');
});
},
//渲染价格明细
... ... @@ -312,17 +325,22 @@ var TicketCat = {
e.$toPay.html((data.shopping_cart_data.last_order_amount).toFixed(2));
//有货币清零状态更新
$('#biprice').val(accMul(100, data.shopping_cart_data.use_yoho_coin));
if (data.use_yoho_coin === 0) {
$('.errbitip').text('');
} else {
$('.errbitip').text('抵扣' + data.shopping_cart_data.use_yoho_coin.toFixed(2) + '元');
$('dl.play-bi-pan').find('dt').removeClass('not-btn');
$('.not-btn-tip').addClass('hide');
if (!data.yohoCoinCompute.yohoCoinClick) {
//不可以使用状态
$('dl.play-bi-pan').find('dt').addClass('not-btn');
$('.not-btn-tip').removeClass('hide');
}
$('#biprice').data('.yoho-coin-click', data.yohoCoinCompute.yohoCoinClick);
$('#biprice').find('.num-limit-coin').html(data.yohoCoinCompute.yoho_coin_pay_rule.num_limit);
$('#biprice').find('.totalYohoCoinNum').html(data.yohoCoinCompute.totalYohoCoinNum);
$('#biprice').find('.yohoCoinNum').html(data.yohoCoinCompute.yohoCoinNum);
$('#biprice').find('.yohoCoin').html(data.yohoCoinCompute.yohoCoin);
},
getSelectData: function() {
var expressVal = $('.express-list input[name="carriagegroup"]:checked').val();
var biVal = $('#biprice.is-select').val();
var biVal = $('#biprice.is-select').data('yoho-coin-num') * 1;
var cartType = $('.address-manage').attr('cart-type');
var resultData;
... ...
... ... @@ -127,6 +127,7 @@
.red {
color: #e8044f!important;
text-align: center;
}
.orange {
... ... @@ -152,6 +153,16 @@
margin-bottom:5px;
}
.pan dt.not-btn {
background: resolve(/order/not-btn.png) no-repeat center center;
cursor: auto;
}
.not-btn-tip {
position: absolute;
right: 150px;
}
.pan dd {
display: none;
border: 1px #ccc solid;
... ... @@ -183,7 +194,8 @@
background: none;
border: 1px solid #ccc;
border-radius: 2px;
height: 20px;
height: 25px;
width: 60px
}
.ok {
... ... @@ -241,8 +253,7 @@
.play-right {
float: right;
width: 50%;
width: 405px;
width: 410px;
.pan {
text-align: right;
... ... @@ -342,8 +353,72 @@
}
.play-bi-pan {
.play-pan {
font-size: 14px;
width: 100%;
height: 166px;
.num-list-width {
width: 360px;
}
.yoho-coin-help-link {
color: #027cf9;
}
li {
margin-top: 15px;
overflow: hidden;
&:last-child {
margin-top: 28px;
}
}
.yoho-coin-help {
display: inline-block;
background-color: #000;
border-radius: 16px;
width: 16px;
height: 16px;
line-height: 17px;
text-align: center;
color: #fff;
font-size: 14px;
cursor: pointer;
}
.yoho-coin-help-dialog {
position: absolute;
right: 20px;
color: #000;
background-color: #fff;
border: 1px solid #000;
margin-top: 10px;
width: 280px;
height: 150px;
padding: 15px;
text-align: left;
cursor: auto;
li {
margin-top: 10px;
}
}
.yoho-coin-help-dialog-title {
font-weight: bold;
margin-bottom: 15px;
}
}
.sign-amount {
color: #d0021b;
}
dd {
text-align: right;
text-align: left;
}
.textbox {
... ... @@ -358,6 +433,40 @@
}
}
.btn-group {
text-align: left;
}
.float-left {
float: left;
}
.float-right {
float: right;
}
}
.arrow-up {
position: absolute;
right: 6px;
width: 0;
height: 0;
top: -9px;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 8px solid #000;
&:before {
content: '';
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 8px solid #fff;
right: -6px;
top: 1px;
position: absolute;
}
}
}
... ...
... ... @@ -55,7 +55,6 @@ class CartModel
// 调用接口,获取购物车数据
$cartData = CartData::cartData($uid, $shoppingKey);
// print_r($cartData); exit;
// 接口异常时,购物车置为空
if (empty($cartData['data'])) {
$result['isEmpty'] = true;
... ... @@ -690,10 +689,15 @@ class CartModel
*/
public static function cartPay($uid, $cartType, $isAdvanceCart)
{
$result = [];
/* 调接口订单确认接口 */
$pay = CartData::cartPay($uid, $cartType);
$result = self::filterCartPay($pay, $cartType, $isAdvanceCart, $uid);
return self::filterCartPay($pay, $cartType, $isAdvanceCart, $uid);
//有货币
$result['yohoCoinCompute'] = self::yohoCoinCompute($pay['data']);
return $result;
}
/**
* 处理购物车返回
... ... @@ -880,10 +884,7 @@ class CartModel
}
// 返还的 YOHO 币
$result['totalYoho'] = $pay['data']['shopping_cart_data']['gain_yoho_coin'];
// 拥有的有货币
$result['ownYohoCoin'] = $pay['data']['yoho_coin'] * 100;
// 默认是否使用有货币
$result['useYohoCoin'] = empty($pay['data']['use_yoho_coin']) ? false : true;
// 红包总金额
$result['redEnvelopes'] = empty($pay['data']['red_envelopes']) ? false : Helpers::transPrice($pay['data']['red_envelopes']);
// 使用的红包金额
... ... @@ -906,7 +907,6 @@ class CartModel
$isNewUser = false;
}
$result['isNewUser'] = $isNewUser ? true : false;
//JIT拆单需求 package
$result['packages'] = self::getPackageInfo($pay['data']['shopping_cart_data']);
} while (false);
... ... @@ -1000,6 +1000,8 @@ class CartModel
$compute['data']['promotion_formula_list'] = $promotionFormulaList;
//JIT拆单
$compute['packages'] = self::getPackageInfo($compute['data']);
//有货币
$compute['data']['yohoCoinCompute'] = self::yohoCoinCompute($compute['data']);
}
$result = $compute;
}
... ... @@ -1546,7 +1548,13 @@ class CartModel
*/
public function addTicket($uid, $productSku, $buyNumber, $yohoCoin = 0)
{
return CartData::addTicket($uid, $productSku, $buyNumber, $yohoCoin);
$result = [];
$result = CartData::addTicket($uid, $productSku, $buyNumber, $yohoCoin);
//有货币
if (isset($result['data']['shopping_cart_data'])) {
$result['data']['yohoCoinCompute'] = self::yohoCoinCompute($result['data']['shopping_cart_data']);
}
return $result;
}
/**
... ... @@ -1559,10 +1567,17 @@ class CartModel
*/
public function filterTicket($uid, $productSku, $buyNumber, $yohoCoin = 0)
{
$result = [];
$cartType = 'advance';
$data = self::addTicket($uid, $productSku, $buyNumber, $yohoCoin);
return self::filterCartPay($data, $cartType, false);
$result = self::filterCartPay($data, $cartType, false);
//有货币
if (isset($data['data']['shopping_cart_data'])) {
$result['yohoCoinCompute'] = self::yohoCoinCompute($data['data']['shopping_cart_data']);
}
return $result;
}
/**
... ... @@ -1578,4 +1593,36 @@ class CartModel
{
return CartData::submitTicket($uid, $productSku, $buyNumber, $mobile, $yohoCoin);
}
/**
*有货币使用前端方案显示及是否可单击判断
*/
public static function yohoCoinCompute($orderCompute) {
$yohoCoinData = ['totalYohoCoinNum' => 0, 'yohoCoin' => 0, 'yohoCoinNum' =>0, 'useYohoCoin' => 0, 'yohoCoinClick' => 0, 'yohoCoinMsg' => ''];
if (empty($orderCompute) || empty($orderCompute['yoho_coin_pay_rule'])) {
return $yohoCoinData;
}
$yohoCoinData = [
'totalYohoCoinNum' => isset($orderCompute['total_yoho_coin_num']) ? intval($orderCompute['total_yoho_coin_num']) : 0,
'yohoCoin' => isset($orderCompute['yoho_coin']) ? Helpers::transPrice($orderCompute['yoho_coin']) : 0,
'yohoCoinNum' => isset($orderCompute['yoho_coin']) ? $orderCompute['yoho_coin'] * 100 : 0,
'useYohoCoin' => isset($orderCompute['use_yoho_coin']) ? Helpers::transPrice($orderCompute['use_yoho_coin']) : 0,
'yohoCoinClick' => 0,
'yohoCoinMsg' => '',
'yoho_coin_pay_rule' => $orderCompute['yoho_coin_pay_rule']
];
if ($yohoCoinData['totalYohoCoinNum'] < 100) {
$yohoCoinData['yohoCoinMsg'] = "共{$yohoCoinData['totalYohoCoinNum']}有货币,满{$orderCompute['yoho_coin_pay_rule']['num_limit']}可用";
} else if ($yohoCoinData['useYohoCoin'] > 0 || $yohoCoinData['yohoCoin'] > 0) {
$yohoCoinData['yohoCoinMsg'] = '可抵¥' . ($yohoCoinData['useYohoCoin'] > 0 ? $yohoCoinData['useYohoCoin'] : $yohoCoinData['yohoCoin']);
$yohoCoinData['yohoCoinClick'] = 1;
$yohoCoinData['yohoCoinNum'] = ($yohoCoinData['useYohoCoin'] > 0 ? $yohoCoinData['useYohoCoin'] : $yohoCoinData['yohoCoin']) * 100;
} else {
$yohoCoinData['yohoCoinMsg'] = "不满足有货币使用条件";
}
return $yohoCoinData;
}
}
... ...