homewatermark.php 5.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: xiaofeng
  5. * Date: 2018/3/6
  6. * Time: 下午5:49
  7. */
  8. use backend\assets\AppAsset;
  9. AppAsset::addScript($this,Yii::$app->request->baseUrl.'/js/other/watermark.js')
  10. ?>
  11. <style>
  12. .xm_qytc_box{width:920px;margin:20px auto 0 auto;}
  13. .layui_w_box {width:230px;padding:15px 0;}
  14. .layui-code, .layui-upload-list {margin-top:0;}
  15. form {margin-left:20px;}
  16. </style>
  17. <div class="xm_qytc_box">
  18. <span style="font-size:20px;">水印设置</span>
  19. <hr class="layui-bg-blue">
  20. <form class="layui-form layui-form-pane" id="start_form" action="">
  21. <div class="layui-form-item">
  22. <div class="layui-inline" >
  23. <label class="layui-form-label" style="width: 140px;">水印类型:</label>
  24. <input type="checkbox" class="xm_xcxqTc_button" checked name="type" value="1" title="图片" >
  25. </div>
  26. </div>
  27. <div class="layui-form-item">
  28. <div class="layui-inline" >
  29. <label class="layui-form-label" style="width: 140px;"><span style="color:red">*</span>水印位置:</label>
  30. <input type="checkbox" name="status" value="1" checked title="水印开启">
  31. </div>
  32. <div class="layui_w_box" >
  33. <?php foreach($position as $key=>$val){?>
  34. <input type="radio" name="position" value="<?php echo $key?>" <?php if($key == $model['position']) echo 'checked' ?> title="<?php echo $val ?>">
  35. <?php }?>
  36. </div>
  37. </div>
  38. <div class="layui-form-item" >
  39. <div class="layui-inline">
  40. <label class="layui-form-label" style="width: 140px;"><span style="color:red">*</span>禁止水印宽度:</label>
  41. <div class="layui-input-block" style="float: left;margin-left: 10px;width:180px;">
  42. <input type="text" name="width" required value="<?php echo $model['width'] ?>" lay-verify="required" placeholder="输入宽度" autocomplete="off" class="layui-input" style="width:105%;">
  43. </div>
  44. <span style="color:#999;padding-left:15px;line-height:38px;color:#a89898">如果图片宽度小于该值将不会添加水印</span>
  45. </div>
  46. </div>
  47. <div class="layui-form-item" >
  48. <div class="layui-inline">
  49. <label class="layui-form-label" style="width: 140px;"><span style="color:red">*</span>禁止水印高度:</label>
  50. <div class="layui-input-block" style="float: left;margin-left: 10px;width:180px;">
  51. <input type="text" name="height" required value="<?php echo $model['height'] ?>" lay-verify="required" placeholder="输入高度" autocomplete="off" class="layui-input" style="width:105%;">
  52. </div>
  53. <span style="color:#999;padding-left:15px;line-height:38px;color:#a89898">如果图片高度小于该值将不会添加水印</span>
  54. </div>
  55. </div>
  56. <div class="layui-form-item" >
  57. <div class="layui-inline">
  58. <label class="layui-form-label" style="width: 140px;">间距:</label>
  59. <div class="layui-input-block" style="float: left;margin-left: 10px;width:180px;">
  60. <input type="text" name="spacing" value="<?php echo $model['spacing'] ?>" placeholder="默认为20" autocomplete="off" class="layui-input" style="width:105%;">
  61. </div>
  62. <span style="color:#999;padding-left:15px;line-height:38px;color:#a89898">如果图片高度小于该值将不会添加水印</span>
  63. </div>
  64. </div>
  65. <div class="layui-form-item xm_pr">
  66. <label class="layui-form-label" style="width: 140px;"><span style="color:red">*</span>水印图片:</label>
  67. <div class="layui-inline">
  68. <div class="layui-inline">
  69. <div class="layui-upload">
  70. <div class="layui-upload-list" style="width:249px;height:80px;line-height:80px;padding:0 15px;margin-left:10px;border:1px solid #d2d2d2;background:rgba(0,0,0,0.3)">
  71. <img class="layui-upload-img" id="demo1" src="<?php echo '/'.$model['template'] ?>" style="width:249px;height:26px;">
  72. </div>
  73. </div>
  74. </div>
  75. <div class="layui-inline">
  76. <div class="layui-upload">
  77. <button type="button" field="aaa" class="layui-btn layui-btn-primary" id="test1">上传图片</button>
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. <hr class="layui-bg-blue">
  83. <div class="layui-form-item">
  84. <div class="layui-input-block xm_xcxqTc_tj" style="margin:20px 0 0 0;text-align:center;">
  85. <input type="hidden" name="id" value="<?php echo $model['id'] ?>">
  86. <button class="layui-btn" lay-submit="" lay-filter="watermark">提交</button>
  87. </div>
  88. </div>
  89. </form>
  90. </div>