payManage.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. $(document).ready(function () {
  2. let url = window.location.search;
  3. var theRequest = new Object();
  4. if (url.indexOf("?") != -1) {
  5. var str = url.substr(1);
  6. strs = str.split("&");
  7. for (var i = 0; i < strs.length; i++) {
  8. theRequest[strs[i].split("=")[0]] = unescape(
  9. decodeURI(strs[i].split("=")[1])
  10. );
  11. }
  12. }
  13. let index = 0;
  14. let payType = 0;
  15. let payTypea = 0;
  16. let payTypeb = 0;
  17. let array = [];
  18. let htmlArray = ['#ZFBQX', '#ZFBZB', '#ZFBKS', '#ZFBYY'];
  19. $.ajax({
  20. type: "post",
  21. url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackoneeight/select_td_list",
  22. dataType: "json",
  23. data: {},
  24. success: function (res) {
  25. console.log(res);
  26. console.log(res.data)
  27. array = [res.data[0].num, res.data[1].num, res.data[2].num];
  28. for (let i = 0; i < array.length; i++) {
  29. console.log(array[i])
  30. console.log(htmlArray[array[i]]);
  31. $(`#HoutaiContainerBottomAppleListHeader${(i + 1)}`).find(htmlArray[array[i] - 1] + (i + 1)).attr('checked', true);
  32. }
  33. }
  34. });
  35. $('.HoutaiContainerBottomAppleListHeaderQR').on('click', function () {
  36. index = $(this).parent().index();
  37. let arr = [payTypea, payTypeb, 4];
  38. payType = arr[index];
  39. console.log(index);
  40. console.log(payType);
  41. index += 1;
  42. payType += 1;
  43. $.ajax({
  44. type: "post",
  45. url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackoneeight/save_td",
  46. dataType: "json",
  47. data: {
  48. id: index,
  49. td_id: payType
  50. },
  51. success: function (res) {
  52. console.log(res);
  53. alert('修改成功');
  54. }
  55. });
  56. })
  57. $('.paySelectTypeContent').on('click', function () {
  58. index = $(this).parent().parent().index();
  59. console.log(index);
  60. let arr = [0, 1, 2, 3];
  61. if (index == 0) {
  62. payTypea = arr[$(this).index()];
  63. } else if (index == 1) {
  64. payTypeb = arr[$(this).index()];
  65. } else {
  66. payType = 4;
  67. }
  68. })
  69. });