农燊高科官方网站
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

pirms 4 gadiem
pirms 4 gadiem
pirms 4 gadiem
pirms 4 gadiem
pirms 4 gadiem
pirms 4 gadiem
pirms 4 gadiem
pirms 4 gadiem
pirms 4 gadiem
pirms 4 gadiem
pirms 4 gadiem
pirms 4 gadiem
pirms 4 gadiem
pirms 4 gadiem
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. /**
  2. * Created by Administrator on 2021/4/5.
  3. */
  4. define(['jquery', "template", "Tools", "user", "paging"], function ($, template, Tools) {
  5. //数据存储
  6. var module = {
  7. data: {
  8. userInformationDetail:[],
  9. userSupplyInformationList:'',
  10. consultingInformationList:'',
  11. biddingInformationList:'',
  12. //页码
  13. pageNum: 1,
  14. //页码集合
  15. pageList: [],
  16. //每页数量
  17. pageSize: 1,
  18. //总页数
  19. pageCount:0,
  20. //用户ID
  21. memberId:0,
  22. //用户资料form
  23. form:{
  24. }
  25. },
  26. };
  27. var tools = new Tools();
  28. module.init = function (page) {
  29. //用户资料
  30. tools.doGet(userData, {}, module.userData);
  31. //用户资料
  32. //tools.doPut(userData, {id:}, module.userData,true);
  33. //用户资料鼠标悬浮
  34. module.userHover();
  35. //个人中心选项卡鼠标悬浮
  36. module.userListHover();
  37. };
  38. //个人中心用户信息
  39. module.userData = function(data){
  40. if (data.code == 200) {
  41. var content = data.user;
  42. console.log(content)
  43. tools.doGet(userMember+'/'+content.userId, {}, module.userMember);//memberType 1个人 2单位
  44. }
  45. }
  46. //个人中心用户资料
  47. module.userMember = function(data){
  48. if (data.code == 200) {
  49. var content = data.data;
  50. console.log(data)
  51. module.data.userInformationDetail = content;
  52. module.data.memberType = content.memberType;
  53. if(content.memberType == '1'){
  54. document.getElementById('companyInformationContent').style.display = 'none';
  55. document.getElementById('userInformationContent').style.display = 'block';
  56. var userInformationData = template('userInformationData', module.data);
  57. $("#userInformationContent").html(userInformationData);
  58. }else{
  59. document.getElementById('companyInformationContent').style.display = 'block';
  60. document.getElementById('userInformationContent').style.display = 'none';
  61. var companyInformationData = template('companyInformationData', module.data);
  62. $("#companyInformationContent").html(companyInformationData);
  63. }
  64. document.getElementById('bankAddress').value = content.bankAddress;
  65. document.getElementById('bankCardName').value = content.bankCardName;
  66. document.getElementById('bankCardNum').value = content.bankCardNum;
  67. document.getElementById('phone').innerHTML = content.phone;
  68. module.data.memberId = content.id;
  69. console.log(content.memberType)
  70. //我的供求
  71. tools.doGet(userSupply, {memberId:content.id,pageNum:module.data.pageNum,pageSize:module.data.pageSize}, module.userSupply);
  72. //我的咨询
  73. tools.doGet(userConsulting, {memberId:content.id,pageNum:module.data.pageNum,pageSize:module.data.pageSize}, module.consulting);
  74. //我的竞价
  75. tools.doGet(userBidding, {memberId:content.id,pageNum:module.data.pageNum,pageSize:module.data.pageSize}, module.bidding);
  76. }
  77. }
  78. //个人中心我的供求
  79. module.userSupply = function(data){
  80. console.log(data)
  81. if (data.code == 200) {
  82. var content = data.rows;
  83. console.log(data)
  84. var pageCount = (data.total/module.data.pageSize).toFixed(0);
  85. if (pageCount < 1){
  86. pageCount = 1;
  87. }
  88. if(module.data.userSupplyInformationList == '') {
  89. // 初始化 分页器
  90. var page_s1 = createPage('.page_s1');
  91. // 设置分页
  92. setPage(page_s1, {
  93. pageTotal: data.total, // 数据总条数
  94. pageSize: module.data.pageSize, // 每页显示条数
  95. pageCurrent: 1, // 当前页
  96. maxBtnNum: 5, // 最多按钮个数 (最少5个)
  97. })
  98. $('#page_s1').html('共' + pageCount + '页')
  99. }
  100. module.data.userSupplyInformationList = content;
  101. var userSupplyInformationData = template('userSupplyInformationData', module.data);
  102. $("#userSupplyInformationContent").html(userSupplyInformationData);
  103. }
  104. }
  105. //个人中心我的咨询
  106. module.consulting = function(data){
  107. if (data.code == 200) {
  108. var content = data.rows;
  109. var pageCount = (data.total/module.data.pageSize).toFixed(0);
  110. if (pageCount < 1){
  111. pageCount = 1;
  112. }
  113. if(module.data.consultingInformationList == '') {
  114. // 初始化 分页器
  115. var page_s1 = createPage('.page_s2');
  116. // 设置分页
  117. setPage(page_s1, {
  118. pageTotal: data.total, // 数据总条数
  119. pageSize: module.data.pageSize, // 每页显示条数
  120. pageCurrent: 1, // 当前页
  121. maxBtnNum: 5, // 最多按钮个数 (最少5个)
  122. })
  123. }
  124. module.data.consultingInformationList = content;
  125. $('#page_s2').html('共'+pageCount+'页')
  126. var consultingInformationData = template('consultingInformationData', module.data);
  127. $("#consultingInformationContent").html(consultingInformationData);
  128. }
  129. }
  130. //个人中心我的竞价
  131. module.bidding = function(data){
  132. if (data.code == 200) {
  133. var content = data.rows;
  134. console.log(content)
  135. var pageCount = (data.total/module.data.pageSize).toFixed(0);
  136. if (pageCount < 1){
  137. pageCount = 1;
  138. }
  139. if(module.data.biddingInformationList == '') {
  140. // 初始化 分页器
  141. var page_s1=createPage('.page_s3');
  142. // 设置分页
  143. setPage(page_s1, {
  144. pageTotal: data.total, // 数据总条数
  145. pageSize: module.data.pageSize, // 每页显示条数
  146. pageCurrent: 1, // 当前页
  147. maxBtnNum: 5, // 最多按钮个数 (最少5个)
  148. })
  149. $('#page_s3').html('共' + pageCount + '页')
  150. }
  151. module.data.biddingInformationList = content;
  152. var biddingInformationData = template('biddingInformationData', module.data);
  153. $("#biddingInformationContent").html(biddingInformationData);
  154. }
  155. }
  156. tabCheck = function(type){
  157. document.getElementById('user').className = '';
  158. document.getElementById('bank').className = '';
  159. document.getElementById(type).className = 'active';
  160. console.log(type)
  161. document.getElementById('userInformationContent').style.display = 'none';
  162. document.getElementById('companyInformationContent').style.display = 'none';
  163. document.getElementById('bankInformationContent').style.display = 'none';
  164. document.getElementById('phoneInformationContent').style.display = 'none';
  165. if (module.data.memberType == '2' && type == 'user'){
  166. document.getElementById('companyInformationContent').style.display = 'block';
  167. }else if (module.data.memberType == '1' && type == 'user'){
  168. document.getElementById('userInformationContent').style.display = 'block';
  169. }else{
  170. document.getElementById(type+'InformationContent').style.display = 'block';
  171. }
  172. }
  173. phoneUpdate = function(type){
  174. document.getElementById(type+'InformationContent').style.display = 'none';
  175. document.getElementById('phoneInformationContent').style.display = 'block';
  176. }
  177. tabLeftCheck = function(type){
  178. for (var i = 1 ; i < 5 ; i++){
  179. document.getElementById('icon-list'+i).className = '';
  180. }
  181. document.getElementById(type).className = 'active';
  182. document.getElementById('userInformation').style.display = 'none';
  183. document.getElementById('supplyInformation').style.display = 'none';
  184. document.getElementById('consultingInformation').style.display = 'none';
  185. document.getElementById('biddingInformation').style.display = 'none';
  186. if(type == 'icon-list1'){
  187. document.getElementById('userInformation').style.display = 'block';
  188. }
  189. if(type == 'icon-list2'){
  190. document.getElementById('supplyInformation').style.display = 'block';
  191. module.data.clickType = 'supply';
  192. }
  193. if(type == 'icon-list3'){
  194. document.getElementById('consultingInformation').style.display = 'block';
  195. module.data.clickType = 'consulting';
  196. }
  197. if(type == 'icon-list4'){
  198. document.getElementById('biddingInformation').style.display = 'block';
  199. module.data.clickType = 'bidding';
  200. }
  201. module.data.pageNum = 1 ;
  202. }
  203. //翻页
  204. turnThePage = function (pageNum) {
  205. module.data.pageNum = pageNum ;
  206. if(module.data.clickType == 'supply'){
  207. tools.doGet(userSupply, {memberId:module.data.memberId,pageNum:pageNum,pageSize:module.data.pageSize}, module.userSupply);
  208. }
  209. if(module.data.clickType == 'consulting'){
  210. tools.doGet(userConsulting, {memberId:module.data.memberId,pageNum:pageNum,pageSize:module.data.pageSize}, module.consulting);
  211. }
  212. if(module.data.clickType == 'bidding'){
  213. tools.doGet(userBidding, {memberId:module.data.memberId,pageNum:pageNum,pageSize:module.data.pageSize}, module.bidding);
  214. }
  215. }
  216. //个人用户资料修改
  217. formAction = function (name,value){
  218. console.log(name+'-------'+value)
  219. return;
  220. module.data.form.name = value ;
  221. console.log(module.data.form)
  222. }
  223. //个人中心选项卡鼠标悬浮
  224. module.userListHover = function(){
  225. document.getElementById('icon-list1').onmouseout = function(){
  226. document.getElementById('icon1').src = '../../static/images/user_index_icon1.png'
  227. }
  228. document.getElementById('icon-list1').onmouseover = function(){
  229. document.getElementById('icon1').src = '../../static/images/user_index_icon5.png'
  230. }
  231. document.getElementById('icon-list2').onmouseout = function(){
  232. document.getElementById('icon2').src = '../../static/images/user_index_icon2.png'
  233. }
  234. document.getElementById('icon-list2').onmouseover = function(){
  235. document.getElementById('icon2').src = '../../static/images/user_index_icon6.png'
  236. }
  237. document.getElementById('icon-list3').onmouseout = function(){
  238. document.getElementById('icon3').src = '../../static/images/user_index_icon3.png'
  239. }
  240. document.getElementById('icon-list3').onmouseover = function(){
  241. document.getElementById('icon3').src = '../../static/images/user_index_icon7.png'
  242. }
  243. document.getElementById('icon-list4').onmouseout = function(){
  244. document.getElementById('icon4').src = '../../static/images/user_index_icon4.png'
  245. }
  246. document.getElementById('icon-list4').onmouseover = function(){
  247. document.getElementById('icon4').src = '../../static/images/user_index_icon8.png'
  248. }
  249. }
  250. //用户资料鼠标悬浮
  251. module.userHover = function () {
  252. document.getElementById('userName').onmouseover = function(){
  253. document.getElementById('headHover').style.display = 'block';
  254. };
  255. document.getElementById('headHover').onmouseover = function(){
  256. document.getElementById('headHover').style.display = 'block';
  257. };
  258. document.getElementById('userName').onmouseout = function(){
  259. document.getElementById('headHover').style.display = 'none';
  260. };
  261. document.getElementById('headHover').onmouseout = function(){
  262. document.getElementById('headHover').style.display = 'none';
  263. };
  264. }
  265. return module;
  266. });