|
|
@@ -65,113 +65,13 @@ Page({
|
|
|
},
|
|
|
|
|
|
switch4: function (e) {
|
|
|
- // var obj = {}
|
|
|
- // if (this.data.currentTab == 1) {
|
|
|
- // if (this.data.activityName == '' || this.data.activityTime == '' || this.data.activityPlace == '' ||
|
|
|
- // this.data.activityAttr.length == 0 || this.data.activityContact == '' || this.data.activityDetail == '') {
|
|
|
- // wx.showToast({
|
|
|
- // title: '请确认信息填写完整',
|
|
|
- // icon: 'none'
|
|
|
- // })
|
|
|
- // return
|
|
|
- // }
|
|
|
- // obj = {
|
|
|
- // title: this.data.activityName,
|
|
|
- // subTitle: this.data.activitySubTitle,
|
|
|
- // activityTime: this.data.activityTime,
|
|
|
- // place: this.data.activityPlace,
|
|
|
- // attribute: this.data.activityAttr,
|
|
|
- // supply: this.data.activitySupply,
|
|
|
- // contactDetails: this.data.activityContact,
|
|
|
- // objectOriented: this.data.activityAim,
|
|
|
- // details: this.data.activityDetail,
|
|
|
- // poster: this.data.activityPoster.length == 0 ? '' : this.data.activityPoster[0],
|
|
|
- // photo: this.data.activityPicture,
|
|
|
- // publicity: this.data.activityProInfo,
|
|
|
- // registrationLink: this.data.activitySrc
|
|
|
- // }
|
|
|
- // } else if (this.data.currentTab == 2) {
|
|
|
- // if (this.data.recruitName == '' || this.data.recruitTime == '' || this.data.recruitAttr == '' ||
|
|
|
- // this.data.recruitContact == '' || this.data.recruitDetail == '') {
|
|
|
- // wx.showToast({
|
|
|
- // title: '请确认信息填写完整',
|
|
|
- // icon: 'none'
|
|
|
- // })
|
|
|
- // return
|
|
|
- // }
|
|
|
- // obj = {
|
|
|
- // title: this.data.recruitName,
|
|
|
- // subTitle: this.data.recruitSubTitle,
|
|
|
- // activityTime: this.data.recruitTime,
|
|
|
- // attribute: this.data.recruitAttr,
|
|
|
- // contactDetails: this.data.recruitContact,
|
|
|
- // objectOriented: this.data.recruitAim,
|
|
|
- // details: this.data.recruitDetail,
|
|
|
- // poster: this.data.recruitPoster.length == 0 ? '' : this.data.recruitPoster[0],
|
|
|
- // photo: this.data.recruitPicture,
|
|
|
- // publicity: this.data.recruitProInfo,
|
|
|
- // registrationLink: this.data.recruitSrc
|
|
|
- // }
|
|
|
- // } else {
|
|
|
- // if (this.data.notiName == '' || this.data.notiAttr.length == 0 || this.data.notiDetail == '') {
|
|
|
- // wx.showToast({
|
|
|
- // title: '请确认信息填写完整',
|
|
|
- // icon: 'none'
|
|
|
- // })
|
|
|
- // return
|
|
|
- // }
|
|
|
- // obj = {
|
|
|
- // title: this.data.notiName,
|
|
|
- // subTitle: this.data.notiSubTitle,
|
|
|
- // attribute: this.data.notiAttr,
|
|
|
- // objectOriented: this.data.notiAim,
|
|
|
- // details: this.data.notiDetail,
|
|
|
- // poster: this.data.notiPoster.length == 0 ? '' : this.data.notiPoster[0],
|
|
|
- // photo: this.data.notiPicture
|
|
|
- // }
|
|
|
- // }
|
|
|
- // obj.time = new Date()
|
|
|
- // obj.publisherId = this.data.publisherId
|
|
|
- // wx.showLoading({
|
|
|
- // title: '发布中'
|
|
|
- // })
|
|
|
- // const db = wx.cloud.database()
|
|
|
- // db.collection('publisherInfoData').doc(this.data.publisherId).get({
|
|
|
- // success: async function (res) {
|
|
|
- // obj.publisherAvatar = res.data.publisherAvatar
|
|
|
- // obj.publisherName = res.data.publisherName
|
|
|
- // if (obj.poster != '') {
|
|
|
- // obj.poster = (await wx.cloud.uploadFile({
|
|
|
- // cloudPath: 'activityPoster/' + this.randomString() + '.jpg',
|
|
|
- // filePath: obj.poster
|
|
|
- // })).fileID
|
|
|
- // }
|
|
|
- // var arr = []
|
|
|
- // for (let i = 0; i < obj.photo.length; i++) {
|
|
|
- // arr.push(wx.cloud.uploadFile({
|
|
|
- // cloudPath: 'informPhoto/' + this.randomString() + '.jpg',
|
|
|
- // filePath: obj.photo[i]
|
|
|
- // }))
|
|
|
- // }
|
|
|
- // arr = await Promise.all(arr)
|
|
|
- // for (let i = 0; i < obj.photo.length; i++) {
|
|
|
- // obj.photo[i] = arr[i].fileID
|
|
|
- // }
|
|
|
- // db.collection('mainData').add({
|
|
|
- // data: obj,
|
|
|
- // success: function () {
|
|
|
- // this.setData({
|
|
|
- // currentTab: 4
|
|
|
- // })
|
|
|
- // wx.hideLoading()
|
|
|
- // }.bind(this)
|
|
|
- // })
|
|
|
- // }.bind(this)
|
|
|
- // })
|
|
|
-
|
|
|
const value = e.detail.value
|
|
|
|
|
|
- if (value.name === '' || this.data.currentTab !== 2 && value.type === '' || this.data.detail === '') {
|
|
|
+ if (this.data.currentTab === 2) {
|
|
|
+ value.type = '纳新'
|
|
|
+ }
|
|
|
+
|
|
|
+ if (value.name === '' || value.type === '' || this.data.detail === '') {
|
|
|
wx.showToast({
|
|
|
title: '请确认信息填写完整',
|
|
|
icon: 'none'
|