Add product features, Heleket crypto payments and order status icons.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package orderstatus
|
||||
|
||||
type Info struct {
|
||||
Icon string
|
||||
Label string
|
||||
Class string
|
||||
Step int
|
||||
@@ -8,17 +9,17 @@ type Info struct {
|
||||
}
|
||||
|
||||
var statuses = map[string]Info{
|
||||
"pending": {Label: "В ожидании", Class: "status--pending", Step: 1},
|
||||
"unpaid": {Label: "Не оплачено", Class: "status--unpaid", Step: 1},
|
||||
"paid": {Label: "Оплачено", Class: "status--paid", Step: 2},
|
||||
"processing": {Label: "В обработке", Class: "status--processing", Step: 3},
|
||||
"shipped": {Label: "Отправлен", Class: "status--shipped", Step: 4},
|
||||
"delivered": {Label: "Доставлен", Class: "status--delivered", Step: 5},
|
||||
"cancelled": {Label: "Отменён", Class: "status--cancelled", Step: 0, Terminal: true},
|
||||
"refunded": {Label: "Возврат", Class: "status--refunded", Step: 0, Terminal: true},
|
||||
"pending": {Icon: "⏳", Label: "В ожидании", Class: "status--pending", Step: 1},
|
||||
"unpaid": {Icon: "💳", Label: "Не оплачено", Class: "status--unpaid", Step: 1},
|
||||
"paid": {Icon: "✓", Label: "Оплачено", Class: "status--paid", Step: 2},
|
||||
"processing": {Icon: "⚙", Label: "В обработке", Class: "status--processing", Step: 3},
|
||||
"shipped": {Icon: "📦", Label: "Отправлен", Class: "status--shipped", Step: 4},
|
||||
"delivered": {Icon: "✓", Label: "Доставлен", Class: "status--delivered", Step: 5},
|
||||
"cancelled": {Icon: "✕", Label: "Отменён", Class: "status--cancelled", Step: 0, Terminal: true},
|
||||
"refunded": {Icon: "↩", Label: "Возврат", Class: "status--refunded", Step: 0, Terminal: true},
|
||||
// совместимость со старыми заказами
|
||||
"new": {Label: "В ожидании", Class: "status--pending", Step: 1},
|
||||
"confirmed": {Label: "Оплачено", Class: "status--paid", Step: 2},
|
||||
"new": {Icon: "⏳", Label: "В ожидании", Class: "status--pending", Step: 1},
|
||||
"confirmed": {Icon: "✓", Label: "Оплачено", Class: "status--paid", Step: 2},
|
||||
}
|
||||
|
||||
// Timeline — основной путь доставки (для таймлайна в кабинете)
|
||||
@@ -47,8 +48,9 @@ func Get(code string) Info {
|
||||
return Info{Label: code, Class: "status--pending", Step: 1}
|
||||
}
|
||||
|
||||
func Label(code string) string { return Get(code).Label }
|
||||
func Class(code string) string { return Get(code).Class }
|
||||
func Label(code string) string { return Get(code).Label }
|
||||
func Icon(code string) string { return Get(code).Icon }
|
||||
func Class(code string) string { return Get(code).Class }
|
||||
func Step(code string) int { return Get(code).Step }
|
||||
func IsTerminal(code string) bool { return Get(code).Terminal }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user