config.ts 5.6 KB

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