Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
FMVip_LXJ
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
FMVip_LXJ
Commits
5bcf74f2
Commit
5bcf74f2
authored
Feb 27, 2017
by
NitefullWind
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 新增支付前判断账号是否是激活状态。 2. 删除激活/锁定相关代码。 3. 修复获取代金券线程崩溃问题。
parent
e7c9bf01
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
45 additions
and
177 deletions
+45
-177
FMVip_LXJ/task/tasklogin.cpp
+7
-16
FMVip_LXJ/task/taskmanage.cpp
+0
-19
FMVip_LXJ/task/taskmanage.h
+1
-3
FMVip_LXJ/task/taskothers.cpp
+1
-49
FMVip_LXJ/task/taskothers.h
+1
-22
FMVip_LXJ/task/taskpay.cpp
+11
-4
FMVip_LXJ/task/taskpay.h
+7
-2
FMVip_LXJ/windows/fmviporder.cpp
+2
-0
FMVip_LXJ/windows/fmvippanel.cpp
+0
-10
FMVip_LXJ/windows/fmvippanel.h
+1
-5
FMVip_LXJ/windows/forms/fmviporder.ui
+10
-0
FMVip_LXJ/windows/forms/fmvippanel.ui
+4
-47
No files found.
FMVip_LXJ/task/tasklogin.cpp
View file @
5bcf74f2
...
...
@@ -57,6 +57,11 @@ void TaskLogin::onLogin()
if
(
session
()
->
data
(
PosProps
.
FM_Type
).
toInt
()
==
FM_Login
)
{
FMMsgWnd
::
LoginSuccess
(
account
,
name
,
birthday
);
closeWindow
();
}
else
if
(
session
()
->
data
(
PosProps
.
FM_Type
).
toInt
()
==
FM_Pay
&&
getServerJsonValue
(
PosProps
.
IsActive
).
toInt
()
==
0
)
{
QString
msg
(
"该账号未激活!"
);
qDebug
()
<<
msg
;
FMMsgWnd
::
FailureWnd
(
msg
);
}
else
{
session
()
->
addData
(
PosProps
.
Name
,
name
);
session
()
->
addData
(
PosProps
.
Amount
,
getServerJsonValue
(
PosProps
.
Amount
).
toInt
());
...
...
@@ -66,24 +71,10 @@ void TaskLogin::onLogin()
session
()
->
addData
(
PosProps
.
Fm_open_id
,
fm_unique_id
);
//其实是认证接口中返回的fm_unique_id(PosProps.Fm_unique_id)
session
()
->
addData
(
PosProps
.
Score
,
getServerJsonValue
(
PosProps
.
Score
).
toInt
());
session
()
->
addData
(
PosProps
.
IsActive
,
getServerJsonValue
(
PosProps
.
IsActive
).
toInt
());
// QMap<QString, QVariant> couponMap;
// for (auto value : getServerJsonValue(PosProps.CouponList).toArray())
// {
// QJsonObject couponOb = value.toObject();
// QString code = couponOb[ServerProps(PosProps.Coupon_code)].toString();
// double amount = couponOb[ServerProps(PosProps.Coupon_disAmount)].toInt() / 100.0;
// QString desc = couponOb[ServerProps(PosProps.Coupon_desc)].toString();
// Coupon c{code, amount, desc};
// QVariant v;
// v.setValue(c);
// couponMap[code] = v;
// }
// session()->addData(PosProps.CouponMap, couponMap);
closeWindow
();
}
closeWindow
();
}
if
(
_window
!=
nullptr
)
{
_window
->
resetWnd
();
}
...
...
FMVip_LXJ/task/taskmanage.cpp
View file @
5bcf74f2
...
...
@@ -37,8 +37,6 @@ void TaskManage::setWindow()
auto
manageWindow
=
new
FMVipPanel
;
connect
(
manageWindow
,
SIGNAL
(
fund
()),
this
,
SLOT
(
onFund
()));
connect
(
manageWindow
,
SIGNAL
(
lock
()),
this
,
SLOT
(
onLock
()));
connect
(
manageWindow
,
SIGNAL
(
activate
()),
this
,
SLOT
(
onActivate
()));
_window
=
manageWindow
;
}
...
...
@@ -57,23 +55,6 @@ void TaskManage::onFund()
doChildTask
();
}
void
TaskManage
::
onLock
()
{
// childTask = new TaskCardLock(posReqJsonObj, this->session());
// doChildTask();
}
void
TaskManage
::
onActivate
()
{
// bool isOk = Reader::instance()->activateCard();
// if(!isOk) {
// FMMsgWnd::FailureWnd("fmv: 激活卡时写卡失败!");
// return;
// }
// childTask = new TaskCardActive(posReqJsonObj, this->session());
// doChildTask();
}
void
TaskManage
::
doChildTask
()
{
childTask
->
doTask
();
...
...
FMVip_LXJ/task/taskmanage.h
View file @
5bcf74f2
#ifndef TASKMANAGE_H
#
ifndef
TASKMANAGE_H
#define TASKMANAGE_H
#include "fmtask.h"
...
...
@@ -19,8 +19,6 @@ public:
public
slots
:
void
onFund
();
void
onLock
();
void
onActivate
();
private
:
FMTask
*
childTask
;
...
...
FMVip_LXJ/task/taskothers.cpp
View file @
5bcf74f2
#include "taskothers.h"
#
include
"taskothers.h"
#include "reader.h"
/// 优惠券查询
...
...
@@ -94,51 +94,3 @@ void TaskRefundOrder::packagePOSRsp()
}
posRspJsonObj
[
PosProps
.
Prompt
]
=
1
;
}
/// 锁定
TaskCardLock
::
TaskCardLock
(
QJsonObject
&
jsonObj
,
Session
*
session
,
QObject
*
parent
)
:
FMTaskNoWnd
(
jsonObj
,
FM_Card_Lock
,
session
,
parent
)
{
}
void
TaskCardLock
::
packageServerReq
()
{
serverReqJsonObj
[
ServerProps
(
PosProps
.
TransId
)]
=
createTransId
();
serverReqJsonObj
[
ServerProps
(
PosProps
.
CardNo
)]
=
session
()
->
data
(
PosProps
.
Member_sign
).
toString
();
serverReqJsonObj
[
ServerProps
(
PosProps
.
Passward
)]
=
""
;
}
void
TaskCardLock
::
packagePOSRsp
()
{
if
(
getServerJsonValue
(
PosProps
.
StatusCode
)
==
FM_API_SUCCESS
)
{
FMMsgWnd
::
SuccessWnd
(
"锁定成功
\n
卡状态:"
+
getServerJsonValue
(
PosProps
.
CardStatusDesc
).
toString
());
}
else
{
FMMsgWnd
::
FailureWnd
(
"锁定失败
\n
"
+
getServerJsonValue
(
PosProps
.
Msg
).
toString
());
}
}
/// 激活
TaskCardActive
::
TaskCardActive
(
QJsonObject
&
jsonObj
,
Session
*
session
,
QObject
*
parent
)
:
FMTaskNoWnd
(
jsonObj
,
FM_Card_Active
,
session
,
parent
)
{
}
void
TaskCardActive
::
packageServerReq
()
{
serverReqJsonObj
[
ServerProps
(
PosProps
.
TransId
)]
=
createTransId
();
serverReqJsonObj
[
ServerProps
(
PosProps
.
CardNo
)]
=
session
()
->
data
(
PosProps
.
Member_sign
).
toString
();
serverReqJsonObj
[
ServerProps
(
PosProps
.
Passward
)]
=
""
;
}
void
TaskCardActive
::
packagePOSRsp
()
{
if
(
getServerJsonValue
(
PosProps
.
StatusCode
)
==
FM_API_SUCCESS
)
{
FMMsgWnd
::
SuccessWnd
(
"激活成功
\n
卡状态:"
+
getServerJsonValue
(
PosProps
.
CardStatusDesc
).
toString
());
}
else
{
FMMsgWnd
::
FailureWnd
(
"激活失败
\n
"
+
getServerJsonValue
(
PosProps
.
Msg
).
toString
());
}
}
FMVip_LXJ/task/taskothers.h
View file @
5bcf74f2
#ifndef TASKOTHERS_H
#
ifndef
TASKOTHERS_H
#define TASKOTHERS_H
#include "fmtasknownd.h"
...
...
@@ -32,25 +32,4 @@ public:
void
packageServerReq
();
void
packagePOSRsp
();
};
// 账号锁定
class
TaskCardLock
:
public
FMTaskNoWnd
{
Q_OBJECT
public
:
explicit
TaskCardLock
(
QJsonObject
&
jsonObj
,
Session
*
session
,
QObject
*
parent
=
0
);
void
packageServerReq
();
void
packagePOSRsp
();
};
// 账号激活
class
TaskCardActive
:
public
FMTaskNoWnd
{
Q_OBJECT
public
:
explicit
TaskCardActive
(
QJsonObject
&
jsonObj
,
Session
*
session
,
QObject
*
parent
=
0
);
void
packageServerReq
();
void
packagePOSRsp
();
};
#endif // TASKOTHERS_H
FMVip_LXJ/task/taskpay.cpp
View file @
5bcf74f2
#include "taskpay.h"
#
include
"taskpay.h"
#include "fmviporder.h"
#include "tasklogin.h"
#include "taskothers.h"
...
...
@@ -9,6 +9,10 @@ TaskPay::TaskPay(QJsonObject &jsonObj, QObject *parent)
posReqJsonObj
[
PosProps
.
TransId
]
=
createTransId
();
}
TaskPay
::~
TaskPay
()
{
}
QByteArray
TaskPay
::
doTask
()
{
preTask
=
new
TaskLogin
(
posReqJsonObj
,
_session
,
this
);
...
...
@@ -19,14 +23,17 @@ QByteArray TaskPay::doTask()
}
this
->
_session
=
preTask
->
session
();
TaskCouponThread
c
ouponThread
(
posReqJsonObj
,
_session
,
this
);
couponThread
.
start
();
connect
(
&
couponThread
,
SIGNAL
(
finished
(
Session
*
)),
SLOT
(
onGetCoupons
(
Session
*
)));
couponThread
=
new
TaskC
ouponThread
(
posReqJsonObj
,
_session
,
this
);
couponThread
->
start
();
connect
(
couponThread
,
SIGNAL
(
finished
(
Session
*
)),
SLOT
(
onGetCoupons
(
Session
*
)));
return
FMTask
::
doTask
();
}
void
TaskPay
::
onGetCoupons
(
Session
*
session
)
{
couponThread
->
exit
();
del_p
(
couponThread
);
_session
->
addData
(
PosProps
.
CouponMap
,
session
->
getCouponMap
(
PosProps
.
CouponMap
));
if
(
_window
!=
nullptr
)
{
qobject_cast
<
FMVipOrder
*>
(
_window
)
->
initCouponItems
();
...
...
FMVip_LXJ/task/taskpay.h
View file @
5bcf74f2
#ifndef TASKPAY_H
#
ifndef
TASKPAY_H
#define TASKPAY_H
#include "fmtask.h"
#include <QThread>
#include "taskothers.h"
class
TaskCouponThread
;
class
TaskPay
:
public
FMTask
{
Q_OBJECT
public
:
explicit
TaskPay
(
QJsonObject
&
jsonObj
,
QObject
*
parent
=
0
);
~
TaskPay
();
QByteArray
doTask
();
void
setWindow
();
...
...
@@ -18,6 +21,9 @@ public:
private
slots
:
void
onPay
();
void
onGetCoupons
(
Session
*
session
);
private
:
TaskCouponThread
*
couponThread
;
};
// 加载代金券的线程类
...
...
@@ -31,7 +37,6 @@ public:
}
~
TaskCouponThread
()
{
del_p
(
task
);
del_p
(
_session
);
}
void
run
()
{
...
...
FMVip_LXJ/windows/fmviporder.cpp
View file @
5bcf74f2
...
...
@@ -129,6 +129,8 @@ void FMVipOrder::initCouponItems()
if
(
ui
->
coupon_page
->
count
()
>
0
)
{
connect
(
ui
->
coupon_page
,
SIGNAL
(
itemClicked
(
QListWidgetItem
*
)),
this
,
SLOT
(
onItemClicked
(
QListWidgetItem
*
)));
}
ui
->
pay_edit
->
setFocus
();
ui
->
pay_edit
->
selectAll
();
}
void
FMVipOrder
::
setWillPayText
()
...
...
FMVip_LXJ/windows/fmvippanel.cpp
View file @
5bcf74f2
...
...
@@ -43,13 +43,3 @@ void FMVipPanel::on_fund_btn_clicked()
{
emit
fund
();
}
void
FMVipPanel
::
on_lock_btn_clicked
()
{
emit
lock
();
}
void
FMVipPanel
::
on_activate_btn_clicked
()
{
emit
activate
();
}
FMVip_LXJ/windows/fmvippanel.h
View file @
5bcf74f2
#ifndef FMVIPPANEL_H
#
ifndef
FMVIPPANEL_H
#define FMVIPPANEL_H
#include <fmvipwnd.h>
...
...
@@ -19,13 +19,9 @@ public:
public
slots
:
void
on_fund_btn_clicked
();
void
on_lock_btn_clicked
();
void
on_activate_btn_clicked
();
signals
:
void
fund
();
void
lock
();
void
activate
();
private
:
Ui
::
FMVipPanel
*
ui
;
...
...
FMVip_LXJ/windows/forms/fmviporder.ui
View file @
5bcf74f2
...
...
@@ -939,6 +939,16 @@ font: 13px "微软雅黑";
</layout>
</widget>
<layoutdefault
spacing=
"6"
margin=
"11"
/>
<tabstops>
<tabstop>
pay_edit
</tabstop>
<tabstop>
pay_btn
</tabstop>
<tabstop>
coupon_next_btn
</tabstop>
<tabstop>
coupon_page
</tabstop>
<tabstop>
coupon_prev_btn
</tabstop>
<tabstop>
close_btn
</tabstop>
<tabstop>
pay_key
</tabstop>
<tabstop>
pay_chk
</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
FMVip_LXJ/windows/forms/fmvippanel.ui
View file @
5bcf74f2
...
...
@@ -107,6 +107,7 @@ QWidget {
#fund_btn {
background: rgb(255,85,85);
max-width: 400px;
}
#new_btn {
...
...
@@ -434,29 +435,7 @@ QWidget {
<property
name=
"spacing"
>
<number>
6
</number>
</property>
<item
row=
"4"
column=
"1"
>
<widget
class=
"QPushButton"
name=
"lock_btn"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Preferred"
vsizetype=
"Preferred"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"minimumSize"
>
<size>
<width>
0
</width>
<height>
120
</height>
</size>
</property>
<property
name=
"cursor"
>
<cursorShape>
PointingHandCursor
</cursorShape>
</property>
<property
name=
"text"
>
<string>
会员锁定
</string>
</property>
</widget>
</item>
<item
row=
"7"
column=
"1"
>
<item
row=
"6"
column=
"0"
>
<spacer
name=
"verticalSpacer_3"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
...
...
@@ -469,7 +448,7 @@ QWidget {
</property>
</spacer>
</item>
<item
row=
"
0"
column=
"1
"
>
<item
row=
"
4"
column=
"0
"
>
<spacer
name=
"verticalSpacer_2"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
...
...
@@ -482,7 +461,7 @@ QWidget {
</property>
</spacer>
</item>
<item
row=
"
4
"
column=
"0"
>
<item
row=
"
5
"
column=
"0"
>
<widget
class=
"QPushButton"
name=
"fund_btn"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Preferred"
vsizetype=
"Preferred"
>
...
...
@@ -504,28 +483,6 @@ QWidget {
</property>
</widget>
</item>
<item
row=
"4"
column=
"2"
>
<widget
class=
"QPushButton"
name=
"activate_btn"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Preferred"
vsizetype=
"Preferred"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"minimumSize"
>
<size>
<width>
0
</width>
<height>
120
</height>
</size>
</property>
<property
name=
"cursor"
>
<cursorShape>
PointingHandCursor
</cursorShape>
</property>
<property
name=
"text"
>
<string>
会员激活
</string>
</property>
</widget>
</item>
</layout>
</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