index.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // lionfish_comshop/pages/auth/index.js
  2. var util = require('../../utils/util.js');
  3. var app = getApp()
  4. Page({
  5. /**
  6. * 页面的初始数据
  7. */
  8. data: {
  9. canIUse: wx.canIUse("button.open-type.getUserInfo"),
  10. backurl: "/lionfish_comshop/pages/index/index",
  11. navType: 1
  12. },
  13. /**
  14. * 生命周期函数--监听页面加载
  15. */
  16. onLoad: function (options) {
  17. let url = options.url;
  18. let navType = options.t || 0;
  19. let modify_item = options.modify_item || 0;
  20. let id = options.id || 0;
  21. console.log(options)
  22. if (typeof (url) != "undefined" && url){
  23. this.setData({
  24. backurl: url,
  25. navType: navType,
  26. modify_item: modify_item,
  27. id: id
  28. })
  29. }
  30. },
  31. bindGetUserInfo: function (e) {
  32. let that = this;
  33. let url = "";
  34. if (this.data.modify_item)
  35. {
  36. url = that.data.backurl + '?' + this.data.modify_item +'=' + this.data.id
  37. }
  38. else if (this.data.id){
  39. url = that.data.backurl + '?id=' + this.data.id
  40. } else {
  41. url = that.data.backurl
  42. }
  43. console.log(url)
  44. util.login(url, that.data.navType);
  45. }
  46. })