-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDeposit.cpp
51 lines (46 loc) · 1.32 KB
/
Deposit.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include "Deposit.h"
Deposit::Deposit(QWidget *parent)
: QDialog(parent)
{
QIcon ico(":/LXDInjector/LXDInjector.ico");
setWindowIcon(ico);
ui.setupUi(this);
}
Deposit::~Deposit()
{
}
void Deposit::on_btnClose_clicked()
{
this->close();
}
void Deposit::on_btnGetCode_clicked()
{
ui.btnGetCode->setDisabled(true);
ui.lbQRCode->setText(QString::fromWCharArray(L"<h1>正在获取……</h1>"));
QByteArray reqdata;
reqdata.append("username=");
reqdata.append(((LXDQApp *)qApp)->sessionkey.split("::")[0]);
reqdata.append("&paytype=");
reqdata.append(ui.bgPayMethods->checkedButton()->text());
reqdata.append("&price=");
reqdata.append(ui.leAmount->text());
QNetworkReply *rep = accessmanager.post(QNetworkRequest(QUrl("http://" + ((LXDQApp *)qApp)->host + "/020pay_getQRcode")), reqdata);
if (rep->error() == QNetworkReply::NoError)
{
connect(&accessmanager, SIGNAL(finished(QNetworkReply*)), this, SLOT(on_QRcode_got(QNetworkReply*)));
}
else
{
ui.lbQRCode->setText(QString::fromWCharArray(L"<h1>获取失败!</h1>"));
}
return;
}
void Deposit::on_QRcode_got(QNetworkReply *rep)
{
QString result;
QString respstr = rep->readAll();
rep->deleteLater();
ui.lbQRCode->setText(respstr);
disconnect(&accessmanager, SIGNAL(finished(QNetworkReply*)), this, SLOT(on_QRcode_got(QNetworkReply*)));
ui.btnGetCode->setDisabled(false);
}