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
xiaojing.zhang
fmp_vip
Commits
2c62a2ab
Commit
2c62a2ab
authored
Sep 11, 2017
by
NitefullWind
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 优惠券接口改变。 2. 限制只能使用一张优惠券。
parent
035b9d0d
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
41 additions
and
11 deletions
+41
-11
fmp_vip.pro
+2
-0
global.h
+2
-2
task/fmtasknownd.cpp
+1
-1
task/tasklogin.cpp
+16
-1
task/taskothers.cpp
+15
-2
windows/fmviporder.cpp
+5
-4
windows/forms/fmmsgwnd.ui
+0
-1
No files found.
fmp_vip.pro
View file @
2c62a2ab
...
@@ -11,6 +11,8 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
...
@@ -11,6 +11,8 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG
+=
c
++
11
CONFIG
+=
c
++
11
DEFINES
+=
TEST
SOURCES
+=
\
SOURCES
+=
\
fmp_vip
.
cpp
\
fmp_vip
.
cpp
\
fmp_vip_p
.
cpp
\
fmp_vip_p
.
cpp
\
...
...
global.h
View file @
2c62a2ab
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
// 请求类型链表
// 请求类型链表
const
static
QStringList
FM_Type_List
=
QString
(
const
static
QStringList
FM_Type_List
=
QString
(
"member_check_request,"
"member_check_request,"
"
coupon_check
_request,"
"
order_coupon
_request,"
"member_charge_request,"
"member_charge_request,"
"order_request,"
"order_request,"
"integral_request,"
"integral_request,"
...
@@ -22,7 +22,7 @@ const static QStringList FM_Type_List = QString(
...
@@ -22,7 +22,7 @@ const static QStringList FM_Type_List = QString(
// 服务端请求类型
// 服务端请求类型
const
static
QStringList
FM_Server_Type
=
QString
(
const
static
QStringList
FM_Server_Type
=
QString
(
"member_check_request,"
"member_check_request,"
"
coupon_check
_request,"
"
order_coupon
_request,"
"member_charge_request,"
"member_charge_request,"
"order_request,"
"order_request,"
"integral_request,"
"integral_request,"
...
...
task/fmtasknownd.cpp
View file @
2c62a2ab
...
@@ -27,7 +27,7 @@ QByteArray FMTaskNoWnd::doTask()
...
@@ -27,7 +27,7 @@ QByteArray FMTaskNoWnd::doTask()
// }
// }
copyPros
();
copyPros
();
bool
isOk
=
sendToServer
();
bool
isOk
=
sendToServer
(
false
);
if
(
!
isOk
)
{
if
(
!
isOk
)
{
FMP_WARN
()
<<
QString
(
"Task error %1: %2"
).
arg
(
error
()).
arg
(
errorString
());
FMP_WARN
()
<<
QString
(
"Task error %1: %2"
).
arg
(
error
()).
arg
(
errorString
());
return
QString
(
ErrorMsgJson
).
arg
(
error
()).
arg
(
errorString
()).
toLatin1
();
return
QString
(
ErrorMsgJson
).
arg
(
error
()).
arg
(
errorString
()).
toLatin1
();
...
...
task/tasklogin.cpp
View file @
2c62a2ab
...
@@ -50,12 +50,14 @@ void TaskLogin::onLogin()
...
@@ -50,12 +50,14 @@ void TaskLogin::onLogin()
FMP_WARN
()
<<
"Login failed: "
<<
info
;
FMP_WARN
()
<<
"Login failed: "
<<
info
;
FMMsgWnd
::
FailureWnd
(
info
,
_window
);
FMMsgWnd
::
FailureWnd
(
info
,
_window
);
}
}
#ifndef TEST
// 认证成功但限制用支付码
// 认证成功但限制用支付码
else
if
((
session
()
->
data
(
PosProps
.
FM_Type
).
toInt
()
==
FM_Pay
)
&&
else
if
((
session
()
->
data
(
PosProps
.
FM_Type
).
toInt
()
==
FM_Pay
)
&&
(
getServerJsonValue
(
PosProps
.
CanPay
).
toInt
()
!=
1
))
{
(
getServerJsonValue
(
PosProps
.
CanPay
).
toInt
()
!=
1
))
{
FMP_WARN
()
<<
ErrorNeedPayCode
;
FMP_WARN
()
<<
ErrorNeedPayCode
;
FMMsgWnd
::
FailureWnd
(
QString
::
fromLocal8Bit
(
ErrorNeedPayCode
),
_window
);
FMMsgWnd
::
FailureWnd
(
QString
::
fromLocal8Bit
(
ErrorNeedPayCode
),
_window
);
}
}
#endif
// 认证成功
// 认证成功
else
{
else
{
QString
fm_open_id
=
getServerJsonValue
(
PosProps
.
Fm_open_id
).
toString
();
QString
fm_open_id
=
getServerJsonValue
(
PosProps
.
Fm_open_id
).
toString
();
...
@@ -89,11 +91,24 @@ void TaskLogin::onLogin()
...
@@ -89,11 +91,24 @@ void TaskLogin::onLogin()
double
amount
=
couponOb
[
ServerProps
(
PosProps
.
Coupon_disAmount
)].
toInt
()
/
100.0
;
double
amount
=
couponOb
[
ServerProps
(
PosProps
.
Coupon_disAmount
)].
toInt
()
/
100.0
;
QString
desc
=
couponOb
[
ServerProps
(
PosProps
.
Coupon_desc
)].
toString
();
QString
desc
=
couponOb
[
ServerProps
(
PosProps
.
Coupon_desc
)].
toString
();
Coupon
c
(
desc
,
code
,
amount
,
0
,
1
);
Coupon
c
(
desc
,
code
,
amount
,
0
,
false
);
QVariant
v
;
QVariant
v
;
v
.
setValue
(
c
);
v
.
setValue
(
c
);
couponMap
[
code
]
=
v
;
couponMap
[
code
]
=
v
;
}
}
#ifdef TEST
for
(
int
i
=
0
;
i
<
5
;
i
++
)
{
QString
strI
=
QString
::
number
(
i
);
Coupon
c
(
QString
::
fromLocal8Bit
(
"测试不可用"
)
+
strI
,
strI
,
i
,
0
,
false
);
QVariant
v
;
v
.
setValue
(
c
);
couponMap
[
strI
]
=
v
;
}
FMP_INFO
()
<<
"Test coupon: "
<<
couponMap
;
#endif
session
()
->
addData
(
PosProps
.
CouponMap
,
couponMap
);
session
()
->
addData
(
PosProps
.
CouponMap
,
couponMap
);
}
}
_window
->
accept
();
_window
->
accept
();
...
...
task/taskothers.cpp
View file @
2c62a2ab
#
include
"taskothers.h"
#
include
"taskothers.h"
#include "fmp_logger_i.h"
/// 优惠券查询
/// 优惠券查询
TaskCoupon
::
TaskCoupon
(
QJsonObject
&
jsonObj
,
Session
*
session
,
QObject
*
parent
)
TaskCoupon
::
TaskCoupon
(
QJsonObject
&
jsonObj
,
Session
*
session
,
QObject
*
parent
)
...
@@ -50,11 +50,24 @@ void TaskCoupon::packagePOSRsp()
...
@@ -50,11 +50,24 @@ void TaskCoupon::packagePOSRsp()
double
amount
=
couponOb
[
ServerProps
(
PosProps
.
Coupon_disAmount
)].
toInt
()
/
100.0
;
double
amount
=
couponOb
[
ServerProps
(
PosProps
.
Coupon_disAmount
)].
toInt
()
/
100.0
;
QString
desc
=
couponOb
[
ServerProps
(
PosProps
.
Coupon_desc
)].
toString
();
QString
desc
=
couponOb
[
ServerProps
(
PosProps
.
Coupon_desc
)].
toString
();
Coupon
c
(
desc
,
code
,
amount
);
Coupon
c
(
desc
,
code
,
amount
,
0
,
false
);
QVariant
v
;
QVariant
v
;
v
.
setValue
(
c
);
v
.
setValue
(
c
);
couponMap
[
code
]
=
v
;
couponMap
[
code
]
=
v
;
}
}
#ifdef TEST
for
(
int
i
=
0
;
i
<
5
;
i
++
)
{
QString
strI
=
QString
::
number
(
i
);
Coupon
c
(
strI
,
strI
,
i
,
0
,
false
);
QVariant
v
;
v
.
setValue
(
c
);
couponMap
[
strI
]
=
v
;
}
FMP_INFO
()
<<
"Test coupon: "
<<
couponMap
;
#endif
session
()
->
addData
(
PosProps
.
CouponMap
,
couponMap
);
session
()
->
addData
(
PosProps
.
CouponMap
,
couponMap
);
}
}
...
...
windows/fmviporder.cpp
View file @
2c62a2ab
...
@@ -117,20 +117,21 @@ void FMVipOrder::on_coupon_page_clicked(const QModelIndex &index)
...
@@ -117,20 +117,21 @@ void FMVipOrder::on_coupon_page_clicked(const QModelIndex &index)
if
(
selectionModel
->
selectedIndexes
().
length
()
==
1
)
{
if
(
selectionModel
->
selectedIndexes
().
length
()
==
1
)
{
QModelIndex
firstIndex
=
selectionModel
->
selectedIndexes
().
first
();
QModelIndex
firstIndex
=
selectionModel
->
selectedIndexes
().
first
();
if
(
!
couponModel
->
coupon
(
firstIndex
).
isCompatible
())
{
if
(
!
couponModel
->
coupon
(
firstIndex
).
isCompatible
())
{
FMMsgWnd
::
FailureWnd
(
QString
::
fromLocal8Bit
(
"已经选中了一张不可叠加券,不能再选用其他代金券"
));
// FMMsgWnd::FailureWnd(QString::fromLocal8Bit("已经选中了一张不可叠加券,不能再选用其他代金券"), this);
return
;
// return;
selectionModel
->
clear
();
}
}
}
}
Coupon
coupon
=
couponModel
->
coupon
(
index
);
Coupon
coupon
=
couponModel
->
coupon
(
index
);
// 判断是否满足使用条件
// 判断是否满足使用条件
if
(
orderInfo
->
getMaxDisAmount
()
<
coupon
.
limitAmount
())
{
if
(
orderInfo
->
getMaxDisAmount
()
<
coupon
.
limitAmount
())
{
FMMsgWnd
::
FailureWnd
(
QString
::
fromLocal8Bit
(
"该代金券不满足使用条件"
));
FMMsgWnd
::
FailureWnd
(
QString
::
fromLocal8Bit
(
"该代金券不满足使用条件"
)
,
this
);
return
;
return
;
}
}
// 处理不可叠加券
// 处理不可叠加券
if
(
!
coupon
.
isCompatible
())
{
if
(
!
coupon
.
isCompatible
())
{
if
(
!
selectionModel
->
selectedIndexes
().
isEmpty
())
{
if
(
!
selectionModel
->
selectedIndexes
().
isEmpty
())
{
FMMsgWnd
::
FailureWnd
(
"该代金券不可与其他代金券叠加使用,请取消选中其他代金券"
);
FMMsgWnd
::
FailureWnd
(
"该代金券不可与其他代金券叠加使用,请取消选中其他代金券"
,
this
);
return
;
return
;
}
}
selectionModel
->
select
(
index
,
QItemSelectionModel
::
ClearAndSelect
);
selectionModel
->
select
(
index
,
QItemSelectionModel
::
ClearAndSelect
);
...
...
windows/forms/fmmsgwnd.ui
View file @
2c62a2ab
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
<property
name=
"styleSheet"
>
<property
name=
"styleSheet"
>
<string
notr=
"true"
>
#label_logo
<string
notr=
"true"
>
#label_logo
{
{
border-image: url(:/img/tip_ok.png);
}
</string>
}
</string>
</property>
</property>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_4"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_4"
>
...
...
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