No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

users_centre_field.htm 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435
  1. {eyou:volist name="$users_para" id="vo"}
  2. {eyou:switch name="vo.dtype"}
  3. {eyou:case value="hidden"}
  4. <!-- 隐藏域 start -->
  5. <div class="item-from-row" style="display: none;">
  6. <dt class="tit">{$vo.title}:</dt>
  7. <dd class="opt">
  8. <input type="hidden" id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" value="{$vo.dfvalue|default=''}">
  9. </dd>
  10. </div>
  11. <!-- 隐藏域 end -->
  12. {/eyou:case}
  13. {eyou:case value="mobile"}
  14. <!-- 手机文本框 start -->
  15. <div class="item-from-row">
  16. <div class="from-row-l">
  17. {eyou:if condition="1 == $vo.is_required"}
  18. <span class="red">*</span>
  19. {eyou:else/}
  20. <span class="red"></span>
  21. {/eyou:if}
  22. {$vo.title}:
  23. </div>
  24. <div class="from-row-r">
  25. {$vo.dfvalue|default=''}
  26. {eyou:eq name='$users.is_mobile' value='1'}
  27. <span class="err"><a href="JavaScript:void(0);" onclick="get_{$vo.fieldArr}{$vo.name|default=''}_mobile_code('更改手机');">( 更改手机 )</a></span>
  28. {eyou:else/}
  29. <span class="err"><a href="JavaScript:void(0);" onclick="get_{$vo.fieldArr}{$vo.name|default=''}_mobile_code('绑定手机');">( 绑定手机 )</a></span>
  30. {/eyou:eq}
  31. <script type="text/javascript">
  32. function get_{$vo.fieldArr}{$vo.name|default=''}_mobile_code(title) {
  33. var url = '{$RootDir}/index.php?m=user&c=Users&a=bind_mobile';
  34. if (url.indexOf('?') > -1) {
  35. url += '&';
  36. } else {
  37. url += '?';
  38. }
  39. url += 'title=' + title;
  40. //iframe窗
  41. layer.open({
  42. type: 2,
  43. title: title,
  44. shadeClose: false,
  45. maxmin: false, //开启最大化最小化按钮
  46. area: ['400px', '330px'],
  47. content: url
  48. });
  49. }
  50. </script>
  51. <p class="notic">{$vo.remark|default=''}</p>
  52. </div>
  53. </div>
  54. <!-- 手机文本框 end -->
  55. {/eyou:case}
  56. {eyou:case value="email"}
  57. <!-- 邮箱文本框 start -->
  58. <div class="item-from-row">
  59. <div class="from-row-l">
  60. {eyou:if condition="1 == $vo.is_required"}
  61. <span class="red">*</span>
  62. {eyou:else/}
  63. <span class="red"></span>
  64. {/eyou:if}
  65. {$vo.title}:
  66. </div>
  67. <div class="from-row-r">
  68. {$vo.dfvalue|default=''}
  69. {eyou:eq name='$users.is_email' value='1'}
  70. <span class="err"><a href="JavaScript:void(0);" onclick="get_{$vo.fieldArr}{$vo.name|default=''}_email_code('更改邮箱');">( 更改邮箱 )</a></span>
  71. {eyou:else/}
  72. <span class="err"><a href="JavaScript:void(0);" onclick="get_{$vo.fieldArr}{$vo.name|default=''}_email_code('绑定邮箱');">( 绑定邮箱 )</a></span>
  73. {/eyou:eq}
  74. <p class="notic">{$vo.remark|default=''}</p>
  75. </div>
  76. </div>
  77. <script type="text/javascript">
  78. function get_{$vo.fieldArr}{$vo.name|default=''}_email_code(title)
  79. {
  80. var url = "{eyou:url link='user/Users/bind_email'/}";
  81. if (url.indexOf('?') > -1) {
  82. url += '&';
  83. } else {
  84. url += '?';
  85. }
  86. url += 'title='+title;
  87. //iframe窗
  88. layer.open({
  89. type: 2,
  90. title: title,
  91. shadeClose: false,
  92. maxmin: false, //开启最大化最小化按钮
  93. area: ['400px', '270px'],
  94. content: url
  95. });
  96. }
  97. </script>
  98. <!-- 邮箱文本框 end -->
  99. {/eyou:case}
  100. {eyou:case value="text"}
  101. <!-- 单行文本框 start -->
  102. <div class="item-from-row">
  103. <div class="from-row-l">
  104. {eyou:if condition="1 == $vo.is_required"}
  105. <span class="red">*</span>
  106. {eyou:else/}
  107. <span class="red"></span>
  108. {/eyou:if}
  109. {$vo.title}:
  110. </div>
  111. <div class="from-row-r">
  112. <input type="text" class="el-input__inner w310" id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" value="{$vo.dfvalue|default=''}" autocomplete="off">{$vo.dfvalue_unit|default=''}
  113. </div>
  114. </div>
  115. <!-- 单行文本框 end -->
  116. {/eyou:case}
  117. {eyou:case value="multitext"}
  118. <!-- 多行文本框 start -->
  119. <div class="item-from-row">
  120. <div class="from-row-l">
  121. {eyou:if condition="1 == $vo.is_required"}
  122. <span class="red">*</span>
  123. {eyou:else/}
  124. <span class="red"></span>
  125. {/eyou:if}
  126. {$vo.title}:
  127. </div>
  128. <div class="from-row-r">
  129. <textarea id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" class="w310" autocomplete="off">{$vo.dfvalue|default=''}</textarea>
  130. </div>
  131. </div>
  132. <!-- 多行文本框 end -->
  133. {/eyou:case}
  134. {eyou:case value="checkbox"}
  135. <!-- 复选框 start -->
  136. <div class="item-from-row">
  137. <div class="from-row-l">
  138. {eyou:if condition="1 == $vo.is_required"}
  139. <span class="red">*</span>
  140. {eyou:else/}
  141. <span class="red"></span>
  142. {/eyou:if}
  143. {$vo.title}:
  144. </div>
  145. <div class="from-row-r">
  146. {eyou:volist name="$vo.dfvalue" id="v2"}
  147. <label class="checkbox-label">
  148. <span>{$v2}</span>
  149. <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}>
  150. <span class="check-mark"></span>
  151. </label>
  152. {/eyou:volist}
  153. <!-- {eyou:if condition="1 == $vo.is_required"}(必选){/eyou:if} -->
  154. </div>
  155. </div>
  156. <!-- 复选框 end -->
  157. {/eyou:case}
  158. {eyou:case value="radio"}
  159. <!-- 单选项 start -->
  160. <div class="item-from-row">
  161. <div class="from-row-l">
  162. {eyou:if condition="1 == $vo.is_required"}
  163. <span class="red">*</span>
  164. {eyou:else/}
  165. <span class="red"></span>
  166. {/eyou:if}
  167. {$vo.title}:
  168. </div>
  169. <div class="from-row-r">
  170. {eyou:volist name="$vo.dfvalue" id="v2"}
  171. <label class="radio-label">
  172. <span>{$v2}</span>
  173. <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}>
  174. <span class="check-mark"></span>
  175. </label>
  176. {/eyou:volist}
  177. <!-- {eyou:if condition="1 == $vo.is_required"}(必选){/eyou:if} -->
  178. </div>
  179. </div>
  180. <!-- 单选项 end -->
  181. {/eyou:case}
  182. {eyou:case value="select"}
  183. <!-- 下拉框 start -->
  184. <div class="item-from-row">
  185. <div class="from-row-l">
  186. {eyou:if condition="1 == $vo.is_required"}
  187. <span class="red">*</span>
  188. {eyou:else/}
  189. <span class="red"></span>
  190. {/eyou:if}
  191. {$vo.title}:
  192. </div>
  193. <div class="from-row-r">
  194. <div class="w310 select">
  195. <select name="{$vo.fieldArr}[{$vo.name|default=''}]" id="{$vo.fieldArr}_{$vo.name|default=''}">
  196. <option value="">请选择</option>
  197. {eyou:volist name="$vo.dfvalue" id="v2"}
  198. <option value="{$v2}" {eyou:if condition="isset($vo['trueValue']) AND in_array($v2, $vo['trueValue'])"} selected {/eyou:if}>{$v2}</option>
  199. {/eyou:volist}
  200. </select>
  201. </div>
  202. </div>
  203. </div>
  204. <!-- 下拉框 end -->
  205. {/eyou:case}
  206. {eyou:case value="img"}
  207. <!-- 单张图 start -->
  208. <div class="item-from-row">
  209. <div class="from-row-l">
  210. {eyou:if condition="1 == $vo.is_required"}
  211. <span class="red">*</span>
  212. {eyou:else/}
  213. <span class="red"></span>
  214. {/eyou:if}
  215. {$vo.title}:
  216. </div>
  217. <div class="from-row-r">
  218. <a href="javascript:void(0);" onclick="$('#singlePicFile_{$vo.fieldArr}_{$vo.name|default=''}').trigger('click');" class="img-upload">
  219. <div class="y-line" id="singlePicYline_{$vo.para_id|default=0}" {notempty name='$vo.info'} style="display: none;" {/notempty}></div>
  220. <div class="x-line" id="singlePicXline_{$vo.para_id|default=0}" {notempty name='$vo.info'} style="display: none;" {/notempty}></div>
  221. <img src="{$vo.info|default=''}" id="singlePicImgSrc_{$vo.para_id|default=0}" >
  222. </a>
  223. </div>
  224. <input type="file" id="singlePicFile_{$vo.fieldArr}_{$vo.name|default=''}" data-id="{$vo.para_id|default=0}" onchange="uploadSinglePicFile(this);" style="display: none;">
  225. <input type="hidden" name="{$vo.fieldArr}[{$vo.name|default=''}]" id="singlePicHidden_{$vo.para_id|default=0}" value="{$vo.info|default=''}">
  226. </div>
  227. <!-- 单张图 end -->
  228. {/eyou:case}
  229. {case value="imgs"}
  230. <script type="text/javascript" src="__STATIC__/admin/js/jquery-ui/jquery-ui.min.js"></script>
  231. <!-- 多张图 start -->
  232. <div class="item-from-row" id="dl_{$vo.fieldArr}_{$vo.name|default=''}">
  233. <div class="from-row-l">
  234. {eyou:if condition="1 == $vo.is_required"}
  235. <span class="red">*</span>
  236. {eyou:else/}
  237. <span class="red"></span>
  238. {/eyou:if}
  239. {$vo.title}:
  240. </div>
  241. <div class="from-row-r">
  242. <div class="images_upload_main" id="tab_{$vo.fieldArr}_{$vo.name|default=''}">
  243. <div class="sort-list-{$vo.fieldArr}_{$vo.name|default=''}">
  244. {volist name="$vo[$vo['name'].'_eyou_imgupload_list']" id="v2" key="k2"}
  245. <div class="fieldext_upload fieldext_upload_html" >
  246. <div class="images_upload_item">
  247. <input type="hidden" name="{$vo.fieldArr}[{$vo.name|default=''}][]" value="{$v2|default=''}">
  248. <a href="{$v2|default=''}" onclick="" class="pic">
  249. <img src="{$v2|default=''}">
  250. </a>
  251. <a class="delete" title="删除" href="javascript:void(0)" onclick="{$vo.fieldArr}_{$vo.name|default=''}_ClearPicArr2(this,'{$v2|default=''}')"></a>
  252. </div>
  253. </div>
  254. {/volist}
  255. <div class="fieldext_upload" style="display:none;"></div>
  256. </div>
  257. <a href="javascript:void(0);" onClick="GetUploadify(100,'','allimg','{$vo.fieldArr}_{$vo.name|default=''}_call_back', '', '{$vo.title}');" class="img-upload" title="上传图片">
  258. <div class="y-line"></div>
  259. <div class="x-line"></div>
  260. </a>
  261. </div>
  262. <!-- 上传图片显示的样板 start -->
  263. <div class="{$vo.fieldArr}_{$vo.name|default=''}_upload_tpl" style="display: none;">
  264. <div class="fieldext_upload fieldext_upload_html">
  265. <div class="images_upload_item">
  266. <input type="hidden" name="{$vo.fieldArr}[{$vo.name|default=''}][]" value="" />
  267. <a href="javascript:void(0);" onClick="" >
  268. <img src="__STATIC__/admin/images/add-button.jpg"/>
  269. </a>
  270. <a class="delete" href="javascript:void(0)" title="删除">&nbsp;&nbsp;</a>
  271. </div>
  272. </div>
  273. </div>
  274. <!-- 上传图片显示的样板 end -->
  275. </div>
  276. </div>
  277. <script type="text/javascript">
  278. // 上传多图回调函数
  279. function {$vo.fieldArr}_{$vo.name|default=''}_call_back(paths) {
  280. var last_div = $(".{$vo.fieldArr}_{$vo.name|default=''}_upload_tpl").html();
  281. for (var i = 0; i < paths.length; i++) {
  282. if ($(".sort-list-{$vo.fieldArr}_{$vo.name|default=''} .fieldext_upload_html").length > 0) {
  283. $(".sort-list-{$vo.fieldArr}_{$vo.name|default=''} .fieldext_upload_html:last").after(last_div); // 插入一个 新图片
  284. } else {
  285. $(".sort-list-{$vo.fieldArr}_{$vo.name|default=''} .fieldext_upload:last").before(last_div); // 插入一个 新图片
  286. }
  287. $(".sort-list-{$vo.fieldArr}_{$vo.name|default=''} .fieldext_upload_html:last").find('a:eq(0)').attr('href',paths[i]).attr('onclick','').attr('target', "_blank");// 修改他的链接地址
  288. $(".sort-list-{$vo.fieldArr}_{$vo.name|default=''} .fieldext_upload_html:last").find('img').attr('src',paths[i]);// 修改他的图片路径
  289. $(".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('');
  290. $(".sort-list-{$vo.fieldArr}_{$vo.name|default=''} .fieldext_upload_html:last").find('input').val(paths[i]); // 设置隐藏域 要提交的值
  291. }
  292. }
  293. // 上传之后删除组图input
  294. function {$vo.fieldArr}_{$vo.name|default=''}_ClearPicArr2(obj,path) {
  295. $(obj).parent().remove();
  296. }
  297. /** 以下 产品相册的拖动排序相关 js*/
  298. $( ".sort-list-{$vo.fieldArr}_{$vo.name|default=''}" ).sortable({
  299. start: function( event, ui) {},
  300. stop: function( event, ui ) {}
  301. });
  302. $( ".sort-list-{$vo.fieldArr}_{$vo.name|default=''}" ).disableSelection();
  303. </script>
  304. <!-- 多张图 end -->
  305. {/case}
  306. {case value="file"}
  307. {eyou:static file="/public/plugins/layui/css/layui.css" /}
  308. {eyou:static file="/public/plugins/layui/layui.js" /}
  309. <!-- 单个文件 start -->
  310. <div class="item-from-row">
  311. <div class="from-row-l">
  312. {eyou:if condition="1 == $vo.is_required"}
  313. <span class="red">*</span>
  314. {eyou:else/}
  315. <span class="red"></span>
  316. {/eyou:if}
  317. {$vo.title}:
  318. </div>
  319. <div class="from-row-r" >
  320. <a id="download_file_{$vo.fieldArr}_{$vo.name|default=''}" style="margin-right: 30px;text-decoration: underline;{eyou:notempty name='$vo.info' /}display: '';{eyou:else /}display: none;{/eyou:notempty}"
  321. {eyou:notempty name='$vo.info' /} href="{$vo.info|default=''}" download="{$vo.info|get_filename=###}" {/eyou:notempty}>
  322. <img src="__STATIC__/common/images/file.png" alt="" style="width: 16px;height: 16px;">下载附件</a>
  323. <input type="text" id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" value="{$vo.info|default=''}" style="display: none;">
  324. <button type="button" class="el-button el-button--primary is-plain el-button--small" id="upload_{$vo.fieldArr}_{$vo.name|default=''}" style="height: 40px;">上传文件</button>
  325. </div>
  326. </div>
  327. <script type="text/javascript">
  328. $(function(){
  329. layui.use('upload', function(){
  330. // 执行实例
  331. var upload = layui.upload;
  332. var uploadInst = upload.render({
  333. elem: "#upload_{$vo.fieldArr}_{$vo.name|default=''}",
  334. url: "{:url('user/Uploadify/DownloadUploadFileAjax')}",
  335. accept: 'file',
  336. exts: '{$vo.ext}',
  337. size: {$vo.filesize},
  338. done: function(res) {
  339. if (res.state == "SUCCESS") {
  340. layer.msg('上传成功!')
  341. $("#{$vo.fieldArr}_{$vo.name|default=''}").val(res.url);
  342. $("#download_file_{$vo.fieldArr}_{$vo.name|default=''}").css('display','');
  343. $("#download_file_{$vo.fieldArr}_{$vo.name|default=''}").attr('href',res.url);
  344. var arr = res.url.split("/");
  345. var download = arr[arr.length-1];
  346. $("#download_file_{$vo.fieldArr}_{$vo.name|default=''}").attr('download',download);
  347. $("#download_file_{$vo.fieldArr}_{$vo.name|default=''}").css('color','#000');
  348. $("#download_file_{$vo.fieldArr}_{$vo.name|default=''}").html('<img src="__STATIC__/common/images/file.png" alt="" style="width: 16px;height: 16px;">下载附件');
  349. } else {
  350. showErrorAlert(res.state);
  351. $("#download_file_{$vo.fieldArr}_{$vo.name|default=''}").css('display','');
  352. $("#download_file_{$vo.fieldArr}_{$vo.name|default=''}").css('color','red');
  353. $("#download_file_{$vo.fieldArr}_{$vo.name|default=''}").text(res.state);
  354. }
  355. }
  356. });
  357. });
  358. })
  359. </script>
  360. <!-- 单个文件 end -->
  361. {/case}
  362. {eyou:case value="datetime"}
  363. <!-- 日期和时间 start -->
  364. {eyou:static file="/public/plugins/laydate/laydate.js"/}
  365. <div class="item-from-row">
  366. <div class="from-row-l">
  367. {eyou:if condition="1 == $vo.is_required"}
  368. <span class="red">*</span>
  369. {eyou:else/}
  370. <span class="red"></span>
  371. {/eyou:if}
  372. {$vo.title}:
  373. </div>
  374. <div class="from-row-r">
  375. <input type="text" class="el-input__inner w310" id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" value="{$vo.dfvalue|default=''}" autocomplete="off">{$vo.dfvalue_unit|default=''}
  376. </div>
  377. </div>
  378. <script type="text/javascript">
  379. $(function () {
  380. $('#{$vo.fieldArr}_{$vo.name|default=''}').layDate();
  381. });
  382. </script>
  383. <!-- 日期和时间 end -->
  384. {/eyou:case}
  385. {/eyou:switch}
  386. {/eyou:volist}
  387. <script type="text/javascript">
  388. // 单图上传
  389. function uploadSinglePicFile(obj) {
  390. var file = $(obj)[0].files[0];
  391. if (!file) return false;
  392. var formData = new FormData();
  393. formData.append('_ajax', 1);
  394. formData.append('file', file);
  395. formData.append('compress', '1000-1000');
  396. layer_loading('正在处理');
  397. $.ajax({
  398. type: 'post',
  399. url : eyou_basefile + "?m=user&c=Uploadify&a=imageUp",
  400. data: formData,
  401. contentType: false,
  402. processData: false,
  403. dataType: 'json',
  404. success: function (res) {
  405. layer.closeAll();
  406. if (res.state == 'SUCCESS') {
  407. var id = $(obj).data('id');
  408. $("#singlePicHidden_" + id).val(res.url);
  409. $("#singlePicImgSrc_" + id).show().attr('src', res.url);
  410. $('#singlePicYline_'+id+', #singlePicXline_' + id).hide();
  411. } else {
  412. showErrorAlert(res.state);
  413. }
  414. },
  415. error: function(e) {
  416. layer.closeAll();
  417. showErrorAlert(e.responseText);
  418. }
  419. })
  420. }
  421. </script>