Без опису
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

users_centre_field.htm 32KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660
  1. {eyou:volist name="$users_para" id="vo"}
  2. {eyou:switch name="vo.dtype"}
  3. {eyou:case value="hidden"}
  4. <!-- 隐藏域 start -->
  5. <div class="list_item" style="display: none;">
  6. <div class="list_left">
  7. {$vo.title}
  8. </div>
  9. <div class="flex-dir-row flex-y-center">
  10. <input type="hidden" class="input-txt" id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" value="{$vo.dfvalue|default=''}">
  11. </div>
  12. <span class="beta_arrow_right"></span>
  13. </div>
  14. <!-- 隐藏域 start -->
  15. {/eyou:case}
  16. {eyou:case value="mobile"}
  17. <!-- 手机文本框 start -->
  18. {eyou:if condition="3 == $users['thirdparty']"}
  19. <div class="list_item">
  20. <div class="list_left">
  21. {$vo.title}
  22. </div>
  23. <div class="flex-dir-row flex-y-center">
  24. {$users.mobile|default=''}
  25. </div>
  26. <span class="beta_arrow_right"></span>
  27. </div>
  28. {eyou:else /}
  29. <div class="list_item">
  30. <div class="list_left">
  31. {$vo.title}
  32. </div>
  33. <div class="flex-dir-row flex-y-center">
  34. {eyou:empty name='$users.mobile' /}
  35. <a href="JavaScript:void(0);" onclick="openMobileAction740128('绑定手机号');" class="fc9">请输入手机号码</a>
  36. {eyou:else /}
  37. <a href="JavaScript:void(0);" onclick="openMobileAction740128('修改手机号');">{$users.mobile}</a>
  38. {/eyou:empty}
  39. </div>
  40. <div id="users_bind_mobile_html" style="display: none;">
  41. <div class="el-row">
  42. <div class="ey-popup">
  43. <div class="el-form-item">
  44. <div class="el-input">
  45. <input type="text" name="mobile" class="el-input__inner" id="mobileInput740128" placeholder="手机号码" {eq name='$users.is_mobile' value='0'} value="{$users.mobile}" {/eq} maxlength="11" onpaste="this.value=this.value.replace(/[^\d]/g, '');" onkeyup="this.value=this.value.replace(/[^\d]/g, '');" autocomplete="off">
  46. </div>
  47. </div>
  48. <div class="el-form-item">
  49. <div class="el-input el-input-group">
  50. <input type="text" name="vertify" id="vertifyInput740128" autocomplete="off" class="el-input__inner" placeholder="图片验证码" />
  51. <img src="{eyou:url link='api/Ajax/vertify' vars='type=bind' /}" class="chicuele" id="imgVerifys" onClick="handleVerifyRefresh('imgVerifys', 'bind');">
  52. </div>
  53. </div>
  54. <div class="el-form-item">
  55. <div class="el-input el-input-group el-input-group--append el-input-group--prepend">
  56. <input type="text" name="mobile_code" class="el-input__inner" id="mobileCodeInput740128" placeholder="手机验证码" autocomplete="off">
  57. <div class="el-input-group__append">
  58. <input type="button" onclick="getMobileCode740128(this);" class="el-button el-button--default" value="获取验证码">
  59. </div>
  60. </div>
  61. </div>
  62. <div class="el-form-item">
  63. <div class="el-input">
  64. <button type="button" onclick="submitBindMobile740128();" class="el-button el-button--primary" style="width: 100%; box-sizing: border-box;">确定</button>
  65. </div>
  66. </div>
  67. </div>
  68. </div>
  69. </div>
  70. <script type="text/javascript">
  71. // 绑定、更换手机号码
  72. function openMobileAction740128(title) {
  73. var content = $('#users_bind_mobile_html').html();
  74. if (content) $('#users_bind_mobile_html').empty();
  75. layer.open({
  76. type: 1,
  77. anim: 2,
  78. title: title,
  79. content: content,
  80. success: function () {
  81. $(".layui-layer-content").parent().css('top', 'unset').css('bottom', '0px').css('width', '100%').css('left', '0px');
  82. },
  83. cancel: function() {
  84. if (content) $('#users_bind_mobile_html').html(content);
  85. }
  86. });
  87. }
  88. // 获取手机验证码
  89. function getMobileCode740128(obj) {
  90. // 手机号验证
  91. var mobile = $("#mobileInput740128").val();
  92. if (!mobile) {
  93. $("#mobileInput740128").focus();
  94. showLayerMsg('手机号码不能为空');
  95. return false;
  96. }
  97. // 手机格式不正确
  98. var mobile_format = /^1[0-9]{10}$/i;
  99. if (!mobile_format.test(mobile)) {
  100. $("#mobileInput740128").focus();
  101. showLayerMsg('请输入正确的手机号码');
  102. return false;
  103. }
  104. // 图形验证码
  105. var vertify = $("#vertifyInput740128").val();
  106. if (!vertify) {
  107. $("#vertifyInput740128").focus();
  108. showLayerMsg('请输入图形验证码');
  109. return false;
  110. }
  111. $(obj).val('获取中…');
  112. // 正在处理提示动画
  113. var loading = showLayerLoad();
  114. $.ajax({
  115. url : "{:dynamic_url('api/Ajax/SendMobileCode', ['_ajax'=>1])}",
  116. data: {mobile: mobile, is_mobile: true, source: 1, vertify: vertify, type: 'bind'},
  117. type: 'post',
  118. dataType: 'json',
  119. success: function(res) {
  120. layer.close(loading);
  121. showLayerMsg(res.msg);
  122. if (1 === parseInt(res.code)) {
  123. countDown740128(obj);
  124. $("#mobileCodeInput740128").focus();
  125. } else {
  126. $(obj).val('获取验证码');
  127. }
  128. },
  129. error: function(e) {
  130. layer.close(loading);
  131. $(obj).val('获取验证码');
  132. showLayerAlert(e.responseText);
  133. }
  134. });
  135. }
  136. // 倒计时
  137. function countDown740128(obj) {
  138. var setTime;
  139. var time = "{$mobile_send_time|default='120'}";
  140. setTime = setInterval(function() {
  141. if (0 >= parseInt(time)) {
  142. clearInterval(setTime);
  143. return false;
  144. }
  145. time--;
  146. $(obj).val(time + '秒').attr('disabled', true);
  147. if (0 === parseInt(time)) $(obj).val('获取验证码').attr('disabled', false);
  148. }, 1000);
  149. }
  150. // 提交手机及验证码进行绑定
  151. function submitBindMobile740128() {
  152. // 手机号验证
  153. var mobile = $("#mobileInput740128").val();
  154. if (!mobile) {
  155. $("#mobileInput740128").focus();
  156. showLayerMsg('手机号码不能为空');
  157. return false;
  158. }
  159. // 手机格式不正确
  160. var mobile_format = /^1[0-9]{10}$/i;
  161. if (!mobile_format.test(mobile)) {
  162. $("#mobileInput740128").focus();
  163. showLayerMsg('请输入正确的手机号码');
  164. return false;
  165. }
  166. var mobile_code = $("#mobileCodeInput740128").val();
  167. if(!mobile_code) {
  168. showLayerMsg('验证码不能为空');
  169. $("#mobileCodeInput740128").focus();
  170. return false;
  171. }
  172. var loading = showLayerLoad();
  173. $.ajax({
  174. url : "{:dynamic_url('user/Users/bind_mobile', ['_ajax'=>1])}",
  175. data: {mobile: mobile, mobile_code: mobile_code},
  176. type: 'post',
  177. dataType: 'json',
  178. success: function(res){
  179. if (1 === parseInt(res.code)) {
  180. layer.closeAll();
  181. showLayerMsg(res.msg, 2, function() {
  182. window.location.reload();
  183. });
  184. } else {
  185. layer.close(loading);
  186. showLayerMsg(res.msg);
  187. }
  188. },
  189. error: function(e) {
  190. layer.close(loading);
  191. showLayerAlert(e.responseText);
  192. }
  193. });
  194. };
  195. </script>
  196. </div>
  197. {/eyou:if}
  198. <!-- 手机文本框 end -->
  199. {/eyou:case}
  200. {eyou:case value="email"}
  201. <!-- 邮箱文本框 start -->
  202. <div class="list_item">
  203. <div class="list_left">
  204. {$vo.title}
  205. </div>
  206. <div class="flex-dir-row flex-y-center">
  207. {eyou:empty name='$users.email'/}
  208. <a href="JavaScript:void(0);" onclick="openEmailAction657130('绑定邮箱');" class="fc9">请输入邮箱地址</a>
  209. {eyou:else /}
  210. <a href="JavaScript:void(0);" onclick="openEmailAction657130('更改邮箱');">{$users.email}</a>
  211. {/eyou:empty}
  212. </div>
  213. </div>
  214. <div id="users_bind_email_html" style="display: none;">
  215. <div class="el-row">
  216. <div class="ey-popup">
  217. <div class="el-form-item">
  218. <div class="el-input">
  219. <input type="text" name="email" class="el-input__inner" id="emailInput657130" placeholder="请输入邮箱地址" {eyou:empty name='$users.is_email'} value="{$users.email}" {/eyou:empty} autocomplete="off">
  220. </div>
  221. </div>
  222. <div class="el-form-item">
  223. <div class="el-input el-input-group el-input-group--append el-input-group--prepend">
  224. <input type="text" name="email_code" class="el-input__inner" id="emailCodeInput657130" placeholder="请输入验证码" autocomplete="off">
  225. <div class="el-input-group__append">
  226. <input type="button" onclick="getEmailCode657130(this);" class="el-button el-button--default" value="获取验证码">
  227. </div>
  228. </div>
  229. </div>
  230. <div class="el-form-item">
  231. <div class="el-input">
  232. <button type="button" onclick="submitBindEmail657130();" class="el-button el-button--primary" style="width: 100%; box-sizing: border-box;">确定</button>
  233. </div>
  234. </div>
  235. </div>
  236. </div>
  237. </div>
  238. <script type="text/javascript">
  239. // 绑定、更换邮箱
  240. function openEmailAction657130(title) {
  241. var content = $('#users_bind_email_html').html();
  242. if (content) $('#users_bind_email_html').empty();
  243. layer.open({
  244. type: 1,
  245. anim: 2,
  246. title: title,
  247. content: content,
  248. success: function () {
  249. $(".layui-layer-content").parent().css('top', 'unset').css('bottom', '0px').css('width', '100%').css('left', '0px');
  250. },
  251. cancel: function() {
  252. if (content) $('#users_bind_email_html').html(content);
  253. }
  254. });
  255. }
  256. // 获取邮箱验证码
  257. function getEmailCode657130(obj) {
  258. // 邮箱地址
  259. var email = $("#emailInput657130").val();
  260. // 验证邮箱格式是否正确
  261. if (!handleEmailFormat(email)) {
  262. $("#emailInput657130").focus();
  263. showLayerMsg('请输入正确邮箱地址');
  264. return false;
  265. }
  266. $(obj).val('获取中…');
  267. // 正在处理提示动画
  268. var loading = showLayerLoad();
  269. $.ajax({
  270. url : "{:dynamic_url('user/Smtpmail/send_email', ['_ajax'=>1])}",
  271. data: {email: email, title: '邮箱验证', type: 'bind_email', scene: 3},
  272. type: 'post',
  273. dataType: 'json',
  274. success: function(res) {
  275. layer.close(loading);
  276. showLayerMsg(res.msg);
  277. if (1 === parseInt(res.code)) {
  278. countDown657130(obj);
  279. $("#emailCodeInput657130").focus();
  280. } else {
  281. $(obj).val('获取验证码');
  282. }
  283. },
  284. error: function(e) {
  285. layer.close(loading);
  286. $(obj).val('获取验证码');
  287. showLayerAlert(e.responseText);
  288. }
  289. });
  290. }
  291. // 倒计时
  292. function countDown657130(obj) {
  293. var setTime;
  294. var time = "{$email_send_time|default='120'}";
  295. setTime = setInterval(function() {
  296. if (0 >= parseInt(time)) {
  297. clearInterval(setTime);
  298. return false;
  299. }
  300. time--;
  301. $(obj).val(time + '秒').attr('disabled', true);
  302. if (0 === parseInt(time)) $(obj).val('获取验证码').attr('disabled', false);
  303. }, 1000);
  304. }
  305. // 提交邮箱绑定信息
  306. function submitBindEmail657130() {
  307. // 验证邮箱格式是否正确
  308. var email = $("#emailInput657130").val();
  309. if (!(email)) {
  310. showLayerMsg('邮箱地址不能为空');
  311. return false;
  312. }
  313. // 验证邮箱格式是否正确
  314. var email = $("#emailInput657130").val();
  315. if (!handleEmailFormat(email)) {
  316. showLayerMsg('请输入正确邮箱地址');
  317. return false;
  318. }
  319. // 邮箱验证码不能为空
  320. var email_code = $("#emailCodeInput657130").val();
  321. if (!email_code) {
  322. $("#emailCodeInput657130").focus();
  323. showLayerMsg('验证码不能为空');
  324. return false;
  325. }
  326. var loading = showLayerLoad();
  327. $.ajax({
  328. url : "{:dynamic_url('user/Users/bind_email', ['_ajax'=>1])}",
  329. data: {email: email, email_code: email_code},
  330. type: 'post',
  331. dataType: 'json',
  332. success: function(res){
  333. if (1 === parseInt(res.code)) {
  334. layer.closeAll();
  335. showLayerMsg(res.msg, 2, function() {
  336. window.location.reload();
  337. });
  338. } else {
  339. layer.close(loading);
  340. showLayerMsg(res.msg);
  341. }
  342. },
  343. error: function(e) {
  344. layer.close(loading);
  345. showLayerAlert(e.responseText);
  346. }
  347. });
  348. }
  349. </script>
  350. <!-- 邮箱文本框 end -->
  351. {/eyou:case}
  352. {eyou:case value="text"}
  353. <!-- 单行文本框 start -->
  354. <div class="list_item">
  355. <div class="list_left">
  356. {$vo.title}
  357. </div>
  358. <div class="flex-dir-row flex-y-center">
  359. <input type="text" class="input-text" id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" value="{$vo.dfvalue|default=''}">{$vo.dfvalue_unit|default=''}
  360. </div>
  361. </div>
  362. <!-- 单行文本框 end -->
  363. {/eyou:case}
  364. {eyou:case value="multitext"}
  365. <!-- 多行文本框 start -->
  366. <div class="list_item">
  367. <div class="list_left">
  368. {$vo.title}
  369. </div>
  370. <div class="flex-dir-row flex-y-center">
  371. <textarea id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" style="height: 20px; width: 100%;">{$vo.dfvalue|default=''}</textarea>
  372. </div>
  373. </div>
  374. <!-- 多行文本框 end -->
  375. {/eyou:case}
  376. {eyou:case value="checkbox"}
  377. <!-- 复选框 start -->
  378. <div class="list_item" style="padding: 10px 15px;">
  379. <div class="list_left">
  380. {$vo.title}
  381. </div>
  382. <div class="flex-dir-row flex-y-center">
  383. {eyou:volist name="$vo.dfvalue" id="v2"}
  384. <label class="checkbox-label">
  385. <input type="checkbox" class="checkbox" name="{$vo.fieldArr}[{$vo.name|default=''}][]" value="{$v2}" {if condition="isset($vo['trueValue']) AND in_array($v2, $vo['trueValue'])"} checked="checked" {/if}>
  386. <span class="check-mark"></span>
  387. <span class="text">{$v2}</span>
  388. </label>
  389. {/eyou:volist}
  390. </div>
  391. </div>
  392. <!-- 复选框 end -->
  393. {/eyou:case}
  394. {eyou:case value="radio"}
  395. <!-- 单选项 start -->
  396. <div class="list_item" style="padding: 10px 15px;">
  397. <div class="list_left">
  398. {$vo.title}
  399. </div>
  400. <div class="flex-dir-row flex-y-center">
  401. {eyou:volist name="$vo.dfvalue" id="v2"}
  402. <label class="radio-label">
  403. <input type="radio" class="radio" name="{$vo.fieldArr}[{$vo.name|default=''}]" value="{$v2}" {eyou:if condition="isset($vo['trueValue']) AND in_array($v2, $vo['trueValue'])"} checked="checked" {/eyou:if}>
  404. <span class="check-mark"></span>
  405. <span class="text">{$v2}</span>
  406. </label>
  407. {/eyou:volist}
  408. </div>
  409. </div>
  410. <!-- 单选项 end -->
  411. {/eyou:case}
  412. {eyou:case value="select"}
  413. <!-- 下拉框 start -->
  414. <div class="list_item">
  415. <div class="list_left">
  416. {$vo.title}
  417. </div>
  418. <div class="flex-dir-row flex-y-center">
  419. <div class="select">
  420. <select name="{$vo.fieldArr}[{$vo.name|default=''}]" id="{$vo.fieldArr}_{$vo.name|default=''}">
  421. <option value="">请选择</option>
  422. {eyou:volist name="$vo.dfvalue" id="v2"}
  423. <option value="{$v2}" {eyou:if condition="isset($vo['trueValue']) AND in_array($v2, $vo['trueValue'])"} selected {/eyou:if}>{$v2}</option>
  424. {/eyou:volist}
  425. </select>
  426. </div>
  427. </div>
  428. <span class="beta_arrow_right"></span>
  429. </div>
  430. <!-- 下拉框 end -->
  431. {/eyou:case}
  432. <!-- 扩展 start -->
  433. {case value="imgs"}
  434. <script type="text/javascript" src="__STATIC__/admin/js/jquery-ui/jquery-ui.min.js"></script>
  435. <!-- 多张图 start -->
  436. <div class="list_item item-from-flex">
  437. <div class="list_left">
  438. {$vo.title|default=''}
  439. </div>
  440. <div class="flex-dir-row flex-y-center tab-pane" id="dl_{$vo.fieldArr}_{$vo.name|default=''}">
  441. <div class="images_upload_main" id="tab_{$vo.fieldArr}_{$vo.name|default=''}">
  442. <div class="sort-list-{$vo.fieldArr}_{$vo.name|default=''}">
  443. {volist name="$vo[$vo['name'].'_eyou_imgupload_list']" id="v2" key="k2"}
  444. <div class="fieldext_upload fieldext_upload_html" >
  445. <div class="images_upload_item">
  446. <input type="hidden" name="{$vo.fieldArr}[{$vo.name|default=''}][]" value="{$v2|default=''}">
  447. <a class="img-upload" href="{$v2|default=''}" onclick="" target="_blank">
  448. <img src="{$v2|default=''}">
  449. </a>
  450. <a class="delete" href="javascript:void(0)" onclick="{$vo.fieldArr}_{$vo.name|default=''}_ClearPicArr2(this,'{$v2|default=''}')">删除</a>
  451. </div>
  452. </div>
  453. {/volist}
  454. <div class="fieldext_upload" style="display:none;"></div>
  455. </div>
  456. </div>
  457. <!-- 上传图片显示的样板 start -->
  458. <div class="{$vo.fieldArr}_{$vo.name|default=''}_upload_tpl" style="display: none;">
  459. <div class="fieldext_upload fieldext_upload_html">
  460. <div class="images_upload_item">
  461. <input type="hidden" name="{$vo.fieldArr}[{$vo.name|default=''}][]" value="" />
  462. <a class="img-upload" href="javascript:void(0);" onClick="" >
  463. <img src="__STATIC__/admin/images/add-button.jpg"/>
  464. </a>
  465. <a class="delete" href="javascript:void(0)">&nbsp;&nbsp;</a>
  466. </div>
  467. </div>
  468. </div>
  469. <!-- 上传图片显示的样板 end -->
  470. <div class="images_upload_main" id="tab_{$vo.fieldArr}_{$vo.name|default=''}">
  471. <div class="fieldext_upload fieldext_upload_html">
  472. <a href="javascript:void(0);" onClick="GetUploadify(100, '', 'allimg', '{$vo.fieldArr}_{$vo.name|default=''}_call_back', '', '上传多图', 1);" class="img-upload">
  473. <div class="y-line"></div>
  474. <div class="x-line"></div>
  475. </a>
  476. </div>
  477. </div>
  478. </div>
  479. </div>
  480. <script type="text/javascript">
  481. // 上传多图回调函数
  482. function {$vo.fieldArr}_{$vo.name|default=''}_call_back(paths) {
  483. var last_div = $(".{$vo.fieldArr}_{$vo.name|default=''}_upload_tpl").html();
  484. for (var i = 0; i < paths.length; i++) {
  485. if ($(".sort-list-{$vo.fieldArr}_{$vo.name|default=''} .fieldext_upload_html").length > 0) {
  486. $(".sort-list-{$vo.fieldArr}_{$vo.name|default=''} .fieldext_upload_html:last").after(last_div); // 插入一个 新图片
  487. } else {
  488. $(".sort-list-{$vo.fieldArr}_{$vo.name|default=''} .fieldext_upload:last").before(last_div); // 插入一个 新图片
  489. }
  490. $(".sort-list-{$vo.fieldArr}_{$vo.name|default=''} .fieldext_upload_html:last").find('a:eq(0)').attr('href',paths[i]).attr('onclick','').attr('target', "_blank");// 修改他的链接地址
  491. $(".sort-list-{$vo.fieldArr}_{$vo.name|default=''} .fieldext_upload_html:last").find('img').attr('src',paths[i]);// 修改他的图片路径
  492. $(".sort-list-{$vo.fieldArr}_{$vo.name|default=''} .fieldext_upload_html:last").find('a:eq(1)').attr('onclick',"{$vo.fieldArr}_{$vo.name|default=''}_ClearPicArr2(this,'"+paths[i]+"')").text('删除');
  493. $(".sort-list-{$vo.fieldArr}_{$vo.name|default=''} .fieldext_upload_html:last").find('input').val(paths[i]); // 设置隐藏域 要提交的值
  494. }
  495. }
  496. // 上传之后删除组图input
  497. function {$vo.fieldArr}_{$vo.name|default=''}_ClearPicArr2(obj,path) {
  498. $(obj).parent().parent().remove();
  499. }
  500. /** 以下 产品相册的拖动排序相关 js*/
  501. $( ".sort-list-{$vo.fieldArr}_{$vo.name|default=''}" ).sortable({
  502. start: function( event, ui) {},
  503. stop: function( event, ui ) {}
  504. });
  505. $( ".sort-list-{$vo.fieldArr}_{$vo.name|default=''}" ).disableSelection();
  506. </script>
  507. <!-- 多张图 end -->
  508. {/case}
  509. {eyou:case value="img"}
  510. <!-- 单张图 start -->
  511. <div class="list_item item-from-flex">
  512. <div class="list_left">
  513. {$vo.title}
  514. </div>
  515. <div class="flex-dir-row flex-y-center">
  516. <div class="images_upload_main mr10">
  517. <a href="javascript:void(0);" onclick="$('#singlePicFile_{$vo.name|default=''}').trigger('click');" class="img-upload img_a_{$vo.fieldArr}_{$vo.name|default=''}">
  518. <div class="y-line" id="singlePicYline_{$vo.para_id|default=0}" {notempty name="$vo.info"} style="display: none;" {/notempty}></div>
  519. <div class="x-line" id="singlePicXline_{$vo.para_id|default=0}" {notempty name="$vo.info"} style="display: none;" {/notempty}></div>
  520. <img src="{$vo.info|default=''}" id="singlePicImgSrc_{$vo.para_id|default=0}" {empty name='$vo.info'}display: none;{/empty}">
  521. </a>
  522. </div>
  523. <input type="file" id="singlePicFile_{$vo.name|default=''}" data-id="{$vo.para_id|default=0}" onchange="uploadSinglePicFile(this);" style="display: none;">
  524. <input type="hidden" name="{$vo.fieldArr}[{$vo.name|default=''}]" id="singlePicHidden_{$vo.para_id|default=0}" value="{$vo.info|default=''}">
  525. </div>
  526. </div>
  527. <!-- 单张图 end -->
  528. {/eyou:case}
  529. {case value="file"}
  530. {eyou:static file="/public/plugins/layui/css/layui.css" /}
  531. {eyou:static file="/public/plugins/layui/layui.js" /}
  532. <!-- 单个文件 start -->
  533. <div class="list_item">
  534. <div class="list_left">
  535. {$vo.title}
  536. </div>
  537. <div class="flex-dir-row flex-y-center">
  538. <a id="download_file_{$vo.fieldArr}_{$vo.name|default=''}" style="margin-right: 30px; text-decoration: none; {eyou:notempty name='$vo.dfvalue' /} display: ''; {eyou:else /} display: none; {/eyou:notempty}" {eyou:notempty name='$vo.dfvalue' /} href="{$vo.dfvalue|default=''}" download="{$vo.dfvalue|get_filename=###}" {/eyou:notempty}>
  539. <img src="__STATIC__/common/images/file.png" alt="" style="width: 16px; height: 16px; margin-right: 3px;">下载</a>
  540. <input type="text" id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" value="{$vo.dfvalue|default=''}" style="display: none;">
  541. <button type="button" class="el-button el-button--small" id="upload_{$vo.fieldArr}_{$vo.name|default=''}" ><i class="el-icon-paperclip"></i>上传文件</button>
  542. </div>
  543. </div>
  544. <script type="text/javascript">
  545. $(function() {
  546. layui.use('upload', function() {
  547. // 执行实例
  548. var upload = layui.upload;
  549. var uploadInst = upload.render({
  550. elem: "#upload_{$vo.fieldArr}_{$vo.name|default=''}",
  551. url: "{:url('user/Uploadify/DownloadUploadFileAjax')}",
  552. accept: 'file',
  553. exts: '{$vo.ext}',
  554. size: {$vo.filesize},
  555. done: function(res) {
  556. if (res.state == "SUCCESS") {
  557. layer.msg('上传成功!');
  558. $("#{$vo.fieldArr}_{$vo.name|default=''}").val(res.url);
  559. $("#download_file_{$vo.fieldArr}_{$vo.name|default=''}").css('display','');
  560. $("#download_file_{$vo.fieldArr}_{$vo.name|default=''}").attr('href', res.url);
  561. var arr = res.url.split("/");
  562. var download = arr[arr.length-1];
  563. $("#download_file_{$vo.fieldArr}_{$vo.name|default=''}").attr('download', download);
  564. $("#download_file_{$vo.fieldArr}_{$vo.name|default=''}").css('color', '#000');
  565. $("#download_file_{$vo.fieldArr}_{$vo.name|default=''}").html('<img src="__STATIC__/common/images/file.png" alt="" style="width: 16px;height: 16px;">下载附件');
  566. } else {
  567. showLayerAlert(res.state);
  568. $("#download_file_{$vo.fieldArr}_{$vo.name|default=''}").css('display', '');
  569. $("#download_file_{$vo.fieldArr}_{$vo.name|default=''}").css('color', 'red');
  570. $("#download_file_{$vo.fieldArr}_{$vo.name|default=''}").text(res.state);
  571. }
  572. }
  573. });
  574. });
  575. });
  576. </script>
  577. <!-- 单个文件 end -->
  578. {/case}
  579. {eyou:case value="datetime"}
  580. {eyou:static file="/public/plugins/laydate/laydate.js"/}
  581. <!-- 日期和时间 start -->
  582. <div class="list_item">
  583. <div class="list_left">
  584. {$vo.title}
  585. </div>
  586. <div class="flex-dir-row flex-y-center">
  587. <input type="text" class="input-text" id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" value="{$vo.dfvalue|default=''}">{$vo.dfvalue_unit|default=''}
  588. </div>
  589. </div>
  590. <script type="text/javascript">
  591. $(function () {
  592. $('#{$vo.fieldArr}_{$vo.name|default=''}').layDate();
  593. });
  594. </script>
  595. <!-- 日期和时间 end -->
  596. {/eyou:case}
  597. {/eyou:switch}
  598. {/eyou:volist}
  599. <script type="text/javascript">
  600. // 单图上传
  601. function uploadSinglePicFile(obj) {
  602. var file = $(obj)[0].files[0];
  603. if (!file) return false;
  604. var formData = new FormData();
  605. formData.append('_ajax', 1);
  606. formData.append('file', file);
  607. formData.append('compress', '1000-1000');
  608. showLayerLoad();
  609. $.ajax({
  610. type: 'post',
  611. url : eyou_basefile + "?m=user&c=Uploadify&a=imageUp",
  612. data: formData,
  613. contentType: false,
  614. processData: false,
  615. dataType: 'json',
  616. success: function (res) {
  617. layer.closeAll();
  618. if (res.state == 'SUCCESS') {
  619. var id = $(obj).data('id');
  620. $("#singlePicHidden_" + id).val(res.url);
  621. $("#singlePicImgSrc_" + id).show().attr('src', res.url);
  622. $('#singlePicYline_'+id+', #singlePicXline_' + id).hide();
  623. } else {
  624. showLayerAlert(res.state);
  625. }
  626. },
  627. error: function(e) {
  628. layer.closeAll();
  629. showLayerAlert(e.responseText);
  630. }
  631. })
  632. }
  633. </script>