Browse Source

2022-6-23 胡春雨

master
1913812@qq.com 3 years ago
parent
commit
2543cb5676
  1. 1
      pages/index/index.js
  2. 40
      pages/message/clubmessage/clubmessage.js
  3. 12
      pages/message/clubmessage/clubmessage.wxml
  4. 8
      pages/message/message.wxml
  5. 26
      pages/message/sysmessage/sysmessage.js
  6. 4
      pages/message/sysmessage/sysmessage.wxml
  7. 43
      pages/release/addactive/addactive.js
  8. 10
      pages/release/addactive/addactive.wxml
  9. 23
      pages/release/release.js
  10. 13
      utils/common.js
  11. 23
      utils/util.js

1
pages/index/index.js

@ -253,6 +253,7 @@ Page({
datas[i].typeImg = imgUrl + datas[i].typeImg datas[i].typeImg = imgUrl + datas[i].typeImg
} }
} }
console.log(datas)
that.setData({ that.setData({
fiveImages:datas fiveImages:datas
}) })

40
pages/message/clubmessage/clubmessage.js

@ -1,24 +1,48 @@
// pages/message/clubmessage/clubmessage.js // pages/message/clubmessage/clubmessage.js
var Api = require('../../../utils/common.js');
var re = require('../../../utils/request.js');
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
cluber:[ pageSize: 10,
{clubname:'众行天下',time:'3小时前',img:'../../../images/ava.png',name:'王华',content:'会员邀请加入',status:'1'}, page:1,
{clubname:'众行天下',time:'3小时前',img:'../../../images/ava.png',name:'王华',content:'会员邀请加入',status:'2'}, cluber:[
{clubname:'众行天下',time:'3小时前',img:'../../../images/ava.png',name:'王华',content:'会员邀请加入',status:'2'}, {clubname:'众行天下',time:'3小时前',img:'../../../images/ava.png',name:'王华',content:'会员邀请加入',status:'1'},
{clubname:'众行天下',time:'3小时前',img:'../../../images/ava.png',name:'王华',content:'会员邀请加入',status:'3'}, {clubname:'众行天下',time:'3小时前',img:'../../../images/ava.png',name:'王华',content:'会员邀请加入',status:'2'},
{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:'3'},
{clubname:'众行天下',time:'3小时前',img:'../../../images/ava.png',name:'王华',content:'会员邀请加入',status:'1'}
]
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { 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
})
}
})
}, },
/** /**

12
pages/message/clubmessage/clubmessage.wxml

@ -7,22 +7,22 @@
<block wx:for="{{cluber}}" wx:key="cluber"> <block wx:for="{{cluber}}" wx:key="cluber">
<view class="list"> <view class="list">
<view class="list-top"> <view class="list-top">
{{item.clubname}}<text>{{item.time}}</text> {{item.clubName}}<text>{{item.createdTime}}</text>
</view> </view>
<view class="list-content"> <view class="list-content">
<view class="content-left"> <view class="content-left">
<image src="{{item.img}}"></image> <image src="{{item.userPhoto}}"></image>
{{item.name}} {{item.memberName}} {{item.massageContent}}
</view> </view>
<view class="statusIn" wx:if="{{item.status==1}}"> <!--<view class="statusIn" > wx:if="{{item.status==1}}"
会员邀请加入 {{item.massageContent}}
</view> </view>
<view class="statusMa" wx:elif="{{item.status==2}}"> <view class="statusMa" wx:elif="{{item.status==2}}">
被设为管理员 被设为管理员
</view> </view>
<view class="statusOut" wx:else> <view class="statusOut" wx:else>
被撤销管理员 被撤销管理员
</view> </view>-->
</view> </view>
</view> </view>
</block> </block>

8
pages/message/message.wxml

@ -1,5 +1,5 @@
<view class="container"> <view class="container">
<!-- <view class="list" bindtap="toclub"> <view class="list" bindtap="toclub">
<view class="list-left"> <view class="list-left">
<image src="../../images/clubm.png"></image> <image src="../../images/clubm.png"></image>
</view> </view>
@ -11,7 +11,7 @@
{{club.massageContent}} {{club.massageContent}}
</view> </view>
</view> </view>
</view> --> </view>
<view class="list" bindtap="toorder"> <view class="list" bindtap="toorder">
<view class="list-left"> <view class="list-left">
<image src="../../images/orderm.png"></image> <image src="../../images/orderm.png"></image>
@ -29,7 +29,7 @@
</view> </view>
</view> </view>
</view> </view>
<!-- <view class="list" bindtap="tosystem"> <view class="list" bindtap="tosystem">
<view class="list-left"> <view class="list-left">
<image src="../../images/sysm.png"></image> <image src="../../images/sysm.png"></image>
</view> </view>
@ -41,7 +41,7 @@
{{system.massageTitle}} {{system.massageTitle}}
</view> </view>
</view> </view>
</view> --> </view>
<view class="list" bindtap="toactive"> <view class="list" bindtap="toactive">
<view class="list-left"> <view class="list-left">
<image src="../../images/activem.png"></image> <image src="../../images/activem.png"></image>

26
pages/message/sysmessage/sysmessage.js

@ -1,10 +1,14 @@
// pages/message/sysmessage/sysmessage.js // pages/message/sysmessage/sysmessage.js
var Api = require('../../../utils/common.js');
var re = require('../../../utils/request.js');
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
pageSize: 10,
page:1,
sysList:[ sysList:[
{time:'08-31 14:50',title:'俱乐部申请通过',content:'您创建的俱乐部已通过审核,可以使用提现功能,请遵守国家法律法规,文明发布活动。'}, {time:'08-31 14:50',title:'俱乐部申请通过',content:'您创建的俱乐部已通过审核,可以使用提现功能,请遵守国家法律法规,文明发布活动。'},
{time:'08-31 14:50',title:'俱乐部申请通过',content:'您创建的俱乐部未通过审核,原因:(后台变量),请修改后重新提交。'}, {time:'08-31 14:50',title:'俱乐部申请通过',content:'您创建的俱乐部未通过审核,原因:(后台变量),请修改后重新提交。'},
@ -17,7 +21,27 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { 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
})
}
})
}, },
/** /**

4
pages/message/sysmessage/sysmessage.wxml

@ -7,10 +7,10 @@
<block wx:for="{{sysList}}" wx:key="sysList"> <block wx:for="{{sysList}}" wx:key="sysList">
<view class="list"> <view class="list">
<view class="list-top"> <view class="list-top">
{{item.title}}<text>{{item.time}}</text> <text>{{item.createdTime}}</text>
</view> </view>
<view class="list-content"> <view class="list-content">
{{item.content}} {{item.massageTitle}}
</view> </view>
</view> </view>
</block> </block>

43
pages/release/addactive/addactive.js

@ -1,8 +1,8 @@
var Api = require('../../../utils/common.js'); var Api = require('../../../utils/common.js');
var re = require('../../../utils/request.js'); var re = require('../../../utils/request.js');
var WxParse = require('../../../wxParse/wxParse.js'); var WxParse = require('../../../wxParse/wxParse.js');
var dateTimePicker = require('../../dateTimePicker.js') var dateTimePicker = require('../../dateTimePicker.js');
var util = require('../../../utils/util.js');
Page({ Page({
/** /**
@ -28,8 +28,8 @@ Page({
year: new Date().getFullYear(), year: new Date().getFullYear(),
clubId: '', clubId: '',
endRegisterTime: '2021-06-01', endRegisterTime: '2021-06-01',
startTime: '2021-06-01', startTime: util.getNowDate(new Date()),
endTime: '2021-06-01', endTime: util.getNowDate(new Date()),
nofree: true, nofree: true,
flag: true, flag: true,
array:[], array:[],
@ -41,7 +41,7 @@ Page({
addrLon: '', addrLon: '',
createdTel:'', createdTel:'',
costList:[], costList:[],
isFree: '0', //kaishi isFree: '1', //kaishi
imgIndex: 0, imgIndex: 0,
imageLength: 0, imageLength: 0,
firstCon: '', firstCon: '',
@ -337,17 +337,16 @@ console.log(startT);
}) })
var startTFour = dateTimePicker.formatPickerDateTime(this.data.dateTimeArrayFour, this.data.dateTimeFour) var startTFour = dateTimePicker.formatPickerDateTime(this.data.dateTimeArrayFour, this.data.dateTimeFour)
console.log(startTFour);
this.setData({ this.setData({
startTFour: startTFour startTFour: startTFour
}) })
}, },
onLoad: function (options) { onLoad: function (options) {
this.getClubHave();
var nowDate = util.formatTimeTwo(new Date());
// 时间ONE // 时间ONE
var start = '2019-04-26 15:26' var start = nowDate;
var obj = dateTimePicker.dateTimePicker(2000,this.data.year,start); var obj = dateTimePicker.dateTimePicker(2000,this.data.year,start);
this.setData({ this.setData({
dateTime: obj.dateTime, dateTime: obj.dateTime,
@ -360,7 +359,7 @@ console.log(startTFour);
}) })
// 时间Two // 时间Two
var startTwo = '2019-04-26 15:26' var startTwo = nowDate;
var objTwo = dateTimePicker.dateTimePicker(2000,this.data.year,startTwo); var objTwo = dateTimePicker.dateTimePicker(2000,this.data.year,startTwo);
this.setData({ this.setData({
dateTimeTwo: objTwo.dateTime, dateTimeTwo: objTwo.dateTime,
@ -373,7 +372,7 @@ console.log(startTFour);
}) })
// 时间three // 时间three
var startThree= '2019-04-26 15:26' var startThree= nowDate;
var objThree = dateTimePicker.dateTimePicker(2000,this.data.year,startThree); var objThree = dateTimePicker.dateTimePicker(2000,this.data.year,startThree);
this.setData({ this.setData({
dateTimeThree: objThree.dateTime, dateTimeThree: objThree.dateTime,
@ -386,7 +385,7 @@ console.log(startTFour);
// 时间Four // 时间Four
var startFour= '2019-04-26 15:26' var startFour= nowDate;
var objFour = dateTimePicker.dateTimePicker(2000,this.data.year,startFour); var objFour = dateTimePicker.dateTimePicker(2000,this.data.year,startFour);
this.setData({ this.setData({
dateTimeFour: objFour.dateTime, dateTimeFour: objFour.dateTime,
@ -396,7 +395,7 @@ console.log(startTFour);
this.setData({ this.setData({
startTFour: startTFour startTFour: startTFour
}) })
this.getClubHave();
}, },
@ -408,9 +407,11 @@ console.log(startTFour);
}; };
re.request(Api.getClubHave(), '', header).then((res) => { re.request(Api.getClubHave(), '', header).then((res) => {
let datas = res.data.data; let datas = res.data.data;
console.log(datas); if(datas.length > 0){
that.data.clubId = datas[0].clubId;
}
that.setData({ that.setData({
array:datas, array: datas,
}) })
}) })
}, },
@ -603,8 +604,6 @@ uploadfront: function (e) {
// , isHaveInsurance // , isHaveInsurance
} }
costLists.push(costListItem); costLists.push(costListItem);
console.log(costLists);
console.log(that.data.clubId)
var postData = { var postData = {
activityAddr: that.data.address, activityAddr: that.data.address,
activityContent: JSON.stringify(content), activityContent: JSON.stringify(content),
@ -649,7 +648,7 @@ uploadfront: function (e) {
wx.showToast({ wx.showToast({
title: '请先阅读并同意此协议', title: '请先阅读并同意此协议',
icon: 'none', icon: 'none',
duration: 1000 duration: 1500
}) })
}else{ }else{
re.request(Api.createActive(), postData, header).then((res) => { re.request(Api.createActive(), postData, header).then((res) => {
@ -657,11 +656,13 @@ uploadfront: function (e) {
wx.showToast({ wx.showToast({
title: '提交成功,等待审核', title: '提交成功,等待审核',
icon: 'none', icon: 'none',
duration: 1000 duration: 1500
})
wx.navigateBack({
delta: 1
}) })
setTimeout(function(){
wx.navigateBack({
delta: 1
})
},1500)
}) })
} }
}, },

10
pages/release/addactive/addactive.wxml

@ -117,16 +117,16 @@
<!-- 结束 --> <!-- 结束 -->
</view> </view>
</view> </view>
<view class="formlist" hidden> <view class="formlist">
<text>报名费用</text> <text>报名费用</text>
<view class="authright"> <view class="authright">
<radio-group name="isFree" bindchange="radioChange" > <radio-group name="isFree" bindchange="radioChange" >
<label><radio value="0" color="#FFCB12"/>免费</label> <label hidden><radio value="0" color="#FFCB12"/>免费</label>
<label><radio value="1" checked="true" color="#FFCB12"/>付费</label> <label><radio value="1" checked="true" color="#FFCB12"/>付费</label>
</radio-group> </radio-group>
</view> </view>
</view> </view>
<view class="money" hidden="{{nofree}}"> <view class="money" > <!-- hidden="{{nofree}}"-->
<view class="formlist"> <view class="formlist">
<text>费用名称</text> <text>费用名称</text>
<input type="text" placeholder="10字以内" bindinput="custname"/> <input type="text" placeholder="10字以内" bindinput="custname"/>
@ -208,11 +208,11 @@
</radio-group> </radio-group>
</view> </view>
</view> </view>
<view class="formlist"> <view class="formlist" hidden>
<text>保险</text> <text>保险</text>
<input type="text" placeholder="请输入保险费用" bindinput="safeInput"/> <input type="text" placeholder="请输入保险费用" bindinput="safeInput"/>
</view> </view>
<view class="formlist"> <view class="formlist" hidden>
<text>买保险方式</text> <text>买保险方式</text>
<view class="authright"> <view class="authright">
<radio-group name="insuranceType" bindchange="insuranceTypeChange" > <radio-group name="insuranceType" bindchange="insuranceTypeChange" >

23
pages/release/release.js

@ -33,9 +33,26 @@ Page({
}) })
}, },
manageac:function(){ manageac:function(){
wx.navigateTo({ var header = {
url: './manageac/manageac' token:wx.getStorageSync('token'),
}) "Content-Type": "application/x-www-form-urlencoded"
};
var postData={
};
re.request(Api.checkUserClubActivity(), postData, header).then((res) => {
let msg = res.data.msg;
if(msg != 'OK'){
wx.showToast({
title: msg,
icon: 'none',
duration: 3000
})
}else{
wx.navigateTo({
url: './manageac/manageac'
})
}
})
}, },
sendMassege:function(){ sendMassege:function(){
wx.navigateTo({ wx.navigateTo({

13
utils/common.js

@ -100,7 +100,8 @@ var HOST_URI = 'http://127.0.0.1:8088';
let API_memberList='/open/club/member/setList'//成员列表       let API_memberList='/open/club/member/setList'//成员列表      
 let API_Setmember='/open/club/member/edit'//成员列表        let API_Setmember='/open/club/member/edit'//成员列表      
let API_getClubMessagePage= '/open/massage/club/pages' //俱乐部消息
let API_getSystemMessagePage= '/open/massage/system/pages' //系统消息
 function SetMember(){  function SetMember(){
  return HOST_URI + API_Setmember;   return HOST_URI + API_Setmember;
 }  }
@ -152,6 +153,9 @@ function checkUserClubRole(){
function getphone() {//获取手机 function getphone() {//获取手机
return HOST_URI + API_getphone; return HOST_URI + API_getphone;
} }
function getSystemMessagePage() {//获取手机
return HOST_URI + API_getSystemMessagePage;
}
function getUserInfo() {//获取信息 function getUserInfo() {//获取信息
return HOST_URI + API_getUserInfo; return HOST_URI + API_getUserInfo;
} }
@ -214,6 +218,9 @@ function checkUserClubRole(){
} }
function checkUserClubActivity() { function checkUserClubActivity() {
return HOST_URI + API_checkUserClubActivity; return HOST_URI + API_checkUserClubActivity;
}
function getClubMessagePage(){
return HOST_URI + API_getClubMessagePage;
} }
function getLike() { function getLike() {
return HOST_URI + API_getLike; return HOST_URI + API_getLike;
@ -447,5 +454,7 @@ function checkUserClubRole(){
selectgrade, selectgrade,
getRegisterAll, getRegisterAll,
checkUserClubRole, checkUserClubRole,
checkUserClubActivity checkUserClubActivity,
getClubMessagePage,
getSystemMessagePage
}; };

23
utils/util.js

@ -6,7 +6,24 @@ const formatTime = date => {
const minute = date.getMinutes() const minute = date.getMinutes()
const second = date.getSeconds() const second = date.getSeconds()
return `${[year, month, day].map(formatNumber).join('/')} ${[hour, minute, second].map(formatNumber).join(':')}` return `${[year, month, day].map(formatNumber).join('-')} ${[hour, minute, second].map(formatNumber).join(':')}`
}
const formatTimeTwo = date => {
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
const hour = date.getHours()
const minute = date.getMinutes()
return `${[year, month, day].map(formatNumber).join('-')} ${[hour, minute].map(formatNumber).join(':')}`
}
const getNowDate = date => {
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
return [year, month,day].map(formatNumber).join('-')
} }
const formatNumber = n => { const formatNumber = n => {
@ -15,5 +32,7 @@ const formatNumber = n => {
} }
module.exports = { module.exports = {
formatTime formatTime:formatTime,
getNowDate:getNowDate,
formatTimeTwo:formatTimeTwo
} }

Loading…
Cancel
Save