Authored by 郝肖肖

合支付分支

... ... @@ -33,7 +33,7 @@
<div class="count">
{{#each list}}
<div class="mode" data-id="{{dataId}}" data-value="{{dataVal}}">
<div id="{{idNum}}"></div>
<div id="{{idNum}}" class="borer-tag"></div>
<img src="{{ico}}" alt="{{name}}" id="{{imgId}}">
</div>
{{/each}}
... ... @@ -44,7 +44,7 @@
<div class="count">
{{# each entry}}
<div class="mode" data-id="{{dataId}}" data-value="{{dataVal}}">
<div id="{{idNum}}"></div>
<div id="{{idNum}}" class="borer-tag"></div>
<img src="{{ico}}" alt="{{name}}" id="{{imgId}}">
</div>
{{/each}}
... ...
... ... @@ -15,7 +15,6 @@ var $ = require('yoho.jquery'),
$payUrl = $('#payUrl').val(),
$modeData,
activeTab,
showDiv,
imgAlt,
imgSrc,
orderCode,
... ... @@ -45,7 +44,6 @@ function choosed() {
$mode.eq(0).addClass('choose-type').show();
$mode.eq(0).find('div').addClass('choosed-tag');
}
$btnty.attr('value', '前往' + $('#' + $chooseMoid).attr('alt'));
$showPayImg.attr('src', $('#' + $chooseMoid).attr('src'));
}
... ... @@ -54,7 +52,6 @@ choosed();
$mode.click(function() {
$modeData = $(this).data();
showDiv = $modeData.id;
$showValue = $modeData.value;
imgAlt = $('#' + $showValue).attr('alt');
imgSrc = $('#' + $showValue).attr('src');
... ... @@ -62,7 +59,7 @@ $mode.click(function() {
$mode.removeClass('choose-type');
$(this).addClass('choose-type');
$choseTag.removeClass('choosed-tag');
$('#' + showDiv).addClass('choosed-tag');
$(this).find('.borer-tag').addClass('choosed-tag');
$btnty.attr('value', '前往' + imgAlt);
$showPayImg.attr('src', imgSrc);
return false;
... ...
... ... @@ -560,6 +560,7 @@ class ItemModel
'href' => Helpers::getUrlBySkc($goods['goodsImagesList'][0]['productId'],
$goods['goodsImagesList'][0]['goodsId'], $val['product']['cnAlphabet']),
);
$point['href'] = $point['product']['href'];
}
}
if(!empty($point)) {
... ...
... ... @@ -145,18 +145,20 @@ class PayModel
// 记录支付方式
$bankRecord = PayData::getBankByOrder($orderCode);
if (isset($bankRecord['data']['bankCode']) && !empty($bankRecord['data']['bankCode'])) {
//银行的记录方式
$payRecord = $bankRecord['data']['bankCode'];
} elseif (isset($bankRecord['data']['payment']) && !empty($bankRecord['data']['payment'])) {
//支付宝等平台的记录方式
$payRecord = $bankRecord['data']['payment'];
} else {
$payCode = $order['payment'] ?: $defaultPayType;
//记录app上的支付方式
$payCode = empty($order['payment']) ? $defaultPayType : $order['payment'];
$changeCodes = array(
19 => 21,// app上微信支付
22 => 21,// h5微信支付
18 => $defaultPayType// h5支付宝支付
18 => 2// h5支付宝支付
);
$platformCode = isset($changeCodes[$payCode]) && $changeCodes[$payCode] ? $changeCodes[$payCode] : $payCode;
$platformCodeList = array_keys($types);
$payRecord = in_array($platformCode, $platformCodeList) ? $platformCode : $defaultPayType;
$payRecord = empty($changeCodes[$payCode]) ? $defaultPayType : $changeCodes[$payCode];
}
$result['payRecord'] = $payRecord;
... ... @@ -198,16 +200,14 @@ class PayModel
$onePay = array();
foreach ($pays as $code => $pay) {
$onePay = array();
$onePay['dataId'] = $code;
$onePay['dataId'] = $isBank ? 12 : $code;//支付宝支联为12
$onePay['dataVal'] = $isBank ? '12_' . $code : $code . '_platform';
$onePay['idNum'] = $code;
$onePay['ico'] = $pay['ico'];
$onePay['name'] = $pay['name'];
$onePay['imgId'] = $onePay['dataVal'];
$result[] = $onePay;
}
return $result;
}
... ...
... ... @@ -148,18 +148,20 @@ class PaymentModel
$bankRecord = PayData::getBankByOrder($orderCode);
if (isset($bankRecord['data']['bankCode']) && !empty($bankRecord['data']['bankCode'])) {
//银行的记录方式
$payRecord = $bankRecord['data']['bankCode'];
} elseif (isset($bankRecord['data']['payment']) && !empty($bankRecord['data']['payment'])) {
//支付宝等平台的记录方式
$payRecord = $bankRecord['data']['payment'];
} else {
$payCode = $order['payment'] ?: $defaultPayType;
//记录app上的支付方式
$payCode = empty($order['payment']) ? $defaultPayType : $order['payment'];
$changeCodes = array(
19 => 21,// app上微信支付
22 => 21,// h5微信支付
18 => $defaultPayType// h5支付宝支付
18 => 2// h5支付宝支付
);
$platformCode = isset($changeCodes[$payCode]) && $changeCodes[$payCode] ? $changeCodes[$payCode] : $payCode;
$platformCodeList = array_keys($types);
$payRecord = in_array($platformCode, $platformCodeList) ? $platformCode : $defaultPayType;
$payRecord = empty($changeCodes[$payCode]) ? $defaultPayType : $changeCodes[$payCode];
}
$result['payRecord'] = $payRecord;
... ... @@ -202,7 +204,7 @@ class PaymentModel
foreach ($pays as $code => $pay) {
$onePay = array();
$onePay['dataId'] = $code;
$onePay['dataId'] = $isBank ? 12 : $code;//支付宝支联为12
$onePay['dataVal'] = $isBank ? '12_' . $code : $code . '_platform';
$onePay['idNum'] = $code;
$onePay['ico'] = $pay['ico'];
... ...
... ... @@ -26,7 +26,7 @@ class PayController extends WebAction
public function indexAction()
{
/* 判断用户是否登录 */
$uid = $this->getUid(true);
$uid = $this->getUid();
if (!$uid) {
$this->go( Helpers::url('/signin.html', array('refer' => $this->server('HTTP_REFERER', SITE_MAIN))) );
}
... ... @@ -88,7 +88,7 @@ class PayController extends WebAction
$result = array('code' => 400, 'message' => '操作失败!');
if ($this->isAjax()) {
do {
$uid = $this->getUid(true);
$uid = $this->getUid();
$orderCode = $this->post('orderCode', 0);
$paymentId = $this->post('paymentId', 0);
if (empty($orderCode) || empty($uid) || empty($paymentId)) {
... ...