Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fmPOS
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhenfei.zhang
fmPOS
Commits
10d384ee
Commit
10d384ee
authored
Jun 25, 2019
by
刘帅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加查询页面的商品展示
parent
1cfec17a
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
135 additions
and
39 deletions
+135
-39
fmp_home
+1
-1
fmp_keyboard/version.h
+1
-1
fmp_logger/version.h
+1
-1
fmp_manager/version.h
+1
-1
fmp_network/version.h
+1
-1
fmp_redeem/consumptiondialog.cpp
+81
-1
fmp_redeem/consumptiondialog.h
+7
-0
fmp_redeem/consumptiondialog.ui
+29
-11
fmp_redeem/fmp_redeem.cpp
+5
-15
fmp_redeem/version.h
+1
-1
fmp_syncer/version.h
+1
-1
fmprc.bat
+1
-0
release/bins/FreemudPOS.exe
+0
-0
release/bins/FreemudPOS.ini
+1
-1
release/bins/FreemudSyncer.exe
+0
-0
release/bins/server_url.ini
+4
-4
No files found.
fmp_home
@
da1606bb
Subproject commit
ae1170745403d24c3d1cbd1ce5bd418732b02075
Subproject commit
da1606bbad4d543b107d1e16c892d9d36dba92cd
fmp_keyboard/version.h
View file @
10d384ee
...
...
@@ -5,7 +5,7 @@
#define VER_MINOR 1
#define VER_REVISION 0
#define VER_BUILD 9
5
#define VER_BUILD 9
6
//! Convert version numbers to string
#define _STR(S) #S
...
...
fmp_logger/version.h
View file @
10d384ee
...
...
@@ -5,7 +5,7 @@
#define VER_MINOR 1
#define VER_REVISION 0
#define VER_BUILD 9
5
#define VER_BUILD 9
6
//! Convert version numbers to string
#define _STR(S) #S
...
...
fmp_manager/version.h
View file @
10d384ee
...
...
@@ -5,7 +5,7 @@
#define VER_MINOR 1
#define VER_REVISION 0
#define VER_BUILD 9
5
#define VER_BUILD 9
6
//! Convert version numbers to string
#define _STR(S) #S
...
...
fmp_network/version.h
View file @
10d384ee
...
...
@@ -5,7 +5,7 @@
#define VER_MINOR 1
#define VER_REVISION 0
#define VER_BUILD 9
5
#define VER_BUILD 9
6
//! Convert version numbers to string
#define _STR(S) #S
...
...
fmp_redeem/consumptiondialog.cpp
View file @
10d384ee
#
include
"consumptiondialog.h"
#include "ui_consumptiondialog.h"
#include <QDebug>
#include <QJsonObject>
#include <QCheckBox>
#include <QJsonArray>
#include <QButtonGroup>
#include <QRadioButton>
#include <QDebug>
ConsumptionDialog
::
ConsumptionDialog
(
QWidget
*
parent
,
Qt
::
WindowFlags
f
)
:
QDialog
(
parent
,
f
),
...
...
@@ -41,6 +47,79 @@ bool ConsumptionDialog::ShowForUnConsum(const QString& act_name, double face_amo
return
false
;
}
bool
ConsumptionDialog
::
ShowForUnConsum
(
const
QString
coupon
,
const
QJsonObject
object
,
QJsonArray
&
products
,
QWidget
*
parent
)
{
QJsonObject
codeInfo
=
object
[
"codeInfo"
].
toObject
();
QString
act_name
=
codeInfo
[
"act_name"
].
toString
();
QString
channel
=
object
[
"channel"
].
toString
();
QString
fullChannel
=
object
[
"channel"
].
toString
();
int
index
=
fullChannel
.
indexOf
(
"-"
);
if
(
index
!=
-
1
)
{
channel
=
fullChannel
.
left
(
index
);
}
double
realAmount
=
codeInfo
[
"originalPrice"
].
toInt
()
/
100.0
;
// 面值
double
amount
=
codeInfo
[
"paid"
].
toInt
()
/
100.0
;
//实付
QJsonArray
_products_info
=
codeInfo
[
"products"
].
toArray
();
ConsumptionDialog
v
(
parent
);
v
.
ui
->
topNoConsumeWidget
->
setObjectName
(
"topNoConsumeWidget"
);
v
.
ui
->
topNoConsumeWidget
->
setStyleSheet
(
v
.
ui
->
topNoConsumeWidget
->
styleSheet
());
v
.
ui
->
btnConsumption
->
setObjectName
(
"btnConsumption"
);
v
.
ui
->
btnConsumption
->
setStyleSheet
(
v
.
ui
->
btnConsumption
->
styleSheet
());
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
++
)
{
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
);
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
{
if
(
item
->
isChecked
())
{
QString
text
=
item
->
text
();
for
(
int
i
=
0
;
i
<
_products_info
.
size
();
i
++
)
{
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
;
}
}
products
=
_products
;
return
true
;
}
return
false
;
}
bool
ConsumptionDialog
::
ShowForHasConsum
(
const
QString
&
act_name
,
const
QString
channel
,
const
QString
&
code_name
,
const
QString
&
time_name
,
const
QString
&
coupon
,
QWidget
*
parent
)
{
ConsumptionDialog
v
(
parent
);
...
...
@@ -121,7 +200,8 @@ void ConsumptionDialog::setData(const QString &act_name, double face_amount, dou
{
ui
->
labCode
->
setText
(
coupon
);
ui
->
labCodeName
->
setText
(
QString
::
fromLocal8Bit
(
"面值: %1 元"
).
arg
(
face_amount
));
ui
->
actualAmount
->
setText
(
QString
::
fromLocal8Bit
(
"实收: %1 元"
).
arg
(
actual_amount
));
//ui->actualAmount->setText(QString::fromLocal8Bit("实收: %1 元").arg(actual_amount));
ui
->
actualAmount
->
hide
();
ui
->
ebname
->
setText
(
QString
::
fromLocal8Bit
(
"渠道: "
)
+
eb_name
);
ui
->
labActName
->
setText
(
act_name
);
ui
->
labTime
->
setText
(
time_name
);
...
...
fmp_redeem/consumptiondialog.h
View file @
10d384ee
...
...
@@ -21,6 +21,13 @@ public:
void
setData
(
const
QString
&
act_name
,
const
QString
channel
,
const
QString
&
code_name
,
const
QString
&
time_name
,
const
QString
&
coupon
);
void
setData
(
const
QString
&
act_name
,
double
face_amount
,
double
actual_amount
,
const
QString
&
eb_name
,
const
QString
&
time_name
,
const
QString
&
coupon
);
static
bool
ShowForUnConsum
(
const
QString
&
act_name
,
double
face_amount
,
double
actual_amount
,
const
QString
&
eb_name
,
const
QString
&
time_name
,
const
QString
&
coupon
,
QWidget
*
parent
=
0
);
/* 描述:展示查询成功且券有效页面,重载函数
* 参数:
* coupon 券
* object 查询接口返回数据
*/
static
bool
ShowForUnConsum
(
const
QString
coupon
,
const
QJsonObject
object
,
QJsonArray
&
products
,
QWidget
*
parent
=
0
);
static
bool
ShowForHasConsum
(
const
QString
&
act_name
,
const
QString
channel
,
const
QString
&
code_name
,
const
QString
&
time_name
,
const
QString
&
coupon
,
QWidget
*
parent
=
0
);
void
ShowForWaiting
(
QString
context
,
QString
coupon
,
QWidget
*
parent
=
0
);
void
HideForWaiting
();
...
...
fmp_redeem/consumptiondialog.ui
View file @
10d384ee
...
...
@@ -59,21 +59,25 @@
/**/
#labActName{
/*font: 30 bold
"
微软雅黑
"
;*/
font-size:25px;
font-family:
"
微软雅黑
"
;
font-weight:bold;
font: 65 13pt
"
微软雅黑
"
;
color: rgb(255, 255, 0);
border:none;
}
#ebname{
font: 65
20
pt
"
微软雅黑
"
;
font: 65
15
pt
"
微软雅黑
"
;
color: rgb(255,255,255);
border:none;
}
#labCodeName, #actualAmount{
font: 65 15pt
"
微软雅黑
"
;
font: 65 13pt
"
微软雅黑
"
;
color: rgb(255, 255, 0);
border:none;
}
#QRadioButton{
font: 65 13pt
"
微软雅黑
"
;
color: rgb(255, 255, 0);
border:none;
}
...
...
@@ -174,7 +178,7 @@
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
9
0
</y>
<y>
4
0
</y>
<width>
330
</width>
<height>
50
</height>
</rect>
...
...
@@ -195,10 +199,13 @@
<string>
查询中
</string>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignCenter
</set>
<set>
Qt::Align
Leading|Qt::AlignLeft|Qt::AlignV
Center
</set>
</property>
<property
name=
"wordWrap"
>
<bool>
true
</bool>
<bool>
false
</bool>
</property>
<property
name=
"indent"
>
<number>
10
</number>
</property>
</widget>
<widget
class=
"QLabel"
name=
"labTime"
>
...
...
@@ -233,7 +240,7 @@
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
1
86
</y>
<y>
1
10
</y>
<width>
330
</width>
<height>
37
</height>
</rect>
...
...
@@ -267,7 +274,7 @@
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
22
0
</y>
<y>
14
0
</y>
<width>
330
</width>
<height>
37
</height>
</rect>
...
...
@@ -301,7 +308,7 @@
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
15
0
</y>
<y>
8
0
</y>
<width>
330
</width>
<height>
37
</height>
</rect>
...
...
@@ -331,6 +338,17 @@
<number>
10
</number>
</property>
</widget>
<widget
class=
"QWidget"
name=
"verticalLayoutWidget"
>
<property
name=
"geometry"
>
<rect>
<x>
170
</x>
<y>
120
</y>
<width>
161
</width>
<height>
151
</height>
</rect>
</property>
<layout
class=
"QVBoxLayout"
name=
"selectLayout"
/>
</widget>
</widget>
</item>
<item>
...
...
fmp_redeem/fmp_redeem.cpp
View file @
10d384ee
...
...
@@ -186,7 +186,7 @@ QJsonObject FMPRedeem::Redeem(const QJsonArray& productsInfo)
json
.
insert
(
"ver"
,
2
);
json
.
insert
(
"clientReqCount"
,
++
_clientReqCount
%=
10000000
);
json
.
insert
(
"reqtype"
,
0
);
//
json.insert("partnerId", _partner_id);
json
.
insert
(
"partnerId"
,
_partner_id
);
json
.
insert
(
"store_id"
,
_store_id
);
json
.
insert
(
"station_id"
,
_station_id
);
json
.
insert
(
"operator_id"
,
_operator_id
);
...
...
@@ -314,13 +314,15 @@ QJsonObject FMPRedeem::ShowForUnConsum(QJsonObject json)
QString
time_name
=
QString
::
fromLocal8Bit
(
"有效期至: "
).
append
(
QDate
::
fromString
(
vdata
,
"yyyyMMdd"
).
toString
(
"yyyy-MM-dd"
));
//UNUSED(time_name);
int
couponType
=
json
[
"couponType"
].
toInt
();
if
(
ConsumptionDialog
::
ShowForUnConsum
(
act_name
,
realAmount
,
amount
,
channel
,
""
,
coupon
))
//if( ConsumptionDialog::ShowForUnConsum(act_name, realAmount, amount, channel, "", coupon))
QJsonArray
products
;
if
(
ConsumptionDialog
::
ShowForUnConsum
(
coupon
,
json
,
products
))
{
_redeem_json
=
QJsonObject
();
_redeem_json
[
"ver"
]
=
2
;
_redeem_json
[
"clientReqCount"
]
=
(
++
_clientReqCount
%=
10000000
);
_redeem_json
[
"reqtype"
]
=
71
;
//
_redeem_json["partnerId"] = _partner_id;
_redeem_json
[
"partnerId"
]
=
_partner_id
;
_redeem_json
[
"store_id"
]
=
_store_id
;
_redeem_json
[
"station_id"
]
=
_station_id
;
_redeem_json
[
"trans_id"
]
=
QString
::
number
(
QDateTime
::
currentDateTimeUtc
().
toTime_t
());
...
...
@@ -332,17 +334,6 @@ QJsonObject FMPRedeem::ShowForUnConsum(QJsonObject json)
QJsonArray
transactions
;
transaction
[
"code"
]
=
coupon
;
transaction
[
"ebcode"
]
=
ebcode
;
QJsonArray
products
;
for
(
int
i
=
0
;
i
<
_products_info
.
size
();
i
++
)
{
QJsonObject
product
;
product
.
insert
(
"seq"
,
i
+
1
);
product
.
insert
(
"pid"
,
_products_info
[
i
].
toObject
()[
"pid"
]);
product
.
insert
(
"consume_num"
,
_products_info
[
i
].
toObject
()[
"consume_num"
]);
products
.
append
(
product
);
}
transaction
[
"products"
]
=
products
;
transactions
.
append
(
transaction
);
_redeem_json
[
"transactions"
]
=
transactions
;
...
...
@@ -494,7 +485,6 @@ QByteArray FMPRedeem::CheckSendArray(QByteArray &jsonArray)
strLength
++
;
QByteArray
array
(
tmpBuf
);
return
array
;
}
...
...
fmp_redeem/version.h
View file @
10d384ee
...
...
@@ -5,7 +5,7 @@
#define VER_MINOR 1
#define VER_REVISION 0
#define VER_BUILD 9
5
#define VER_BUILD 9
6
//! Convert version numbers to string
#define _STR(S) #S
...
...
fmp_syncer/version.h
View file @
10d384ee
...
...
@@ -5,7 +5,7 @@
#define VER_MINOR 1
#define VER_REVISION 0
#define VER_BUILD 9
5
#define VER_BUILD 9
6
//! Convert version numbers to string
#define _STR(S) #S
...
...
fmprc.bat
View file @
10d384ee
...
...
@@ -47,6 +47,7 @@ for /f "tokens=1-3 delims=." %%h in ("%ver_tag%") do (
)
for /f %%i in ('git rev-list HEAD --count') do set ver_build=%%i
set ver_build=96
set version=%ver_maj%.%ver_min%.%ver_rev%
echo %version%
...
...
release/bins/FreemudPOS.exe
View file @
10d384ee
No preview for this file type
release/bins/FreemudPOS.ini
View file @
10d384ee
...
...
@@ -16,7 +16,7 @@ Level=0
[Home]
Server
=
http://115.159.226.87:20001/api/user/login
PartnerId
=
1739
StoreId
=
SH05
8
StoreId
=
9
8
PosId
=
01
Position
=
2586, 177
CashierId
=
001
...
...
release/bins/FreemudSyncer.exe
View file @
10d384ee
No preview for this file type
release/bins/server_url.ini
View file @
10d384ee
[Home]
PartnerId
=
1
739
PartnerId
=
1
946
[Pay]
Server
=
"http://115.159.
119.32:27935/api?partner=yhdw
"
Server
=
"http://115.159.
65.101:8001/api
"
Timeout
=
60
[Coupon]
Server
=
http://115.159.142.32/api
RedeemLog
=
http://115.159.119.32:27935/getRedeemLog
\ No newline at end of file
RedeemLog
=
http://couponbackstage.freemudvip.com:8111/report/getLogList
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment