Nenhuma descrição
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

add.htm 72KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468
  1. {include file="public/layout" /}
  2. <link rel="stylesheet" type="text/css" href="__PUBLIC__/plugins/webuploader/webuploader.css">
  3. {eq name="$editor.editor_select" value="1"}
  4. {load href="__PUBLIC__/plugins/Ueditor/ueditor.config.js" /}
  5. {load href="__PUBLIC__/plugins/Ueditor/ueditor.all.min.js" /}
  6. {load href="__PUBLIC__/plugins/Ueditor/lang/zh-cn/zh-cn.js" /}
  7. {else/}
  8. {load href="__PUBLIC__/plugins/ckeditor/ckeditor.js" /}
  9. {/eq}
  10. <style type="text/css">
  11. /*服务器名称下拉*/
  12. .help-hot-list {
  13. padding: 10px 0;
  14. width: 164px;
  15. position: absolute;
  16. left: 16px;
  17. top: 40px;
  18. margin: 0;
  19. line-height: 32px;
  20. font-size: 14px;
  21. border-radius: 2px;
  22. box-shadow: 0 1px 5px rgba(0,0,0,.2);
  23. background-color: #fff;
  24. display: none;
  25. z-index: 999999;
  26. }
  27. .remote-hot-list{
  28. left: 86px;
  29. top: 26px;
  30. }
  31. .help-hot-list>a {
  32. display: block;
  33. color: #333;
  34. text-decoration: none;
  35. overflow: hidden;
  36. padding-right: 10px;
  37. }
  38. .help-hot-list>a:hover {
  39. background-color: #f3f3f3;
  40. }
  41. .help-hot-list>a>div {
  42. float: left;
  43. height: 32px;
  44. overflow: hidden;
  45. max-width:94%;
  46. }
  47. .help-hot-list>a>div.number {
  48. text-align: center;
  49. width: 22px;
  50. color: #ff8105
  51. }
  52. .help-hot-list>a>div.hottxt{
  53. width: 132px;
  54. overflow: hidden;
  55. text-overflow:ellipsis;
  56. white-space: nowrap;
  57. }
  58. .help-hot-list>a>div.number.c1 {
  59. color: #ff2c00
  60. }
  61. .help-hot-list>a>div.number.c2 {
  62. color: #ff5a00
  63. }
  64. .help-hot-list>a>div.number.c3 {
  65. color: #3cbe85
  66. }
  67. .template_div .ey_server_name{
  68. position: relative;
  69. }
  70. </style>
  71. <body class="bodysy-w">
  72. <div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
  73. <div id="append_parent"></div>
  74. <div id="ajaxwaitid"></div>
  75. <div id="geduan_div" class="h10"></div>
  76. <div id="page_div" class="page min-hg-c mb-20" style="min-width:auto;box-shadow:none;">
  77. <div class="fixed-bar">
  78. <div class="item-title">
  79. {include file="public/callback_page_1" /}<!-- 返回箭头 -->
  80. <a class="back_sz" href="javascript:void(0);" data-href="{:url('Download/help')}" onclick="openHelpframe(this, '设置与帮助', '500px', '100%', 'r');" title="设置与帮助"><i class="iconfont e-shezhi-tongyong"></i></a>
  81. <div class="subject">
  82. <h3>发布文档</h3>
  83. <h5></h5>
  84. </div>
  85. <ul class="tab-base nc-row">
  86. <li><a href="javascript:void(0);" data-index='1' class="tab current"><span>基础内容</span></a></li>
  87. <li><a href="javascript:void(0);" data-index='2' class="tab"><span>SEO优化</span></a></li>
  88. <li><a href="javascript:void(0);" data-index='3' class="tab"><span>更多设置</span></a></li>
  89. <!-- #weapp_demontrate_li# -->
  90. <!-- #weapp_li# -->
  91. </ul>
  92. </div>
  93. </div>
  94. <form class="form-horizontal" id="post_form" action="{:url('Download/add')}" method="post">
  95. <!-- 常规信息 -->
  96. <div class="ncap-form-default tab_div_1">
  97. <dl class="row">
  98. <dt class="tit">
  99. <label for="title"><em>*</em>文档标题</label>
  100. </dt>
  101. <dd class="opt">
  102. <input type="text" name="title" value="" id="title" class="input-txt" maxlength="200" {eq name="$channelRow.is_repeat_title" value="0"} oninput="check_title_repeat(this,0);" {/eq}>
  103. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  104. 副标题:<input type="text" name="subtitle" value="" id="subtitle" class="w200">
  105. <span class="err"></span>
  106. <p class="notic"></p>
  107. </dd>
  108. </dl>
  109. <dl class="row">
  110. <dt class="tit">
  111. <label for="title"><em>*</em>栏目分类</label>
  112. </dt>
  113. <dd class="opt">
  114. <select name="typeid" id="typeid">
  115. <option value="0">请选择栏目…</option>
  116. {$arctype_html}
  117. </select>
  118. <span class="err"></span>
  119. <p class="notic">谨慎切换,自定义字段的内容会随着栏目切换而清空,在保存之前不受影响!</p>
  120. </dd>
  121. </dl>
  122. {notempty name='$global.web_stypeid_open'}
  123. <dl class="row">
  124. <dt class="tit">
  125. <label for="stypeid">副栏目分类</label>
  126. </dt>
  127. <dd class="opt">
  128. <input type="hidden" name="stypeid" id="stypeid" value="" class="input-txt" onkeyup="this.value=this.value.replace(/[^\d\,]/g,'');" onpaste="this.value=this.value.replace(/[^\d\,]/g,'');">
  129. &nbsp;<a href="javascript:void(0);" data-channel="{$channeltype}" onclick="select_stypeid(this);" class="ncap-btn ncap-btn-green">选择副栏目</a>
  130. <span class="err"></span>
  131. <p class="notic">支持同频道模型的栏目</p>
  132. <div id="stypeid_txt" class="pt5"></div>
  133. </dd>
  134. </dl>
  135. {/notempty}
  136. <dl class="row">
  137. <dt class="tit">
  138. <label>文档属性</label>
  139. </dt>
  140. <dd class="opt">
  141. {volist name="archives_flags" id="vo"}
  142. <label><input type="checkbox" name="{$vo.flag_fieldname}" value="1">{$vo.flag_name}<!-- [{$vo.flag_attr}] --></label>&nbsp;
  143. {/volist}
  144. <span class="err"></span>
  145. <p class="notic">如需管理,请点击右上角设置与帮助按钮</p>
  146. </dd>
  147. </dl>
  148. <dl class="row none dl_jump">
  149. <dt class="tit">
  150. <label>跳转网址</label>
  151. </dt>
  152. <dd class="opt">
  153. <input type="text" value="" name="jumplinks" id="jumplinks" class="input-txt" placeholder="http://">
  154. <span class="err"></span>
  155. <p class="notic">请输入完整的URL网址(包含http或https),设置后访问该条信息将直接跳转到设置的网址</p>
  156. </dd>
  157. </dl>
  158. <dl class="row" style="z-index:2;">
  159. <dt class="tit">
  160. <label>文档标签</label>
  161. </dt>
  162. <dd class="opt">
  163. <input type="text" value="" name="tags" id="tags" class="input-txt" placeholder="多个标签之间以逗号隔开" autocomplete="off" oninput="get_common_tagindex_input(this);" onfocus="$('#often_tags').hide();" onkeyup="this.value=this.value.replace(/[\,]/g,',');" onpaste="this.value=this.value.replace(/[\,]/g,',')">&nbsp;
  164. <a href="javascript:void(0);" onclick="get_common_tagindex(this);">显示常用标签</a>&nbsp;<img id="tag_loading" src="__STATIC__/common/images/loading.gif" style="display: none;" />
  165. <div class="often_tags" id="often_tags" data-opt="add" style="display: none;"></div>
  166. <div class="often_tags" id="often_tags_input" style="display: none;"></div>
  167. <input type="hidden" id="tags_click_count">
  168. </dd>
  169. </dl>
  170. <dl class="row {empty name="$global.web_citysite_open"} none {/empty} ">
  171. <dt class="tit">
  172. <label for="title">所属区域</label>
  173. </dt>
  174. <dd class="opt">
  175. <select name="province_id" id="province_id" onchange="set_city_list(0);">
  176. <option value="0">全国</option>
  177. {volist name=':get_site_province_list()' id='vo'}
  178. <option value="{$vo.id}" {eq name="$Request.param.province_id" value="$vo.id" } selected="true" {/eq}>{$vo.name}</option>
  179. {/volist}
  180. </select>
  181. <select name="city_id" id="city_id" class="none ml5" onchange="set_area_list(0);">
  182. <option value="">--请选择--</option>
  183. </select>
  184. <select name="area_id" id="area_id" class="none ml5">
  185. <option value="">--请选择--</option>
  186. </select>
  187. <span class="err"></span>
  188. <p class="notic"></p>
  189. </dd>
  190. </dl>
  191. <dl class="row">
  192. <dt class="tit">
  193. <label>封面图片</label>
  194. </dt>
  195. <dd class="opt">
  196. <div class="input-file-show div_litpic_local">
  197. <span class="show">
  198. <a id="img_a" target="_blank" class="nyroModal" rel="gal" href="javascript:void(0);">
  199. <i id="img_i" class="fa fa-picture-o" onmouseover="" onmouseout="layer.close(layer_tips);"></i>
  200. </a>
  201. </span>
  202. <span class="type-file-box">
  203. <input type="text" id="litpic_local" name="litpic_local" value="" class="type-file-text" autocomplete="off">
  204. <input type="button" name="button" id="button1" value="选择上传..." class="type-file-button">
  205. <input class="type-file-file" onClick="GetUploadify(1,'','allimg','img_call_back')" size="30" hidefocus="true" nc_type="change_site_logo"
  206. title="点击前方预览图可查看大图,点击按钮选择文件并提交表单后上传生效">
  207. </span>
  208. </div>
  209. <input type="text" id="litpic_remote" name="litpic_remote" value="" placeholder="http://" class="input-txt" onKeyup="keyupRemote(this, 'litpic');" style="display: none;">
  210. &nbsp;
  211. <label><input type="checkbox" name="is_remote" id="is_remote" value="1" onClick="clickRemote(this, 'litpic');">远程图片</label>
  212. <span class="err"></span>
  213. <p class="notic">当没有手动上传图片时候,会自动提取正文的第一张图片作为缩略图</p>
  214. </dd>
  215. </dl>
  216. {if condition="!empty($channelRow.data.is_download_pay)"}
  217. <div class="{if condition='empty($channelRow.data.is_download_pay)'} none {/if}">
  218. <dl class="row">
  219. <dt class="tit">
  220. <label>付费限制</label>
  221. </dt>
  222. <dd class="opt">
  223. <label class="curpoin"><input type="radio" name="restric_type" value="0" checked="checked">免费</label>&nbsp;&nbsp;
  224. <label class="curpoin"><input type="radio" name="restric_type" value="1">付费</label>&nbsp;&nbsp;
  225. <label class="curpoin"><input type="radio" name="restric_type" value="2">指定会员</label>&nbsp;&nbsp;
  226. <label class="curpoin"><input type="radio" name="restric_type" value="3">会员付费</label>&nbsp;&nbsp;
  227. </dd>
  228. </dl>
  229. <dl class="row none" id="dl_arc_level_id">
  230. <dt class="tit">
  231. <label><em>*</em>会员等级</label>
  232. </dt>
  233. <dd class="opt">
  234. <select name="arc_level_id" id="arc_level_id">
  235. {volist name="users_level" id="vo"}
  236. <option value="{$vo.level_id}" level_value="{$vo.level_value}">{$vo.level_name}</option>
  237. {/volist}
  238. </select>
  239. <label id="no_vip_pay_label"><input type="checkbox" name="no_vip_pay" id="no_vip_pay" value="1" onClick="clickNoVipPay(this);">开启非会员付费</label>
  240. </dd>
  241. </dl>
  242. <dl class="row none" id="dl_users_price">
  243. <dt class="tit">
  244. <label for="users_price"><em>*</em>购买价格</label>
  245. </dt>
  246. <dd class="opt">
  247. <input type="text" name="users_price" id="users_price" class="input-txt" autocomplete="off" style="width: 100px !important;text-align: right;" onkeyup="this.value=this.value.replace(/[^\d\.]/g,'');" onpaste="this.value=this.value.replace(/[^\d\.]/g,'')">&nbsp;元
  248. <span class="err"></span>
  249. <p class="notic"></p>
  250. </dd>
  251. </dl>
  252. </div>
  253. {else /}
  254. <dl class="row">
  255. <dt class="tit">
  256. <label>下载限制</label>
  257. </dt>
  258. <dd class="opt">
  259. <select name="arc_level_id" id="arc_level_id">
  260. <option value="0">不限会员</option>
  261. {volist name="users_level" id="vo"}
  262. <option value="{$vo.level_id}">{$vo.level_name}</option>
  263. {/volist}
  264. </select>
  265. <p class="notic">如需使用付费下载功能,请到频道模型里下载模型内开启</p>
  266. </dd>
  267. </dl>
  268. {/if}
  269. <dl class="row" style="z-index: 2;">
  270. <dt class="tit">
  271. <label>上传文件</label>
  272. </dt>
  273. <dd class="opt">
  274. <div class="layui-upload">
  275. {if condition="$qiniu_open eq 1"}
  276. <button type="button" class="layui-btn layui-btn-normal" style="position: relative;z-index: 1;">
  277. 七牛云上传
  278. <input type="file" name="file" id="qiniuFile" multiple="multiple" onchange="qiniu_upload(this);" style="position: absolute;top: 0;right: 0;opacity: 0;width: 110px;height: 30px;"/>
  279. </button>
  280. {elseif condition="$oss_open eq 1"/}
  281. <button type="button" class="layui-btn layui-btn-normal" style="position: relative;z-index: 1;">
  282. oss上传
  283. <input type="file" name="file" id="ossFile" multiple="multiple" onchange="oss_upload(this);" style="position: absolute;top: 0;right: 0;opacity: 0;width: 110px;height: 30px;"/>
  284. </button>
  285. {elseif condition="$cos_open eq 1"/}
  286. <button type="button" class="layui-btn layui-btn-normal" style="position: relative;z-index: 1;">
  287. cos上传
  288. <input type="file" name="file" id="cosFile" multiple="multiple" onchange="cos_multiple_upload(this);" style="position: absolute;top: 0;right: 0;opacity: 0;width: 110px;height: 30px;"/>
  289. </button>
  290. {else /}
  291. <button type="button" class="layui-btn layui-btn-normal" id="buttonList">选择多文件</button>
  292. {/if}
  293. <label><input type="checkbox" value="1" onclick="ClickRemoteFile(this);">远程地址</label>
  294. <a href="javascript:void(0);" data-url="{:url('Download/template_set')}" onclick="TemplateSet(this);" style="display: inline-block;" id='TemplateSet' data-servername_use="{$servername_use}">[参数设置]</a>
  295. <div class="layui-upload-list none" id="layui-upload-list_downfile">
  296. <table class="layui-table">
  297. <thead>
  298. <tr>
  299. <th>文件名</th>
  300. <th class="th_server_name" {neq name="$servername_use" value="1"} style="display: none;" {/neq}>{$servername_info.field_title}</th>
  301. <th>大小</th>
  302. <th>状态</th>
  303. <th>操作</th>
  304. </tr>
  305. </thead>
  306. <tbody id="demoList"></tbody>
  307. </table>
  308. </div>
  309. <div style="display: none;" id='ClickRemoteFile'>
  310. <div id='Template'>
  311. <div class="template_div">
  312. 远程地址1:<input type="text" name="remote_file[]" value="" placeholder="http://" style="width: 50%;">
  313. {volist name="attr_field" id="vo"}
  314. <span class="ey_{$vo.field_name}" {neq name="$vo.field_use" value="1"} style="display: none;" {/neq}>
  315. <span class="title_{$vo.field_name}">{$vo.field_title}</span>:<input type="text" name="{$vo.field_name}[]" id="{$vo.field_name}_remote_1" style="width: 7%;" {if $vo.field_name=='server_name'} onclick="searchServername(this);" autocomplete="off" value="{$default_servername}" {/if}>
  316. {if $vo.field_name=='server_name'}
  317. <div class="help-hot-list remote-hot-list" style="display: none;" data-test_val="5434" id="search_keywords_list_{$vo.field_name}_remote_1">
  318. </div>
  319. {/if}
  320. </span>
  321. {/volist}
  322. </div>
  323. <div class="template_div">
  324. 远程地址2:<input type="text" name="remote_file[]" value="" placeholder="http://" style="width: 50%;">
  325. {volist name="attr_field" id="vo"}
  326. <span class="ey_{$vo.field_name}" {neq name="$vo.field_use" value="1"} style="display: none;" {/neq}>
  327. <span class="title_{$vo.field_name}">{$vo.field_title}</span>:<input type="text" name="{$vo.field_name}[]" id="{$vo.field_name}_remote_2" style="width: 7%;" {if $vo.field_name=='server_name'} onclick="searchServername(this);" autocomplete="off" value="{$default_servername}" {/if}>
  328. {if $vo.field_name=='server_name'}
  329. <div class="help-hot-list remote-hot-list" style="display: none;" id="search_keywords_list_{$vo.field_name}_remote_2">
  330. </div>
  331. {/if}
  332. </span>
  333. {/volist}
  334. </div>
  335. <div class="template_div">
  336. 远程地址3:<input type="text" name="remote_file[]" value="" placeholder="http://" style="width: 50%;">
  337. {volist name="attr_field" id="vo"}
  338. <span class="ey_{$vo.field_name}" {neq name="$vo.field_use" value="1"} style="display: none;" {/neq}>
  339. <span class="title_{$vo.field_name}">{$vo.field_title}</span>:<input type="text" name="{$vo.field_name}[]" id="{$vo.field_name}_remote_3" style="width: 7%;" {if $vo.field_name=='server_name'} onclick="searchServername(this);" autocomplete="off" value="{$default_servername}" {/if}>
  340. {if $vo.field_name=='server_name'}
  341. <div class="help-hot-list remote-hot-list" style="display: none;" id="search_keywords_list_{$vo.field_name}_remote_3">
  342. </div>
  343. {/if}
  344. </span>
  345. {/volist}
  346. </div>
  347. </div>
  348. <a onclick="GetTemplateAddr(2);" style="cursor: pointer;">
  349. 更多远程地址
  350. </a>
  351. </div>
  352. <button style="display:none;" type="button" class="layui-btn" id="buttonListAction">批量重传</button>
  353. </div>
  354. </dd>
  355. </dl>
  356. {include file="archives/get_field_addonextitem" /}
  357. </div>
  358. <!-- 常规信息 -->
  359. <!-- SEO参数 -->
  360. <div class="ncap-form-default tab_div_2" style="display:none;">
  361. <dl class="row">
  362. <dt class="tit">
  363. <label for="seo_title">SEO标题</label>
  364. </dt>
  365. <dd class="opt">
  366. <input type="text" value="" name="seo_title" id="seo_title" class="input-txt">
  367. <span class="err"></span>
  368. <p class="notic">一般不超过80个字符,为空时系统自动构成,可以到 <a href="{:url('Seo/index', array('inc_type'=>'seo'))}">SEO设置 - SEO基础</a> 中设置构成规则。</p>
  369. </dd>
  370. </dl>
  371. <dl class="row">
  372. <dt class="tit">
  373. <label>SEO关键词</label>
  374. </dt>
  375. <dd class="opt">
  376. <textarea rows="5" cols="60" id="seo_keywords" name="seo_keywords" style="height:20px;"></textarea>
  377. <span class="err"></span>
  378. <p class="notic">一般不超过100个字符,多个关键词请用英文逗号(,)隔开,建议3到5个关键词。</p>
  379. </dd>
  380. </dl>
  381. <dl class="row">
  382. <dt class="tit">
  383. <label>SEO描述</label>
  384. </dt>
  385. <dd class="opt">
  386. <textarea rows="5" cols="60" id="seo_description" name="seo_description" style="height:54px;" class="keywordsTextarea" onkeyup="monitorInputStr();" onkeypress="monitorInputStr();"></textarea>
  387. <span class="err"></span>
  388. <p class="notic">一般不超过100个字符,不填写时系统自动提取正文的前100个字符</p>
  389. <p class="notic2 none" id="beenWritten">你已输入<span id="beenWrittenStr">0</span>个字符</p>
  390. </dd>
  391. </dl>
  392. </div>
  393. <!-- SEO参数 -->
  394. <!-- 其他参数 -->
  395. <div class="ncap-form-default tab_div_3" style="display:none;">
  396. <dl class="row">
  397. <dt class="tit">
  398. <label for="author">作者</label>
  399. </dt>
  400. <dd class="opt">
  401. <input type="text" value="{$Think.session.admin_info.pen_name|default='小编'}" name="author" id="author" class="input-txt">
  402. <span class="err"></span>
  403. <p class="notic">设置作者默认名称(将同步至管理员笔名)</p>
  404. </dd>
  405. </dl>
  406. <dl class="row dl_origin">
  407. <dt class="tit">
  408. <label>来源</label>
  409. </dt>
  410. <dd class="opt origin-hot">
  411. <input type="text" value="{$system_originlist_0}" name="origin" id="origin" class="input-txt" onclick="searchOrigin(this);" autocomplete="off">
  412. <div class="origin-hot-list" style="display: none;" id="search_keywords_list_origin"></div>
  413. <textarea id="system_originlist_str" style="display: none;">{$system_originlist_str}</textarea>
  414. <span class="setting" onclick="set_originlist();">设置</span>
  415. <span class="err"></span>
  416. <p class="notic">为空时默认“网络”</p>
  417. </dd>
  418. </dl>
  419. <dl class="row">
  420. <dt class="tit">
  421. <label>点击数</label>
  422. </dt>
  423. <dd class="opt">
  424. <input type="text" value="{$rand_arcclick}" name="click" id="click" class="input-txt">
  425. <span class="err"></span>
  426. </dd>
  427. </dl>
  428. <dl class="row">
  429. <dt class="tit">
  430. <label>下载数</label>
  431. </dt>
  432. <dd class="opt">
  433. <input type="text" value="{$rand_arcdownload}" name="downcount" id="downcount" class="input-txt">
  434. <span class="err"></span>
  435. </dd>
  436. </dl>
  437. <dl class="row">
  438. <dt class="tit">
  439. <label>阅读权限</label>
  440. </dt>
  441. <dd class="opt">
  442. <select name="arcrank" id="arcrank" {if $admin_info.role_id>0&&$auth_role_info.check_oneself<1} disabled="disabled" {/if}>
  443. {volist name="arcrank_list" id="vo"}
  444. <option value="{$vo.rank}" {if $admin_info.role_id>0&&$auth_role_info.check_oneself<1&&$vo.rank==-1} selected="selected" {/if}>{$vo.name}</option>
  445. {/volist}
  446. </select>
  447. <span class="err"></span>
  448. </dd>
  449. </dl>
  450. <!-- #weapp_UsersGroup_content_users_id={$field.users_id}#--><!-- #weapp_UsersGroup_content# -->
  451. <dl class="row">
  452. <dt class="tit">
  453. <label for="add_time">发布时间</label>
  454. </dt>
  455. <dd class="opt">
  456. <input type="text" class="input-txt" id="add_time" name="add_time" value="{php}echo date('Y-m-d H:i:s'){/php}" autocomplete="off">
  457. <span class="add-on input-group-addon">
  458. <i class="glyphicon glyphicon-calendar fa fa-calendar"></i>
  459. </span>
  460. <span class="err"></span>
  461. </dd>
  462. </dl>
  463. <dl class="row">
  464. <dt class="tit">
  465. <label for="tempview">文档模板</label>
  466. </dt>
  467. <dd class="opt">
  468. <select name="tempview" id="tempview">
  469. {volist name='$templateList' id='vo'}
  470. <option value="{$vo}" {eq name='$vo' value='$tempview'}selected{/eq}>{$vo}</option>
  471. {/volist}
  472. </select>
  473. <input type="hidden" name="type_tempview" value="{$tempview}" />
  474. <span class="err"></span>
  475. </dd>
  476. </dl>
  477. <dl class="row {notin name='$seo_pseudo' value='2,3'}no-grey{/notin}">
  478. <dt class="tit">
  479. <label>自定义文件名</label>
  480. </dt>
  481. <dd class="opt">
  482. <input type="text" {notin name='$seo_pseudo' value='2,3'}readonly="readonly" title="动态模式下不支持自定义文档url"{/notin} value="" name="htmlfilename" id="htmlfilename" autocomplete="off" onkeyup="this.value=this.value.replace(/[^\u4E00-\u9FA5\w\-]/g,'-');" onpaste="this.value=this.value.replace(/[^\u4E00-\u9FA5\w\-]/g,'-');" class="input-txt {notin name='$seo_pseudo' value='2,3'}no-drop{/notin}">.html
  483. <span class="err"></span>
  484. <p class="notic">自定义文件名可由字母、数字、下划线(_)、连接符(-)等符号组成,除此之外其他字符将自动转为连接符(-)</p>
  485. </dd>
  486. </dl>
  487. </div>
  488. <!-- 其他参数 -->
  489. <!-- #weapp_demontrate_div# -->
  490. <!-- #weapp_div# -->
  491. <div class="ncap-form-default">
  492. <div class="bot2">
  493. <input type="hidden" name="gourl" value="{$gourl|default=''}">
  494. <input type="hidden" name="editor_addonFieldExt" id="editor_addonFieldExt" value="">
  495. <a href="JavaScript:void(0);" onclick="check_submit();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a>
  496. {include file="public/callback_page_2" /}<!-- 返回按钮 -->
  497. </div>
  498. </div>
  499. </form>
  500. </div>
  501. <script type="text/javascript" src="__PUBLIC__/plugins/webuploader/webuploader.min.js"></script>
  502. <script type="text/javascript">
  503. var uploader_swf = '__PUBLIC__/plugins/webuploader/Uploader.swf';
  504. var server_url = "{:url('Ueditor/DownloadUploadFile',array('savepath'=>'soft'))}";
  505. var admin_id = "{$Think.session.admin_id|default='1'}";
  506. </script>
  507. <script src="__SKIN__/js/getting-started.js"></script>
  508. <!-- 陈风任 -->
  509. <script type="text/javascript">
  510. function cos_multiple_upload() {
  511. $('#layui-upload-list_downfile').show();
  512. var cosFileObj = document.getElementById("cosFile").files;
  513. var servername_use = $('#TemplateSet').attr("data-servername_use");
  514. var formData = new FormData();
  515. formData.append('file_num', cosFileObj.length);
  516. for (var i = 0; i < cosFileObj.length; i++) {
  517. var file = cosFileObj[i];
  518. var fileName = file.name;
  519. var fileExt = fileName.substr(fileName.lastIndexOf('.')).toLowerCase();
  520. var ext = judgeExt(fileExt);
  521. if (ext > -1) {
  522. // 追加显示在页面上
  523. var timestamp = new Date().getTime() + '-' + Math.ceil(Math.random()*100);
  524. var append_html = '';
  525. append_html += '<tr>';
  526. append_html += '<td>'+ file.name +'</td>';
  527. if (1 == servername_use){
  528. append_html += '<td class="th_server_name">';
  529. } else {
  530. append_html += '<td class="th_server_name" style="display: none;">';
  531. }
  532. append_html += '<input type="text" name="fileupload[server_name][]" value="腾讯云服务器" id="severname_qiniuyun_'+i+'" onclick="searchServername(this);" autocomplete="off">';
  533. append_html += '<div class="help-hot-list" style="display: none;" id="search_keywords_list_severname_qiniuyun_'+i+'"></div>';
  534. append_html += '</td>';
  535. append_html += '<td>'+ (file.size/1014).toFixed(1) +' KB</td>';
  536. append_html += '<td id="upload-'+ timestamp +'">上传腾讯云…请稍等</td>';
  537. append_html += '<td><button class="layui-btn layui-btn-xs layui-btn-danger demo-delete" style="line-height:unset;height: unset;" onclick="DeleteFile(this);">移除</button>';
  538. append_html += '</td>';
  539. append_html += '</tr>';
  540. $("#demoList").append(append_html);
  541. // 表单提交数据
  542. formData.append('file_' + [i], cosFileObj[i]);
  543. formData.append('file_mime_' + [i], file.type);
  544. formData.append('file_name_' + [i], file.name);
  545. formData.append('file_size_' + [i], file.size);
  546. formData.append('file_ext_' + [i], fileExt);
  547. formData.append('file_tdid_' + [i], "#upload-" + timestamp);
  548. } else {
  549. showErrorMsg('不支持选中的文件格式,仅支持' + "{$basic.file_type}");
  550. }
  551. }
  552. // 上传提示
  553. layer.msg('上传腾讯云……&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font id="upgrade_backup_speed">0.01</font>%,请勿刷新', {icon: 1, time: 3600000, shade: [0.2]});
  554. layer.load(3, {shade: [0.1,'#fff']});
  555. // 执行上传
  556. $.ajax({
  557. type: 'post',
  558. url : '__ROOT_DIR__/index.php?m=plugins&c=Cos&a=cos_multiple_upload&_ajax=1',
  559. data: formData,
  560. contentType: false,
  561. processData: false,
  562. dataType: 'json',
  563. xhr: function () {
  564. myXhr = $.ajaxSettings.xhr();
  565. if (myXhr.upload) {
  566. myXhr.upload.addEventListener('progress', function(e) {
  567. var curr = e.loaded;
  568. var total = e.total;
  569. var process = parseInt(curr / total * 100);
  570. process = 100 == process ? 99 : process;
  571. $('#upgrade_backup_speed').html(process);
  572. });
  573. }
  574. return myXhr;
  575. },
  576. success: function(res) {
  577. layer.closeAll();
  578. try {
  579. if (1 == res.code) {
  580. var file_url = res.data.file_url;
  581. $.each(file_url, function(i, item) {
  582. var html = '';
  583. html += '<input type="hidden" name="fileupload[file_url][]" value="'+ file_url[i] +'">';
  584. html += '<input type="hidden" name="fileupload[file_mime][]" value="'+ res.data.file_mime[i] +'">';
  585. html += '<input type="hidden" name="fileupload[file_name][]" value="'+ res.data.file_name[i] +'">';
  586. html += '<input type="hidden" name="fileupload[file_size][]" value="'+ res.data.file_size[i] +'">';
  587. html += '<input type="hidden" name="fileupload[file_ext][]" value="'+ res.data.file_ext[i] +'">';
  588. $(res.data.file_tdid[i]).html('<span style="color: #5FB878;">上传成功</span>' + html);
  589. });
  590. } else {
  591. showErrorAlert('接口超时,部分上传腾讯云失败,请移除未上传成功的文件重新上传。');
  592. }
  593. } catch(e) {}
  594. },
  595. error: function(e){
  596. layer.closeAll();
  597. showErrorAlert(e.responseText);
  598. }
  599. });
  600. }
  601. </script>
  602. <!-- END -->
  603. <script type="text/javascript">
  604. function qiniu_upload() {
  605. $('#layui-upload-list_downfile').show();
  606. var arr = [];
  607. var servername_use = $('#TemplateSet').attr("data-servername_use");
  608. for(var i = 0 ;i<document.getElementById("qiniuFile").files.length;i++){
  609. //file对象为用户选择的某一个文件
  610. file=document.getElementById("qiniuFile").files[i];
  611. var fileName = file.name;
  612. var fileExt = fileName.substr(fileName.lastIndexOf('.')).toLowerCase();
  613. var ext = judgeExt(fileExt);
  614. if (ext>-1) {
  615. //此时取出这个文件进行处理,这里只是显示文件名
  616. var timestamp = new Date().getTime()+'-'+ Math.ceil(Math.random()*100);
  617. arr[i] = timestamp;
  618. var append_html = '';
  619. append_html += '<tr id="upload-'+ timestamp +'">';
  620. append_html += '<td>'+ file.name +'</td>';
  621. if (1 == servername_use){
  622. append_html += '<td class="th_server_name">';
  623. }else{
  624. append_html += '<td class="th_server_name" style="display: none;">';
  625. }
  626. append_html += '<input type="text" name="fileupload[server_name][]" value="七牛云服务器" id="severname_qiniuyun_'+i+'" onclick="searchServername(this);" autocomplete="off">';
  627. append_html += '<div class="help-hot-list" style="display: none;" id="search_keywords_list_severname_qiniuyun_'+i+'"></div>';
  628. append_html += '</td>';
  629. append_html += '<td>'+ (file.size/1014).toFixed(1) +' KB</td>';
  630. append_html += '<td>等待上传</td>';
  631. append_html += '<td><button class="layui-btn layui-btn-xs layui-btn-danger demo-delete" style="line-height:unset;height: unset;" onclick="DeleteFile(this);">移除</button>';
  632. append_html += '</td>';
  633. append_html += '</tr>';
  634. $("#demoList").append(append_html);
  635. }else{
  636. showErrorMsg('不支持选中的文件格式,仅支持'+"{$basic.file_type}");
  637. }
  638. }
  639. var date = new Date();
  640. var y = date.getFullYear();
  641. var m = date.getMonth() + 1;
  642. m = m < 10 ? '0' + m : m;
  643. var d = date.getDate();
  644. d = d < 10 ? ('0' + d) : d;
  645. //获取token
  646. $.ajax({
  647. type: 'POST',
  648. url: '__ROOT_DIR__/index.php?m=plugins&c=Qiniuyun&a=qiniu_upload',
  649. data: {_ajax:1,down:1},
  650. dataType: "JSON",
  651. success: function(res1){
  652. if (1 == res1.code){
  653. var token = res1.data.token;
  654. for(var i = 0 ;i<document.getElementById("qiniuFile").files.length;i++) {
  655. file = document.getElementById("qiniuFile").files[i];
  656. var fileName = file.name;
  657. var formData = new FormData();
  658. formData.append('token', token);
  659. //文件路径
  660. formData.append('file', file);
  661. //获取文件拓展名
  662. var fileExt = fileName.substr(fileName.lastIndexOf('.')).toLowerCase();
  663. //三位随机数
  664. var num = round_num();
  665. //七牛云存储文件名
  666. var name = admin_id+'-'+ new Date().getTime()+num+ fileExt;
  667. fileName = res1.data.filePath + y + m + d + "/"+ name;
  668. formData.append('key', fileName);
  669. var tr = $("#upload-" + arr[i]);
  670. new Promise(function() {
  671. var tr = $("#upload-" + arr[i]);
  672. var file_mime = file.type;
  673. var file_name = file.name;
  674. var file_size = file.size;
  675. var file_ext = fileExt;
  676. $.ajax({
  677. url: res1.data.uphost,
  678. type: 'POST',
  679. dataType: 'JSON',
  680. data: formData,
  681. timeout: 1200000,
  682. // async: false,
  683. cache: false, //默认是true,但是一般不做缓存
  684. processData: false, //用于对data参数进行序列化处理,这里必须false;如果是true,就会将FormData转换为String类型
  685. contentType: false, //一些文件上传http协议的关系,自行百度,如果上传的有文件,那么只能设置为false
  686. xhr: function () { //获取ajaxSettings中的xhr对象,为它的upload属性绑定progress事件的处理函数
  687. myXhr = $.ajaxSettings.xhr();
  688. if (myXhr.upload) { //检查upload属性是否存在
  689. //绑定progress事件的回调函数
  690. // myXhr.upload.addEventListener('progress', progressHandlingFunction, false);
  691. myXhr.upload.addEventListener('progress', function (e) {
  692. var curr = e.loaded;
  693. var total = e.total;
  694. process = parseInt(curr / total * 100);
  695. tr.children("td").eq(3).text('上传中...' + process + "%");
  696. });
  697. }
  698. return myXhr; //xhr对象返回给jQuery使用
  699. },
  700. success: function (res2) {
  701. var video_url = res1.data.domain + "/" + res2.key;
  702. var html = '';
  703. html += '<input type="hidden" name="fileupload[file_url][]" value="'+ video_url +'">';
  704. html += '<input type="hidden" name="fileupload[file_mime][]" value="'+ file_mime +'">';
  705. html += '<input type="hidden" name="fileupload[file_name][]" value="'+ file_name +'">';
  706. html += '<input type="hidden" name="fileupload[file_ext][]" value="'+ file_ext +'">';
  707. html += '<input type="hidden" name="fileupload[file_size][]" value="'+ file_size +'">';
  708. var tds = tr.children();
  709. tds.eq(3).html('<span style="color: #5FB878;">上传成功</span>');
  710. tds.eq(4).html('<span class="layui-btn layui-btn-xs layui-btn-danger" style="line-height:unset;height: unset;" onclick="DeleteFile(this);">移除</span>'+html);
  711. },
  712. error: function (e) {
  713. showErrorMsg(e.responseText);
  714. return false;
  715. }
  716. });
  717. })
  718. }
  719. }else{
  720. showErrorMsg(res1.msg);
  721. }
  722. },
  723. error: function(e){
  724. showErrorMsg(e.responseText);
  725. }
  726. });
  727. }
  728. function oss_upload() {
  729. $('#layui-upload-list_downfile').show();
  730. var arr = [];
  731. var servername_use = $('#TemplateSet').attr("data-servername_use");
  732. for(var i = 0 ;i<document.getElementById("ossFile").files.length;i++){
  733. //file对象为用户选择的某一个文件
  734. file=document.getElementById("ossFile").files[i];
  735. var fileName = file.name;
  736. var fileExt = fileName.substr(fileName.lastIndexOf('.')).toLowerCase();
  737. var ext = judgeExt(fileExt);
  738. if (ext>-1) {
  739. //此时取出这个文件进行处理,这里只是显示文件名
  740. var timestamp = new Date().getTime() + '-' + Math.ceil(Math.random()*100);
  741. arr[i] = timestamp;
  742. var append_html = '';
  743. append_html += '<tr id="upload-'+ timestamp +'">';
  744. append_html += '<td>'+ file.name +'</td>';
  745. if (1 == servername_use){
  746. append_html += '<td class="th_server_name">';
  747. }else{
  748. append_html += '<td class="th_server_name" style="display: none;">';
  749. }
  750. append_html += '<input type="text" name="fileupload[server_name][]" value="阿里云服务器" id="severname_qiniuyun_'+i+'" onclick="searchServername(this);" autocomplete="off">';
  751. append_html += '<div class="help-hot-list" style="display: none;" id="search_keywords_list_severname_qiniuyun_'+i+'"></div>';
  752. append_html += '</td>';
  753. append_html += '<td>'+ (file.size/1014).toFixed(1) +' KB</td>';
  754. append_html += '<td>等待上传</td>';
  755. append_html += '<td><button class="layui-btn layui-btn-xs layui-btn-danger demo-delete" style="line-height:unset;height: unset;" onclick="DeleteFile(this);">移除</button>';
  756. append_html += '</td>';
  757. append_html += '</tr>';
  758. $("#demoList").append(append_html);
  759. }else{
  760. showErrorMsg('不支持选中的文件格式,仅支持'+"{$basic.file_type}");
  761. }
  762. }
  763. var date = new Date();
  764. var y = date.getFullYear();
  765. var m = date.getMonth() + 1;
  766. m = m < 10 ? '0' + m : m;
  767. var d = date.getDate();
  768. d = d < 10 ? ('0' + d) : d;
  769. //获取token
  770. $.ajax({
  771. type: 'POST',
  772. url : '__ROOT_DIR__/index.php?m=plugins&c=AliyunOss&a=oss_upload',
  773. data: {_ajax:1,down:1},
  774. dataType: "JSON",
  775. success: function(res1){
  776. if (1 == res1.code){
  777. var accessid = res1.data.accessid;
  778. var policy = res1.data.policy;
  779. var signature = res1.data.signature;
  780. var filePath = res1.data.filePath;
  781. for(var i = 0 ;i<document.getElementById("ossFile").files.length;i++) {
  782. file = document.getElementById("ossFile").files[i];
  783. var fileName = file.name;
  784. var request = new FormData();
  785. request.append("OSSAccessKeyId",accessid);//Bucket 拥有者的Access Key Id。
  786. request.append("policy",policy);//policy规定了请求的表单域的合法性
  787. request.append("Signature",signature);//根据Access Key Secret和policy计算的签名信息,OSS验证该签名信息从而验证该Post请求的合法性
  788. request.append("success_action_status",201);// 让服务端返回200,不然,默认会返回204
  789. //获取文件拓展名
  790. var fileExt = fileName.substr(fileName.lastIndexOf('.')).toLowerCase();
  791. //三位随机数
  792. var num = round_num();
  793. //七牛云存储文件名
  794. var name = admin_id+'-'+ new Date().getTime()+num+ fileExt;
  795. fileName = filePath + y + m + d + "/"+ name;
  796. request.append("key", fileName);
  797. request.append('file', file);
  798. var tr = $("#upload-" + arr[i]);
  799. new Promise(function() {
  800. var tr = $("#upload-" + arr[i]);
  801. var file_mime = file.type;
  802. var file_name = file.name;
  803. var file_size = file.size;
  804. var file_ext = fileExt;
  805. $.ajax({
  806. url: res1.data.host,
  807. data: request,
  808. processData: false,
  809. cache: false,
  810. contentType: false,
  811. dataType: 'xml',
  812. type : 'post',
  813. xhr: function () { //获取ajaxSettings中的xhr对象,为它的upload属性绑定progress事件的处理函数
  814. myXhr = $.ajaxSettings.xhr();
  815. if (myXhr.upload) { //检查upload属性是否存在
  816. //绑定progress事件的回调函数
  817. // myXhr.upload.addEventListener('progress', progressHandlingFunction, false);
  818. myXhr.upload.addEventListener('progress', function (e) {
  819. var curr = e.loaded;
  820. var total = e.total;
  821. process = parseInt(curr / total * 100);
  822. tr.children("td").eq(3).text('上传中...' + process + "%");
  823. });
  824. }
  825. return myXhr; //xhr对象返回给jQuery使用
  826. },
  827. success: function (res2) {
  828. var res = $(res2).find('PostResponse');
  829. if (res) {
  830. var key = res.find('Key').text();
  831. var video_url = res1.data.domain + "/" + key;
  832. var html = '';
  833. html += '<input type="hidden" name="fileupload[file_url][]" value="' + video_url + '">';
  834. html += '<input type="hidden" name="fileupload[file_mime][]" value="' + file_mime + '">';
  835. html += '<input type="hidden" name="fileupload[file_name][]" value="' + file_name + '">';
  836. html += '<input type="hidden" name="fileupload[file_ext][]" value="' + file_ext + '">';
  837. html += '<input type="hidden" name="fileupload[file_size][]" value="' + file_size + '">';
  838. var tds = tr.children();
  839. tds.eq(3).html('<span style="color: #5FB878;">上传成功</span>');
  840. tds.eq(4).html('<span class="layui-btn layui-btn-xs layui-btn-danger" style="line-height:unset;height: unset;" onclick="DeleteFile(this);">移除</span>' + html);
  841. }
  842. },
  843. error: function (e) {
  844. showErrorMsg(e.responseText);
  845. return false;
  846. }
  847. });
  848. })
  849. }
  850. }else{
  851. showErrorMsg(res1.msg);
  852. }
  853. },
  854. error: function(e){
  855. showErrorMsg(e.responseText);
  856. }
  857. });
  858. }
  859. // 远程/本地上传文件切换
  860. function ClickRemoteFile(obj)
  861. {
  862. if ($(obj).is(':checked')) {
  863. $('#ClickRemoteFile').show();
  864. //$('#TemplateSet').show();
  865. } else {
  866. $('#ClickRemoteFile').hide();
  867. //$('#TemplateSet').hide();
  868. }
  869. }
  870. // 远程地址参数设置
  871. function TemplateSet(th){
  872. var url = $(th).attr('data-url');
  873. //iframe窗
  874. layer.open({
  875. type: 2,
  876. title: '参数设置',
  877. fixed: true, //不固定
  878. shadeClose: false,
  879. shade: layer_shade,
  880. maxmin: true, //开启最大化最小化按钮
  881. area: ['40%', '60%'],
  882. content: url
  883. });
  884. }
  885. // 获取模板属性数据
  886. function GetTemplateAddr(num){
  887. if (!num) {
  888. num = 1;
  889. }
  890. $.ajax({
  891. url: "{:url('Download/get_template', ['_ajax'=>1])}",
  892. data: {num:num},
  893. type:'post',
  894. dataType:'json',
  895. success: function(res){
  896. // 拼装模板属性并追加
  897. AddTemplateAddr(num,res.data);
  898. },
  899. });
  900. }
  901. // 删除对应的文件及文件信息
  902. function DeleteFile(obj){
  903. layer.confirm('确认要移除?', {
  904. shade: layer_shade,
  905. area: ['480px', '190px'],
  906. move: false,
  907. title: '提示',
  908. btnAlign:'r',
  909. closeBtn: 3,
  910. btn: ['确定', '取消'], //按钮
  911. success: function () {
  912. $(".layui-layer-content").css('text-align', 'left');
  913. }
  914. }, function (index) {
  915. layer.close(index);
  916. $(obj).parent().parent().remove();
  917. if ($('#demoList tr').length > 0) {
  918. $('#layui-upload-list_downfile').show();
  919. } else {
  920. $('#layui-upload-list_downfile').hide();
  921. }
  922. {if condition="$qiniu_open eq 1"}
  923. $('#qiniuFile').val('');
  924. {elseif condition="$oss_open eq 1"/}
  925. $('#ossFile').val('');
  926. {elseif condition="$cos_open eq 1"/}
  927. $('#cosFile').val('');
  928. {/if}
  929. }, function (index) {
  930. layer.close(index);
  931. });
  932. }
  933. // 拼装模板属性并追加
  934. function AddTemplateAddr(num,data){
  935. if (!num) {
  936. num = 1;
  937. }
  938. // 获取指定div数量
  939. var SerialNum = $('#Template div.template_div').length;
  940. var default_servername = "{$default_servername}";
  941. // 获取是否有
  942. // 初始化数组
  943. var html_div = [];
  944. // 拼装html
  945. if (num > 1) {
  946. for (var i = 0; i < num; i++) {
  947. SerialNum++;
  948. html_div +=
  949. [
  950. '<div class="template_div">'+
  951. '远程地址'+SerialNum+':<input type="text" name="remote_file[]" value="" placeholder="http://" style="width: 50%;"> '
  952. ];
  953. if (data) {
  954. for (var j = 0; j < data.length; j++) {
  955. if (data[j]['field_name'] == 'server_name') {
  956. if (data[j]['field_use'] == 1){
  957. html_div += ['<span class="ey_' + data[j]['field_name'] + '"> '];
  958. }else {
  959. html_div += ['<span style="display:none;" class="ey_' + data[j]['field_name'] + '"> '];
  960. }
  961. html_div +=
  962. [
  963. '<span class="title_'+data[j]['field_name']+'"> '+data[j]['field_title']+'</span>:<input type="text" name="'+data[j]['field_name']+'[]" id="'+data[j]['field_name']+'_remote_'+SerialNum+'" style="width: 7%;" onclick="searchServername(this);" autocomplete="off" value="'+default_servername+'">'+
  964. '<div class="help-hot-list" style="display: none;" id="search_keywords_list_'+data[j]['field_name']+'_remote_'+SerialNum+'"></div>'+
  965. '</span>'
  966. ];
  967. }else{
  968. if (data[j]['field_use'] == 1){
  969. html_div += ['<span class="ey_' + data[j]['field_name'] + '"> '];
  970. }else {
  971. html_div += ['<span style="display:none;" class="ey_' + data[j]['field_name'] + '"> '];
  972. }
  973. html_div +=
  974. [
  975. '<span class="title_'+data[j]['field_name']+'"> '+data[j]['field_title']+'</span>:<input type="text" name="'+data[j]['field_name']+'[]" id="'+data[j]['field_name']+'_'+SerialNum+'" style="width: 7%;">'+
  976. '</span>'
  977. ];
  978. }
  979. }
  980. }
  981. html_div +=
  982. [
  983. '</div>'
  984. ];
  985. }
  986. }else{
  987. SerialNum++;
  988. html_div +=
  989. [
  990. '<div class="template_div">'+
  991. '远程地址'+SerialNum+':<input type="text" name="remote_file[]" value="" placeholder="http://" style="width: 50%;">'
  992. ];
  993. if (data) {
  994. for (var j = 0; j < data.length; j++) {
  995. if (data[j]['field_name'] == 'server_name') {
  996. if (data[j]['field_use'] == 1){
  997. html_div += ['<span class="ey_' + data[j]['field_name'] + '"> '];
  998. }else {
  999. html_div += ['<span style="display:none;" class="ey_' + data[j]['field_name'] + '"> '];
  1000. }
  1001. html_div +=
  1002. [
  1003. '<span class="title_'+data[j]['field_name']+'"> '+data[j]['field_title']+'</span>:<input type="text" name="'+data[j]['field_name']+'[]" id="'+data[j]['field_name']+'_remote_'+SerialNum+'" style="width: 7%;" onclick="searchServername(this);" autocomplete="off" value="'+default_servername+'">'+
  1004. '<div class="help-hot-list" style="display: none;" id="search_keywords_list_'+data[j]['field_name']+'_remote_'+SerialNum+'"></div>'+
  1005. '</span>'
  1006. ];
  1007. }else{
  1008. if (data[j]['field_use'] == 1){
  1009. html_div += ['<span class="ey_' + data[j]['field_name'] + '"> '];
  1010. }else {
  1011. html_div += ['<span style="display:none;" class="ey_' + data[j]['field_name'] + '"> '];
  1012. }
  1013. html_div +=
  1014. [
  1015. '<span class="title_'+data[j]['field_name']+'"> '+data[j]['field_title']+'</span>:<input type="text" name="'+data[j]['field_name']+'[]" id="'+data[j]['field_name']+'_'+SerialNum+'" style="width: 7%;">'+
  1016. '</span>'
  1017. ];
  1018. }
  1019. }
  1020. }
  1021. html_div +=
  1022. [
  1023. '</div>'
  1024. ];
  1025. }
  1026. // 追加html
  1027. $('#Template').append(html_div);
  1028. }
  1029. // 文件上传JS
  1030. layui.use('upload', function(){
  1031. var type = "{$basic.file_type}";
  1032. var $ = layui.jquery,upload = layui.upload;
  1033. // 多文件列表示例
  1034. var demoListView = $('#demoList'),uploadListIns = upload.render({
  1035. elem: '#buttonList',
  1036. url: server_url,
  1037. accept: 'file',
  1038. exts: type,
  1039. multiple: true,
  1040. auto: true,
  1041. bindAction: '#buttonListAction',
  1042. choose: function(obj){
  1043. $('#layui-upload-list_downfile').show();
  1044. // 将每次选择的文件追加到文件队列
  1045. var files = this.files = obj.pushFile();
  1046. var servername_use = $('#TemplateSet').attr("data-servername_use");
  1047. // 读取本地文件
  1048. obj.preview(function(index, file, result){
  1049. if (1 == servername_use) {
  1050. var tr = $(
  1051. [
  1052. '<tr id="upload-' + index + '">',
  1053. '<td>' + file.name + '</td>',
  1054. '<td class="th_server_name"><input type="text" name="fileupload[server_name][]" value="{$default_servername}" id="severname_local_' + index + '" onclick="searchServername(this);" autocomplete="off">',
  1055. '<div class="help-hot-list" style="display: none;" id="search_keywords_list_severname_local_' + index + '"></div>',
  1056. '</td>',
  1057. '<td>' + (file.size / 1014).toFixed(1) + ' KB</td>',
  1058. '<td>等待上传</td>',
  1059. '<td>',
  1060. // '<button class="layui-btn layui-btn-xs demo-reload layui-hide">重传</button>',
  1061. '<button class="layui-btn layui-btn-xs layui-btn-danger demo-delete" style="line-height:unset;height: unset;">移除</button>',
  1062. '</td>',
  1063. '</tr>'
  1064. ].join(''));
  1065. }else{
  1066. var tr = $(
  1067. [
  1068. '<tr id="upload-' + index + '">',
  1069. '<td>' + file.name + '</td>',
  1070. '<td class="th_server_name" style="display: none;"><input type="text" name="fileupload[server_name][]" value="{$default_servername}" id="severname_local_' + index + '" onclick="searchServername(this);" autocomplete="off">',
  1071. '<div class="help-hot-list" style="display: none;" id="search_keywords_list_severname_local_' + index + '"></div>',
  1072. '</td>',
  1073. '<td>' + (file.size / 1014).toFixed(1) + ' KB</td>',
  1074. '<td>等待上传</td>',
  1075. '<td>',
  1076. // '<button class="layui-btn layui-btn-xs demo-reload layui-hide">重传</button>',
  1077. '<button class="layui-btn layui-btn-xs layui-btn-danger demo-delete" style="line-height:unset;height: unset;">移除</button>',
  1078. '</td>',
  1079. '</tr>'
  1080. ].join(''));
  1081. }
  1082. // 单个重传
  1083. tr.find('.demo-reload').on('click', function(){
  1084. obj.upload(index, file);
  1085. });
  1086. // 删除
  1087. tr.find('.demo-delete').on('click', function(){
  1088. // 删除对应的文件
  1089. delete files[index];
  1090. tr.remove();
  1091. // 清空 input file 值,以免删除后出现同名文件不可选
  1092. uploadListIns.config.elem.next()[0].value = '';
  1093. });
  1094. demoListView.append(tr);
  1095. });
  1096. },
  1097. done: function(res, index, upload){
  1098. if(res.code == 1){
  1099. // 上传成功
  1100. var html = '';
  1101. html += '<input type="hidden" name="fileupload[file_url][]" value="'+res.file_url+'">';
  1102. html += '<input type="hidden" name="fileupload[file_mime][]" value="'+res.file_mime+'">';
  1103. html += '<input type="hidden" name="fileupload[file_name][]" value="'+res.file_name+'">';
  1104. html += '<input type="hidden" name="fileupload[file_ext][]" value="'+res.file_ext+'">';
  1105. html += '<input type="hidden" name="fileupload[file_size][]" value="'+res.file_size+'">';
  1106. html += '<input type="hidden" name="fileupload[uhash][]" value="'+res.uhash+'">';
  1107. html += '<input type="hidden" name="fileupload[md5file][]" value="'+res.md5file+'">';
  1108. var tr = demoListView.find('tr#upload-'+ index),
  1109. tds = tr.children();
  1110. tds.eq(0).html(res.file_name);
  1111. tds.eq(3).html('<span style="color: #5FB878;">'+res.msg+'</span>');
  1112. tds.eq(4).html('<span class="layui-btn layui-btn-xs layui-btn-danger" style="line-height:unset;height: unset;" onclick="DeleteFile(this);">移除</span>'+html);
  1113. // 清空操作
  1114. return delete this.files[index];// 删除文件队列已经上传成功的文件
  1115. }
  1116. this.error(res, index, upload);
  1117. },
  1118. error: function(res, index, upload){
  1119. if (res.msg){
  1120. var tr = demoListView.find('tr#upload-'+ index),
  1121. tds = tr.children();
  1122. tds.eq(3).html('<span style="color: #FF5722;">'+res.msg+'</span>');
  1123. }else{
  1124. msg = "请求上传接口出现异常,请打开<a style='color:red;' target='_blank' href='https://www.eyoucms.com/plus/view.php?aid=28315&origin_eycms=1'>教程</a>查看是否存在配置错误";
  1125. showSuccessAlert(msg);
  1126. }
  1127. return false;
  1128. }
  1129. });
  1130. });
  1131. </script>
  1132. <script type="text/javascript">
  1133. layui.use('laydate', function() {
  1134. var laydate = layui.laydate;
  1135. laydate.render({
  1136. elem: '#add_time'
  1137. ,type: 'datetime'
  1138. });
  1139. })
  1140. $(function () {
  1141. try {
  1142. var web_citysite_open = {$global['web_citysite_open']|default=0};
  1143. var site_province_id = {$site_province_id|default=0};
  1144. var site_city_id = {$site_city_id|default=0};
  1145. var site_area_id = {$site_area_id|default=0};
  1146. if (web_citysite_open > 0 && site_province_id > 0) {
  1147. $('select[name=province_id]').val(site_province_id);
  1148. set_city_list(site_city_id);
  1149. set_area_list(site_area_id);
  1150. }
  1151. }catch(e){}
  1152. //选项卡切换列表
  1153. $('.tab-base').find('.tab').click(function(){
  1154. $('.tab-base').find('.tab').each(function(){
  1155. $(this).removeClass('current');
  1156. });
  1157. $(this).addClass('current');
  1158. var tab_index = $(this).data('index');
  1159. $(".tab_div_1, .tab_div_2, .tab_div_3, .tab_div_4").hide();
  1160. $(".tab_div_"+tab_index).show();
  1161. layer.closeAll();
  1162. });
  1163. $('input[name=is_jump]').click(function(){
  1164. if ($(this).is(':checked')) {
  1165. $('.dl_jump').show();
  1166. } else {
  1167. $('.dl_jump').hide();
  1168. }
  1169. });
  1170. var dftypeid = {$typeid|default='0'};
  1171. $('#typeid').change(function(){
  1172. var current_channel = $(this).find('option:selected').data('current_channel');
  1173. if (0 < $(this).val() && {$channeltype} != current_channel) {
  1174. showErrorMsg('请选择对应模型的栏目!');
  1175. $(this).val(dftypeid);
  1176. } else if ({$channeltype} == current_channel) {
  1177. layer.closeAll();
  1178. }
  1179. GetAddonextitem(1, $(this).val(), {$channeltype}, 0, true);
  1180. });
  1181. $(document).click(function(){
  1182. $('#often_tags').hide();
  1183. $('#often_tags_input').hide();
  1184. event.stopPropagation();
  1185. });
  1186. $('#often_tags').click(function(){
  1187. $('#often_tags').show();
  1188. event.stopPropagation();
  1189. });
  1190. $('input[name=tags]').keyup(function(){
  1191. var tags = $.trim($(this).val());
  1192. $('#seo_keywords').val(tags);
  1193. });
  1194. $('input[name=restric_type]').click(function(){
  1195. $('#dl_arc_level_id').hide();
  1196. $('#dl_users_price').hide();
  1197. $('#no_vip_pay_label').hide();
  1198. var restric_type = $(this).val();
  1199. $('#arc_level_id').find('option:eq(0)').attr('selected',true);
  1200. if (-1 < $.inArray(restric_type, ['1','3'])) {
  1201. $('#dl_users_price').show();
  1202. }
  1203. if (-1 < $.inArray(restric_type, ['2','3'])) {
  1204. $('#dl_arc_level_id').show();
  1205. if (2 == restric_type) {
  1206. $('#no_vip_pay_label').show();
  1207. if ($('#no_vip_pay').is(':checked')){
  1208. $('#dl_users_price').show();
  1209. }
  1210. }
  1211. }
  1212. });
  1213. });
  1214. // 判断输入框是否为空
  1215. function check_submit(){
  1216. if($.trim($('input[name=title]').val()) == ''){
  1217. $($('.tab-base').find('.tab')[0]).trigger('click');
  1218. showErrorMsg('标题不能为空!');
  1219. $('input[name=title]').focus();
  1220. return false;
  1221. }
  1222. if ($('#typeid').val() == 0) {
  1223. $($('.tab-base').find('.tab')[0]).trigger('click');
  1224. showErrorMsg('请选择栏目…!');
  1225. $('#typeid').focus();
  1226. return false;
  1227. }
  1228. var is_download_pay = {$channelRow.data.is_download_pay|default=0};
  1229. if (is_download_pay != 0) {
  1230. var restric_type = $('input[name=restric_type]:checked').val();
  1231. if ( restric_type == 1 || restric_type == 3 || (restric_type == 2 && $('#no_vip_pay').is(':checked'))){
  1232. var users_price = $('#users_price').val();
  1233. if (parseFloat(users_price).toString() == "NaN") {
  1234. users_price = 0;
  1235. }
  1236. if (0 == users_price || users_price == '') {
  1237. showErrorMsg('购买价格不能为空或0');
  1238. $('#users_price').focus();
  1239. return false;
  1240. } else {
  1241. var exp = /^(([1-9]\d*)|\d)(\.\d{1,2})?$/;
  1242. if (!exp.test(users_price)) {
  1243. showErrorMsg('购买价格格式不正确!');
  1244. $('#users_price').focus();
  1245. return false;
  1246. }
  1247. }
  1248. }
  1249. }
  1250. var htmlfilename = $.trim($('input[name=htmlfilename]').val());
  1251. if (htmlfilename != '') {
  1252. var exp = /^\d{1,}$/;
  1253. if (exp.test(htmlfilename)) {
  1254. showErrorAlert('自定义文件名不能纯数字,会与文档ID冲突!');
  1255. $('input[name=htmlfilename]').focus();
  1256. return false;
  1257. }
  1258. }
  1259. layer_loading('正在处理');
  1260. if(!ajax_check_htmlfilename())
  1261. {
  1262. layer.closeAll();
  1263. showErrorMsg('同栏目下,自定义文件名已存在!');
  1264. $('input[name=htmlfilename]').focus();
  1265. return false;
  1266. }
  1267. setTimeout(function (){
  1268. editor_auto_210607();
  1269. $('#post_form').submit();
  1270. }, 1);
  1271. }
  1272. function img_call_back(fileurl_tmp)
  1273. {
  1274. $("#litpic_local").val(fileurl_tmp);
  1275. $("#img_a").attr('href', fileurl_tmp);
  1276. $("#img_i").attr('onmouseover', "layer_tips=layer.tips('<img src="+fileurl_tmp+" class=\\'layer_tips_img\\'>',this,{tips: [1, '#fff']});");
  1277. $("input[name=is_litpic]").attr('checked', true); // 自动勾选属性[图片]
  1278. }
  1279. function round_num() {
  1280. var num = '';
  1281. for(var i=0;i<3;i++)
  1282. {
  1283. num+=Math.floor(Math.random()*10);
  1284. }
  1285. return num;
  1286. }
  1287. function judgeExt(ext) {
  1288. var type = "{$basic.file_type}";
  1289. var extArr = [];
  1290. extArr = type.split("|");
  1291. var ext = ext.replace(".","");
  1292. return extArr.indexOf(ext);
  1293. }
  1294. // 服务器名称选择
  1295. function ServernameSelect(th){
  1296. var url = $(th).attr('data-url');
  1297. var sn_name_sub = $(th).attr('data-sn_name_sub');
  1298. var sn_type = $(th).attr('data-sn_type');
  1299. if (sn_type==1){
  1300. var key = $(th).parent().parent().attr('id');
  1301. }else{
  1302. var key = $(th).attr('data-file_key');
  1303. }
  1304. url = url+'&file_key='+key+'&sn_type='+sn_type+'&sn_name_sub='+sn_name_sub;
  1305. //iframe窗
  1306. layer.open({
  1307. type: 2,
  1308. title: '服务器名称选择',
  1309. fixed: true, //不固定
  1310. shadeClose: false,
  1311. shade: layer_shade,
  1312. maxmin: true, //开启最大化最小化按钮
  1313. area: ['40%', '60%'],
  1314. content: url
  1315. });
  1316. }
  1317. </script>
  1318. <script type="text/javascript">
  1319. $(function(){
  1320. $("body").click(function(){
  1321. $('.help-hot-list').hide();
  1322. });
  1323. });
  1324. var t2_1598602098 = '';
  1325. function search_mouseover(th)
  1326. {
  1327. var sinput_id = $(th).attr('data-sinput_id');
  1328. $('#search_keywords_list_'+sinput_id).show();
  1329. try{
  1330. clearTimeout(t2_1598602098);
  1331. }catch(e){}
  1332. }
  1333. function search_mouseout(th)
  1334. {
  1335. var sinput_id = $(th).attr('data-sinput_id');
  1336. var setFunc = $("#search_keywords_list_"+sinput_id).hide();
  1337. t2_1598602098 = setTimeout('"'+setFunc+'"',1000);
  1338. }
  1339. function searchServername(th) {
  1340. var sinput_id = $(th).attr('id');
  1341. $.ajax({
  1342. type: "POST",
  1343. url: "{:url('Download/search_servername')}",
  1344. data: {keyword:'',_ajax:1},
  1345. dataType: 'json',
  1346. cache: false,
  1347. success: function (res) {
  1348. if(res.code == 1){
  1349. if (res.data.length > 0) {
  1350. var html='';
  1351. res.data.forEach(function(i,e) {
  1352. var e_num = e+1;
  1353. html += '<a href="javascript:void(0);" onclick="select_sname(this);" onmouseover="search_mouseover(this);" onmouseout="search_mouseout(this);" data-sname="'+i+'" data-sinput_id="'+sinput_id+'" style="cursor: pointer;">';
  1354. html += '<div class="number c'+e_num+'">'+e_num+'</div>';
  1355. html += '<div class="hottxt">'+i+'</div>';
  1356. html += '</a>';
  1357. });
  1358. // return false;
  1359. $('#search_keywords_list_'+sinput_id).html(html).show();
  1360. } else {
  1361. $('#search_keywords_list_'+sinput_id).hide();
  1362. }
  1363. } else {
  1364. $('#search_keywords_list_'+sinput_id).hide();
  1365. }
  1366. }
  1367. });
  1368. }
  1369. function select_sname(th) {
  1370. var sinput_id = $(th).attr('data-sinput_id');
  1371. var sname = $(th).attr('data-sname');
  1372. $("#"+sinput_id).val(sname);
  1373. }
  1374. function clickNoVipPay(obj) {
  1375. if ($(obj).is(':checked')) {
  1376. $('#dl_users_price').show();
  1377. } else {
  1378. $('#dl_users_price').hide();
  1379. }
  1380. }
  1381. </script>
  1382. <script>
  1383. try{
  1384. var mt20_1649209614 = sessionStorage.getItem("mt20_1649209614");
  1385. if (mt20_1649209614 == 1){
  1386. $("#geduan_div").removeClass("h10");
  1387. }else{
  1388. $("#geduan_div").addClass("h10");
  1389. }
  1390. }catch(e){}
  1391. </script>
  1392. {include file="public/footer" /}