newsedit.php 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: xiaofeng
  5. * Date: 2018/3/18
  6. * Time: 下午3:49
  7. */
  8. use backend\assets\AppAsset;
  9. AppAsset::addScript($this,Yii::$app->request->baseUrl."/static/plug-in/ueditor/1.4.3/ueditor.config.js");
  10. AppAsset::addScript($this,Yii::$app->request->baseUrl."/static/plug-in/ueditor/1.4.3/ueditor.all.min.js");
  11. AppAsset::addScript($this,Yii::$app->request->baseUrl."/static/plug-in/ueditor/1.4.3/lang/zh-cn/zh-cn.js");
  12. AppAsset::addScript($this,Yii::$app->request->baseUrl."/static/plug-in/jquery-3.2.1.min.js");
  13. AppAsset::addScript($this,Yii::$app->request->baseUrl."/js/news.js");
  14. ?>
  15. <style>
  16. .xm_qytc_box{width:920px;margin:auto;margin-top:20px;}
  17. .xm_xcxqTc_img{margin:0;}
  18. .xm_xcxqTc_button{position:absolute;bottom:0;left:0;}
  19. .xm_pr{position:relative;}
  20. .ml{margin-left:18px}
  21. /*.layui-form-pane .layui-form-checkbox{position:absolute;bottom:0;left:100px;}*/
  22. .layui-upload-img{display: inline-block;height:120px;width: 120px;border: 1px solid #999;margin-right: 10px;position: absolute;position: relative;
  23. overflow: hidden;}
  24. .layui-upload-img img{display: block;height: 100%;width: 100%;}
  25. .close-icon{position: absolute;right:5px;top: 1px;color: #000;cursor: pointer;}
  26. /*删除*/
  27. .delete-list {background:rgba(0,0,0,0.5);position:absolute;top:-28px;left:0;width:100%;padding:3px 0;}
  28. .delete-list i {float:right;margin-right:8px;cursor:pointer;font-size:20px !important;; color: #fff;}
  29. .layui-upload-img:hover .delete-list {top:0;}
  30. .layui_w_btn {display:none;} /*去除删除按钮 特别需求*/
  31. </style>
  32. <div class="xm_qytc_box">
  33. <form class="layui-form layui-form-pane" id="signupForm">
  34. <div class="layui-form-item">
  35. <label class="layui-form-label"><span style="color:red">*</span>标题</label>
  36. <div class="layui-input-inline" style="width:270px;">
  37. <input type="text" name="subject" lay-verify="required" placeholder="请输入标题" value="<?php echo $model['subject']?>" autocomplete="off" class="layui-input">
  38. </div>
  39. <!-- <div class="layui-input-inline">-->
  40. <!-- <button class="layui-btn ml">检查重名</button>-->
  41. <!-- </div>-->
  42. </div>
  43. <div class="layui-form-item">
  44. <label class="layui-form-label">短标题</label>
  45. <div class="layui-input-inline" style="width:270px;">
  46. <input type="text" name="short_subject" placeholder="请输入短标题" autocomplete="off" value="<?php echo $model['short_subject']?>" class="layui-input">
  47. </div>
  48. <!-- <div class="layui-input-inline">
  49. <a class="layui-btn" id="examine_user">检查重名</a>
  50. </div> -->
  51. </div>
  52. <div class="layui-form-item">
  53. <label class="layui-form-label"><span style="color:red;">*</span>所属栏目</label>
  54. <div class="layui-input-inline" style="width:270px;">
  55. <select name="category">
  56. <?php foreach($news as $val){?>
  57. <option value="<?php echo $val['id'] ?>" <?php if($val['id'] == $model['category']) echo 'selected'?> ><?php echo $val['news_name']?></option>
  58. <?php }?>
  59. </select>
  60. </div>
  61. </div>
  62. <div class="layui-form-item">
  63. <label class="layui-form-label">区域</label>
  64. <div class="layui-input-inline" style="width:270px;">
  65. <select name="city" lay-search="">
  66. <option value="">请选择</option>
  67. <?php foreach($city as $val){?>
  68. <option value="<?php echo $val['id'] ?>" <?php if($val['id'] == $model['city']) echo 'selected'?> ><?php echo $val['city_name']?></option>
  69. <?php }?>
  70. </select>
  71. </div>
  72. </div>
  73. <div class="layui-form-item">
  74. <label class="layui-form-label">作者</label>
  75. <div class="layui-input-inline" style="width:270px;">
  76. <input type="text" name="author" placeholder="请输入" value="<?php echo $model['author']?>" autocomplete="off" class="layui-input">
  77. </div>
  78. </div>
  79. <div class="layui-form-item">
  80. <label class="layui-form-label">来源</label>
  81. <div class="layui-input-inline" style="width:270px;">
  82. <input type="text" name="source" lay-verify="required" value="<?php echo $model['source']?>" autocomplete="off" class="layui-input">
  83. </div>
  84. <!-- <div class="layui-input-inline">
  85. <button class="layui-btn ml">选择</button>
  86. </div> -->
  87. </div>
  88. <div class="layui-form-item">
  89. <div class="layui-inline">
  90. <label class="layui-form-label">添加时间</label>
  91. <div class="layui-input-block" style="width:270px;">
  92. <!-- id="ModificationDate"-->
  93. <input type="text" name="open_time" id="ModificationDate" value="<?php echo $model['open_time'] ?>" placeholder="添加时间" autocomplete="off" class="layui-input">
  94. </div>
  95. </div>
  96. </div>
  97. <div class="layui-form-item">
  98. <label class="layui-form-label">关联楼盘</label>
  99. <div class="layui-input-inline" style="width:270px;">
  100. <select name="hid" lay-search="">
  101. <option value="">请选择将该资讯关联至某一楼盘</option>
  102. <?php foreach($house as $val){?>
  103. <option value="<?php echo $val['id'] ?>" <?php if($val['id'] == $model['hid']) echo 'selected'?> ><?php echo $val['name']?></option>
  104. <?php }?>
  105. </select>
  106. </div>
  107. </div>
  108. <div class="layui-form-item">
  109. <label class="layui-form-label">描述</label>
  110. <div class="layui-input-inline" style="width:390px;">
  111. <textarea name="abstract" placeholder="请输入内容" class="layui-textarea"><?php echo $model['abstract']?></textarea>
  112. </div>
  113. </div>
  114. <div class="layui-form-item xm_pr">
  115. <div class="layui-upload">
  116. <!-- <button type="button" class="layui-btn upload_box" id="upload_edit">多图片上传</button> -->
  117. <button type="button" class="layui-btn upload_box" id="">选择封面图</button>
  118. <input type="checkbox" lay-filter="thumb_size" class="xm_xcxqTc_button" name="thumb_size" value="<?php echo $model['thumb_size']?>" title="大图" <?php if($model['thumb_size'] == 2) echo 'checked' ?>>
  119. <input type="checkbox" lay-filter="thumb_watermark" class="xm_xcxqTc_button" name="thumb_watermark" value="1" checked title="水印">
  120. <span style="color:red;font-size:12px;margin-left:5px;">(水印默认选中,不添加水印去掉勾选!)</span>
  121. <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">
  122. 预览图:
  123. <div class="layui-upload-list" id="demo2">
  124. <?php foreach ($model['thumb'] as $val){?>
  125. <div class="layui-upload-img">
  126. <div class="delete-list" id="delimg"><i class="layui-icon fa-trash-o" >&#xe640;</i></div>
  127. <img imgname="<?=$val?>" src="<?php echo Yii::$app->params['httpImg']['host'].Yii::$app->params['httpImg']['newsthumb'].$val ?>" >
  128. </div>
  129. <?php }?>
  130. </div>
  131. </blockquote>
  132. </div>
  133. </div>
  134. <div class="layui-bg-gray" style="padding:3px 15px;">文章内容:</div>
  135. <div class="editor_box">
  136. <textarea name="content" id="editor_content" cols="30" rows="10" style="width:100%;height:400px;float:left;"><?php echo $model['content']?></textarea>
  137. </div>
  138. <hr class="layui-bg-blue">
  139. <div class="layui-form-item">
  140. <input type="hidden" name="id" value="<?php echo $model['id']?>">
  141. <div class="layui-input-block xm_xcxqTc_tj" style="margin:20px 0 0 0;text-align:center;">
  142. <button class="layui-btn" lay-submit="" lay-filter="edit">提交</button>
  143. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="check_words" >敏感词检测</button>
  144. </div>
  145. </div>
  146. </form>
  147. </div>