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_reg_field.htm 26KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610
  1. {eyou:volist name="$users_para" id="vo"}
  2. {eyou:switch name="vo.dtype"}
  3. {eyou:case value="hidden"}
  4. <!-- 隐藏域 start -->
  5. <div class="form-group" style="display: none;">
  6. <div class="row">
  7. <div class="ey-form-file-title col-md-3"></div>
  8. <div class="col-md-9">
  9. <input type="hidden" class="input-txt" id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" value="{$vo.dfvalue|default=''}">
  10. </div>
  11. </div>
  12. </div>
  13. <!-- 隐藏域 start -->
  14. {/eyou:case}
  15. {eyou:case value="mobile"}
  16. <!-- 手机文本框 start -->
  17. <div class="wx-form-group">
  18. <input type="text" class="wx-form-control" required id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" maxlength="11" value="{$vo.dfvalue|default=''}" placeholder="{$vo.title}">
  19. </div>
  20. {eyou:if condition="isset($usersConfig['users_verification']) && 3 == $usersConfig['users_verification']"}
  21. <div class="wx-form-group">
  22. <div class="field">
  23. <input type="hidden" name="__mobile_1_token__" value="{$Request.token.__mobile_1_token__}" />
  24. <input type="text" class="wx-form-control" id="{$vo.fieldArr}_{$vo.name|default=''}_code" name="{$vo.fieldArr}[{$vo.name|default=''}_code]" placeholder="手机验证码" autocomplete="off">
  25. <input type="button" id="{$vo.fieldArr}_{$vo.name|default=''}_button" onclick="get_{$vo.fieldArr}{$vo.name|default=''}_code();" class="sento" value="获取验证码"/>
  26. </div>
  27. </div>
  28. <script type="text/javascript">
  29. function get_{$vo.fieldArr}{$vo.name|default=''}_code() {
  30. var mobile = $("#{$vo.fieldArr}_{$vo.name|default=''}").val();
  31. // 手机号是否为空
  32. if (!mobile) {
  33. $("#{$vo.fieldArr}_{$vo.name|default=''}").focus();
  34. layer.msg('请输入{$vo.title}!', {time: 1500});
  35. return false;
  36. }
  37. // 手机格式不正确
  38. var reg = /^1[0-9]{10}$/i;
  39. if (!reg.test(mobile)) {
  40. $("#{$vo.fieldArr}_{$vo.name|default=''}").focus();
  41. layer.msg('请输入正确的{$vo.title}!', {time: 1500});
  42. return false;
  43. }
  44. // 设置为不可点击
  45. $("#{$vo.fieldArr}_{$vo.name|default=''}_button").val('获取中…').attr('disabled', 'disabled');
  46. var __mobile_1_token__ = $('input[name=__mobile_1_token__]').val();
  47. $.ajax({
  48. url: "{eyou:url link='api/Ajax/SendMobileCode' /}",
  49. data: {type:'reg', mobile:mobile, is_mobile:true, title:'账号注册', source:0, __mobile_1_token__:__mobile_1_token__},
  50. type:'post',
  51. dataType:'json',
  52. success:function(res){
  53. if (res.code == 1) {
  54. {$vo.fieldArr}{$vo.name|default=''}_countdown();
  55. layer.msg(res.msg, {time: 1500});
  56. } else {
  57. $("#{$vo.fieldArr}_{$vo.name|default=''}_button").val('获取验证码').removeAttr("disabled");
  58. layer.alert(res.msg, {icon: 2, title: false, closeBtn: 0});
  59. }
  60. },
  61. error : function() {
  62. $("#{$vo.fieldArr}_{$vo.name|default=''}_button").val('获取验证码').removeAttr("disabled");
  63. layer.alert('发送失败,请尝试重新发送!', {icon: 5, title: false, closeBtn: 0});
  64. }
  65. });
  66. }
  67. function {$vo.fieldArr}{$vo.name|default=''}_countdown(){
  68. // 倒计时
  69. var setTime;
  70. var time = 120;
  71. setTime = setInterval(function() {
  72. if(0 >= time) {
  73. clearInterval(setTime);
  74. return false;
  75. }
  76. time--;
  77. $("#{$vo.fieldArr}_{$vo.name|default=''}_button").val(time + '秒').attr('disabled', 'disabled');
  78. if(time == 0) $("#{$vo.fieldArr}_{$vo.name|default=''}_button").val('获取验证码').removeAttr("disabled");
  79. }, 1000);
  80. }
  81. </script>
  82. {/eyou:if}
  83. <!-- 手机文本框 end -->
  84. {/eyou:case}
  85. {eyou:case value="email"}
  86. <!-- 邮箱文本框 start -->
  87. <div class="wx-form-group">
  88. <input type="text" class="wx-form-control" required id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" value="{$vo.dfvalue|default=''}" placeholder="{$vo.title}" >
  89. </div>
  90. {eyou:if condition="isset($usersConfig['users_verification']) && 2 == $usersConfig['users_verification']"}
  91. <div class="wx-form-group">
  92. <div class="field">
  93. <input type="text" class="wx-form-control" id="{$vo.fieldArr}_{$vo.name|default=''}_code" name="{$vo.fieldArr}[{$vo.name|default=''}_code]" value="" placeholder="邮箱验证码">
  94. <input type="button" id="{$vo.fieldArr}_{$vo.name|default=''}_button" onclick="get_{$vo.fieldArr}{$vo.name|default=''}_code();" class="sento" value="点击发送" />
  95. </div>
  96. </div>
  97. <script type="text/javascript">
  98. function get_{$vo.fieldArr}{$vo.name|default=''}_code(){
  99. var email = $("#{$vo.fieldArr}_{$vo.name|default=''}").val();
  100. var reg = /^[a-z0-9]([a-z0-9\\.]*[-_]{0,4}?[a-z0-9-_\\.]+)*@([a-z0-9]*[-_]?[a-z0-9]+)+([\.][\w_-]+){1,5}$/i;
  101. // 邮箱格式不正确
  102. if(!reg.test(email)){
  103. layer.msg('请正确输入邮箱地址!', {time: 1500});
  104. return false;
  105. }
  106. $("#{$vo.fieldArr}_{$vo.name|default=''}_button").val('发送中…');
  107. $("#{$vo.fieldArr}_{$vo.name|default=''}_button").attr('disabled', 'disabled');
  108. $.ajax({
  109. // async:false,
  110. url: "{eyou:url link='user/Smtpmail/send_email' /}",
  111. data: {type:'reg',email:email,title:'账号注册',scene:2},
  112. type:'post',
  113. dataType:'json',
  114. success:function(res){
  115. if(res.code == 1){
  116. {$vo.fieldArr}{$vo.name|default=''}_countdown();
  117. layer.msg(res.msg, {time: 1500});
  118. }else{
  119. $("#{$vo.fieldArr}_{$vo.name|default=''}_button").val('点击发送');
  120. $("#{$vo.fieldArr}_{$vo.name|default=''}_button").removeAttr("disabled");
  121. showErrorAlert(res.msg);
  122. }
  123. },
  124. error : function(e) {
  125. $("#{$vo.fieldArr}_{$vo.name|default=''}_button").val('点击发送');
  126. $("#{$vo.fieldArr}_{$vo.name|default=''}_button").removeAttr("disabled");
  127. showErrorAlert(e.responseText);
  128. }
  129. });
  130. }
  131. function {$vo.fieldArr}{$vo.name|default=''}_countdown(){
  132. // 倒计时
  133. var setTime;
  134. var time = {php}echo config('global.email_send_time');{/php};
  135. setTime = setInterval(function(){
  136. if(0 >= time){
  137. clearInterval(setTime);
  138. return;
  139. }
  140. time--;
  141. $("#{$vo.fieldArr}_{$vo.name|default=''}_button").val(time+'秒');
  142. $("#{$vo.fieldArr}_{$vo.name|default=''}_button").attr('disabled', 'disabled');
  143. if(time == 0){
  144. $("#{$vo.fieldArr}_{$vo.name|default=''}_button").val('点击发送');
  145. $("#{$vo.fieldArr}_{$vo.name|default=''}_button").removeAttr("disabled");
  146. }
  147. },1000);
  148. }
  149. </script>
  150. {/eyou:if}
  151. <!-- 邮箱文本框 end -->
  152. {/eyou:case}
  153. {eyou:case value="text"}
  154. <!-- 单行文本框 start -->
  155. {eyou:if condition='($vo.title == "地区")'}
  156. <!--引入城市-->
  157. <link rel="stylesheet" href="https://www.zc10000.com/template/pc/js/city/style.css" media="all">
  158. <script src="https://www.zc10000.com/template/pc/js/jquery-v3.1.1.min.js?t=544151"></script>
  159. <script type="text/javascript" src="https://www.zc10000.com/template/pc/js/city/cityTemplate.js?t=225513619665"></script>
  160. <script src="https://www.zc10000.com/template/pc/js/layer/3.1.1/layer.js"></script>
  161. <div class="form-group group_z" style="margin-top: 33px;">
  162. <div class="input-group" style="position:relative;width: 100%;">
  163. {eyou:eq name="$vo.is_required" value="1"}<!--<em class="tis">(必填)</em>-->{/eyou:eq}
  164. <input style=" color: rgb(51, 51, 51);font-size: 15px;padding:0; border: none;
  165. border-bottom: 1px solid #eee;"type="text" class="form-control" required id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" value="{$vo.dfvalue|default=''}" lay-verify="city" autocomplete="off"
  166. placeholder="请选择您的所在城市">
  167. <div id="in_city_bak"></div>
  168. <div id="in_city" style="display: none;"></div>
  169. </div>
  170. </div>
  171. <style>
  172. .city_a_le1:first-child{
  173. overflow-y: auto !important;
  174. }
  175. #in_city_bak{
  176. position: fixed;
  177. top:0;left: 0;z-index: 500;
  178. display: none;
  179. background: #000;
  180. opacity: 0.8;
  181. width: 100%;height: 100%;
  182. }
  183. #in_city{
  184. position:fixed !important;top:8% !important;left:5% !important;z-index: 1000;
  185. padding-top: 10px;
  186. width: 90%;height:80%;
  187. }
  188. #in_city h1{
  189. font-size: 20px !important;
  190. }
  191. .screen a {
  192. padding: 1px 5px;
  193. font-size: 12px;
  194. }
  195. .city_a_le1 a{
  196. font-size: 12px;
  197. }
  198. #quxiao{
  199. /* display: none !important;*/
  200. }
  201. .city_a_le1{
  202. height: 100%;
  203. }
  204. .screen a {
  205. padding: 10px 10px;
  206. font-size: 12px;
  207. width: 100%;
  208. margin: 0 auto;
  209. /* line-height: 15px;*/
  210. word-wrap: break-word;/*英文的时候需要加上这句,自动换行*/
  211. word-break:break-all;
  212. display: block;float: left;
  213. border-bottom:none !important;
  214. }
  215. .screen .shar {
  216. border: none !important;
  217. /* border-right: solid 1px #c92436;*/
  218. color: red;
  219. }
  220. .city_a_le1{
  221. padding: 10px 0px;
  222. }
  223. .screen{
  224. float: left;
  225. width: 20%;
  226. height: 100%;
  227. }
  228. .city_pos{
  229. float: left;
  230. width: 80%;
  231. height: 100%;
  232. }
  233. #quxiao{
  234. bottom: -40px !important;
  235. }
  236. </style>
  237. <script type="text/javascript">
  238. var cityA = $(".city_a_le1 a"); //城市
  239. var pla = $("#{$vo.fieldArr}_{$vo.name|default=''}"); //出发地
  240. var dest = $("#destination"); //目的地
  241. // 默认值
  242. inCity.width = "100%"; //城市选择框 宽
  243. inCity.height = ""; //城市选择框 高
  244. inCity.id = "#in_city"; //城市选择框 父级ID
  245. inCity.Children = '.city_a_le1'; //城市名box
  246. // 初始化 城市HTML模板
  247. $(inCity.id).prepend(inCity._template.join(''));
  248. inCity.Hot(cityA);
  249. //城市 导航
  250. var apay = $(".screen a");
  251. var placeThis; //当前选择标签
  252. apay.click(function (obj) { //城市导航
  253. inCity.payment($(this));
  254. $('#in_city_bak').show();
  255. })
  256. inCity.place(pla); //出发地
  257. inCity.destination(dest); //目的地
  258. inCity.cityClick(cityA); //显示赋值城市
  259. $(document).on('click','#quxiao',function(){
  260. $("#in_city").hide();
  261. $('#in_city_bak').hide();
  262. });
  263. $(document).on('click',function(e) {
  264. var $target = $(e.target);
  265. if (!$target.closest('#in_city').length && !$target.is('#in_city')) {
  266. /* alert('You clicked outside the div!');*/
  267. $("#in_city").hide();
  268. $('#in_city_bak').hide();
  269. }
  270. });
  271. /*
  272. $(document).on('click','.container',function(){
  273. $("#in_city").hide();
  274. });
  275. $(document).on('click','.screen a',function(){
  276. $("#in_city").show();
  277. });
  278. */
  279. //改为layer弹窗
  280. /* $(document).on('focus','#users__para_5',function(){
  281. console.log('dfdf');
  282. layer.open({
  283. title: '在线调试'
  284. ,content: $("#city_div").html()
  285. ,area: ['500px','300px']
  286. });
  287. });*/
  288. </script>
  289. {eyou:else /}
  290. <div class="form-group group_z">
  291. <div class="input-group" style="width:100%; ">
  292. {eyou:eq name="$vo.is_required" value="1"}<!--<em class="tis">(必填)</em>-->{/eyou:eq}
  293. <input style="font-size: 15px;padding:0;border: none;
  294. border-bottom: 1px solid #eee;" type="text" class="form-control" required id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" value="{$vo.dfvalue|default=''}" placeholder="{$vo.title}">
  295. </div>
  296. </div>
  297. {/eyou:if}
  298. <!-- 单行文本框 end -->
  299. {/eyou:case}
  300. {eyou:case value="multitext"}
  301. <!-- 多行文本框 start -->
  302. <div class="form-group group_z">
  303. <div class="input-group">
  304. <textarea rows="5" cols="60" class="form-control" id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" {eyou:eq name="$vo.is_required" value="1"} placeholder="{$vo.title}(必填)" {eyou:else/} placeholder="{$vo.title}" {/eyou:eq}>{$vo.dfvalue|default=''}</textarea>
  305. </div>
  306. </div>
  307. <!-- 多行文本框 end -->
  308. {/eyou:case}
  309. {eyou:case value="checkbox"}
  310. <!-- 复选框 start -->
  311. <div class="form-group group_z">
  312. <fieldset>
  313. <legend>{$vo.title}{eyou:if condition="1 == $vo.is_required"}(必填){/eyou:if}</legend>
  314. {eyou:volist name="$vo.dfvalue" id="v2"}
  315. <label class="checkbox-label">
  316. <span>{$v2}</span>
  317. <input type="checkbox" class="checkbox" name="{$vo.fieldArr}[{$vo.name|default=''}][]" value="{$v2}" {eyou:if condition="isset($vo['trueValue']) AND in_array($v2, $vo['trueValue'])"}checked="checked"{/eyou:if}>
  318. <span class="check-mark"></span>
  319. </label>
  320. {/eyou:volist}
  321. </fieldset>
  322. </div>
  323. <!-- 复选框 end -->
  324. {/eyou:case}
  325. {eyou:case value="radio"}
  326. <!-- 单选项 start -->
  327. <div class="form-group group_z" style="width:100%;">
  328. <fieldset style=" padding: 0; border:none;height: 36px;line-height: 36px; ">
  329. <!-- <legend>{$vo.title}{eyou:if condition="1 == $vo.is_required"}(必填){/eyou:if}</legend>-->
  330. {eyou:volist name="$vo.dfvalue" id="v2"}
  331. <label class="radio-label" style="margin-right: 5%;margin-bottom:0px;">
  332. <span style="font-size: 15px;color: #999;">{$v2}</span>
  333. <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}>
  334. <span class="check-mark"></span>
  335. </label>
  336. {/eyou:volist}
  337. </fieldset>
  338. </div>
  339. <!-- 单选项 end -->
  340. {/eyou:case}
  341. {eyou:case value="select"}
  342. <!-- 下拉框 start -->
  343. <div class="form-group group_z">
  344. <fieldset>
  345. <legend>{$vo.title}{eyou:if condition="1 == $vo.is_required"}(必填){/eyou:if}</legend>
  346. <div class="select">
  347. <div class="dd">
  348. <select name="{$vo.fieldArr}[{$vo.name|default=''}]" id="{$vo.fieldArr}_{$vo.name|default=''}" class="form-control">
  349. <option value="">请选择</option>
  350. {eyou:volist name="$vo.dfvalue" id="v2"}
  351. <option value="{$v2}" {eyou:if condition="isset($vo['trueValue']) AND in_array($v2, $vo['trueValue'])"}selected{/eyou:if}>{$v2}</option>
  352. {/eyou:volist}
  353. </select>
  354. </div>
  355. </div>
  356. </fieldset>
  357. </div>
  358. <!-- 下拉框 end -->
  359. {/eyou:case}
  360. <!-- 扩展 start -->
  361. <!-- 扩展 -->
  362. {eyou:case value="img"}
  363. <!-- 单张图 start -->
  364. <div class="form-group group_z">
  365. <div class="input-group input-group-icon">
  366. <input type="text" class=" form-control" id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" value="" style="display: none;"><!--{$vo.info|default=''}-->
  367. <input class=" form-control {$vo.fieldArr}_{$vo.name|default=''}_input" placeholder="{$vo.title}" onClick="GetUploadify(1,'','allimg','{$vo.fieldArr}_{$vo.name|default=''}_call_back','{:url('user/Uploadify/upload',['resource'=>'reg'])}')">
  368. </div>
  369. </div>
  370. <script type="text/javascript">
  371. function {$vo.fieldArr}_{$vo.name|default=''}_call_back(fileurl_tmp)
  372. {
  373. $("#{$vo.fieldArr}_{$vo.name|default=''}").val(fileurl_tmp);
  374. $(".{$vo.fieldArr}_{$vo.name|default=''}_input").val(fileurl_tmp);
  375. }
  376. </script>
  377. <!-- 单张图 end -->
  378. {/eyou:case}
  379. {eyou:case value="imgs"}
  380. <!-- 多张图 start -->
  381. <div class="form-group group_z images_upload_main">
  382. <div class="input-group">
  383. <button type="button" style="text-align: left;" class="form-control" onClick="GetUploadify(100,'','allimg','{$vo.fieldArr}_{$vo.name|default=''}_call_back', '', '{$vo.title}');">
  384. {$vo.title}<span style="float: right;font-size: 16px;">点击上传</span>
  385. </button>
  386. </div>
  387. <div style="margin: 5px 0;padding: 3px;border: 1px dashed #ebeced;display: none;" id="upload_imgs_{$vo.fieldArr}_{$vo.name|default=''}">
  388. <!--上传填充-->
  389. </div>
  390. <!-- 上传图片显示的样板 start -->
  391. <div class="{$vo.fieldArr}_{$vo.name|default=''}_upload_tpl" style="display: none;">
  392. <div class="fieldext_upload fieldext_upload_html">
  393. <div class="images_upload_item">
  394. <input type="hidden" name="{$vo.fieldArr}[{$vo.name|default=''}][]" value="">
  395. <a href="" >
  396. <img src="__STATIC__/admin/images/add-button.jpg" width="42" height="42">
  397. </a>
  398. <a class="delete" href="javascript:void(0)" title="删除"></a>
  399. </div>
  400. </div>
  401. </div>
  402. <!-- 上传图片显示的样板 end -->
  403. </div>
  404. <script type="text/javascript">
  405. var GetUploadify_url = "{:url('user/Uploadify/upload',['resource'=>'reg'])}";
  406. // 上传多图回调函数
  407. function {$vo.fieldArr}_{$vo.name|default=''}_call_back(paths){
  408. var last_div = $(".{$vo.fieldArr}_{$vo.name|default=''}_upload_tpl").html();
  409. for (var i=0;i<paths.length ;i++ )
  410. {
  411. if ($("#upload_imgs_{$vo.fieldArr}_{$vo.name|default=''} .fieldext_upload_html").length == 0) {
  412. $("#upload_imgs_{$vo.fieldArr}_{$vo.name|default=''}").css('display','');
  413. }
  414. $("#upload_imgs_{$vo.fieldArr}_{$vo.name|default=''}").append(last_div); // 插入一个 新图片
  415. $("#upload_imgs_{$vo.fieldArr}_{$vo.name|default=''} .fieldext_upload_html:last").find('a:eq(0)').attr('href',paths[i]).attr('onclick','').attr('target', "_blank");// 修改他的链接地址
  416. $("#upload_imgs_{$vo.fieldArr}_{$vo.name|default=''} .fieldext_upload_html:last").find('img').attr('src',paths[i]);// 修改他的图片路径
  417. $("#upload_imgs_{$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('');
  418. $("#upload_imgs_{$vo.fieldArr}_{$vo.name|default=''} .fieldext_upload_html:last").find('input').val(paths[i]); // 设置隐藏域 要提交的值
  419. }
  420. }
  421. /*
  422. * 上传之后删除组图input
  423. * @access public
  424. * @val string 删除的图片input
  425. */
  426. function {$vo.fieldArr}_{$vo.name|default=''}_ClearPicArr2(obj,path)
  427. {
  428. $(obj).parent().parent().remove();
  429. if ($("#upload_imgs_{$vo.fieldArr}_{$vo.name|default=''} .fieldext_upload_html").length == 0) {
  430. $("#upload_imgs_{$vo.fieldArr}_{$vo.name|default=''}").css('display','none');
  431. }
  432. }
  433. </script>
  434. <!-- 多张图 end -->
  435. {/eyou:case}
  436. {case value="file"}
  437. {eyou:static file="/public/plugins/layui/css/layui.css" /}
  438. {eyou:static file="/public/plugins/layui/layui.js" /}
  439. <!-- 单个文件 start -->
  440. <div class="form-group group_z">
  441. <div class="input-group">
  442. <input type="text" id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" value="{$vo.dfvalue|default=''}" style="display: none;">
  443. <button type="button" style="text-align: left;" class="form-control" id="upload_{$vo.fieldArr}_{$vo.name|default=''}" >{$vo.title}<span style="float: right;font-size: 16px;" id="btntxt_file_{$vo.fieldArr}_{$vo.name|default=''}">点击上传</span></button>
  444. <!-- <a id="download_file_{$vo.fieldArr}_{$vo.name|default=''}" style="margin-left: 10px;text-decoration: underline;{eyou:notempty name='$vo.dfvalue' /}display: 'block';{eyou:else /}display: none;{/eyou:notempty}" {eyou:notempty name='$vo.dfvalue' /} href="{$vo.dfvalue|default=''}" download="{$vo.dfvalue|get_filename=###}" {/eyou:notempty}>
  445. <img src="__STATIC__/common/images/file.png" alt="" style="width: 16px;height: 16px;">下载附件
  446. </a> -->
  447. </div>
  448. </div>
  449. <script>
  450. $(function(){
  451. layui.use('upload', function(){
  452. var upload = layui.upload;
  453. //执行实例
  454. upload.render({
  455. elem: "#upload_{$vo.fieldArr}_{$vo.name|default=''}" //绑定元素
  456. ,url: "{:url('user/Uploadify/DownloadUploadFileAjax')}"
  457. ,exts: '{$vo.ext}'
  458. ,size: {$vo.filesize} //限制文件大小,单位 KB
  459. ,accept: 'file' //普通文件
  460. ,done: function(res){
  461. //上传完毕回调
  462. if (res.state=="SUCCESS"){
  463. layer.msg('上传成功!')
  464. $("#btntxt_file_{$vo.fieldArr}_{$vo.name|default=''}").text('已上传');
  465. // $("#{$vo.fieldArr}_{$vo.name|default=''}").val(res.url);
  466. // $("#download_file_{$vo.fieldArr}_{$vo.name|default=''}").css('display','');
  467. // $("#download_file_{$vo.fieldArr}_{$vo.name|default=''}").attr('href',res.url);
  468. // var arr = res.url.split("/");
  469. // var download = arr[arr.length-1];
  470. // $("#download_file_{$vo.fieldArr}_{$vo.name|default=''}").attr('download',download);
  471. // $("#download_file_{$vo.fieldArr}_{$vo.name|default=''}").css('color','#000');
  472. // $("#download_file_{$vo.fieldArr}_{$vo.name|default=''}").html('<img src="__STATIC__/common/images/file.png" alt="" style="width: 16px;height: 16px;">下载附件');
  473. }else {
  474. $("#btntxt_file_{$vo.fieldArr}_{$vo.name|default=''}").text('点击上传');
  475. // $("#download_file_{$vo.fieldArr}_{$vo.name|default=''}").css('display','');
  476. // $("#download_file_{$vo.fieldArr}_{$vo.name|default=''}").css('color','red');
  477. // $("#download_file_{$vo.fieldArr}_{$vo.name|default=''}").text(res.state);
  478. }
  479. }
  480. ,error: function(){
  481. //请求异常回调
  482. }
  483. });
  484. });
  485. })
  486. </script>
  487. <!-- 单个文件 end -->
  488. {/case}
  489. <!-- 扩展 end -->
  490. {/eyou:switch}
  491. {/eyou:volist}
  492. <style>
  493. /* 整个滚动条 */
  494. ::-webkit-scrollbar {
  495. width: 12px; /* 滚动条的宽度 */
  496. height: 12px; /* 滚动条的高度,对水平滚动条有效 */
  497. background-color: #f9f9fd; /* 滚动条的背景颜色 */
  498. }
  499. /* 滚动条轨道 */
  500. ::-webkit-scrollbar-track {
  501. border-radius: 10px;
  502. background: #e1e1e1; /* 轨道的背景颜色 */
  503. }
  504. /* 滚动条滑块 */
  505. ::-webkit-scrollbar-thumb {
  506. border-radius: 10px;
  507. background-color: #c1c1c1; /* 滑块的背景颜色 */
  508. border: 3px solid #e1e1e1; /* 滑块的边框和轨道相同的颜色,可以制造“边距”的效果 */
  509. }
  510. /* 滚动条滑块:悬停效果 */
  511. ::-webkit-scrollbar-thumb:hover {
  512. background-color: #a8a8a8; /* 滑块的悬停颜色 */
  513. }
  514. /* 滚动条滑块:激活时的效果 */
  515. ::-webkit-scrollbar-thumb:active {
  516. background-color: #888888; /* 滑块的激活颜色 */
  517. }
  518. /* 滚动条按钮(上下箭头) */
  519. ::-webkit-scrollbar-button {
  520. display: none; /* 通常情况下不显示滚动条按钮 */
  521. }
  522. /* Firefox */
  523. html {
  524. scrollbar-width: thin; /* "auto" | "thin" | "none" */
  525. scrollbar-color: #c1c1c1 #e1e1e1; /* 滑块颜色 轨道颜色 */
  526. }
  527. </style>