index.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. async onShow() {
  22. await this.$store.dispatch("checkHandle", "noGO");
  23. this.isShowFreeButton();
  24. },
  25. methods: {
  26. //免费标签的隐现
  27. async isShowFreeButton() {
  28. const res = await Reports.reportIsShow();
  29. if (res.Ret === 200) {
  30. this.wholeShowListData = res.Data;
  31. this.isShowFree = res.Data.IsShowFreeButton;
  32. this.searchPlaceholderList = res.Data.SearchTxtList;
  33. }
  34. },
  35. //判断手机号是否是弘则的
  36. async userIsShowShare() {
  37. const res = await FreeButton.userIsShowShare();
  38. if (res.Ret === 200) {
  39. this.isHorzMobile = res.Data.IsShow;
  40. }
  41. },
  42. // 埋点
  43. async getRecordTracking(PageRouter, payload = {}) {
  44. const res = await User.getUserTracking({
  45. PageRouter,
  46. ...payload,
  47. });
  48. },
  49. strFontSize(str) {
  50. let font = str
  51. .replace(/font-size:\s\w+;?/g, "")
  52. .replace(/font-size\s:\w+;?/g, "")
  53. .replace(/font-size:\w+;?/g, "");
  54. return `<div style="font-size:16px;line-height: 1.6">${font}</div>`;
  55. },
  56. pleaseGoLogin() {
  57. uni.showModal({
  58. title: "即将前往登录页面,请确认是否继续",
  59. confirmColor: "#376cbb",
  60. cancelColor: "#606266",
  61. success: function (res) {
  62. if (res.confirm) {
  63. //已授权未绑定
  64. uni.navigateTo({
  65. url: "/pageMy/login/login",
  66. });
  67. }
  68. },
  69. });
  70. },
  71. },
  72. computed: {
  73. isUserBindingPhoneNumber: {
  74. get() {
  75. let isShow = !(!this.$store.state.isAuth && this.$store.state.isBind);
  76. return isShow;
  77. },
  78. set() {},
  79. },
  80. mixinIsSceneNumber: {
  81. get() {
  82. return this.$store.state.isSceneNumber;
  83. },
  84. set() {},
  85. },
  86. },
  87. };