Commit 09a5e76b by NitefullWind

1. 手机号认证不可支付。 2. 认证区别实体卡号。

parent 4305996f
...@@ -44,7 +44,6 @@ int FMNetwork::send(const QString &url, const QByteArray &reqData, QByteArray &r ...@@ -44,7 +44,6 @@ int FMNetwork::send(const QString &url, const QByteArray &reqData, QByteArray &r
QTimer timer; QTimer timer;
timer.setSingleShot(true); timer.setSingleShot(true);
connect(&timer, SIGNAL(timeout()),&loop,SLOT(quit())); connect(&timer, SIGNAL(timeout()),&loop,SLOT(quit()));
timer.start(1000 * 60); timer.start(1000 * 60);
loop.exec(); loop.exec();
...@@ -57,7 +56,7 @@ int FMNetwork::send(const QString &url, const QByteArray &reqData, QByteArray &r ...@@ -57,7 +56,7 @@ int FMNetwork::send(const QString &url, const QByteArray &reqData, QByteArray &r
int err = reply->error(); int err = reply->error();
rspData = reply->readAll(); rspData = reply->readAll();
error = FM_API_NETWORERROR; error = FM_API_NETWORERROR;
errorMsg = netErrInfo(err); errorMsg = QString("NetworkError(%1)").arg(err);
} }
}else{ }else{
error = FM_API_TIMEOUT; error = FM_API_TIMEOUT;
......
...@@ -84,7 +84,7 @@ struct PP{ ...@@ -84,7 +84,7 @@ struct PP{
Amount = "amount"; Amount = "amount";
Phone = "phone"; Phone = "phone";
Fm_open_id = "fm_open_id"; Fm_open_id = "fm_open_id";
CanPay = "CanPay"; CanPay = "canPay";
Address = "address"; Address = "address";
Email = "email"; Email = "email";
......
...@@ -28,7 +28,12 @@ void TaskLogin::setWindow() ...@@ -28,7 +28,12 @@ void TaskLogin::setWindow()
void TaskLogin::packageServerReq() void TaskLogin::packageServerReq()
{ {
QJsonObject code; QJsonObject code;
code[ServerProps(PosProps.Member_sign)] = session()->data(PosProps.Member_sign).toString(); QString memberSign = session()->data(PosProps.Member_sign).toString();
// 原生卡前加上"cardNo="标志给服务端
if(memberSign.length() == 6) {
memberSign = "cardNo="+memberSign;
}
code[ServerProps(PosProps.Member_sign)] = memberSign;
serverReqJsonObj["data"] = code; serverReqJsonObj["data"] = code;
} }
...@@ -74,8 +79,15 @@ void TaskLogin::onLogin() ...@@ -74,8 +79,15 @@ void TaskLogin::onLogin()
QString birthday = getServerJsonValue(PosProps.Birthday).toString(); QString birthday = getServerJsonValue(PosProps.Birthday).toString();
QString name = getServerJsonValue(PosProps.Name).toString(); QString name = getServerJsonValue(PosProps.Name).toString();
if(getServerJsonValue(PosProps.CanPay).toInt() == 0) { bool canPay = (getServerJsonValue(PosProps.CanPay).toInt() == 1);
if(!canPay) {
if(getPosJsonValue(PosProps.Fm_cmd).toInt() != FM_Pay) {
FMMsgWnd::LoginSuccess(account, name, birthday, _window); FMMsgWnd::LoginSuccess(account, name, birthday, _window);
} else {
FMMsgWnd::FailureWnd(QString::fromLocal8Bit(ErrorNeedPayCode), _window);
_window->resetWnd();
return;
}
} }
session()->addData(PosProps.Name, name); session()->addData(PosProps.Name, name);
...@@ -83,6 +95,7 @@ void TaskLogin::onLogin() ...@@ -83,6 +95,7 @@ void TaskLogin::onLogin()
session()->addData(PosProps.Fm_open_id, account); session()->addData(PosProps.Fm_open_id, account);
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());
session()->addData(PosProps.CanPay, canPay);
_window->accept(); _window->accept();
} }
......
...@@ -29,7 +29,9 @@ QByteArray TaskPay::doTask() ...@@ -29,7 +29,9 @@ QByteArray TaskPay::doTask()
// return ret; // return ret;
// } // }
if(session()->data(PosProps.Fm_open_id).toString() == 0) { QString fm_open_id_pos = getPosJsonValue(PosProps.Fm_open_id).toString();
QString fm_open_id_session = session()->data(PosProps.Fm_open_id).toString();
if(fm_open_id_session == "" || fm_open_id_pos!=fm_open_id_session || session()->data(PosProps.CanPay).toBool() == false) {
preTask = new TaskLogin(posReqJsonObj, _session, this); preTask = new TaskLogin(posReqJsonObj, _session, this);
preTask->session()->addData(PosProps.FM_Type, FM_Pay); preTask->session()->addData(PosProps.FM_Type, FM_Pay);
QByteArray loginRst = preTask->doTask(); QByteArray loginRst = preTask->doTask();
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include <QFile> #include <QFile>
#include <QMutex> #include <QMutex>
#include "fmloading.h" #include "fmloading.h"
#include "fmmsgwnd.h"
FMVipLogin::FMVipLogin(QDialog *parent) : FMVipLogin::FMVipLogin(QDialog *parent) :
FMVipWnd(parent), FMVipWnd(parent),
...@@ -52,6 +53,11 @@ QString FMVipLogin::getVersionInfo() ...@@ -52,6 +53,11 @@ QString FMVipLogin::getVersionInfo()
void FMVipLogin::on_login_btn_clicked() void FMVipLogin::on_login_btn_clicked()
{ {
QString id = ui->login_edit->text(); QString id = ui->login_edit->text();
if(id.isEmpty()) {
FMMsgWnd::FailureWnd(QString::fromLocal8Bit("认证号码不能为空!"), this);
resetWnd();
return;
}
_session->addData(PosProps.Member_sign, id); _session->addData(PosProps.Member_sign, id);
......
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