callback.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>请填写资料</title>
  6. <link href="/css/join/style.css?version=<?= $this->context->version ?>" rel="stylesheet" type="text/css">
  7. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  8. <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui" />
  9. <meta name="apple-mobile-web-app-capable" content="yes" />
  10. <meta name="format-detection" content="telephone=no, email=no" />
  11. <link rel="stylesheet" href="/css/bootstrap.css?version=<?= $this->context->version ?>">
  12. <link rel="stylesheet" href="/css/custom.css?version=<?= $this->context->version ?>">
  13. <script src="/js/jquery-1.11.1.min.js?version=<?= $this->context->version ?>"></script>
  14. <script src="/js/bootstrap.min.js?version=<?= $this->context->version ?>"></script>
  15. <script charset="utf-8" src="http://map.qq.com/api/js?v=2.exp&libraries=geometry&key=OFWBZ-2NTHP-EHNDD-LKWQY-GANM7-PXBJH"></script>
  16. <script type="text/javascript" src="/js/jweixin-1.0.0.js?version=<?= $this->context->version ?>" ></script>
  17. <style>
  18. label{
  19. font-weight:normal;
  20. }
  21. .xhMask{position:fixed;left:0;top:0;width:100%;height:100%;z-index:99;background-color:gray;filter:alpha(opacity=25);opacity:0.2;display:none;}
  22. .xhBeCenterBox{position:fixed;width:40px;height:40px;display:block;z-index:999;display:none;}
  23. .hintMention{position:fixed;width:200px;height:120px;display:block;z-index:999;background:white;border-radius:10px;display:none;}
  24. .xhCenterModal{
  25. background-color: #8dc63f;
  26. border-color: #8dc63f;
  27. color: #ffffff;
  28. position:fixed;
  29. width:20%;
  30. font-size:12px;
  31. height:auto;
  32. padding:15px;
  33. z-index:999;
  34. display:none;
  35. width:180px;
  36. text-align:center;
  37. border-radius:4px;
  38. }
  39. </style>
  40. </head>
  41. <body>
  42. <div name="xhCenterModal" class="xhCenterModal"></div>
  43. <div name="applyBeCenterMask" class="xhMask"></div>
  44. <div class="xhBeCenterBox" name="applyBeCenter"><img src="/images/loader.gif" style="width:42px;" /></div>
  45. <div class="hintMention" name="hintMention" style="text-align:center;padding-top:15px;">
  46. <p>恭喜!邀请码有效</p>
  47. <p>优惠<span name="favorable" style="color:red;">0</span>元</p>
  48. <button name="closeHint" type="button" class="btn btn-info btn-single" style="background-color:#68b828;border-color: #e5e5e5;padding:4px 6px;margin:0 auto;">确认</button>
  49. </div>
  50. <div class="panel panel-default">
  51. <div class="panel-body">
  52. <form role="form">
  53. <div class="form-group">
  54. <label class="col-sm-2 control-label">*花店名称:</label>
  55. <div class="col-sm-10">
  56. <input type="text" class="form-control" name="merchantName" placeholder="" <?php if($merchantName == $demoName){ ?>readonly="readonly"<?php } ?> value="<?= $merchantName ?>">
  57. <p></p>
  58. </div>
  59. </div>
  60. <div class="form-group">
  61. <label class="col-sm-2 control-label">*花店地址:</label>
  62. <div id="citySelect" class="col-sm-10" style="padding-bottom:5px;">
  63. <select class="form-control prov" name="province" style="width:auto;display:inline;">
  64. <option value="福建">福建</option>
  65. </select>
  66. <select name="city" class="form-control city" style="width:auto;display:inline;">
  67. <option value="厦门">厦门</option>
  68. </select>
  69. <input type="text" style="margin-top:4px;" class="form-control" isSelect="false" oninput="getArea(this.value);" onpropertychange="getArea(this.value)" name="shopAddress" placeholder="所在街道、小区或商场">
  70. <div style="z-index: 999; background: rgb(243, 243, 243);margin-top:4px;" id="infoDiv">
  71. <div style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; color: rgb(51, 51, 51); line-height: 20px; font-family: 'Tahoma 宋体 Arial'; border: 0px none;">
  72. </div>
  73. </div>
  74. <input type="text" class="form-control" name="shopAddressFloor" placeholder="楼号或门牌号(选填)">
  75. <p></p>
  76. </div>
  77. </div>
  78. <div style="margin-left:14px;">
  79. <div class="form-group" style="display:inline-block;padding:0;margin-right:8px;margin-bottom:0px;">
  80. <label class="col-sm-2 control-label" style="padding:0px;" >*店门照片</label>
  81. <div class="col-sm-10" style="padding:0px;">
  82. <div style="width:81px;height:100px;display:inline-block;">
  83. <a href="javascript:;" class="a-upload" name="shopImg">选择图片</a>
  84. <div style="width:80px;height:50px;display:inline-block;margin-bottom:4px;margin-top:3px;border:1px solid #CCC;overflow:hidden;">
  85. <img src="/images/nopicture2.png" name="shopImg" style="width:80px;" />
  86. </div>
  87. </div>
  88. <input type="hidden" name="shopImg" value="" />
  89. <p></p>
  90. </div>
  91. </div>
  92. <div class="form-group" style="display:inline-block;padding:0;margin-right:8px;margin-bottom:0px;">
  93. <label class="col-sm-2 control-label" style="padding:0px;">*店内照片</label>
  94. <div class="col-sm-10" style="padding:0px;">
  95. <div style="width:81px;height:100px;display:inline-block;">
  96. <a href="javascript:;" class="a-upload" name="shopImg2">选择图片</a>
  97. <div style="width:80px;height:50px;display:inline-block;margin-bottom:3px;margin-top:3px;border:1px solid #CCC;overflow:hidden;">
  98. <img src="/images/nopicture2.png" name="shopImg2" style="width:80px;" />
  99. </div>
  100. </div>
  101. <input type="hidden" name="shopImg2" value="" />
  102. <p></p>
  103. </div>
  104. </div>
  105. </div>
  106. <div class="form-group">
  107. <label class="col-sm-2 control-label">*支付宝帐号:</label>
  108. <div class="col-sm-10">
  109. <input type="text" class="form-control" name="alipayAccount" placeholder="户主支付宝或公司支付宝帐号" value="">
  110. <p></p>
  111. </div>
  112. </div>
  113. <div class="form-group">
  114. <label class="col-sm-2 control-label">*支付宝帐号姓名:</label>
  115. <div class="col-sm-10">
  116. <input type="text" class="form-control" name="alipayAccountName" placeholder="请填写真实姓名,否则提现等会失败" value="">
  117. <p></p>
  118. </div>
  119. </div>
  120. <div class="form-group">
  121. <label class="col-sm-2 control-label">*主营业务(选择后不可修改):</label>
  122. <div class="col-sm-10">
  123. <label><input name="manageStyle" type="radio" checked="checked" value="0" />零售</label>&nbsp;&nbsp;
  124. <label><input name="manageStyle" type="radio" value="1" />培训兼零售</label>&nbsp;&nbsp;
  125. <label><input name="manageStyle" type="radio" value="2" />鲜花批发</label>
  126. <p name="mobileHint"></p>
  127. </div>
  128. </div>
  129. <div class="form-group">
  130. <label class="col-sm-2 control-label">邀请码:</label>
  131. <div class="col-sm-10">
  132. <input type="text" class="form-control" name="inviteCode" placeholder="选填">
  133. <p name="mobileHint"></p>
  134. </div>
  135. </div>
  136. <div class="form-group">
  137. <label class="col-sm-2 control-label" style="color:#68b828;font-size:15px;">
  138. 年服务费:¥<span name="setPrice" pre-price="<?= $set['price'] ?>"><?= $set['price'] ?></span>元
  139. </label>
  140. </div>
  141. <div class="form-group-separator"></div>
  142. <div class="form-group" style="text-align:center;">
  143. <button type="button" name="applySubmit" class="btn btn-info btn-single">确认</button>
  144. </div>
  145. </form>
  146. </div>
  147. </div>
  148. <script type="text/javascript" src="/js/city/jquery.cityselect.js?version=<?= $this->context->version ?>"></script>
  149. <script src="/js/util.js?version=<?= $this->context->version ?>"></script>
  150. <script>
  151. var searchService = null;
  152. $(window).load(function() {
  153. //调用Poi检索类
  154. searchService = new qq.maps.SearchService({
  155. complete: function(results) {
  156. //设置回调函数参数
  157. var pois = results.detail.pois;
  158. if(pois == undefined ){
  159. $("#infoDiv div").html('');
  160. return;
  161. }
  162. var html = '<div style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; color: rgb(51, 51, 51); line-height: 20px; font-family:"Tahoma 宋体 Arial"; border: 0px none;">';
  163. html += '<div style="position: relative; height: 20px; line-height: 20px; font-size: 12px; color: rgb(153, 153, 153); padding: 0px 5px; background-color: rgb(243, 243, 243);">';
  164. html += '<span>搜索结果</span>';
  165. html += '</div>';
  166. html += '<ol style="list-style: none; padding: 0px; margin: 0px;">';
  167. for (var i = 0, l = pois.length; i < l; i++) {
  168. var poi = pois[i];
  169. (function(n) {
  170. var address = '';
  171. if(pois[n].address != undefined){//腾讯地图 搜索出来的地址,下方有解释地址,有可能为空的情况,如搜索 思明区
  172. address = pois[n].address;
  173. }
  174. var no = i+1;
  175. html += '<li onclick="getSearchArea(\''+pois[n].latLng+'\',\''+pois[n].name+'\')" style="margin: 2px 0; padding: 0 5px; cursor: pointer; zoom: 1;">';
  176. html += '<div style="float: left; display: inline; width: 20px; height: 20px; line-height: 20px; overflow: hidden; text-align: center;">'+no+'.</div>';
  177. html += '<div style="overflow: hidden; padding: 0 5px; zoom: 1;">';
  178. html += '<div style="color: #0059B3;">'+pois[n].name+'</div>';
  179. html += '<div>';
  180. html += '<div>';
  181. html += '<span style="color: #999999; font-size: 12px;">'+address+'</span>';
  182. html += '</div>';
  183. html += '<div>';
  184. html += '<span style="color: #999999; font-size: 12px;"> </span>';
  185. html += '</div>';
  186. html += '</div>';
  187. html += '</div>';
  188. html += '</li>';
  189. })(i);
  190. }
  191. html += '</ol>';
  192. html += '</div>';
  193. $("#infoDiv div").html(html);
  194. $("input[name=shopAddress]").attr("isSelect","false");//还没有选择搜索出来的内容
  195. },
  196. error: function() {
  197. $("#infoDiv div").html('');
  198. $("input[name=shopAddress]").attr("isSelect","false");//还没有选择搜索出来的内容
  199. }
  200. });
  201. });
  202. $("#citySelect").citySelect({
  203. prov: '福建',
  204. city: '厦门',
  205. nodata: "none"
  206. });
  207. //根据输入的去搜索
  208. function getArea()
  209. {
  210. var poiText = arguments[0];
  211. var city = $("select[name=city]").find("option:selected").val();
  212. if(city.length <= 0){
  213. return;
  214. }
  215. $("input[name=shopAddress]").attr("isSelect","false");
  216. searchService.setLocation(city);
  217. searchService.search(poiText);
  218. searchService.setPageIndex(0);
  219. searchService.setPageCapacity(10);
  220. }
  221. var shopLat,shopLong;
  222. //选择搜索的地址结果
  223. function getSearchArea()
  224. {
  225. var latLng = arguments[0];
  226. var area = arguments[1];
  227. $("input[name=shopAddress]").val(area).attr("isSelect","true").siblings('p').html('');
  228. var arr = latLng.split(",");
  229. shopLat = $.trim(arr[0]);//收件人纬度
  230. shopLong = $.trim(arr[1]);//收件人经度
  231. $("#infoDiv div").html('');
  232. }
  233. var merchantName = $("input[name=merchantName]");
  234. var shopAddress = $("input[name=shopAddress]");
  235. var inviteCode = $("input[name=inviteCode]");
  236. var shopImg = $("input[name=shopImg]");
  237. var shopImg2 = $("input[name=shopImg2]");
  238. var alipayAccount = $(":input[name=alipayAccount]");
  239. var alipayAccountName = $(":input[name=alipayAccountName]");
  240. var applyCheck = [merchantName,shopAddress,shopImg,shopImg2,alipayAccount];
  241. var wWidth = $(window).width();
  242. var wHeight = $(window).height();
  243. var scrollHeight = $(document).scrollTop();//获取当前窗口距离页面顶部高度
  244. var applyBeCenter = $("div[name=applyBeCenter]");
  245. var applyBeCenterMask = $("div[name=applyBeCenterMask]");
  246. var applyHeight = applyBeCenter.outerHeight();//取div高
  247. var applyWidth = applyBeCenter.outerWidth();//取div宽
  248. var rH = (wHeight - applyHeight) / 2 + scrollHeight;
  249. var rW = (wWidth - applyWidth) /2;
  250. applyBeCenter.css({"z-index":998,"position":"absolute","left":rW,"top":rH,});
  251. var hintMention = $("div[name=hintMention]");
  252. var hintHeight = hintMention.outerHeight();//取div高
  253. var hintWidth = hintMention.outerWidth();//取div宽
  254. var tH = (wHeight - hintHeight) / 2 + scrollHeight;
  255. var tW = (wWidth - hintWidth) /2;
  256. hintMention.css({"z-index":998,"position":"absolute","left":tW,"top":tH,});
  257. //浏览器有滚动条时的操作
  258. $(window).scroll(function() {
  259. scrollHeight = $(document).scrollTop();
  260. rH = (wHeight - applyHeight) / 2 + scrollHeight;
  261. rW = (wWidth - applyWidth) /2;
  262. applyBeCenter.css({"z-index":998,"position":"absolute","left":rW,"top":rH,});
  263. tH = (wHeight - hintHeight) / 2 + scrollHeight;
  264. tW = (wWidth - hintWidth) /2;
  265. hintMention.css({"z-index":998,"position":"absolute","left":tW,"top":tH,});
  266. });
  267. function showPop()
  268. {
  269. applyBeCenterMask.css('display','block');
  270. applyBeCenter.css("display","block");
  271. }
  272. function hidePop()
  273. {
  274. applyBeCenterMask.css('display','none');
  275. applyBeCenter.css("display","none");
  276. }
  277. wx.config({
  278. debug:false,
  279. appId: '',
  280. timestamp: 0,
  281. nonceStr: '',
  282. signature: '',
  283. jsApiList: [
  284. 'checkJsApi',
  285. 'onMenuShareTimeline',
  286. 'onMenuShareAppMessage',
  287. 'onMenuShareQQ',
  288. 'onMenuShareWeibo',
  289. 'chooseImage',
  290. 'uploadImage',
  291. ]
  292. });
  293. //选择图片
  294. $("a[name=shopImg]").click(function(){
  295. wx.chooseImage({
  296. count: 1, // 默认9
  297. sizeType: ['original'], // 可以指定是原图还是压缩图,默认二者都有
  298. sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
  299. success: function (res) {
  300. localIds = res.localIds; // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片
  301. var myLocalId = localIds[0];
  302. showPop();
  303. wx.uploadImage({
  304. localId: myLocalId, // 需要上传的图片的本地ID,由chooseImage接口获得
  305. isShowProgressTips: 0, // 默认为1,显示进度提示
  306. success: function (res) {
  307. var serverId = res.serverId; // 返回图片的服务器端ID mediaId 图片有效期3天
  308. $.ajax({type:"GET",url:'/join/download-wx-img?mediaId='+serverId,dataType:'json',async:false,success:function(data){
  309. if(data.code == 'A0001'){
  310. $("input[name=shopImg]").val(data.data['large']).attr('applyInputStatus','yes').siblings('p').html('');
  311. $("img[name=shopImg]").attr('src','<?= Yii::$app->params['imgUrl'] ?>'+data.data['medium']);
  312. hidePop();//隐藏浮层
  313. }
  314. }
  315. });
  316. }
  317. });
  318. }
  319. });
  320. });
  321. //选择图片
  322. $("a[name=shopImg2]").click(function(){
  323. wx.chooseImage({
  324. count: 1, // 默认9
  325. sizeType: ['original'], // 可以指定是原图还是压缩图,默认二者都有
  326. sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
  327. success: function (res) {
  328. localIds = res.localIds; // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片
  329. var myLocalId = localIds[0];
  330. showPop();
  331. wx.uploadImage({
  332. localId: myLocalId, // 需要上传的图片的本地ID,由chooseImage接口获得
  333. isShowProgressTips: 0, // 默认为1,显示进度提示
  334. success: function (res) {
  335. var serverId = res.serverId; // 返回图片的服务器端ID mediaId 图片有效期3天
  336. $.ajax({type:"GET",url:'/join/download-wx-img?mediaId='+serverId,dataType:'json',async:false,success:function(data){
  337. if(data.code == 'A0001'){
  338. $("input[name=shopImg2]").val(data.data['large']).attr('applyInputStatus','yes').siblings('p').html('');
  339. $("img[name=shopImg2]").attr('src','<?= Yii::$app->params['imgUrl'] ?>'+data.data['medium']);
  340. hidePop();//隐藏浮层
  341. }
  342. }
  343. });
  344. }
  345. });
  346. }
  347. });
  348. });
  349. setApplyStats(merchantName, '请填花店名称', function(val, mess){
  350. var info=[false, mess];
  351. if(val.length <= 0){
  352. info[1] = '请填花店名称';
  353. }else if(getLength(val) >=0 && getLength(val) <=20){
  354. $.ajax({type:"GET",url:"/join/check-merchant-name?merchantName="+val,dataType:'json',async:false,success:function(data){
  355. if(data.code == 'A0001'){
  356. info[0] = true;
  357. }else{
  358. info[1] = data.msg;
  359. }
  360. }});
  361. }else{
  362. info[0] = false;
  363. }
  364. return info;
  365. });
  366. setApplyStats(shopAddress, '请填写选择地址', function(val, mess){
  367. var info=[false, mess];
  368. if(val.length <= 0){
  369. info[1] = '请填写选择地址';
  370. }else if(getLength(val) >=0 && getLength(val) <=20){
  371. info[0] = true;
  372. info[1] = '填写正确';
  373. }else{
  374. info[0] = false;
  375. }
  376. return info;
  377. });
  378. setApplyStats(shopImg, '请上传照片', function(val, mess){
  379. var info=[false, mess];
  380. if(val.length <= 0){
  381. info[1] = '请上传照片';
  382. }else if(getLength(val) >=0 && getLength(val) <=20){
  383. info[0] = true;
  384. info[1] = '填写正确';
  385. }else{
  386. info[0] = false;
  387. }
  388. return info;
  389. });
  390. setApplyStats(shopImg2, '请上传照片', function(val, mess){
  391. var info=[false, mess];
  392. if(val.length <= 0){
  393. info[1] = '请上传照片';
  394. }else if(getLength(val) >=0 && getLength(val) <=20){
  395. info[0] = true;
  396. info[1] = '填写正确';
  397. }else{
  398. info[0] = false;
  399. }
  400. return info;
  401. });
  402. setApplyStats(inviteCode, '请填写邀请码', function(val, mess){
  403. var info=[false, mess];
  404. if(val.length <= 0){
  405. info[0] = true;
  406. }else if(val.length > 0){
  407. showPop();//显示浮层
  408. $.ajax({type:"GET",url:"/join/check-invite-code?code="+val,dataType:'json',async:false,success:function(data){
  409. if(data.code == 'A0001'){
  410. info[0] = true;
  411. applyBeCenter.css("display","none");
  412. hintMention.css("display","block");
  413. $("span[name=favorable]").html(data.data.save);
  414. var prePrice = $("span[name=setPrice]").attr('pre-price');
  415. var newPrice = calcSub(prePrice,data.data.save);//减去邀请码价值
  416. $("span[name=setPrice]").html(newPrice);
  417. }else{
  418. info[1] = data.msg;
  419. hidePop();//隐藏浮层
  420. }
  421. }});
  422. }else{
  423. info[0] = false;
  424. }
  425. return info;
  426. });
  427. setApplyStats(alipayAccount, '请填写支付宝帐号', function(val, mess){
  428. var info=[false, mess];
  429. if(val.length <= 0){
  430. info[1] = '请填写支付宝帐号';
  431. }else if(getLength(val) >=0 && getLength(val) <=100){
  432. info[0] = true;
  433. }else{
  434. info[0] = false;
  435. }
  436. return info;
  437. });
  438. setApplyStats(alipayAccountName, '请填写支付宝帐号姓名', function(val, mess){
  439. var info=[false, mess];
  440. if(val.length <= 0){
  441. info[1] = '请填写支付宝帐号姓名';
  442. }else if(getLength(val) >=0 && getLength(val) <=1000){
  443. info[0] = true;
  444. }else{
  445. info[0] = false;
  446. }
  447. return info;
  448. });
  449. $("button[name=applySubmit]").click(function(){
  450. var submitButtonObj = $(this);
  451. if(submitButtonObj.attr('submitStatus') == 'yes'){
  452. xhPopMsg('请稍候…',1000);
  453. return;
  454. }
  455. submitButtonObj.attr('submitStatus','yes');
  456. setTimeout(function(){
  457. submitButtonObj.attr('submitStatus','no');
  458. },3000);
  459. var applySubmitStatus = true;
  460. for(var om=0;om<applyCheck.length;om++){
  461. var singleObj = applyCheck[om]
  462. if(singleObj.attr('applyInputStatus') == undefined){
  463. singleObj.blur();
  464. }
  465. if(singleObj.attr('applyInputStatus') == 'no'){
  466. applySubmitStatus = false;
  467. }
  468. }
  469. var shopAddressVal = shopAddress.val();
  470. if(shopAddressVal.length > 0 && shopAddress.attr('isSelect') == 'false'){
  471. shopAddress.next('p').css("color","red").html('请选择下面的地址,或重新搜索选择');
  472. return;
  473. }
  474. if(applySubmitStatus == false){
  475. return;
  476. }
  477. shopAddressVal += $(":input[name=shopAddressFloor]").val();//楼号、门牌
  478. var province = $("select[name=province] option:selected").val();
  479. var city = $("select[name=city] option:selected").val();
  480. var manageStyle = $(':radio[name=manageStyle]:checked').val();
  481. params = "shopLong="+shopLong+"&shopLat="+shopLat+"&merchantName="+merchantName.val();
  482. params += "&shopAddress="+shopAddressVal+"&shopCity="+city+"&shopProvince="+province;
  483. params += "&inviteCode="+inviteCode.val()+"&shopImg="+shopImg.val()+"&shopImg2="+shopImg2.val()+"&manageStyle="+manageStyle;
  484. params += "&_csrf=<?= Yii::$app->request->csrfToken ?>&alipayAccount="+alipayAccount.val()+"&alipayAccountName="+alipayAccountName.val();
  485. $.ajax({type:"POST",url:'/join/add-merchant',dataType:'json',data:params,async:false,success:function(data){
  486. xhPopMsg(data.msg,1800);
  487. if(data.code == 'A0001'){
  488. if(data.data.toPay == 'yes'){
  489. setTimeout(function(){
  490. window.location.href="/pay/apply?orderId="+data.data.orderId;
  491. },1500);
  492. }else{
  493. setTimeout(function(){
  494. window.location.href='<?= Yii::$app->params['adminUrl'] ?>/admin/generate?account='+data.data.account+'&newAccount='+data.data.newAccount;
  495. },1500);
  496. }
  497. }
  498. }});
  499. });
  500. function setApplyStats(obj,mess,check)
  501. {
  502. obj.focus(function(){
  503. $(this).removeAttr('applyInputStatus');
  504. $(this).siblings('p').html('');
  505. });
  506. obj.blur(function(){
  507. var objVal = obj.val();
  508. var info = check(objVal,mess);
  509. if(info[0]){
  510. $(this).attr('applyInputStatus','yes');
  511. }else{
  512. $(this).attr('applyInputStatus','no');
  513. $(this).siblings('p').css("color","red").html(info[1]);
  514. }
  515. });
  516. }
  517. $('input:radio[name=accountStyle]').click(function(){
  518. var num = $(this).val();
  519. if(num == 3){
  520. $("div[name=accountStyle]").css("display","block");
  521. }else{
  522. $("div[name=accountStyle]").css("display","none");
  523. needValidate = [];
  524. }
  525. });
  526. //关闭邀请码的提示
  527. $("button[name=closeHint]").click(function(){
  528. applyBeCenterMask.css("display","none");
  529. hintMention.css("display","none");
  530. });
  531. </script>
  532. </body>
  533. </html>