project.lbi 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737
  1. {include file="{$_lang.moban}/library/member_paths.lbi"}
  2. <div class="container" style="margin-bottom: 20px;">
  3. {if $act eq 'list'}
  4. <style>
  5. .table td{
  6. line-height: 40px;
  7. }
  8. </style>
  9. <div class="main_wrap" id="pic_wrap">
  10. <div class="row">
  11. <div class="col-md-3">
  12. 共 <strong style="font-size:18px;">{$total}</strong> 个作品
  13. </div>
  14. <div class="col-md-3">
  15. <div class="input-group date form-date" data-date="" data-date-format="dd MM yyyy" data-link-format="yyyy-mm-dd">
  16. <input class="form-control" size="16" id="time_s" type="text" value="" readonly="" placeholder="开始时间" >
  17. <span class="input-group-addon"><span class="icon-remove"></span></span>
  18. <span class="input-group-addon"><span class="icon-calendar"></span></span>
  19. </div>
  20. </div>
  21. <div class="col-md-3">
  22. <div class="input-group date form-date" data-date="" data-date-format="dd MM yyyy" data-link-format="yyyy-mm-dd">
  23. <input class="form-control" size="16" id="time_e" type="text" value="" readonly="" placeholder="结束时间" >
  24. <span class="input-group-addon"><span class="icon-remove"></span></span>
  25. <span class="input-group-addon"><span class="icon-calendar"></span></span>
  26. </div>
  27. </div>
  28. <div class="col-md-2">
  29. <input type="text" id="name" class="form-control" placeholder="作品名">
  30. </div>
  31. <div class="col-md-1">
  32. <button class="btn btn-info" onclick="list(1)">搜索</button>
  33. </div>
  34. </div>
  35. <div class="row">
  36. <div class="col-md-3">
  37. <nav class="menu" data-toggle="menu" style="width: 200px">
  38. <button class="btn btn-primary" data-toggle="modal" data-target="#atlas_modal"><i class="icon-plus-sign"></i> 新建图册 </button>
  39. <ul class="nav nav-primary" id="atlas_nav">
  40. {foreach $atlas as $v}
  41. {if $v.atlas_type eq 0}
  42. <li class="atlas_active" data-atlasid="{$v.pk_atlas_main}"><a href="javascript:;">
  43. <span class="altlas_name">{$v.name} ({$v.num})</span></a></li>
  44. {else}
  45. <li data-atlasid="{$v.pk_atlas_main}">
  46. <a href="javascript:;" style="padding-right:2px" >
  47. <span class="altlas_name" {if mb_strlen($v.name) gt 10}title="{$v.name} ({$v.num})"{/if}>{$v.name} ({$v.num})</span>
  48. <span class="pull-right">
  49. <i class="icon-edit" onclick="atlas_edit('{$v.pk_atlas_main}','{$v.name}')"></i>&nbsp; <i class="icon-trash" onclick="atlas_del('{$v.pk_atlas_main}')"></i>
  50. </span>
  51. </a>
  52. </li>
  53. {/if}
  54. {/foreach}
  55. </ul>
  56. </nav>
  57. </div>
  58. <div class="col-md-9">
  59. <div class="row" style="margin-top:20px;">
  60. <div class="col-md-2">
  61. <div class="checkbox">
  62. <label>
  63. <input type="checkbox" onclick="setCheck(this,'project_checkbox')">全选
  64. </label>
  65. </div>
  66. </div>
  67. <div class="col-md-3" style="margin-left: -75px;">
  68. <select class="form-control" id="atlas_select">
  69. <option value="0">移动到其他图册</option>
  70. {foreach $atlas as $v}
  71. <option value="{$v.pk_atlas_main}">{$v.name}</option>
  72. {/foreach}
  73. </select>
  74. </div>
  75. </div>
  76. <div class="list_wrap">
  77. <div id="list_wrap_content"></div>
  78. <div id="pager_wrap"></div>
  79. </div>
  80. </div>
  81. </div>
  82. </div>
  83. <!--评论框-->
  84. <div class="main_wrap" id="comment_wrap" style="display:none">
  85. <div class="row">
  86. <div class="col-md-1">
  87. <strong style="font-size:18px;cursor:pointer;" class="text-primary" onclick="hidecomment()"><i class="icon-reply"></i>&nbsp;返回</strong>
  88. </div>
  89. <div class="col-md-3">
  90. 共 <strong style="font-size:18px;" id="comment_count"></strong> 条评论
  91. </div>
  92. <div class="col-md-2 col-md-offset-5">
  93. <input type="text" id="content" class="form-control" placeholder="内容">
  94. </div>
  95. <div class="col-md-1 ">
  96. <button class="btn btn-info" onclick="list_comments(1,false)">搜索</button>
  97. </div>
  98. </div>
  99. <div class="row" style="margin-top:30px;">
  100. <div class="col-md-12">
  101. <table class="table table-hover">
  102. <thead>
  103. <tr>
  104. <th>#</th>
  105. <th >头像</th>
  106. <th>昵称</th>
  107. <th>内容</th>
  108. <th>评论时间</th>
  109. <th>性别</th>
  110. <th>省份</th>
  111. <th>城市</th>
  112. <th>操作</th>
  113. </tr>
  114. </thead>
  115. <tbody>
  116. </tbody>
  117. </table>
  118. </div>
  119. </div>
  120. <div id="comment_pager_wrap" style="text-align:center"></div>
  121. </div>
  122. <!--评论框end-->
  123. <!--新建图册弹框-->
  124. <div class="modal fade" id="atlas_modal">
  125. <div class="modal-dialog">
  126. <div class="modal-content">
  127. <div class="modal-header">
  128. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span></button>
  129. <h4 class="modal-title">新增图册</h4>
  130. </div>
  131. <div class="modal-body">
  132. <input type="hidden" id="atlas_id" value="0">
  133. <input class="form-control form-focus" autofocus type="text" placeholder="请输入名称" id="atlas_name">
  134. </div>
  135. <div class="modal-footer">
  136. <button type="button" class="btn btn-primary" id="atlas_save">保存</button>
  137. </div>
  138. </div>
  139. </div>
  140. </div>
  141. <script>
  142. {literal}
  143. $(function(){
  144. list(1,true);
  145. })
  146. {/literal}
  147. </script>
  148. {elseif $act eq 'videos'}
  149. <div class="main_wrap">
  150. <div class="row">
  151. <div class="col-md-3">
  152. 共 <strong style="font-size:18px;">{$total}</strong> 个作品
  153. </div>
  154. <div class="col-md-3">
  155. <div class="input-group date form-date" data-date="" data-date-format="dd MM yyyy" data-link-format="yyyy-mm-dd">
  156. <input class="form-control" size="16" id="time_s" type="text" value="" readonly="" placeholder="开始时间" >
  157. <span class="input-group-addon"><span class="icon-remove"></span></span>
  158. <span class="input-group-addon"><span class="icon-calendar"></span></span>
  159. </div>
  160. </div>
  161. <div class="col-md-3">
  162. <div class="input-group date form-date" data-date="" data-date-format="dd MM yyyy" data-link-format="yyyy-mm-dd">
  163. <input class="form-control" size="16" id="time_e" type="text" value="" readonly="" placeholder="结束时间" >
  164. <span class="input-group-addon"><span class="icon-remove"></span></span>
  165. <span class="input-group-addon"><span class="icon-calendar"></span></span>
  166. </div>
  167. </div>
  168. <div class="col-md-2">
  169. <input type="text" id="vname" class="form-control" placeholder="作品名">
  170. </div>
  171. <div class="col-md-1">
  172. <button class="btn btn-info" onclick="list_videos(1)">搜索</button>
  173. </div>
  174. </div>
  175. <div class="row" style="margin-top:30px;">
  176. <div class="col-md-12">
  177. <div class="list_wrap">
  178. <div id="list_wrap_content"></div>
  179. <div id="pager_wrap"></div>
  180. </div>
  181. </div>
  182. </div>
  183. </div>
  184. <script>
  185. $(function(){
  186. list_videos(1);
  187. })
  188. </script>
  189. {/if}
  190. <!--分享框-->
  191. <div class="modal fade" id="fx_modal">
  192. <div class="modal-dialog">
  193. <div class="modal-content">
  194. <div class="modal-header">
  195. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span></button>
  196. <h4 class="modal-title">手机扫描二维码分享给朋友:</h4>
  197. </div>
  198. <div class="modal-body" style="text-align:center">
  199. <img id="fx_img" src="" width="200" height="200">
  200. <div class="row" style="margin-top: 15px">
  201. <label class="col-md-2 control-label">作品地址</label>
  202. <div class="col-md-10">
  203. <input type="text" class="form-control" id="workslocation" name="videoname" value="">
  204. </div>
  205. </div>
  206. <div class="row" style="margin-top: 15px">
  207. <label class="col-md-2 control-label">嵌入到网站</label>
  208. <div class="col-md-10">
  209. <input type="text" class="form-control" id="web_site" name="web_site" frameborder="no" border="0" >
  210. </div>
  211. </div>
  212. <div class="row" style="margin-top: 15px">
  213. <label class="col-md-2 control-label">嵌入到论坛</label>
  214. <div class="col-md-10">
  215. <input type="text" class="form-control" id="forum" name="forum" frameborder="no" border="0" >
  216. </div>
  217. </div>
  218. </div>
  219. </div>
  220. </div>
  221. </div>
  222. </div>
  223. <script src="/static/js/jquery.zclip.min.js"></script>
  224. <script>
  225. var cdn_host = "{$_lang['cdn_host']}";
  226. var host = "{$_lang['host']}";
  227. var pageSize = 10;
  228. var comment_c_pid;
  229. {literal}
  230. $(function(){
  231. $(".form-date").datetimepicker({
  232. language: "zh-CN",
  233. weekStart: 1,
  234. todayBtn: 1,
  235. autoclose: 1,
  236. todayHighlight: 1,
  237. startView: 2,
  238. minView: 2,
  239. forceParse: 0,
  240. format: "yyyy-mm-dd"
  241. });
  242. $("#atlas_nav .altlas_name").click(function(){
  243. var $li = $(this).parents('li');
  244. if(!$li.hasClass("atlas_active")){
  245. $li.siblings().removeClass("atlas_active");
  246. $li.addClass("atlas_active");
  247. }
  248. list(1,true);
  249. })
  250. $("#atlas_save").click(function(){
  251. $(this).attr("disabled", true);
  252. var name = $.trim($("#atlas_name").val());
  253. if(name.length<=0||name.length>200){
  254. alert_notice("请输入0到200长度的名称!");
  255. return false;
  256. }
  257. $.post("/member/project",{
  258. 'act':'atlas_update',
  259. 'name':name,
  260. 'atlas_id':$("#atlas_id").val()
  261. },function(result){
  262. result = eval("("+result+")");
  263. if (result.flag) {
  264. alert_notice("操作成功","success");
  265. setTimeout(function(){
  266. window.location.reload();
  267. },1000);
  268. }else{
  269. alert_notice(result.msg);
  270. $("#atlas_modal").modal('hide');
  271. }
  272. })
  273. $("#atlas_save").removeAttr('disabled');
  274. });
  275. $("#atlas_select").change(function(){
  276. var atlas_id = $(this).val();
  277. if (atlas_id<=0) {
  278. return false;
  279. }
  280. var pids =new Array;
  281. $("input[name='project_checkbox']").each(function(){
  282. if($(this).is(':checked')){
  283. pids.push($(this).data("pid"));
  284. }
  285. });
  286. if(pids.length==0){
  287. alert_notice("请先勾选要移动的项目");
  288. return false;
  289. }
  290. $.post("/member/project",{
  291. "act":"move_project",
  292. "atlas_id":atlas_id,
  293. "pids":JSON.stringify(pids)
  294. },function(result){
  295. result = eval("("+result+")");
  296. if (result.flag) {
  297. alert_notice("操作成功","success");
  298. window.location.reload();
  299. }else{
  300. alert_notice(result.msg);
  301. }
  302. })
  303. });
  304. });
  305. function list(currentPage,reset){
  306. var obj = alert_notice("页面加载中...",'success');
  307. var atlas_id = $("#atlas_nav .atlas_active").data("atlasid");
  308. var name , time_s,time_e;
  309. if(!reset){
  310. name = $.trim($("#name").val());
  311. time_s = $("#time_s").val();
  312. time_e = $("#time_e").val();
  313. if(time_s!=""&&time_e==""){
  314. alert_notice("请选择结束时间");
  315. return false;
  316. }
  317. if(time_s==""&&time_e!=""){
  318. alert_notice("请选择开始时间");
  319. return false;
  320. }
  321. }else{
  322. $("#name").val("");
  323. $("#time_s").val("");
  324. $("#time_e").val("");
  325. }
  326. $("#list_wrap_content").html("");
  327. $.post("/member/project",{
  328. "act":"list_data",
  329. "pageSize":pageSize,
  330. "page":currentPage,
  331. "name":name,
  332. "atlas":atlas_id,
  333. "time_s":time_s,
  334. "time_e":time_e
  335. },function(res){
  336. var res = eval("("+res+")");
  337. var h = "",data = res.list;
  338. if (data.length==0) {
  339. h='<span style="width:100px;text-align:center;margin-left:40%;margin-top:50px;font-size:16px;display:inline-block">没有结果!</span>';
  340. $("#pager_wrap").html("");
  341. }else{
  342. for (var i = 0; i <data.length; i++) {
  343. var o = data[i];
  344. h+='<div class="items">'+
  345. '<div class="item">'+
  346. '<div class="item-content">'+
  347. '<div class=pull-left><input type="checkbox" style="margin:20px 10px 0 0" name="project_checkbox" data-pid="'+o.pk_works_main+'"></div>'+
  348. '<div class="pull-left">'+
  349. '<img src="'+o.thumb_path+'" width="60" height="60" class="img-rounded" >'+
  350. '</div>'+
  351. '<div class="pull-left works_intro" >'+
  352. '<a href="/tour/'+o.view_uuid+'" class="works_name" target="_blank">'+o.name+'</a>'+
  353. '<a href="/tour/'+o.view_uuid+'" class="works_preview" target="_blank">预览</a>'+
  354. '<div class="text-muted">'+
  355. '<span>'+o.create_time+'</span>'+
  356. '&nbsp;&nbsp;'+
  357. '<span><i class="icon icon-thumbs-o-up"></i>&nbsp;'+o.praised_num+'</span>&nbsp;&nbsp;'+
  358. '<span><i class="icon icon-eye-open"></i>&nbsp;'+o.browsing_num+'</span>'+
  359. '</div>'+
  360. '</div>'+
  361. '<div class="pull-right works_edit">'+
  362. '<span>排序:<a id="sort_1_'+o.pk_works_main+'" onclick="sort('+o.pk_works_main+','+o.user_sort+',1)">'+o.user_sort+'</a></span>'+
  363. '<span>是否推荐:<a id="recommend_1_'+o.pk_works_main+'" onclick="tuijian('+o.pk_works_main+',1)" data-recommend="'+o.user_recommend+'">'+(o.user_recommend==0?"<i class=\"icon-times\"></i>":"<i class=\"icon-check\" style=\"color:#c40000\"></i>")+'</a></span>'+
  364. '<span><a onclick="fenxiang(\''+o.view_uuid+'\')">分享</a></span>'+
  365. '<span><a onclick="showcomment('+o.pk_works_main+')">说一说</a></span>'+
  366. '<span><a href="/edit/pic?pid='+o.pk_works_main+'">编辑</a></span>'+
  367. '<span><a onclick="works_del('+o.pk_works_main+')">删除</a></span>'+
  368. '</div>'+
  369. ' </div>'+
  370. ' </div>'+
  371. '</div>';
  372. }
  373. var pg = new Page('list',res.pageCount,res.currentPage);
  374. $("#pager_wrap").html(pg.printHtml());
  375. }
  376. $("#list_wrap_content").html(h);
  377. pageSize = res.pageSize;
  378. obj.hide();
  379. })
  380. }
  381. function list_comments(currentPage,reset){
  382. var obj = alert_notice("评论加载中...",'success');
  383. var content;
  384. if (!reset) {
  385. content = $("#content").val();
  386. }else{
  387. $("#content").val("");
  388. }
  389. $.post("/member/comment",{
  390. "act":"list",
  391. "pageSize":pageSize,
  392. "currentPage":currentPage,
  393. "pid":comment_c_pid,
  394. "content":content
  395. },function(res){
  396. var res = eval("("+res+")");
  397. var h = "",data = res.list;
  398. $("#comment_count").html(res.total);
  399. if (data.length==0) {
  400. //TODO
  401. }else{
  402. for(var i=0 ; i<data.length;i++){
  403. var o = data[i];
  404. h+='<tr>'+
  405. '<td><input type="checkbox" name="comment_checkbox"></td>'+
  406. '<td><img src="'+o.head_img+'" width="40"></td>'+
  407. '<td>'+o.nickname+'</td>'+
  408. '<td>'+o.content+'</td>'+
  409. '<td>'+o.add_time+'</td>'+
  410. '<td>'+o.sex+'</td>'+
  411. '<td>'+o.province+'</td>'+
  412. '<td>'+o.city+'</td>'+
  413. '<td><span class="text-danger" style="cursor:pointer" onclick="comment_del_one('+o.id+')"><i class="icon-trash"></i></span></td>'+
  414. '</tr>';
  415. }
  416. var pg = new Page('list_comments',res.pageCount,res.currentPage);
  417. $("#comment_pager_wrap").html(pg.printHtml());
  418. }
  419. $("#comment_wrap table tbody").html(h);
  420. pageSize = res.pageSize;
  421. obj.hide();
  422. })
  423. }
  424. function showcomment(pid){
  425. comment_c_pid = pid;
  426. list_comments(1,true);
  427. $("#pic_wrap").hide();
  428. $("#comment_wrap").show();
  429. }
  430. function hidecomment(){
  431. $("#pic_wrap").show();
  432. $("#comment_wrap").hide();
  433. }
  434. function list_videos(currentPage,reset){
  435. var obj = alert_notice("页面加载中...",'success');
  436. var vname , time_s,time_e;
  437. if(!reset){
  438. vname = $.trim($("#vname").val());
  439. time_s = $("#time_s").val();
  440. time_e = $("#time_e").val();
  441. if(time_s!=""&&time_e==""){
  442. alert_notice("请选择结束时间");
  443. return false;
  444. }
  445. if(time_s==""&&time_e!=""){
  446. alert_notice("请选择开始时间");
  447. return false;
  448. }
  449. }else{
  450. $("#vname").val("");
  451. $("#time_s").val("");
  452. $("#time_e").val("");
  453. }
  454. $("#list_wrap_content").html("");
  455. $.post("/member/project",{
  456. "act":"list_videos",
  457. "pageSize":pageSize,
  458. "page":currentPage,
  459. "vname":vname,
  460. "time_s":time_s,
  461. "time_e":time_e
  462. },function(res){
  463. var res = eval("("+res+")");
  464. var h = "",data = res.list;
  465. if (data.length==0) {
  466. h='<span style="width:100px;text-align:center;margin-left:40%;margin-top:50px;font-size:16px;display:inline-block">没有结果!</span>';
  467. $("#pager_wrap").html("");
  468. }else{
  469. for (var i = 0; i <data.length; i++) {
  470. var o = data[i];
  471. h+='<div class="items">'+
  472. '<div class="item">'+
  473. '<div class="item-content">'+
  474. '<div class=pull-left><input type="checkbox" style="margin:20px 10px 0 0" name="project_checkbox" data-pid="'+o.id+'"></div>'+
  475. '<div class="pull-left">'+
  476. '<img src="'+(o.thumb_path?o.thumb_path:"/static/images/play.png")+'" width="60" height="60" class="img-rounded" >'+
  477. '</div>'+
  478. '<div class="pull-left works_intro" >'+
  479. '<a href="'+cdn_host+'video/play.html?vid='+o.id+'" class="works_name" target="_blank">'+o.vname+'</a>&nbsp;&nbsp;&nbsp;&nbsp;'+
  480. (o.state==0?'<span class="text-warning">等待编辑</span>':
  481. (o.flag_publish==0?'<span class="text-danger">未发布</span>':'<span class="text-success">已发布</span>'))+
  482. '<a href="'+cdn_host+'video/play.html?vid='+o.id+'" class="works_preview" target="_blank">预览</a>'+
  483. '<div class="text-muted">'+
  484. '<span>'+o.create_time+'</span>'+
  485. '&nbsp;&nbsp;'+
  486. '<span><i class="icon icon-thumbs-o-up"></i>&nbsp;'+o.praised_num+'</span>&nbsp;&nbsp;'+
  487. '<span><i class="icon icon-eye-open"></i>&nbsp;'+o.browsing_num+'</span>'+
  488. '</div>'+
  489. '</div>'+
  490. '<div class="pull-right works_edit">'+
  491. '<span>排序:<a id="sort_2_'+o.id+'" onclick="sort('+o.id+','+o.user_sort+',2)">'+o.user_sort+'</a></span>'+
  492. '<span>是否推荐:<a id="recommend_2_'+o.id+'" onclick="tuijian('+o.id+',2)" data-recommend="'+o.user_recommend+'">'+(o.user_recommend==0?"<i class=\"icon-times\"></i>":"<i class=\"icon-check\" style=\"color:#c40000\"></i>")+'</a></span>'+
  493. '<span><a onclick="fenxiang(\''+cdn_host+'video/play.html?vid='+o.id+'\')">分享</a></span>'+
  494. '<span><a href="/edit/video?vid='+o.id+'">编辑</a></span>'+
  495. '<span><a onclick="video_del('+o.id+')">删除</a></span>'+
  496. '</div>'+
  497. ' </div>'+
  498. ' </div>'+
  499. '</div>';
  500. }
  501. var pg = new Page('list_videos',res.pageCount,res.currentPage);
  502. $("#pager_wrap").html(pg.printHtml());
  503. }
  504. $("#list_wrap_content").html(h);
  505. pageSize = res.pageSize;
  506. obj.hide();
  507. })
  508. }
  509. function atlas_edit(atlas_id,name){
  510. $("#atlas_id").val(atlas_id);
  511. $("#atlas_name").val(name);
  512. $("#atlas_modal").modal('show');
  513. }
  514. function atlas_del(atlas_id){
  515. bootbox.confirm({
  516. message:"确定要删除一个分类吗?",
  517. buttons: {
  518. confirm: {
  519. label: '确认',
  520. className: 'btn-primary'
  521. },
  522. cancel: {
  523. label: '取消',
  524. className: 'btn-default'
  525. }
  526. },
  527. title:"提示:",
  528. callback:function(result) {
  529. if(result){
  530. alert_notice("等待执行...","success",'top',5000);
  531. $.post("/member/project",{
  532. 'act':'atlas_del',
  533. 'atlas_id':atlas_id
  534. },function(result){
  535. result = eval("("+result+")");
  536. if (result.flag) {
  537. alert_notice("操作成功","success");
  538. window.location.reload();
  539. }else{
  540. alert_notice(result.msg);
  541. }
  542. })
  543. }
  544. }
  545. });
  546. }
  547. function sort(id,value,type){
  548. bootbox.prompt({
  549. buttons: {
  550. confirm: {
  551. label: '确认',
  552. className: 'btn-primary'
  553. },
  554. cancel: {
  555. label: '取消',
  556. className: 'btn-default'
  557. }
  558. },
  559. value: value?value:"",
  560. title:"排序默认为999,越小越靠前",
  561. callback:function(result) {
  562. if (result!=null) {
  563. result = parseInt(result);
  564. if (result<1||result>999) {
  565. alert_notice("请输入1到999之间的值");
  566. return false;
  567. }else{
  568. $.post("/member/project",{
  569. "id":id,
  570. "type":type,
  571. "user_sort":result,
  572. "edit":1,
  573. 'act':"edit_sort_recommend"
  574. },function(res){
  575. res = eval("("+res+")");
  576. if (res.status==1) {
  577. alert_notice("修改成功","success");
  578. $("#sort_"+type+"_"+id).text(result);
  579. }else{
  580. alert_notice(res.msg);
  581. }
  582. })
  583. }
  584. }
  585. }
  586. })
  587. }
  588. function tuijian(id,type){
  589. $.post("/member/project",{
  590. "id":id,
  591. "type":type,
  592. "edit":2,
  593. 'act':"edit_sort_recommend"
  594. },function(res){
  595. res = eval("("+res+")");
  596. if (res.status==1) {
  597. alert_notice("修改成功","success");
  598. var html = res.recommend==0?'<i class="icon-times"></i>':'<i class="icon-check" style="color:#c40000;"></i>';
  599. $("#recommend_"+type+"_"+id).html(html);
  600. }else{
  601. alert_notice(res.msg);
  602. }
  603. })
  604. }
  605. function comment_del_one(oid){
  606. var params = new Array();
  607. params.push(oid);
  608. do_comment_del(params);
  609. }
  610. function do_comment_del(params){
  611. bootbox.confirm({
  612. message:"确定要删除该评论吗?",
  613. buttons: {
  614. confirm: {
  615. label: '确认',
  616. className: 'btn-primary'
  617. },
  618. cancel: {
  619. label: '取消',
  620. className: 'btn-default'
  621. }
  622. },
  623. title:"提示:",
  624. callback:function(result) {
  625. if(result){
  626. alert_notice("等待执行...","success",'top',5000);
  627. $.post("/member/comment",{
  628. "act":"delete",
  629. "params":JSON.stringify(params)
  630. },function(result){
  631. result = eval("("+result+")");
  632. if (result.flag) {
  633. alert_notice("操作成功","success");
  634. list_comments(1);
  635. }else{
  636. alert_notice(result.msg);
  637. }
  638. })
  639. }
  640. }
  641. });
  642. }
  643. function works_del(pid){
  644. bootbox.confirm({
  645. message:"确定要删除该项目吗?",
  646. buttons: {
  647. confirm: {
  648. label: '确认',
  649. className: 'btn-primary'
  650. },
  651. cancel: {
  652. label: '取消',
  653. className: 'btn-default'
  654. }
  655. },
  656. title:"提示:",
  657. callback:function(result) {
  658. if(result){
  659. alert_notice("等待执行...","success",'top',5000);
  660. $.post("/member/project",{
  661. "act":"works_del",
  662. "pid":pid
  663. },function(result){
  664. result = eval("("+result+")");
  665. if (result.flag) {
  666. alert_notice("操作成功","success");
  667. window.location.reload();
  668. }else{
  669. alert_notice(result.msg);
  670. }
  671. })
  672. }
  673. }
  674. });
  675. }
  676. function video_del(vid){
  677. bootbox.confirm({
  678. message:"确定要删除该项目吗?",
  679. buttons: {
  680. confirm: {
  681. label: '确认',
  682. className: 'btn-primary'
  683. },
  684. cancel: {
  685. label: '取消',
  686. className: 'btn-default'
  687. }
  688. },
  689. title:"提示:",
  690. callback:function(result) {
  691. if(result){
  692. alert_notice("等待执行...","success",'top',5000);
  693. $.post("/member/project",{
  694. "act":"video_del",
  695. "vid":vid
  696. },function(result){
  697. if (result) {
  698. alert_notice("操作成功","success");
  699. window.location.reload();
  700. }
  701. })
  702. }
  703. }
  704. });
  705. }
  706. function fenxiang(viewid){
  707. var text = "http://" + window.location.host +"/tour/"+viewid;
  708. $("#fx_img").attr("src","/qrcode.php?viewid="+viewid);
  709. $("#fx_modal").modal("show");
  710. $("#workslocation").val(text);
  711. $("#web_site").val('<iframe src="' + text + '" frameborder="no" border="0" style="width: 1000px;height: 600px;" allowfullscreen="true"></iframe>');
  712. $("#forum").val('<iframe src="' + text + '" frameborder="no" border="0" style="width: 1000px;height: 600px;"></iframe>');
  713. }
  714. {/literal}
  715. </script>