weirdoedit.php 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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/weirdo.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-upload-img{display: inline-block;height:120px;width: 120px;border: 1px solid #999;margin-right: 10px;position: absolute;position: relative;
  22. overflow: hidden;}
  23. .layui-upload-img img{display: block;height: 100%;width: 100%;}
  24. .close-icon{position: absolute;right:5px;top: 1px;color: #000;cursor: pointer;}
  25. .layui_w_btn {display:none;} /*去除删除按钮 特别需求*/
  26. /*选择封面图上传弹窗*/
  27. .layui_w_box {}
  28. .layui_w_title {background:red;}
  29. .layui_w_title ul li {display:inline-block;}
  30. </style>
  31. <div class="xm_qytc_box">
  32. <form class="layui-form layui-form-pane" id="signupForm">
  33. <div class="layui-form-item">
  34. <label class="layui-form-label"><span style="color:red">*</span>标题</label>
  35. <div class="layui-input-inline" style="width:270px;">
  36. <input type="text" name="subject" lay-verify="required" value="<?= $model['subject'] ?>" placeholder="请输入标题" autocomplete="off" class="layui-input">
  37. </div>
  38. <!-- <div class="layui-input-inline">
  39. <a class="layui-btn" id="examine_user">检查重名</a>
  40. </div> -->
  41. </div>
  42. <div class="layui-form-item">
  43. <label class="layui-form-label">短标题</label>
  44. <div class="layui-input-inline" style="width:270px;">
  45. <input type="text" name="short_subject" value="<?= $model['short_subject'] ?>" placeholder="请输入短标题" autocomplete="off" class="layui-input">
  46. </div>
  47. <!-- <div class="layui-input-inline">
  48. <a class="layui-btn" id="examine_user">检查重名</a>
  49. </div> -->
  50. </div>
  51. <div class="layui-form-item">
  52. <label class="layui-form-label">作者</label>
  53. <div class="layui-input-inline" style="width:270px;">
  54. <input type="text" name="author" value="<?= $model['author'] ?>" placeholder="请输入" autocomplete="off" class="layui-input">
  55. </div>
  56. </div>
  57. <div class="layui-form-item">
  58. <label class="layui-form-label"><span style="color:red">*</span>来源</label>
  59. <div class="layui-input-inline" style="width:270px;">
  60. <input type="text" name="source" lay-verify="required" value="<?= $model['source'] ?>" placeholder="来源地址" autocomplete="off" class="layui-input">
  61. </div>
  62. <!-- <div class="layui-input-inline">
  63. <button class="layui-btn ml">选择</button>
  64. </div> -->
  65. </div>
  66. <div class="layui-form-item">
  67. <label class="layui-form-label"><span style="color:red">*</span>描述</label>
  68. <div class="layui-input-inline" style="width:390px;">
  69. <textarea name="abstract" lay-verify="required" placeholder="请输入内容" class="layui-textarea"><?= $model['abstract'] ?></textarea>
  70. </div>
  71. </div>
  72. <div class="layui-form-item xm_pr layui-table-main">
  73. <div class="layui-inline">
  74. <button type="button" class="layui-btn layui-btn-primary" id="test1"><span style="color:red">*</span>选择封面图</button>
  75. <div class="layui-inline">
  76. <div class="layui-upload">
  77. <div class="layui-upload-list lay_p_relative"> <!--低级添加 lay_p_relative-->
  78. <img class="layui-upload-img layui_magnify" name="advertising_img" src="<?= Yii::$app->params['httpImg']['host'],Yii::$app->params['httpImg']['weirdo'],$model['thumb'] ?>" id="breviary_img" style="width:280px;height:90px;margin-left:10px;border:1px solid #ccc;">
  79. <p id="demoText"></p>
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. <!-- <input type="checkbox" class="xm_xcxqTc_button" name="thumb_watermark" value="1" checked title="水印">
  86. <input type="checkbox" class="xm_xcxqTc_button" name="compress" value="1" checked title="压缩图片"> -->
  87. <!-- <div class="layui-form-item xm_pr">-->
  88. <!-- <div class="layui-upload">-->
  89. <!-- <button type="button" class="layui-btn upload_box" id="">选择封面图</button>-->
  90. <!-- <!-- <button type="button" class="layui-btn upload_box" id="upload_edit">多图片上传</button> -->
  91. <!-- <input type="checkbox" class="xm_xcxqTc_button" name="thumb_size" value="2" title="大图">-->
  92. <!-- -->
  93. <!-- <span style="color:red;font-size:12px;margin-left:5px;">(水印默认选中,不添加水印去掉勾选!)</span>-->
  94. <!-- <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">-->
  95. <!-- 预览图:-->
  96. <!-- <div class="layui-upload-list" id="demo2"></div>-->
  97. <!-- </blockquote>-->
  98. <!-- </div>-->
  99. <!-- </div>-->
  100. <div class="layui-bg-gray" style="padding:3px 15px;"><span style="color:red">*</span>文章内容:</div>
  101. <div class="editor_box">
  102. <textarea name="content" id="editor_content" lay-verify="required" cols="30" rows="10" style="width:100%;height:400px;float:left;"><?= $model['content'] ?></textarea>
  103. </div>
  104. <hr class="layui-bg-blue">
  105. <div class="layui-form-item">
  106. <div class="layui-input-block xm_xcxqTc_tj" style="margin:20px 0 0 0;text-align:center;">
  107. <input type="hidden" name="id" value="<?= $model['id'] ?>">
  108. <button class="layui-btn" lay-submit="" lay-filter="edit">提交</button>
  109. </div>
  110. </div>
  111. </form>
  112. </div>