regize.html 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854
  1. <!DOCTYPE html>
  2. <html class="">
  3. <!--STATUS OK-->
  4. <head>
  5. <meta name="referrer" content="always" />
  6. <meta charset='utf-8' />
  7. <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
  8. <meta http-equiv="x-dns-prefetch-control" content="on">
  9. <meta name="description" content="">
  10. <meta name="format-detection" content="telephone=no" />
  11. <link rel="stylesheet" type="text/css" href="css/vant-ui.css" />
  12. <link rel="stylesheet" type="text/css" href="css/iconfont.css">
  13. <link rel="stylesheet" type="text/css" href="css/main.css" />
  14. <link rel="stylesheet" type="text/css" href="css/style.css" />
  15. <script src="js/vue.js"></script>
  16. <script src="js/vant-ui.js"></script>
  17. <script src="js/main.js"></script>
  18. <title></title>
  19. </head>
  20. <style>
  21. #app {
  22. background: linear-gradient(180deg, rgba(0, 160, 234, 1), rgba(0, 95, 163, 1)) !important;
  23. }
  24. .login {
  25. padding-bottom: 0rem;
  26. height: auto;
  27. padding-top: .01rem;
  28. background: none;
  29. }
  30. .login .loginFix {
  31. position: absolute;
  32. }
  33. .login .loginBox {
  34. width: 90%;
  35. height: auto;
  36. padding: 10px;
  37. padding-bottom: 1rem;
  38. }
  39. .pull-right {
  40. width: .15rem !important;
  41. height: .3rem !important;
  42. }
  43. .brandList {
  44. display: flex;
  45. width: 100%;
  46. flex-wrap: wrap;
  47. margin-top: .8rem;
  48. }
  49. .brandList .brandItem,
  50. .brandList .choose {
  51. width: 40%;
  52. margin: .1rem .3rem;
  53. }
  54. .brandItem {
  55. height: .6rem;
  56. }
  57. .anniu>input {
  58. width: 90%;
  59. height: .86rem;
  60. background: rgba(0, 160, 234, 1);
  61. border-radius: 5rem;
  62. color: #fff;
  63. font-size: .31rem;
  64. margin-top: .5rem;
  65. }
  66. .getCodeBtn {
  67. width: 150px;
  68. background-color: #00a0ea;
  69. padding: 5px;
  70. color: #fff;
  71. border-radius: 8px 5px;
  72. text-align: center;
  73. }
  74. .dontSend {
  75. background-color: #ccc !important;
  76. color: #999 !important;
  77. }
  78. .hasClick {
  79. border: 1px solid#ccc;
  80. padding: 0.05rem;
  81. }
  82. .noclick {
  83. padding: 0.05rem;
  84. }
  85. </style>
  86. <body>
  87. <div id="app" style="overflow-y: scroll" v-cloak>
  88. <!-- 附件上传 -->
  89. <div class="login">
  90. <div class="loginBox">
  91. <div class="biaoti" style="margin-top: 0.4rem;"><img src="image/xiantiao.png" alt=""><span
  92. style="margin-top:-0.175rem">附件上传</span><img src="image/xiantiao1.png" alt="">
  93. </div>
  94. <div class="brandList" style="text-align: center">
  95. <div class="choose">
  96. <p>
  97. 营业执照
  98. </p>
  99. <input accept="image/x-png,image/gif,image/jpeg,image/bmp" class="change" id="files1"
  100. type="file" multiple="multiple" style="width: 6.78rem;opacity: 0"
  101. onchange="changePhoto(event,1)" />
  102. <img :src="urldata1 == '' ? './image/biankuang.png' : urldata1" style="margin: .3rem auto;"
  103. v-on:click="choosePhoto(1)" />
  104. </div>
  105. <div class="choose">
  106. <p>
  107. 门头照片
  108. </p>
  109. <input accept="image/x-png,image/gif,image/jpeg,image/bmp" class="change" id="files2"
  110. type="file" multiple="multiple" style="width: 6.78rem;opacity: 0"
  111. onchange="changePhoto(event,2)" />
  112. <img :src="urldata2 == '' ? './image/biankuang.png' : urldata2" style="margin: .3rem auto;"
  113. v-on:click="choosePhoto(2)" />
  114. </div>
  115. </div>
  116. </div>
  117. </div>
  118. <div class="login" id="aui-header">
  119. <div class="loginBox">
  120. <div class="labelTitle flex a-center" style="margin-top: 0;">
  121. <b class="i1"></b> 公司名称
  122. </div>
  123. <div class="labelValue flex a-center">
  124. <input type="text" placeholder="请输入公司名称" v-model="companyName" v-on:change="check2" readonly />
  125. </div>
  126. <div class="labelTitle flex a-center" style="margin-top: 0;">
  127. <b class="i1"></b> 门店名称
  128. </div>
  129. <div class="labelValue flex a-center">
  130. <input type="text" placeholder="请输入门店名称" v-model="userName" v-on:change="check2" />
  131. </div>
  132. <div class="labelTitle flex a-center" style="margin-top: 0.3rem;">
  133. <b class="i2"></b> 法人
  134. </div>
  135. <div class="labelValue flex a-center">
  136. <input type="text" placeholder="请输入法人" v-model="legalPerson" v-on:change="check" readonly />
  137. </div>
  138. <div class="labelTitle flex a-center" style="margin-top: 0.3rem;">
  139. <b class="i2"></b> 联系人
  140. </div>
  141. <div class="labelValue flex a-center">
  142. <input type="text" placeholder="请输入联系人" v-model="userPerson" v-on:change="check" />
  143. </div>
  144. <div class="labelTitle flex a-center" style="margin-top: 0.3rem;">
  145. <b class="i2"></b> 联系电话
  146. </div>
  147. <div class="labelValue flex a-center">
  148. <input placeholder="请输入联系电话" v-model="userPhone" />
  149. </div>
  150. <div class="labelTitle flex a-center" style="margin-top: 0.3rem;">
  151. <b class="i2"></b> 验证码
  152. </div>
  153. <div class="labelValue flex a-center">
  154. <input placeholder="请输入验证码" v-model="userCode" />
  155. <div class="getCodeBtn" v-bind:class="wait < 60 ? 'dontSend' : ''" v-on:click="sendRegistCode">
  156. {{ wait == 60 ? '获取验证码' : (wait + "s 后重发") }}
  157. </div>
  158. </div>
  159. <div class="labelTitle flex a-center" style="margin-top: 0.3rem;">
  160. <b class="i2"></b> 选择地址
  161. </div>
  162. <div class="labelValue flex a-center">
  163. <input placeholder="点击选择地区" v-model="userDistrct" readonly="readonly" v-on:click="goMap" />
  164. </div>
  165. <div class="labelTitle flex a-center" style="margin-top: 0.3rem;">
  166. <b class="i2"></b> 详细地址
  167. </div>
  168. <div class="labelValue flex a-center">
  169. <input placeholder="请输入详细地址" v-model="userAddress" readonly="readonly" v-on:click="goMap" />
  170. </div>
  171. </div>
  172. <!-- 合作经销商 -->
  173. <div class="login">
  174. <div class="loginBox">
  175. <div class="labelTitle flex a-center" style="margin-top: 0;">
  176. <b class="i1"></b> 合作供应商
  177. </div>
  178. <div class="labelValue flex a-center">
  179. <input placeholder="请选择合作经销商" readonly="readonly" v-on:click="choosePosterM"
  180. v-model="choosePoster.name" />
  181. <img src="./image/009.png" class="pull-right" />
  182. </div>
  183. <div class="labelValue flex a-center">
  184. <input placeholder="请选择签约任务" readonly="readonly" v-model="chooseLv.name"
  185. v-on:click="choosesignLv" />
  186. <img src="./image/009.png" class="pull-right" />
  187. </div>
  188. <div class="biaoti" style="margin-top: 0.4rem;"><img src="image/xiantiao.png" alt=""><span
  189. style="margin-top: -0.175rem">合作品牌</span><img src="image/xiantiao1.png" alt="">
  190. </div>
  191. <div class="brandList">
  192. <img v-for="(brand,index) in choosePoster.meberArr" class="brandItem" :src="brand.url" alt=""
  193. v-bind:class="chooseBrands == index ? 'hasClick' : 'noclick'"
  194. v-on:click="chooseBrand(index)">
  195. <!--<img class="brandItem" src="image/015.png" alt="">
  196. <img class="brandItem" src="image/016.png" alt="">
  197. <img class="brandItem" src="image/017.png" alt="">-->
  198. </div>
  199. </div>
  200. </div>
  201. </div>
  202. <div class="login">
  203. <div class="loginBox">
  204. <div class="flex a-center checkedXieyi" style="padding-left:0.3rem">
  205. <van-checkbox v-model="xyChecked">
  206. </van-checkbox>
  207. <p style="margin-left:5px" v-on:click="lookPdf(0)">同意用户协议</p>
  208. </div>
  209. <div class="flex a-center checkedXieyi" style="padding-left:0.3rem">
  210. <van-checkbox v-model="zcChecked">
  211. </van-checkbox>
  212. <p style="margin-left:5px" v-on:click="lookPdf(1)">同意隐私政策</p>
  213. </div>
  214. <div class="anniu" v-if="inclick">
  215. <input type="submit" value="提交审批" v-on:click="startRegizeUser">
  216. </div>
  217. <div class="anniu" v-if="!inclick">
  218. <input type="submit" value="提交审批" style="background:#ccc">
  219. </div>
  220. </div>
  221. </div>
  222. </div>
  223. </div>
  224. </body>
  225. <script type="text/javascript" src="../script/aui_compress.min.js"></script>
  226. <script type="text/javascript" src="../script/jquery-1.11.0.min.js"></script>
  227. <script type="text/javascript" src="../script/api.js"></script>
  228. <script type="text/javascript" src="../script/httpRequest.js"></script>
  229. <script type="text/javascript" src="../script/vue_plugins.js"></script>
  230. <script type="text/javascript">
  231. var vm;
  232. apiready = function () {
  233. vm = new Vue({
  234. el: '#app',
  235. data: {
  236. // 选择省市区
  237. UIActionSelector: '',
  238. map: '', // 百度地图SDK
  239. // 选择省市区的文件
  240. file: 'widget://res/city.json',
  241. companyName: '',//公司名称
  242. userName: '', // 门店名称
  243. userPerson: '', // 用户联系人
  244. userPhone: '', // 用户手机号
  245. userCode: '', // 手机号验证码
  246. userDistrct: '', // 点击选择地址
  247. userAddress: '', // 用户地址
  248. distrctArr: [], // 保存的地址
  249. userLicense: '', // 营业执照
  250. userDoorway: '', // 门头照片
  251. userLat: '', // 纬度
  252. userLon: '', // 经度
  253. posterList: [], // 经销商列表
  254. choosePoster: {}, // 选择的经销商
  255. chooseLv: {
  256. name: '点击选择签约任务'
  257. }, // 签约任务
  258. signList: [], // 签约任务lsit
  259. wait: 60,
  260. chooseBrands: 100, // 选择的品牌
  261. xyChecked: false,
  262. zcChecked: false,
  263. ptfurl0: 'widget://res/xy.pdf',
  264. ptfurl1: 'widget://res/zc.pdf',
  265. pdfReader: '',
  266. urldata1: '',
  267. urldata2: '',
  268. inclick: true,
  269. tishi1: 0,
  270. tishi2: 0,
  271. },
  272. methods: {
  273. getBrandNum: function (index) {
  274. return this.chooseBrands.indexOf(index) >= 0;
  275. },
  276. // 初始化数据
  277. init: function () {
  278. var _this = this;
  279. this.pdfReader = api.require('pdfReader');
  280. this.UIActionSelector = api.require('UIActionSelector');
  281. this.map = api.require('bMap');
  282. if (api.systemType == 'ios') {
  283. this.map.initMapSDK(function (ret) {
  284. if (ret.status) { }
  285. });
  286. }
  287. this.getSignLv();
  288. this.addEvent('chooseDistict', function (ret) {
  289. if (ret) {
  290. _this.userDistrct = ret.value.p + ret.value.c + ret.value.d;
  291. _this.distrctArr = [ret.value.p, ret.value.c, ret.value.d];
  292. _this.userAddress = ret.value.a;
  293. _this.userLat = ret.value.lat;
  294. _this.userlon = ret.value.lon;
  295. }
  296. _this.getPosterByDistrict();
  297. api.closeWin({
  298. name: 'map_win'
  299. });
  300. })
  301. },
  302. // 点击获取用户地址
  303. getUserDistrict: function () {
  304. var _this = this;
  305. this.chooseRegion(this.UIActionSelector, 3, this.file, function (ret) {
  306. if (ret.eventType == 'ok') {
  307. _this.userDistrct = ret.level1 + ' ' + ret.level2 + ' ' + ret.level3;
  308. _this.distrctArr = [ret.level1, ret.level2, ret.level3];
  309. _this.getPosterByDistrict();
  310. }
  311. })
  312. },
  313. // 根据地理位置获取经纬度
  314. getLatLotByAddress: function (c) {
  315. var _this = this;
  316. this.map.getCoordsFromName({
  317. city: this.distrctArr[0],
  318. address: this.userAddress
  319. }, function (ret, err) {
  320. if (ret.status) {
  321. _this.userLat = ret.lat;
  322. _this.userlon = ret.lon;
  323. c(true);
  324. } else {
  325. c(false);
  326. }
  327. });
  328. },
  329. goMap: function () {
  330. this.goWin('map_win', 'map_win.html', {
  331. d: this.distrctArr[2]
  332. });
  333. },
  334. // 根据用户选择的省市区获取对应的经销商和品牌
  335. getPosterByDistrict: function () {
  336. var data = {
  337. "province": this.distrctArr[0],
  338. "city": this.distrctArr[1],
  339. "area": this.distrctArr[2],
  340. url: 'json',
  341. type: 'body'
  342. },
  343. _this = this;
  344. this.choosePoster = {};
  345. this.$post('getUpuserByProvideUrl', data, function (ret) {
  346. console.log(JSON.stringify(ret));
  347. if (ret.code == 0 || ret.code == '0') {
  348. // 对数据进行处理
  349. ret.Data.data.map(function (meber, index) {
  350. var meberArr = new Array();
  351. meber.regionBrandList.map(function (brand, brandIndex) {
  352. if (meber.brandAndUrl != null) {
  353. var url = eval('meber.brandAndUrl.' + brand);
  354. meberArr.push({
  355. name: brand,
  356. url: url
  357. })
  358. } else {
  359. meberArr.push({
  360. name: brand,
  361. url: './image/logo1.png'
  362. })
  363. }
  364. })
  365. meber.meberArr = meberArr
  366. })
  367. _this.posterList = ret.Data.data;
  368. }
  369. })
  370. },
  371. // 获取签约级别
  372. getSignLv: function () {
  373. var url = "getSignLvU",
  374. _this = this;
  375. this.$post(url, {
  376. url: "json",
  377. type: 'body'
  378. }, function (ret) {
  379. if (ret.code == 0 || ret.code == '0') {
  380. ret.date.map(function (n, index) {
  381. n.name = n.signLv;
  382. })
  383. _this.signList = ret.date;
  384. }
  385. })
  386. },
  387. // 选择签约级别
  388. choosesignLv: function () {
  389. var _this = this;
  390. this.chooseRegion(this.UIActionSelector, 1, this.signList, function (ret) {
  391. if (ret.eventType == 'ok') {
  392. _this.chooseLv = ret.selectedInfo[0];
  393. }
  394. })
  395. },
  396. // 选择合作经销商
  397. choosePosterM: function () {
  398. var data = this.posterList,
  399. _this = this;
  400. if (data.length == 0) {
  401. api.toast({
  402. msg: '该地区暂未维护经销商'
  403. });
  404. return;
  405. }
  406. this.chooseRegion(this.UIActionSelector, 1, data, function (ret) {
  407. if (ret.eventType == 'ok') {
  408. _this.choosePoster = ret.selectedInfo[0];
  409. if (_this.choosePoster.meberArr.length == 1) {
  410. _this.chooseBrands = 0;
  411. } else {
  412. _this.chooseBrands = 100;
  413. }
  414. }
  415. })
  416. },
  417. // 点击选择附件
  418. choosePhoto: function (type) {
  419. var _this = this;
  420. if (type == 1) {
  421. api.confirm({
  422. title: '温馨提示',
  423. msg: '此操作需要上传正规的营业执照照片 ,并确保系统识别出来的信息与营业执照一致,是否同意?',
  424. buttons: ['同意', '不同意']
  425. }, function (ret, err) {
  426. if (ret.buttonIndex == 1) {
  427. // 判断是不是有权限,如果没有则需要开启
  428. _this.ifHasPrme('storage', function (ret) {
  429. if (ret == true) {
  430. _this.ifHasPrme('camera', function (res) {
  431. if (res == true) {
  432. _this.chooseImage(function (ret) {
  433. uploadFile(ret, type);
  434. //
  435. if (type == 1) {
  436. vm.urldata1 = _this.localImage;
  437. } else {
  438. vm.urldata2 = _this.localImage;
  439. }
  440. })
  441. }
  442. })
  443. }
  444. })
  445. }
  446. });
  447. } else {
  448. _this.ifHasPrme('storage', function (ret) {
  449. if (ret == true) {
  450. _this.ifHasPrme('camera', function (res) {
  451. if (res == true) {
  452. _this.chooseImage(function (ret) {
  453. uploadFile(ret, type);
  454. //
  455. if (type == 1) {
  456. vm.urldata1 = _this.localImage;
  457. } else {
  458. vm.urldata2 = _this.localImage;
  459. }
  460. })
  461. }
  462. })
  463. }
  464. })
  465. }
  466. // $('#files' + ).click();
  467. },
  468. // 选择品牌
  469. chooseBrand: function (index) {
  470. this.chooseBrands = index;
  471. },
  472. // 使用搞得api获取经纬度
  473. getLocationByAmap: function (c) {
  474. var url = "http://restapi.amap.com/v3/geocode/geo?key=389880a06e3f893ea46036f030c94700&s=rsv3&city=35&address=" + this.distrctArr[0] + this.distrctArr[1] + this.distrctArr[2] + this.userAddress;
  475. console.log(url);
  476. var _this = this;
  477. api.ajax({
  478. url: url,
  479. method: 'get',
  480. data: ''
  481. }, function (ret, err) {
  482. if (ret) {
  483. if (ret.status == 1 || ret.status == '1') {
  484. if (ret.geocodes[0].location.indexOf(',') >= 0) {
  485. var latlon = ret.geocodes[0].location.split(',');
  486. _this.userlon = latlon[0];
  487. _this.userLat = latlon[1];
  488. c(true);
  489. } else {
  490. c(false)
  491. }
  492. } else {
  493. c(false)
  494. }
  495. } else {
  496. c(false)
  497. }
  498. });
  499. },
  500. //获取照片信息
  501. licenseDiscern: function () {
  502. var url = "licenseDiscern",
  503. _this = this;
  504. this.$postuser(url, {
  505. "url": "json",
  506. "type": 'body',
  507. "fileBox": _this.userLicense
  508. }, function (ret) {
  509. if (ret.code == 0 || ret.code == '0') {
  510. api.alert({
  511. title: '温馨提示',
  512. msg: '如果店名和联系人与营业执照不一致,请重新上传清晰度更高的营业执照',
  513. }, function (ret, err) {
  514. });
  515. _this.userName = ret.data.wordsResultQuery.company.words;
  516. _this.userPerson = ret.data.wordsResultQuery.person.words;
  517. _this.companyName = ret.data.wordsResultQuery.company.words;
  518. _this.legalPerson = ret.data.wordsResultQuery.person.words;
  519. } else {
  520. api.toast({
  521. msg: ret.msg,
  522. });
  523. _this.userName = "";
  524. _this.userPerson = "";
  525. _this.companyName = "";
  526. _this.legalPerson = "";
  527. }
  528. })
  529. },
  530. // 点击注册提交
  531. startRegizeUser: function () {
  532. var _this = this;
  533. if (this.xyChecked == false) {
  534. api.toast({
  535. msg: '请勾选同意用户协议',
  536. });
  537. return;
  538. }
  539. if (this.zcChecked == false) {
  540. api.toast({
  541. msg: '请勾选同意隐私政策',
  542. });
  543. return;
  544. }
  545. var _this = this;
  546. if (_this.companyName == '') {
  547. api.toast({
  548. msg: '请完善公司名称'
  549. });
  550. return;
  551. }
  552. if (_this.userName == '') {
  553. api.toast({
  554. msg: '请完善门店名称'
  555. });
  556. return;
  557. }
  558. if (_this.userPerson == '') {
  559. api.toast({
  560. msg: '请完善门店联系人'
  561. });
  562. return;
  563. }
  564. if (_this.userPhone == '') {
  565. api.toast({
  566. msg: '请完善门店联系电话'
  567. });
  568. return;
  569. }
  570. if (!(/^1[3456789]\d{9}$/.test(_this.userPhone))) {
  571. api.toast({
  572. msg: '联系电话格式有误'
  573. });
  574. return;
  575. }
  576. if (_this.userCode == '') {
  577. api.toast({
  578. msg: '请完善验证码'
  579. });
  580. return;
  581. }
  582. if (_this.distrctArr.length == 0) {
  583. api.toast({
  584. msg: '请完善地址'
  585. });
  586. return;
  587. }
  588. if (_this.userAddress == '') {
  589. api.toast({
  590. msg: '请完善详细地址'
  591. });
  592. return;
  593. }
  594. if (_this.choosePoster.name == '') {
  595. api.toast({
  596. msg: '请完善合作供应商'
  597. });
  598. return;
  599. }
  600. if (_this.chooseLv.name == '点击选择签约任务') {
  601. api.toast({
  602. msg: '请完善签约等级'
  603. });
  604. return;
  605. }
  606. if (_this.chooseBrands == 100) {
  607. api.toast({
  608. msg: '请选择轮胎品牌'
  609. });
  610. return;
  611. }
  612. if (_this.userLicense == '') {
  613. api.toast({
  614. msg: '请完善营业执照'
  615. });
  616. return;
  617. }
  618. if (_this.userDoorway == '') {
  619. api.toast({
  620. msg: '请完善门头照片'
  621. });
  622. return;
  623. }
  624. if (_this.userName == '无' && _this.tishi1 == 0) {
  625. api.alert({
  626. title: '温馨提示',
  627. msg: '请正确输入门店名称',
  628. }, function (ret, err) {
  629. _this.tishi1 = 1
  630. });
  631. return;
  632. }
  633. if (_this.userPerson == '无' && _this.tishi2 == 0) {
  634. api.alert({
  635. title: '温馨提示',
  636. msg: '请正确输入联系人',
  637. }, function (ret, err) {
  638. _this.tishi2 = 1
  639. });
  640. return;
  641. }
  642. // 先去访问根据地址获取经纬度的接口
  643. // this.getLocationByAmap(function(status) {
  644. // if (status == false) {
  645. // api.toast({
  646. // msg: '请填写真实地址'
  647. // });
  648. // return;
  649. // }
  650. var data = {
  651. "companyName": _this.companyName,
  652. "storeName": _this.userName,
  653. "contactName": _this.userPerson,
  654. "legalPerson": _this.legalPerson,
  655. "storePhone": _this.userPhone,
  656. "mobileCode": _this.userCode,
  657. "province": _this.distrctArr[0],
  658. "city": _this.distrctArr[1],
  659. "district": _this.distrctArr[2],
  660. "addressInfo": _this.userAddress,
  661. "jd": _this.userlon,
  662. "wd": _this.userLat,
  663. "name": _this.choosePoster.name,
  664. "brandList": [_this.choosePoster.meberArr[_this.chooseBrands].name],
  665. "spart": _this.choosePoster.spart,
  666. "kunnr": _this.choosePoster.kunnr,
  667. "vkorg": _this.choosePoster.vkorg,
  668. "vtweg": _this.choosePoster.vtweg,
  669. "signLv": _this.chooseLv.name, // 这是签约等级
  670. "numTask": _this.chooseLv.numTask,
  671. "licenseUrl": _this.userLicense,
  672. "storeImageUrl": _this.userDoorway,
  673. "version": parseFloat(api.appVersion),
  674. "url": 'json',
  675. "type": 'body'
  676. }
  677. _this.inclick = false;
  678. _this.$postuser("regizeUrl", data, function (ret) {
  679. if (ret.code == 0 || ret.code == "0") {
  680. setTimeout(_this.showAlert("注册成功,请等待经销商审核", function () {
  681. api.closeWin({});
  682. }), 5000);
  683. } else {
  684. setTimeout(function () {
  685. api.toast({
  686. msg: ret.msg
  687. });
  688. _this.inclick = true;
  689. }, 1000);
  690. }
  691. })
  692. },
  693. sendRegistCode: function () {
  694. if (this.userName != this.userName.replace(/[^\u4e00-\u9fa5\w]/g, '')) {
  695. api.toast({
  696. msg: '只能输入汉字、字母、数字'
  697. });
  698. this.userName = "";
  699. }
  700. if (this.userPerson != this.userPerson.replace(/[^\u4e00-\u9fa5\w]/g, '')) {
  701. api.toast({
  702. msg: '只能输入汉字、字母、数字'
  703. });
  704. this.userPerson = "";
  705. }
  706. if (this.wait < 60) {
  707. return;
  708. }
  709. var _this = this;
  710. var mobile = _this.userPhone;
  711. if (mobile == null || mobile == '') {
  712. _this.showAlert("请输入手机号", function () { });
  713. return;
  714. };
  715. if (!(/^1[3456789]\d{9}$/.test(_this.userPhone))) {
  716. api.toast({
  717. msg: '联系电话格式有误'
  718. });
  719. return;
  720. }
  721. var params = {
  722. mobile: mobile,
  723. validType: "2",
  724. url: 'json',
  725. type: 'body'
  726. };
  727. _this.$post("getPhoneCode", params, function (ret) {
  728. if (ret.code == 0 || ret.code == "0") {
  729. api.toast({
  730. msg: '验证码发送成功'
  731. });
  732. _this.startResod();
  733. }
  734. });
  735. },
  736. // 开始倒计时
  737. startResod: function () {
  738. var _this = this;
  739. if (this.wait == 0) {
  740. this.wait = 60;
  741. } else {
  742. this.wait--;
  743. setTimeout(function () {
  744. _this.startResod();
  745. }, 1000)
  746. }
  747. },
  748. check: function () {
  749. if (this.userPerson != this.userPerson.replace(/[^\u4e00-\u9fa5\w]/g, '')) {
  750. api.toast({
  751. msg: '只能输入汉字、字母、数字'
  752. });
  753. this.userPerson = ""
  754. }
  755. },
  756. check2: function () {
  757. if (this.userName != this.userName.replace(/[^\u4e00-\u9fa5\w]/g, '')) {
  758. api.toast({
  759. msg: '只能输入汉字、字母、数字'
  760. });
  761. this.userName = ""
  762. }
  763. },
  764. // 查看pdf
  765. lookPdf: function (index) {
  766. this.pdfReader.open({
  767. path: index == 0 ? this.ptfurl0 : this.ptfurl1,
  768. hidden: {
  769. print: true,
  770. export: true,
  771. bookmark: true,
  772. email: true
  773. },
  774. backBtn: {
  775. size: { //JSON对象;左上角按钮的大小配置
  776. w: 20, //数字类型;左上角按钮的宽;默认:60
  777. h: 20 //数字类型;左上角按钮的高;默认:40
  778. },
  779. title: { //JSON对象;按钮标题配置
  780. text: "返回", //字符串类型;标题文本;默认:‘’
  781. },
  782. corner: 5 //数字类型;左上角按钮圆角大小;默认值:5.0
  783. }
  784. });
  785. }
  786. },
  787. filters: {},
  788. mounted: function () {
  789. this.init();
  790. }
  791. })
  792. }
  793. function changePhoto(event, type) {
  794. uploadFile(event.target.files[0], type);
  795. }
  796. // jq 的上传文件
  797. function uploadFile(file, type) {
  798. var formdata = new FormData();
  799. formdata.append('file', file);
  800. // api.showProgress({});
  801. $.ajax({
  802. url: "http://b2bcnapi.sailuntire.com/api/test/web/file/upload",
  803. type: "POST",
  804. data: formdata,
  805. processData: false, // 告诉jQuery不要去处理发送的数据
  806. contentType: false, // 告诉jQuery不要去设置Content-Type请求头
  807. success: function (ret, status, xhr) {
  808. // api.hideProgress();
  809. if (ret.code == 0 || ret.code == '0') {
  810. api.toast({
  811. msg: '上传成功'
  812. });
  813. if (type == 1) {
  814. vm.userLicense = ret.data;
  815. vm.licenseDiscern()
  816. } else {
  817. vm.userDoorway = ret.data;
  818. }
  819. } else {
  820. api.toast({
  821. msg: '上传失败'
  822. });
  823. }
  824. }
  825. });
  826. }
  827. </script>
  828. </html>