index.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import { FreeButton, Reports } 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. };
  16. },
  17. onShow() {
  18. this.isShowFreeButton();
  19. },
  20. onLoad(optios) {
  21. const page = this.$mp && this.$mp.page;
  22. uni.getSystemInfo({
  23. success: function (res) {
  24. if (page && page.route == "pages/pcWebViev/pcWebViev") return;
  25. if (res.windowWidth > 700) {
  26. uni.reLaunch({
  27. url: "/pages/pcWebViev/pcWebViev?path=" + page.route + "&query=" + JSON.stringify(optios),
  28. });
  29. }
  30. },
  31. });
  32. // 判断手机号是不是弘则研究
  33. // this.userIsShowShare();
  34. },
  35. methods: {
  36. //免费标签的隐现
  37. async isShowFreeButton() {
  38. const res = await Reports.reportIsShow();
  39. if (res.Ret === 200) {
  40. this.wholeShowListData = res.Data;
  41. this.isShowFree = res.Data.IsShowFreeButton;
  42. this.searchPlaceholderList = res.Data.SearchTxtList;
  43. }
  44. },
  45. //判断手机号是否是弘则的
  46. async userIsShowShare() {
  47. const res = await FreeButton.userIsShowShare();
  48. if (res.Ret === 200) {
  49. this.isHorzMobile = res.Data.IsShow;
  50. }
  51. },
  52. },
  53. };