Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
2
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
xiaowei
9 years ago
Commit
495ca78537943835a64f2531516e266926d53110
1 parent
dc8f8987
优惠码使用问题
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
28 additions
and
16 deletions
library/LibModels/Web/Home/CartData.php
web-static/dist/yohobuy/0.0.23/index-debug.js
web-static/dist/yohobuy/0.0.23/index.css
web-static/dist/yohobuy/0.0.23/index.js
web-static/js/order/address.js
yohobuy/www.yohobuy.com/application/models/Shopping/Cart.php
yohobuy/www.yohobuy.com/application/modules/Cart/controllers/Index.php
library/LibModels/Web/Home/CartData.php
View file @
495ca78
...
...
@@ -365,6 +365,7 @@ class CartData
* @param int $paymentType 支付类型ID
* @param string $remark 留言
* @param string $couponCode 优惠券码
* @param string $promotionCode 优惠码
* @param mixed $yohoCoin 使用的YOHO币数量或为空
* @param int $isPreContact 送货前是否联系
* @param int $isPrintPrice 是否打印价格
...
...
@@ -374,7 +375,7 @@ class CartData
* @return array 接口返回的数据
*/
public
static
function
orderSub
(
$uid
,
$addressId
,
$cartType
,
$deliveryTime
,
$deliveryWay
,
$invoiceTitle
,
$invoiceId
,
$paymentId
,
$paymentType
,
$remark
,
$coup
onCode
,
$yohoCoin
,
$isPreContact
,
$isPrintPrice
,
$unionKey
,
$userAgent
,
$redEnvelopes
)
$paymentId
,
$paymentType
,
$remark
,
$couponCode
,
$promoti
onCode
,
$yohoCoin
,
$isPreContact
,
$isPrintPrice
,
$unionKey
,
$userAgent
,
$redEnvelopes
)
{
$param
=
Yohobuy
::
param
();
$param
[
'debug'
]
=
'Y'
;
...
...
@@ -397,9 +398,13 @@ class CartData
}
$param
[
'payment_id'
]
=
$paymentId
;
$param
[
'payment_type'
]
=
$paymentType
;
if
(
!
empty
(
$couponCode
))
{
$param
[
'coupon_code'
]
=
$couponCode
;
}
if
(
!
empty
(
$promotionCode
))
{
$param
[
'promotion_code'
]
=
$promotionCode
;
}
if
(
!
empty
(
$yohoCoin
))
{
$param
[
'use_yoho_coin'
]
=
$yohoCoin
;
}
...
...
web-static/dist/yohobuy/0.0.23/index-debug.js
View file @
495ca78
...
...
@@ -16330,7 +16330,7 @@ function getYohoBiList() {
type
:
'GET'
,
dataType
:
'json'
,
url
:
'/cart/index/getCouponList'
}).
then
(
function
(
d
)
{
}).
then
(
function
(
d
)
{
if
(
d
.
code
===
200
)
{
data
=
d
.
data
;
...
...
@@ -16338,9 +16338,9 @@ function getYohoBiList() {
for
(
i
=
0
;
i
<
dLen
;
i
++
)
{
juanStr
+=
'<li>'
+
'<input name="juangroup" type="radio" value="'
+
data
[
i
].
code
+
'" '
+
(
data
[
i
].
valid
?
''
:
'disabled="disabled"'
)
+
'>'
+
'<label>'
+
data
[
i
].
desc
+
'</label>'
+
'<input name="juangroup" type="radio" value="'
+
data
[
i
].
code
+
'" '
+
(
data
[
i
].
valid
?
''
:
'disabled="disabled"'
)
+
'>'
+
'<label>'
+
data
[
i
].
desc
+
'</label>'
+
'</li>'
;
}
...
...
@@ -16382,6 +16382,7 @@ $('.to-play input.submit').click(function() {
redEnvelopes
=
$
(
'.use-envelopes input:checked'
).
attr
(
'data-use'
),
$juangroupInput
=
$
(
'.play-juan.is-select input[name="juangroup"]:checked'
),
codeVal
=
$juangroupInput
.
val
(),
promotionVal
=
$juangroupInput
.
closest
(
'li'
).
find
(
'#juancode'
).
val
();
juanCode
=
!!
codeVal
?
codeVal
:
$juangroupInput
.
closest
(
'li'
).
find
(
'#juancode'
).
val
();
$loading
.
show
();
...
...
@@ -16407,6 +16408,7 @@ $('.to-play input.submit').click(function() {
paymentType
:
paymentType
,
remark
:
remark
,
couponCode
:
juanCode
,
promotionCode
:
promotionVal
,
yohoCoin
:
yohoCoin
,
isPreContact
:
ytoTrue
(
isPreContact
),
isPrintPrice
:
ytoTrue
(
isPrintPrice
),
...
...
@@ -16424,7 +16426,7 @@ $('.to-play input.submit').click(function() {
}).
always
(
function
()
{
$this
.
removeAttr
(
'disabled'
);
});
});
});
});
define
(
"js/shopping/pay"
,
[
"jquery"
],
function
(
require
,
exports
,
module
){
...
...
web-static/dist/yohobuy/0.0.23/index.css
View file @
495ca78
This diff could not be displayed because it is too large.
web-static/dist/yohobuy/0.0.23/index.js
View file @
495ca78
This diff could not be displayed because it is too large.
web-static/js/order/address.js
View file @
495ca78
...
...
@@ -720,7 +720,7 @@ function getYohoBiList() {
type
:
'GET'
,
dataType
:
'json'
,
url
:
'/cart/index/getCouponList'
}).
then
(
function
(
d
)
{
}).
then
(
function
(
d
)
{
if
(
d
.
code
===
200
)
{
data
=
d
.
data
;
...
...
@@ -728,9 +728,9 @@ function getYohoBiList() {
for
(
i
=
0
;
i
<
dLen
;
i
++
)
{
juanStr
+=
'<li>'
+
'<input name="juangroup" type="radio" value="'
+
data
[
i
].
code
+
'" '
+
(
data
[
i
].
valid
?
''
:
'disabled="disabled"'
)
+
'>'
+
'<label>'
+
data
[
i
].
desc
+
'</label>'
+
'<input name="juangroup" type="radio" value="'
+
data
[
i
].
code
+
'" '
+
(
data
[
i
].
valid
?
''
:
'disabled="disabled"'
)
+
'>'
+
'<label>'
+
data
[
i
].
desc
+
'</label>'
+
'</li>'
;
}
...
...
@@ -772,6 +772,7 @@ $('.to-play input.submit').click(function() {
redEnvelopes
=
$
(
'.use-envelopes input:checked'
).
attr
(
'data-use'
),
$juangroupInput
=
$
(
'.play-juan.is-select input[name="juangroup"]:checked'
),
codeVal
=
$juangroupInput
.
val
(),
promotionVal
=
$juangroupInput
.
closest
(
'li'
).
find
(
'#juancode'
).
val
();
juanCode
=
!!
codeVal
?
codeVal
:
$juangroupInput
.
closest
(
'li'
).
find
(
'#juancode'
).
val
();
$loading
.
show
();
...
...
@@ -797,6 +798,7 @@ $('.to-play input.submit').click(function() {
paymentType
:
paymentType
,
remark
:
remark
,
couponCode
:
juanCode
,
promotionCode
:
promotionVal
,
yohoCoin
:
yohoCoin
,
isPreContact
:
ytoTrue
(
isPreContact
),
isPrintPrice
:
ytoTrue
(
isPrintPrice
),
...
...
@@ -814,4 +816,4 @@ $('.to-play input.submit').click(function() {
}).
always
(
function
()
{
$this
.
removeAttr
(
'disabled'
);
});
});
});
...
...
yohobuy/www.yohobuy.com/application/models/Shopping/Cart.php
View file @
495ca78
...
...
@@ -872,13 +872,14 @@ class CartModel
* @param int $paymentType 支付类型ID
* @param string $remark 留言
* @param string $couponCode 优惠券码
* @param string $promotionCode 优惠码
* @param mixed $yohoCoin 使用的YOHO币数量或为空
* @param int $isPreContact 送货前是否联系
* @param int $isPrintPrice 是否打印价格
* @param int $redEnvelopes 红包
* @return array 接口返回的数据
*/
public
static
function
orderSub
(
$uid
,
$addressId
,
$cartType
,
$deliveryTimeId
,
$deliveryWayId
,
$invoiceTitle
,
$invoiceId
,
$paymentId
,
$paymentType
,
$remark
,
$couponCode
,
$yohoCoin
,
$isPreContact
,
$isPrintPrice
,
$redEnvelopes
)
public
static
function
orderSub
(
$uid
,
$addressId
,
$cartType
,
$deliveryTimeId
,
$deliveryWayId
,
$invoiceTitle
,
$invoiceId
,
$paymentId
,
$paymentType
,
$remark
,
$couponCode
,
$promotionCode
,
$yohoCoin
,
$isPreContact
,
$isPrintPrice
,
$redEnvelopes
)
{
$result
=
array
(
'code'
=>
400
,
'message'
=>
self
::
ERROR_400_MESSAGE
);
...
...
@@ -916,7 +917,7 @@ class CartModel
$userAgent
=
isset
(
$unionInfo
[
'client_id'
])
?
'YOHO!Buy/3.8.2.259(Model/PC;Channel/'
.
$unionInfo
[
'client_id'
]
.
';uid/'
.
$uid
.
')'
:
null
;
}
$orderSubRes
=
CartData
::
orderSub
(
$uid
,
$addressId
,
$cartType
,
$deliveryTimeId
,
$deliveryWayId
,
$invoiceTitle
,
$invoiceId
,
$paymentId
,
$paymentType
,
$remark
,
$couponCode
,
$yohoCoin
,
$isPreContact
,
$isPrintPrice
,
$unionKey
,
$userAgent
,
$redEnvelopes
);
$orderSubRes
=
CartData
::
orderSub
(
$uid
,
$addressId
,
$cartType
,
$deliveryTimeId
,
$deliveryWayId
,
$invoiceTitle
,
$invoiceId
,
$paymentId
,
$paymentType
,
$remark
,
$couponCode
,
$promotionCode
,
$yohoCoin
,
$isPreContact
,
$isPrintPrice
,
$unionKey
,
$userAgent
,
$redEnvelopes
);
if
(
$orderSubRes
&&
isset
(
$orderSubRes
[
'code'
]))
{
$result
=
$orderSubRes
;
}
...
...
yohobuy/www.yohobuy.com/application/modules/Cart/controllers/Index.php
View file @
495ca78
...
...
@@ -445,15 +445,17 @@ class IndexController extends WebAction
$paymentId
=
$this
->
post
(
'paymentId'
,
15
);
// 支付ID
$paymentType
=
$this
->
post
(
'paymentType'
,
1
);
// 默认在线支付
$remark
=
$this
->
post
(
'remark'
,
''
);
// 备注信息
$couponCode
=
$this
->
post
(
'couponCode'
,
null
);
// 优惠码
$couponCode
=
$this
->
post
(
'couponCode'
,
null
);
// 优惠券码
$promotionCode
=
$this
->
post
(
'promotionCode'
,
null
);
//优惠码
$yohoCoin
=
$this
->
post
(
'yohoCoin'
,
1
);
// YOHO币
$isPreContact
=
$this
->
post
(
'isPreContact'
,
false
);
// 送货前是否联系
$isPrintPrice
=
$this
->
post
(
'isPrintPrice'
,
true
);
// 是否打印价格
$redEnvelopes
=
$this
->
post
(
'redEnvelopes'
,
null
);
//优先优惠码
$couponCode
=
$promotionCode
?
null
:
$couponCode
;
// 调用下单接口
$result
=
CartModel
::
orderSub
(
$uid
,
$addressId
,
$cartType
,
$deliveryTimeId
,
$deliveryWayId
,
$invoiceTitle
,
$invoiceId
,
$paymentId
,
$paymentType
,
$remark
,
$couponCode
,
$yohoCoin
,
$isPreContact
,
$isPrintPrice
,
$redEnvelopes
);
$paymentId
,
$paymentType
,
$remark
,
$couponCode
,
$promotionCode
,
$yohoCoin
,
$isPreContact
,
$isPrintPrice
,
$redEnvelopes
);
// 判断是否下单成功
if
(
empty
(
$result
[
'data'
][
'order_code'
]))
{
...
...
Please
register
or
login
to post a comment