index.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. import { FreeButton, Reports, User } from "@/config/api.js";
  2. export default {
  3. data() {
  4. return {
  5. isShowFree: false, //免费标签的隐现
  6. isHorzMobile: false, //手机号是否是弘则的
  7. globalBgAudioManager: uni.getBackgroundAudioManager(), //背景音频
  8. navBarStyle: {
  9. height: 60 + "px",
  10. paddingTop: 40 + "px",
  11. paddingBottom: "4px",
  12. },
  13. searchPlaceholderList: {},
  14. wholeShowListData: {}, //
  15. PageRouter: {
  16. report: "",
  17. activity: "",
  18. }, //页面进来的路径
  19. };
  20. },
  21. onShow() {
  22. this.isShowFreeButton();
  23. },
  24. onLoad(optios) {
  25. // PC端功能关闭
  26. // const page = this.$mp && this.$mp.page;
  27. // uni.getSystemInfo({
  28. // success: function (res) {
  29. // if (page && page.route == "pages/pcWebViev/pcWebViev") return;
  30. // if (res.windowWidth > 700) {
  31. // uni.reLaunch({
  32. // url: "/pages/pcWebViev/pcWebViev?path=" + page.route + "&query=" + JSON.stringify(optios),
  33. // });
  34. // }
  35. // },
  36. // });
  37. // 判断手机号是不是弘则研究
  38. // this.userIsShowShare();
  39. },
  40. methods: {
  41. //免费标签的隐现
  42. async isShowFreeButton() {
  43. const res = await Reports.reportIsShow();
  44. if (res.Ret === 200) {
  45. this.wholeShowListData = res.Data;
  46. this.isShowFree = res.Data.IsShowFreeButton;
  47. this.searchPlaceholderList = res.Data.SearchTxtList;
  48. }
  49. },
  50. //判断手机号是否是弘则的
  51. async userIsShowShare() {
  52. const res = await FreeButton.userIsShowShare();
  53. if (res.Ret === 200) {
  54. this.isHorzMobile = res.Data.IsShow;
  55. }
  56. },
  57. // 埋点
  58. async getRecordTracking(PageRouter, payload = {}) {
  59. const res = await User.getUserTracking({
  60. PageRouter,
  61. ...payload,
  62. });
  63. },
  64. },
  65. };