verify.html 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  1. {extend name="base"/}
  2. {block name="resources"}
  3. <style>
  4. .screen{margin-bottom: 15px;}
  5. .contraction span {
  6. cursor: pointer;
  7. display: inline-block;
  8. width: 17px;
  9. height: 17px;
  10. text-align: center;
  11. line-height: 14px;
  12. user-select: none;
  13. }
  14. .verify-list {
  15. overflow: hidden;
  16. padding: 0 45px;
  17. }
  18. .verify-list li .img-wrap {
  19. vertical-align: middle;
  20. margin-right: 8px;
  21. width: 80px;
  22. height: 80px;
  23. text-align: center;
  24. border: 1px solid #e2e2e2;
  25. }
  26. .verify-list li .img-wrap img {
  27. max-width: 100%;
  28. max-height: 100%;
  29. }
  30. .verify-list li .info-wrap{
  31. flex: 1;
  32. display: flex;
  33. flex-direction: column;
  34. }
  35. .verify-list li .name-wrap{
  36. flex: 1;
  37. }
  38. .verify-list li .info-wrap span.sku-name {
  39. -webkit-line-clamp: 2;
  40. margin-bottom: 5px;
  41. line-height: 1.3;
  42. margin-top: 0;
  43. color: #333;
  44. font-size: 14px;
  45. }
  46. .verify-list li .info-wrap span {
  47. display: -webkit-box;
  48. margin-top: 5px;
  49. overflow: hidden;
  50. text-overflow: ellipsis;
  51. white-space: normal;
  52. word-break: break-all;
  53. -webkit-box-orient: vertical;
  54. -webkit-line-clamp: 1;
  55. line-height: 1;
  56. font-size: 12px;
  57. }
  58. .verify-list li {
  59. float: left;
  60. display: flex;
  61. padding: 10px;
  62. margin-right: 10px;
  63. margin-bottom: 10px;
  64. border: 1px solid #EFEFEF;
  65. width: 294px;
  66. align-items: center;
  67. }
  68. .table-title .title-content p{overflow: hidden;text-overflow:ellipsis;white-space: nowrap;}
  69. .goods-box{
  70. display: flex;
  71. padding: 10px;
  72. justify-content: space-between;
  73. margin-bottom: 20px;
  74. }
  75. .goods-box .goods-info{
  76. width: 340px;
  77. }
  78. .goods-box .goods-info .goods-name{
  79. text-overflow: ellipsis;
  80. display: -webkit-box;
  81. -webkit-line-clamp: 2;
  82. -webkit-box-orient: vertical;
  83. display: -moz-box;
  84. -moz-line-clamp: 2;
  85. -moz-box-orient: vertical;
  86. overflow-wrap: break-word;
  87. word-break: break-all;
  88. white-space: normal;
  89. overflow: hidden;
  90. height: 38px;
  91. }
  92. .goods-box .goods-info .goods-desc{
  93. margin-top: 5px;
  94. }
  95. .goods-box .goods-img{
  96. margin-right: 15px;
  97. display: flex;
  98. align-items: center;
  99. }
  100. .goods-box .goods-img img{
  101. width: 80px;
  102. max-height: 80px;
  103. }
  104. .goods-box .box-left{
  105. display: flex;
  106. }
  107. .goods-box .box-right{
  108. display: flex;
  109. align-items: center;
  110. }
  111. .stat-box{
  112. display: flex;
  113. justify-content: space-around;
  114. height: 100px;
  115. align-items: center;
  116. background: #f7f7f7;
  117. margin-bottom: 10px;
  118. }
  119. .stat-box .stat-item .stat-val{
  120. margin-top: 10px;
  121. font-size: 20px;
  122. font-weight: bold;
  123. }
  124. .user-detail{
  125. cursor: pointer;
  126. }
  127. .table-title .title-content{
  128. overflow: unset;
  129. }
  130. </style>
  131. {/block}
  132. {block name="main"}
  133. <!--商品信息-->
  134. <div class="goods-box">
  135. <div class="box-left">
  136. <div class="goods-img">
  137. <img src="{:img(explode(',', $goods_info['goods_image'])[0])}">
  138. </div>
  139. <div class="goods-info">
  140. <div class="goods-name">{$goods_info['goods_name']}</div>
  141. <div class="goods-price">价格:{$goods_info['price']}</div>
  142. <div class="goods-desc">库存:{$goods_info['goods_stock']}&nbsp;&nbsp;&nbsp;销量:{$goods_info['sale_num']}</div>
  143. </div>
  144. </div>
  145. <div class="box-right">
  146. <button class="layui-btn layui-btn-primary" onclick="window.location.href='{:url('shop/goods/lists')}'">返回</button>
  147. </div>
  148. </div>
  149. <div class="stat-box">
  150. <div class="stat-item">
  151. <div class="stat-txt">核销码总数(个)</div>
  152. <div class="stat-val">{$total_count}</div>
  153. </div>
  154. <div class="stat-item">
  155. <div class="stat-txt">已核销(次)</div>
  156. <div class="stat-val">{$verify_use_num}</div>
  157. </div>
  158. </div>
  159. <!-- 搜索框 -->
  160. <div class="screen layui-collapse" lay-filter="selection_panel">
  161. <div class="layui-colla-item">
  162. <form class="layui-colla-content layui-form layui-show">
  163. <div class="layui-form-item">
  164. <div class="layui-inline">
  165. <label class="layui-form-label">购买人:</label>
  166. <div class="layui-input-inline">
  167. <input type="text" name="nickname" placeholder="请输入购买人名称" autocomplete="off" class="layui-input">
  168. </div>
  169. </div>
  170. <div class="layui-inline">
  171. <label class="layui-form-label">核销码:</label>
  172. <div class="layui-input-inline">
  173. <input type="text" name="verify_code" placeholder="请输入核销码" autocomplete="off" class="layui-input">
  174. </div>
  175. </div>
  176. </div>
  177. <div class="form-row">
  178. <button class="layui-btn" lay-submit lay-filter="search">筛选</button>
  179. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  180. </div>
  181. </form>
  182. </div>
  183. </div>
  184. <!-- 列表 -->
  185. <table id="verify_list" lay-filter="verify_list"></table>
  186. <!-- 工具栏操作 -->
  187. <script type="text/html" id="operation">
  188. <div class="table-btn">
  189. <a class="layui-btn" lay-event="record">核销记录</a>
  190. </div>
  191. </script>
  192. <script type="text/html" id="userdetail">
  193. <div class='table-title user-detail' onclick="memberDetail({{d.member_id}})">
  194. <div class='title-pic'>
  195. <img layer-src src="{{ns.img(d.headimg)}}" onerror="this.src = '{:img('public/static/img/default_img/head.png')}' ">
  196. </div>
  197. <div class='title-content'>
  198. {{d.nickname}}
  199. </div>
  200. </div>
  201. </script>
  202. <script type="text/html" id="goodsDetail">
  203. <div class="table-title">
  204. <div class=" table-title">
  205. <div class="title-pic"><img src="{{ns.img(d.sku_image)}}"></div>
  206. <div class="title-content">
  207. <p title="{{ d.sku_name }}">{{ d.sku_name }}</p>
  208. </div>
  209. </div>
  210. </div>
  211. </script>
  212. {/block}
  213. {block name="script"}
  214. <script>
  215. var laytpl;
  216. $(function () {
  217. layui.use(['form', 'laydate','laytpl'], function () {
  218. laytpl = layui.laytpl;
  219. var table,
  220. form = layui.form,
  221. laydate = layui.laydate;
  222. form.render();
  223. //渲染时间
  224. laydate.render({
  225. elem: '#start_time',
  226. type: 'datetime'
  227. });
  228. laydate.render({
  229. elem: '#end_time',
  230. type: 'datetime'
  231. });
  232. /**
  233. * 加载表格
  234. */
  235. table = new Table({
  236. elem: '#verify_list',
  237. url: ns.url("shop/goods/verify"), //数据接口
  238. where: {goods_id:"{$goods_id}"},
  239. cols: [
  240. [{
  241. title: '商品信息',
  242. width: '20%',
  243. templet: '#goodsDetail'
  244. },{
  245. field: 'nickname',
  246. title: '买家信息',
  247. templet: '#userdetail'
  248. },{
  249. field: 'code',
  250. title: '核销码',
  251. },
  252. {
  253. field: 'order_no',
  254. title: '订单编号',
  255. templet: function (data) {
  256. return '<a href="'+ ns.url("shop/order/detail", {order_id:data.order_id}) +'" target="_blank">'+ data.order_no +'</a>';
  257. }
  258. },{
  259. field: '',
  260. title: '已核销/可核销',
  261. templet: function (data) {
  262. return data.verify_use_num + '/' + data.verify_total_count;
  263. }
  264. },
  265. {
  266. field: 'sold_time',
  267. title: '售出时间',
  268. width: '10%',
  269. templet: function (data) {
  270. return ns.time_to_date(data.sold_time)
  271. }
  272. }, {
  273. title: '操作',
  274. toolbar: '#operation',
  275. unresize: 'false',
  276. align : 'right'
  277. }]
  278. ]
  279. });
  280. /**
  281. * 监听工具栏操作
  282. */
  283. table.tool(function(obj) {
  284. var data = obj.data;
  285. switch (obj.event) {
  286. case 'record':
  287. window.open(ns.url("shop/verify/records?verify_code=" + data.code))
  288. break;
  289. }
  290. });
  291. /**
  292. * 搜索功能
  293. */
  294. form.on('submit(search)', function (data) {
  295. table.reload({
  296. page: {
  297. curr: 1
  298. },
  299. where: data.field
  300. });
  301. return false;
  302. });
  303. //批量导出
  304. form.on('submit(export_verify)', function (data) {
  305. location.href = ns.url("shop/verify/exportVerify", data.field);
  306. return false;
  307. });
  308. });
  309. })
  310. function memberDetail(member_id){
  311. window.open(ns.url("shop/member/editmember", {'member_id':member_id}))
  312. }
  313. </script>
  314. {/block}