groupBuyingCx.ftl 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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 style="text-indent: -0em;margin-left: 2em;">最低起送(份):&nbsp;&nbsp;${ tgItem.tgMinNum }</p>
  26. <div style="height: 1vh;"></div>
  27. <p style="text-indent: -0em;margin-left: 2em;">最大订量(份):&nbsp;&nbsp;${ tgItem.tgMaxNum }</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 style="height: 1vh;"></div>
  31. <p id="cx_p_endTime" style="text-indent: -0em;margin-left: 2em;">截止时间:&nbsp;&nbsp;</p>
  32. <div style="height: 1vh;"></div>
  33. <p id="cx_p_deliverTime"style="text-indent: -0em;margin-left: 2em;">预计送货时间:&nbsp;&nbsp;</p>
  34. <div style="height: 1vh;"></div>
  35. <p style="text-indent: -0em;margin-left: 2em;">服务电话:&nbsp;&nbsp;${ tgItem.tgPhoneNumber }</p>
  36. </div>
  37. <div class="weui-loadmore weui-loadmore_line" style="width: 100%">
  38. <br/>
  39. <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>
  40. </div>
  41. <div class="weui-btn-area" style="display: grid;">
  42. <a id="cx_sure" class="weui-btn weui-btn_primary">确&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;定</a>
  43. </div>
  44. </div>
  45. </div>
  46. <#include "/home/frag.foot.ftl" />
  47. <script>
  48. var userId = ${userId};
  49. var tgItem = ${tgItemJson};
  50. var operation = ${operation};
  51. $('#cx_p_endTime').append(tgItem.tgEndTime);
  52. $('#cx_p_deliverTime').append(tgItem.tgDeliverTime);
  53. if (tgItem.tgItemNum != 0) {
  54. $('#cx_p_tgItemNum').append(tgItem.tgItemNum);
  55. }
  56. if (tgItem.remark.length > 0) {
  57. $('#cx_remark').val(tgItem.remark);
  58. }
  59. $('#cx_sure').on('click', function () {
  60. console.log("确定");
  61. let inputValue = $('#cx_remark').val();
  62. if (inputValue.length <= 0){
  63. $.alert('请输入内容');
  64. return;
  65. }
  66. let sendData = {
  67. jmId: tgItem.jmId,
  68. remark: inputValue
  69. };
  70. if (operation === 'cancel') {
  71. sendData.status = 4;
  72. }
  73. $.ajax({
  74. url: '/yeweihui/groupBuyingCx/remark/add.json',
  75. type: 'post',
  76. data: sendData,
  77. success: function (data) {
  78. if (data.success) {
  79. $.alert("操作成功");
  80. window.location.href = "/yeweihui/groupBuyingXx.html?jmId=" + tgItem.jmId + "&userId=" + userId;
  81. }
  82. else {
  83. $.alert("操作失败");
  84. }
  85. },
  86. error: function () {
  87. $.alert("网络异常");
  88. }
  89. });
  90. });
  91. function goback() {
  92. window.location.href = "/yeweihui/groupBuyingXx.html?jmId=" + tgItem.jmId + "&userId=" + userId;
  93. }
  94. </script>