index.html 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. {layout name="layout" /}
  2. <div id="actionbar" class="fn-clear">
  3. <button class="button button-blue openwin" url="{:url('group/add')}"><i class="iconfont icon-list_icon"></i>选择商品</button>
  4. </div>
  5. <table class="table table-border">
  6. <thead>
  7. <tr>
  8. <th class="fn-tac w100">操作</th>
  9. <th class="fn-tac w100">¥团购价</th>
  10. <th class="fn-tac w100">几人团</th>
  11. <th class="fn-tac w80">商品名称</th>
  12. <th></th>
  13. <th class="w100 fn-tar">¥销售价</th>
  14. </tr>
  15. </thead>
  16. <tbody>
  17. {foreach $lists as $vo}<tr>
  18. <td class="fn-tac">
  19. <a class="button isDel" url="{:url('group/delete',['id'=>$vo.id])}"href="javascript:;" title="删除">
  20. <i class="iconfont icon-lajixiang"></i>删除
  21. </a>
  22. </td>
  23. <td class="fn-tac"><input name="sort" class="w80 input fn-tac" type="text" value="{$vo.amount}" id="{$vo.id}" /></td>
  24. <td class="fn-tac"><input name="hao_people" class="w80 input fn-tac" type="text" value="{$vo.hao_people}" id="{$vo.id}" /></td>
  25. <td class="fn-tac"><img src="{$vo.item.img}?x-oss-process=style/80" class="w60" /></td>
  26. <td>{$vo.item.name}</td>
  27. <td class="fn-tar">¥{$vo.item.sell_price}</td>
  28. </tr>
  29. {/foreach}
  30. </tbody>
  31. </table>
  32. {$lists|raw}
  33. <script type="text/javascript">
  34. Do('base', 'layer', function () {
  35. $('.isDel').isDel();
  36. sort("{:url('group/amount')}");
  37. //修改价格
  38. $("input[name='hao_people']").change(function () {
  39. var id = $(this).attr('id');
  40. var value = $(this).val();
  41. var url = "{:url('group/hao_people')}";
  42. $.post(url, { id: id, sort: value }, function (data) {
  43. if (data.code == 200) {
  44. layer.msg(data.msg, { time: 300 }, function () { window.location.reload(); });
  45. } else {
  46. layer.msg(data.msg);
  47. }
  48. })
  49. });
  50. $(".openwin").click(function () {
  51. var url = $(this).attr('url');
  52. var index = parent.layer.getFrameIndex(window.name);
  53. parent.layer.open({
  54. type: 2, maxmin: false, area: ['60%', '70%'], content: url, end: function () {
  55. window.location.reload()
  56. }
  57. });
  58. });
  59. })
  60. </script>