Cách thêm script tags vào index.html
Bước 1: Tìm vị trí cần thêm
Trong file index.html, tìm dòng:
<script src="quote-ui.js?v=8"></script>
Bước 2: Thêm các dòng sau NGAY SAU dòng trên
<script src="vai-complete-quote.js?v=1"></script>
<script src="export-functions.js?v=1"></script>
Bước 3: Kiểm tra
Sau khi thêm, file index.html sẽ có các script tags này ở gần cuối (trước </body>):
<script src="url-added-live-loader.js?v=1019"></script>
<script src="order-store.js?v=19"></script>
<script src="quote-ui.js?v=8"></script>
<script src="vai-complete-quote.js?v=1"></script>
<script src="export-functions.js?v=1"></script>
<script src="qr-payment.js?v=25"></script>
...
Bước 4: Rebuild Space
- Vào https://huggingface.co/spaces/bep40/V.AISTUDIO/settings
- Nhấn nút "Rebuild" hoặc "Factory rebuild"
- Đợi khoảng 2-3 phút để Space khởi động lại
Bước 5: Kiểm tra tính năng
- Mở Space: https://bep40-v-aistudio.static.hf.space
- Thêm sản phẩm vào giỏ hàng
- Mở giỏ hàng (icon giỏ hàng trên header)
- Nhấn "Báo giá"
- Nhập mã
V.AISTUDIOvào ô "Mã truy cập" - Kiểm tra các nút:
- ✅ "Lưu" (saveOrder) - luôn hiện
- ✅ "Đơn hàng" (openOrderPage) - hiện sau khi nhập mã
- ✅ "Excel Giao" (exportDeliveryExcel) - hiện sau khi nhập mã
- ✅ "PDF Giao" (exportDeliveryPDF) - hiện sau khi nhập mã
Lưu ý quan trọng
- File
index.htmlhiện tại ~177KB, quá lớn để chỉnh sửa qua AI tools - Cần chỉnh sửa thủ công qua giao diện Hugging Face hoặc dùng Git
- Các file JS đã được tải lên và sẵn sàng:
vai-complete-quote.js,export-functions.js
Cách thêm nhanh qua Git
git clone https://huggingface.co/spaces/bep40/V.AISTUDIO
cd V.AISTUDIO
# Sửa file index.html, thêm 2 dòng script sau quote-ui.js
git add index.html
git commit -m "Add quote system scripts"
git push