config.ts 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. export class config {
  2. //为小程序ID,后台生成
  3. public static app_name = '卿卿小屋'
  4. public static applet_id = '10000' //douyin_卿卿小屋: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. READ_RECORD: "READ_RECORD",
  37. }
  38. /**
  39. * 事件类型
  40. */
  41. public static EVENT_TYPE = {
  42. USER_LOGIN_SUCCESS: "EVENT_TYPE_USER_LOGIN_SUCCESS", //用户登录成功
  43. UPDATE_BOOKSHELF: "EVENT_TYPE_UPDATE_BOOKSHELF", //更新书架
  44. UPDATE_READHISTORY: "EVENT_UPDATE_READHISTORY", //更新阅读历史
  45. }
  46. /**
  47. * 测试域名
  48. */
  49. private static URL_DEBUG = {
  50. Dynamic:"https://bookapi.hainanmlwl.com",
  51. Static:"https://zaoca.oss-accelerate.aliyuncs.com"
  52. }
  53. /**
  54. * 正式域名
  55. */
  56. private static URL_RELEASE = {
  57. Dynamic:"http://",
  58. Static:"http://"
  59. }
  60. /**
  61. * 域名
  62. */
  63. public static url_addr= {
  64. Dynamic:config.isTest?config.URL_DEBUG.Dynamic:config.URL_RELEASE.Dynamic, //动态接口
  65. Static:config.isTest?config.URL_DEBUG.Static:config.URL_RELEASE.Static //静态接口
  66. }
  67. /**
  68. * 接口
  69. */
  70. public static url_confg = {
  71. /**
  72. * 动态
  73. */
  74. Dynamic:{
  75. user_get_douyin_openid:'/user/get_douyin_openid',
  76. user_get_wx_open_id:'/user/get_wx_open_id',
  77. user_login:'/user/login',
  78. books_shelf:'/book/books_shelf',
  79. recharge:{
  80. /**
  81. * 充值
  82. */
  83. order_buy:'/order/buy',
  84. order_info:'/order/info',
  85. },
  86. buy_chapter:'/book/buy_chapter', //购买书籍
  87. get_user_chapter_ids:'/book/get_user_chapter_ids', //购买书籍章节记录
  88. user_info:'/user/info', //用户详情
  89. reset:'/user/reset', //重置用户
  90. },
  91. /**
  92. * 静态
  93. */
  94. Static:{
  95. book_details(book_id:number) {
  96. return config.url_addr.Static + `/bookstatic/book/${book_id}.json`
  97. },
  98. get_recharge_list(stype:number){
  99. /**
  100. * stype 类型 1 章节页面 2 vip充值页面 3 充书币页面
  101. */
  102. return config.url_addr.Static + `/bookstatic/recharge/${config.applet_id}_${stype}.json`
  103. }
  104. },
  105. StatesCode:{
  106. SUCCESS:10000,
  107. }
  108. }
  109. public static read_config = {
  110. colorList:['#f3a73f', '#adff2f','#b0c4de','#cd5c5c','#3B4144'],
  111. lineHeight:1.8,
  112. fontSizeList:[12,14,16,18,20,22,24],
  113. readMode:{
  114. Bright:1,
  115. Dark:2
  116. },
  117. BrightFontColor:'#000000', //光亮模式下的字体颜色
  118. DarkFontColor:`#ffffff`, //黑暗模式下的字体颜色
  119. BrightDbColor:`#ffffff`, //光亮模式下的底板颜色
  120. DarkDbColor:`#000000` //黑暗模式下的底板颜色
  121. }
  122. public static recharge_stype = {
  123. CHAPTER_PAGE:1, //1 章节页面
  124. VIP_RECHARGE:2, //2 vip充值页面
  125. BOOK_COIN_PAGE:3, //3 充书币页面
  126. }
  127. /**
  128. * 支付类型 1 抖音支付 2 微信支付 3 内部充值(内部测试)
  129. */
  130. public static pay_type = {
  131. DOU_YIN:1, //抖音支付
  132. WEI_XIN:2, //微信支付
  133. NEI_BU:3, //内部充值
  134. }
  135. /**
  136. * 是否收费 1 收费 0 免费
  137. */
  138. public static chapter_pay_type = {
  139. SHOU_FEI:1, //收费
  140. BU_SHOU_FEI:0, //不收费
  141. }
  142. /**
  143. * 订单状态 1 支付中 2 已经支付
  144. */
  145. public static order_status = {
  146. ZHI_FUZHIONG:1, //支付中
  147. YI_JING_ZHI_FU:2, //已经支付
  148. }
  149. }