mixin.js 650 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * 全局注入器
  3. */
  4. let page = {
  5. data() {
  6. return {
  7. }
  8. },
  9. methods: {
  10. },
  11. onLoad(options) {
  12. let userId=uni.getStorageSync("userId")
  13. console.log(userId,'我是userid===============>');
  14. if (!this.$u.test.isEmpty(userId)) {
  15. let link=window.location.href
  16. if (link.indexOf("?")!=-1) {
  17. link=link+"&agenterId="+userId
  18. }else{
  19. link=link+"?agenterId="+userId
  20. }
  21. let obj={
  22. link,
  23. title:"",
  24. desc:link
  25. }
  26. this.$shareConfig(obj,this)
  27. }
  28. if (!this.$u.test.isEmpty(options.agenterId)) {
  29. uni.setStorageSync("agenterId",options.agenterId)
  30. }
  31. }
  32. }
  33. export default page