flexbiz-server 12.5.28 → 12.5.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/server/controllers/findHandler.js +2 -2
- package/server/controllers/viewHandler.js +252 -13
- package/server/libs/joinData.js +2 -2
- package/server/libs/post-sokho.js +23 -351
- package/server/models/csphucap.js +2 -0
- package/server/models/dmbp.js +2 -2
- package/server/models/pcl.js +1 -1
- package/server/models/ptl.js +1 -2
- package/server/modules/lists/ls-checkin.js +24 -336
- package/server/modules/lists/ls-csphucap.js +1 -0
- package/server/modules/reports/calc-tinhluong.js +25 -22
- package/server/modules/reports/rp-sctluong.js +5 -3
- package/server/modules/vouchers/vo-hd2.js +82 -81
- package/server/modules/vouchers/vo-pcl.js +3 -3
- package/server/modules/vouchers/vo-ptl.js +4 -4
- package/server/templates/product-verify-result.ejs +205 -11
|
@@ -5,6 +5,31 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
|
6
6
|
<title>Kết quả xác thực sản phẩm</title>
|
|
7
7
|
<style>
|
|
8
|
+
/* Style cho trường hợp không có ảnh */
|
|
9
|
+
.no-image-box {
|
|
10
|
+
width: 100%;
|
|
11
|
+
height: 100%;
|
|
12
|
+
background-color: #f0f2f5;
|
|
13
|
+
border-radius: 10px;
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
align-items: center;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
color: #95a5a6;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.no-image-icon {
|
|
22
|
+
width: 48px;
|
|
23
|
+
height: 48px;
|
|
24
|
+
margin-bottom: 8px;
|
|
25
|
+
opacity: 0.5;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.no-image-text {
|
|
29
|
+
font-size: 12px;
|
|
30
|
+
font-weight: 500;
|
|
31
|
+
}
|
|
32
|
+
|
|
8
33
|
:root {
|
|
9
34
|
--color-success: #2ecc71;
|
|
10
35
|
--color-warning: #f39c12;
|
|
@@ -163,6 +188,121 @@
|
|
|
163
188
|
.theme-WARNING .status-header { background-color: var(--color-warning); }
|
|
164
189
|
.theme-FAKE .status-header { background-color: var(--color-danger); }
|
|
165
190
|
|
|
191
|
+
|
|
192
|
+
/* Tiêu đề các section nhỏ */
|
|
193
|
+
.section-label {
|
|
194
|
+
font-size: 13px;
|
|
195
|
+
text-transform: uppercase;
|
|
196
|
+
color: #95a5a6;
|
|
197
|
+
font-weight: 700;
|
|
198
|
+
letter-spacing: 0.5px;
|
|
199
|
+
margin-bottom: 10px;
|
|
200
|
+
margin-top: 20px;
|
|
201
|
+
padding-left: 5px;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/* Container chứa nội dung mô tả */
|
|
205
|
+
.product-desc-box {
|
|
206
|
+
text-align: left;
|
|
207
|
+
background: #fdfdfd;
|
|
208
|
+
padding: 15px;
|
|
209
|
+
border-radius: 12px;
|
|
210
|
+
border: 1px dashed #dcdcdc;
|
|
211
|
+
margin-top: 15px;
|
|
212
|
+
color: #555;
|
|
213
|
+
font-size: 14px;
|
|
214
|
+
overflow-x: hidden; /* Ngăn tràn ngang */
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/* --- Style cho các thẻ HTML bên trong mô tả --- */
|
|
218
|
+
|
|
219
|
+
/* Đảm bảo ảnh không bao giờ to hơn màn hình điện thoại */
|
|
220
|
+
.product-desc-box img {
|
|
221
|
+
max-width: 100% !important;
|
|
222
|
+
height: auto !important;
|
|
223
|
+
border-radius: 8px;
|
|
224
|
+
margin: 10px 0;
|
|
225
|
+
display: block;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/* Khoảng cách giữa các đoạn văn */
|
|
229
|
+
.product-desc-box p {
|
|
230
|
+
margin-bottom: 10px;
|
|
231
|
+
line-height: 1.6;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/* Style cho danh sách (ul, ol) */
|
|
235
|
+
.product-desc-box ul, .product-desc-box ol {
|
|
236
|
+
margin-left: 20px;
|
|
237
|
+
margin-bottom: 10px;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.product-desc-box li {
|
|
241
|
+
margin-bottom: 5px;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/* Style cho các thẻ Heading h1, h2, h3 trong bài viết */
|
|
245
|
+
.product-desc-box h1,
|
|
246
|
+
.product-desc-box h2,
|
|
247
|
+
.product-desc-box h3 {
|
|
248
|
+
font-size: 16px;
|
|
249
|
+
font-weight: bold;
|
|
250
|
+
color: #333;
|
|
251
|
+
margin-top: 15px;
|
|
252
|
+
margin-bottom: 8px;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.product-desc-box a {
|
|
256
|
+
color: #3498db;
|
|
257
|
+
text-decoration: underline;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/* Thông tin công ty */
|
|
261
|
+
.company-card {
|
|
262
|
+
background: white;
|
|
263
|
+
margin: 20px 20px 0 20px;
|
|
264
|
+
padding: 20px;
|
|
265
|
+
border-radius: 15px;
|
|
266
|
+
box-shadow: 0 4px 15px rgba(0,0,0,0.03);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.company-name {
|
|
270
|
+
font-size: 16px;
|
|
271
|
+
font-weight: 700;
|
|
272
|
+
color: var(--color-text);
|
|
273
|
+
margin-bottom: 12px;
|
|
274
|
+
padding-bottom: 10px;
|
|
275
|
+
border-bottom: 1px solid #f0f0f0;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.info-row {
|
|
279
|
+
display: flex;
|
|
280
|
+
align-items: flex-start; /* Canh lề trên nếu text dài */
|
|
281
|
+
margin-bottom: 12px;
|
|
282
|
+
font-size: 14px;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.info-row:last-child { margin-bottom: 0; }
|
|
286
|
+
|
|
287
|
+
.info-icon {
|
|
288
|
+
flex-shrink: 0;
|
|
289
|
+
width: 18px;
|
|
290
|
+
height: 18px;
|
|
291
|
+
margin-right: 10px;
|
|
292
|
+
color: #3498db; /* Màu xanh dương cho icon thông tin */
|
|
293
|
+
margin-top: 2px;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.info-content {
|
|
297
|
+
color: #333;
|
|
298
|
+
word-break: break-word; /* Xuống dòng nếu link quá dài */
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.info-content a {
|
|
302
|
+
color: #2980b9;
|
|
303
|
+
text-decoration: none;
|
|
304
|
+
}
|
|
305
|
+
|
|
166
306
|
</style>
|
|
167
307
|
</head>
|
|
168
308
|
<body class="theme-<%= status %>">
|
|
@@ -189,12 +329,31 @@
|
|
|
189
329
|
</div>
|
|
190
330
|
|
|
191
331
|
<% if (status !== 'FAKE' && typeof product !== 'undefined') { %>
|
|
332
|
+
|
|
192
333
|
<div class="product-card">
|
|
193
334
|
<div class="product-image-wrapper">
|
|
194
|
-
|
|
335
|
+
<% if (product.picture && product.picture.trim() !== '') { %>
|
|
336
|
+
<img src="<%= product.picture %>" alt="<%= product.ten_vt %>" class="product-image" onerror="this.style.display='none'; this.nextElementSibling.style.display='flex'">
|
|
337
|
+
<div class="no-image-box" style="display: none;">
|
|
338
|
+
<svg class="no-image-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><circle cx="8.5" cy="8.5" r="1.5"></circle><polyline points="21 15 16 10 5 21"></polyline></svg>
|
|
339
|
+
<span class="no-image-text">Không có ảnh</span>
|
|
340
|
+
</div>
|
|
341
|
+
<% } else { %>
|
|
342
|
+
<div class="no-image-box">
|
|
343
|
+
<svg class="no-image-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><circle cx="8.5" cy="8.5" r="1.5"></circle><polyline points="21 15 16 10 5 21"></polyline></svg>
|
|
344
|
+
<span class="no-image-text">Chưa cập nhật ảnh</span>
|
|
345
|
+
</div>
|
|
346
|
+
<% } %>
|
|
195
347
|
</div>
|
|
348
|
+
|
|
196
349
|
<h2 class="product-name"><%= product.ten_vt %></h2>
|
|
197
350
|
<span class="product-code">Mã SP: <%= product.ma_vt %></span>
|
|
351
|
+
|
|
352
|
+
<% if (product.mieu_ta && product.mieu_ta.trim() !== '') { %>
|
|
353
|
+
<div class="product-desc-box">
|
|
354
|
+
<%- product.mieu_ta %>
|
|
355
|
+
</div>
|
|
356
|
+
<% } %>
|
|
198
357
|
</div>
|
|
199
358
|
|
|
200
359
|
<div class="detail-box">
|
|
@@ -204,24 +363,59 @@
|
|
|
204
363
|
<span class="value"><%= scanCount %> lần</span>
|
|
205
364
|
</div>
|
|
206
365
|
<% } %>
|
|
207
|
-
|
|
208
366
|
<div class="detail-row">
|
|
209
367
|
<span class="label">Ngày xác thực:</span>
|
|
210
368
|
<span class="value"><%= new Date().toLocaleDateString('vi-VN') %></span>
|
|
211
369
|
</div>
|
|
212
|
-
<div class="detail-row">
|
|
213
|
-
<span class="label">Serial:</span>
|
|
214
|
-
<span class="value">...</span>
|
|
215
|
-
</div>
|
|
216
370
|
</div>
|
|
371
|
+
|
|
372
|
+
<% if (typeof company !== 'undefined' && company) { %>
|
|
373
|
+
<div class="company-card">
|
|
374
|
+
<div class="section-label">Thông tin nhà cung cấp</div>
|
|
375
|
+
|
|
376
|
+
<% if (company.name) { %>
|
|
377
|
+
<div class="company-name"><%= company.name %></div>
|
|
378
|
+
<% } %>
|
|
379
|
+
|
|
380
|
+
<% if (company.address) { %>
|
|
381
|
+
<div class="info-row">
|
|
382
|
+
<svg class="info-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"></path><circle cx="12" cy="10" r="3"></circle></svg>
|
|
383
|
+
<span class="info-content"><%= company.address %></span>
|
|
384
|
+
</div>
|
|
385
|
+
<% } %>
|
|
386
|
+
|
|
387
|
+
<% if (company.phone) { %>
|
|
388
|
+
<div class="info-row">
|
|
389
|
+
<svg class="info-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path></svg>
|
|
390
|
+
<span class="info-content">
|
|
391
|
+
<a href="tel:<%= company.phone %>"><b><%= company.phone %></b></a>
|
|
392
|
+
</span>
|
|
393
|
+
</div>
|
|
394
|
+
<% } %>
|
|
395
|
+
|
|
396
|
+
<% if (company.email) { %>
|
|
397
|
+
<div class="info-row">
|
|
398
|
+
<svg class="info-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"></path><polyline points="22,6 12,13 2,6"></polyline></svg>
|
|
399
|
+
<span class="info-content">
|
|
400
|
+
<a href="mailto:<%= company.email %>"><%= company.email %></a>
|
|
401
|
+
</span>
|
|
402
|
+
</div>
|
|
403
|
+
<% } %>
|
|
404
|
+
|
|
405
|
+
<% if (company.website) { %>
|
|
406
|
+
<div class="info-row">
|
|
407
|
+
<svg class="info-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="2" y1="12" x2="22" y2="12"></line><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"></path></svg>
|
|
408
|
+
<span class="info-content">
|
|
409
|
+
<a href="<%= company.website %>" target="_blank"><%= company.website %></a>
|
|
410
|
+
</span>
|
|
411
|
+
</div>
|
|
412
|
+
<% } %>
|
|
413
|
+
</div>
|
|
414
|
+
<% } %>
|
|
415
|
+
|
|
217
416
|
<% } %>
|
|
218
417
|
|
|
219
418
|
<div class="action-area">
|
|
220
|
-
<% if (status === 'GENUINE') { %>
|
|
221
|
-
<a href="#" class="btn" style="background: var(--color-success); color: white;">Xem chi tiết sản phẩm</a>
|
|
222
|
-
<% } else { %>
|
|
223
|
-
<a href="tel:1900xxxx" class="btn btn-support">Liên hệ hỗ trợ: 1900 xxxx</a>
|
|
224
|
-
<% } %>
|
|
225
419
|
<p style="margin-top: 15px; font-size: 12px; color: #999;">Hệ thống xác thực chống hàng giả</p>
|
|
226
420
|
</div>
|
|
227
421
|
|