config.ts 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. export class config {
  2. //为小程序ID,后台生成
  3. public static app_name = '卿卿小屋'
  4. public static applet_id = '10000' //wx_卿卿小屋:10001
  5. public static theme_color = '#2979ff'
  6. /**
  7. * 平台
  8. */
  9. public static Platform = {
  10. WEIXIN :"WEIXIN",
  11. TOUTIAO: "TOUTIAO",
  12. H5:"H5"
  13. }
  14. /**
  15. * 日志开关
  16. */
  17. public static LOG_OPEN:boolean = true
  18. /**
  19. * 测试开关
  20. */
  21. public static isTest:boolean = true
  22. /**
  23. * 缓存数据的key
  24. */
  25. public static stores_key = {
  26. USER_DATA: "USER_DATA",
  27. }
  28. /**
  29. * 本地数据的key
  30. */
  31. public static storage_key = {
  32. USER_DATA: "USER_DATA",
  33. BOOKSHELF_LIST: "BOOKSHELF_LIST",
  34. READ_SETTING: "READ_SETTING",
  35. READ_HISTORY: "READ_HISTORY",
  36. }
  37. /**
  38. * 事件类型
  39. */
  40. public static EVENT_TYPE = {
  41. UPDATE_BOOKSHELF: "EVENT_TYPE_UPDATE_BOOKSHELF", //更新书架
  42. UPDATE_READHISTORY: "EVENT_UPDATE_READHISTORY", //更新阅读历史
  43. }
  44. /**
  45. * 测试域名
  46. */
  47. private static URL_DEBUG = {
  48. Dynamic:"https://bookapi.hainanmlwl.com",
  49. Static:"https://zaoca.oss-accelerate.aliyuncs.com"
  50. }
  51. /**
  52. * 正式域名
  53. */
  54. private static URL_RELEASE = {
  55. Dynamic:"http://",
  56. Static:"http://"
  57. }
  58. /**
  59. * 域名
  60. */
  61. public static url_addr= {
  62. Dynamic:config.isTest?config.URL_DEBUG.Dynamic:config.URL_RELEASE.Dynamic, //动态接口
  63. Static:config.isTest?config.URL_DEBUG.Static:config.URL_RELEASE.Static //静态接口
  64. }
  65. /**
  66. * 接口
  67. */
  68. public static url_confg = {
  69. /**
  70. * 动态
  71. */
  72. Dynamic:{
  73. user_get_douyin_openid:'/user/get_douyin_openid',
  74. user_get_wx_open_id:'/user/get_wx_open_id',
  75. user_login:'/user/login',
  76. },
  77. /**
  78. * 静态
  79. */
  80. Static:{
  81. book_details(book_id:number) {
  82. return config.url_addr.Static + `/bookstatic/book/${book_id}.json`
  83. },
  84. /**
  85. * stype 类型 1 章节页面 2 vip充值页面 3 充书币页面
  86. */
  87. get_recharge_list(stype:number){
  88. return config.url_addr.Static + `/bookstatic/recharge/${config.applet_id}_${stype}.json`
  89. }
  90. },
  91. StatesCode:{
  92. SUCCESS:10000,
  93. }
  94. }
  95. public static read_config = {
  96. colorList:['#f3a73f', '#adff2f','#b0c4de','#cd5c5c','#3B4144'],
  97. lineHeight:1.8,
  98. fontSizeList:[12,14,16,18,20,22,24],
  99. readMode:{
  100. Bright:1,
  101. Dark:2
  102. },
  103. BrightFontColor:'#000000', //光亮模式下的字体颜色
  104. DarkFontColor:`#ffffff`, //黑暗模式下的字体颜色
  105. BrightDbColor:`#ffffff`, //光亮模式下的底板颜色
  106. DarkDbColor:`#000000` //黑暗模式下的底板颜色
  107. }
  108. public static recharge_stype = {
  109. CHAPTER_PAGE:1, //1 章节页面
  110. VIP_RECHARGE:2, //2 vip充值页面
  111. BOOK_COIN_PAGE:3, //3 充书币页面
  112. }
  113. /**
  114. * 支付类型 1 抖音支付 2 微信支付 3 内部充值(内部测试)
  115. */
  116. public static pay_type = {
  117. DOU_YIN:1, //抖音支付
  118. WEI_XIN:2, //微信支付
  119. NEI_BU:3, //内部充值
  120. }
  121. }