123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- function tuangou_init(tt) {
- $('#tg_publish').on('click', function () {
- window.location.href = "/yeweihui/tgPublish.html?userId=" + $('#userId').val();
- });
- $('#tg_publish2').on('click', function () {
- window.location.href = "/yeweihui/tgPublish.html?userId=" + $('#userId').val();
- });
- $('#tg_btnQZ1').on('click', function () {
- getListData();
- });
- $('#tg_btnQZ2').on('click', function () {
- getMyPbListData();
- });
- getListData();
- getMyPbListData();
- };
- function getListData() {
- let searchTitle = $('#tg_searchNum1').val();
- $.ajax({
- url: '/yeweihui/tuangou/list/query.json',
- type: 'post',
- data: {
- userId: $('#userId').val(),
- title: searchTitle
- },
- success: function (data) {
- if (data.success) {
- makeList(data.data);
- }
- else {
- $.alert("操作失败");
- }
- },
- error: function () {
- $.alert("网络异常");
- }
- });
- }
- function getMyPbListData() {
- let searchTitle = $('#tg_searchNum2').val();
- $.ajax({
- url: '/yeweihui/tuangou/mylist/query.json',
- type: 'post',
- data: {
- userId: $('#userId').val(),
- title: searchTitle
- },
- success: function (data) {
- if (data.success) {
- makeMyPublishList(data.data);
- }
- else {
- $.alert("操作失败");
- }
- },
- error: function () {
- $.alert("网络异常");
- }
- });
- }
- function makeList(list) {
- $('#tg_list1').empty();
- if (list == undefined || list.length <= 0) {
- $('#tg_list1').append('<div class="weui-loadmore weui-loadmore_line">\n' +
- ' <span class="weui-loadmore__tips">暂无数据</span>\n' +
- '</div>');
- return;
- }
- for (let i = 0; i < list.length; i++) {
- let item = list[i];
- let status = '';
- if (item.tgStatus == 1) {
- status = "在团";
- }
- else if (item.tgStatus == 2) {
- status = "发货";
- }
- else if (item.tgStatus == 3) {
- status = "完成";
- }
- else if (item.tgStatus == 4) {
- status = "取消";
- }
- let sstime = item.tgEndTime.toString().substring(5);
- $('#tg_list1').append($('<a href="javascript:tgItemSelect(' + "'" + item.jmId + "'" + ');" style="color: grey;">\n' +
- ' <div style="display: flex; flex-direction: row; text-align: center; font-size: small; line-height: 5vh;">\n' +
- ' <div style="width: 40%; padding-left:3vw; text-align: left; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">' + item.tgTitle + '</div>\n' +
- ' <div style="width: 15%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">' + item.currentNum + '</div>\n' +
- ' <div style="width: 30%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">' + sstime + '</div>\n' +
- ' <div style="width: 15%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">' + status + '</div>\n' +
- ' </div>\n' +
- ' </a>'));
- }
- }
- function makeMyPublishList(list) {
- $('#tg_list2').empty();
- if (list == undefined || list.length <= 0) {
- $('#tg_list2').append('<div class="weui-loadmore weui-loadmore_line">\n' +
- ' <span class="weui-loadmore__tips">暂无数据</span>\n' +
- '</div>');
- return;
- }
- for (let i = 0; i < list.length; i++) {
- let item = list[i];
- let status = '';
- if (item.tgStatus == 1) {
- status = "在团";
- }
- else if (item.tgStatus == 2) {
- status = "发货";
- }
- else if (item.tgStatus == 3) {
- status = "完成";
- }
- else if (item.tgStatus == 4) {
- status = "取消";
- }
- let sstime = item.tgEndTime.toString().substring(5);
- $('#tg_list2').append($('<a href="javascript:tgMyItemSelect(' + "'" + item.jmId + "'" + ');" style="color: grey;">\n' +
- ' <div style="display: flex; flex-direction: row; text-align: center; font-size: small; line-height: 5vh;">\n' +
- ' <div style="width: 40%; padding-left:3vw; text-align: left; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">' + item.tgTitle + '</div>\n' +
- ' <div style="width: 15%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">' + item.currentNum + '</div>\n' +
- ' <div style="width: 30%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">' + sstime + '</div>\n' +
- ' <div style="width: 15%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">' + status + '</div>\n' +
- ' </div>\n' +
- ' </a>'));
- }
- }
- function tgItemSelect(jmId) {
- window.location.href = "/yeweihui/groupBuyingXx.html?jmId=" + jmId + "&userId=" + $('#userId').val();
- }
- function tgMyItemSelect(jmId) {
- window.location.href = "/yeweihui/groupBuyingXx.html?jmId=" + jmId + "&userId=" + $('#userId').val();
- }
|