Commit 3faf4339 by 刘帅

适配时间戳,修改一处显示问题

parent c51d56e9
...@@ -178,6 +178,9 @@ ...@@ -178,6 +178,9 @@
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget> </widget>
<widget class="QLabel" name="labChannel"> <widget class="QLabel" name="labChannel">
<property name="geometry"> <property name="geometry">
......
...@@ -302,13 +302,13 @@ QJsonObject FMPRedeem::ShowForUnConsum(QJsonObject json) ...@@ -302,13 +302,13 @@ QJsonObject FMPRedeem::ShowForUnConsum(QJsonObject json)
int index = fullChannel.indexOf("-"); int index = fullChannel.indexOf("-");
if( index != -1) if( index != -1)
{ {
channel = fullChannel.left(index); channel = fullChannel.left(index);
}
double realAmount = codeInfo["amount"].toInt()/100.0; // 面值
if(coupon.trimmed().length() == 9 || coupon.trimmed().length() == 15) //非码券
{
realAmount = codeInfo["originalPrice"].toInt()/100.0; // 面值
} }
double realAmount = codeInfo["originalPrice"].toInt()/100.0; // 面值
// if(coupon.trimmed().length() == 9 || coupon.trimmed().length() == 15) //非码券
// {
// realAmount = codeInfo["originalPrice"].toInt()/100.0; // 面值
// }
double amount = codeInfo["paid"].toInt()/100.0; //实付 double amount = codeInfo["paid"].toInt()/100.0; //实付
QString time_name = QString::fromLocal8Bit("有效期至: ").append(QDate::fromString(vdata, "yyyyMMdd").toString("yyyy-MM-dd")); QString time_name = QString::fromLocal8Bit("有效期至: ").append(QDate::fromString(vdata, "yyyyMMdd").toString("yyyy-MM-dd"));
...@@ -320,14 +320,14 @@ QJsonObject FMPRedeem::ShowForUnConsum(QJsonObject json) ...@@ -320,14 +320,14 @@ QJsonObject FMPRedeem::ShowForUnConsum(QJsonObject json)
_redeem_json["ver"] = 2; _redeem_json["ver"] = 2;
_redeem_json["clientReqCount"] = (++_clientReqCount%=10000000); _redeem_json["clientReqCount"] = (++_clientReqCount%=10000000);
_redeem_json["reqtype"] = 71; _redeem_json["reqtype"] = 71;
// _redeem_json["partnerId"] = _partner_id; // _redeem_json["partnerId"] = _partner_id;
_redeem_json["store_id"] = _store_id; _redeem_json["store_id"] = _store_id;
_redeem_json["station_id"] = _station_id; _redeem_json["station_id"] = _station_id;
_redeem_json["trans_id"] = QString::number(QDateTime::currentDateTimeUtc().toTime_t()); _redeem_json["trans_id"] = QString::number(QDateTime::currentDateTimeUtc().toTime_t());
_redeem_json["operator_id"] = _operator_id; _redeem_json["operator_id"] = _operator_id;
_redeem_json["business_date"] = QDate::currentDate().toString("yyyyMMdd"); _redeem_json["business_date"] = QDate::currentDate().toString("yyyyMMdd");
if( couponType == 0){ //商品券 if( couponType == 0){ //商品券
QJsonObject transaction; QJsonObject transaction;
QJsonArray transactions; QJsonArray transactions;
transaction["code"] = coupon; transaction["code"] = coupon;
...@@ -347,14 +347,14 @@ QJsonObject FMPRedeem::ShowForUnConsum(QJsonObject json) ...@@ -347,14 +347,14 @@ QJsonObject FMPRedeem::ShowForUnConsum(QJsonObject json)
transactions.append(transaction); transactions.append(transaction);
_redeem_json["transactions"] = transactions; _redeem_json["transactions"] = transactions;
} }
if( couponType == 1){ //代金券 if( couponType == 1){ //代金券
QJsonObject transaction; QJsonObject transaction;
transaction["code"] = coupon; transaction["code"] = coupon;
transaction["ebcode"] = ebcode; transaction["ebcode"] = ebcode;
QJsonArray transactions; QJsonArray transactions;
transactions.append(transaction); transactions.append(transaction);
_redeem_json["transactions"] = transactions; _redeem_json["transactions"] = transactions;
} }
QByteArray reqData = QJsonDocument(_redeem_json).toJson(); QByteArray reqData = QJsonDocument(_redeem_json).toJson();
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <QNetworkRequest> #include <QNetworkRequest>
#include <QJsonArray> #include <QJsonArray>
#include <QtConcurrent> #include <QtConcurrent>
#include <QDateTime>
extern bool isRedeeming; extern bool isRedeeming;
RedeemDetail::RedeemDetail(int partnerId, QString storeId, QString url, QWidget *parent) : RedeemDetail::RedeemDetail(int partnerId, QString storeId, QString url, QWidget *parent) :
...@@ -239,7 +240,17 @@ void RedeemDetail::ShowRedeemRecord(QJsonObject obj) ...@@ -239,7 +240,17 @@ void RedeemDetail::ShowRedeemRecord(QJsonObject obj)
QString channel = tmp["channel"].toString(); QString channel = tmp["channel"].toString();
double faceAmount = tmp["amount"].toInt()/100.0; double faceAmount = tmp["amount"].toInt()/100.0;
double realAmount = tmp["realAmount"].toInt()/100.0; double realAmount = tmp["realAmount"].toInt()/100.0;
QString redeemDate = tmp["redeemDate"].toString(); QString redeemDate;
if(tmp["redeemDate"].isString())
{
redeemDate = tmp["redeemDate"].toString();
}
else //时间戳
{
qint64 ms = tmp["redeemDate"].toDouble();
QDateTime time = QDateTime::fromMSecsSinceEpoch(ms);
redeemDate = time.toString("yyyy-MM-dd HH:mm:ss");
}
totalMoney += realAmount; totalMoney += realAmount;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#define VER_MINOR 1 #define VER_MINOR 1
#define VER_REVISION 0 #define VER_REVISION 0
#define VER_BUILD 91 #define VER_BUILD 92
//! Convert version numbers to string //! Convert version numbers to string
#define _STR(S) #S #define _STR(S) #S
......
[Home]
PartnerId=1739
[Pay]
Server="http://115.159.119.32:27935/api?partner=yhdw"
Timeout=60
[Coupon]
Server=http://115.159.142.32/api
RedeemLog=http://115.159.119.32:27935/getRedeemLog
\ No newline at end of file
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