网站
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

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