respgetmfuserinfo.cpp 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. #include "respgetmfuserinfo.h"
  2. #include <QScriptValue>
  3. #include <QScriptEngine>
  4. #include <QScriptValueIterator>
  5. RespGetMfUserInfo::RespGetMfUserInfo(QString json)
  6. {
  7. this->json = json;
  8. QScriptEngine engine;
  9. QScriptValue sv = engine.evaluate("value = " + this->json);
  10. QScriptValueIterator it(sv);
  11. if(json.isEmpty())
  12. {
  13. rtnCode = RTNCODE_NETWORK_NOTAVAILABLE;
  14. rtnMemo = RTNMEMO_NETWORK_NOTAVAILABLE;
  15. }
  16. else if(json=="ABORT")
  17. {
  18. rtnCode = RTNCODE_NETWORK_ABORT;
  19. rtnMemo = RTNMEMO_NETWORK_ABORT;
  20. }
  21. else
  22. {
  23. rtnCode = RTNCODE_INVALID_FORMAT;
  24. rtnMemo = RTNMEMO_INVALID_FORMAT;
  25. while (it.hasNext())
  26. {
  27. it.next();
  28. if(it.name()=="rtnCode")
  29. {
  30. this->rtnCode = it.value().toInt32();
  31. }
  32. else if(it.name()=="rtnMemo")
  33. {
  34. this->rtnMemo = it.value().toString();
  35. }
  36. else if(it.name()=="userInfo")
  37. {
  38. QScriptValue sv1 = it.value();
  39. this->userid = sv1.property("userid").toString();
  40. this->usercode =sv1.property("usercode").toString();
  41. this->username =sv1.property("username").toString();
  42. this->qq =sv1.property("qq").toString();
  43. this->wangwang =sv1.property("wangwang").toString();
  44. this->email =sv1.property("email").toString();
  45. this->phone =sv1.property("phone").toString();
  46. this->paymoney =sv1.property("paymoney").toString();
  47. this->paytime =sv1.property("paytime").toString();
  48. this->regdate =sv1.property("regdate").toString();
  49. this->lastlogintime =sv1.property("lastlogintime").toString();
  50. this->lastloginip =sv1.property("lastloginip").toString();
  51. this->lastloginstatus =sv1.property("lastloginstatus").toString();
  52. this->memo =sv1.property("memo").toString();
  53. this->starttime = it.value().property("starttime").toString();
  54. this->endtime = it.value().property("endtime").toString();
  55. this->city = it.value().property("city").toString();
  56. this->companyname = it.value().property("companyname").toString();
  57. }
  58. }
  59. }
  60. }
  61. int RespGetMfUserInfo::getRtnCode()
  62. {
  63. return this->rtnCode;
  64. }
  65. QString RespGetMfUserInfo::getRtnMemo()
  66. {
  67. return this->rtnMemo;
  68. }
  69. QString RespGetMfUserInfo::getUserID()
  70. {
  71. return this->userid;
  72. }
  73. QString RespGetMfUserInfo::getUserCode()
  74. {
  75. return this->usercode;
  76. }
  77. QString RespGetMfUserInfo::getUserName()
  78. {
  79. return this->username;
  80. }
  81. QString RespGetMfUserInfo::getUserQQ()
  82. {
  83. return this->qq;
  84. }
  85. QString RespGetMfUserInfo::getUserWW()
  86. {
  87. return this->wangwang;
  88. }
  89. QString RespGetMfUserInfo::getUserEmail()
  90. {
  91. return this->email;
  92. }
  93. QString RespGetMfUserInfo::getUserPhone()
  94. {
  95. return this->phone;
  96. }
  97. QString RespGetMfUserInfo::getUserPayMoney()
  98. {
  99. return this->paymoney;
  100. }
  101. QString RespGetMfUserInfo::getUserPayTime()
  102. {
  103. return this->paytime;
  104. }
  105. QString RespGetMfUserInfo::getUserRegDate()
  106. {
  107. return this->regdate;
  108. }
  109. QString RespGetMfUserInfo::getUserLastLoginTime()
  110. {
  111. return this->lastlogintime;
  112. }
  113. QString RespGetMfUserInfo::getUserLastLoginIP()
  114. {
  115. return this->lastloginip;
  116. }
  117. QString RespGetMfUserInfo::getUserLoginStatus()
  118. {
  119. return this->lastloginstatus;
  120. }
  121. QString RespGetMfUserInfo::getUserMemo()
  122. {
  123. return this->memo;
  124. }
  125. QString RespGetMfUserInfo::getUserStartTime()
  126. {
  127. return this->starttime;
  128. }
  129. QString RespGetMfUserInfo::getUserEndTime()
  130. {
  131. return this->endtime;
  132. }
  133. QString RespGetMfUserInfo::getCity()
  134. {
  135. return this->city;
  136. }
  137. QString RespGetMfUserInfo::getCompanyName()
  138. {
  139. return this->companyname;
  140. }