policy-config.js 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. /** 业务协议同意版本,协议内容改版时递增以触发重新弹窗 */
  2. export const POLICY_CONSENT_VERSION = '1'
  3. export const STORAGE_KEY_POLICY_CONSENT = 'policyConsentVersion'
  4. /** 弹窗层级:协议/隐私高于营销活动(分享减价等) */
  5. export const POLICY_POPUP_Z_INDEX = 10100
  6. export const PRIVACY_POPUP_Z_INDEX = 10110
  7. /** TabBar「首页」对应页面(买书商城),勿与 pages/home/index(卖书)混淆 */
  8. export const HOME_TAB_PATH = '/pages/sell/index'
  9. /** CMS 文章 code */
  10. export const ARTICLE_CODE = {
  11. userAgreement: 'userAgreement',
  12. privacyPolicy: 'privacyPolicy',
  13. orderAgreement: 'orderAgreement',
  14. }
  15. export const ARTICLE_TITLE = {
  16. userAgreement: '用户协议',
  17. privacyPolicy: '隐私政策',
  18. orderAgreement: '书嗨用户协议',
  19. }
  20. /** 协议展示页路径(含 code、title 参数) */
  21. export function buildAgreementPageUrl(type) {
  22. const code = ARTICLE_CODE[type] || ARTICLE_CODE.orderAgreement
  23. const title = ARTICLE_TITLE[type] || ARTICLE_TITLE.orderAgreement
  24. return `/pages-home/pages/user-agreement?code=${code}&title=${encodeURIComponent(title)}`
  25. }