mxConst.js 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. const consts = {
  2. keyToken: 'mx-token',
  3. keyUserInfo: 'mx-userInfo',
  4. keyAppConfig: 'mx-appConfig',
  5. keyCacheUniquePrefix: 'mx-transfer-cache-',
  6. keyTheme: 'mx-theme',
  7. keyParentIdentifier: 'from=wechat',
  8. keyGuideRead: 'mx-guideRead-v1',
  9. keyUserAgreed: 'mx-userAgreed',
  10. keyDisplayPermission: 'mx-displayPermission',
  11. keyOutTradeNo: 'mx-outTradeNo',
  12. keyCulturalExamType: '职高对口升学',
  13. propAppConfig: 'appConfig',
  14. routes: {
  15. index: {url: '/pages/index/index', type: 'tab'},
  16. portal: {url: '/pages/ie/portal', type: 'tab'},
  17. personalCenter: {url: '/pages/personal-center/index/index', type: 'tab'},
  18. login: '/pages/login/login',
  19. register: '/pages/login/register',
  20. activate: '/pages/personal-center/bind-card/bind-card',
  21. forgetPwd: '/pages/login/forget-pwd',
  22. guide: {url: '/pages/index/guide', animationType: 'pop-in'},
  23. bindMobile: {url: '/pages/login/bind-mobile', animationType: 'pop-in'},
  24. bindProfile: '/pages/login/bind-profile',
  25. setting: '/pages/personal-center/setting/setting',
  26. basicInfo: '/pages/personal-center/basic-info/basic-info',
  27. newsIndex: '/pages/news/index/index',
  28. newsDetail: '/pages/news/detail/detail',
  29. newsGroup: '/pages/news/group/group',
  30. videoPlay: '/pages/video-center/play/play'
  31. },
  32. globalEvents: {
  33. paperCompleted: 'globalEvents-paperCompleted',
  34. collegeSelected: 'globalEvents-collegeSelected',
  35. aiFilterShortcutClear: 'globalEvents-aiFilterShortcutClear',
  36. voluntaryChanged: 'globalEvents-voluntaryChanged'
  37. },
  38. serverErrors: {
  39. 400: '请求无效 (Bad request)',
  40. 401: '操作未授权,请登陆',
  41. 402: '登陆凭据失效,请重新登陆',
  42. 403: '没有权限访问',
  43. 404: '请求资源不存在',
  44. 405: '权限不足,请开通VIP'
  45. },
  46. commonStyle: {
  47. blockFloatTitle: {
  48. position: 'absolute',
  49. color: '#fff',
  50. fontSize: '18px',
  51. fontFamily: 'PingFangSC-Medium, PingFang SC',
  52. left: '15px',
  53. top: '15px'
  54. },
  55. blockFloatDesc: {
  56. position: 'absolute',
  57. color: '#fff',
  58. fontSize: '18px',
  59. fontFamily: 'PingFangSC-Medium, PingFang SC',
  60. left: '15px',
  61. top: '40px',
  62. opacity: 0.5
  63. },
  64. blockNormalTitle: {
  65. color: '#666666',
  66. fontSize: '14px',
  67. fontFamily: 'PingFangSC-Medium, PingFang SC',
  68. },
  69. blockNormalDesc: {
  70. color: '#999999',
  71. fontSize: '12px',
  72. fontFamily: 'PingFangSC-Regular, PingFang SC'
  73. }
  74. },
  75. enum: {
  76. scoreLock: {
  77. // 待锁定状态
  78. locking: -1,
  79. // 正常状态
  80. unlock: 0,
  81. // 已锁定状态
  82. locked: 1
  83. },
  84. /// @description 心理健康测评
  85. mentalHealthTestType: 4,
  86. brochureType: {
  87. introduction: 1,
  88. enrollRule: 2,
  89. examTime: 3,
  90. work: 4,
  91. otherRule: 5
  92. },
  93. ai: {
  94. voluntaryType: {
  95. ai: 'AI',
  96. multiple: 'Multiple'
  97. },
  98. renderType: {
  99. def: 0,
  100. ai: 1,
  101. calculate: 2
  102. },
  103. inputType: {
  104. text: 'Text', // 普通文本,一般情况下输入均使用此类。数值也可以使用此类型,结合校验规则使用
  105. score: 'Score', // AI的特殊输入类型,带分制的分数 // 此类输入之后可能涉及输入条件动态变化,NOTE:后面再考虑这种情况。
  106. number: 'Number', // 数值,会限制键盘,但因为小数点之类的键盘并不太好控制,所以如果能不使用还是使用Text
  107. radio: 'Radio', // radio单选。如果固定2个,用radio,否则用picker。一般超过3个会折行,影响美观
  108. picker: 'Picker', // picker单选,一般使用Picker做单选。
  109. checkbox: 'Checkbox', // 多选
  110. eyesight: 'Eyesight' // 视力,特殊项,前端自己生成了选项
  111. },
  112. pickType: {
  113. all: {
  114. text: '全部',
  115. value: 'All'
  116. },
  117. danger: {
  118. text: '冲刺型',
  119. value: 'Danger'
  120. },
  121. normal: {
  122. text: '稳妥型',
  123. value: 'Normal'
  124. },
  125. safety: {
  126. text: '保守型',
  127. value: 'Safety'
  128. }
  129. },
  130. pickEmpty: {
  131. enrollPass: {
  132. text: '无概率',
  133. value: '0'
  134. },
  135. new: {
  136. text: '新增',
  137. value: '1'
  138. }
  139. },
  140. ruleCategory: {
  141. none: {
  142. text: '未知',
  143. value: 'None'
  144. },
  145. enroll: {
  146. text: '录取规则',
  147. formText: '填写成绩',
  148. value: 'Enroll'
  149. },
  150. special: {
  151. text: '特殊要求',
  152. formText: '其它信息',
  153. value: 'Special'
  154. }
  155. },
  156. ruleType: {
  157. none: 'None', // 缺省类型
  158. scoreTotal: 'ScoreTotal', // 总分,综合分
  159. scoreUnion: 'ScoreUnion', // 学考,文化成绩
  160. scoreBase: 'ScoreBase', // 校考,非学考,文化成绩
  161. scoreSkill: 'ScoreSkill', // 技能分,非文化成绩
  162. scoreSingle: 'ScoreSingle', // 单科成绩
  163. special: 'Special', // 附加要求
  164. readonly: 'Readonly', // 只读项,只展示,不参与判定
  165. other: 'Other' // 未知项
  166. }
  167. },
  168. simulatePickTypes: [{
  169. text: '冲刺型',
  170. value: '0'
  171. }, {
  172. text: '稳妥型',
  173. value: '1'
  174. }, {
  175. text: '保守型',
  176. value: '2'
  177. }]
  178. },
  179. question: {
  180. // 客观题类型
  181. objectiveTypes: [1, 3, 6, 7],
  182. // 客观题-单选类型
  183. radioTypes: [1, 6, 7],
  184. // 客观题-多选类型
  185. checkboxTypes: [3],
  186. // 转方法
  187. isObjective: function (typeId) {
  188. return this.objectiveTypes.some(t => t == typeId)
  189. },
  190. isRadio: function (typeId) {
  191. return this.radioTypes.some(t => t == typeId)
  192. },
  193. isCheckbox: function (typeId) {
  194. return this.checkboxTypes.some(t => t == typeId)
  195. }
  196. },
  197. scrollIntoOption: {
  198. block: 'center',
  199. behavior: 'smooth'
  200. },
  201. recommendMajorSortFn: (a, b) => a.localPriority - b.localPriority
  202. }
  203. export function getTabRoutes() {
  204. return Object.values(consts.routes)
  205. .filter(r => r.type == 'tab')
  206. .map(r => r.url)
  207. }
  208. export default consts