Commit 09a5e76b by NitefullWind

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

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