网站
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 

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