网站
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 

265 rader
9.8 KiB

  1. /**
  2. * Created by Administrator on 2021/4/5.
  3. */
  4. define(['jquery', "template", "Tools", 'swiper', 'itemsApi',"cupload"], function ($, template, Tools, swiper) {
  5. //数据存储
  6. var module = {
  7. data: {
  8. //焦点图数据
  9. focusListTop: [],
  10. showImgInformationDetail:''
  11. },
  12. };
  13. var tools = new Tools();
  14. module.init = function (page) {//底部友情链接
  15. //获取焦点图信息
  16. tools.doGet(websitePicture, {picType:1,status:0,orderByColumn:'picSort',isAsc:'desc'}, module.focusNewsTop , true);
  17. tools.doGet(friendsLinks, {}, module.bottomFriendsLinks, true);
  18. document.getElementById('realName').value = tools.getCookie('userName');
  19. document.getElementById('userNum').value = tools.getCookie('phone');
  20. document.getElementById('userBank').value = tools.getCookie('bankAddress');
  21. document.getElementById('bankId').value = tools.getCookie('bankCardNum');
  22. document.getElementById('bankCardName').value = tools.getCookie('bankCardName');
  23. document.getElementById('idCard').value = tools.getCookie('idCardNum');
  24. document.getElementById('payeePaymentLines').value = tools.getCookie('payeePaymentLines');
  25. tools.doGet(webDeptType+"/bank_account_type", {}, module.accountType, true);
  26. tools.doGet(webDeptType+"/bank_type_all", {}, module.bankType, true);
  27. //项目基本信息
  28. tools.doGet(outProject + '/id/'+getQueryVariable('id'), {}, module.outProjectInformation,true);
  29. //网站配置信息(网站名称 底部联系方式 公安备案号 网站备案号)
  30. tools.getWebConfig();
  31. };
  32. //底部友情链接
  33. module.bankType = function (data) {
  34. if (data.code == 200) {
  35. var content = data.data;
  36. var bankType = ''
  37. if(tools.getCookie('bankType') != undefined && tools.getCookie('bankType') != 'null' && tools.getCookie('bankType') != ''){
  38. bankType = content.filter(function (e) { return e.dictValue == tools.getCookie('bankType'); })[0].dictLabel;
  39. document.getElementById('bankType').value = bankType;
  40. }
  41. }
  42. }
  43. //底部友情链接
  44. module.accountType = function (data) {
  45. if (data.code == 200) {
  46. var content = data.data;
  47. if(tools.getCookie('accountType') != undefined){
  48. var accountType = content.filter(function (e) { return e.dictValue == tools.getCookie('accountType'); })[0].dictLabel;
  49. document.getElementById('accountType').value = accountType;
  50. }
  51. }
  52. }
  53. //焦点图数据
  54. module.focusNewsTop = function (data) {
  55. if (data.code == 200) {
  56. let focusArray = [];
  57. if(data.data.length<1){
  58. focusArray.push({
  59. picUrl:'../../../static/images/banner1.png'
  60. },{
  61. picUrl:'../../../static/images/banner2.png'
  62. },{
  63. picUrl:'../../../static/images/banner3.png'
  64. })
  65. }else{
  66. data.data.forEach(res=>{
  67. focusArray.push({
  68. picUrl:'/api'+res.picUrl
  69. })
  70. })
  71. }
  72. module.data.focusListTop = focusArray;
  73. var bannerFocusDataTop = template('bannerFocusDataTop', module.data);
  74. $("#bannerFocusTopContent").html(bannerFocusDataTop);
  75. new Swiper('#bannerFocusWrapTop', {
  76. paginationClickable: true,
  77. autoplay : 4000,
  78. loop:true
  79. })
  80. }
  81. }
  82. //底部友情链接
  83. module.bottomFriendsLinks = function (data) {
  84. if (data.code == 200) {
  85. var content = data.data;
  86. console.log(content)
  87. module.data.friendsLinksList = content;
  88. var friendsLinksData = template('friendsLinksData', module.data);
  89. $("#friendsLinksContent").html(friendsLinksData);
  90. }
  91. }
  92. //获取地址栏参数
  93. function getQueryVariable(variable){
  94. var query = window.location.search.substring(1);
  95. var vars = query.split("&");
  96. for (var i=0;i<vars.length;i++) {
  97. var pair = vars[i].split("=");
  98. if(pair[0] == variable){return pair[1];}
  99. }
  100. return(false);
  101. }
  102. //获取上传图片list
  103. module.upLoadAction = function(data){
  104. console.log(data)
  105. if (data.msg != '操作成功'){
  106. tools.initError(data.msg);
  107. return;
  108. }else{
  109. var upLoadList = [];
  110. var dataList = {};
  111. $('#cupload-3').find('input').each(function() {
  112. if($(this).val()!=''){
  113. upLoadList.push($(this).val())
  114. }
  115. });
  116. dataList["files"] = upLoadList;
  117. dataList["tableId"] = data.data;
  118. dataList["fileType"] = '';
  119. dataList["bizPath"] = 'transaction';
  120. dataList["tableName"] = 't_transaction_signup';
  121. console.log(dataList)
  122. tools.doPostImg(base64Upload, dataList, module.upLoadOver);
  123. }
  124. }
  125. module.upLoadOver = function(data){
  126. tools.initError('提交申请,等待审核')
  127. setTimeout(function () {
  128. tools.skip('itemsDetail.html?id='+getQueryVariable('id'))
  129. },2000)
  130. }
  131. module.outProjectInformation = function (data) {
  132. if (data.code == 200) {
  133. console.log(data)
  134. var content = data.data;
  135. $("#projectTitle").html('项目名称:'+content.projectName);
  136. $("#projectNum").html('需缴纳保证新:'+content.deposit+'元');
  137. $("#payAccount").html('保证金缴纳账号:'+content.payAccount);
  138. $("#accountName").html('账户名称:'+content.accountName);
  139. $("#bankName").html('开户银行:'+content.bankName);
  140. var cupload2 = new Cupload ({
  141. ele: '#cupload-3',
  142. num: 5,
  143. });
  144. }
  145. }
  146. submit = function(){
  147. if(module.onCheck()){
  148. var data = {};
  149. var realName = $('#realName').val();
  150. var userNum = $('#userNum').val();
  151. var userBank = $('#userBank').val();
  152. var bankId = $('#bankId').val();
  153. var idCard = $('#idCard').val();
  154. var bankCardName = $('#bankCardName').val();
  155. var payeePaymentLines = $('#payeePaymentLines').val();
  156. var bankType = $('#bankType').val();
  157. var accountType = $('#accountType').val();
  158. data['projectId'] = getQueryVariable('id');
  159. data['memberId'] = tools.getCookie('memberId');
  160. data['realname'] = realName;
  161. data['idCardNum'] = idCard;
  162. data['phone'] = userNum;
  163. data['address'] = tools.getCookie('address');
  164. data['bankAddress'] = userBank;
  165. data['bankCardName'] = bankCardName;
  166. data['bankCardNum'] = bankId;
  167. data['payeePaymentLines'] = payeePaymentLines;
  168. data['bankType'] = bankType;
  169. data['accountType'] = accountType;
  170. data['status'] = 'Y';
  171. tools.doPost(signupSubmit, data, module.upLoadAction);
  172. }
  173. }
  174. //验证表单
  175. module.onCheck = function () {
  176. var userNum = $('#userNum').val();
  177. var realName = $('#realName').val();
  178. var userBank = $('#userBank').val();
  179. var bankCardName = $('#bankCardName').val();
  180. var bankId = $('#bankId').val();
  181. var idCard = $('#idCard').val();
  182. var payeePaymentLines = $('#payeePaymentLines').val();
  183. var bankType = $('#bankType').val();
  184. var accountType = $('#accountType').val();
  185. if ($('#checkAgree:checked').val() == undefined ) {
  186. $('#checkAgree')[0].focus()
  187. tools.initTips('请选择我已同意', 'right', $('#checkAgree')[0], 2000)
  188. return false;
  189. }
  190. if (realName == '') {
  191. $('#realName')[0].focus()
  192. tools.initTips('姓名不可为空', 'right', $('#realName')[0], 2000)
  193. return false;
  194. }
  195. if (userNum == '') {
  196. $('#userNum')[0].focus()
  197. tools.initTips('会员账号不可为空', 'right', $('#userNum')[0], 2000)
  198. return false;
  199. }
  200. if (accountType == '') {
  201. $('#accountType')[0].focus()
  202. tools.initTips('账户类型不可为空', 'right', $('#accountType')[0], 2000)
  203. return false;
  204. }
  205. if (bankType == '') {
  206. $('#bankType')[0].focus()
  207. tools.initTips('所属银行不可为空', 'right', $('#bankType')[0], 2000)
  208. return false;
  209. }
  210. if (bankCardName == '') {
  211. $('#bankCardName')[0].focus()
  212. tools.initTips('开户行姓名不可为空', 'right', $('#bankCardName')[0], 2000)
  213. return false;
  214. }
  215. if (userBank == '') {
  216. $('#userBank')[0].focus()
  217. tools.initTips('开户银行不可为空', 'right', $('#userBank')[0], 2000)
  218. return false;
  219. }
  220. if (bankId == '') {
  221. $('#bankId')[0].focus()
  222. tools.initTips('银行卡号不可为空', 'right', $('#bankId')[0], 2000)
  223. return false;
  224. }
  225. if (payeePaymentLines == '') {
  226. $('#payeePaymentLines')[0].focus()
  227. tools.initTips('联行号不可为空', 'right', $('#payeePaymentLines')[0], 2000)
  228. return false;
  229. }
  230. if (idCard == '') {
  231. $('#idCard')[0].focus()
  232. tools.initTips('身份证号不可为空', 'right', $('#idCard')[0], 2000)
  233. return false;
  234. }
  235. return true;
  236. }
  237. module.toTips = function(data){
  238. console.log(data)
  239. if(data.msg != '操作成功'){
  240. tools.initError(data.msg)
  241. }else{
  242. tools.initError('提交申请,等待审核')
  243. }
  244. }
  245. return module;
  246. });