巴青农资商城

mallConfigDisplay.js 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /**
  2. * C 端商城配置 → 关于页展示模型
  3. * 数据来源:GET /api/mall/config(MallConfigAppVO)
  4. */
  5. export function mapMallAboutPage(data) {
  6. const raw = data || {}
  7. const filings = []
  8. if (raw.icpNo && raw.icpLink) {
  9. filings.push({
  10. key: 'icp',
  11. label: 'ICP 备案',
  12. no: raw.icpNo,
  13. link: raw.icpLink
  14. })
  15. }
  16. if (raw.psbNo && raw.psbLink) {
  17. filings.push({
  18. key: 'psb',
  19. label: '公安备案',
  20. no: raw.psbNo,
  21. link: raw.psbLink
  22. })
  23. }
  24. return {
  25. currencySymbol: raw.currencySymbol || '¥',
  26. showSales: raw.showSales === true,
  27. filings,
  28. hasFiling: filings.length > 0
  29. }
  30. }
  31. /** 打开备案外链(H5 / App / 小程序降级复制) */
  32. export function openExternalLink(url) {
  33. if (!url) return
  34. // #ifdef H5
  35. window.open(url, '_blank')
  36. // #endif
  37. // #ifdef APP-PLUS
  38. plus.runtime.openURL(url)
  39. // #endif
  40. // #ifdef MP
  41. uni.setClipboardData({
  42. data: url,
  43. success: () => {
  44. uni.showToast({ title: '链接已复制,请在浏览器打开', icon: 'none' })
  45. }
  46. })
  47. // #endif
  48. }