Commit b345ca80 by 刘帅

修改代金券面值显示、商品券的商品展示、换班确认

parent 9b0d07ae
......@@ -14,10 +14,12 @@
*/plugins/*.lib
*/plugins/*.pdb
*/plugins/*.rc
bins/*.exe
*.exe
*/bin/configuration/*
log/
*/res/resource.h
*/res/MANIFEST.MF
*/res/*.rc
release/bins/database/Fmtakeout.s3db
release/plugins/FreemudPOS.ini
debug/bins/
\ No newline at end of file
[Service]
Name=FMPService
Desc=\xe9\x9d\x9e\xe7\xa0\x81 POS \xe6\x8f\x92\xe4\xbb\xb6\xe6\x9c\x8d\xe5\x8a\xa1
StartType=0
[Plugin]
Path=../plugins
EntryService=com.fmp.home
Animation=1
[Log]
Path=log
Size=1
Level=4
[Home]
Server=http://115.159.226.87:20001/api/user/login
PartnerId=1371
StoreId=fm99999
PosId=fm1802
Position=1520, 266
CashierId=001
[Pay]
Server=https://115.159.18.100/api
Timeout=60
[Vip]
Server=http://jtest.sandload.cn/member_tianfu/service/restful/pos
[Syncer]
Interval=3
TaskUrl=http://115.159.33.143/api/fork/checkupdate
DeployPath=..
DownloadPath=download
[Takeout]
Server=http://wmpos.sandload.cn/api
Port=34953
Password=posoperator@freemud.cn
ShiftId=001
ShiftName=001
AutoConfirm=0
Entryurl=
Entryport=
[Printer]
Name=Microsoft XPS Document Writer
Mode=2
PaperWidth=80
......@@ -53,6 +53,7 @@ bool ConsumptionDialog::ShowForUnConsum(const QString coupon, const QJsonObject
QString act_name = codeInfo["act_name"].toString();
QString channel = object["channel"].toString();
QString fullChannel = object["channel"].toString();
int couponType = object["couponType"].toInt();
int index = fullChannel.indexOf("-");
if( index != -1)
{
......@@ -61,6 +62,14 @@ bool ConsumptionDialog::ShowForUnConsum(const QString coupon, const QJsonObject
double realAmount = codeInfo["originalPrice"].toInt()/100.0; // 面值
double amount = codeInfo["paid"].toInt()/100.0; //实付
QJsonArray _products_info = codeInfo["products"].toArray();
if(!_products_info.isEmpty())
{
realAmount = _products_info[0].toObject()["price_act"].toInt()/100.0;
}
if(couponType == 1) //如果代金券查询接口返回商品信息,需要对realAmount重新赋值
{
realAmount = codeInfo["originalPrice"].toInt()/100.0; // 面值
}
ConsumptionDialog v(parent);
v.ui->topNoConsumeWidget->setObjectName( "topNoConsumeWidget");
......@@ -70,52 +79,62 @@ bool ConsumptionDialog::ShowForUnConsum(const QString coupon, const QJsonObject
v.ui->btnConsumption->setEnabled( true);
v.setData(act_name, realAmount, amount, channel, "", coupon);
QButtonGroup *group = new QButtonGroup();
int checkedIndex = 0; //默认选中的商品选项
for(int i = 0; i < _products_info.size(); i++)
if(couponType == 0)
{
QJsonObject product;
product.insert("seq", i+1);
product.insert("pid", _products_info[i].toObject()["pid"]);
product.insert("consume_num", _products_info[i].toObject()["number"]);
QString name = _products_info[i].toObject()["name"].toString();
if(name.contains(QString::fromLocal8Bit("92"), Qt::CaseSensitive))
QButtonGroup *group = new QButtonGroup();
int checkedIndex = 0; //默认选中的商品选项
for(int i = 0; i < _products_info.size(); i++)
{
checkedIndex = i;
QJsonObject product;
product.insert("seq", i+1);
product.insert("pid", _products_info[i].toObject()["pid"]);
product.insert("consume_num", _products_info[i].toObject()["number"]);
QString name = _products_info[i].toObject()["name"].toString();
if(name.contains(QString::fromLocal8Bit("92"), Qt::CaseSensitive))
{
checkedIndex = i;
}
QRadioButton *radioButton = new QRadioButton(name);
radioButton->setStyleSheet("font-family:\"微软雅黑\"; font-size:14px; color: rgb(255, 255, 0)");
group->addButton(radioButton, i);
v.ui->selectLayout->addWidget(radioButton);
}
QRadioButton *radioButton = new QRadioButton(name);
group->addButton(radioButton, i);
v.ui->selectLayout->addWidget(radioButton);
}
realAmount = _products_info[checkedIndex].toObject()["price_act"].toInt()/100.0; // 面值
QAbstractButton* button = group->button(checkedIndex);
if(button)
button->setChecked(true);
if( v.exec() == QDialog::Accepted)
{
QJsonArray _products;
foreach(auto item, group->buttons()) //QList<QAbstractButton *> buttons() const
realAmount = _products_info[checkedIndex].toObject()["price_act"].toInt()/100.0; // 面值
QAbstractButton* button = group->button(checkedIndex);
if(button)
button->setChecked(true);
if( v.exec() == QDialog::Accepted)
{
if(item->isChecked())
QJsonArray _products;
foreach(auto item, group->buttons()) //QList<QAbstractButton *> buttons() const
{
QString text = item->text();
for(int i = 0; i < _products_info.size(); i++)
if(item->isChecked())
{
if(text == _products_info[i].toObject()["name"].toString())
QString text = item->text();
for(int i = 0; i < _products_info.size(); i++)
{
QJsonObject product;
product.insert("seq", 1);
product.insert("pid", _products_info[i].toObject()["pid"]);
product.insert("consume_num", _products_info[i].toObject()["number"]);
_products.append(product);
break;
if(text == _products_info[i].toObject()["name"].toString())
{
QJsonObject product;
product.insert("seq", 1);
product.insert("pid", _products_info[i].toObject()["pid"]);
product.insert("consume_num", _products_info[i].toObject()["number"]);
_products.append(product);
break;
}
}
break;
}
break;
}
products = _products;
return true;
}
products = _products;
return true;
}
else
{
if( v.exec() == QDialog::Accepted)
return true;
}
return false;
}
......
......@@ -62,7 +62,10 @@ RedeemDetail::RedeemDetail(int partnerId, QString storeId, QString url, QWidget
QString shiftTimeString = settings.value("Coupon/shiftTime").toString();
shiftTime = QDateTime::fromString(shiftTimeString, DATE_TIME_FORMAT);
if(!shiftTime.isValid())
{
shiftTime = QDateTime::currentDateTime();
settings.setValue("Coupon/shiftTime", shiftTime.toString(DATE_TIME_FORMAT));
}
startTime = shiftTime;
endTime = QDateTime::currentDateTime();
......@@ -412,6 +415,12 @@ void RedeemDetail::SetBusy(bool busy)
void RedeemDetail::shiftWork()
{
if(QMessageBox::information(this,
QString::fromLocal8Bit("换班提示"),
QString::fromLocal8Bit("确认换班吗?"),
QMessageBox::Ok | QMessageBox::Cancel,
QMessageBox::Ok) == QMessageBox::Cancel)
return;
QDateTime currentTime = QDateTime::currentDateTime();
QString shiftTimeString = currentTime.toString(DATE_TIME_FORMAT);
FMP_INFO() << "shift work: " << shiftTimeString;
......
......@@ -8,4 +8,4 @@ Timeout=60
[Coupon]
Server=http://115.159.142.32/api
RedeemLog=http://115.159.65.101:8111/fmcouponredeem/queryCouponRedeemReturnJson
shiftTime=2019-06-26 19:59:16
shiftTime=2019-06-28 15:10:14
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