orderform.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. import common from '../../utils/util';
  2. import main from '../../utils/main';
  3. const app = getApp();
  4. Page({
  5. data: {
  6. PayList:[],
  7. IsLogin:1,
  8. },
  9. onLoad: function (options) {
  10. var that = this;
  11. that.setData({
  12. Containnerheight: main.getWindowHeight(),
  13. });
  14. if (app.globalData.userInfo){
  15. that.init();
  16. }
  17. else{
  18. this.setData({
  19. IsLogin: -1,
  20. });
  21. }
  22. },
  23. init:function(){
  24. var that = this;
  25. var url = "GetUserPayList?UserID=" + app.globalData.userInfo.UserID;
  26. main.getData(url, function (data) {
  27. if (data) {
  28. that.setData({
  29. PayList: data,
  30. IsLogin: 1,
  31. });
  32. }
  33. });
  34. },
  35. showLogin:function(){
  36. this.setData({
  37. IsLogin: -2,
  38. });
  39. },
  40. hideLogin:function(){
  41. this.setData({
  42. IsLogin: -1,
  43. });
  44. },
  45. onKeyInput: function (e) {
  46. var that=this;
  47. that.setData({
  48. UserName: e.detail.value
  49. });
  50. },
  51. onKeyInput2: function (e) {
  52. var that=this;
  53. that.setData({
  54. UserPwd: e.detail.value
  55. });
  56. },
  57. login: function () {
  58. var that = this;
  59. main.getData('Login20221228?UserName=' + that.data.UserName + "&UserPwd="+that.data.UserPwd+"&ProductID=" + app.globalData.ProgramID, function (data) {
  60. if (data) {
  61. if (data>0){
  62. app.globalData.userInfo={};
  63. app.globalData.userInfo.UserID=data;
  64. main.getData('GetWXUsersAllPayInfo500?UserID=' + app.globalData.userInfo.UserID + "&ProductID=" + app.globalData.ProgramID, function (data2) {
  65. if (data2) {
  66. that.setData({
  67. IsLogin: 1,
  68. PayList: data2,
  69. });
  70. }
  71. else {
  72. that.setData({
  73. IsLogin: 1,
  74. PayList: [],
  75. });
  76. }
  77. });
  78. }
  79. else {
  80. wx.showToast({
  81. title: '用户名或密码不正确',
  82. });
  83. }
  84. }
  85. else {
  86. wx.showToast({
  87. title: '登录出错',
  88. });
  89. }
  90. });
  91. },
  92. onShareAppMessage: function () {
  93. return {
  94. title: app.globalData.ShareTitle,
  95. path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
  96. imageUrl: app.globalData.ShareImage,
  97. }
  98. },
  99. })