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
Email Patches
Plain Diff
Browse Files
Authored by
zhangxiaoru
8 years ago
Commit
01d2c3ae4a0d394ed88bdb94cf5fd0443421410b
1 parent
0483d1f4
支付 埋点
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
66 additions
and
3 deletions
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
yohobuy/m.yohobuy.com/application/modules/Shopping/controllers/Pay.php
static/js/me/pay.js
View file @
01d2c3a
...
...
@@ -22,7 +22,9 @@ var appIconPosition = {
bank
:
'-4rem'
};
// 隐藏微信分享选项
require
(
'../common'
);
//隐藏微信分享选项
if
(
window
.
wx
)
{
wx
.
hideOptionMenu
();
}
...
...
@@ -54,6 +56,7 @@ function jsApiCall(orderCode, jsApiParameters) {
'getBrandWCPayRequest'
,
jsApiParameters
,
function
(
res
)
{
window
.
location
.
href
=
'/home/orders/detail?order_code='
+
orderCode
+
'&openId=true'
;
}
);
...
...
@@ -185,4 +188,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 @
01d2c3a
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 @
01d2c3a
...
...
@@ -33,6 +33,8 @@
</div>
<div
class=
"loading-toast hide"
></div>
</div>
<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 @
01d2c3a
...
...
@@ -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 @
01d2c3a
...
...
@@ -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 @
01d2c3a
...
...
@@ -434,3 +434,8 @@
seajs.use('js/life/coupon');
</script>
{{/if}}
{{#if payBackPage}}
<script>
seajs.use('js/product/pay-back');
</script>
{{/if}}
...
...
yohobuy/m.yohobuy.com/application/modules/Shopping/controllers/Pay.php
View file @
01d2c3a
...
...
@@ -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
);
}
...
...
Please
register
or
login
to post a comment