Commit b6bc3ced by NitefullWind

1. 使用accept()或reject()代替close(). 2. 初始化积分相关变量.

parent dd7fdb79
...@@ -61,7 +61,7 @@ void FMTask::stopTask() ...@@ -61,7 +61,7 @@ void FMTask::stopTask()
preTask->stopTask(); preTask->stopTask();
} }
if(_window != nullptr) { if(_window != nullptr) {
_window->close(); _window->accept();
_window = nullptr; _window = nullptr;
} }
...@@ -93,7 +93,7 @@ void FMTask::showWindow() ...@@ -93,7 +93,7 @@ void FMTask::showWindow()
if(_window != nullptr) { if(_window != nullptr) {
_window->initWnd(this->session()); _window->initWnd(this->session());
int ret = _window->exec(); int ret = _window->exec();
if(ret == -1) { if(ret != 1) {
setError(FM_API_WINDOWCLOSE); setError(FM_API_WINDOWCLOSE);
} }
} }
......
...@@ -55,5 +55,5 @@ ...@@ -55,5 +55,5 @@
//void TaskFund::onFund() //void TaskFund::onFund()
//{ //{
// sendToServer(); // sendToServer();
// _window->close(); // _window->accept();
//} //}
...@@ -56,7 +56,7 @@ void TaskLogin::onLogin() ...@@ -56,7 +56,7 @@ void TaskLogin::onLogin()
bool isOk = sendToServer(); bool isOk = sendToServer();
if(!isOk) { if(!isOk) {
if(_window != nullptr) { if(_window != nullptr) {
_window->close(); _window->accept();
} }
return; return;
} }
...@@ -83,7 +83,7 @@ void TaskLogin::onLogin() ...@@ -83,7 +83,7 @@ void TaskLogin::onLogin()
session()->addData(PosProps.Amount, getServerJsonValue(PosProps.Amount).toInt()); session()->addData(PosProps.Amount, getServerJsonValue(PosProps.Amount).toInt());
session()->addData(PosProps.Score, getServerJsonValue(PosProps.Score).toInt()); session()->addData(PosProps.Score, getServerJsonValue(PosProps.Score).toInt());
_window->close(); _window->accept();
} }
if(_window!=nullptr) { if(_window!=nullptr) {
_window->resetWnd(); _window->resetWnd();
......
...@@ -162,5 +162,5 @@ void TaskPay::packagePOSRsp() ...@@ -162,5 +162,5 @@ void TaskPay::packagePOSRsp()
void TaskPay::onPay() void TaskPay::onPay()
{ {
sendToServer(); sendToServer();
_window->close(); _window->accept();
} }
...@@ -88,5 +88,5 @@ void FMMsgWnd::LoginSuccess(const QString &account, const QString &name, const Q ...@@ -88,5 +88,5 @@ void FMMsgWnd::LoginSuccess(const QString &account, const QString &name, const Q
void FMMsgWnd::on_btn_confirm_clicked() void FMMsgWnd::on_btn_confirm_clicked()
{ {
this->close(); this->accept();
} }
...@@ -53,7 +53,7 @@ private: ...@@ -53,7 +53,7 @@ private:
OrderInfo() OrderInfo()
{ {
_amountStr = _needPayStr = ""; _amountStr = _needPayStr = "";
_amount = _score = _needPay = _maxWillPay = _payAmountScore = _payAmountCoupon = 0; _amount = _score = _payScore = _needPay = _maxWillPay = _payAmountScore = _payAmountCoupon = 0;
} }
OrderInfo(QString amountStr, int score, QString needPayStr) OrderInfo(QString amountStr, int score, QString needPayStr)
{ {
...@@ -64,7 +64,7 @@ private: ...@@ -64,7 +64,7 @@ private:
_needPay = _needPayStr.toInt() / 100.0; _needPay = _needPayStr.toInt() / 100.0;
_score = score; _score = score;
_maxWillPay = _payAmountScore = _payAmountCoupon = 0; _payScore = _maxWillPay = _payAmountScore = _payAmountCoupon = 0;
setMaxWillPay(); setMaxWillPay();
} }
......
...@@ -26,7 +26,7 @@ FMVipWnd::~FMVipWnd() ...@@ -26,7 +26,7 @@ FMVipWnd::~FMVipWnd()
void FMVipWnd::on_close_btn_clicked() void FMVipWnd::on_close_btn_clicked()
{ {
this->done(-1); this->reject();
} }
bool FMVipWnd::close() bool FMVipWnd::close()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment