|
@@ -2,26 +2,29 @@
|
|
|
<div style="display:flex; flex-direction: row; justify-content: space-between">
|
|
|
<div class="weui-flex__item">
|
|
|
<div class="placeholder" style="display: inline;align-items: flex-start">当前参团:</div>
|
|
|
- <div style="display: inline;align-items: flex-start">107</div>
|
|
|
- </div>
|
|
|
- <div class="weui-flex__item" style="display:flex; flex-direction: row; justify-content: space-between">
|
|
|
- <div style="display: inline;align-items: flex-end">状态:</div>
|
|
|
- <div style="align-items: flex-end">在团</div>
|
|
|
+ <div style="display: inline;align-items: flex-start" id="Buycount"></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
+ <div class="weui-flex__item">
|
|
|
+ <div style="display: inline;align-items: flex-end">状 态:</div>
|
|
|
+ <div style="display: inline;" id="myStatus"></div>
|
|
|
+ </div>
|
|
|
+
|
|
|
<div class="weui-flex" style="display:flex; flex-direction: row; justify-content: space-between">
|
|
|
<div class="weui-flex__item">
|
|
|
<div style="display: inline;align-items: flex-start">我的团购:</div>
|
|
|
<div style="display: inline;">
|
|
|
<input type="text" id="buyCount"
|
|
|
style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh; width: 20%;"
|
|
|
- maxlength="3" onkeyup="this.value=this.value.replace(/[^0-9-]+/,'');">
|
|
|
+ maxlength="3" onkeyup="this.value=this.value.replace(/[^0-9-]+/,'');" min="1"
|
|
|
+ onchange="changeBuy()">
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="weui-flex__item" style="display:flex; flex-direction: row; justify-content: space-between">
|
|
|
- <div style="display: inline;align-items: flex-end">金额¥:</div>
|
|
|
- <div style="display: inline;align-items: flex-end" id="myMenory">金额钱啊</div>
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
+ <div class="weui-flex__item" >
|
|
|
+ <div style="display: inline;">金 额¥:</div>
|
|
|
+ <div style="display: inline;" id="myMenory"></div>
|
|
|
</div>
|
|
|
<div class="weui-flex">
|
|
|
<div class="weui-flex__item">
|
|
@@ -40,47 +43,74 @@
|
|
|
</div>
|
|
|
<div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh; margin-bottom: 5vh;">
|
|
|
<#if type==1>
|
|
|
- <a id="buyBack" onclick="buyBack()" href="javascript:;" class="weui-btn weui-btn_default"
|
|
|
- style="width: 30%;">返回</a>
|
|
|
+ <a id="buyBack" onclick="buyBack()" href="javascript:;" class="weui-btn weui-btn_default"
|
|
|
+ style="width: 30%;">返回</a>
|
|
|
<#else>
|
|
|
<a id="MybuyRepeal" onclick="MybuyBack()" href="javascript:;" class="weui-btn weui-btn_default"
|
|
|
style="width: 30%;">撤销</a>
|
|
|
</#if>
|
|
|
<a id="buyCommit" onclick="buyCommit()" href="javascript:;" class="weui-btn weui-btn_primary"
|
|
|
style="margin-top: 0;width: 30%;">提交</a>
|
|
|
+
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
<#include "/home/frag.foot.ftl" />
|
|
|
<script>
|
|
|
|
|
|
+
|
|
|
+ (function ($) {
|
|
|
+ $.ajax({
|
|
|
+ url: '/query/getAll/status',
|
|
|
+ data: {
|
|
|
+ jmId: $('#jmBuy').val(),
|
|
|
+ },
|
|
|
+ type: 'GET',
|
|
|
+ success: function (data) {
|
|
|
+ console.log(data);
|
|
|
+ $("#Buycount").html(data.data.count)
|
|
|
+ $("#myStatus").html(getStatus(data.data.tgStatus))
|
|
|
+ /* $("#myMenory").html(data.data.tgPrice)*/
|
|
|
+ },
|
|
|
+ error: function () {
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })(jQuery);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
<#--返回-->
|
|
|
function buyBack() {
|
|
|
window.location.href = "/user/homeIndex.html?userId=" + $('#buyuserId').val() + "&userType=" + 1 + '#tab3';
|
|
|
}
|
|
|
|
|
|
/*撤销*/
|
|
|
- /* function MybuyBack() {
|
|
|
- $.ajax({
|
|
|
- url: '/home/home/buyGroup',
|
|
|
- data: {
|
|
|
- userId: $('#buyuserId').val(),
|
|
|
- buyCount: $('#buyCount').val(),
|
|
|
- phone: $('#myPhone').val(),
|
|
|
- remark: $('#Myremarks').val(),
|
|
|
- buyMoney: $('#myMenory').text(),
|
|
|
- jmId: $('#jmBuy').val(),
|
|
|
- },
|
|
|
- type: 'GET',
|
|
|
- success: function (data) {
|
|
|
- console.log(data);
|
|
|
- buyBack();
|
|
|
- },
|
|
|
- error: function () {
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- }*/
|
|
|
+ function MybuyBack() {
|
|
|
+ $.ajax({
|
|
|
+ url: '/home/back/buyBack',
|
|
|
+ data: {
|
|
|
+ userId: $('#buyuserId').val(),
|
|
|
+ buyCount: $('#buyCount').val(),
|
|
|
+ phone: $('#myPhone').val(),
|
|
|
+ myRemark: $('#Myremarks').val(),
|
|
|
+ buyMoney: $('#myMenory').text(),
|
|
|
+ jmId: $('#jmBuy').val(),
|
|
|
+ },
|
|
|
+ type: 'GET',
|
|
|
+ success: function (data) {
|
|
|
+ console.log(data);
|
|
|
+ if (data.data == 1) {
|
|
|
+ buyBack();
|
|
|
+ } else {
|
|
|
+ $.alert("该套餐已过截止日期或者已发货中不允许撤单");
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ error: function () {
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
//提交
|
|
|
function buyCommit() {
|
|
@@ -92,23 +122,23 @@
|
|
|
$.alert("请填写联系电话");
|
|
|
return;
|
|
|
}
|
|
|
- if ($('#Myremarks').val() == undefined || $('#Myremarks').val() == '') {
|
|
|
- $.alert("请填写备注");
|
|
|
- return;
|
|
|
- }
|
|
|
+ /* if ($('#Myremarks').val() == undefined || $('#Myremarks').val() == '') {
|
|
|
+ $.alert("请填写备注");
|
|
|
+ return;
|
|
|
+ }*/
|
|
|
$.ajax({
|
|
|
url: '/home/home/buyGroup',
|
|
|
data: {
|
|
|
userId: $('#buyuserId').val(),
|
|
|
buyCount: $('#buyCount').val(),
|
|
|
phone: $('#myPhone').val(),
|
|
|
- remark: $('#Myremarks').val(),
|
|
|
+ myRemark: $('#Myremarks').val(),
|
|
|
buyMoney: $('#myMenory').text(),
|
|
|
jmId: $('#jmBuy').val(),
|
|
|
},
|
|
|
type: 'GET',
|
|
|
success: function (data) {
|
|
|
- console.log(data);
|
|
|
+ console.log(data.data);
|
|
|
buyBack();
|
|
|
},
|
|
|
error: function () {
|
|
@@ -116,64 +146,34 @@
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- (function ($) {
|
|
|
- /* $.ajax({
|
|
|
- url: '/home/querysj/buytj',
|
|
|
+ //输入购买的数量
|
|
|
+ function changeBuy() {
|
|
|
+ $.ajax({
|
|
|
+ url: '/query/getAll/status',
|
|
|
data: {
|
|
|
- userId: $('#buyuserId').val(),
|
|
|
jmId: $('#jmBuy').val(),
|
|
|
},
|
|
|
type: 'GET',
|
|
|
success: function (data) {
|
|
|
- var v=data.data;
|
|
|
- $('#details').append('<div id="myyw">\n' +
|
|
|
- ' <div class="weui-loadmore weui-loadmore_line" style="text-align: center;size: 20px">\n' +
|
|
|
- ' <span class="weui-loadmore__tips">团购信息</span>\n' +
|
|
|
- ' <div class="weui-media-box__bd">\n' +
|
|
|
- ' <h3>青菜套餐</h3>\n' +
|
|
|
- ' </div>\n' +
|
|
|
- ' </div>\n' +
|
|
|
- ' <div>\n' +
|
|
|
- ' <div style="text-indent: -0em;margin-left: 2em;">供应商: </div>\n' +
|
|
|
- '\n' +
|
|
|
- ' <div style="text-indent: -0em;margin-left: 2em;">套 餐: 没有套餐</div>\n' +
|
|
|
- '\n' +
|
|
|
- ' <div style="text-indent: -0em;margin-left: 2em;">单 价: 10</div>\n' +
|
|
|
- '\n' +
|
|
|
- ' <div style="text-indent: -0em;margin-left: 2em;">最新起定量(份): 20</div>\n' +
|
|
|
- '\n' +
|
|
|
- ' <div style="text-indent: -0em;margin-left: 2em;">截止时间: 2020-02-11</div>\n' +
|
|
|
- '\n' +
|
|
|
- ' <div style="text-indent: -0em;margin-left: 2em;">预计送货时间: 2020-02-10</div>\n' +
|
|
|
- '\n' +
|
|
|
- ' <div style="text-indent: -0em;margin-left: 2em;">服务电话: 12345678912</div>\n' +
|
|
|
- ' </div>\n' +
|
|
|
- ' </div>')
|
|
|
+ console.log(data);
|
|
|
+ $("#myMenory").html($('#buyCount').val() * data.data.tgPrice)
|
|
|
},
|
|
|
error: function () {
|
|
|
}
|
|
|
- });*/
|
|
|
- <#if type==2>
|
|
|
- $.ajax({
|
|
|
- url: '/home/queryGroup/buyGroup',
|
|
|
- data: {
|
|
|
- userId: $('#buyuserId').val(),
|
|
|
- jmId: $('#jmBuy').val(),
|
|
|
- },
|
|
|
- type: 'GET',
|
|
|
- success: function (data) {
|
|
|
- $('#buyCount').val(data.data.buyCount);
|
|
|
- $('#myPhone').val(data.data.phone);
|
|
|
- $('#Myremarks').val(data.data.myRemark);
|
|
|
- $('#myMenory').text(data.data.buyMoney);
|
|
|
-
|
|
|
- },
|
|
|
- error: function () {
|
|
|
- }
|
|
|
- });
|
|
|
- </#if>
|
|
|
-
|
|
|
- })(jQuery);
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
|
|
|
+ //1 在团 2 发货 3完成 4取消',
|
|
|
+ function getStatus(v) {
|
|
|
+ if (v == 1) {
|
|
|
+ return "<span style='color:green;'>在团</span>";
|
|
|
+ } else if (v == 2) {
|
|
|
+ return "<span style='color:Black;'>发货</span>";
|
|
|
+ } else if (v == 3) {
|
|
|
+ return "完成";
|
|
|
+ } else if (v == 4) {
|
|
|
+ return "<span style='color:red;'>取消</span>";
|
|
|
+ }
|
|
|
+ }
|
|
|
</script>
|