Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYWAP
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
zhangxiaoru
8 years ago
Commit
1db81933b06b73b07d7a181dea142580f006c6f5
2 parents
9cd49935
01d2c3ae
冲突
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
147 additions
and
8 deletions
static/js/cart/cart.js
static/js/cart/invoice-info.js
static/js/cart/order-ensure.js
static/js/me/pay.js
static/js/product/pay-back.js
template/m.yohobuy.com/actions/index/home/pay.phtml
template/m.yohobuy.com/actions/shopping/pay/index.phtml
template/m.yohobuy.com/actions/shopping/pay/notneedpay.phtml
template/m.yohobuy.com/partials/layout/use.phtml
template/m.yohobuy.com/partials/me/order/good.phtml
yohobuy/m.yohobuy.com/application/models/Index/Cart.php
yohobuy/m.yohobuy.com/application/modules/Cart/controllers/Index.php
yohobuy/m.yohobuy.com/application/modules/Shopping/controllers/Pay.php
yohobuy/m.yohobuy.com/public/index-dev.php
static/js/cart/cart.js
View file @
1db8193
...
...
@@ -27,6 +27,8 @@ var isRefreshByDelete = window.cookie('_yoho-cart-refreshByDelete') === 'true' ?
var
lowStockCount
=
0
;
var
C_ID
=
window
.
_ChannelVary
[
window
.
cookie
(
'_Channel'
)]
||
1
;
loading
.
showLoadingMask
();
function
needLoadRecommandForYou
()
{
...
...
@@ -193,6 +195,22 @@ $('.btn-balance').on('touchend', function() {
lowStockCount
=
0
;
if
(
window
.
_yas
&&
window
.
_yas
.
sendCustomInfo
)
{
var
productId
=
[];
$
(
'.shopping-cart-good'
).
each
(
function
()
{
productId
.
push
(
$
(
this
).
data
(
'id'
));
});
window
.
_yas
.
sendCustomInfo
({
op
:
'YB_SC_TOBUY_CLICK'
,
param
:
JSON
.
stringify
({
C_ID
:
C_ID
,
PRD_ID
:
productId
.
join
(
','
),
})
},
true
);
}
if
(
shouldLowStocks
())
{
tip
.
show
(
'所选商品中有'
+
lowStockCount
+
'种库存不足的商品'
);
return
false
;
...
...
@@ -239,4 +257,13 @@ $(window).scrollTop(1).scrollTop(0);
if
(
$
(
'.invalid-goods'
).
find
(
'.shopping-cart-good'
).
length
===
0
)
{
$
(
'#failure-goods'
).
removeClass
(
'invalid-goods'
);
}
\ No newline at end of file
}
$
(
function
()
{
if
(
window
.
_yas
&&
window
.
_yas
.
sendCustomInfo
)
{
window
.
_yas
.
sendCustomInfo
({
op
:
'YB_SC'
,
param
:
JSON
.
stringify
({
C_ID
:
C_ID
})
},
true
);
}
});
\ No newline at end of file
...
...
static/js/cart/invoice-info.js
View file @
1db8193
...
...
@@ -25,6 +25,8 @@ var $invoiceNotice = $('.invoice-notice'),
var
myreg
=
/^
(((
13
[
0-9
]{1})
|
(
14
[
0-9
]{1})
|
(
15
[
0-9
]{1})
|
(
17
[
0-9
]{1})
|
(
18
[
0-9
]{1}))
+
\d{8})
$/
,
linkUrl
=
$
(
'.address-more'
).
val
()
||
'/cart/index/orderEnsure?cartType=ordinary'
;
var
C_ID
=
window
.
_ChannelVary
[
window
.
cookie
(
'_Channel'
)]
||
1
;
require
(
'../common'
);
if
(
window
.
getUid
()
!==
orderInfo
(
'uid'
))
{
...
...
@@ -165,6 +167,19 @@ $company.on('input', function() {
// 确认及返回事件
$
(
'.confirm-btn, .nav-back'
).
on
(
'touchstart'
,
function
(
e
)
{
if
(
window
.
_yas
&&
window
.
_yas
.
sendCustomInfo
)
{
window
.
_yas
.
sendCustomInfo
({
op
:
'YB_SC_INVOICE_INFO_SAVE'
,
param
:
JSON
.
stringify
({
C_ID
:
C_ID
,
INVOICE_TYPE
:
$invoiceType
.
find
(
'.on'
).
data
(
'id'
),
INVOICE_TITLE
:
$
(
'.invoice-top'
).
find
(
'.on'
).
text
(),
INVOICE_CONTENT
:
$chooseCont
.
data
(
'id'
)
})
},
true
);
}
e
.
preventDefault
();
confirmAction
();
});
...
...
static/js/cart/order-ensure.js
View file @
1db8193
...
...
@@ -46,6 +46,8 @@ var invoiceCont = {
2
:
'电子'
};
var
C_ID
=
window
.
_ChannelVary
[
window
.
cookie
(
'_Channel'
)]
||
1
;
require
(
'../common'
);
lazyLoad
();
...
...
@@ -162,6 +164,15 @@ $invoice.on('touchend', '.checkbox', function() {
orderCont
=
window
.
cookie
(
'order-info'
)
&&
JSON
.
parse
(
window
.
cookie
(
'order-info'
));
invoiceInit
();
if
(
window
.
_yas
&&
window
.
_yas
.
sendCustomInfo
)
{
window
.
_yas
.
sendCustomInfo
({
op
:
'YB_SC_INVOICE_ISSUE'
,
param
:
JSON
.
stringify
({
C_ID
:
C_ID
})
},
true
);
}
});
...
...
@@ -306,6 +317,9 @@ function submitOrder(times) {
}
if
(
res
.
code
===
200
)
{
var
PRD_SKN
=
[],
PRD_SKU
=
[];
if
(
payType
===
2
)
{
// 货到付款的进入订单页面
...
...
@@ -314,6 +328,14 @@ function submitOrder(times) {
url
=
'/home/orders/pay?order_code='
+
res
.
data
.
order_code
;
}
var
PRD_SKN
=
[],
PRD_SKU
=
[];
$
(
'.order-good'
).
each
(
function
()
{
PRD_SKN
.
push
(
$
(
this
).
data
(
'id'
));
PRD_SKU
.
push
(
$
(
this
).
data
(
'skn'
));
})
/* tar add 161116 */
if
(
window
.
_yas
&&
window
.
_yas
.
sendCustomInfo
)
{
window
.
_yas
.
sendCustomInfo
({
...
...
@@ -324,6 +346,8 @@ function submitOrder(times) {
PRD_NUM
:
$
(
'#goods-num'
).
val
(),
ORDER_AMOUNT
:
res
.
data
.
order_amount
,
UNIONCOOKIE
:
res
.
data
.
unionCookie
||
''
,
PRD_SKN
:
PRD_SKN
.
join
(
','
),
PRD_SKU
:
PRD_SKU
.
join
(
','
)
})
},
true
);
}
...
...
@@ -557,3 +581,14 @@ $(window).scroll(function() {
$
(
'.address-bottom'
).
hide
();
}
});
$
(
function
()
{
if
(
window
.
_yas
&&
window
.
_yas
.
sendCustomInfo
)
{
window
.
_yas
.
sendCustomInfo
({
op
:
'YB_SC_ORDER_ENSURE'
,
param
:
JSON
.
stringify
({
C_ID
:
C_ID
})
},
true
);
}
});
...
...
static/js/me/pay.js
View file @
1db8193
...
...
@@ -41,7 +41,9 @@ $('.nav-back').on('touchend', function() {
);
});
// 隐藏微信分享选项
require
(
'../common'
);
//隐藏微信分享选项
if
(
window
.
wx
)
{
wx
.
hideOptionMenu
();
}
...
...
@@ -73,6 +75,7 @@ function jsApiCall(orderCode, jsApiParameters) {
'getBrandWCPayRequest'
,
jsApiParameters
,
function
(
res
)
{
window
.
location
.
href
=
'/home/orders/detail?order_code='
+
orderCode
+
'&openId=true'
;
}
);
...
...
@@ -204,4 +207,21 @@ function main() {
loading
.
showLoadingMask
();
$
(
document
).
ready
(
main
);
\ No newline at end of file
$
(
document
).
ready
(
main
);
//埋点
$
(
'.box'
).
on
(
'touchstart'
,
function
()
{
var
payStyle
=
$
(
this
).
find
(
'.app'
).
html
();
if
(
window
.
_yas
&&
window
.
_yas
.
sendCustomInfo
)
{
window
.
_yas
.
sendCustomInfo
({
op
:
'YB_SC_PAYMENT'
,
param
:
JSON
.
stringify
({
C_ID
:
window
.
_ChannelVary
[
cookie
(
'_Channel'
)],
ORDER_CODE
:
$
(
'.order-code'
).
val
(),
ORDER_AMOUNT
:
$
(
'.order-total'
).
val
(),
PAY_STYLE
:
payStyle
})
},
true
);
}
})
...
...
static/js/product/pay-back.js
0 → 100644
View file @
1db8193
var
$
=
require
(
'jquery'
);
require
(
'../../common'
);
//支付结果埋点
setTimeout
(
function
()
{
if
(
window
.
_yas
&&
window
.
_yas
.
sendCustomInfo
)
{
window
.
_yas
.
sendCustomInfo
({
op
:
'YB_SC_PAY_RES'
,
param
:
JSON
.
stringify
({
C_ID
:
window
.
_ChannelVary
[
cookie
(
'_Channel'
)],
ORDER_CODE
:
$
(
'.order-code'
).
val
(),
PAY_RES
:
$
(
'.pay-back'
).
val
(),
PAY_AMOUNT
:
$
(
'.pay-amount'
).
val
(),
PAY_STYLE
:
'支付宝'
})
},
true
);
}
},
200
);
...
...
template/m.yohobuy.com/actions/index/home/pay.phtml
View file @
1db8193
...
...
@@ -33,7 +33,8 @@
</div>
<div
class=
"loading-toast hide"
></div>
</div>
{
{>
plugin/rich_tip
}
}
<input
type=
"hidden"
class=
"order-code"
value=
"{{orderCode}}"
>
<input
type=
"hidden"
class=
"order-total"
value=
"{{orderTotal}}"
>
<script>_ozprm=
"orderid={{orderCode}}&ordertotal={{orderTotal}}"
;</script>
<script
type=
"text/javascript"
src
=
"//static.yohobuy.com/m/v1/js/AG_Tracking.js"
></script>
<script
type=
"text/javascript"
>
...
...
template/m.yohobuy.com/actions/shopping/pay/index.phtml
View file @
1db8193
...
...
@@ -16,4 +16,7 @@
</div>
</div>
</div>
<input
type=
"hidden"
class=
"pay-back"
value=
"{{payBack}}"
>
<input
type=
"hidden"
class=
"orderCode"
value=
"{{payOrderCode}}"
>
<input
type=
"hidden"
class=
"pay-amount"
value=
"{{payAmount}}"
>
{
{>
layout/footer
}
}
\ No newline at end of file
...
...
template/m.yohobuy.com/actions/shopping/pay/notneedpay.phtml
View file @
1db8193
...
...
@@ -9,4 +9,7 @@
</div>
</div>
</div>
<input
type=
"hidden"
class=
"pay-back"
value=
"{{payBack}}"
>
<input
type=
"hidden"
class=
"order-code"
value=
"{{payOrderCode}}"
>
<input
type=
"hidden"
class=
"pay-amount"
value=
"{{payAmount}}"
>
{
{>
layout/footer
}
}
\ No newline at end of file
...
...
template/m.yohobuy.com/partials/layout/use.phtml
View file @
1db8193
...
...
@@ -434,3 +434,8 @@
seajs.use('js/life/coupon');
</script>
{{/if}}
{{#if payBackPage}}
<script>
seajs.use('js/product/pay-back');
</script>
{{/if}}
...
...
template/m.yohobuy.com/partials/me/order/good.phtml
View file @
1db8193
<div class="order-good" data-id="{{id}}">
<div class="order-good" data-id="{{id}}"
data-skn="{{skn}}"
>
<div class="thumb-wrap">
{{#if link}}
<a href="{{link}}"><img class="thumb lazy" data-original="{{thumb}}"></a>
...
...
yohobuy/m.yohobuy.com/application/models/Index/Cart.php
View file @
1db8193
...
...
@@ -494,6 +494,7 @@ class CartModel
$oneGoods
=
array
();
$oneGoods
[
'id'
]
=
$single
[
'product_sku'
];
$oneGoods
[
'skn'
]
=
$single
[
'product_skn'
];
$oneGoods
[
'thumb'
]
=
Images
::
getImageUrl
(
$single
[
'goods_images'
],
120
,
160
);
$oneGoods
[
'name'
]
=
$single
[
'product_name'
];
$oneGoods
[
'color'
]
=
isset
(
$single
[
'factory_goods_name'
])
?
$single
[
'factory_goods_name'
]
:
$single
[
'color_name'
];
...
...
yohobuy/m.yohobuy.com/application/modules/Cart/controllers/Index.php
View file @
1db8193
...
...
@@ -371,7 +371,7 @@ class IndexController extends AbstractAction
$this
->
setTitle
(
'确认订单'
);
$this
->
setNavHeader
(
'确认订单'
,
$returnUrl
,
false
);
// 不显示右上角home按钮
//print_r($data);
$this
->
_view
->
display
(
'order-ensure'
,
$data
);
}
...
...
yohobuy/m.yohobuy.com/application/modules/Shopping/controllers/Pay.php
View file @
1db8193
...
...
@@ -244,10 +244,22 @@ class PayController extends AbstractAction
}
}
$payOrderCode
=
$payResult
->
orderCode
;
$payAmount
=
$payResult
->
totalFee
;
if
(
$view
=
'notneedpay'
)
{
$payBack
=
'failure'
;
}
else
{
$payBack
=
'success'
;
}
$data
=
array
(
'payBackPage'
=>
true
,
'pageFooter'
=>
true
,
'order_code'
=>
$orderCode
'order_code'
=>
$orderCode
,
'payBack'
=>
$payBack
,
'payOrderCode'
=>
$payOrderCode
,
'payAmount'
=>
$payAmount
);
$this
->
_view
->
display
(
$view
,
$data
);
}
...
...
yohobuy/m.yohobuy.com/public/index-dev.php
View file @
1db8193
...
...
@@ -20,7 +20,6 @@ define('USE_INTER_FACE_SHUNT', false);//分流开关
//define('YOHOBUY_URL', 'http://www.yohobuy.com/');
//define('SERVICE_NOTIFY', 'http://dev-service.yohops.com:9999/');
define
(
'API_URL'
,
'http://api-test3.yohops.com:9999/'
);
define
(
'SERVICE_URL'
,
'http://service-test3.yohops.com:9999/'
);
define
(
'YOHOBUY_URL'
,
'http://www.yohobuy.com/'
);
...
...
Please
register
or
login
to post a comment