groupBuyingCx.ftl 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <#assign title="团购"/>
  2. <#include "/home/frag.head.ftl" />
  3. <div class="page__bd">
  4. <div class="weui-tab">
  5. <#-- <header class="demos-header">-->
  6. <#-- <h1 class="demos-title">团购</h1>-->
  7. <#-- </header>-->
  8. <div class="weui-btn-area" style="display: flex; flex-direction: row;">
  9. <a class="weui-btn weui-btn_primary" href="javascript:goback();" style="width: 25vw; height: 6vh; line-height: 6vh;">返回</a>
  10. <div style="width: 65%;"></div>
  11. </div>
  12. <div class="weui-loadmore weui-loadmore_line" style="width: 100%">
  13. <span class="weui-loadmore__tips">团购信息</span>
  14. <div class="weui-media-box__bd">
  15. <h3>${ tgItem.tgTitle }</h3>
  16. </div>
  17. </div>
  18. <div>
  19. <p style="text-indent: -0em;margin-left: 2em;">供应商:&nbsp;&nbsp;${ tgItem.tgSupplier }</p>
  20. <div style="height: 1vh;"></div>
  21. <p style="text-indent: -0em;margin-left: 2em;">套&nbsp;&nbsp;&nbsp;&nbsp;餐:&nbsp;&nbsp;${ tgItem.tgGoods }</p>
  22. <div style="height: 1vh;"></div>
  23. <p style="text-indent: -0em;margin-left: 2em;">单&nbsp;&nbsp;&nbsp;&nbsp;价:&nbsp;&nbsp;${ tgItem.tgPrice }</p>
  24. <div style="height: 1vh;"></div>
  25. <p id="cx_p_tgMinNum" style="text-indent: -0em;margin-left: 2em;">最低起送(份):&nbsp;&nbsp;</p>
  26. <div style="height: 1vh;"></div>
  27. <p id="cx_p_tgMaxNum" style="text-indent: -0em;margin-left: 2em;">最大订量(份):&nbsp;&nbsp;</p>
  28. <div style="height: 1vh;"></div>
  29. <p id="cx_p_tgItemNum" style="text-indent: -0em;margin-left: 2em;">个人限额(份):&nbsp;&nbsp;</p>
  30. <div id="cx_showView">
  31. <div style="height: 1vh;"></div>
  32. <p id="cx_p_endTime" style="text-indent: -0em;margin-left: 2em;">截止时间:&nbsp;&nbsp;</p>
  33. <div style="height: 1vh;"></div>
  34. <p id="cx_p_deliverTime"style="text-indent: -0em;margin-left: 2em;">预计送货时间:&nbsp;&nbsp;</p>
  35. </div>
  36. <div id="cx_modifyView">
  37. <div style="height: 1vh;"></div>
  38. <p class="weui-media-box__desc" style="text-indent: -0em;margin-left: 2em;">截止时间:</p>
  39. <input id="cx_tg_input_end_time" type="text" placeholder="请选择时间" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;text-indent: -0em;margin-left: 2em;"/>
  40. <div style="height: 1vh;"></div>
  41. <p class="weui-media-box__desc" style="text-indent: -0em;margin-left: 2em;">预计送货时间:</p>
  42. <input id="cx_tg_input_deliver_time" type="text" placeholder="请选择时间" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;text-indent: -0em;margin-left: 2em;"/>
  43. </div>
  44. <div style="height: 1vh;"></div>
  45. <p style="text-indent: -0em;margin-left: 2em;">服务电话:&nbsp;&nbsp;${ tgItem.tgPhoneNumber }</p>
  46. </div>
  47. <div class="weui-loadmore weui-loadmore_line" style="width: 100%">
  48. <br/>
  49. <textarea id="cx_remark" class="weui-input" autofocus="" type="text" placeholder="填写撤销原因或增补修订的内容" maxlength="200" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 20vh; width: 85%;"></textarea>
  50. </div>
  51. <div class="weui-btn-area" style="display: grid;">
  52. <a id="cx_sure" class="weui-btn weui-btn_primary">确&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;定</a>
  53. </div>
  54. </div>
  55. </div>
  56. <#include "/home/frag.foot.ftl" />
  57. <script>
  58. var userId = ${userId};
  59. var tgItem = ${tgItemJson};
  60. var operation = ${operation};
  61. if (operation === 'remark') {
  62. $('#cx_showView').hide();
  63. $('#cx_modifyView').show();
  64. $('#cx_tg_input_end_time').val(tgItem.tgEndTime);
  65. $('#cx_tg_input_deliver_time').val(tgItem.tgDeliverTime);
  66. $("#cx_tg_input_end_time").datetimePicker();
  67. $("#cx_tg_input_deliver_time").datetimePicker();
  68. }
  69. if (operation === 'cancel') {
  70. $('#cx_showView').show();
  71. $('#cx_modifyView').hide();
  72. $('#cx_p_endTime').append(tgItem.tgEndTime);
  73. $('#cx_p_deliverTime').append(tgItem.tgDeliverTime);
  74. }
  75. if (tgItem.tgMinNum != 0) {
  76. $('#cx_p_tgMinNum').append(tgItem.tgMinNum);
  77. }
  78. if (tgItem.tgMaxNum != 0) {
  79. $('#cx_p_tgMaxNum').append(tgItem.tgMaxNum);
  80. }
  81. if (tgItem.tgItemNum != 0) {
  82. $('#cx_p_tgItemNum').append(tgItem.tgItemNum);
  83. }
  84. if (tgItem.remark.length > 0) {
  85. $('#cx_remark').val(tgItem.remark);
  86. }
  87. $('#cx_sure').on('click', function () {
  88. console.log("确定");
  89. let inputValue = $('#cx_remark').val();
  90. if (inputValue.length <= 0){
  91. $.alert('请输入内容');
  92. return;
  93. }
  94. let sendData = {
  95. jmId: tgItem.jmId,
  96. remark: inputValue,
  97. endTime: $('#cx_tg_input_end_time').val(),
  98. deliverTime: $('#cx_tg_input_deliver_time').val()
  99. };
  100. if (operation === 'cancel') {
  101. sendData.status = 4;
  102. }
  103. $.ajax({
  104. url: '/yeweihui/groupBuyingCx/remark/add.json',
  105. type: 'post',
  106. data: sendData,
  107. success: function (data) {
  108. if (data.success) {
  109. $.alert("操作成功");
  110. window.location.href = "/yeweihui/groupBuyingXx.html?jmId=" + tgItem.jmId + "&userId=" + userId;
  111. }
  112. else {
  113. $.alert("操作失败");
  114. }
  115. },
  116. error: function () {
  117. $.alert("网络异常");
  118. }
  119. });
  120. });
  121. function goback() {
  122. window.location.href = "/yeweihui/groupBuyingXx.html?jmId=" + tgItem.jmId + "&userId=" + userId;
  123. }
  124. </script>