config.ts 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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. * douyin_卿卿小屋:10000 wx_卿卿小屋:10001
  8. */
  9. public static applet_id_config = {
  10. wx:'10001',
  11. dy:'10000'
  12. }
  13. /**
  14. * 平台
  15. */
  16. public static Platform = {
  17. WEIXIN :"WEIXIN",
  18. TOUTIAO: "TOUTIAO",
  19. H5:"H5"
  20. }
  21. /**
  22. * 日志开关
  23. */
  24. public static LOG_OPEN:boolean = true
  25. /**
  26. * 测试开关
  27. */
  28. public static isTest:boolean = true
  29. /**
  30. * 缓存数据的key
  31. */
  32. public static stores_key = {
  33. USER_DATA: "USER_DATA",
  34. }
  35. /**
  36. * 本地数据的key
  37. */
  38. public static storage_key = {
  39. USER_DATA: "USER_DATA",
  40. BOOKSHELF_LIST: "BOOKSHELF_LIST",
  41. READ_SETTING: "READ_SETTING",
  42. READ_HISTORY: "READ_HISTORY",
  43. READ_RECORD: "READ_RECORD",
  44. }
  45. /**
  46. * 事件类型
  47. */
  48. public static EVENT_TYPE = {
  49. USER_LOGIN_SUCCESS: "EVENT_TYPE_USER_LOGIN_SUCCESS", //用户登录成功
  50. UPDATE_BOOKSHELF: "EVENT_TYPE_UPDATE_BOOKSHELF", //更新书架
  51. UPDATE_READHISTORY: "EVENT_UPDATE_READHISTORY", //更新阅读历史
  52. }
  53. /**
  54. * 测试域名
  55. */
  56. private static URL_DEBUG = {
  57. Dynamic:"https://bookapi.hainanmlwl.com",
  58. Static:"https://zaoca.oss-accelerate.aliyuncs.com"
  59. }
  60. /**
  61. * 正式域名
  62. */
  63. private static URL_RELEASE = {
  64. Dynamic:"http://",
  65. Static:"http://"
  66. }
  67. /**
  68. * 域名
  69. */
  70. public static url_addr= {
  71. Dynamic:config.isTest?config.URL_DEBUG.Dynamic:config.URL_RELEASE.Dynamic, //动态接口
  72. Static:config.isTest?config.URL_DEBUG.Static:config.URL_RELEASE.Static //静态接口
  73. }
  74. /**
  75. * 接口
  76. */
  77. public static url_confg = {
  78. /**
  79. * 动态
  80. */
  81. Dynamic:{
  82. user_get_douyin_openid:'/user/get_douyin_openid',
  83. user_get_wx_open_id:'/user/get_wx_open_id',
  84. user_login:'/user/login',
  85. books_shelf:'/book/books_shelf',
  86. recharge:{
  87. /**
  88. * 充值
  89. */
  90. order_buy:'/order/buy',
  91. order_info:'/order/info',
  92. },
  93. buy_chapter:'/book/buy_chapter', //购买书籍
  94. get_user_chapter_ids:'/book/get_user_chapter_ids', //购买书籍章节记录
  95. user_info:'/user/info', //用户详情
  96. reset:'/user/reset', //重置用户
  97. },
  98. /**
  99. * 静态
  100. */
  101. Static:{
  102. book_store: config.url_addr.Static + `/bookstatic/store/${config.applet_id}.json`, //书城
  103. book_details(book_id:number) {
  104. return config.url_addr.Static + `/bookstatic/book/${book_id}.json`
  105. },
  106. get_recharge_list(stype:number){
  107. /**
  108. * stype 类型 1 章节页面 2 vip充值页面 3 充书币页面
  109. */
  110. return config.url_addr.Static + `/bookstatic/recharge/${config.applet_id}_${stype}.json`
  111. }
  112. },
  113. StatesCode:{
  114. SUCCESS:10000,
  115. }
  116. }
  117. public static read_config = {
  118. colorList:['#ffffff', '#e6e1d6','#f5d6d6','#dce5d3','#d7dde3'],
  119. lineHeight:1.8,
  120. fontSizeList:[12,14,16,18,20,22,24],
  121. readMode:{
  122. Bright:1,
  123. Dark:2
  124. },
  125. BrightFontColor:'#404040', //光亮模式下的字体颜色
  126. DarkFontColor:`#ffffff`, //黑暗模式下的字体颜色
  127. BrightDbColor:`#ffffff`, //光亮模式下的底板颜色
  128. DarkDbColor:`#000000`, //黑暗模式下的底板颜色
  129. RedColor:'#FF4252',
  130. colorBgResList:[{on_res:'../../static/imgs/read/setting/read_bg/img_bg_bai_1.png',off_res:'../../static/imgs/read/setting/read_bg/img_bg_bai_0.png'},
  131. {on_res:'../../static/imgs/read/setting/read_bg/img_bg_he_1.png',off_res:'../../static/imgs/read/setting/read_bg/img_bg_he_0.png'},
  132. {on_res:'../../static/imgs/read/setting/read_bg/img_bg_fen_1.png',off_res:'../../static/imgs/read/setting/read_bg/img_bg_fen_0.png'},
  133. {on_res:'../../static/imgs/read/setting/read_bg/img_bg_lv_1.png',off_res:'../../static/imgs/read/setting/read_bg/img_bg_lv_0.png'},
  134. {on_res:'../../static/imgs/read/setting/read_bg/img_bg_hui_1.png',off_res:'../../static/imgs/read/setting/read_bg/img_bg_hui_0.png'}]
  135. }
  136. public static recharge_stype = {
  137. CHAPTER_PAGE:1, //1 章节页面
  138. VIP_RECHARGE:2, //2 vip充值页面
  139. BOOK_COIN_PAGE:3, //3 充书币页面
  140. }
  141. /**
  142. * 支付类型 1 抖音支付 2 微信支付 3 内部充值(内部测试)
  143. */
  144. public static pay_type = {
  145. DOU_YIN:1, //抖音支付
  146. WEI_XIN:2, //微信支付
  147. NEI_BU:3, //内部充值
  148. }
  149. /**
  150. * 是否收费 1 收费 0 免费
  151. */
  152. public static chapter_pay_type = {
  153. SHOU_FEI:1, //收费
  154. BU_SHOU_FEI:0, //不收费
  155. }
  156. /**
  157. * 订单状态 1 支付中 2 已经支付
  158. */
  159. public static order_status = {
  160. ZHI_FUZHIONG:1, //支付中
  161. YI_JING_ZHI_FU:2, //已经支付
  162. }
  163. /**
  164. * 书的状态 0:连载 1:完结 100:全部(用户书架筛选用)
  165. */
  166. public static book_action_status = {
  167. LIAN_ZAI:0, //连载
  168. WAN_JIE:1, //完结
  169. QUAN_BU:100, //全部
  170. }
  171. /**
  172. * 模版类型 1:banner 2:横版三封面 3:竖版三封面 4:竖版列表 5:搜索
  173. */
  174. public static template_stype = {
  175. BANNER:1,
  176. H_3:2,
  177. V_3:3,
  178. LIST:4,
  179. SEARCH:5,
  180. }
  181. }