freeMixin.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // import freeCharge from '@/components/freeCharge'
  2. import { FreeButton } from "@/config/api.js";
  3. export default {
  4. // components: {
  5. // freeCharge
  6. // },
  7. data() {
  8. return {
  9. isShowFree: false, //免费标签的隐现
  10. isHorzMobile: null, //手机号是否是弘则的
  11. };
  12. },
  13. onShow() {
  14. this.isShowFreeButton();
  15. },
  16. onLoad(optios) {
  17. const page = this.$mp && this.$mp.page;
  18. uni.getSystemInfo({
  19. success: function (res) {
  20. if (page && page.route == "pages/pcWebViev/pcWebViev") return;
  21. if (res.windowWidth > 700) {
  22. uni.reLaunch({
  23. url: "/pages/pcWebViev/pcWebViev?path=" + page.route + "&query=" + JSON.stringify(optios),
  24. });
  25. }
  26. },
  27. });
  28. this.userIsShowShare();
  29. },
  30. methods: {
  31. //免费标签的隐现
  32. async isShowFreeButton() {
  33. const res = await FreeButton.userIsShowFreeButton();
  34. if (res.Ret === 200) {
  35. this.isShowFree = res.Data.IsShow;
  36. }
  37. },
  38. //判断手机号是否是弘则的
  39. async userIsShowShare() {
  40. const res = await FreeButton.userIsShowShare();
  41. if (res.Ret === 200) {
  42. this.isHorzMobile = res.Data.IsShow;
  43. }
  44. },
  45. },
  46. };