license_body.html 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  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/aui-win.css" />
  12. <link rel="stylesheet" type="text/css" href="css/vant-ui.css" />
  13. <link rel="stylesheet" type="text/css" href="css/iconfont.css">
  14. <link rel="stylesheet" type="text/css" href="css/main.css" />
  15. <link rel="stylesheet" type="text/css" href="css/style.css" />
  16. <script src="js/vue.js"></script>
  17. <script src="js/vant-ui.js"></script>
  18. <script src="js/main.js"></script>
  19. <title></title>
  20. </head>
  21. <style>
  22. .login {
  23. padding-bottom: 0rem;
  24. height: auto;
  25. padding-top: .01rem;
  26. background: #ffffff;
  27. ;
  28. }
  29. .login .loginFix {
  30. position: absolute;
  31. }
  32. .login .loginBox {
  33. width: 90%;
  34. height: auto;
  35. padding: 10px;
  36. padding-bottom: 1rem;
  37. }
  38. .pull-right {
  39. width: .15rem !important;
  40. height: .3rem !important;
  41. }
  42. .brandList {
  43. display: flex;
  44. width: 100%;
  45. flex-wrap: wrap;
  46. margin-top: .8rem;
  47. }
  48. .brandList .brandItem,
  49. .brandList .choose {
  50. width: 40%;
  51. margin: .1rem .3rem;
  52. }
  53. .brandItem {
  54. height: .6rem;
  55. }
  56. .anniu>input {
  57. width: 90%;
  58. height: .86rem;
  59. background: rgba(0, 160, 234, 1);
  60. border-radius: 5rem;
  61. color: #fff;
  62. font-size: .31rem;
  63. margin-top: .5rem;
  64. }
  65. .getCodeBtn {
  66. width: 150px;
  67. background-color: #00a0ea;
  68. padding: 5px;
  69. color: #fff;
  70. border-radius: 8px 5px;
  71. text-align: center;
  72. }
  73. .dontSend {
  74. background-color: #ccc !important;
  75. color: #999 !important;
  76. }
  77. .hasClick {
  78. border: 1px solid#ccc;
  79. padding: 0.05rem;
  80. }
  81. .noclick {
  82. padding: 0.05rem;
  83. }
  84. .card {
  85. width: 7rem;
  86. background: #FFFFFF;
  87. box-shadow: 0px 5px 20px 0px rgba(223, 223, 223, 0.91);
  88. border-radius: 10px;
  89. margin-top: .2rem;
  90. }
  91. .van-field__label {
  92. color: #0095FF;
  93. }
  94. .van-field__control {
  95. color: #0095FF;
  96. }
  97. </style>
  98. <body>
  99. <div id="app" style="overflow-y: scroll;" v-cloak>
  100. <header class="aui-bar aui-bar-nav aui-bar-info" id="aui-header">
  101. <div>
  102. <a class="aui-btn aui-btn-info aui-pull-left" tapmode onclick="closeWin()"
  103. style="background: rgba(0, 160, 234, 1);"> <span class="aui-iconfont aui-icon-left"></span> </a>
  104. <div class="aui-title" id="aui-title">
  105. 上传执照
  106. </div>
  107. </div>
  108. </header>
  109. <!-- 附件上传 -->
  110. <div style="display: flex;justify-content: center;">
  111. <div class="card">
  112. <div style="display: flex;align-items: center;">
  113. <div style="width: 4px;height: 24px;background: #0292FD;margin: .2rem;">
  114. </div>
  115. <div>
  116. 为保障积分商城正常使用,请上传真实营业执照
  117. </div>
  118. </div>
  119. <div style="width: 666px;height: 1px;background: #F4F4F4;"></div>
  120. <div style="display: flex;justify-content: center;">
  121. <div>
  122. <input accept="image/x-png,image/gif,image/jpeg,image/bmp" class="change" id="files1"
  123. type="file" multiple="multiple" style="width: 5rem;opacity: 0"
  124. onchange="changePhoto(event,1)" />
  125. <img :src="urldata1 == '' ? './image/tpyulan.png' : urldata1" style="width: 5rem;"
  126. v-on:click="choosePhoto(1)" />
  127. <p
  128. style="width: 5rem;text-align: center;margin: .2rem 0;font-size: .3rem;font-family: Source Han Sans CN;color: #787878;">
  129. 营业执照
  130. </p>
  131. </div>
  132. </div>
  133. </div>
  134. </div>
  135. <div style="display: flex;justify-content: center;">
  136. <div class="card">
  137. <div style="display: flex;justify-content: center;padding: .2rem;">
  138. <div>
  139. <div>
  140. <van-field v-model="companyName" label="公司名称" placeholder="请输入公司名称" readonly />
  141. </div>
  142. <div>
  143. <van-field v-model="userName" label="门店名称" placeholder="请输入门店名称" />
  144. </div>
  145. <div>
  146. <van-field v-model="legalPerson" label="法人" placeholder="请输入法人" readonly />
  147. </div>
  148. </div>
  149. </div>
  150. </div>
  151. </div>
  152. <div style="font-size: 16px;color: #787878;display: flex;margin:.3rem .3rem 0 .3rem;">
  153. <div>注:</div>
  154. <div>1、请上传清晰、准确、符合规范的营业执照,并确保系统识别出来的信息与营业执照的信息一致。若存在差异,请重新上传。<br>
  155. 2、为保证后期能够顺利申请店招店、形象店等,请尽量保持门店名称与营业执照名称一致。</div>
  156. </div>
  157. <div style="display: flex; justify-content: center;margin-top: .5rem;">
  158. <div style="background-color:#0095FF;color: #fff;width:6rem;height: .8rem;border-radius: .4rem;display: flex;justify-content: center; align-items: center;"
  159. v-on:click="storeUpdatalicense">确认提交</div>
  160. </div>
  161. </div>
  162. </body>
  163. <script type="text/javascript" src="../script/aui_compress.min.js"></script>
  164. <script type="text/javascript" src="../script/jquery-1.11.0.min.js"></script>
  165. <script type="text/javascript" src="../script/api.js"></script>
  166. <script type="text/javascript" src="../script/httpRequest.js"></script>
  167. <script type="text/javascript" src="../script/vue_plugins.js"></script>
  168. <script type="text/javascript">
  169. function closeWin() {
  170. api.closeWin({});
  171. }
  172. var vm;
  173. apiready = function () {
  174. var licenseUrl = api.pageParam.licenseUrl;
  175. var companyName = api.pageParam.companyName;
  176. var userName = api.pageParam.userName;
  177. var legalPerson = api.pageParam.legalPerson;
  178. var header = $api.byId('aui-header');
  179. $api.fixStatusBar(header);
  180. vm = new Vue({
  181. el: '#app',
  182. data: {
  183. userLicense:licenseUrl, // 营业执照
  184. urldata1: licenseUrl,
  185. companyName: companyName,
  186. userName: userName,
  187. legalPerson: legalPerson,
  188. check2: '',
  189. check: '',
  190. },
  191. methods: {
  192. getBrandNum: function (index) {
  193. return this.chooseBrands.indexOf(index) >= 0;
  194. },
  195. // 初始化数据
  196. init: function () {
  197. this.storeId = $api.getStorage('userid');
  198. },
  199. // 点击选择附件
  200. choosePhoto: function (type) {
  201. var _this = this;
  202. // 判断是不是有权限,如果没有则需要开启
  203. this.ifHasPrme('storage', function (ret) {
  204. if (ret == true) {
  205. _this.ifHasPrme('camera', function (res) {
  206. if (res == true) {
  207. _this.chooseImage(function (ret) {
  208. uploadFile(ret, type);
  209. //
  210. if (type == 1) {
  211. vm.urldata1 = _this.localImage;
  212. }
  213. })
  214. }
  215. })
  216. }
  217. })
  218. },
  219. storeUpdatalicense: function () {
  220. var url = "storeUpdatalicense",
  221. _this = this;
  222. data = {
  223. "url": "json",
  224. "type": 'body',
  225. "id": _this.storeId,
  226. "licenseUrl": _this.userLicense,
  227. "companyName": _this.companyName,
  228. "legalPerson": _this.legalPerson,
  229. "storeName": _this.userName
  230. }
  231. this.$post(url,data, function (ret) {
  232. if (ret.code == 0 || ret.code == '0') {
  233. api.closeWin();
  234. }
  235. })
  236. },
  237. //获取照片信息
  238. licenseDiscern: function () {
  239. var url = "licenseDiscern",
  240. _this = this;
  241. this.$postuser(url, {
  242. "url": "json",
  243. "type": 'body',
  244. "fileBox": _this.userLicense
  245. }, function (ret) {
  246. if (ret.code == 0 || ret.code == '0') {
  247. api.alert({
  248. title: '温馨提示',
  249. msg: '如果识别的营业执照名称和法定代表人与营业执照上的信息存在差异,请重新上传清晰度更高的营业执照!',
  250. }, function (ret, err) {
  251. });
  252. _this.companyName = ret.data.wordsResultQuery.company.words;
  253. _this.userName = ret.data.wordsResultQuery.company.words;
  254. _this.legalPerson = ret.data.wordsResultQuery.person.words;
  255. }else{
  256. _this.companyName = ""
  257. _this.userName = ""
  258. _this.legalPerson = ""
  259. }
  260. })
  261. },
  262. },
  263. filters: {},
  264. mounted: function () {
  265. this.init();
  266. }
  267. })
  268. }
  269. function changePhoto(event, type) {
  270. uploadFile(event.target.files[0], type);
  271. }
  272. // jq 的上传文件
  273. function uploadFile(file, type) {
  274. var formdata = new FormData();
  275. formdata.append('file', file);
  276. // api.showProgress({});
  277. $.ajax({
  278. url: "http://b2bcnapi.sailuntire.com/api/test/web/file/upload",
  279. type: "POST",
  280. data: formdata,
  281. processData: false, // 告诉jQuery不要去处理发送的数据
  282. contentType: false, // 告诉jQuery不要去设置Content-Type请求头
  283. success: function (ret, status, xhr) {
  284. // api.hideProgress();
  285. if (ret.code == 0 || ret.code == '0') {
  286. api.toast({
  287. msg: '上传成功'
  288. });
  289. if (type == 1) {
  290. vm.userLicense = ret.data;
  291. vm.licenseDiscern()
  292. }
  293. } else {
  294. api.toast({
  295. msg: '上传失败'
  296. });
  297. }
  298. }
  299. });
  300. }
  301. </script>
  302. </html>