Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fmp_vip
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhenfei.zhang
fmp_vip
Commits
7a5e127a
Commit
7a5e127a
authored
Feb 11, 2018
by
NitefullWind
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 一茶一坐_富罟对接。 积分使用规则调整为1积分1元。
parent
9cf9423d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
68 additions
and
16 deletions
+68
-16
global.h
+7
-2
task/taskpay.cpp
+33
-7
windows/fmviporder.cpp
+16
-2
windows/fmviporder.h
+7
-0
windows/forms/fmviporder.ui
+5
-5
No files found.
global.h
View file @
7a5e127a
...
...
@@ -11,11 +11,16 @@
//#define KEY_CODE "a35e33c8-e6f2-4107-8670-a69a85adf85b"
//#define PARTNER_ID "f92b8997-40c7-4622-af3b-512fd49d6113"
#ifdef YCYZ_FUGU
////! 一茶一座_富罟
#ifdef YCYZ_FUGU
_TEST
////! 一茶一座_富罟
测试
#define APP_ID "T021"
#define KEY_CODE "5f300ce7-8d00-464f-a969-f9ebb4c0e7d4"
#define PARTNER_ID "ea86bff6-1783-4c4a-9dee-0189de37b6eb"
#elif YCYZ_FUGU
////! 一茶一座_富罟
#define APP_ID "T020"
#define KEY_CODE "0206c33a-aa2d-49e5-bdd1-3107143a252f"
#define PARTNER_ID "8d5b84a9-0cb6-417f-b87d-ff39d17ad311"
#else
////! 一茶一座
#define APP_ID "T014"
...
...
task/taskpay.cpp
View file @
7a5e127a
...
...
@@ -91,17 +91,23 @@ void TaskPay::packageServerReq()
//余额支付详情
QJsonObject
balance
;
int
codeAmount
=
session
()
->
data
(
PosProps
.
CodeAmount
).
toInt
();
balance
[
"amount"
]
=
codeAmount
;
balance
[
"transId"
]
=
getPosJsonValue
(
"trans_id"
);
balance
[
"typeModeFlag"
]
=
20001
;
balance
[
"thirdPayTransId"
]
=
""
;
payList
.
push_back
(
balance
);
if
(
codeAmount
>
0
)
{
balance
[
"amount"
]
=
codeAmount
;
balance
[
"transId"
]
=
getPosJsonValue
(
"trans_id"
);
balance
[
"typeModeFlag"
]
=
20001
;
balance
[
"thirdPayTransId"
]
=
""
;
payList
.
push_back
(
balance
);
}
// 积分支付详情
QJsonObject
score
;
int
scoreAmount
=
session
()
->
data
(
PosProps
.
ScoreAmount
).
toInt
();
if
(
scoreAmount
>
0
)
{
#ifdef YCYZ_FUGU
score
[
"amount"
]
=
(
int
)(
scoreAmount
/
100
);
#else
score
[
"amount"
]
=
scoreAmount
;
#endif
score
[
"transId"
]
=
getPosJsonValue
(
"trans_id"
);
score
[
"typeModeFlag"
]
=
20002
;
score
[
"thirdPayTransId"
]
=
""
;
...
...
@@ -147,11 +153,25 @@ void TaskPay::packageServerReq()
coupon
[
"code"
]
=
c
.
code
();
payList
.
push_back
(
coupon
);
}
int
payAmount
=
codeAmount
+
scoreAmount
+
couponAmount
;
// 支付金额为0
if
(
payAmount
==
0
)
{
QJsonObject
balance
;
balance
[
"amount"
]
=
0
;
balance
[
"transId"
]
=
getPosJsonValue
(
"trans_id"
);
balance
[
"typeModeFlag"
]
=
20001
;
balance
[
"thirdPayTransId"
]
=
""
;
payList
.
push_back
(
balance
);
}
transData
[
"productList"
]
=
products
;
transData
[
"payList"
]
=
payList
;
int
payAmount
=
codeAmount
+
scoreAmount
+
couponAmount
;
#ifdef YCYZ_FUGU
transData
[
ServerProps
(
PosProps
.
PaidAmount
)]
=
payAmount
;
#elif
transData
[
ServerProps
(
PosProps
.
Pay_amount
)]
=
payAmount
;
#endif
serverReqJsonObj
[
"data"
]
=
transData
;
}
...
...
@@ -185,7 +205,13 @@ void TaskPay::packagePOSRsp()
if
(
payId
==
"20003"
)
{
pay_id
[
PosProps
.
Pay_amount
]
=
0
;
pay_id
[
"merchant_discount"
]
=
servPayArray
[
i
].
toObject
()[
ServerProps
(
PosProps
.
Pay_amount
)].
toInt
();
}
else
{
}
#ifdef YCYZ_FUGU
else
if
(
payId
==
"20002"
)
{
pay_id
[
PosProps
.
Pay_amount
]
=
servPayArray
[
i
].
toObject
()[
ServerProps
(
PosProps
.
Pay_amount
)].
toInt
()
*
100
;
}
#endif
else
{
pay_id
[
PosProps
.
Pay_amount
]
=
servPayArray
[
i
].
toObject
()[
ServerProps
(
PosProps
.
Pay_amount
)].
toInt
();
}
pay_id
[
PosProps
.
Pay_id
]
=
payId
;
...
...
windows/fmviporder.cpp
View file @
7a5e127a
...
...
@@ -11,6 +11,14 @@ FMVipOrder::FMVipOrder(QDialog *parent) :
ui
(
new
Ui
::
FMVipOrder
)
{
ui
->
setupUi
(
this
);
#ifdef YCYZ_FUGU
#else
ui
->
score_edit
->
setMaximumSize
(
0
,
0
);
ui
->
score_edit
->
setMinimumSize
(
0
,
0
);
ui
->
score_label
->
setMaximumSize
(
0
,
0
);
ui
->
score_label
->
setMinimumSize
(
0
,
0
);
#endif
}
FMVipOrder
::~
FMVipOrder
()
...
...
@@ -56,6 +64,7 @@ bool FMVipOrder::initWnd(Session *session)
ui
->
balance_label
->
setText
(
orderInfo
->
getAmountStr
());
ui
->
price_label
->
setText
(
orderInfo
->
getNeedPayStr
());
ui
->
name_label
->
setText
(
name
);
ui
->
store_label
->
setText
(
session
->
data
(
PosProps
.
StoreId
).
toString
());
couponModel
=
new
CouponModel
(
this
);
ui
->
coupon_page
->
setModel
(
couponModel
);
...
...
@@ -205,11 +214,16 @@ void FMVipOrder::on_score_edit_textChanged(const QString &scoreStr)
ui
->
score_edit
->
setText
(
QString
::
number
(
orderInfo
->
getScore
()));
score
=
orderInfo
->
getScore
();
}
int
baseUseScore
=
1000
;
#ifdef YCYZ_FUGU
baseUseScore
=
1
;
#endif
// 可用积分数量
int
score_enable
=
score
/
1000
*
1000
;
// 以1000
的整数倍可抵扣
int
score_enable
=
score
/
baseUseScore
*
baseUseScore
;
// 以baseUseScore
的整数倍可抵扣
orderInfo
->
setUseScore
(
score_enable
);
while
(
orderInfo
->
enoughScore
())
{
score_enable
-=
1000
;
score_enable
-=
baseUseScore
;
orderInfo
->
setUseScore
(
score_enable
);
}
...
...
windows/fmviporder.h
View file @
7a5e127a
...
...
@@ -62,6 +62,7 @@ private:
_amount
=
_amountStr
.
toInt
()
/
100
.
0
;
_needPay
=
_needPayStr
.
toInt
()
/
100
.
0
;
_score
=
score
;
_payScore
=
_maxWillPay
=
_payAmountScore
=
_payAmountCoupon
=
0
;
...
...
@@ -86,6 +87,11 @@ private:
void
setUseScore
(
int
payScore
)
{
_payScore
=
payScore
;
#ifdef YCYZ_FUGU
// 1积分=1元
_payScore
=
payScore
*
100
;
_payAmountScore
=
payScore
;
#else
if
(
payScore
<
1000
)
{
_payAmountScore
=
payScore
/
100
.
0
*
0
;
}
else
if
(
payScore
<
4999
)
{
...
...
@@ -95,6 +101,7 @@ private:
}
else
{
_payAmountScore
=
payScore
/
100
.
0
*
1
.
5
;
}
#endif
setMaxWillPay
();
}
double
getPayAmountScore
()
...
...
windows/forms/fmviporder.ui
View file @
7a5e127a
...
...
@@ -794,13 +794,13 @@
<property
name=
"minimumSize"
>
<size>
<width>
0
</width>
<height>
0
</height>
<height>
47
</height>
</size>
</property>
<property
name=
"maximumSize"
>
<size>
<width>
0
</width>
<height>
0
</height>
<width>
16777215
</width>
<height>
16777215
</height>
</size>
</property>
<property
name=
"text"
>
...
...
@@ -815,8 +815,8 @@
<widget
class=
"QLabel"
name=
"score_label"
>
<property
name=
"maximumSize"
>
<size>
<width>
0
</width>
<height>
0
</height>
<width>
16777215
</width>
<height>
16777215
</height>
</size>
</property>
<property
name=
"text"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment