diff --git a/pages/index/index.js b/pages/index/index.js index 3081582..b6404a2 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -253,6 +253,7 @@ Page({ datas[i].typeImg = imgUrl + datas[i].typeImg } } + console.log(datas) that.setData({ fiveImages:datas }) diff --git a/pages/message/clubmessage/clubmessage.js b/pages/message/clubmessage/clubmessage.js index dbdf7fe..3c6d4d8 100644 --- a/pages/message/clubmessage/clubmessage.js +++ b/pages/message/clubmessage/clubmessage.js @@ -1,24 +1,48 @@ // pages/message/clubmessage/clubmessage.js +var Api = require('../../../utils/common.js'); +var re = require('../../../utils/request.js'); Page({ /** * 页面的初始数据 */ data: { - cluber:[ - {clubname:'众行天下',time:'3小时前',img:'../../../images/ava.png',name:'王华',content:'会员邀请加入',status:'1'}, - {clubname:'众行天下',time:'3小时前',img:'../../../images/ava.png',name:'王华',content:'会员邀请加入',status:'2'}, - {clubname:'众行天下',time:'3小时前',img:'../../../images/ava.png',name:'王华',content:'会员邀请加入',status:'2'}, - {clubname:'众行天下',time:'3小时前',img:'../../../images/ava.png',name:'王华',content:'会员邀请加入',status:'3'}, - {clubname:'众行天下',time:'3小时前',img:'../../../images/ava.png',name:'王华',content:'会员邀请加入',status:'1'} - ] + pageSize: 10, + page:1, + cluber:[ + {clubname:'众行天下',time:'3小时前',img:'../../../images/ava.png',name:'王华',content:'会员邀请加入',status:'1'}, + {clubname:'众行天下',time:'3小时前',img:'../../../images/ava.png',name:'王华',content:'会员邀请加入',status:'2'}, + {clubname:'众行天下',time:'3小时前',img:'../../../images/ava.png',name:'王华',content:'会员邀请加入',status:'2'}, + {clubname:'众行天下',time:'3小时前',img:'../../../images/ava.png',name:'王华',content:'会员邀请加入',status:'3'}, + {clubname:'众行天下',time:'3小时前',img:'../../../images/ava.png',name:'王华',content:'会员邀请加入',status:'1'} + ] }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { - + this.getClubMessageList(); + }, + + getClubMessageList: function(){ + var that = this; + let postData = { + pageSize: that.data.pageSize, + pageNum: that.data.page + }; + var header = { + token: wx.getStorageSync('token'), + "Content-Type": "application/x-www-form-urlencoded" + }; + re.request(Api.getClubMessagePage(), postData, header).then((res) => { + let datas = res.data.rows; + if(datas.length!=0){ + that.setData({ + cluber: datas + }) + } + }) }, /** diff --git a/pages/message/clubmessage/clubmessage.wxml b/pages/message/clubmessage/clubmessage.wxml index 8b5f2cf..d4de6a8 100644 --- a/pages/message/clubmessage/clubmessage.wxml +++ b/pages/message/clubmessage/clubmessage.wxml @@ -7,22 +7,22 @@ - {{item.clubname}}{{item.time}} + {{item.clubName}}{{item.createdTime}} - - {{item.name}} + + {{item.memberName}} {{item.massageContent}} - - 会员邀请加入 + diff --git a/pages/message/message.wxml b/pages/message/message.wxml index e958944..ffdb4d3 100644 --- a/pages/message/message.wxml +++ b/pages/message/message.wxml @@ -1,5 +1,5 @@ - + @@ -29,7 +29,7 @@ - + diff --git a/pages/message/sysmessage/sysmessage.js b/pages/message/sysmessage/sysmessage.js index 4853c38..02bcb7f 100644 --- a/pages/message/sysmessage/sysmessage.js +++ b/pages/message/sysmessage/sysmessage.js @@ -1,10 +1,14 @@ // pages/message/sysmessage/sysmessage.js +var Api = require('../../../utils/common.js'); +var re = require('../../../utils/request.js'); Page({ /** * 页面的初始数据 */ data: { + pageSize: 10, + page:1, sysList:[ {time:'08-31 14:50',title:'俱乐部申请通过',content:'您创建的俱乐部已通过审核,可以使用提现功能,请遵守国家法律法规,文明发布活动。'}, {time:'08-31 14:50',title:'俱乐部申请通过',content:'您创建的俱乐部未通过审核,原因:(后台变量),请修改后重新提交。'}, @@ -17,7 +21,27 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function (options) { - + this.getSystemMessageList(); + }, + + getSystemMessageList: function(){ + var that = this; + let postData = { + pageSize: that.data.pageSize, + pageNum: that.data.page + }; + var header = { + token: wx.getStorageSync('token'), + "Content-Type": "application/x-www-form-urlencoded" + }; + re.request(Api.getSystemMessagePage(), postData, header).then((res) => { + let datas = res.data.rows; + if(datas.length!=0){ + that.setData({ + sysList: datas + }) + } + }) }, /** diff --git a/pages/message/sysmessage/sysmessage.wxml b/pages/message/sysmessage/sysmessage.wxml index 1dbe3e5..daa29bc 100644 --- a/pages/message/sysmessage/sysmessage.wxml +++ b/pages/message/sysmessage/sysmessage.wxml @@ -7,10 +7,10 @@ - {{item.title}}{{item.time}} + {{item.createdTime}} - {{item.content}} + {{item.massageTitle}} diff --git a/pages/release/addactive/addactive.js b/pages/release/addactive/addactive.js index d1c813e..08c91e4 100644 --- a/pages/release/addactive/addactive.js +++ b/pages/release/addactive/addactive.js @@ -1,8 +1,8 @@ var Api = require('../../../utils/common.js'); var re = require('../../../utils/request.js'); var WxParse = require('../../../wxParse/wxParse.js'); -var dateTimePicker = require('../../dateTimePicker.js') - +var dateTimePicker = require('../../dateTimePicker.js'); +var util = require('../../../utils/util.js'); Page({ /** @@ -28,8 +28,8 @@ Page({ year: new Date().getFullYear(), clubId: '', endRegisterTime: '2021-06-01', - startTime: '2021-06-01', - endTime: '2021-06-01', + startTime: util.getNowDate(new Date()), + endTime: util.getNowDate(new Date()), nofree: true, flag: true, array:[], @@ -41,7 +41,7 @@ Page({ addrLon: '', createdTel:'', costList:[], - isFree: '0', //kaishi + isFree: '1', //kaishi imgIndex: 0, imageLength: 0, firstCon: '', @@ -337,17 +337,16 @@ console.log(startT); }) var startTFour = dateTimePicker.formatPickerDateTime(this.data.dateTimeArrayFour, this.data.dateTimeFour) -console.log(startTFour); this.setData({ startTFour: startTFour }) }, onLoad: function (options) { - this.getClubHave(); + var nowDate = util.formatTimeTwo(new Date()); // 时间ONE - var start = '2019-04-26 15:26' + var start = nowDate; var obj = dateTimePicker.dateTimePicker(2000,this.data.year,start); this.setData({ dateTime: obj.dateTime, @@ -360,7 +359,7 @@ console.log(startTFour); }) // 时间Two - var startTwo = '2019-04-26 15:26' + var startTwo = nowDate; var objTwo = dateTimePicker.dateTimePicker(2000,this.data.year,startTwo); this.setData({ dateTimeTwo: objTwo.dateTime, @@ -373,7 +372,7 @@ console.log(startTFour); }) // 时间three - var startThree= '2019-04-26 15:26' + var startThree= nowDate; var objThree = dateTimePicker.dateTimePicker(2000,this.data.year,startThree); this.setData({ dateTimeThree: objThree.dateTime, @@ -386,7 +385,7 @@ console.log(startTFour); // 时间Four - var startFour= '2019-04-26 15:26' + var startFour= nowDate; var objFour = dateTimePicker.dateTimePicker(2000,this.data.year,startFour); this.setData({ dateTimeFour: objFour.dateTime, @@ -396,7 +395,7 @@ console.log(startTFour); this.setData({ startTFour: startTFour }) - + this.getClubHave(); }, @@ -408,9 +407,11 @@ console.log(startTFour); }; re.request(Api.getClubHave(), '', header).then((res) => { let datas = res.data.data; - console.log(datas); + if(datas.length > 0){ + that.data.clubId = datas[0].clubId; + } that.setData({ - array:datas, + array: datas, }) }) }, @@ -603,8 +604,6 @@ uploadfront: function (e) { // , isHaveInsurance } costLists.push(costListItem); - console.log(costLists); - console.log(that.data.clubId) var postData = { activityAddr: that.data.address, activityContent: JSON.stringify(content), @@ -649,7 +648,7 @@ uploadfront: function (e) { wx.showToast({ title: '请先阅读并同意此协议', icon: 'none', - duration: 1000 + duration: 1500 }) }else{ re.request(Api.createActive(), postData, header).then((res) => { @@ -657,11 +656,13 @@ uploadfront: function (e) { wx.showToast({ title: '提交成功,等待审核', icon: 'none', - duration: 1000 - }) - wx.navigateBack({ - delta: 1 + duration: 1500 }) + setTimeout(function(){ + wx.navigateBack({ + delta: 1 + }) + },1500) }) } }, diff --git a/pages/release/addactive/addactive.wxml b/pages/release/addactive/addactive.wxml index 77cf282..4b9e5ee 100644 --- a/pages/release/addactive/addactive.wxml +++ b/pages/release/addactive/addactive.wxml @@ -117,16 +117,16 @@ -