freeMixin.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. // console.log(optios,'kankan===============================');
  18. // const page = this.$mp && this.$mp.page;
  19. // console.log(page.route);
  20. // uni.getSystemInfo({
  21. // success: function (res) {
  22. // if (page.route == "pages/pcWebViev/pcWebViev") return
  23. // if (res.windowWidth > 700) {
  24. // uni.reLaunch({
  25. // url: "/pages/pcWebViev/pcWebViev?path=" + optios.path + "&query=" + JSON.stringify(optios.query),
  26. // });
  27. // }
  28. // },
  29. // });
  30. this.userIsShowShare();
  31. },
  32. methods: {
  33. //免费标签的隐现
  34. async isShowFreeButton() {
  35. const res = await FreeButton.userIsShowFreeButton();
  36. if (res.Ret === 200) {
  37. this.isShowFree = res.Data.IsShow;
  38. }
  39. },
  40. //判断手机号是否是弘则的
  41. async userIsShowShare() {
  42. const res = await FreeButton.userIsShowShare();
  43. if (res.Ret === 200) {
  44. this.isHorzMobile = res.Data.IsShow;
  45. }
  46. },
  47. },
  48. };