model.go 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. package model
  2. // coupon use state.
  3. const (
  4. UseFaild int8 = iota
  5. UseSuccess
  6. )
  7. // coupon state.
  8. const (
  9. NotUsed = iota
  10. InUse
  11. Used
  12. Expire
  13. Block
  14. )
  15. // coupon state.
  16. const (
  17. WaitPay = iota
  18. InPay
  19. PaySuccess
  20. PayFaild
  21. )
  22. // max salary count.
  23. const (
  24. MaxSalaryCount = 100
  25. )
  26. // blance change type
  27. const (
  28. VipSalary int8 = iota + 1
  29. SystemAdminSalary
  30. Consume
  31. ConsumeFaildBack
  32. )
  33. // coupon type
  34. const (
  35. CouponVideo = iota + 1
  36. CouponCartoon
  37. CouponAllowance
  38. )
  39. //allowance origin
  40. const (
  41. AllowanceNone = iota
  42. AllowanceSystemAdmin
  43. AllowanceBusinessReceive
  44. AllowanceBusinessNewYear
  45. AllowanceCodeOpen
  46. )
  47. // batch state
  48. const (
  49. BatchStateNormal = iota
  50. BatchStateBlock
  51. )
  52. // coupon disables explains
  53. const (
  54. CouponHadBlock = "代金券已被冻结"
  55. CouponFullAmountDissatisfy = "未达到满额条件"
  56. CouponNotInUsableTime = "当前不在有效期内"
  57. CouponInUse = "已绑定在其他未支付订单,点击解锁"
  58. CouponPlatformExplain = "当前平台不可使用"
  59. CouponProductExplain = "当前商品不可使用"
  60. )
  61. // coupon scope explains
  62. const (
  63. ScopeNoLimit = "不限使用平台"
  64. ScopePlatFmt = "仅限%s端,"
  65. ScopeProductFmt = "购买%s%s大会员时使用"
  66. )
  67. // coupon send message
  68. const (
  69. ReceiveMessageTitle = "大会员代金券到账通知"
  70. ReceiveMessage = "大会员代金券已到账,快到“我的代金券”看看吧!IOS端需要在网页使用。#{传送门}{\"https://account.bilibili.com/account/big/voucher\"}"
  71. )
  72. // device code
  73. const (
  74. DeviceIOS int = iota + 1
  75. DeviceIPAD
  76. DevicePC
  77. DeviceANDROID
  78. DeviceIPADHD
  79. DeviceIOSBLUE
  80. DeviceANDROIDBLUE
  81. DevicePUBLIC
  82. )
  83. // PlatformByCode device name map.
  84. var PlatformByCode = map[int]string{
  85. DeviceIOS: "ios",
  86. DeviceIPAD: "ipad",
  87. DevicePC: "网页",
  88. DeviceANDROID: "Android",
  89. }
  90. // coupon format
  91. const (
  92. CouponFullAmountLimit = "满%s元可用"
  93. CouponAllowanceName = "大会员代金券"
  94. )
  95. // coupon seleted
  96. const (
  97. Seleted = 1
  98. )
  99. // allowance change type
  100. const (
  101. AllowanceSalary int8 = iota + 1
  102. AllowanceConsume
  103. AllowanceCancel
  104. AllowanceConsumeSuccess
  105. AllowanceConsumeFaild
  106. AllowanceReceive
  107. )
  108. // allowance notify pay status
  109. const (
  110. AllowanceUseFaild int8 = iota
  111. AllowanceUseSuccess
  112. )
  113. // allowance able state
  114. const (
  115. AllowanceDisables int8 = iota
  116. AllowanceUsable
  117. )
  118. //PlatformByName .
  119. var PlatformByName = map[string]int{
  120. "ios": DeviceIOS,
  121. "ios_b": DeviceIOS,
  122. "ipad": DeviceIPAD,
  123. "ipadhd": DeviceIPAD,
  124. "pc": DevicePC,
  125. "public": DevicePC,
  126. "android": DeviceANDROID,
  127. "android_b": DeviceANDROID,
  128. }
  129. //PlatfromMapping .
  130. var PlatfromMapping = map[int]int{
  131. DeviceIPADHD: DeviceIPAD,
  132. DeviceIOSBLUE: DeviceIOS,
  133. DeviceANDROIDBLUE: DeviceANDROID,
  134. DevicePUBLIC: DevicePC,
  135. }
  136. // coupon tip.
  137. const (
  138. CouponTipNotUse = "不使用代金券"
  139. CouponTipChooseOther = "选中其他商品有惊喜"
  140. CouponTipUse = "抵扣%.2f元"
  141. CouponTipInUse = "有代金券被锁定"
  142. )