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.

add.htm 76KB

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