index.js 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. import { FreeButton, Reports, User } from "@/config/api.js";
  2. import { Throttle } from "@/config/util.js";
  3. export default {
  4. data() {
  5. return {
  6. isShowFree: false, //免费标签的隐现
  7. isHorzMobile: false, //手机号是否是弘则的
  8. globalBgAudioManager: uni.getBackgroundAudioManager(), //背景音频
  9. navBarStyle: {
  10. height: 60 + "px",
  11. paddingTop: 40 + "px",
  12. paddingBottom: "4px",
  13. },
  14. searchPlaceholderList: {},
  15. wholeShowListData: {}, //
  16. PageRouter: {
  17. report: "",
  18. activity: "",
  19. }, //页面进来的路径
  20. };
  21. },
  22. async onShow() {
  23. await this.$store.dispatch("checkHandle", "noGO");
  24. this.isShowFreeButton();
  25. },
  26. onLoad(optios) {
  27. // PC端功能关闭
  28. // const page = this.$mp && this.$mp.page;
  29. // uni.getSystemInfo({
  30. // success: function (res) {
  31. // if (page && page.route == "pages/pcWebViev/pcWebViev") return;
  32. // if (res.windowWidth > 700) {
  33. // uni.reLaunch({
  34. // url: "/pages/pcWebViev/pcWebViev?path=" + page.route + "&query=" + JSON.stringify(optios),
  35. // });
  36. // }
  37. // },
  38. // });
  39. // 判断手机号是不是弘则研究
  40. // this.userIsShowShare();
  41. },
  42. methods: {
  43. //免费标签的隐现
  44. async isShowFreeButton() {
  45. const res = await Reports.reportIsShow();
  46. if (res.Ret === 200) {
  47. this.wholeShowListData = res.Data;
  48. this.isShowFree = res.Data.IsShowFreeButton;
  49. this.searchPlaceholderList = res.Data.SearchTxtList;
  50. }
  51. },
  52. //判断手机号是否是弘则的
  53. async userIsShowShare() {
  54. const res = await FreeButton.userIsShowShare();
  55. if (res.Ret === 200) {
  56. this.isHorzMobile = res.Data.IsShow;
  57. }
  58. },
  59. // 埋点
  60. async getRecordTracking(PageRouter, payload = {}) {
  61. const res = await User.getUserTracking({
  62. PageRouter,
  63. ...payload,
  64. });
  65. },
  66. strFontSize(str) {
  67. let font = str
  68. .replace(/font-size:\s\w+;?/g, "")
  69. .replace(/font-size\s:\w+;?/g, "")
  70. .replace(/font-size:\w+;?/g, "");
  71. return `<div style="font-size:16px;line-height: 1.6">${font}</div>`;
  72. },
  73. },
  74. computed: {
  75. isUserBindingPhoneNumber: {
  76. get() {
  77. let isShow = !(!this.$store.state.isAuth && this.$store.state.isBind);
  78. return isShow;
  79. },
  80. set() {},
  81. },
  82. },
  83. };