config.ts 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  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:"https://bookapi.hainanmlwl.com",
  67. Static:"https://zaoca.oss-accelerate.aliyuncs.com"
  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. get_wxbook_to_bookid:'/book/get_wxbook_to_bookid', //获取书id
  102. order_list:'/order/list',//订单列表 stype 1:充值 2:购买章节
  103. },
  104. /**
  105. * 静态
  106. */
  107. Static:{
  108. book_store: config.url_addr.Static + `/bookstatic/store/${config.applet_id}.json`, //书城
  109. book_details(book_id:number) {
  110. return config.url_addr.Static + `/bookstatic/book/${book_id}.json`
  111. },
  112. get_recharge_list(stype:number){
  113. /**
  114. * stype 类型 1 章节页面 2 vip充值页面 3 充书币页面
  115. */
  116. return config.url_addr.Static + `/bookstatic/recharge/${config.applet_id}_${stype}.json`
  117. }
  118. },
  119. StatesCode:{
  120. SUCCESS:10000,
  121. }
  122. }
  123. public static read_config = {
  124. colorList:['#ffffff', '#e6e1d6','#f5d6d6','#dce5d3','#d7dde3'],
  125. lineHeight:1.8,
  126. fontSizeList:[12,14,16,18,20,22,24],
  127. readMode:{
  128. Bright:1,
  129. Dark:2
  130. },
  131. BrightFontColor:'#404040', //光亮模式下的字体颜色
  132. DarkFontColor:`#ffffff`, //黑暗模式下的字体颜色
  133. BrightDbColor:`#ffffff`, //光亮模式下的底板颜色
  134. DarkDbColor:`#000000`, //黑暗模式下的底板颜色
  135. RedColor:'#FF4252',
  136. 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'},
  137. {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'},
  138. {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'},
  139. {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'},
  140. {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'}]
  141. }
  142. public static recharge_stype = {
  143. CHAPTER_PAGE:1, //1 章节页面
  144. VIP_RECHARGE:2, //2 vip充值页面
  145. BOOK_COIN_PAGE:3, //3 充书币页面
  146. }
  147. /**
  148. * 支付类型 1 抖音支付 2 微信支付 3 内部充值(内部测试)
  149. */
  150. public static pay_type = {
  151. DOU_YIN:1, //抖音支付
  152. WEI_XIN:2, //微信支付
  153. NEI_BU:3, //内部充值
  154. }
  155. /**
  156. * 是否收费 1 收费 0 免费
  157. */
  158. public static chapter_pay_type = {
  159. SHOU_FEI:1, //收费
  160. BU_SHOU_FEI:0, //不收费
  161. }
  162. /**
  163. * 订单状态 1:支付中 2:已经支付 3:已取消 4:已退款
  164. */
  165. public static order_status = {
  166. PAYING:1, //支付中
  167. HAVE_PAY:2, //已经支付
  168. CANCEL:3, //已取消
  169. REFUNDED:4, //已退款
  170. }
  171. /**
  172. * 书的状态 0:连载 1:完结 100:全部(用户书架筛选用)
  173. */
  174. public static book_action_status = {
  175. LIAN_ZAI:0, //连载
  176. WAN_JIE:1, //完结
  177. QUAN_BU:100, //全部
  178. }
  179. /**
  180. * 模版类型 1:banner 2:横版三封面 3:竖版三封面 4:竖版列表 5:搜索
  181. */
  182. public static template_stype = {
  183. BANNER:1,
  184. H_3:2,
  185. V_3:3,
  186. LIST:4,
  187. SEARCH:5,
  188. }
  189. /**
  190. * 我的跳转类型
  191. */
  192. public static mine_goto_type = {
  193. SHUBI:1,
  194. VIP:2,
  195. TIANJIAZHUOMIAN:3,
  196. JIAOYIJILU:4,
  197. LIANXIKEFU:5,
  198. GUANYUWOMEN:6,
  199. }
  200. }