Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
A
Aqbits Trace Code
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mai Thanh Cong
Aqbits Trace Code
Commits
45c3aa7d
Commit
45c3aa7d
authored
Jul 12, 2021
by
Mai Thanh Cong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace Qr code in table
parent
bf4b5526
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
12 deletions
+32
-12
src/components/Profile/AddProfile.js
src/components/Profile/AddProfile.js
+0
-2
src/views/IndexSections/Table.js
src/views/IndexSections/Table.js
+32
-10
No files found.
src/components/Profile/AddProfile.js
View file @
45c3aa7d
...
...
@@ -27,8 +27,6 @@ const AddProfile = () => {
const
[
profileAddress
,
setProfileAddress
]
=
useState
(
profileId
?
detailProfile
.
address
:
""
);
const
[
validPhoneNumber
,
setValidPhoneNumber
]
=
useState
(
false
);
console
.
log
(
"
phoneNumber
"
,
typeof
(
phoneNumber
));
const
onHandleBack
=
()
=>
{
history
.
push
(
"
/
"
);
}
...
...
src/views/IndexSections/Table.js
View file @
45c3aa7d
...
...
@@ -6,6 +6,7 @@ import {
UncontrolledDropdown
,
DropdownToggle
,
DropdownMenu
,
DropdownItem
,
Pagination
,
PaginationItem
,
PaginationLink
,
Modal
,
ModalHeader
,
ModalBody
,
ModalFooter
,
Form
,
FormGroup
,
Label
,
InputGroup
,
InputGroupAddon
,
InputGroupText
,
Input
}
from
"
reactstrap
"
;
import
QRCode
from
'
qrcode.react
'
;
import
{
profileFormatDateTime
}
from
"
constans
"
;
export
const
ProfileTable
=
(
props
)
=>
{
...
...
@@ -71,7 +72,7 @@ export const ProfileTable = (props) => {
let
count
=
0
;
const
TableRow
=
(
props
)
=>
{
const
{
id
,
address
,
logo
,
name
,
phone_number
,
profile_product
,
created_at
,
qr_
code
}
=
props
;
const
{
id
,
address
,
logo
,
name
,
phone_number
,
profile_product
,
created_at
,
code
}
=
props
;
count
++
;
const
productName
=
profile_product
?
profile_product
.
map
(
item
=>
item
.
name
)
:
[];
...
...
@@ -84,12 +85,23 @@ export const ProfileTable = (props) => {
<
tr
>
<
th
scope
=
"
row
"
>
{
count
}
<
/th
>
<
td
>
{
name
}
<
/td
>
<
td
><
img
src
=
{
window
.
location
.
origin
+
logo
}
alt
=
"
logo
"
width
=
{
100
}
height
=
{
50
}
/></
td
>
<
td
>
{
phone_number
}
<
/td
>
<
td
>
{
address
}
<
/td
>
<
td
dangerouslySetInnerHTML
=
{{
__html
:
listProductName
}}
><
/td
>
<
td
>
{
created_at
?
profileFormatDateTime
(
created_at
)
:
""
}
<
/td
>
<
td
><
img
src
=
{
window
.
location
.
origin
+
qr_code
}
alt
=
"
qr-code
"
width
=
{
50
}
height
=
{
50
}
/></
td
>
<
td
>
<
QRCode
size
=
{
120
}
includeMargin
value
=
{
`http://trace.aqbits.net/
${
code
}
`
}
imageSettings
=
{{
width
:
60
,
height
:
40
,
src
:
window
.
location
.
origin
+
logo
,
excavate
:
true
,
}}
/
>
<
/td
>
<
td
key
=
{
id
}
>
<
UncontrolledDropdown
nav
>
<
DropdownToggle
nav
>
...
...
@@ -127,7 +139,6 @@ export const ProfileTable = (props) => {
<
tr
>
<
th
>
{
"
STT
"
}
<
/th
>
<
th
>
{
"
Tên doanh nghiệp
"
}
<
/th
>
<
th
>
{
"
Logo
"
}
<
/th
>
<
th
>
{
"
Số điện thoại
"
}
<
/th
>
<
th
>
{
"
Địa chỉ
"
}
<
/th
>
<
th
>
{
"
Tên sản phẩm
"
}
<
/th
>
...
...
@@ -144,7 +155,7 @@ export const ProfileTable = (props) => {
<
Col
>
<
nav
>
<
Pagination
aria
-
label
=
"
Page navigation example
"
>
<
PaginationItem
>
<
PaginationItem
disabled
=
{
props
.
currentPage
===
1
}
>
<
PaginationLink
first
href
=
"
#
"
/>
<
/PaginationItem
>
<
PaginationItem
disabled
=
{
props
.
currentPage
===
1
}
onClick
=
{
onPrevItem
}
>
...
...
@@ -154,7 +165,7 @@ export const ProfileTable = (props) => {
<
PaginationItem
disabled
=
{
props
.
currentPage
===
Math
.
ceil
(
pageSize
)}
onClick
=
{
onNextItem
}
>
<
PaginationLink
next
href
=
"
#
"
/>
<
/PaginationItem
>
<
PaginationItem
>
<
PaginationItem
disabled
=
{
props
.
currentPage
===
Math
.
ceil
(
pageSize
)}
>
<
PaginationLink
last
href
=
"
#
"
/>
<
/PaginationItem
>
<
/Pagination
>
...
...
@@ -237,8 +248,20 @@ export const ProductTable = (props) => {
<
td
>
{
origin
}
<
/td
>
<
td
>
{
description
}
<
/td
>
<
td
>
{
growing_conditions
}
<
/td
>
<
td
><
img
src
=
{
window
.
location
.
origin
+
image
}
alt
=
"
product
"
width
=
{
50
}
height
=
{
50
}
/></
td
>
<
td
><
img
src
=
{
window
.
location
.
origin
+
qr_code
}
alt
=
"
qr-code
"
width
=
{
50
}
height
=
{
50
}
/></
td
>
<
td
>
<
QRCode
size
=
{
120
}
includeMargin
value
=
{
`http://trace.aqbits.net/trace-code/
${
qr_code
}
`
}
imageSettings
=
{{
width
:
60
,
height
:
40
,
src
:
window
.
location
.
origin
+
image
,
excavate
:
true
,
}}
/
>
{
/* <img src={window.location.origin + qr_code} alt="qr-code" width={50} height={50} /> */
}
<
/td
>
<
td
>
{
created_at
?
profileFormatDateTime
(
created_at
)
:
""
}
<
/td
>
<
td
key
=
{
product_id
}
>
<
UncontrolledDropdown
nav
>
...
...
@@ -282,7 +305,6 @@ export const ProductTable = (props) => {
<
th
>
{
"
Xuất xứ
"
}
<
/th
>
<
th
>
{
"
Mô tả
"
}
<
/th
>
<
th
>
{
"
Điều kiện nuôi trồng
"
}
<
/th
>
<
th
>
{
"
Ảnh
"
}
<
/th
>
<
th
>
{
"
QR code
"
}
<
/th
>
<
th
>
{
"
Ngày tạo
"
}
<
/th
>
<
th
><
/th
>
...
...
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