recruit.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. var app = getApp();
  2. var util = require('../../utils/util.js');
  3. var status = require('../../utils/index.js');
  4. Page({
  5. mixins: [require('../../mixin/globalMixin.js')],
  6. data: {
  7. },
  8. onLoad: function (options) {
  9. status.setNavBgColor();
  10. status.setGroupInfo().then((groupInfo) => {
  11. wx.setNavigationBarTitle({
  12. title: groupInfo.owner_name || '团长',
  13. })
  14. });
  15. let that = this;
  16. app.util.request({
  17. url: 'entry/wxapp/index',
  18. data: {
  19. controller: 'community.get_apply_page'
  20. },
  21. dataType: 'json',
  22. success: function (res) {
  23. if (res.data.code == 0) {
  24. let article = res.data.data || '';
  25. that.setData({ article })
  26. }
  27. }
  28. })
  29. },
  30. onShow: function () {
  31. let that = this;
  32. util.check_login_new().then((res) => {
  33. that.setData({ needAuth: !res });
  34. })
  35. },
  36. authModal: function () {
  37. if (this.data.needAuth) {
  38. this.setData({ showAuthModal: !this.data.showAuthModal });
  39. return false;
  40. }
  41. return true;
  42. },
  43. authSuccess: function () {
  44. this.setData({
  45. needAuth: false,
  46. showAuthModal: false
  47. })
  48. },
  49. goLink: function (event) {
  50. if (!this.authModal()) return;
  51. let url = event.currentTarget.dataset.link;
  52. var pages_all = getCurrentPages();
  53. if (pages_all.length > 3) {
  54. wx.redirectTo({ url })
  55. } else {
  56. wx.navigateTo({ url })
  57. }
  58. },
  59. /**
  60. * 用户点击右上角分享
  61. */
  62. onShareAppMessage: function () {
  63. }
  64. })