截流自动化的商城平台
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.html 7.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. {layout name="layout2" /}
  2. <style>
  3. .layui-form-label {
  4. color: #6a6f6c;
  5. width: 100px;
  6. }
  7. .layui-input-block {
  8. margin-left: 130px;
  9. }
  10. .tips {
  11. color: red;
  12. }
  13. .unit-tips {
  14. float: left;
  15. display: block;
  16. padding: 9px 0 !important;
  17. line-height: 20px;
  18. margin-right: 10px;
  19. }
  20. .layui-form-mid.layui-word-aux {
  21. width: 392px;
  22. }
  23. .mintop {
  24. padding-top: -350px;
  25. position: relative;
  26. top: -40px;
  27. }
  28. .one_price {
  29. margin-bottom: 11px !important;
  30. }
  31. .input_width {
  32. width: 40% !important;
  33. }
  34. </style>
  35. <div class="layui-form" lay-filter="layuiadmin-form-coupon" id="layuiadmin-form-coupon" style="padding: 20px 30px 0 0;">
  36. <!-- 产品来源 -->
  37. <div class="layui-form-item">
  38. <label class="layui-form-label"><font color="red">*</font>产品来源:</label>
  39. <input type="hidden" name="source_id" id="source_id" value="0">
  40. <div class="layui-input-inline input_width">
  41. <input type="radio" name="source_type" value="0" title="商品库" checked>
  42. </div>
  43. </div>
  44. <!-- 选择商品 -->
  45. <div class="layui-form-item">
  46. <div class="layui-input-block">
  47. <a class="layui-btn layui-btn-normal select-goods">选择商品</a>
  48. </div>
  49. </div>
  50. <!-- 商品名称 -->
  51. <div class="layui-form-item">
  52. <label class="layui-form-label"><font color="red">*</font>商品名称:</label>
  53. <div class="layui-input-inline input_width">
  54. <input type="text" id="goods_name" name="name"
  55. class="layui-input" autocomplete="off" lay-verType="tips" lay-verify="required">
  56. </div>
  57. </div>
  58. <!-- 商品封面 -->
  59. <div class="layui-form-item">
  60. <label class="layui-form-label"><font color="red">*</font>商品封面:</label>
  61. <div class="layui-input-block">
  62. <div class="like-upload-image " switch-tab="0" lay-verType="tips">
  63. <div class="upload-image-elem"><a class="add-upload-image upload-cover-img"> + 添加</a></div>
  64. </div>
  65. <div class="layui-form-mid layui-word-aux">建议尺寸:200像素 * 200像素,图片尺寸不能超过300像素 * 300像素。</div>
  66. </div>
  67. </div>
  68. <!-- 价格形式-->
  69. <div class="layui-form-item">
  70. <label class="layui-form-label"><span class="tips">*</span>价格形式:</label>
  71. <!--一口价 -->
  72. <div class="layui-form-item mintop one_price">
  73. <label class="layui-form-label"></label>
  74. <div class="layui-input-inline" style="margin-right: 0px;width: 120px;">
  75. <input type="radio" name="price_type" value="1" title="一口价" checked>
  76. </div>
  77. <div class="unit-tips">价格</div>
  78. <div class="layui-input-inline" style="width: 110px">
  79. <input type="number" name="price" id="price" class="layui-input" min="0">
  80. </div>
  81. <div class="unit-tips">元</div>
  82. </div>
  83. <!-- 价格区间-->
  84. <label class="layui-form-label"></label>
  85. <div class="mintop">
  86. <div class="layui-input-inline" style="margin-right: 0px;width: 120px;">
  87. <input type="radio" name="price_type" value="2" title="价格区间">
  88. </div>
  89. <div class="unit-tips">价格</div>
  90. <div class="layui-input-inline" style="width: 110px">
  91. <input type="number" name="section_price_start" class="layui-input " autocomplete="off" min="0">
  92. </div>
  93. <div class="unit-tips">元&nbsp;&nbsp;&nbsp;-</div>
  94. <div class="layui-input-inline" style="width: 110px">
  95. <input type="number" name="section_price_end" class="layui-input " autocomplete="off" min="0">
  96. </div>
  97. <div class="unit-tips">元</div>
  98. </div>
  99. <!--显示折扣价 -->
  100. <div class="layui-form-item mintop" style="padding-top: 10px">
  101. <label class="layui-form-label"></label>
  102. <div class="layui-input-inline" style="margin-right: 0px;width: 120px;">
  103. <input type="radio" name="price_type" value="3" title="显示折扣价">
  104. </div>
  105. <div class="unit-tips">原价</div>
  106. <div class="layui-input-inline" style="width: 110px">
  107. <input type="number" name="discount_price_start" class="layui-input " autocomplete="off" min="0">
  108. </div>
  109. <div class="unit-tips">元&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
  110. <div class="unit-tips">现价</div>
  111. <div class="layui-input-inline" style="width: 110px">
  112. <input type="number" name="discount_price_end" class="layui-input " autocomplete="off" min="0">
  113. </div>
  114. <div class="unit-tips">元</div>
  115. </div>
  116. </div>
  117. <!-- 商品链接 -->
  118. <div class="layui-form-item">
  119. <label class="layui-form-label" style="margin-top:-15px;"><font color="red">*</font>商品链接:</label>
  120. <div class="layui-input-inline input_width" style="margin-top:-15px;">
  121. <input type="text" id="url" name="url"
  122. class="layui-input" autocomplete="off" lay-verType="tips" lay-verify="required">
  123. <div class="layui-form-mid " style="color: #999;">
  124. 请确保小程序页面路径可被访问,例如:pages/goods_details/goods_details?id=goods_id
  125. </div>
  126. </div>
  127. </div>
  128. <div class="layui-form-item layui-hide">
  129. <input type="button" lay-submit lay-filter="addSubmit" id="addSubmit" value="确认">
  130. </div>
  131. </div>
  132. <script>
  133. layui.use(['table', 'form'], function () {
  134. var $ = layui.$
  135. , form = layui.form
  136. , table = layui.table;
  137. // 选择商品
  138. $(document).on('click', '.select-goods', function () {
  139. layer.open({
  140. type: 2
  141. , title: '选择商品'
  142. , content: '{:url("common/selectGoods")}'
  143. , area: ['90%', '90%']
  144. , btn: ['确认', '取消']
  145. , yes: function (index, layero) {
  146. var data = window["layui-layer-iframe" + index].callbackdata();
  147. data.forEach(function (item, index) {
  148. $('.del-upload-btn').parent().remove()
  149. $('#goods_name').val(item.name);
  150. $('imput[name="price_type"]:eq(0)').attr('checked', true);
  151. $('#price').val(item.min_price);
  152. $('#url').val('pages/goods_details/goods_details?id=' + item.id);
  153. var template = '<div class="upload-image-div">';
  154. template += '<img src="'+item.image+'" alt="img">';
  155. template += '<input type="hidden" name="cover_img" value="'+item.image+'">';
  156. template += '<div class="del-upload-btn">x</div>';
  157. $('.upload-image-elem').parent().before(template);
  158. $('.upload-image-elem').hide();
  159. $('#source_id').val(item.id);
  160. });
  161. }
  162. })
  163. });
  164. like.delUpload();
  165. // 直播背景
  166. $(document).on("click", ".upload-cover-img", function () {
  167. like.imageUpload({
  168. limit: 1,
  169. field: "cover_img",
  170. that: $(this),
  171. content: '/shop/file/lists?type=10',
  172. });
  173. });
  174. });
  175. </script>