V.AISTUDIO / INJECT_QUOTE_SCRIPTS.md
bep40's picture
Add instructions for injecting quote scripts
a94ad2f verified
|
Raw
History Blame
2.05 kB

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

  1. Vào https://huggingface.co/spaces/bep40/V.AISTUDIO/settings
  2. Nhấn nút "Rebuild" hoặc "Factory rebuild"
  3. Đợi khoảng 2-3 phút để Space khởi động lại

Bước 5: Kiểm tra tính năng

  1. Mở Space: https://bep40-v-aistudio.static.hf.space
  2. Thêm sản phẩm vào giỏ hàng
  3. Mở giỏ hàng (icon giỏ hàng trên header)
  4. Nhấn "Báo giá"
  5. Nhập mã V.AISTUDIO vào ô "Mã truy cập"
  6. 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.html hiệ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