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

edit.html 9.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. {layout name="layout2" /}
  2. <style>
  3. .layui-form-label { width: 110px; }
  4. </style>
  5. <div class="layui-card layui-form" style="box-shadow:none;">
  6. <div class="layui-card-body">
  7. <!-- 选择商品 -->
  8. <div class="layui-form-item">
  9. <label class="layui-form-label"><font color="red">*</font>拼团商品:</label>
  10. <div class="layui-input-block">
  11. <a class="layui-btn layui-btn-normal layEvent" lay-event="select">选择拼团商品</a>
  12. </div>
  13. </div>
  14. <!-- 商品信息 -->
  15. <div class="layui-form-item">
  16. <label class="layui-form-label"></label>
  17. <div class="layui-input-block">
  18. <div class="goods_info">
  19. <img src="{$detail.goods.image}" alt="商品图片" style="width:80px;height:80px;">
  20. <span style="margin-left:5px;">{$detail.goods.name}</span>
  21. <input type="hidden" name="goods_id" value="{$detail.goods.id}">
  22. </div>
  23. <table id="goods_list" class="layui-table" lay-size="sm" style="width:630px;">
  24. <thead>
  25. <tr style="background-color: #f3f5f9">
  26. <th style="width: 120px;text-align: center">商品规格</th>
  27. <th style="width: 60px;text-align: center">商品价格</th>
  28. <th style="width: 40px;text-align: center">拼团价格</th>
  29. </tr>
  30. </thead>
  31. <tbody>
  32. {volist name="$detail.teamGoods" id="vo"}
  33. <tr>
  34. <td style="text-align: center">{$vo.spec_value_str}</td>
  35. <td style="text-align: center">{$vo.price}</td>
  36. <td style="width: 40px;">
  37. <input type="number" name=item[{$vo.goods_id}][{$vo.item_id}]
  38. lay-verType="tips" lay-verify="required" autocomplete="off"
  39. class="layui-input" value="{$vo.team_price}">
  40. </td>
  41. </tr>
  42. {/volist}
  43. </tbody>
  44. </table>
  45. </div>
  46. </div>
  47. <!-- 拼团人数 -->
  48. <div class="layui-form-item" style="margin-bottom: 0;">
  49. <label for="people_num" class="layui-form-label"><font color="red">*</font>拼团人数:</label>
  50. <div class="layui-input-inline">
  51. <input type="number" min="2" id="people_num" name="people_num"
  52. class="layui-input" autocomplete="off" value="{$detail.people_num}"
  53. onkeyup="value=value.replace(/[^\d]/g,'')"
  54. lay-verType="tips" lay-verify="required|number|people_num">
  55. <div class="layui-form-mid layui-word-aux" style="white-space:nowrap;">最少两人成团,设置商品拼团人数</div>
  56. </div>
  57. <div class="layui-form-mid">人</div>
  58. </div>
  59. <!-- 拼团时效 -->
  60. <div class="layui-form-item" style="margin-bottom: 0;">
  61. <label for="effective_time" class="layui-form-label"><font color="red">*</font>成团有效期:</label>
  62. <div class="layui-input-inline">
  63. <input type="number" min="0" id="effective_time" name="effective_time"
  64. class="layui-input" autocomplete="off" value="{$detail.effective_time}"
  65. onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
  66. lay-verType="tips" lay-verify="required|number|effective_time">
  67. <div class="layui-form-mid layui-word-aux" style="white-space:nowrap;">拼团有效期,超出时间还未成团则拼团失败</div>
  68. </div>
  69. <div class="layui-form-mid">小时</div>
  70. </div>
  71. <!-- 拼团活动时间 -->
  72. <div class="layui-form-item" style="margin-bottom: 0;">
  73. <label class="layui-form-label"><font color="red">*</font>拼团活动时间:</label>
  74. <div class="layui-input-block">
  75. <div class="layui-inline">
  76. <input type="text" id="activity_start_time" name="activity_start_time" value="{$detail.activity_start_time}"
  77. class="layui-input" autocomplete="off" lay-verType="tips" lay-verify="required">
  78. </div>
  79. <div class="layui-inline">-</div>
  80. <div class="layui-inline">
  81. <input type="text" id="activity_end_time" name="activity_end_time" value="{$detail.activity_end_time}"
  82. class="layui-input" autocomplete="off" lay-verType="tips" lay-verify="required">
  83. </div>
  84. </div>
  85. <div class="layui-form-mid layui-word-aux" style="white-space:nowrap;margin-left:140px;">商品参与拼团营销活动的时间,超出活动时间则不能开启新团</div>
  86. </div>
  87. <!-- 拼够分享标题 -->
  88. <div class="layui-form-item" style="margin-bottom: 0;">
  89. <label for="share_title" class="layui-form-label" style="width:110px;">拼团分享标题:</label>
  90. <div class="layui-input-inline" style="width: 300px;">
  91. <input type="text" id="share_title" name="share_title" value="{$detail.share_title}"
  92. class="layui-input" autocomplete="off" lay-verType="tips">
  93. <div class="layui-form-mid layui-word-aux" style="white-space:nowrap;">分享拼团活动时的标题,不填则默认使用商品标题</div>
  94. </div>
  95. </div>
  96. <!-- 拼够分享简介 -->
  97. <div class="layui-form-item" style="margin-bottom: 0;">
  98. <label for="share_intro" class="layui-form-label" style="width:110px;">拼团分享简介:</label>
  99. <div class="layui-input-inline" style="width: 300px;">
  100. <input type="text" id="share_intro" name="share_intro" value="{$detail.share_intro}"
  101. class="layui-input" autocomplete="off" lay-verType="tips">
  102. <div class="layui-form-mid layui-word-aux" style="white-space:nowrap;">分享拼团活动时的简介,不填则默认使用商品简介</div>
  103. </div>
  104. </div>
  105. <!-- 拼团状态 -->
  106. <div class="layui-form-item" style="margin-bottom: 0;">
  107. <label class="layui-form-label"><font color="red">*</font>拼团状态:</label>
  108. <div class="layui-input-inline">
  109. <input type="radio" name="status" value="1" title="开启" {if $detail.status==1}checked{/if}>
  110. <input type="radio" name="status" value="0" title="关闭" {if $detail.status==0}checked{/if}>
  111. <div class="layui-form-mid layui-word-aux" style="white-space:nowrap;">商品参与拼团营销活动的状态,停止活动则不能开启新团</div>
  112. </div>
  113. </div>
  114. <div class="layui-form-item layui-hide">
  115. <input type="button" lay-submit lay-filter="addSubmit" id="addSubmit" value="确认">
  116. </div>
  117. </div>
  118. </div>
  119. <script>
  120. layui.use(["laydate"], function () {
  121. var laydate = layui.laydate;
  122. laydate.render({type:'datetime',elem:'#activity_start_time',trigger:'click'});
  123. laydate.render({type:'datetime',elem:'#activity_end_time',trigger:'click'});
  124. var active = {
  125. select: function () {
  126. layer.open({
  127. type: 2
  128. ,title: "选择拼购商品"
  129. ,content: "{:url('team.Activity/select')}"
  130. ,area: ["80%", "90%"]
  131. ,btn: ["确定", "取消"]
  132. ,yes: function(index){
  133. var iframeWindow = window["layui-layer-iframe" + index];
  134. var data = iframeWindow.callbackData();
  135. var goods_ids = [];
  136. if(data.length){
  137. $('#goods_list tbody').remove();
  138. }
  139. data.forEach(function(item) {
  140. // 商品基本信息
  141. var goods_info_html = '<img src="'+item.image+'" alt="商品图片" style="width:80px;height:80px;">\n';
  142. goods_info_html += '<span style="margin-left:5px;">'+item.name+'</span>\n';
  143. goods_info_html += '<input type="hidden" name="goods_id" value="'+item.id+'">';
  144. $(".goods_info").html(goods_info_html);
  145. // 商品规格表格
  146. for(var i = 0; item.GoodsItem.length > i; i++){
  147. var goods_item = item.GoodsItem[i];
  148. if(goods_ids.indexOf(goods_item.id) === -1) {
  149. goods_ids.push(goods_item.id);
  150. var goods_html = '<tr>\n';
  151. goods_html += '<td style="text-align: center">'+goods_item.spec_value_str+'</td>\n';
  152. goods_html += '<td style="text-align: center">'+goods_item.price+'</td>\n';
  153. goods_html += '<td style="width: 40px;">';
  154. goods_html += '<input type="number" name=item['+item.id+']['+goods_item.id+'] lay-verType="tips" lay-verify="required" autocomplete="off" class="layui-input">\n';
  155. goods_html += '</td></tr>';
  156. $('#goods_list').append(goods_html);
  157. }
  158. }
  159. // 显示规格表格
  160. $('table#goods_list').show();
  161. });
  162. }
  163. });
  164. }
  165. };
  166. like.eventClick(active);
  167. })
  168. </script>