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
18f682b1
Commit
18f682b1
authored
Jul 20, 2017
by
NitefullWind
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 实现输入消费积分功能。 2. 重新实现代金券界面和逻辑。
parent
8c7406ea
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
270 additions
and
479 deletions
+270
-479
fmp_vip.pro
+6
-2
global.h
+14
-1
task/coupon.cpp
+2
-1
task/coupon.h
+3
-1
task/fmtask.cpp
+2
-5
task/fmtasknownd.cpp
+0
-2
task/session.cpp
+2
-2
task/session.h
+2
-53
task/taskcoupon.cpp
+0
-207
task/taskcoupon.h
+0
-67
task/tasklogin.cpp
+5
-2
task/tasklogin.h
+1
-1
task/taskothers.cpp
+25
-5
task/taskothers.h
+10
-0
task/taskpay.cpp
+30
-26
task/taskpay.h
+33
-3
windows/fmcouponwidget.cpp
+3
-3
windows/fmmsgwnd.cpp
+16
-9
windows/fmvipfund.cpp
+2
-1
windows/fmvipfund.h
+1
-1
windows/fmviplogin.cpp
+2
-1
windows/fmviplogin.h
+1
-1
windows/fmviporder.cpp
+0
-0
windows/fmviporder.h
+84
-67
windows/fmvippanel.cpp
+2
-1
windows/fmvippanel.h
+1
-1
windows/fmvipwnd.h
+1
-1
windows/forms/fmviporder.ui
+22
-15
No files found.
fmp_vip.pro
View file @
18f682b1
...
...
@@ -39,7 +39,9 @@ SOURCES += \
fmp_ve_handlers
.
cpp
\
fmp_vip_server
.
cpp
\
fmp_vip_settings
.
cpp
\
task
/
taskcoupon
.
cpp
task
/
coupon
.
cpp
\
windows
/
couponmodel
.
cpp
\
windows
/
itemdelegate
.
cpp
HEADERS
+=
\
fmp_vip
.
h
\
...
...
@@ -71,7 +73,9 @@ HEADERS +=\
fmp_ve_handlers
.
h
\
fmp_vip_server
.
h
\
fmp_vip_settings
.
h
\
task
/
taskcoupon
.
h
task
/
coupon
.
h
\
windows
/
couponmodel
.
h
\
windows
/
itemdelegate
.
h
unix
{
target
.
path
=
/
usr
/
lib
...
...
global.h
View file @
18f682b1
...
...
@@ -31,6 +31,15 @@ enum FM_TYPE {
FM_Refund_Pay
,
FM_Refund_Order
};
enum
Member_Type
{
Unknow
=
0
,
PayCode
,
Phone
,
Account
,
OriginalCard
};
// 会员服务端请求URL
#ifndef FMREQURLMAP
#define FMREQURLMAP
...
...
@@ -67,7 +76,8 @@ struct PP{
Account
=
"account"
;
Type_code
=
"type_code"
;
Type_name
=
"type_name"
;
Member_type
=
"member_type"
;
Name
=
"name"
;
Sex
=
"sex"
;
Birthday
=
"birthday"
;
...
...
@@ -93,6 +103,7 @@ struct PP{
Transaction
=
"transactions"
;
OrderAmount
=
"order_amount"
;
PaidAmount
=
"paid_amount"
;
UndisAmount
=
"undis_amount"
;
NeedAmount
=
"need_amount"
;
StandardAmount
=
"standard_amount"
;
Fm_id
=
"fm_id"
;
...
...
@@ -141,6 +152,7 @@ struct PP{
QString
Account
;
QString
Type_code
;
QString
Type_name
;
QString
Member_type
;
QString
Name
;
QString
Sex
;
...
...
@@ -169,6 +181,7 @@ struct PP{
QString
OrderAmount
;
QString
NeedAmount
;
QString
PaidAmount
;
QString
UndisAmount
;
QString
StandardAmount
;
QString
Fm_id
;
QString
Settlement
;
...
...
task/coupon.cpp
View file @
18f682b1
...
...
@@ -6,9 +6,10 @@
const
int
PaintingWidth
=
220
;
const
int
PaintingHeight
=
116
;
Coupon
::
Coupon
(
QString
name
,
QString
code
,
double
disAmount
,
double
limitAmount
,
bool
isCompatible
)
:
Coupon
::
Coupon
(
QString
name
,
QString
code
,
QString
type
,
double
disAmount
,
double
limitAmount
,
bool
isCompatible
)
:
_name
(
name
),
_code
(
code
),
_type
(
type
),
_disAmount
(
disAmount
),
_limitAmount
(
limitAmount
),
_isCompatible
(
isCompatible
)
...
...
task/coupon.h
View file @
18f682b1
...
...
@@ -10,7 +10,7 @@ class QPainter;
class
Coupon
{
public
:
explicit
Coupon
(
QString
name
=
""
,
QString
code
=
""
,
double
disAmount
=
0
,
double
limitAmount
=
0
,
bool
isCompatible
=
true
);
explicit
Coupon
(
QString
name
=
""
,
QString
code
=
""
,
QString
type
=
""
,
double
disAmount
=
0
,
double
limitAmount
=
0
,
bool
isCompatible
=
true
);
void
paint
(
QPainter
*
painter
,
const
QRect
&
rect
,
const
QPalette
&
palette
)
const
;
...
...
@@ -18,12 +18,14 @@ public:
QString
name
()
const
{
return
_name
;}
QString
code
()
const
{
return
_code
;}
QString
typeModeFlag
()
const
{
return
_type
;}
double
disAmount
()
const
{
return
_disAmount
;}
double
limitAmount
()
const
{
return
_limitAmount
;}
bool
isCompatible
()
const
{
return
_isCompatible
;}
private
:
QString
_name
;
QString
_code
;
QString
_type
;
double
_disAmount
;
double
_limitAmount
;
bool
_isCompatible
;
...
...
task/fmtask.cpp
View file @
18f682b1
...
...
@@ -120,6 +120,8 @@ bool FMTask::sendToServer(bool isShowMsg)
FMNetwork
net
;
net
.
send
(
url
,
data
,
rspData
);
FMP_INFO
()
<<
"Server rsponse: "
<<
rspData
;
// 网络错误
if
(
net
.
error
!=
FM_API_SUCCESS
)
{
setError
(
net
.
error
,
net
.
errorMsg
);
...
...
@@ -132,7 +134,6 @@ bool FMTask::sendToServer(bool isShowMsg)
setError
(
FM_API_BADJSON
);
}
else
{
serverRspJsonObj
=
rspJson
.
object
();
qDebug
()
<<
"serverRspJsonObj: "
<<
serverRspJsonObj
;
// 服务器返回的错误
if
(
serverRspJsonObj
.
contains
(
"errcode"
))
{
...
...
@@ -141,9 +142,6 @@ bool FMTask::sendToServer(bool isShowMsg)
}
}
FMP_INFO
()
<<
"Server rsponse: "
<<
serverRspJsonObj
;
if
(
_window
!=
nullptr
)
{
_window
->
setIsBusy
(
false
);
}
...
...
@@ -162,7 +160,6 @@ QJsonValue FMTask::searchJsonValue(QJsonObject &searchJson, QString searchKey)
if
(
searchJson
.
contains
(
searchKey
))
{
return
searchJson
[
searchKey
];
}
else
{
qDebug
()
<<
searchJson
.
keys
();
foreach
(
QString
key
,
searchJson
.
keys
())
{
if
(
searchJson
[
key
].
isObject
())
{
QJsonObject
ob
=
searchJson
[
key
].
toObject
();
...
...
task/fmtasknownd.cpp
View file @
18f682b1
#
include
"fmtasknownd.h"
#include "fmp_vip_settings.h"
#include "fmnetwork.h"
#include <QJsonDocument>
#include <QCryptographicHash>
FMTaskNoWnd
::
FMTaskNoWnd
(
QJsonObject
&
jsonObj
,
FM_TYPE
fmType
,
Session
*
session
,
QObject
*
parent
)
:
FMTask
(
jsonObj
,
fmType
,
session
,
parent
)
...
...
task/session.cpp
View file @
18f682b1
...
...
@@ -30,7 +30,7 @@ void Session::addData(const QString key, const QMap<QString, Coupon> couponMap)
foreach
(
const
Coupon
coupon
,
couponMap
)
{
QVariant
v
;
v
.
setValue
(
coupon
);
v_couponMap
[
coupon
.
code
]
=
v
;
v_couponMap
[
coupon
.
code
()
]
=
v
;
}
addData
(
key
,
v_couponMap
);
}
...
...
@@ -41,7 +41,7 @@ QMap<QString, Coupon> Session::getCouponMap(const QString key)
QMap
<
QString
,
Coupon
>
couponMap
;
foreach
(
const
QVariant
v_coupon
,
v_couponMap
)
{
Coupon
coupon
=
v_coupon
.
value
<
Coupon
>
();
couponMap
[
coupon
.
code
]
=
coupon
;
couponMap
[
coupon
.
code
()
]
=
coupon
;
}
return
couponMap
;
}
task/session.h
View file @
18f682b1
...
...
@@ -2,60 +2,8 @@
#define SESSION_H
#include <QVariant>
#include <QVector>
#include "global.h"
//代金券所适用的商品的信息
struct
ApplyProduct
{
int
price
;
//商品价格
int
coupon_discount_amount
;
//抵消额
QString
pid
;
//商品id
int
consume_num
;
//商品数量
};
Q_DECLARE_METATYPE
(
ApplyProduct
)
// 代金券结构体
struct
Coupon
{
Coupon
()
{
code
=
""
;
disAmount
=
0
.
0
;
desc
=
""
;
typeModeFlag
=
-
1
;
limit_amount
=
0
;
dis_price
=
0
;
compatible_flag
=
0
;
}
Coupon
(
const
Coupon
&
C
)
{
code
=
C
.
code
;
disAmount
=
C
.
disAmount
;
desc
=
C
.
desc
;
typeModeFlag
=
C
.
typeModeFlag
;
limit_amount
=
C
.
limit_amount
;
dis_price
=
C
.
dis_price
;
compatible_flag
=
C
.
compatible_flag
;
}
Coupon
(
const
QString
&
c
,
const
double
amount
,
const
QString
&
d
)
{
code
=
c
;
disAmount
=
amount
;
desc
=
d
;
typeModeFlag
=
-
1
;
limit_amount
=
0
;
dis_price
=
0
;
compatible_flag
=
0
;
}
QString
code
;
double
disAmount
;
QString
desc
;
int
typeModeFlag
;
//代金券 or 商品券
QVector
<
ApplyProduct
>
applyProducts
;
//该券适用的商品
int
limit_amount
;
//满额条件
int
dis_price
;
//该券应用到商品后,实际抵扣金额
int
compatible_flag
;
//是否可叠加
};
Q_DECLARE_METATYPE
(
Coupon
)
// 使Coupon类型可以和QVariant类型互相转换
#include "coupon.h"
class
Session
{
...
...
@@ -76,6 +24,7 @@ public:
void
addData
(
const
QString
key
,
const
QVariant
value
);
void
addData
(
const
QString
key
,
const
QMap
<
QString
,
Coupon
>
couponMap
);
bool
contains
(
const
QString
key
)
{
return
_sessionDataMap
.
contains
(
key
);}
QMap
<
QString
,
Coupon
>
getCouponMap
(
const
QString
key
);
QMap
<
QString
,
QVariant
>
sessionDataMap
()
const
{
return
this
->
_sessionDataMap
;}
...
...
task/taskcoupon.cpp
deleted
100644 → 0
View file @
8c7406ea
#include "taskcoupon.h"
#include "fmnetwork.h"
#include "fmp_logger_i.h"
#include "fmmsgwnd.h"
#include "fmp_vip_settings.h"
#include <QJsonArray>
#include <QJsonDocument>
#include <QJsonObject>
#include <QCryptographicHash>
TaskCoupon
::
TaskCoupon
(
QJsonObject
&
jsonObj
,
Session
*
session
,
QObject
*
parent
)
:
QObject
(
parent
)
{
posReqJsonObj
=
jsonObj
;
_session
=
session
;
_error
=
FM_API_SUCCESS
;
}
QByteArray
TaskCoupon
::
doTask
()
{
bool
isOk
=
sendToServer
();
if
(
!
isOk
)
{
FMP_WARN
()
<<
QString
(
"Task error %1: %2"
).
arg
(
error
()).
arg
(
errorString
());
return
QString
(
ErrorMsgJson
).
arg
(
error
()).
arg
(
errorString
()).
toLatin1
();
}
session
()
->
addData
(
"fm_open_id"
,
getServerJsonValue
(
"account"
));
QMap
<
QString
,
QVariant
>
couponMap
;
foreach
(
auto
value
,
getServerJsonValue
(
"coupon_list"
).
toArray
())
{
Coupon
c
;
QJsonObject
couponOb
=
value
.
toObject
();
QJsonArray
applyProducts
=
couponOb
[
"apply_products"
].
toArray
();
for
(
int
i
=
0
;
i
<
applyProducts
.
size
();
i
++
)
{
ApplyProduct
p
;
p
.
price
=
applyProducts
[
i
].
toObject
()[
"price"
].
toInt
();
p
.
coupon_discount_amount
=
applyProducts
[
i
].
toObject
()[
"coupon_discount_amount"
].
toInt
();
p
.
pid
=
applyProducts
[
i
].
toObject
()[
"pid"
].
toString
();
p
.
consume_num
=
applyProducts
[
i
].
toObject
()[
"consume_num"
].
toInt
();
c
.
applyProducts
.
push_back
(
p
);
}
c
.
code
=
couponOb
[
"code"
].
toString
();
c
.
limit_amount
=
couponOb
[
"limit_amount"
].
toInt
();
c
.
dis_price
=
couponOb
[
"dis_price"
].
toInt
();
c
.
desc
=
couponOb
[
"name"
].
toString
();
c
.
compatible_flag
=
couponOb
[
"compatible_flag"
].
toInt
();
c
.
disAmount
=
couponOb
[
"dis_amount"
].
toInt
();
c
.
typeModeFlag
=
couponOb
[
"typeModeFlag"
].
toInt
();
couponMap
[
c
.
code
]
=
QVariant
::
fromValue
(
c
);
}
session
()
->
addData
(
"payCouponMap"
,
couponMap
);
packagePOSRsp
();
return
QJsonDocument
(
posRspJsonObj
).
toJson
(
QJsonDocument
::
Compact
);
}
void
TaskCoupon
::
packageServerReq
()
{
serverReqJsonObj
[
"appId"
]
=
APP_ID
;
serverReqJsonObj
[
"reqType"
]
=
FM_Coupon
;
serverReqJsonObj
[
"stationId"
]
=
getPosJsonValue
(
"pos_id"
);
serverReqJsonObj
[
"storeId"
]
=
getPosJsonValue
(
"store_id"
);
serverReqJsonObj
[
"operatorId"
]
=
getPosJsonValue
(
"operator_id"
);
serverReqJsonObj
[
"partnerId"
]
=
PARTNER_ID
;
QJsonObject
transData
;
transData
[
"transId"
]
=
getPosJsonValue
(
"trans_id"
);
transData
[
"businessDate"
]
=
getPosJsonValue
(
"business_date"
);
transData
[
"memberTransId"
]
=
getPosJsonValue
(
"fm_id"
);
transData
[
"account"
]
=
getPosJsonValue
(
"fm_open_id"
);
transData
[
"isUseScore"
]
=
1
;
transData
[
"payAmount"
]
=
getPosJsonValue
(
"order_amount"
).
toInt
()
-
getPosJsonValue
(
"paid_amount"
).
toInt
();
QJsonArray
products
;
QJsonArray
clientArr
=
getPosJsonValue
(
"products"
).
toArray
();
for
(
int
i
=
0
;
i
<
clientArr
.
size
();
i
++
)
{
QJsonObject
product
;
product
[
"consumeNum"
]
=
clientArr
[
i
].
toObject
()[
"consume_num"
];
product
[
"price"
]
=
clientArr
[
i
].
toObject
()[
"price"
];
product
[
"productId"
]
=
clientArr
[
i
].
toObject
()[
"pid"
];
products
.
append
(
product
);
}
transData
[
"productList"
]
=
products
;
serverReqJsonObj
[
"data"
]
=
transData
;
serverReqJsonObj
[
"t"
]
=
QString
::
number
(
QDateTime
::
currentMSecsSinceEpoch
());
serverReqJsonObj
[
"sign"
]
=
sign
();
}
bool
TaskCoupon
::
sendToServer
(
bool
isShowMsg
)
{
FMP_DEBUG
()
<<
__FUNCTION__
;
packageServerReq
();
QJsonDocument
json
(
serverReqJsonObj
);
QByteArray
data
=
json
.
toJson
(
QJsonDocument
::
Compact
);
url
=
FMPVipSettings
::
instance
()
->
getServerUrl
()
+
"/coupon"
;
QByteArray
rspData
;
FMNetwork
net
;
net
.
send
(
url
,
data
,
rspData
);
QJsonParseError
jsonErr
;
QJsonDocument
rspJson
=
QJsonDocument
::
fromJson
(
rspData
,
&
jsonErr
);
// 网络错误
if
(
net
.
error
!=
FM_API_SUCCESS
)
{
setError
(
net
.
error
,
net
.
errorMsg
);
serverRspJsonObj
=
rspJson
.
object
();
}
else
{
// Json错误
if
(
jsonErr
.
error
!=
QJsonParseError
::
NoError
)
{
setError
(
FM_API_BADJSON
);
FMP_ERROR
()
<<
"Unknown data: "
<<
rspData
;
}
else
{
serverRspJsonObj
=
rspJson
.
object
();
// 服务器返回的错误
if
(
serverRspJsonObj
.
contains
(
"errcode"
))
{
setError
(
FM_API_SERVERERROR
,
serverRspJsonObj
[
"errcode"
].
toInt
(),
serverRspJsonObj
[
"errmsg"
].
toString
());
}
}
}
FMP_INFO
()
<<
"Server rsponse: "
<<
serverRspJsonObj
;
bool
isOk
=
(
error
()
==
FM_API_SUCCESS
);
if
(
!
isOk
&&
isShowMsg
)
{
FMMsgWnd
::
FailureWnd
(
errorString
(),
nullptr
);
}
return
isOk
;
}
void
TaskCoupon
::
packagePOSRsp
()
{
posRspJsonObj
[
"fm_open_id"
]
=
getServerJsonValue
(
"account"
);
posRspJsonObj
[
"statusCode"
]
=
getServerJsonValue
(
"status_code"
);
posRspJsonObj
[
"msg"
]
=
getServerJsonValue
(
"msg"
);
}
QJsonValue
TaskCoupon
::
searchJsonValue
(
QJsonObject
&
searchJson
,
QString
searchKey
)
{
if
(
searchJson
.
contains
(
searchKey
))
{
return
searchJson
[
searchKey
];
}
else
{
qDebug
()
<<
searchJson
.
keys
();
foreach
(
QString
key
,
searchJson
.
keys
())
{
if
(
searchJson
[
key
].
isObject
())
{
QJsonObject
ob
=
searchJson
[
key
].
toObject
();
QJsonValue
value
=
searchJsonValue
(
ob
,
searchKey
);
if
(
!
value
.
isNull
()){
return
value
;
}
}
}
}
return
QJsonValue
();
}
QJsonValue
TaskCoupon
::
getServerJsonValue
(
const
QString
prop
)
{
return
searchJsonValue
(
serverRspJsonObj
,
prop
);
}
QJsonValue
TaskCoupon
::
getPosJsonValue
(
const
QString
prop
)
{
return
searchJsonValue
(
posReqJsonObj
,
prop
);
}
QString
TaskCoupon
::
sign
()
const
{
FMP_DEBUG
()
<<
__FUNCTION__
;
// 解析JSON插入MAP中按字典排序
QMap
<
QString
,
QString
>
mapData
;
for
(
int
i
=
0
;
i
<
sizeof
(
SignProps
)
/
sizeof
(
SignProps
[
0
]);
++
i
)
{
QString
word
=
SignProps
[
i
];
if
(
serverReqJsonObj
[
word
].
isDouble
())
{
mapData
[
word
]
=
QString
::
number
(
serverReqJsonObj
[
word
].
toDouble
());
}
else
{
mapData
[
word
]
=
serverReqJsonObj
[
word
].
toString
();
}
}
if
(
serverRspJsonObj
[
ServerProps
(
PosProps
.
Fm_cmd
)].
toInt
()
==
FM_Fund
)
{
mapData
[
ServerProps
(
PosProps
.
TransId
)]
=
serverReqJsonObj
[
ServerProps
(
PosProps
.
TransId
)].
toString
();
}
// 使用URL键值对的格式拼接
QString
sb
=
""
;
foreach
(
QString
key
,
mapData
.
keys
())
{
sb
+=
(
key
+
"="
+
mapData
.
value
(
key
)
+
"&"
);
}
sb
.
remove
(
sb
.
length
()
-
1
,
1
);
// 去掉最后一个&
sb
.
append
(
KEY_CODE
);
QByteArray
bt
;
bt
.
append
(
sb
);
FMP_INFO
()
<<
"Sign String: "
<<
bt
;
QByteArray
md5Bt
=
QCryptographicHash
::
hash
(
bt
,
QCryptographicHash
::
Md5
);
return
md5Bt
.
toHex
();
}
task/taskcoupon.h
deleted
100644 → 0
View file @
8c7406ea
#ifndef TASKCOUPON_H
#define TASKCOUPON_H
#include <QObject>
#include <QJsonObject>
#include "session.h"
//根据订单,查询可用的优惠券
class
TaskCoupon
:
public
QObject
{
Q_OBJECT
public
:
explicit
TaskCoupon
(
QJsonObject
&
jsonObj
,
Session
*
session
=
0
,
QObject
*
parent
=
0
);
QByteArray
doTask
();
Session
*
session
()
const
{
return
_session
;}
QJsonValue
searchJsonValue
(
QJsonObject
&
searchJson
,
QString
searchKey
);
QJsonValue
getServerJsonValue
(
const
QString
prop
);
QJsonValue
getPosJsonValue
(
const
QString
prop
);
protected
:
void
packageServerReq
();
bool
sendToServer
(
bool
isShowMsg
=
true
);
void
packagePOSRsp
();
protected
:
QJsonObject
posReqJsonObj
;
QJsonObject
posRspJsonObj
;
QJsonObject
serverReqJsonObj
;
QJsonObject
serverRspJsonObj
;
Session
*
_session
;
QString
url
;
private
:
QString
sign
()
const
;
/**
* @brief FMError
* define error.
*/
typedef
int
FMError
;
public
:
FMError
error
()
const
{
return
_error
;}
void
setError
(
const
FMError
error
)
{
_error
=
error
;
_errorMsg
=
""
;}
void
setError
(
const
FMError
error
,
const
QString
errorMsg
)
{
_error
=
error
;
_errorMsg
=
errorMsg
;}
void
setError
(
const
FMError
error
,
const
int
errorCode
,
const
QString
errorMsg
)
{
_error
=
error
;
_errorMsg
=
QString
(
"[%1]%2"
).
arg
(
errorCode
).
arg
(
errorMsg
);}
QString
errorString
()
{
if
(
fm_error
.
find
(
_error
)
==
fm_error
.
end
())
{
return
"Undefine Error"
;
}
else
{
if
(
_errorMsg
!=
""
)
return
_errorMsg
;
return
fm_error
.
at
(
_error
);
}
}
private
:
FMError
_error
;
QString
_errorMsg
;
};
#endif // TASKCOUPON_H
task/tasklogin.cpp
View file @
18f682b1
...
...
@@ -72,12 +72,15 @@ void TaskLogin::onLogin()
QString
account
=
getServerJsonValue
(
PosProps
.
Fm_open_id
).
toString
();
QString
birthday
=
getServerJsonValue
(
PosProps
.
Birthday
).
toString
();
QString
name
=
getServerJsonValue
(
PosProps
.
Name
).
toString
();
FMMsgWnd
::
LoginSuccess
(
account
,
name
,
birthday
,
_window
);
if
(
getServerJsonValue
(
PosProps
.
CanPay
)
==
-
1
)
{
FMMsgWnd
::
LoginSuccess
(
account
,
name
,
birthday
,
_window
);
}
session
()
->
addData
(
PosProps
.
Name
,
name
);
session
()
->
addData
(
PosProps
.
Amount
,
getServerJsonValue
(
PosProps
.
Amount
).
toInt
());
session
()
->
addData
(
PosProps
.
Birthday
,
birthday
);
session
()
->
addData
(
PosProps
.
Fm_open_id
,
account
);
session
()
->
addData
(
PosProps
.
Amount
,
getServerJsonValue
(
PosProps
.
Amount
).
toInt
());
session
()
->
addData
(
PosProps
.
Score
,
getServerJsonValue
(
PosProps
.
Score
).
toInt
());
_window
->
close
();
...
...
task/tasklogin.h
View file @
18f682b1
#ifndef TASKLOGIN_H
#
ifndef
TASKLOGIN_H
#define TASKLOGIN_H
#include "fmtask.h"
...
...
task/taskothers.cpp
View file @
18f682b1
#
include
"taskothers.h"
#include "fmp_vip_settings.h"
#include "fmnetwork.h"
#include <QJsonDocument>
#include <QDateTime>
#include <fmp_logger_i.h>
TaskCoupon
::
TaskCoupon
(
QJsonObject
&
jsonObj
,
Session
*
session
,
QObject
*
parent
)
:
FMTaskNoWnd
(
jsonObj
,
FM_Coupon
,
session
,
parent
)
{
}
void
TaskCoupon
::
packageServerReq
()
{
serverReqJsonObj
[
ServerProps
(
PosProps
.
Coupon
)]
=
getPosJsonValue
(
PosProps
.
Coupon
);
}
void
TaskCoupon
::
packagePOSRsp
()
{
std
::
vector
<
QString
>
p
;
p
.
push_back
(
PosProps
.
Fm_open_id
);
p
.
push_back
(
PosProps
.
StatusCode
);
p
.
push_back
(
PosProps
.
Msg
);
foreach
(
auto
prop
,
p
)
{
posRspJsonObj
[
prop
]
=
getServerJsonValue
(
ServerProps
(
prop
));
}
posRspJsonObj
[
"pid"
]
=
serverRspJsonObj
[
"productCode"
];
posRspJsonObj
[
PosProps
.
Prompt
]
=
1
;
}
TaskRefundPay
::
TaskRefundPay
(
QJsonObject
&
jsonObj
,
QObject
*
parent
)
:
FMTaskNoWnd
(
jsonObj
,
FM_Refund_Pay
,
0
,
parent
)
...
...
task/taskothers.h
View file @
18f682b1
...
...
@@ -3,6 +3,16 @@
#include "fmtasknownd.h"
// 优惠券查询
class
TaskCoupon
:
public
FMTaskNoWnd
{
Q_OBJECT
public
:
explicit
TaskCoupon
(
QJsonObject
&
jsonObj
,
Session
*
session
,
QObject
*
parent
=
0
);
void
packageServerReq
();
void
packagePOSRsp
();
};
// 支付退款
class
TaskRefundPay
:
public
FMTaskNoWnd
{
...
...
task/taskpay.cpp
View file @
18f682b1
...
...
@@ -4,7 +4,6 @@
#include "fmp_logger_i.h"
#include "fmp_vip_settings.h"
#include "fmnetwork.h"
#include "taskcoupon.h"
#include <QJsonDocument>
#include <QJsonObject>
#include <QCryptographicHash>
...
...
@@ -38,15 +37,28 @@ QByteArray TaskPay::doTask()
}
this
->
_session
=
preTask
->
session
();
// couponThread = new TaskCouponThread(posReqJsonObj, _session, this);
// couponThread->start();
// connect(couponThread, SIGNAL(finished(Session*)), SLOT(onGetCoupons(Session*)));
return
FMTask
::
doTask
();
}
void
TaskPay
::
onGetCoupons
(
Session
*
session
)
{
// couponThread->exit();
_session
->
addData
(
PosProps
.
CouponMap
,
session
->
getCouponMap
(
PosProps
.
CouponMap
));
if
(
_window
!=
nullptr
)
{
qobject_cast
<
FMVipOrder
*>
(
_window
)
->
initCouponItems
();
_window
->
setIsBusy
(
false
);
_window
->
setEnabled
(
true
);
}
}
void
TaskPay
::
setWindow
()
{
_window
=
new
FMVipOrder
;
session
()
->
addData
(
"order_amount"
,
getPosJsonValue
(
"order_amount"
).
toInt
());
session
()
->
addData
(
"pay_amount"
,
getPosJsonValue
(
"order_amount"
).
toInt
()
-
getPosJsonValue
(
"paid_amount"
).
toInt
());
session
()
->
addData
(
"products"
,
getPosJsonValue
(
"products"
).
toArray
());
session
()
->
addData
(
PosProps
.
OrderAmount
,
getPosJsonValue
(
PosProps
.
OrderAmount
).
toInt
());
connect
(
qobject_cast
<
FMVipOrder
*>
(
_window
),
SIGNAL
(
pay
()),
this
,
SLOT
(
onPay
()));
}
...
...
@@ -59,7 +71,6 @@ void TaskPay::packageServerReq()
transData
[
ServerProps
(
PosProps
.
Fm_id
)]
=
getPosJsonValue
(
PosProps
.
Fm_id
);
transData
[
ServerProps
(
PosProps
.
Fm_open_id
)]
=
session
()
->
data
(
PosProps
.
Fm_open_id
).
toString
();
transData
[
ServerProps
(
PosProps
.
IsUseScore
)]
=
session
()
->
data
(
PosProps
.
IsUseScore
).
toInt
();
QJsonArray
products
;
QJsonArray
clientArray
=
getPosJsonValue
(
"products"
).
toArray
();
...
...
@@ -73,49 +84,42 @@ void TaskPay::packageServerReq()
products
.
push_back
(
serverObj
);
}
int
payAmount
=
0
;
QJsonArray
payList
;
//余额支付详情
QJsonObject
balance
;
int
codeAmount
=
session
()
->
data
(
"codeAmount"
).
toInt
();
int
codeAmount
=
session
()
->
data
(
PosProps
.
CodeAmount
).
toInt
();
balance
[
"amount"
]
=
codeAmount
;
payAmount
+=
codeAmount
;
balance
[
"transId"
]
=
getPosJsonValue
(
"trans_id"
);
balance
[
"typeModeFlag"
]
=
20001
;
balance
[
"
code
"
]
=
""
;
balance
[
"
thirdPayTransId
"
]
=
""
;
payList
.
push_back
(
balance
);
//积分支付详情
if
(
transData
[
"isUseScore"
].
toInt
())
{
QJsonObject
score
;
int
scoreAmount
=
session
()
->
data
(
"score"
).
toInt
();
score
[
"amount"
]
=
scoreAmount
;
// payAmount += scoreAmount;
score
[
"transId"
]
=
getPosJsonValue
(
"trans_id"
);
score
[
"typeModeFlag"
]
=
20002
;
score
[
"code"
]
=
""
;
payList
.
push_back
(
score
);
}
// 积分支付详情
QJsonObject
score
;
int
scoreAmount
=
session
()
->
data
(
PosProps
.
ScoreAmount
).
toInt
();
score
[
"amount"
]
=
scoreAmount
;
score
[
"transId"
]
=
getPosJsonValue
(
"trans_id"
);
score
[
"typeModeFlag"
]
=
20002
;
score
[
"thirdPayTransId"
]
=
""
;
payList
.
push_back
(
score
);
//代金券/商品券支付详情
QMap
<
QString
,
QVariant
>
coupons
=
session
()
->
data
(
"payCouponMap"
).
toMap
();
for
(
QMap
<
QString
,
QVariant
>::
const_iterator
it
=
coupons
.
constBegin
();
it
!=
coupons
.
constEnd
();
it
++
)
{
QJsonObject
coupon
;
int
couponAmount
=
it
.
value
().
value
<
Coupon
>
().
disAmount
;
int
couponAmount
=
it
.
value
().
value
<
Coupon
>
().
disAmount
()
;
coupon
[
"amount"
]
=
couponAmount
;
payAmount
+=
couponAmount
;
coupon
[
"transId"
]
=
getPosJsonValue
(
PosProps
.
TransId
);
coupon
[
"typeModeFlag"
]
=
it
.
value
().
value
<
Coupon
>
().
typeModeFlag
;
coupon
[
"code"
]
=
it
.
value
().
value
<
Coupon
>
().
code
;
coupon
[
"typeModeFlag"
]
=
it
.
value
().
value
<
Coupon
>
().
typeModeFlag
()
;
coupon
[
"code"
]
=
it
.
value
().
value
<
Coupon
>
().
code
()
;
payList
.
push_back
(
coupon
);
}
transData
[
"productList"
]
=
products
;
transData
[
"payList"
]
=
payList
;
transData
[
ServerProps
(
PosProps
.
Pay_amount
)]
=
payAmount
;
transData
[
ServerProps
(
PosProps
.
Pay_amount
)]
=
session
()
->
data
(
PosProps
.
Pay_amount
).
toInt
()
;
serverReqJsonObj
[
"data"
]
=
transData
;
}
...
...
task/taskpay.h
View file @
18f682b1
#ifndef TASKPAY_H
#
ifndef
TASKPAY_H
#define TASKPAY_H
#include "fmtask.h"
#include "taskcoupon.h"
#include "taskothers.h"
#include <QThread>
class
TaskCouponThread
;
class
TaskPay
:
public
FMTask
{
...
...
@@ -10,13 +13,40 @@ public:
explicit
TaskPay
(
QJsonObject
&
jsonObj
,
Session
*
session
=
0
,
QObject
*
parent
=
0
);
~
TaskPay
();
QByteArray
doTask
();
void
setWindow
();
void
packageServerReq
();
void
packagePOSRsp
();
private
slots
:
void
onPay
();
void
onGetCoupons
(
Session
*
session
);
private
:
TaskCouponThread
*
couponThread
;
};
// 加载代金券的线程类
class
TaskCouponThread
:
public
QThread
{
Q_OBJECT
public
:
TaskCouponThread
(
QJsonObject
&
jsonObj
,
Session
*
session
,
QObject
*
parent
=
0
)
{
_session
=
session
;
task
=
new
TaskCoupon
(
jsonObj
,
session
,
parent
);
}
~
TaskCouponThread
()
{
del_p
(
task
);
}
void
run
()
{
task
->
doTask
();
emit
finished
(
_session
);
}
TaskCoupon
*
task
;
Session
*
_session
;
signals
:
void
finished
(
Session
*
);
};
#endif // TASKPAY_H
windows/fmcouponwidget.cpp
View file @
18f682b1
...
...
@@ -7,9 +7,9 @@ FMCouponWidget::FMCouponWidget(Coupon conpon, QWidget *parent) :
ui
(
new
Ui
::
FMCouponWidget
)
{
ui
->
setupUi
(
this
);
ui
->
code_lab
->
setText
(
conpon
.
code
);
ui
->
amount_lab
->
setText
(
QString
::
number
(
conpon
.
disAmount
/
100
,
'f'
,
2
));
ui
->
desc_lab
->
setText
(
conpon
.
desc
);
ui
->
code_lab
->
setText
(
conpon
.
code
()
);
ui
->
amount_lab
->
setText
(
QString
::
number
(
conpon
.
disAmount
()
,
'f'
,
2
));
ui
->
desc_lab
->
setText
(
conpon
.
name
()
);
}
FMCouponWidget
::~
FMCouponWidget
()
...
...
windows/fmmsgwnd.cpp
View file @
18f682b1
...
...
@@ -21,19 +21,19 @@ void FMMsgWnd::show(InfoType type, const QString &info)
{
QString
iconUrl
;
switch
(
type
)
{
case
InfoType
:
:
T_Normal
:
case
T_Normal
:
iconUrl
=
""
;
break
;
case
InfoType
:
:
T_Success
:
case
T_Success
:
iconUrl
=
":/tip_ok.png"
;
break
;
case
InfoType
:
:
T_Failure
:
case
T_Failure
:
iconUrl
=
":/tip_error.png"
;
break
;
case
InfoType
:
:
T_Warning
:
case
T_Warning
:
iconUrl
=
":/tip_warning.png"
;
break
;
case
InfoType
:
:
T_LoginSuccess
:
case
T_LoginSuccess
:
ui
->
label_msg
->
setText
(
QString
::
fromLocal8Bit
(
"会员认证成功"
));
iconUrl
=
":/tip_ok.png"
;
break
;
...
...
@@ -54,27 +54,34 @@ void FMMsgWnd::show(InfoType type, const QString &info)
void
FMMsgWnd
::
FailureWnd
(
const
QString
&
info
,
QDialog
*
parent
)
{
FMMsgWnd
window
(
parent
);
if
(
parent
!=
NULL
)
if
(
parent
!=
nullptr
)
{
window
.
setGeometry
(
parent
->
geometry
());
}
window
.
show
(
FMMsgWnd
::
T_Failure
,
info
);
}
void
FMMsgWnd
::
WarningWnd
(
const
QString
&
info
,
QDialog
*
parent
)
{
FMMsgWnd
window
(
parent
);
window
.
setGeometry
(
parent
->
geometry
());
if
(
parent
!=
nullptr
)
{
window
.
setGeometry
(
parent
->
geometry
());
}
window
.
show
(
FMMsgWnd
::
T_Warning
,
info
);
}
void
FMMsgWnd
::
SuccessWnd
(
const
QString
&
info
,
QDialog
*
parent
)
{
FMMsgWnd
window
(
parent
);
window
.
setGeometry
(
parent
->
geometry
());
if
(
parent
!=
nullptr
)
{
window
.
setGeometry
(
parent
->
geometry
());
}
window
.
show
(
FMMsgWnd
::
T_Success
,
info
);
}
void
FMMsgWnd
::
LoginSuccess
(
const
QString
&
account
,
const
QString
&
name
,
const
QString
&
birthday
,
QDialog
*
parent
)
{
FMMsgWnd
window
(
parent
);
window
.
setGeometry
(
parent
->
geometry
());
if
(
parent
!=
nullptr
)
{
window
.
setGeometry
(
parent
->
geometry
());
}
QString
info
=
QString
::
fromLocal8Bit
(
"账号:%1
\n
姓名:%2
\n
生日:%3"
).
arg
(
account
).
arg
(
name
).
arg
(
birthday
);
window
.
show
(
FMMsgWnd
::
T_LoginSuccess
,
info
);
}
...
...
windows/fmvipfund.cpp
View file @
18f682b1
...
...
@@ -14,7 +14,7 @@ FMVipFund::~FMVipFund()
delete
ui
;
}
void
FMVipFund
::
initWnd
(
Session
*
session
)
bool
FMVipFund
::
initWnd
(
Session
*
session
)
{
_session
=
session
;
...
...
@@ -39,6 +39,7 @@ void FMVipFund::initWnd(Session *session)
ui
->
name_label
->
setText
(
name
);
ui
->
fund_btn
->
setFocus
();
return
true
;
}
void
FMVipFund
::
on_fund_btn_clicked
()
...
...
windows/fmvipfund.h
View file @
18f682b1
...
...
@@ -16,7 +16,7 @@ public:
~
FMVipFund
();
void
initWnd
(
Session
*
session
);
bool
initWnd
(
Session
*
session
);
signals
:
void
fund
();
public
slots
:
...
...
windows/fmviplogin.cpp
View file @
18f682b1
...
...
@@ -17,7 +17,7 @@ FMVipLogin::~FMVipLogin()
delete
ui
;
}
void
FMVipLogin
::
initWnd
(
Session
*
session
)
bool
FMVipLogin
::
initWnd
(
Session
*
session
)
{
this
->
_session
=
session
;
...
...
@@ -32,6 +32,7 @@ void FMVipLogin::initWnd(Session *session)
ui
->
operator_label
->
setText
(
session
->
data
(
PosProps
.
OperatorId
).
toString
());
ui
->
bd_label
->
setText
(
session
->
data
(
PosProps
.
BussinessDate
).
toString
());
ui
->
login_edit
->
setPlaceholderText
(
placeText
);
return
true
;
}
QString
FMVipLogin
::
getVersionInfo
()
...
...
windows/fmviplogin.h
View file @
18f682b1
...
...
@@ -19,7 +19,7 @@ public:
QString
getVersionInfo
();
void
initWnd
(
Session
*
session
);
bool
initWnd
(
Session
*
session
);
protected
:
void
resetWnd
();
signals
:
...
...
windows/fmviporder.cpp
View file @
18f682b1
This diff is collapsed.
Click to expand it.
windows/fmviporder.h
View file @
18f682b1
#
ifndef
FMVIPORDER_H
#define FMVIPORDER_H
#include <QListWidgetItem>
#include <QModelIndex>
#include "fmvipwnd.h"
#include "global.h"
class
CouponModel
;
class
QItemSelectionModel
;
#define MIN(a,b) ((a<b) ? a : b)
#define MAX(a,b) ((a<b) ? b : a)
...
...
@@ -19,7 +24,8 @@ public:
explicit
FMVipOrder
(
QDialog
*
parent
=
0
);
~
FMVipOrder
();
void
initWnd
(
Session
*
session
);
bool
initWnd
(
Session
*
session
);
void
initCouponItems
();
void
setWillPayText
();
signals
:
...
...
@@ -27,9 +33,6 @@ signals:
public
slots
:
void
on_pay_btn_clicked
();
void
on_pay_chk_clicked
(
bool
checked
);
void
onItemClicked
(
QListWidgetItem
*
);
private
slots
:
void
on_coupon_prev_btn_clicked
();
...
...
@@ -38,26 +41,30 @@ private slots:
void
on_pay_edit_textChanged
(
const
QString
&
text
);
void
onSelectionChanged
(
const
QItemSelection
&
selected
,
const
QItemSelection
&
deselected
);
void
on_coupon_page_clicked
(
const
QModelIndex
&
index
);
void
on_score_edit_textChanged
(
const
QString
&
scoreStr
);
private
:
class
OrderInfo
{
public
:
OrderInfo
()
{
_amountStr
=
_
scoreStr
=
_
needPayStr
=
""
;
_amount
=
_score
=
_needPay
=
_maxWillPay
=
_
useScore
=
_couponAmount
=
0
;
_amountStr
=
_needPayStr
=
""
;
_amount
=
_score
=
_needPay
=
_maxWillPay
=
_
payAmountScore
=
_payAmountCoupon
=
0
;
}
OrderInfo
(
QString
amountStr
,
QString
scoreStr
,
QString
needPayStr
)
OrderInfo
(
QString
amountStr
,
int
score
,
QString
needPayStr
)
{
this
->
_amountStr
=
amountStr
;
this
->
_scoreStr
=
scoreStr
;
this
->
_needPayStr
=
needPayStr
;
_amount
=
_amountStr
.
to
Double
()
/
10
0
;
_
score
=
_scoreStr
.
toDouble
()
/
10
0
;
_
needPay
=
_needPayStr
.
toDouble
()
/
100
;
_amount
=
_amountStr
.
to
Int
()
/
100
.
0
;
_
needPay
=
_needPayStr
.
toInt
()
/
100
.
0
;
_
score
=
score
;
_maxWillPay
=
_
useScore
=
_couponAmount
=
0
;
_maxWillPay
=
_
payAmountScore
=
_payAmountCoupon
=
0
;
setMaxWillPay
();
}
...
...
@@ -71,69 +78,48 @@ private:
return
DOUBLE_STR
(
_needPay
);
}
QString
getScoreAmount
()
/**
* @brief getPayAmountScore
* 设置/获取积分抵扣金额
* @return
*/
void
setUseScore
(
int
payScore
)
{
return
DOUBLE_STR
(
MIN
(
_score
,
_needPay
));
}
int
getPayAmount
(
QString
amountStr
)
{
qDebug
()
<<
amountStr
.
toDouble
();
qDebug
()
<<
_couponAmount
;
qDebug
()
<<
_useScore
;
int
payAmount
=
MIN
(
_needPay
,
(
amountStr
.
toDouble
()
+
_couponAmount
+
_useScore
))
*
100
;
return
payAmount
;
}
// 代金券总额超过待付时返回true
bool
enoughCoupon
()
{
_couponAmount
=
0
.
0
;
foreach
(
auto
coupon
,
selectCouponMap
)
{
//_couponAmount += coupon.disAmount / 100;
if
(
coupon
.
typeModeFlag
==
20003
)
{
//代金券
_couponAmount
+=
coupon
.
disAmount
/
100
;
}
else
if
(
coupon
.
typeModeFlag
==
20004
)
{
//商品券
_couponAmount
+=
coupon
.
dis_price
/
100
;
}
_payScore
=
payScore
;
if
(
payScore
<
1000
)
{
_payAmountScore
=
payScore
/
100
.
0
*
0
;
}
else
if
(
payScore
<
4999
)
{
_payAmountScore
=
payScore
/
100
.
0
*
1
.
0
;
}
else
if
(
payScore
<
9999
)
{
_payAmountScore
=
payScore
/
100
.
0
*
1
.
2
;
}
else
{
_payAmountScore
=
payScore
/
100
.
0
*
1
.
5
;
}
qDebug
()
<<
"_couponAmount: "
<<
_couponAmount
;
qDebug
()
<<
"_needPay: "
<<
_needPay
;
bool
isEnough
=
(
_couponAmount
>
_needPay
);
setMaxWillPay
();
return
isEnough
;
}
void
setUseScore
(
bool
isUse
)
double
getPayAmountScore
()
{
if
(
isUse
)
{
_useScore
=
MIN
(
_score
,
_needPay
);
}
else
{
_useScore
=
0
;
}
setMaxWillPay
();
return
_payAmountScore
;
}
double
getUseScore
()
// 总积分个数
int
getScore
()
{
return
_
useS
core
;
return
_
s
core
;
}
int
isUseScore
()
int
getPayScore
()
{
return
(
_useScore
==
0
?
0
:
1
);
return
_payScore
;
}
bool
enoughScore
()
{
return
_payAmountScore
>
_needPay
;
}
// 设置付款金额的最大值
// 设置
储值金
付款金额的最大值
void
setMaxWillPay
()
{
double
willPay
=
_needPay
-
_
useScore
-
_couponAmount
;
double
willPay
=
_needPay
-
_
payAmountScore
-
_payAmountCoupon
;
_maxWillPay
=
MIN
(
MAX
(
willPay
,
0
),
_amount
);
}
double
getMaxWillPay
()
...
...
@@ -141,7 +127,17 @@ private:
return
_maxWillPay
;
}
/// 代金券列表
// 设置/获得最大可优惠金额
void
setMaxDisAmount
(
double
amount
)
{
this
->
_maxDisAmount
=
amount
;
}
double
getMaxDisAmount
()
{
return
_maxDisAmount
;
}
// 代金券列表
void
setCouponMap
(
QMap
<
QString
,
Coupon
>
couponMap
)
{
this
->
_couponMap
=
couponMap
;
...
...
@@ -157,13 +153,32 @@ private:
QMap
<
QString
,
Coupon
>
selectCouponMap
;
// 代金券总额超过待付时返回true
bool
enoughCoupon
()
{
_payAmountCoupon
=
0
.
0
;
foreach
(
auto
coupon
,
selectCouponMap
)
{
_payAmountCoupon
+=
coupon
.
disAmount
();
}
bool
isEnough
=
(
_payAmountCoupon
>
_needPay
);
setMaxWillPay
();
return
isEnough
;
}
double
getPayAmountCoupon
()
{
return
_payAmountCoupon
;
}
private
:
QString
_amountStr
,
_scoreStr
,
_needPayStr
;
double
_amount
,
_score
,
_needPay
;
QString
_amountStr
,
_needPayStr
;
double
_amount
,
_needPay
;
int
_score
,
_payScore
;
QMap
<
QString
,
Coupon
>
_couponMap
;
int
_maxPage
,
_nowPage
;
// 代金券金额 使用积分金额 余额将付金额
double
_
couponAmount
,
_useScore
,
_maxWillPay
;
// 代金券金额 使用积分金额 余额将付金额
最大可优惠金额
double
_
payAmountCoupon
,
_payAmountScore
,
_maxWillPay
,
_maxDisAmount
;
};
private
:
...
...
@@ -173,7 +188,9 @@ private:
QString
oldPayText
;
void
initCouponItems
();
QItemSelectionModel
*
selectionModel
;
CouponModel
*
couponModel
;
QModelIndex
selectedIndex
;
};
#endif // FMVIPORDER_H
windows/fmvippanel.cpp
View file @
18f682b1
...
...
@@ -19,7 +19,7 @@ FMVipPanel::~FMVipPanel()
delete
ui
;
}
void
FMVipPanel
::
initWnd
(
Session
*
session
)
bool
FMVipPanel
::
initWnd
(
Session
*
session
)
{
this
->
_session
=
session
;
ui
->
store_label
->
setText
(
session
->
data
(
PosProps
.
StoreId
).
toString
());
...
...
@@ -31,6 +31,7 @@ void FMVipPanel::initWnd(Session *session)
ui
->
name_label
->
setText
(
session
->
data
(
"name"
).
toString
());
ui
->
fund_btn
->
setFocus
();
return
true
;
}
void
FMVipPanel
::
on_fund_btn_clicked
()
...
...
windows/fmvippanel.h
View file @
18f682b1
...
...
@@ -15,7 +15,7 @@ public:
explicit
FMVipPanel
(
QDialog
*
parent
=
0
);
~
FMVipPanel
();
void
initWnd
(
Session
*
session
);
bool
initWnd
(
Session
*
session
);
public
slots
:
void
on_fund_btn_clicked
();
...
...
windows/fmvipwnd.h
View file @
18f682b1
...
...
@@ -21,7 +21,7 @@ public:
int
exec
();
bool
close
();
virtual
void
initWnd
(
Session
*
session
)
{
this
->
_session
=
session
;}
virtual
bool
initWnd
(
Session
*
session
)
{
this
->
_session
=
session
;
return
true
;}
Session
*
session
()
const
{
return
_session
;}
public
slots
:
...
...
windows/forms/fmviporder.ui
View file @
18f682b1
...
...
@@ -179,7 +179,7 @@
color: red;
}
#pay_edit {
#pay_edit
,#score_edit
{
min-height: 45px;
border: 1 solid silver;
text-align: center;
...
...
@@ -187,7 +187,7 @@
color: rgb(50,50,50);
}
#standard_label
#standard_label
, #score_label
{
font: 18px;
}
...
...
@@ -554,7 +554,7 @@
<number>
0
</number>
</property>
<item>
<widget
class=
"QList
Widget
"
name=
"coupon_page"
>
<widget
class=
"QList
View
"
name=
"coupon_page"
>
<property
name=
"frameShape"
>
<enum>
QFrame::NoFrame
</enum>
</property>
...
...
@@ -570,8 +570,11 @@
<property
name=
"autoScroll"
>
<bool>
true
</bool>
</property>
<property
name=
"editTriggers"
>
<set>
QAbstractItemView::NoEditTriggers
</set>
</property>
<property
name=
"selectionMode"
>
<enum>
QAbstractItemView::
Multi
Selection
</enum>
<enum>
QAbstractItemView::
No
Selection
</enum>
</property>
<property
name=
"verticalScrollMode"
>
<enum>
QAbstractItemView::ScrollPerItem
</enum>
...
...
@@ -600,12 +603,6 @@
<property
name=
"uniformItemSizes"
>
<bool>
true
</bool>
</property>
<property
name=
"currentRow"
>
<number>
-1
</number>
</property>
<property
name=
"widgetResizable"
stdset=
"0"
>
<bool>
true
</bool>
</property>
</widget>
</item>
</layout>
...
...
@@ -728,7 +725,7 @@
<number>
60
</number>
</property>
<property
name=
"bottomMargin"
>
<number>
30
</number>
<number>
5
</number>
</property>
<item>
<widget
class=
"QLabel"
name=
"pay_max"
>
...
...
@@ -776,12 +773,22 @@
</widget>
</item>
<item>
<widget
class=
"QCheckBox"
name=
"pay_chk"
>
<property
name=
"cursor"
>
<cursorShape>
PointingHandCursor
</cursorShape>
<widget
class=
"QLineEdit"
name=
"score_edit"
>
<property
name=
"text"
>
<string>
0
</string>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignCenter
</set>
</property>
</widget>
</item>
<item>
<widget
class=
"QLabel"
name=
"score_label"
>
<property
name=
"text"
>
<string>
使用积分
</string>
<string>
使用 0 积分抵扣 0 元
</string>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignCenter
</set>
</property>
</widget>
</item>
...
...
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