config.ts 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  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 = '#fcd9e0'
  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. SEARCH_RECORD: 'SEARCH_RECORD',
  45. }
  46. /**
  47. * 事件类型
  48. */
  49. public static EVENT_TYPE = {
  50. USER_LOGIN_SUCCESS: "EVENT_TYPE_USER_LOGIN_SUCCESS", //用户登录成功
  51. UPDATE_BOOKSHELF: "EVENT_TYPE_UPDATE_BOOKSHELF", //更新书架
  52. UPDATE_READHISTORY: "EVENT_UPDATE_READHISTORY", //更新阅读历史
  53. UPDATE_BOOKSHELF_CURRENT_READ_CHAPTER: "EVENT_TYPE_UPDATE_BOOKSHELF_CURRENT_READ_CHAPTER", //更新书架当前阅读章节
  54. }
  55. /**
  56. * 测试域名
  57. */
  58. private static URL_DEBUG = {
  59. Dynamic:"https://bookapi.hainanmlwl.com",
  60. Static:"https://zaoca.oss-accelerate.aliyuncs.com"
  61. }
  62. /**
  63. * 正式域名
  64. */
  65. private static URL_RELEASE = {
  66. Dynamic:"http://",
  67. Static:"http://"
  68. }
  69. /**
  70. * 域名
  71. */
  72. public static url_addr= {
  73. Dynamic:config.isTest?config.URL_DEBUG.Dynamic:config.URL_RELEASE.Dynamic, //动态接口
  74. Static:config.isTest?config.URL_DEBUG.Static:config.URL_RELEASE.Static //静态接口
  75. }
  76. /**
  77. * 接口
  78. */
  79. public static url_confg = {
  80. /**
  81. * 动态
  82. */
  83. Dynamic:{
  84. user_get_douyin_openid:'/user/get_douyin_openid',
  85. user_get_wx_open_id:'/user/get_wx_open_id',
  86. user_login:'/user/login',
  87. books_shelf:'/book/books_shelf',
  88. book_category_recommend:'/book/category_recommend', //书分类推荐
  89. recharge:{
  90. /**
  91. * 充值
  92. */
  93. order_buy:'/order/buy', //支付类型 1:抖音支付 2:微信支付 3:内部充值(内部测试)
  94. order_info:'/order/info',
  95. },
  96. buy_chapter:'/book/buy_chapter', //购买书籍
  97. get_user_chapter_ids:'/book/get_user_chapter_ids', //购买书籍章节记录
  98. user_info:'/user/info', //用户详情
  99. reset:'/user/reset', //重置用户
  100. book_search:'/book/search', //书搜索
  101. },
  102. /**
  103. * 静态
  104. */
  105. Static:{
  106. book_store: config.url_addr.Static + `/bookstatic/store/${config.applet_id}.json`, //书城
  107. book_details(book_id:number) {
  108. return config.url_addr.Static + `/bookstatic/book/${book_id}.json`
  109. },
  110. get_recharge_list(stype:number){
  111. /**
  112. * stype 类型 1 章节页面 2 vip充值页面 3 充书币页面
  113. */
  114. return config.url_addr.Static + `/bookstatic/recharge/${config.applet_id}_${stype}.json`
  115. }
  116. },
  117. StatesCode:{
  118. SUCCESS:10000,
  119. }
  120. }
  121. public static read_config = {
  122. colorList:['#ffffff', '#e6e1d6','#f5d6d6','#dce5d3','#d7dde3'],
  123. lineHeight:1.8,
  124. fontSizeList:[12,14,16,18,20,22,24],
  125. readMode:{
  126. Bright:1,
  127. Dark:2
  128. },
  129. BrightFontColor:'#404040', //光亮模式下的字体颜色
  130. DarkFontColor:`#ffffff`, //黑暗模式下的字体颜色
  131. BrightDbColor:`#ffffff`, //光亮模式下的底板颜色
  132. DarkDbColor:`#000000`, //黑暗模式下的底板颜色
  133. RedColor:'#FF4252',
  134. 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'},
  135. {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'},
  136. {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'},
  137. {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'},
  138. {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'}]
  139. }
  140. public static recharge_stype = {
  141. CHAPTER_PAGE:1, //1 章节页面
  142. VIP_RECHARGE:2, //2 vip充值页面
  143. BOOK_COIN_PAGE:3, //3 充书币页面
  144. }
  145. /**
  146. * 支付类型 1 抖音支付 2 微信支付 3 内部充值(内部测试)
  147. */
  148. public static pay_type = {
  149. DOU_YIN:1, //抖音支付
  150. WEI_XIN:2, //微信支付
  151. NEI_BU:3, //内部充值
  152. }
  153. /**
  154. * 是否收费 1 收费 0 免费
  155. */
  156. public static chapter_pay_type = {
  157. SHOU_FEI:1, //收费
  158. BU_SHOU_FEI:0, //不收费
  159. }
  160. /**
  161. * 订单状态 1 支付中 2 已经支付
  162. */
  163. public static order_status = {
  164. ZHI_FUZHIONG:1, //支付中
  165. YI_JING_ZHI_FU:2, //已经支付
  166. }
  167. /**
  168. * 书的状态 0:连载 1:完结 100:全部(用户书架筛选用)
  169. */
  170. public static book_action_status = {
  171. LIAN_ZAI:0, //连载
  172. WAN_JIE:1, //完结
  173. QUAN_BU:100, //全部
  174. }
  175. /**
  176. * 模版类型 1:banner 2:横版三封面 3:竖版三封面 4:竖版列表 5:搜索
  177. */
  178. public static template_stype = {
  179. BANNER:1,
  180. H_3:2,
  181. V_3:3,
  182. LIST:4,
  183. SEARCH:5,
  184. }
  185. /**
  186. * 我的跳转类型
  187. */
  188. public static mine_goto_type = {
  189. SHUBI:1,
  190. VIP:2,
  191. TIANJIAZHUOMIAN:3,
  192. JIAOYIJILU:4,
  193. LIANXIKEFU:5,
  194. GUANYUWOMEN:6,
  195. }
  196. }