config_info.js 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
  2. var Controller = {
  3. index: function () {
  4. Controller.api.bindevent();
  5. },
  6. add: function () {
  7. Controller.api.bindevent();
  8. },
  9. edit: function () {
  10. Controller.api.bindevent();
  11. },
  12. frontend: function () {
  13. Controller.api.bindevent();
  14. faForm = Form;
  15. },
  16. api: {
  17. bindevent: function () {
  18. Form.api.bindevent($("form[role=form]"));
  19. Controller.api.bindPageMyFollowMpBtn();
  20. Controller.api.bindPageMyFollowMpClick();
  21. },
  22. /**
  23. * 绑定我的页面关注按钮事件
  24. */
  25. bindPageMyFollowMpBtn: function () {
  26. var showMyFollowMpBtn = function (page_my_follow_mp_btn) {
  27. if (page_my_follow_mp_btn == 1) {
  28. $('#page_my_follow_mp_btn-1').show(200);
  29. } else {
  30. $('#page_my_follow_mp_btn-1').hide(200);
  31. }
  32. };
  33. var page_my_follow_mp_btn = $('input[name="row[page_my_follow_mp_btn]"]:checked').val();
  34. showMyFollowMpBtn(page_my_follow_mp_btn);
  35. $(document).on('click', "input[name='row[page_my_follow_mp_btn]']", function () {
  36. let page_my_follow_mp_btn = $(this).val();
  37. showMyFollowMpBtn(page_my_follow_mp_btn);
  38. });
  39. },
  40. /**
  41. * 绑定我的页面关注按钮事件
  42. */
  43. bindPageMyFollowMpClick: function () {
  44. var showMyFollowMpClick = function (page_my_follow_mp_click) {
  45. if (page_my_follow_mp_click == 'article') {
  46. $('#page_my_follow_mp_click-article').show(200);
  47. $('#page_my_follow_mp_click-image').hide(200);
  48. } else {
  49. $('#page_my_follow_mp_click-article').hide(200);
  50. $('#page_my_follow_mp_click-image').show(200);
  51. }
  52. };
  53. var page_my_follow_mp_click = $('input[name="row[page_my_follow_mp_click]"]:checked').val();
  54. showMyFollowMpClick(page_my_follow_mp_click);
  55. $(document).on('click', "input[name='row[page_my_follow_mp_click]']", function () {
  56. let page_my_follow_mp_click = $(this).val();
  57. showMyFollowMpClick(page_my_follow_mp_click);
  58. });
  59. },
  60. }
  61. };
  62. return Controller;
  63. });