buy.html 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. {include file="common/header"/}
  2. <style>
  3. .upload-wrap {
  4. position: relative;
  5. display: inline-block;
  6. overflow: hidden;
  7. border: 1px solid #2d78f4;
  8. border-radius: 3px;
  9. }
  10. .upload-wrap .file-ele {
  11. position: absolute;
  12. top: 0;
  13. right: 0;
  14. opacity: 0;
  15. height: 100%;
  16. width: 100%;
  17. cursor: pointer;
  18. }
  19. .upload-wrap .file-open {
  20. width: 90px;
  21. height: 30px;
  22. line-height: 30px;
  23. text-align: center;
  24. color: #fff;
  25. background: #3385ff;
  26. }
  27. </style>
  28. <div class="LM-container">
  29. <div class="LM-main">
  30. <fieldset class="layui-elem-field layui-field-title">
  31. <legend>求购订单列表</legend>
  32. <blockquote class="layui-elem-quote">
  33. <div class="LM-table">
  34. <div class="layui-inline">
  35. <input type="text" id='name' name="name" lay-verify="required" placeholder="搜索关键字" autocomplete="off" class="layui-input">
  36. </div>
  37. <a href="javascript:;" class="layui-btn data-add-btn layui-btn-sm" lay-submit="" lay-filter="add"
  38. id="search">
  39. {:lang('search')}
  40. </a>
  41. </div>
  42. </blockquote>
  43. </fieldset>
  44. <table class="layui-table" id="list" lay-filter="list">
  45. </table>
  46. </div>
  47. </div>
  48. <script type="text/html" id="barDemo">
  49. <!-- <input type="button" class="layui-btn layui-btn-xs" lay-event="del" value="删除">-->
  50. <input type="button" class="layui-btn layui-btn-xs" lay-event="jiaoyi" value="匹配交易">
  51. <a href="{:url('personl')}?hre=buy&id={{d.buy_user}}" class="layui-btn layui-btn-xs" >购买用户信息</a>
  52. <!--<a href="addhlep?id={{d.id}}" class="layui-btn layui-btn-xs" >编辑</a>-->
  53. </script>
  54. {include file="common/footer"/}
  55. <div class="layui-form-item lianl" style="display: none" >
  56. <label class="layui-form-label">后台账号</label>
  57. <div class="layui-input-block">
  58. <select name="adminid" id="adminid" lay-verify="required">
  59. {volist name="$data" id="vs"}
  60. <option value="{$vs.id}">{$vs.name}</option>
  61. {/volist}
  62. </select>
  63. </div>
  64. <div class="layui-form-mid layui-word-aux">
  65. </div>
  66. </div>
  67. <script src="/static/plugins/jquery-3.4.1/jquery-3.4.1.min.js"></script>
  68. <script>
  69. layui.use(['form', 'table',"layer"], function () {
  70. var $ = layui.jquery,
  71. form = layui.form,
  72. layer = layui.layer,
  73. table = layui.table;
  74. var tableIn = table.render({
  75. elem: '#list',
  76. url: '{:url("buy")}',
  77. method: 'post',
  78. title: '反馈意见',
  79. loading: true,
  80. toolbar: '#toolbar', //开启头部工具栏,并为其绑定左侧模板
  81. defaultToolbar: ['filter', 'exports', 'print', "excel", { //自定义头部工具栏右侧图标。如无需自定义,去除该参数即可
  82. title: '提示'
  83. , layEvent: 'LAYTABLE_TIPS'
  84. , icon: 'layui-icon-tips'
  85. }],
  86. cols: [[
  87. // {checkbox: true, fixed: true},
  88. {field: 'id', title: 'ID', width: 80, fixed: true, sort: true},
  89. {field: 'buy_user', title: '购买用户id', width: 120, sort: true},
  90. {field: 'user_name', title: '用户', width: 120, sort: true},
  91. {field: 'number', title: '发布数量', width: 120, sort: true},
  92. {field: 'enlarge_quota', title: '放大额度', width: 120, sort: true},
  93. {field: 'order', title: '订单编号', width: 120, sort: true},
  94. {field: 'add_time', title: '添加时间', width: 120, sort: true},
  95. {field: 'status', title: '订单状态', width: 120, sort: true},
  96. {title: '操作', width: 300, align: "center", toolbar: "#barDemo"},
  97. ]],
  98. limits: [10, 15, 20, 25, 50, 100],
  99. limit: 10,
  100. page: true
  101. });
  102. table.on('tool(list)', function (obj) {
  103. var data = obj.data;
  104. let event = obj.event;
  105. switch (event) {
  106. case "jiaoyi":
  107. layer.open({
  108. type: 1,
  109. shade: false,
  110. title: "请选择后台账号",
  111. content: $('.lianl'),
  112. area:["400px","200px"],
  113. btn:["确定","取消"],
  114. yes:function(index,layero){
  115. layer.close(index);
  116. let adminid=$("#adminid").val()
  117. let datas={
  118. order_id:data.id,
  119. user_id:adminid
  120. }
  121. loading = layer.load(1, {shade: [0.1, '#fff']});
  122. $.post("{:url('matching')}", datas, function (res) {
  123. layer.close(loading);
  124. if (res.code ==200) {
  125. layer.msg(res.msg, {time: 1000, icon: 1});
  126. tableIn.reload();
  127. } else {
  128. layer.msg(res.msg, {time: 1000, icon: 2});
  129. }
  130. }, "json")
  131. },
  132. cancel: function(){
  133. // layer.msg('捕获就是从页面已经存在的元素上,包裹layer的结构', {time: 5000, icon:6});
  134. }
  135. });
  136. // layer.confirm('确定要进行这样的操作码', function (index) {
  137. // loading = layer.load(1, {shade: [0.1, '#fff']});
  138. // $.post("{:url('status')}", {id: data.id}, function (res) {
  139. // layer.close(loading);
  140. // layer.close(index);
  141. // if (res.code == 1) {
  142. // layer.msg(res.msg, {time: 1000, icon: 1});
  143. // tableIn.reload();
  144. // } else {
  145. // layer.msg(res.msg, {time: 1000, icon: 2});
  146. // }
  147. // }, "json")
  148. // })
  149. break;
  150. }
  151. });
  152. form.on('switch(status)', function (data) {
  153. });
  154. $('#search').click(function () {
  155. // let user_ids=$("#user_ids").val()
  156. // let user_name=$("#user_name").val()
  157. // let user_phone=$("#user_phone").val()
  158. // let user_order=$("#user_order").val()
  159. // if (!user_ids||!user_name||!user_phone||!user_order){
  160. // return layer.msg('请输入关键词');
  161. // }
  162. let name=$("#name").val()
  163. if (!name){
  164. return layer.msg('请输入关键词');
  165. }
  166. let data={
  167. name:name
  168. // user_ids:user_ids,
  169. // user_name:user_name,
  170. // user_phone:user_phone,
  171. // user_order:user_order,
  172. }
  173. tableIn.reload({page: {page: 1}, where:data});
  174. })
  175. // setInterval(function () {
  176. // tableIn.reload();
  177. // }, 50000)
  178. });
  179. </script>