config.js 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. let huoConfig = {
  2. version: '0.8.0',
  3. // 根地址
  4. miniUrl: 'https://mini.beibaoyx.com',
  5. baseUrl: 'https://miniapi.beibaoyx.com',
  6. // 盒子类型 rp红包 gd金币
  7. mpType: 'gd',
  8. // 基础参数
  9. baseParams: {
  10. 'app_id': 81234700,
  11. 'client_id': '',
  12. 'format': 'json'
  13. },
  14. // 游戏参数
  15. gameParams: {
  16. 'game-pkg_name': wx.canIUse ? '' : 'game',
  17. 'game-app_ver': '',
  18. 'game-h_ver': '',
  19. 'game-sdk_ver': '',
  20. 'game-mp_id': 'wx8ce3423b6e10999d'
  21. },
  22. // 渠道参数
  23. agentParams: {
  24. 'agent-ch': '',
  25. 'agent-sub_ch': ''
  26. },
  27. // 设备参数
  28. deviceParams: {
  29. 'device-device_id': '',
  30. 'device-mac': '',
  31. 'device-ip': '',
  32. 'device-brand': '',
  33. 'device-model': '',
  34. 'device-os': '',
  35. 'device-os_version': '',
  36. 'device-screen': '',
  37. 'device-net': '',
  38. 'device-imsi': '',
  39. 'device-longitude': '',
  40. 'device-latitude': '',
  41. 'device-userua': '',
  42. 'device-disk_space': '',
  43. 'device-open_time': '',
  44. 'device-is_charge': '',
  45. 'device-screen_luminance': '',
  46. 'device-has_sim': '',
  47. 'device-is_break': ''
  48. },
  49. // 配置
  50. setting: {
  51. // 加载框配置
  52. showLoading: true,
  53. loadingParams: {
  54. title: '加载中',
  55. mask: true
  56. },
  57. // 提示框配置
  58. showToast: false,
  59. toastParams: {
  60. icon: 'none'
  61. }
  62. }
  63. }
  64. wx.getSystemInfo({
  65. success: res => {
  66. huoConfig.deviceParams['device-brand'] = encodeURIComponent(res.brand) // 手机品牌
  67. huoConfig.deviceParams['device-model'] = encodeURIComponent(res.model) // 手机型号
  68. huoConfig.deviceParams['device-screen'] = encodeURIComponent(res.screenWidth + 'x' + res.screenHeight) // 屏幕分辨率
  69. huoConfig.deviceParams['device-os'] = encodeURIComponent(res.platform) // 客户端平台
  70. huoConfig.deviceParams['device-os_version'] = encodeURIComponent(res.system) // 操作系统版本
  71. }
  72. })
  73. wx.getNetworkType({
  74. success: res => {
  75. huoConfig.deviceParams['device-net'] = encodeURIComponent(res.networkType) // 网络类型
  76. }
  77. })
  78. wx.getScreenBrightness({
  79. success: res => {
  80. huoConfig.deviceParams['device-screen_luminance'] = encodeURIComponent(parseInt(res.value * 100)) // 屏幕亮度
  81. }
  82. })
  83. huoConfig.gameParams['game-app_ver'] = huoConfig.version
  84. huoConfig.gameParams['game-sdk_ver'] = huoConfig.version
  85. module.exports = huoConfig