商丘市柘城县——前端

Add.html 23KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>我要投诉</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
  7. <meta name="apple-mobile-web-app-capable" content="yes">
  8. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  9. <link href="css/mui.min.css" rel="stylesheet" />
  10. <link href="css/mui.picker.css" rel="stylesheet" />
  11. <link href="css/mui.poppicker.css" rel="stylesheet" />
  12. <link href="css/feedback-page.css" rel="stylesheet" />
  13. <link rel="stylesheet" href="css/webuploader.css" />
  14. <style>
  15. body {
  16. font-size: 14px;
  17. }
  18. .mui-bar-popover {
  19. width: 30%;
  20. }
  21. .mui-popover.mui-bar-popover .mui-table-view {
  22. width: 100%;
  23. }
  24. .mui-table-view .mui-table-view-cell>a:not(.mui-btn) {
  25. text-align: center;
  26. }
  27. .mui-table-view-cell {
  28. padding: 1px 15px!important;
  29. }
  30. .san {
  31. font-size: 14px;
  32. margin-right: 5px;
  33. }
  34. .nav_a {
  35. border-right: 1px solid #ccc;
  36. }
  37. .radio_box {
  38. display: inline-block;
  39. }
  40. .mui-radio input[type=radio]:before {
  41. font-size: 20px;
  42. vertical-align: middle;
  43. }
  44. .mui-radio.mui-left input[type=radio] {
  45. line-height: 24px!important;
  46. }
  47. .mui-radio.mui-left label {
  48. padding-right: 1px!important;
  49. padding-left: 51px!important;
  50. }
  51. .ztext {
  52. width: 100%;
  53. margin: 0;
  54. border: 0;
  55. }
  56. .action {
  57. padding: 5px 15px;
  58. }
  59. .type_down {
  60. float: right!important;
  61. display: inline-block!important;
  62. vertical-align: middle!important;
  63. line-height: 42px;
  64. }
  65. .type_con {
  66. width: 55%!important;
  67. float: left!important;
  68. vertical-align: middle!important;
  69. display: inline-block!important;
  70. padding: 10px 0!important;
  71. }
  72. .label {
  73. width: 30%!important;
  74. padding: 11px 0px!important;
  75. }
  76. .get_yzm {
  77. padding: 5px!important;
  78. width: auto!important;
  79. }
  80. .yzm_con {
  81. float: left!important;
  82. width: 40%!important;
  83. }
  84. .mui-bar-nav {
  85. background-color: #00a1cb;
  86. }
  87. .mui-input-row label {
  88. text-align: -webkit-right;
  89. }
  90. .mui-btn-block {
  91. padding: 10px;
  92. width: 100%;
  93. }
  94. a {
  95. color: #000;
  96. }
  97. .size-14 {
  98. font-size: 14px;
  99. }
  100. .mui-input-row label~input,
  101. .mui-input-row label~select,
  102. {
  103. line-height: 1.1;
  104. font-size: 14px;
  105. }
  106. .iconfont_add {
  107. font-family: "iconfont";
  108. font-size: 20px;
  109. color: #13a7f1;
  110. font-style: normal;
  111. -webkit-font-smoothing: antialiased;
  112. -webkit-text-stroke-width: 0.2px;
  113. -moz-osx-font-smoothing: grayscale;
  114. /* padding-left:20px*/
  115. }
  116. @font-face {
  117. font-family: 'iconfont';
  118. /* project id 280843 */
  119. src: url('//at.alicdn.com/t/font_280843_7m2gttvpislfecdi.eot');
  120. src: url('//at.alicdn.com/t/font_280843_7m2gttvpislfecdi.eot?#iefix') format('embedded-opentype'), url('//at.alicdn.com/t/font_280843_7m2gttvpislfecdi.woff') format('woff'), url('//at.alicdn.com/t/font_280843_7m2gttvpislfecdi.ttf') format('truetype'), url('//at.alicdn.com/t/font_280843_7m2gttvpislfecdi.svg#iconfont') format('svg');
  121. }
  122. .iconfont {
  123. font-family: "iconfont";
  124. font-size: 20px;
  125. color: #13a7f1;
  126. font-style: normal;
  127. -webkit-font-smoothing: antialiased;
  128. -webkit-text-stroke-width: 0.2px;
  129. -moz-osx-font-smoothing: grayscale;
  130. /* padding-left:20px*/
  131. }
  132. .image-list {
  133. width: 100%;
  134. background-size: cover;
  135. padding: 10px 10px;
  136. overflow: hidden;
  137. }
  138. #image-list {
  139. display: none;
  140. }
  141. /*自定义CSS*/
  142. .mui-preview-image.mui-fullscreen {
  143. position: fixed;
  144. z-index: 20;
  145. background-color: #000;
  146. }
  147. .mui-preview-header,
  148. .mui-preview-footer {
  149. position: absolute;
  150. width: 100%;
  151. left: 0;
  152. z-index: 10;
  153. }
  154. .mui-preview-header {
  155. height: 44px;
  156. top: 0;
  157. }
  158. .mui-preview-footer {
  159. height: 50px;
  160. bottom: 0px;
  161. }
  162. .mui-preview-header .mui-preview-indicator {
  163. display: block;
  164. line-height: 25px;
  165. color: #fff;
  166. text-align: center;
  167. margin: 15px auto 4;
  168. width: 70px;
  169. background-color: rgba(0, 0, 0, 0.4);
  170. border-radius: 12px;
  171. font-size: 16px;
  172. }
  173. .mui-preview-image {
  174. display: none;
  175. -webkit-animation-duration: 0.5s;
  176. animation-duration: 0.5s;
  177. -webkit-animation-fill-mode: both;
  178. animation-fill-mode: both;
  179. }
  180. .mui-preview-image.mui-preview-in {
  181. -webkit-animation-name: fadeIn;
  182. animation-name: fadeIn;
  183. }
  184. .mui-preview-image.mui-preview-out {
  185. background: none;
  186. -webkit-animation-name: fadeOut;
  187. animation-name: fadeOut;
  188. }
  189. .mui-preview-image.mui-preview-out .mui-preview-header,
  190. .mui-preview-image.mui-preview-out .mui-preview-footer {
  191. display: none;
  192. }
  193. .mui-zoom-scroller {
  194. position: absolute;
  195. display: -webkit-box;
  196. display: -webkit-flex;
  197. display: flex;
  198. -webkit-box-align: center;
  199. -webkit-align-items: center;
  200. align-items: center;
  201. -webkit-box-pack: center;
  202. -webkit-justify-content: center;
  203. justify-content: center;
  204. left: 0;
  205. right: 0;
  206. bottom: 0;
  207. top: 0;
  208. width: 100%;
  209. height: 100%;
  210. margin: 0;
  211. -webkit-backface-visibility: hidden;
  212. }
  213. .mui-zoom {
  214. -webkit-transform-style: preserve-3d;
  215. transform-style: preserve-3d;
  216. }
  217. .mui-slider .mui-slider-group .mui-slider-item img {
  218. width: auto;
  219. height: auto;
  220. max-width: 100%;
  221. max-height: 100%;
  222. }
  223. .mui-android-4-1 .mui-slider .mui-slider-group .mui-slider-item img {
  224. width: 100%;
  225. }
  226. .mui-android-4-1 .mui-slider.mui-preview-image .mui-slider-group .mui-slider-item {
  227. display: inline-table;
  228. }
  229. .mui-android-4-1 .mui-slider.mui-preview-image .mui-zoom-scroller img {
  230. display: table-cell;
  231. vertical-align: middle;
  232. }
  233. .mui-preview-loading {
  234. position: absolute;
  235. width: 100%;
  236. height: 100%;
  237. top: 0;
  238. left: 0;
  239. display: none;
  240. }
  241. .mui-preview-loading.mui-active {
  242. display: block;
  243. }
  244. .mui-preview-loading .mui-spinner-white {
  245. position: absolute;
  246. top: 50%;
  247. left: 50%;
  248. margin-left: -25px;
  249. margin-top: -25px;
  250. height: 50px;
  251. width: 50px;
  252. }
  253. .mui-preview-image img.mui-transitioning {
  254. -webkit-transition: -webkit-transform 0.5s ease, opacity 0.5s ease;
  255. transition: transform 0.5s ease, opacity 0.5s ease;
  256. }
  257. @-webkit-keyframes fadeIn {
  258. 0% {
  259. opacity: 0;
  260. }
  261. 100% {
  262. opacity: 1;
  263. }
  264. }
  265. @keyframes fadeIn {
  266. 0% {
  267. opacity: 0;
  268. }
  269. 100% {
  270. opacity: 1;
  271. }
  272. }
  273. @-webkit-keyframes fadeOut {
  274. 0% {
  275. opacity: 1;
  276. }
  277. 100% {
  278. opacity: 0;
  279. }
  280. }
  281. @keyframes fadeOut {
  282. 0% {
  283. opacity: 1;
  284. }
  285. 100% {
  286. opacity: 0;
  287. }
  288. }
  289. p img {
  290. max-width: 100%;
  291. height: auto;
  292. }
  293. .mui-content>.mui-table-view:first-child {
  294. margin-top: 5px;
  295. }
  296. .mui-icon-clear {
  297. position: absolute;
  298. right: 0;
  299. line-height: 40px;
  300. color: #999;
  301. font-size: 20px;
  302. }
  303. .Hides {
  304. display: none!important;
  305. }
  306. .SHOW {
  307. display: block!important;
  308. }
  309. #Appointtime {
  310. width: -webkit-calc(65% - 20px)!important;
  311. width: -moz-calc(65%-20px)!important;
  312. width: calc(65% - 20px)!important;
  313. float: none;
  314. }
  315. #Repairtime {
  316. width: -webkit-calc(65% - 20px)!important;
  317. width: -moz-calc(65%-20px)!important;
  318. width: calc(65% - 20px)!important;
  319. float: none;
  320. }
  321. .content-title {
  322. margin-bottom: 0;
  323. padding: 0 30px;
  324. }
  325. .mui-input-row label {
  326. line-height: normal!important;
  327. }
  328. .mui-input-row select {
  329. font-size: 14px;
  330. height: 40px!important;
  331. padding: 0;
  332. }
  333. #showZhuTiPickers {
  334. display: none;
  335. }
  336. .mui-radio input[type=radio] {
  337. top: 7px;
  338. }
  339. #userResult {
  340. width: 30%!important;
  341. }
  342. </style>
  343. </head>
  344. <body>
  345. <div class="mui-content">
  346. <ul class="mui-table-view ">
  347. <li class="mui-table-view-cell" id="showUserPicker">
  348. <div class="mui-input-row">
  349. <label class="label">诉求类型:</label>
  350. <input type="text" id='userResult' class="ui-alert type_con size-14" data-index="" readonly="readonly" />
  351. <a href=""><span class="type_down mui-icon mui-icon-arrowdown mui-pull-right"></span></a>
  352. </div>
  353. </li>
  354. <li class="mui-table-view-cell" id="showZhuTiPicker">
  355. <div class="mui-input-row">
  356. <label class="label">主题词:</label>
  357. <input type="text" id='zhuTiResult' class="ui-alert type_con size-14" data-index="" readonly="readonly" />
  358. <a href=""><span class="type_down mui-icon mui-icon-arrowdown mui-pull-right"></span></a>
  359. </div>
  360. </li>
  361. <li class="mui-table-view-cell">
  362. <div class="mui-input-row">
  363. <label class="label">保密要求:</label>
  364. <div class="mui-input-row mui-radio mui-left radio_box">
  365. <label>保密</label>
  366. <input type="radio" type="radio" name="secret" value="1" class="size-14" />
  367. </div>
  368. <div class="mui-input-row mui-radio mui-left radio_box">
  369. <label>公开</label>
  370. <input type="radio" type="radio" name="secret" checked="checked" value="0" class="size-14" />
  371. </div>
  372. </div>
  373. </li>
  374. <li class="mui-table-view-cell">
  375. <div class="mui-input-row">
  376. <label class="label">紧急程度:</label>
  377. <div class="mui-input-row mui-radio mui-left radio_box">
  378. <label>普通</label>
  379. <input type="radio" type="radio" name="jinji" value="1" class="size-14" />
  380. </div>
  381. <div class="mui-input-row mui-radio mui-left radio_box">
  382. <label>紧急</label>
  383. <input type="radio" type="radio" name="jinji" checked="checked" value="2" class="size-14" />
  384. </div>
  385. </div>
  386. </li>
  387. <li class="mui-table-view-cell">
  388. <div class="mui-input-row">
  389. <label class="label">诉求主题:</label>
  390. <input type="text" id="title" placeholder="请填写您的诉求主题" class="size-14">
  391. </div>
  392. </li>
  393. <li class="mui-table-view-cell">
  394. <div class="mui-input-row">
  395. <label class="label">内容:</label>
  396. <textarea class="ztext content size-14" name="" id="textarea" rows="3" cols="" placeholder="请详细描述您的问题和建议..."></textarea>
  397. </div>
  398. </li>
  399. <li class="mui-table-view-cell">
  400. <div class="mui-input-row">
  401. <label class="label">联系人:</label>
  402. <input type="text" id="name" placeholder="请填写您的称呼" class="size-14">
  403. </div>
  404. </li>
  405. <li class="mui-table-view-cell">
  406. <div class="mui-input-row">
  407. <label class="label">联系电话:</label>
  408. <input type="text" id="phone" placeholder="请填写联系电话" class="size-14">
  409. </div>
  410. </li>
  411. <li class="mui-table-view-cell" id='showCityPicker3'>
  412. <div class="mui-input-row">
  413. <label class="label">事发地址:</label>
  414. <input type="text" id='cityResult3' data-index="" class="ui-alert type_con size-14" placeholder="请选择具体地址" readonly="readonly" />
  415. <a href=""><span class="type_down mui-icon mui-icon-arrowdown mui-pull-right"></span></a>
  416. </div>
  417. </li>
  418. <li class="mui-table-view-cell">
  419. <div class="mui-input-row">
  420. <label class="label">街道:</label>
  421. <input type="text" id="detail_address" class="ui-alert size-14" placeholder="请填写详细地址" />
  422. </div>
  423. </li>
  424. <li class="">
  425. <div class="mui-input-row">
  426. <label class="label">故障图片:</label>
  427. <div id="filePicker">
  428. <i class="iconfont_add">&#xe61a;</i>
  429. </div>
  430. <div id='image-list' class="row image-list">
  431. </div>
  432. </div>
  433. </li>
  434. </ul>
  435. <!--<div class="feedback">
  436. <p>添加图片(选填,提供问题截图,单张10M以下)</p>
  437. <div id='image-list' class="row image-list"></div>
  438. </div>-->
  439. <p class="action">
  440. <i class="iconfont icon-gantanhao" style="margin-right: 5px;font-size: 20px;vertical-align: middle;"></i>
  441. <span style="color: #f81737;">以上内容都为必填内容,请如实填写</span>
  442. </p>
  443. <!--<button type="button" class="mui-btn mui-btn-primary mui-btn-block block_button">提交</button>-->
  444. <div style="padding: 10px;">
  445. <button type="button" data-loading-text="提交中" class="mui-btn mui-btn-primary mui-btn-block block_button submit" id="submit">提交</button>
  446. </div>
  447. </div>
  448. <script src="js/jquery.min.js"></script>
  449. <script src="js/mui.min.js?"></script>
  450. <script src="js/mui.picker.js"></script>
  451. <script src="js/mui.poppicker.js"></script>
  452. <!--<script src="js/city.data-3.js"></script>-->
  453. <script src="js/zepto.js"></script>
  454. <script src="js/mui.zoom.js"></script>
  455. <script src="js/mui.previewimage.js"></script>
  456. <script src="js/huayi.config.js"></script>
  457. <!--<script src="js/feedback-page.js"></script>-->
  458. <script src="js/webuploader.min.js"></script>
  459. <script type="text/javascript">
  460. mui.init({
  461. swipeBack: false,
  462. })
  463. mui.plusReady(function() {
  464. var wv = plus.webview.currentWebview();
  465. var usercode = localStorage.getItem("user"); //获取本地存储
  466. var files;
  467. var Str = '';
  468. var str_ary;
  469. var reg = /,$/gi;
  470. //提交按钮
  471. $('#submit').on('tap', function() {
  472. $(".image-box").each(function(i, n) {
  473. var a = $(n).attr("indexs");
  474. if(a) {
  475. Str += a + ',';
  476. }
  477. })
  478. str_ary = Str.substring(0, Str.length - 1);
  479. var myreg = /^[1][3,4,5,7,8][0-9]{9}$/;
  480. var str = $("#phone").val();
  481. if($('#name').val() == '') {
  482. mui.alert('请输入姓名!')
  483. } else if($('#phone').val() == '') {
  484. mui.alert('请输入联系电话!')
  485. } else if(!myreg.test(str)) {
  486. mui.alert('手机号格式不正确!')
  487. } else if($('#title').val() == '') {
  488. mui.alert('请输入诉求主题!')
  489. } else if($('.content').val() == '') {
  490. mui.alert('请输入诉求内容!')
  491. } else if($('#zhuTiResult').val() == '') {
  492. mui.alert('请选择主题词!')
  493. } else {
  494. $.ajax({
  495. type: "post",
  496. dataType: 'json',
  497. url: huayi.config.callcenter_url + '/APP/AddWorkOrder',
  498. async: true,
  499. data: {
  500. type: $('#userResult').attr('data-index'), //诉求类型
  501. keys: $('#zhuTiResult').attr('data-index'), //关键词
  502. isprotect: $('input[name="secret"]:checked').val(), //(0普通1保密)
  503. level: $('input[name="jinji"]:checked').val(), //=(1普通2紧急)
  504. title: $('#title').val(), //投诉主题
  505. content: $('.content').val(), //投诉内容
  506. cusname: $('#name').val(), //投诉人姓名
  507. cusphone: $('#phone').val(), //投诉人电话
  508. sourcearea: $('#cityResult3').attr('data-index'), //事发地域id
  509. sourceaddress: $('#detail_address').val(), //详细地址
  510. // issubmit:1, //=(0保存1保存并提交)
  511. files: str_ary,
  512. usercode: usercode,
  513. },
  514. success: function(data) {
  515. if(data.state == "success") {
  516. mui.toast('投诉成功!');
  517. $("#name").val('');
  518. $("#phone").val('');
  519. $("#title").val('');
  520. $(".content").val('');
  521. $("#cityResult3").val('');
  522. $("#zhuTiResult").val('');
  523. $("#userResult").val('');
  524. $('#detail_address').val('');
  525. $('input[name="secret"][value="0"]').prop("checked", "checked");
  526. window.location.reload();
  527. } else {
  528. mui.toast(data.message);
  529. }
  530. }
  531. });
  532. }
  533. });
  534. //上传图片
  535. var applicationPath = window.applicationPath === "" ? "" : window.applicationPath || "../../";
  536. var $ = jQuery;
  537. $list = $('#image-list'),
  538. // 优化retina, 在retina下这个值是2
  539. ratio = window.devicePixelRatio || 1,
  540. // // 缩略图大小
  541. thumbnailWidth = 50 * ratio,
  542. thumbnailHeight = 50 * ratio,
  543. // Web Uploader实例
  544. //添加图片
  545. $(function() {
  546. uploader = WebUploader.create({
  547. // 自动上传。
  548. auto: true,
  549. // swf文件路径
  550. swf: '../js/Uploader.swf',
  551. // 文件接收服务端。
  552. // http://12345.shangqiu.gov.cn:8819/Web/Upload64
  553. //server: 'http://192.168.4.18:4120/WxLogin/UpdateFile',
  554. server: huayi.config.callcenter_url + 'Web/Upload64',
  555. // 选择文件的按钮。可选。
  556. // 内部根据当前运行是创建,可能是input元素,也可能是flash.
  557. pick: '#filePicker',
  558. // 图片数量限制
  559. fileNumLimit: 4,
  560. formData: {
  561. uploadtype: "Works"
  562. },
  563. //可以重复上传
  564. duplicate: true,
  565. // 只允许选择文件,可选。
  566. accept: {
  567. title: 'Images',
  568. extensions: 'gif,jpg,jpeg,bmp,png',
  569. mimeTypes: 'image/*'
  570. },
  571. resize: false
  572. });
  573. //上传图片提示
  574. uploader.on('error', function(handler) {
  575. if(handler == "Q_EXCEED_NUM_LIMIT") {
  576. mui.toast("超出最大文件数");
  577. }
  578. });
  579. // 当有文件添加进来的时候
  580. uploader.on('fileQueued', function(file) {
  581. $('#image-list').addClass('SHOW');
  582. console.log(file);
  583. var $li = $(
  584. '<div id="' + file.id + '" class="file-item thumbnail">' +
  585. '<div class="image-close">X</div>' +
  586. '<img>' +
  587. '<div class="info">' + file.name + '</div>' +
  588. '</div>'
  589. ),
  590. $img = $li.find('img');
  591. $list.prepend($li);
  592. var IMGLIST = $(".thumbnail");
  593. $(".image-close").on('tap', function() {
  594. event.stopPropagation();
  595. $(this).parent().remove();
  596. file_num()
  597. });
  598. });
  599. // 文件上传成功,给item添加成功class, 用样式标记上传成功。
  600. uploader.on('uploadSuccess', function(file, response) {
  601. $.each(response.data, function(i, j) {
  602. var $img = $('#' + file.id).find('img');
  603. var img = j.fileurl;
  604. // console.log(img);
  605. $('#' + file.id).attr({
  606. 'data-filename': j.filename,
  607. 'data-fileext': j.fileext,
  608. 'data-filemd5': j.filemd5,
  609. 'data-filesize': j.filesize,
  610. 'data-fileurl': j.fileurl
  611. });
  612. uploader.makeThumb(file, function(error, src) {
  613. if(error) {
  614. $img.replaceWith('<span class="Phone">' + file.ext + '</span>');
  615. return;
  616. }
  617. $img.attr('src', j.fileurl);
  618. $img.attr('data-preview-src', '');
  619. $img.addClass('image-item');
  620. $img.attr('data-preview-group', "1");
  621. }, thumbnailWidth, thumbnailHeight);
  622. });
  623. $('#' + file.id).addClass('upload-state-done');
  624. file_num()
  625. });
  626. // 文件上传失败,现实上传出错。
  627. uploader.on('uploadError', function(file) {
  628. var $li = $('#' + file.id),
  629. $error = $li.find('div.error');
  630. // 避免重复创建
  631. if(!$error.length) {
  632. $error = $('<div class="error"></div>').appendTo($li);
  633. }
  634. $error.text('上传失败');
  635. });
  636. // 完成上传完了,成功或者失败,先删除进度条。
  637. uploader.on('uploadComplete', function(file) {
  638. $('#' + file.id).find('.progress').remove();
  639. });
  640. });
  641. function file_num() {
  642. var arr = [];
  643. $('#image-list').find('.thumbnail').each(function(j, m) {
  644. var obj = {
  645. 'filename': $(m).attr("data-filename"),
  646. 'fileext': $(m).attr("data-fileext"),
  647. 'filemd5': $(m).attr("data-filemd5"),
  648. 'filesize': $(m).attr("data-filesize"),
  649. 'fileurl': $(m).attr("data-fileurl")
  650. }
  651. arr.push(obj)
  652. })
  653. window['Faultpic'] = arr;
  654. console.log(Faultpic);
  655. }
  656. //工单类型
  657. var typeList = [];
  658. $.ajax({
  659. type: "get",
  660. url: huayi.config.callcenter_url + 'Dictionary/GetDicValueListById?',
  661. async: false,
  662. data: {
  663. id: 2
  664. },
  665. dataType: 'json',
  666. success: function(data) {
  667. var type_data = data.data;
  668. $(type_data).each(function(i, n) {
  669. var obj = {};
  670. obj.value = n.F_ValueId;
  671. obj.text = n.F_Value;
  672. typeList.push(obj)
  673. })
  674. }
  675. });
  676. //事发地域
  677. var areaList = [];
  678. $.ajax({
  679. type: "get",
  680. url: huayi.config.callcenter_url + 'web/GetWebAreaList',
  681. async: false,
  682. data: {},
  683. dataType: 'json',
  684. success: function(data) {
  685. var area_data = data.data;
  686. // area_data = JSON.stringify(area_data);
  687. console.log(area_data);
  688. $(area_data).each(function(i, n) {
  689. var obj = {};
  690. obj.value = n.F_AreaId;
  691. obj.text = n.F_AreaName;
  692. areaList.push(obj)
  693. console.log(obj);
  694. })
  695. }
  696. });
  697. //主题词
  698. var keyList = [];
  699. $.ajax({
  700. type: "get",
  701. url: huayi.config.callcenter_url + 'Dictionary/GetDicValueListById?',
  702. async: false,
  703. data: {
  704. id: 3
  705. },
  706. dataType: 'json',
  707. success: function(data) {
  708. var key_data = data.data;
  709. $(key_data).each(function(i, n) {
  710. var obj = {};
  711. obj.value = n.F_ValueId;
  712. obj.text = n.F_Value;
  713. keyList.push(obj)
  714. })
  715. }
  716. });
  717. (function($, doc) {
  718. $.init();
  719. $.ready(function() {
  720. //诉求类型
  721. var userPicker = new $.PopPicker();
  722. userPicker.setData(typeList);
  723. var showUserPickerButton = doc.getElementById('showUserPicker');
  724. var userResult = doc.getElementById('userResult');
  725. showUserPickerButton.addEventListener('tap', function(event) {
  726. userPicker.show(function(items) {
  727. console.log(items)
  728. userResult.value = items[0].text;
  729. userResult.setAttribute("data-index", items[0].value);
  730. //返回 false 可以阻止选择框的关闭
  731. //return false;
  732. });
  733. }, false);
  734. //主题词
  735. var zhuTiPicker = new $.PopPicker();
  736. zhuTiPicker.setData(keyList);
  737. var showZhuTiPickerButton = doc.getElementById('showZhuTiPicker');
  738. var zhuTiResult = doc.getElementById('zhuTiResult');
  739. showZhuTiPickerButton.addEventListener('tap', function(event) {
  740. zhuTiPicker.show(function(items) {
  741. console.log(items)
  742. zhuTiResult.value = items[0].text;
  743. zhuTiResult.setAttribute("data-index", items[0].value);
  744. //返回 false 可以阻止选择框的关闭
  745. //return false;
  746. });
  747. }, false);
  748. //事件地址
  749. var cityPicker3 = new $.PopPicker();
  750. cityPicker3.setData(areaList);
  751. var showCityPickerButton = doc.getElementById('showCityPicker3');
  752. var cityResult3 = doc.getElementById('cityResult3');
  753. showCityPickerButton.addEventListener('tap', function(event) {
  754. cityPicker3.show(function(items) {
  755. cityResult3.value = items[0].text;
  756. cityResult3.setAttribute("data-index", items[0].value);
  757. //返回 false 可以阻止选择框的关闭
  758. //return false;
  759. });
  760. }, false);
  761. })
  762. })(mui, document);
  763. });
  764. </script>
  765. </body>
  766. </html>