merchantMealAdd.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572
  1. <html xmlns:th="http://www.thymeleaf.org">
  2. <head>
  3. <title>私塾家</title>
  4. <script th:include="sys/common/metaCSS" th:remove="tag"></script>
  5. <script th:include="sys/common/metaJS" th:remove="tag"></script>
  6. <script src="sys/js/My97DatePicker/WdatePicker.js" th:src="@{/static/sys/js/My97DatePicker/WdatePicker.js}"></script>
  7. </head>
  8. <style>
  9. .tablelink{margin-right:10px;}
  10. .stylecss{
  11. color: red;
  12. }
  13. .select_width{
  14. width: 220px;
  15. }
  16. .date_width{
  17. width: 150px;
  18. }
  19. .tablelist th,td{
  20. white-space: nowrap;
  21. text-overflow: ellipsis;
  22. overflow: hidden;
  23. }
  24. #mealServiceAdd .zwfb_shop_table {
  25. margin-top: 10px
  26. }
  27. #mealServiceAdd tbody {
  28. display: table-row-group;
  29. vertical-align: middle;
  30. border-color: inherit;
  31. }
  32. #mealServiceAdd .fwmc_xxk {
  33. overflow: hidden;
  34. margin-left: 20px;
  35. }
  36. #mealServiceAdd .fwmc_xxk li {
  37. float: left;
  38. width: 150px;
  39. height: 52px;
  40. border: 1px solid #ddd;
  41. font-size: 18px;
  42. color: #666;
  43. margin-right: 30px;
  44. text-align: center;
  45. margin-bottom: 10px;
  46. overflow: hidden;
  47. cursor: pointer;
  48. }
  49. #mealServiceAdd .fwmc_xxk li p {
  50. line-height: 18px;
  51. font-size: 12px;
  52. color: #999;
  53. margin-top: 5px;
  54. }
  55. #mealServiceAdd .zwsl_num {
  56. margin-left: 20px;
  57. font-size: 16px;
  58. color: #333;
  59. }
  60. #mealServiceAdd .zwsl_num span {
  61. color: #999;
  62. font-size: 12px;
  63. padding-left: 10px;
  64. }
  65. #mealServiceAdd .nmb_jj {
  66. overflow: hidden;
  67. margin-left: 20px;
  68. }
  69. #mealServiceAdd .nmb_jj li.jian {
  70. border-right: none;
  71. cursor: pointer;
  72. color: #999;
  73. width: 30px;
  74. padding: 0;
  75. }
  76. #mealServiceAdd .nmb_jj li {
  77. float: left;
  78. text-align: center;
  79. line-height: 30px;
  80. border: 1px solid #ddd;
  81. font-size: 20px;
  82. padding: 0 8px;
  83. }
  84. #mealServiceAdd .nmb_jj li .srkk {
  85. width: 30px;
  86. font-size: 16px;
  87. border: none;
  88. line-height: 30px;
  89. text-align: center;
  90. outline: 0;
  91. background: #FFF;
  92. }
  93. #mealServiceAdd .nmb_jj li.jia {
  94. border-left: none;
  95. cursor: pointer;
  96. color: #999;
  97. width: 30px;
  98. padding: 0;
  99. }
  100. #mealServiceAdd a.ty_but {
  101. width: 130px;
  102. height: 40px;
  103. line-height: 40px;
  104. text-align: center;
  105. display: block;
  106. font-size: 16px;
  107. color: #fff;
  108. border-radius: 3px;
  109. background: #169ed8;
  110. }
  111. #mealServiceAdd a.ty_but:hover {
  112. background: #1187ba;
  113. }
  114. #mealServiceAdd .fwmc_xxk li.sign_type_select_on {
  115. background: url(/static/sys/images/fwkk.jpg) no-repeat center;
  116. color: #169ed8;
  117. border: 1px solid #169ed8;
  118. }
  119. #libServiceAdd .zwfb_shop_table {
  120. margin-top: 10px
  121. }
  122. #libServiceAdd tbody {
  123. display: table-row-group;
  124. vertical-align: middle;
  125. border-color: inherit;
  126. }
  127. #libServiceAdd .fwmc_xxk {
  128. overflow: hidden;
  129. margin-left: 20px;
  130. }
  131. #libServiceAdd .fwmc_xxk li {
  132. float: left;
  133. width: 150px;
  134. height: 52px;
  135. border: 1px solid #ddd;
  136. font-size: 18px;
  137. color: #666;
  138. margin-right: 30px;
  139. text-align: center;
  140. margin-bottom: 25px;
  141. overflow: hidden;
  142. cursor: pointer;
  143. }
  144. #libServiceAdd .fwmc_xxk li p {
  145. line-height: 18px;
  146. font-size: 12px;
  147. color: #999;
  148. margin-top: 5px;
  149. }
  150. #libServiceAdd .zwsl_num {
  151. margin-left: 20px;
  152. font-size: 16px;
  153. color: #333;
  154. }
  155. #libServiceAdd .zwsl_num span {
  156. color: #999;
  157. font-size: 12px;
  158. padding-left: 10px;
  159. }
  160. #libServiceAdd .nmb_jj {
  161. overflow: hidden;
  162. margin-left: 20px;
  163. }
  164. #libServiceAdd .nmb_jj li.jian {
  165. border-right: none;
  166. cursor: pointer;
  167. color: #999;
  168. width: 30px;
  169. padding: 0;
  170. }
  171. #libServiceAdd .nmb_jj li {
  172. float: left;
  173. text-align: center;
  174. line-height: 30px;
  175. border: 1px solid #ddd;
  176. font-size: 20px;
  177. padding: 0 8px;
  178. }
  179. #libServiceAdd .nmb_jj li .srkk {
  180. width: 30px;
  181. font-size: 16px;
  182. border: none;
  183. line-height: 30px;
  184. text-align: center;
  185. outline: 0;
  186. background: #FFF;
  187. }
  188. #libServiceAdd .nmb_jj li.jia {
  189. border-left: none;
  190. cursor: pointer;
  191. color: #999;
  192. width: 30px;
  193. padding: 0;
  194. }
  195. #libServiceAdd a.ty_but {
  196. width: 130px;
  197. height: 40px;
  198. line-height: 40px;
  199. text-align: center;
  200. display: block;
  201. font-size: 16px;
  202. color: #fff;
  203. border-radius: 3px;
  204. background: #169ed8;
  205. }
  206. #libServiceAdd a.ty_but:hover {
  207. background: #1187ba;
  208. }
  209. #libServiceAdd .fwmc_xxk li.sign_type_select_on {
  210. background: url(/static/sys/images/fwkk.jpg) no-repeat center;
  211. color: #169ed8;
  212. border: 1px solid #169ed8;
  213. }
  214. </style>
  215. <body style="min-width: 100%;">
  216. <div class="rightinfo">
  217. <div class="formbody" id="libServiceAdd" >
  218. <input type="hidden" id="id" th:value="${merchant.id}" >
  219. <table border="0" cellspacing="0" cellpadding="0" class="zwfb_shop_table">
  220. <tbody>
  221. <tr valign="top">
  222. <td align="right" width="70" style="line-height: 50px;font-weight: 700">购买服务包:</td>
  223. <td style="width: 50px;">
  224. <ul class="fwmc_xxk">
  225. <li th:class="sign_type_select" data-type="1" data-lib_service="30" data-unit_price="800" >
  226. <p>服务包1</p>
  227. 30人<i>/1月</i>
  228. </li>
  229. </ul>
  230. </td>
  231. <td style="width: 50px;">
  232. <ul class="fwmc_xxk">
  233. <li th:class="sign_type_select" data-type="2" data-lib_service="50" data-unit_price="1200" >
  234. <p>服务包2</p>
  235. 50人<i>/1月</i>
  236. </li>
  237. </ul>
  238. </td>
  239. <td style="width: 50px;">
  240. <ul class="fwmc_xxk">
  241. <li th:class="sign_type_select" data-type="3" data-lib_service="100" data-unit_price="2000" >
  242. <p>服务包3</p>
  243. 100人<i>/1月</i>
  244. </li>
  245. </ul>
  246. </td>
  247. </tr>
  248. <tr valign="top">
  249. <td align="right" width="70" style="line-height: 50px;font-weight: 700"></td>
  250. <td style="width: 50px;">
  251. <ul class="fwmc_xxk">
  252. <li th:class="sign_type_select" data-type="4" data-lib_service="20" data-unit_price="400" >
  253. <p>服务包4</p>
  254. 20人<i>/1月</i>
  255. </li>
  256. </ul>
  257. </td>
  258. <td style="width: 50px;">
  259. <ul class="fwmc_xxk">
  260. <li th:class="sign_type_select" data-type="5" th:data-lib_service="0" data-unit_price="0" >
  261. <p>服务包5</p>
  262. 自定义<i>/1月</i>
  263. </li>
  264. </ul>
  265. </td>
  266. </tr>
  267. <tr id="lib_service_tr" valign="top">
  268. <td align="right" width="70" style="line-height: 30px;font-weight: 700">服务人数量:</td>
  269. <td>
  270. <ul class="nmb_jj">
  271. <li class="jian" id="1_reduce_num">-</li>
  272. <li>
  273. <input name="" id="1_service_num" type="text" value="0" class="srkk" style="width: 50px;">
  274. </li>
  275. <li class="jia" id="1_add_num">+</li>
  276. </ul>
  277. </td>
  278. </tr>
  279. <tr >
  280. <td height="20"></td>
  281. <td></td>
  282. </tr>
  283. <tr valign="top" th:if="${startActiveTime!=null}">
  284. <td align="right" width="70" style="line-height: 30px;font-weight: 700">合同激活日期:</td>
  285. <td>
  286. <ul class="nmb_jj">
  287. <li style="position: absolute;">
  288. <input type="text" style="width: 120px;" class="srkk" id="startActiveTime" name="startActiveTime" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',autoPickDate:true})" autocomplete="off" th:value="${#dates.format(startActiveTime, 'yyyy-MM-dd')}" placeholder="合同开始激活日期">
  289. ~
  290. <input type="text" style="width: 120px;" class="srkk" id="activeTime" name="activeTime" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',autoPickDate:true})" autocomplete="off" th:value="${#dates.format(startActiveTime, 'yyyy-MM-dd')}" placeholder="合同开始激活日期">
  291. </li>
  292. </ul>
  293. </td>
  294. </tr>
  295. <tr th:if="${startActiveTime!=null}">
  296. <td height="20"></td>
  297. <td></td>
  298. </tr>
  299. <tr valign="top" th:if="${activeTime!=null}">
  300. <td align="right" width="70" style="line-height: 30px;font-weight: 700">合同激活日期:</td>
  301. <td>
  302. <ul class="nmb_jj">
  303. <li style="position: absolute;">
  304. <input type="text" style="width: 120px;" class="srkk" id="activeTime" name="activeTime" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',autoPickDate:true})" autocomplete="off" th:value="${#dates.format(activeTime, 'yyyy-MM-dd')}" placeholder="合同开始激活日期">
  305. </li>
  306. </ul>
  307. </td>
  308. </tr>
  309. <tr th:if="${activeTime!=null}">
  310. <td height="20"></td>
  311. <td></td>
  312. </tr>
  313. <tr valign="top">
  314. <td align="right" width="70" style="line-height: 30px;font-weight: 700">购买月数量:</td>
  315. <td>
  316. <ul class="nmb_jj">
  317. <li class="jian" id="2_reduce_num">-</li>
  318. <li>
  319. <input name="" id="2_service_num" type="text" value="1" class="srkk" style="width: 50px;">
  320. </li>
  321. <li class="jia" id="2_add_num">+</li>
  322. </ul>
  323. </td>
  324. </tr>
  325. <tr>
  326. <td height="20"></td>
  327. <td></td>
  328. </tr>
  329. <tr valign="top">
  330. <td align="right" width="70" style="line-height: 30px;font-weight: 700">赠送月数量:</td>
  331. <td>
  332. <ul class="nmb_jj">
  333. <li class="jian" id="3_reduce_num">-</li>
  334. <li>
  335. <input name="" id="3_service_num" type="text" value="0" class="srkk" style="width: 50px;">
  336. </li>
  337. <li class="jia" id="3_add_num">+</li>
  338. </ul>
  339. </td>
  340. </tr>
  341. <tr>
  342. <td height="20"></td>
  343. <td></td>
  344. </tr>
  345. <tr valign="top">
  346. <td align="right" width="70" style="line-height: 30px;font-weight: 700">月单价(成本):</td>
  347. <td>
  348. <ul class="nmb_jj">
  349. <li>
  350. <input name="unitPrice" id="unitPrice" type="text" value="0" class="srkk" style="width: 95px;"><i></i>
  351. </li>
  352. </ul>
  353. </td>
  354. </tr>
  355. <tr>
  356. <td height="20"></td>
  357. <td></td>
  358. </tr>
  359. <tr valign="top">
  360. <td align="right" width="70" style="line-height: 30px;font-weight: 700">总价(收入):</td>
  361. <td>
  362. <ul class="nmb_jj">
  363. <li>
  364. <input name="price" id="price" type="text" value="0" class="srkk" style="width: 95px;"><i></i>
  365. </li>
  366. </ul>
  367. </td>
  368. </tr>
  369. <tr>
  370. <td height="20"></td>
  371. <td></td>
  372. </tr>
  373. <tr>
  374. <td></td>
  375. <td><a style="margin-left: 20px;" class="ty_but ml20" href="javascript:#" onclick="save();">购 买</a></td>
  376. </tr>
  377. </tbody>
  378. </table>
  379. </div>
  380. <br/>
  381. <br/>
  382. <table class="tablelist">
  383. <thead>
  384. <tr>
  385. <th >订单号</th>
  386. <th >服务包类型</th>
  387. <th >服务包人数</th>
  388. <th >开始激活日期</th>
  389. <th >结束激活日期</th>
  390. <th >购买月份</th>
  391. <th >赠送月份 </th>
  392. <th >月单价(成本)</th>
  393. <th >服务包总价(收入)</th>
  394. <th >购买时间</th>
  395. </tr>
  396. </thead>
  397. <tbody>
  398. <tr th:each="item:${list}" >
  399. <td th:text="${item.id}"></td>
  400. <td th:switch="${item.signType}">
  401. <span th:case="1" >服务包1</span>
  402. <span th:case="2" >服务包2</span>
  403. <span th:case="3" >服务包3</span>
  404. <span th:case="4" >服务包4</span>
  405. <span th:case="5" >服务包5</span>
  406. </td>
  407. <td th:text="${item.libService}"></td>
  408. <td th:text="${item.startActiveTime!=null ? #calendars.format(item.startActiveTime,'yyyy-MM-dd') : ''}"></td>
  409. <td th:text="${item.activeTime!=null ? #calendars.format(item.activeTime,'yyyy-MM-dd') : ''}"></td>
  410. <td th:text="${item.buyMonth}"></td>
  411. <td th:text="${item.giveMonth}"></td>
  412. <td th:text="${item.unitPrice}"></td>
  413. <td th:text="${item.price}"></td>
  414. <td th:text="${item.createTime}"></td>
  415. </tr>
  416. </tbody>
  417. </table>
  418. <br/>
  419. <br/>
  420. </body>
  421. <script type="text/javascript">
  422. $(function () {
  423. $(".sign_type_select").click(function (){
  424. $(".sign_type_select").removeClass("sign_type_select_on");
  425. $(this).addClass("sign_type_select_on");
  426. var sign_type=$(this).data("type");
  427. $("#1_service_num").val($(this).data("lib_service"));
  428. $("#unitPrice").val($(this).data("unit_price"));
  429. // if(sign_type>=5){
  430. // $("#lib_service_tr").show();
  431. // }else{
  432. // $("#lib_service_tr").hide();
  433. // }
  434. });
  435. $("#1_reduce_num").click(function (){
  436. if($("#1_service_num").val()<=0){
  437. parent.layer.msg("服务人数量不能小于1喔",{icon:11});
  438. $("#2_service_num").val(0);
  439. return;
  440. }
  441. $("#1_service_num").val(parseInt($("#1_service_num").val())-1);
  442. });
  443. $("#1_add_num").click(function (){
  444. $("#1_service_num").val(parseInt($("#1_service_num").val())+1);
  445. });
  446. $("#2_reduce_num").click(function (){
  447. if($("#2_service_num").val()<=1){
  448. parent.layer.msg("购买月数量不能小于1喔",{icon:11});
  449. $("#2_service_num").val(1);
  450. return;
  451. }
  452. $("#2_service_num").val(parseInt($("#2_service_num").val())-1);
  453. });
  454. $("#2_add_num").click(function (){
  455. $("#2_service_num").val(parseInt($("#2_service_num").val())+1);
  456. });
  457. $("#3_reduce_num").click(function (){
  458. if($("#3_service_num").val()<=0){
  459. parent.layer.msg("赠送月数量不能小于0",{icon:11});
  460. $("#3_service_num").val(0);
  461. return;
  462. }
  463. $("#3_service_num").val(parseInt($("#3_service_num").val())-1);
  464. });
  465. $("#3_add_num").click(function (){
  466. $("#3_service_num").val(parseInt($("#3_service_num").val())+1);
  467. });
  468. })
  469. var islock=false;
  470. function save(){
  471. if(islock){
  472. parent.layer.msg("正在下单中,请勿重复提交...",{icon:2});
  473. }
  474. if($(".sign_type_select_on").data("type")==undefined){
  475. parent.layer.msg("请选择购买的服务包",{icon:11});
  476. return;
  477. }
  478. parent.layer.confirm("确定为此商户购买服务包?", {
  479. icon: 4, btn: ['确定','关闭'],offset: '100px' //按钮
  480. }, function(){
  481. islock=true;
  482. var id=$("#id").val();
  483. var signType=$(".sign_type_select_on").data("type");
  484. var libService=$("#1_service_num").val();
  485. var buyMonth=$("#2_service_num").val();
  486. var giveMonth=$("#3_service_num").val();
  487. var startActiveTime=$("#startActiveTime").val();
  488. var activeTime=$("#activeTime").val();
  489. var price=$("#price").val();
  490. var unitPrice=$("#unitPrice").val();
  491. var url="[[${sysUrl}]]/sys/fx/saveMerchantMeal";
  492. var params ={
  493. 'id' : id,
  494. 'signType':signType,
  495. 'libService':libService,
  496. 'buyMonth':buyMonth,
  497. 'giveMonth':giveMonth,
  498. 'unitPrice':unitPrice,
  499. 'price':price,
  500. 'startActiveTime':startActiveTime,
  501. 'activeTime':activeTime
  502. };
  503. $.post(url,params,function(data){
  504. if(data.meta.success){
  505. parent.layer.msg("购买成功",{icon:1});
  506. parent.location.reload();
  507. parent.layer.close(parent.layer.getFrameIndex(window.name));
  508. islock=false;
  509. }else{
  510. parent.layer.msg(data.meta.message,{icon:11});
  511. islock=false;
  512. }
  513. });
  514. });
  515. }
  516. </script>
  517. </html>