diff --git a/src/mindspore/app.json b/src/mindspore/app.json index dfbb8f9124837507ad9ae0eb4d1a17af8a160a04..1c6666d2e72a3eac07e3ec87d17092fbfd39f3c4 100644 --- a/src/mindspore/app.json +++ b/src/mindspore/app.json @@ -1,125 +1,129 @@ { - "pages": [ - "pages/index/index", - "pages/auth/auth", - "components/user-info/user-info", - "pages/meeting/meeting", - "pages/events/events", - "pages/my/my", - "pages/null/null" - ], - "subpackages": [ - { - "root": "package-meeting", - "pages": [ - "sig/sig-list", - "reserve/reserve", - "sig/add-sig-member", - "sig/member-detail", - "sig/add-member", - "sig/del-member", - "meeting/detail", - "meeting/meeting-success", - "meeting/meeting-list", - "sig/group" - ] + "pages": [ + "pages/index/index", + "pages/auth/auth", + "components/user-info/user-info", + "pages/meeting/meeting", + "pages/events/events", + "pages/my/my", + "pages/null/null" + ], + "subpackages": [ + { + "root": "package-meeting", + "pages": [ + "sig/sig-list", + "reserve/reserve", + "sig/add-sig-member", + "sig/member-detail", + "sig/add-member", + "sig/del-member", + "meeting/detail", + "meeting/meeting-success", + "meeting/meeting-list", + "sig/group" + ] + }, + { + "root": "package-events", + "pages": [ + "events/event-list", + "manage/enterprise-list", + "manage/member-detail", + "manage/add-member", + "manage/del-member", + "publish/publish", + "publish/success", + "events/event-detail", + "sign-up/sign-up", + "sign-up/sign-up-success", + "events/poster", + "sign-up/career-direction", + "sign-up/career-name" + ] + }, + { + "root": "package-my", + "pages": [ + "my/privecy", + "my/my-meetings", + "my/my-collection", + "my/help", + "my/qrcode", + "events/my-list", + "events/send-email", + "my/feedback" + ] + } + ], + "preloadRule": { + "pages/index/index": { + "network": "all", + "packages": [ + "package-meeting", + "package-events", + "package-my" + ] + } }, - { - "root": "package-events", - "pages": [ - "events/event-list", - "manage/enterprise-list", - "manage/member-detail", - "manage/add-member", - "manage/del-member", - "publish/publish", - "publish/success", - "events/event-detail", - "sign-up/sign-up", - "sign-up/sign-up-success", - "events/poster" - ] + "window": { + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#fff", + "navigationBarTitleText": "MindSpore", + "navigationBarTextStyle": "black", + "backgroundColor": "#fff" }, - { - "root": "package-my", - "pages": [ - "my/privecy", - "my/my-meetings", - "my/my-collection", - "my/help", - "my/qrcode", - "events/my-list", - "events/send-email", - "my/feedback" - ] - } - ], - "preloadRule": { - "pages/index/index": { - "network": "all", - "packages": [ - "package-meeting", - "package-events", - "package-my" - ] - } - }, - "window": { - "backgroundTextStyle": "light", - "navigationBarBackgroundColor": "#fff", - "navigationBarTitleText": "MindSpore", - "navigationBarTextStyle": "black", - "backgroundColor": "#fff" - }, - "usingComponents": { - "van-swipe-cell": "./miniprogram_npm/@vant/weapp/swipe-cell/index", - "van-dialog": "./miniprogram_npm/@vant/weapp/dialog/index", - "van-checkbox": "./miniprogram_npm/@vant/weapp/checkbox/index", - "van-checkbox-group": "./miniprogram_npm/@vant/weapp/checkbox-group/index", - "van-popup": "./miniprogram_npm/@vant/weapp/popup/index", - "van-radio": "./miniprogram_npm/@vant/weapp/radio/index", - "van-radio-group": "./miniprogram_npm/@vant/weapp/radio-group/index", - "van-datetime-picker": "./miniprogram_npm/@vant/weapp/datetime-picker/index", - "van-picker": "./miniprogram_npm/@vant/weapp/picker/index", - "van-action-sheet": "./miniprogram_npm/@vant/weapp/action-sheet/index", - "wxml-to-canvas": "./miniprogram_npm/wxml-to-canvas" - }, - "sitemapLocation": "sitemap.json", - "tabBar": { - "custom": true, - "color": "#C7CAD0", - "selectedColor": "#389EEB", - "backgroundColor": "#fff", - "list": [ - { - "iconPath": "static/tabbar/home.png", - "selectedIconPath": "static/tabbar/home-selected.png", - "pagePath": "pages/index/index", - "text": "首页" - }, - { - "iconPath": "static/tabbar/meeting.png", - "selectedIconPath": "static/tabbar/meeting-selected.png", - "pagePath": "pages/meeting/meeting", - "text": "会议" - }, - { - "iconPath": "static/tabbar/events.png", - "selectedIconPath": "static/tabbar/events-selected.png", - "pagePath": "pages/events/events", - "text": "活动" - }, - { - "iconPath": "static/tabbar/my.png", - "selectedIconPath": "static/tabbar/my-selected.png", - "pagePath": "pages/my/my", - "text": "我的" - } - ] - }, - "permission": { - "scope.userLocation": { - "desc": "您的位置信息将用于确定活动地址" + "usingComponents": { + "van-swipe-cell": "./miniprogram_npm/@vant/weapp/swipe-cell/index", + "van-dialog": "./miniprogram_npm/@vant/weapp/dialog/index", + "van-checkbox": "./miniprogram_npm/@vant/weapp/checkbox/index", + "van-checkbox-group": "./miniprogram_npm/@vant/weapp/checkbox-group/index", + "van-popup": "./miniprogram_npm/@vant/weapp/popup/index", + "van-radio": "./miniprogram_npm/@vant/weapp/radio/index", + "van-radio-group": "./miniprogram_npm/@vant/weapp/radio-group/index", + "van-datetime-picker": "./miniprogram_npm/@vant/weapp/datetime-picker/index", + "van-picker": "./miniprogram_npm/@vant/weapp/picker/index", + "van-action-sheet": "./miniprogram_npm/@vant/weapp/action-sheet/index", + "van-collapse": "./miniprogram_npm/@vant/weapp/collapse/index", + "van-collapse-item": "./miniprogram_npm/@vant/weapp/collapse-item/index", + "wxml-to-canvas": "./miniprogram_npm/wxml-to-canvas" + }, + "sitemapLocation": "sitemap.json", + "tabBar": { + "custom": true, + "color": "#C7CAD0", + "selectedColor": "#389EEB", + "backgroundColor": "#fff", + "list": [ + { + "iconPath": "static/tabbar/home.png", + "selectedIconPath": "static/tabbar/home-selected.png", + "pagePath": "pages/index/index", + "text": "首页" + }, + { + "iconPath": "static/tabbar/meeting.png", + "selectedIconPath": "static/tabbar/meeting-selected.png", + "pagePath": "pages/meeting/meeting", + "text": "会议" + }, + { + "iconPath": "static/tabbar/events.png", + "selectedIconPath": "static/tabbar/events-selected.png", + "pagePath": "pages/events/events", + "text": "活动" + }, + { + "iconPath": "static/tabbar/my.png", + "selectedIconPath": "static/tabbar/my-selected.png", + "pagePath": "pages/my/my", + "text": "我的" + } + ] + }, + "permission": { + "scope.userLocation": { + "desc": "您的位置信息将用于确定活动地址" + } } - } } \ No newline at end of file diff --git a/src/mindspore/config/constants.js b/src/mindspore/config/constants.js index 1c019b277cf2f9d1c4267507bcada5bbd26bd29b..c4ed8d3479d361df4a3a4d8736c2cd839ae27227 100644 --- a/src/mindspore/config/constants.js +++ b/src/mindspore/config/constants.js @@ -5,8 +5,8 @@ var _ = require('../utils/underscore-extend.js'); // 服务连接配置 var serviceConfig = { - SERVICE_URL: 'https://api.mindspore.cn/meetings', // 正式环境 - // SERVICE_URL: "http://119.8.32.82/mindspore", // 测试环境 + // SERVICE_URL: 'https://api.mindspore.cn/meetings', // 正式环境 + SERVICE_URL: "http://119.8.32.82", // 测试环境 }; // 存储配置 diff --git a/src/mindspore/config/services-config.js b/src/mindspore/config/services-config.js index d1b32441b1a4883e2a9683c18f7839419f775b41..36c51a1afd9e1c760b9991ba7f07c37da060139c 100644 --- a/src/mindspore/config/services-config.js +++ b/src/mindspore/config/services-config.js @@ -78,7 +78,7 @@ var commonServiceConfig = { ENTERPRISE_DEL_MEMBER_LIST: '/sponsor/action/del/', // 发布 - PUBLISH_EVENT: '/activity/', + PUBLISH_EVENT: '/activity/?publish=true', // 保存草稿 SAVE_DRAFT: '/activitydraft/', @@ -139,10 +139,10 @@ var commonServiceConfig = { LATEST_EVENTS: '/recentactivities/', // 获取报名者信息 - APPLICANT_INFO: '/applicantinfo/{id}/', + APPLICANT_INFO: '/applicant/{id}/', // 报名 - SAVE_SIGNUP_INFO: '/activityregister/', + SAVE_SIGNUP_INFO: '/register/', // 我报名的活动 MY_SIGNUP_EVENTS: '/registeractivities/', diff --git a/src/mindspore/package-events/events/event-detail.js b/src/mindspore/package-events/events/event-detail.js index d017bbdd565dc6606744724f2fbb1318a32ab593..054b833886fa546e5d4446af5fe8d0092e7cbb7b 100644 --- a/src/mindspore/package-events/events/event-detail.js +++ b/src/mindspore/package-events/events/event-detail.js @@ -96,11 +96,17 @@ Page({ /** * 页面的初始数据 */ + data: { info: {}, id: '', + startTime:'', + endTime:'', steps: [], tabIndex: 0, + activeNames:0, + betweenDay:[], + showDialog:false, type: 0, level: 1, user: '', @@ -139,22 +145,103 @@ Page({ user: sessionUtil.getUserInfoByKey('userId'), }); remoteMethods.getDraftDetail((res) => { + let betweenDay = this.getBetweenDateStr(res.start_date,res.end_date) this.setData({ info: res, + startTime:res.start_date.replaceAll('-','.'), + endTime:res.end_date.replaceAll('-','.'), + betweenDay:betweenDay }); let arr = []; - JSON.parse(res.schedules).forEach((item) => { - arr.push({ - duration: item.start + '-' + item.end, - title: item.topic, - speaker: item.speaker ? item.speaker + '-' + item.desc : '', - }); - }); + JSON.parse(res.schedules).forEach((dayTime,index) => { + arr.push([]) + dayTime.forEach(item => { + if(item.speakerList){ + arr[index].push({ + duration: item.start + '-' + item.end, + title: item.topic, + speakerList: item.speakerList + }) + } else { + arr.push({ + duration: item.start + '-' + item.end, + title: item.topic, + speakerList: [{ + name: item.speaker || '', + title: item.desc || '' + }] + }) + } + }) + }); this.setData({ steps: arr, }); }); }, + linkClick() { + this.setData({ + showDialog:true + }) + }, + copyLink() { + let that = this + wx.setClipboardData({ + data: this.data.info.online_url, + success: function () { + that.setData({ + showDialog: false + }) + }, + fail:function () { + that.setData({ + showDialog: false + }) + } + }) + }, + getBetweenDateStr(start, end) { + let startDate = Date.parse(start); + let endDate = Date.parse(end); + if (startDate > endDate) { + return false; + } else if (startDate == endDate) { + return [start] + } + let result = []; + let beginDay = start.split("-"); + let endDay = end.split("-"); + let diffDay = new Date(); + let dateList = new Array; + let i = 0; + diffDay.setDate(beginDay[2]); + diffDay.setMonth(beginDay[1] - 1); + diffDay.setFullYear(beginDay[0]); + result.push(start); + while (i == 0) { + let countDay = diffDay.getTime() + 24 * 60 * 60 * 1000; + diffDay.setTime(countDay); + dateList[2] = diffDay.getDate(); + dateList[1] = diffDay.getMonth() + 1; + dateList[0] = diffDay.getFullYear(); + if (String(dateList[1]).length == 1) { + dateList[1] = "0" + dateList[1] + } + if (String(dateList[2]).length == 1) { + dateList[2] = "0" + dateList[2] + } + result.push(dateList[0] + "-" + dateList[1] + "-" + dateList[2]); + if (dateList[0] == endDay[0] && dateList[1] == endDay[1] && dateList[2] == endDay[2]) { + i = 1; + } + } + return result; + }, + dateChange(event) { + this.setData({ + activeNames: event.detail, + }); + }, switchTab(e) { this.setData({ tabIndex: e.currentTarget.dataset.index, @@ -219,10 +306,16 @@ Page({ }); }, toSignUp() { + if (!sessionUtil.getUserInfoByKey('access')) { + wx.navigateTo({ + url: '/pages/auth/auth' + }) + return; + } wx.navigateTo({ - url: `/package-events/sign-up/sign-up?id=${this.data.info.id}&title=${this.data.info.title}&poster=${this.data.info.poster}`, - }); - }, + url: `/package-events/sign-up/sign-up?id=${this.data.info.id}&title=${this.data.info.title}&poster=${this.data.info.poster}` + }) +}, onShareAppMessage() { return { title: '活动详情', diff --git a/src/mindspore/package-events/events/event-detail.wxml b/src/mindspore/package-events/events/event-detail.wxml index 3ea99eb6f9d6361565ba3d10995d94ec68e1c30b..bbb74ac27b9812a3231f2e2a5cfdb693679c2b48 100644 --- a/src/mindspore/package-events/events/event-detail.wxml +++ b/src/mindspore/package-events/events/event-detail.wxml @@ -13,12 +13,19 @@ - {{info.date}} + {{startTime}} - {{endTime}} - - + + - {{info.address||info.live_address}} + {{info.address}} + + + + + + + {{info.join_url}} @@ -40,23 +47,29 @@ + + @@ -121,4 +135,14 @@ + + + + {{info.online_url}} + + + + + + \ No newline at end of file diff --git a/src/mindspore/package-events/events/event-detail.wxss b/src/mindspore/package-events/events/event-detail.wxss index 38d7e73c2c560a36337adfe16904cf70ed561799..0f2c176b325cbe846d96964731b13787a42010af 100644 --- a/src/mindspore/package-events/events/event-detail.wxss +++ b/src/mindspore/package-events/events/event-detail.wxss @@ -7,12 +7,16 @@ page { } .container .banner-title { + display: flex; + align-items: center; + justify-content: center; background-size: 100% 100% !important; height: 378rpx; text-align: center; - padding-top: 165rpx; } - +.date-title { + font-size: 30rpx; +} .container .banner-title text { font-size: 40rpx; color: #fff; @@ -93,12 +97,18 @@ page { } .container .detail-wrapper .address { - padding: 30rpx 30rpx 0; display: flex; justify-content: space-between; align-items: center; } - +.left { + display: flex; + align-items: center; +} +.container .detail-wrapper .bottom-date { + padding-bottom: 0; + border: none; +} .container .detail-wrapper .address .left image { width: 28rpx; height: 28rpx; diff --git a/src/mindspore/package-events/events/poster.js b/src/mindspore/package-events/events/poster.js index cc5db6688531d2b74b07b7d6bb77fb73b594b027..89edecef0e8833f3fdba4e1df6be7af29e63c41c 100644 --- a/src/mindspore/package-events/events/poster.js +++ b/src/mindspore/package-events/events/poster.js @@ -52,11 +52,12 @@ Page({ this.setData({ info: { title: options.title, - date: options.date, + starTime:options.starTime, + endTime:options.endTime, detail_address: options.address || '', poster: options.poster, live_address: options.liveAddress || '', - activity_type: options.address ? 1 : 2, + activity_type: options.activity_type, }, isDraft: 1, }); diff --git a/src/mindspore/package-events/events/poster.wxml b/src/mindspore/package-events/events/poster.wxml index 4962e53f85e45a5c532f2a9dee8fd3fb093a92a9..0885b36312d2caa53243440236d40728120ca765 100644 --- a/src/mindspore/package-events/events/poster.wxml +++ b/src/mindspore/package-events/events/poster.wxml @@ -4,7 +4,7 @@ {{info.title}} - 时间:{{info.date}} + 时间:{{info.starTime}}-{{info.endTime}} 地点:{{info.detail_address}} 直播地址:{{info.live_address}} diff --git a/src/mindspore/package-events/publish/publish.js b/src/mindspore/package-events/publish/publish.js index 725d6e86c49e20c82c9ab16060452cfdce4aa2e3..5f1da068934c2d55fbae459137ca0a2f3fdb0c4d 100644 --- a/src/mindspore/package-events/publish/publish.js +++ b/src/mindspore/package-events/publish/publish.js @@ -75,17 +75,18 @@ let remoteMethods = { }; let localMethods = { validation: function (data) { - if (data.activity_form === 1) { + console.log(data); + if (data.activity_type === 1) { if (!data.title) { this.toast('请输入活动标题'); return; } - if (!data.starTime) { + if (!data.start_date) { this.toast('请选择活动起始日期'); return; } - if (!data.endTime) { - this.toast('请选择活动结束开始日期'); + if (!data.end_date) { + this.toast('请选择活动结束日期'); return; } if (!data.address) { @@ -97,45 +98,89 @@ let localMethods = { return; } let flag = true; - data.schedules.forEach((item) => { - if (!item.start) { - flag = false; - } - if (!item.end) { - flag = false; - } - if (!item.topic) { - flag = false; - } + data.schedules.forEach((dayItem) => { + dayItem.forEach(item => { + if (!item.start) { + flag = false; + } + if (!item.end) { + flag = false; + } + if (!item.topic) { + flag = false; + } + }) }); if (!flag) { this.toast('请补充日程必填信息'); return; } + } else if (data.activity_type === 2) { + if (!data.title) { + this.toast('请输入活动标题'); + return; + } + if (!data.online_url) { + this.toast('请输入线上链接地址'); + return; + } + let flag = true; + data.schedules.forEach((dayItem) => { + dayItem.forEach(item => { + if (!item.start) { + flag = false; + } + if (!item.end) { + flag = false; + } + if (!item.topic) { + flag = false; + } + }) + }); + if (!flag) { + this.toast('请补充填写日程必填信息'); + return; + } } else { if (!data.title) { this.toast('请输入活动标题'); return; } - if (!data.date) { - this.toast('请选择活动日期'); + if (!data.start_date) { + this.toast('请选择活动起始日期'); return; } - if (!data.live_address) { - this.toast('请输入直播地址'); + if (!data.end_date) { + this.toast('请选择活动结束日期'); return; } + if (!data.online_url) { + this.toast('请输入线上链接地址'); + return; + } + if (!data.address) { + this.toast('请输入活动城市'); + return; + } + if (!data.detail_address) { + this.toast('请输入具体地址'); + return; + } + let flag = true; - data.schedules.forEach((item) => { - if (!item.start) { - flag = false; - } - if (!item.end) { - flag = false; - } - if (!item.topic) { - flag = false; - } + data.schedules.forEach((dayItem) => { + dayItem.forEach(item => { + if (!item.start) { + flag = false; + } + if (!item.end) { + flag = false; + } + if (!item.topic) { + flag = false; + } + }) }); if (!flag) { this.toast('请补充填写日程必填信息'); @@ -154,45 +199,48 @@ let localMethods = { }, }; Page({ - /** - * 页面的初始数据 - */ data: { - isStar:false, - isEnd:false, - starTime:'', - endTime:'', + isStar: false, + isEnd: false, + starTime: '', + endTime: '', id: '', + activeNames: 0, detailType: 0, title: '', date: '', type: '课程', - form:[], - method:'小程序报名', + form: ['1'], + mode: '小程序报名', address: '', addressName: '', + registerUrl:'', desc: '', - schedule: [ - { - start: '', - end: '', - topic: '', - speaker: '', - desc: '', - }, - ], - typeList:[ + betweenDay: [], + schedule: [{ + start: '', + end: '', + topic: '', + speakerList: [{ + name: '', + title: '', + mail: '' + }] + }, ], + allSchedule: [], + typeList: [ '课程', 'MSG', '赛事', '其他' ], - signUpList:[ + modeList: [ '小程序报名', '跳转其他链接报名' ], datePopShow: false, timePopShow: false, + formShow: false, curDate: new Date().getTime(), currentDate: new Date().getTime(), minDate: new Date().getTime(), @@ -201,6 +249,9 @@ Page({ start: '', end: '', currentTime: '08:00', + method:1, + actegory:1, + tiemIndex: 1, minTime: 8, maxTime: 22, minEndTime: 8, @@ -209,7 +260,6 @@ Page({ if (type === 'minute') { return options.filter((option) => option % 15 === 0); } - return options; }, endTimePopShow: false, @@ -231,11 +281,13 @@ Page({ }); if ((this.data.id && this.data.detailType == 5) || (this.data.id && this.data.detailType == 4)) { remoteMethods.getDraftDetail((res) => { + res.activity_type == 3 ? res.activity_type = [1, 2] : res.activity_type = [res.activity_type] this.setData({ title: res.title, - date: res.date, - type: res.activity_form, - liveAddress: res.live_address || '', + starTime: res.starTime, + endTime: res.endTime, + form: res.activity_type, + liveAddress: res.online_url || '', longitude: res.longitude || '', latitude: res.latitude || '', address: res.address || '', @@ -259,25 +311,72 @@ Page({ setStar: function () { this.setData({ datePopShow: true, - isStar:true + isStar: true }); }, setEnd: function () { this.setData({ datePopShow: true, - isEnd:true + isEnd: true + }); + }, + dateChange(event) { + this.setData({ + activeNames: event.detail, }); }, - onTypeShow:function () { + onTypeShow: function () { + this.setData({ + typeShow: true, + }) + }, + getBetweenDateStr(start, end) { + let startDate = Date.parse(start); + let endDate = Date.parse(end); + if (startDate > endDate) { + return false; + } else if (startDate == endDate) { + return [start] + } + let result = []; + let beginDay = start.split("-"); + let endDay = end.split("-"); + let diffDay = new Date(); + let dateList = new Array; + let i = 0; + diffDay.setDate(beginDay[2]); + diffDay.setMonth(beginDay[1] - 1); + diffDay.setFullYear(beginDay[0]); + result.push(start); + while (i == 0) { + let countDay = diffDay.getTime() + 24 * 60 * 60 * 1000; + diffDay.setTime(countDay); + dateList[2] = diffDay.getDate(); + dateList[1] = diffDay.getMonth() + 1; + dateList[0] = diffDay.getFullYear(); + if (String(dateList[1]).length == 1) { + dateList[1] = "0" + dateList[1] + } + if (String(dateList[2]).length == 1) { + dateList[2] = "0" + dateList[2] + } + result.push(dateList[0] + "-" + dateList[1] + "-" + dateList[2]); + if (dateList[0] == endDay[0] && dateList[1] == endDay[1] && dateList[2] == endDay[2]) { + i = 1; + } + } + return result; + }, + onModeShow: function () { this.setData({ - typeShow:true, + modeShow: true, }) }, dateCancel: function () { this.setData({ datePopShow: false, - isStar:false, - isEnd:false + isStar: false, + isEnd: false }); }, dateOnInput: function (e) { @@ -286,19 +385,77 @@ Page({ }); }, dateConfirm: function () { + let time = new Date(this.data.currentDate).Format('yyyy-MM-dd') + let between = [] if (this.data.isStar) { - this.setData({ - starTime: new Date(this.data.currentDate).Format('yyyy-MM-dd') - }) + if (this.data.endTime) { + between = this.getBetweenDateStr(time, this.data.endTime) + if (between) { + let allSchedule = [] + for (let i = 0; i < between.length; i++) { + allSchedule.push( + [{ + start: '', + end: '', + topic: '', + speakerList: [{ + name: '', + title: '', + mail: '' + }] + }, ], + ) + } + between.length > 10 ? localMethods.toast('暂只支持10天以内活动') : + this.setData({ + starTime: time, + betweenDay: between, + allSchedule: allSchedule + }) + } else { + localMethods.toast('请正确填写日期') + } + } else { + this.setData({ + starTime: time + }) + } + } else if (this.data.starTime) { + between = this.getBetweenDateStr(this.data.starTime, time) + if (between) { + let allSchedule = [] + for (let i = 0; i < between.length; i++) { + allSchedule.push( + [{ + start: '', + end: '', + topic: '', + speakerList: [{ + name: '', + title: '', + mail: '' + }] + }, ], + ) + } + between.length > 10 ? localMethods.toast('暂只支持10天以内活动') : + this.setData({ + endTime: time, + betweenDay: between, + allSchedule: allSchedule + }) + } else { + localMethods.toast('请正确填写日期') + } } else { - this.setData({ - endTime: new Date(this.data.currentDate).Format('yyyy-MM-dd') - }) + this.setData({ + endTime: time + }) } this.setData({ datePopShow: false, - isStar:false, - isEnd:false + isStar: false, + isEnd: false }); }, radioOnChange(e) { @@ -311,6 +468,32 @@ Page({ type: e.detail, }); }, + typeClick(e) { + this.setData({ + actegory: e.currentTarget.dataset.index, + }); + }, + addSpeaker(e) { + const length = this.data.allSchedule[e.currentTarget.dataset.dayindex][e.currentTarget.dataset.index].speakerList.length; + const key = `allSchedule[${e.currentTarget.dataset.dayindex}][${e.currentTarget.dataset.index}].speakerList[${length}]`; + this.setData({ + [key]: { + name: '', + title: '', + mail: '' + } + }) + }, + modeRadioOnChange: function (e) { + this.setData({ + mode: e.detail, + }); + }, + radioClick(e) { + this.setData({ + method: e.currentTarget.dataset.index, + }); + }, selAddress() { wx.chooseLocation({ success: function (res) { @@ -328,51 +511,84 @@ Page({ addressName: e.detail.value, }); }, + registerUrlInput(e) { + this.setData({ + registerUrl: e.detail.value, + }); + }, descInput(e) { this.setData({ desc: e.detail.value, }); }, scheduleTitleInput(e) { - const key = `schedule[${e.currentTarget.dataset.index}].topic`; + const key = `allSchedule[${e.currentTarget.dataset.dayindex}][${e.currentTarget.dataset.index}].topic`; this.setData({ - [key]: e.detail.value, - }); + [key]: e.detail.value + }) + }, + nameInput(e) { + const key = `allSchedule[${e.currentTarget.dataset.dayindex}][${e.currentTarget.dataset.outindex}].speakerList[${e.currentTarget.dataset.innerindex}].name`; + this.setData({ + [key]: e.detail.value + }) + }, + speakerTitleInput(e) { + const key = `allSchedule[${e.currentTarget.dataset.dayindex}][${e.currentTarget.dataset.outindex}].speakerList[${e.currentTarget.dataset.innerindex}].title`; + this.setData({ + [key]: e.detail.value + }) + }, + mailInput(e) { + const key = `allSchedule[${e.currentTarget.dataset.dayindex}][${e.currentTarget.dataset.outindex}].speakerList[${e.currentTarget.dataset.innerindex}].mail`; + this.setData({ + [key]: e.detail.value + }) }, speakerInput(e) { - const key = `schedule[${e.currentTarget.dataset.index}].speaker`; + const key = `allSchedule[${e.currentTarget.dataset.dayindex}][${e.currentTarget.dataset.index}].speaker`; this.setData({ [key]: e.detail.value, }); }, scheduleDescInput(e) { - const key = `schedule[${e.currentTarget.dataset.index}].desc`; + const key = `allSchedule[${e.currentTarget.dataset.dayindex}][${e.currentTarget.dataset.index}].desc`; this.setData({ [key]: e.detail.value, }); }, - addSchedule() { - let arrTemp = this.data.schedule; - arrTemp.push({ + addSchedule(e) { + let arrTemp = this.data.allSchedule; + let index = e.currentTarget.dataset.index + arrTemp[index].push({ start: '', end: '', topic: '', - speaker: '', - desc: '', - }); + speakerList: [] + }) this.setData({ - schedule: arrTemp, - }); + allSchedule: arrTemp + }) }, delSchedule(e) { - let arrTemp = this.data.schedule; - arrTemp.splice(e.currentTarget.dataset.index, 1); + let index = e.currentTarget.dataset.index + let arrTemp = this.data.allSchedule; + arrTemp[e.currentTarget.dataset.dayindex].splice(index, 1); this.setData({ - schedule: arrTemp, - }); + allSchedule: arrTemp + }) + }, + delSpeaker(e) { + let arrTemp = this.data.allSchedule[e.currentTarget.dataset.index][e.currentTarget.dataset.outindex].speakerList; + let key = `allSchedule[${e.currentTarget.dataset.index}][${e.currentTarget.dataset.outindex}].speakerList`; + arrTemp.splice(e.currentTarget.dataset.innerindex, 1); + this.setData({ + [key]: arrTemp + }) }, selTime: function (e) { this.setData({ + tiemIndex: e.currentTarget.dataset.dayindex, timePopShow: true, startTimeIndex: e.currentTarget.dataset.index, }); @@ -388,7 +604,7 @@ Page({ }); }, timeConfirm: function () { - const key = `schedule[${this.data.startTimeIndex}].start`; + const key = `allSchedule[${this.data.tiemIndex}][${this.data.startTimeIndex}].start`; this.setData({ [key]: this.data.currentTime, timePopShow: false, @@ -404,8 +620,19 @@ Page({ typeShow: false, }); }, + modeCancel: function () { + this.setData({ + modeShow: false, + }); + }, + modeConfirm: function () { + this.setData({ + modeShow: false, + }); + }, selEndTime: function (e) { this.setData({ + tiemIndex: e.currentTarget.dataset.dayindex, endTimePopShow: true, endTimeIndex: e.currentTarget.dataset.index, }); @@ -416,7 +643,7 @@ Page({ }); }, endTimeConfirm: function () { - const key = `schedule[${this.data.endTimeIndex}].end`; + const key = `allSchedule[${this.data.tiemIndex}][${this.data.endTimeIndex}].end`; this.setData({ [key]: this.data.currentEndTime, endTimePopShow: false, @@ -439,30 +666,58 @@ Page({ }, publish() { let postData = null; - if (this.data.form[0] === 1) { + if (this.data.form.length === 0) { + localMethods.toast('请选择活动类型') + return false + } + if (this.data.form[0] - 0 === 1 && this.data.form.length !== 2) { postData = { title: this.data.title, - date: this.data.date, - activity_form: 1, + activity_category: this.data.actegory, + activity_type:1, + register_method:this.data.method, + start_date: this.data.starTime, + detail_address: this.data.addressName, + end_date: this.data.endTime, synopsis: this.data.desc, address: this.data.address, - detail_address: this.data.addressName, longitude: this.data.longitude, latitude: this.data.latitude, poster: this.data.topicSelIndex, - schedules: this.data.schedule, + schedules: this.data.allSchedule, + }; + } else if (this.data.form[0] - 0 === 2 && this.data.form[0].length !== 2) { + postData = { + title: this.data.title, + activity_category: this.data.actegory, + register_method:this.data.method, + activity_type:2, + start_date: this.data.starTime, + end_date: this.data.endTime, + synopsis: this.data.desc, + online_url: this.data.liveAddress, + longitude: this.data.longitude, + latitude: this.data.latitude, + poster: this.data.topicSelIndex, + schedules: this.data.allSchedule, }; + this.data.method === 2 ? postData[register_url] = this.data.registerUrl:'' } else { postData = { title: this.data.title, - date: this.data.date, - activity_form: 2, + activity_category: this.data.actegory, + register_method:this.data.method, + activity_type:3, + online_url: this.data.liveAddress, + start_date:this.data.starTime, + end_date:this.data.endTime, synopsis: this.data.desc, - live_address: this.data.liveAddress, + address: this.data.address, + detail_address: this.data.addressName, longitude: this.data.longitude, latitude: this.data.latitude, poster: this.data.topicSelIndex, - schedules: this.data.schedule, + schedules: this.data.allSchedule, }; } if (!localMethods.validation(postData)) { @@ -470,36 +725,58 @@ Page({ } remoteMethods.addEvents(postData, () => { wx.redirectTo({ - url: '/package-events/publish/success?form=2', + url: '/package-events/publish/success?type=2', }); }); }, saveDraft() { let postData = null; - if (this.data.form[0] === 1) { + if (this.data.form[0] === 1 && this.data.form.length !== 2) { postData = { title: this.data.title, - date: this.data.date, - activity_form: 1, + activity_category: 1, + activity_type:3, + start_date: this.data.starTime, + end_date: this.data.endTime, synopsis: this.data.desc, address: this.data.address, detail_address: this.data.addressName, longitude: this.data.longitude, latitude: this.data.latitude, poster: this.data.topicSelIndex, - schedules: this.data.schedule, + schedules: this.data.allSchedule, + }; + } else if (this.data.form[0] === 2 && this.data.form.length !== 2) { + postData = { + title: this.data.title, + activity_category: 2, + activity_type:3, + register_method:1, + start_date: this.data.starTime, + end_date: this.data.endTime, + synopsis: this.data.desc, + online_url: this.data.liveAddress, + longitude: this.data.longitude, + latitude: this.data.latitude, + poster: this.data.topicSelIndex, + schedules: this.data.allSchedule, }; } else { postData = { title: this.data.title, - date: this.data.date, - activity_form: 2, + activity_category: 3, + activity_type:3, + register_method:1, + online_url: this.data.liveAddress, + start_date:this.data.starTime, + end_date:this.data.endTime, synopsis: this.data.desc, - live_address: this.data.liveAddress, + address: this.data.address, + detail_address: this.data.addressName, longitude: this.data.longitude, latitude: this.data.latitude, poster: this.data.topicSelIndex, - schedules: this.data.schedule, + schedules: this.data.allSchedule, }; } if (!localMethods.validation(postData)) { @@ -507,7 +784,7 @@ Page({ } remoteMethods.saveDraft(postData, () => { wx.redirectTo({ - url: '/package-events/publish/success?form=1', + url: '/package-events/publish/success?type=1', }); }); }, @@ -516,47 +793,78 @@ Page({ }, editScheduleConfirm() { let postData = null; - if (this.data.form[0] === 1) { + if (this.data.form[0] === 1 && this.data.form.length !== 2) { postData = { title: this.data.title, - date: this.data.date, - activity_form: 1, + activity_category: 1, + activity_type:3, + start_date: this.data.starTime, + end_date: this.data.endTime, synopsis: this.data.desc, address: this.data.address, detail_address: this.data.addressName, longitude: this.data.longitude, latitude: this.data.latitude, poster: this.data.topicSelIndex, - schedules: this.data.schedule, + schedules: this.data.allSchedule, + }; + } else if (this.data.form[0] === 2 && this.data.form.length !== 2) { + postData = { + title: this.data.title, + activity_category: 2, + activity_type:3, + register_method:1, + start_date: this.data.starTime, + end_date: this.data.endTime, + synopsis: this.data.desc, + online_url: this.data.liveAddress, + longitude: this.data.longitude, + latitude: this.data.latitude, + poster: this.data.topicSelIndex, + schedules: this.data.allSchedule, }; } else { postData = { title: this.data.title, - date: this.data.date, - activity_form: 2, + activity_category: 3, + activity_type:3, + register_method:1, + online_url: this.data.liveAddress, + // type: this.data.type, + start_date:this.data.starTime, + end_date:this.data.endTime, synopsis: this.data.desc, - live_address: this.data.liveAddress, + address: this.data.address, + detail_address: this.data.addressName, longitude: this.data.longitude, latitude: this.data.latitude, poster: this.data.topicSelIndex, - schedules: this.data.schedule, + schedules: this.data.allSchedule, }; } if (!localMethods.validation(postData)) { return; } - postData.schedules = JSON.stringify(this.data.schedule); + postData.schedules = JSON.stringify(this.data.allSchedule); remoteMethods.saveDraft(postData, () => { wx.redirectTo({ - url: '/package-events/publish/success?form=3', + url: '/package-events/publish/success?type=3', }); }); }, toPoster() { - const address = this.data.form[0] == 1 ? this.data.addressName : ''; - const liveAddress = this.data.form[0] == 2 ? this.data.liveAddress : ''; + let activityType = 0 + if (this.data.form[0] == 1 && this.data.form.length !== 2) { + activityType = 1 + } else if (this.data.form[0] == 2) { + activityType = 2 + } else { + activityType = 3 + } + const address = this.data.addressName; + const liveAddress = this.data.liveAddress; wx.navigateTo({ - url: `/package-events/events/poster?title=${this.data.title}&date=${this.data.date}&address=${address}&poster=${this.data.topicSelIndex}&liveAddress=${liveAddress}`, + url: `/package-events/events/poster?title=${this.data.title}&starTime=${this.data.starTime}&endTime=${this.data.endTime}&address=${address}&poster=${this.data.topicSelIndex}&liveAddress=${liveAddress}&activity_type=${activityType}`, }); }, -}); +}); \ No newline at end of file diff --git a/src/mindspore/package-events/publish/publish.wxml b/src/mindspore/package-events/publish/publish.wxml index 9af5369a632269da692e7ed77017155f59bb4a64..87a1604c2514f6c4b3ccdfdd3b01e56ae5144d72 100644 --- a/src/mindspore/package-events/publish/publish.wxml +++ b/src/mindspore/package-events/publish/publish.wxml @@ -7,7 +7,8 @@ 活动名称 * - + @@ -45,20 +46,26 @@ * - - + + 线下 - - + + 线上 - + - 线上链接 - * - + + 线上链接 + * + + @@ -71,75 +78,135 @@ - 具体地址 - * - - - - 报名方式 + 具体地址 * + + + + + + 报名方式 + * + + - {{method}} + {{mode}} + + + 报名链接 + * + + + 活动回放链接 - + - 活动回放链接请在活动结束后补充 + + 活动回放链接请在活动结束后补充 + 活动简介 - - - - - 议题 {{index+1}} - 日程 - - - + + + 活动日程{{betweenDay[dayIndex]}} + + + + 议题 {{index+1}} + 日程 + + + + + + + + 时间 + * + + + {{item.start||'请选择'}} + + {{item.end||'请选择'}} + + + + + 议题 + * + + + + + + Speaker {{index1+1}} + + + + + + + Name + * + + + + + Title + + + + + Mail + * + + Mail + + + + + + 继续添加Speaker + - - - - 时间 - * - - - {{item.start||'请选择'}} - - {{item.end||'请选择'}} + + + 继续添加议题 - - - - 议题 - * - - - - - Speaker - - - - Title - - - - - + 继续添加 - + + + 海报主题 @@ -212,8 +279,9 @@ 选择起始日期 - 选择结束日期 - + 选择结束日期 + @@ -225,8 +293,8 @@ 选择活动类型 - - + + {{item}} @@ -238,28 +306,29 @@ - + - 选择活动类型 - - - - - {{item}} + 选择报名方式 + + + + + {{item}} - - + + 选择日程开始时间 - + @@ -269,7 +338,8 @@ 选择日程结束时间 - + diff --git a/src/mindspore/package-events/publish/publish.wxss b/src/mindspore/package-events/publish/publish.wxss index a25cbf6b7717322edbe2de83adf150b3d96d724c..0b97b71c8cbb5cb02dc25b506f1f4abdc30a6830 100644 --- a/src/mindspore/package-events/publish/publish.wxss +++ b/src/mindspore/package-events/publish/publish.wxss @@ -36,11 +36,41 @@ input { } .checkbox-class { + margin-left: 0 !important; + padding-left: 20rpx; font-size: 28rpx; } .offline { margin-right: 40rpx; } +.van-collapse-item { + background-color: #40ADFF; + margin: 20rpx 0; + border-radius: 10rpx; + overflow: hidden; +} +.van-collapse-item .van-cell{ + background-color: #40ADFF; + color: #ffffff; + font-size: 32rpx; +} +.container .add-speaker { + border: 2rpx dashed #f9762d; + border-radius: 8rpx; + margin: 0 auto 30rpx; + width: 92%; + height: 65rpx; + text-align: center; + line-height: 65rpx; + color: #6d7278; + font-size: 28rpx; +} +.van-collapse-item .van-icon { + color: #fff; +} +.date-title { + margin-left: 30rpx; +} .checkbox { display: flex; } @@ -134,7 +164,6 @@ input { } .container .form .meeting-desc { - margin-top: 20rpx; padding-top: 30rpx; align-items: flex-start; height: 244rpx; @@ -361,7 +390,6 @@ input { width: 300rpx; height: 150rpx; } - .container .relative { position: relative; } @@ -387,4 +415,41 @@ input { height: 28rpx; margin-right: 15rpx; vertical-align: middle; +} +.container .form .schedule .header .del-btn image { + height: 40rpx; + width: 40rpx; +} +.container .add-speaker { + border: 2rpx dashed #f9762d; + border-radius: 8rpx; + margin: 0 auto 30rpx; + width: 92%; + height: 65rpx; + text-align: center; + line-height: 65rpx; + color: #6d7278; + font-size: 28rpx; +} +.container .speaker-wrapper { + border: 2rpx dashed #f9762d; + border-radius: 8rpx; + margin: 0 auto 20rpx; + width: 92%; +} + +.container .speaker-wrapper .speaker-header { + font-size: 34rpx; +} + +.container .form .speaker-wrapper .form-item { + padding: 0 30rpx !important; +} +.container .form .schedule .speaker-del-wrapper { + justify-content: space-between; +} + +.container .form .schedule .speaker-del-wrapper .del-btn image { + width: 30rpx; + height: 30rpx; } \ No newline at end of file diff --git a/src/mindspore/package-events/sign-up/career-direction.js b/src/mindspore/package-events/sign-up/career-direction.js new file mode 100644 index 0000000000000000000000000000000000000000..9b34362b3ccb700a0edf11faea748392543d4ea8 --- /dev/null +++ b/src/mindspore/package-events/sign-up/career-direction.js @@ -0,0 +1,167 @@ +const { + all +} = require("../../utils/underscore") + +Page({ + data: { + checkedList: [], + seachList:[], + addShow: false, + renderList:[], + allCareer: [{ + value: '网络方向', + isActive: false + }, + { + value: '运维方向', + isActive: false + }, + { + value: '数据库方向', + isActive: false + }, + { + value: '开发方向', + isActive: false + }, + { + value: '测试方向', + isActive: false + }, + { + value: '项目产品方向', + isActive: false + }, + { + value: '安全方向', + isActive: false + }, + { + value: '新型产业', + isActive: false + }, + { + value: '技术管理和架构', + isActive: false + }, + ], + seachValue: '', + newTag: '' + }, + onShow() { + wx.getStorageSync('addNew') + this.setData({ + renderList:this.data.allCareer + }) + }, + itemClick(e) { + let renderList = this.data.renderList + let index = e.currentTarget.dataset.index + if (this.data.checkedList.length >= 3 && !renderList[index].isActive) { + wx.showToast({ + title: "最多可选3个标签", + icon: 'error', + }); + } else { + renderList[index].isActive = !renderList[index].isActive + let pushItem = renderList[index] + pushItem['index'] = index + if (renderList[index].isActive) { + this.data.checkedList.push(pushItem) + } else { + let delIndex = this.data.checkedList.findIndex(item => { + return item.index == index + }) + this.data.checkedList.splice(delIndex, 1) + } + } + this.setData({ + renderList: renderList, + checkedList: this.data.checkedList + }) + }, + onSearch(e) { + let value = e.detail; + let seach = this.data.allCareer.filter(item => { + return item.value.includes(value) + }) + this.setData({ + renderList:seach + }) + }, + onCancel() { + this.setData({ + renderList:this.data.allCareer + }) + }, + cancelChecked() { + this.data.renderList.forEach(item => { + item.isActive = false + }) + this.setData({ + checkedList: [], + renderList: this.data.renderList + }) + }, + confirmChecked() { + let pages = getCurrentPages(); + let prevPage = pages[pages.length - 2]; //上一个页面 + //直接调用上一个页面的setData()方法,把数据存到上一个页面中去 + prevPage.setData({ + directionList: this.data.checkedList + }) + + wx.navigateBack({ + delta: 1 + }) + }, + addNew() { + this.setData({ + addShow: true + }) + }, + addCancel() { + this.setData({ + addShow: false + }) + }, + addConfirm() { + + if (this.data.checkedList.length >= 3) { + wx.showToast({ + title: "最多可选3个标签", + icon: 'error', + }); + } else { + let length = this.data.renderList.length + let newTag = { + value: this.data.newTag, + index: length, + isActive: true + } + this.data.checkedList.push(newTag) + this.data.renderList.push(newTag) + this.setData({ + addShow: false, + newTag: '', + checkedList: this.data.checkedList, + renderList: this.data.renderList + }) + } + + }, + tagInput(e) { + this.setData({ + newTag: e.detail.value, + }); + }, + back() { + if (this.data.isScan) { + wx.switchTab({ + url: '/pages/events/events' + }) + return; + } + wx.navigateBack(); + } +}) \ No newline at end of file diff --git a/src/mindspore/package-events/sign-up/career-direction.json b/src/mindspore/package-events/sign-up/career-direction.json new file mode 100644 index 0000000000000000000000000000000000000000..77623236e940325e0500253e4378bd75f889409c --- /dev/null +++ b/src/mindspore/package-events/sign-up/career-direction.json @@ -0,0 +1,8 @@ +{ + "usingComponents": { + "van-search": "@vant/weapp/search/index" + }, + "navigationBarTitleText": "职业方向", + "navigationBarBackgroundColor": "#40ADFF", + "navigationBarTextStyle": "white" +} \ No newline at end of file diff --git a/src/mindspore/package-events/sign-up/career-direction.wxml b/src/mindspore/package-events/sign-up/career-direction.wxml new file mode 100644 index 0000000000000000000000000000000000000000..df7bdc946ab9bae52eb0e9d70a5551ff0519338b --- /dev/null +++ b/src/mindspore/package-events/sign-up/career-direction.wxml @@ -0,0 +1,40 @@ + + + + + + + + {{item.value}} + + + + + 个人岗位从事方向 + + + {{item.value}} + + + 新建其他 + + + + + + + + + + 新建标签 + + + + + + + + \ No newline at end of file diff --git a/src/mindspore/package-events/sign-up/career-direction.wxss b/src/mindspore/package-events/sign-up/career-direction.wxss new file mode 100644 index 0000000000000000000000000000000000000000..86d713d0e1ae859a355f23130da4a15deac86365 --- /dev/null +++ b/src/mindspore/package-events/sign-up/career-direction.wxss @@ -0,0 +1,105 @@ +.container { + padding: 0 0 129rpx; + background-color: #F5F7FA; +} + +.career-top { + margin-top: 30rpx; + background-color: #ffffff; +} +.career-body { + padding: 40rpx 30rpx 0; +} +.title { + font-size: 40rpx; +} +.career-item { + margin-right: 15rpx; + margin-bottom: 20rpx; + padding: 8rpx 14rpx; + color: #6189FF; + font-size: 27rpx; + border: 1px solid #6189FF; + border-radius: 30rpx; + background: rgba(97, 137, 255, 0.3); +} +.all-list { + display: flex; + flex-wrap: wrap; + margin-top: 40rpx; + margin-bottom: 100rpx; +} +.checked-list { + display: flex; + flex-wrap: wrap; + padding: 0 30rpx; +} +.all-item { + margin-right: 15rpx; + margin-bottom: 30rpx; + padding: 8rpx 14rpx; + border-radius: 30rpx; + font-size: 27rpx; + color: #9FA8B1; + border: 1px solid transparent; + background-color: #ffffff; +} + +.career-item { + margin-right: 15rpx; + padding: 8rpx 14rpx; + color: #6189FF; + font-size: 27rpx; + border: 1px solid #6189FF; + border-radius: 30rpx; + background: rgba(97, 137, 255, 0.3); +} + +.create-new { + color: #40ADFF; + margin-right: 15rpx; + margin-bottom: 30rpx; + padding: 8rpx 18rpx; + border-radius: 30rpx; + font-size: 27rpx; + border: 1px dashed #40ADFF; +} +.create-new image { + margin-right: 10rpx; + width: 20rpx; + height: 20rpx; +} +.tag { + color: #81888f; + padding: 40rpx; + box-sizing: content-box; + background-color: rgba(159, 168, 177, 0.13); +} + +.btn-wrapper { + display: flex; + align-items: center; + justify-content: space-between; + height: 90rpx; + font-size: 36rpx; + margin: 60rpx 0; +} + + .btn-wrapper .confirm { + height: 100%; + width: 320rpx; + text-align: center; + line-height: 90rpx; + color: #fff; + background-color: #40ADFF; +} + + .btn-wrapper .cancel { + height: 100%; + width: 320rpx; + text-align: center; + line-height: 90rpx; + color: #40ADFF; + background-color: #fff; + border: 1px solid #40ADFF; +} \ No newline at end of file diff --git a/src/mindspore/package-events/sign-up/career-name.js b/src/mindspore/package-events/sign-up/career-name.js new file mode 100644 index 0000000000000000000000000000000000000000..0bbd58dc1b918494f0ce297f9b84574cf9c9adf4 --- /dev/null +++ b/src/mindspore/package-events/sign-up/career-name.js @@ -0,0 +1,212 @@ +const { + all +} = require("../../utils/underscore") + +Page({ + data: { + checkedList: [], + addShow: false, + allCareer: [{ + value: '管理', + isActive: false + }, + { + value: '后端开发', + isActive: false + }, + { + value: '前端开发', + isActive: false + }, + { + value: '移动开发', + isActive: false + }, + { + value: '测试', + isActive: false + }, + { + value: 'DBA', + isActive: false + }, + { + value: '运维', + isActive: false + }, + { + value: '产品经理', + isActive: false + }, + { + value: '产品设计师', + isActive: false + }, + { + value: '视觉设计', + isActive: false + }, + { + value: '交互设计', + isActive: false + }, + { + value: '用户研究', + isActive: false + }, + { + value: '市场/营销', + isActive: false + }, + { + value: '媒介/公关', + isActive: false + }, + { + value: '品牌/广告', + isActive: false + }, + { + value: '渠道/推广', + isActive: false + }, + { + value: '活动策划', + isActive: false + }, + { + value: '用户运营', + isActive: false + }, + { + value: '产品运营', + isActive: false + }, + { + value: '新媒体运营', + isActive: false + }, + { + value: '内容运营', + isActive: false + }, + { + value: '社群运营', + isActive: false + }, + { + value: '财务', + isActive: false + }, + { + value: '人力资源(HR)', + isActive: false + }, + { + value: '行政', + isActive: false + }, + ], + seachValue: '', + newTag: '' + }, + + itemClick(e) { + let allCareer = this.data.allCareer + let index = e.currentTarget.dataset.index + if (this.data.checkedList.length >= 3 && !allCareer[index].isActive) { + wx.showToast({ + title: "最多可选3个标签", + icon: 'error', + }); + } else { + allCareer[index].isActive = !allCareer[index].isActive + let pushItem = allCareer[index] + pushItem['index'] = index + if (allCareer[index].isActive) { + this.data.checkedList.push(pushItem) + } else { + let delIndex = this.data.checkedList.findIndex(item => { + return item.index == index + }) + this.data.checkedList.splice(delIndex, 1) + } + } + this.setData({ + allCareer: allCareer, + checkedList: this.data.checkedList + }) + }, + onSearch() { + console.log(111); + }, + cancelChecked() { + this.data.allCareer.forEach(item => { + item.isActive = false + }) + this.setData({ + checkedList: [], + allCareer: this.data.allCareer + }) + }, + confirmChecked() { + let pages = getCurrentPages(); + let prevPage = pages[pages.length - 2]; //上一个页面 + //直接调用上一个页面的setData()方法,把数据存到上一个页面中去 + prevPage.setData({ + nameList: this.data.checkedList + }) + + wx.navigateBack({ + delta: 1 + }) + }, + addNew() { + this.setData({ + addShow: true + }) + }, + addCancel() { + this.setData({ + addShow: false + }) + }, + addConfirm() { + if (this.data.checkedList.length >= 3) { + wx.showToast({ + title: "最多可选3个标签", + icon: 'error', + }); + } else { + let length = this.data.allCareer.length + let newTag = { + value: this.data.newTag, + index: length, + isActive: true + } + this.data.checkedList.push(newTag) + this.data.allCareer.push(newTag) + this.setData({ + addShow: false, + newTag: '', + checkedList: this.data.checkedList, + allCareer: this.data.allCareer + }) + } + + }, + tagInput(e) { + this.setData({ + newTag: e.detail.value, + }); + }, + back() { + if (this.data.isScan) { + wx.switchTab({ + url: '/pages/events/events' + }) + return; + } + wx.navigateBack(); + } +}) \ No newline at end of file diff --git a/src/mindspore/package-events/sign-up/career-name.json b/src/mindspore/package-events/sign-up/career-name.json new file mode 100644 index 0000000000000000000000000000000000000000..910d3947471a83ab4bfb3fa9cfcab64a68748845 --- /dev/null +++ b/src/mindspore/package-events/sign-up/career-name.json @@ -0,0 +1,8 @@ +{ + "usingComponents": { + "van-search": "@vant/weapp/search/index" + }, + "navigationBarTitleText": "职业名称", + "navigationBarBackgroundColor": "#40ADFF", + "navigationBarTextStyle": "white" +} \ No newline at end of file diff --git a/src/mindspore/package-events/sign-up/career-name.wxml b/src/mindspore/package-events/sign-up/career-name.wxml new file mode 100644 index 0000000000000000000000000000000000000000..eaa1eab010622874e64f70137f81e3c50bcc2352 --- /dev/null +++ b/src/mindspore/package-events/sign-up/career-name.wxml @@ -0,0 +1,38 @@ + + + + {{item.value}} + + + + + + + 个人目前所在岗位名称 + + + {{item.value}} + + + 新建其他 + + + + + + + + + + 新建标签 + + + + + + + + diff --git a/src/mindspore/package-events/sign-up/career-name.wxss b/src/mindspore/package-events/sign-up/career-name.wxss new file mode 100644 index 0000000000000000000000000000000000000000..c8c090bcc51802e6c08bcc35da9e1231bdf3f353 --- /dev/null +++ b/src/mindspore/package-events/sign-up/career-name.wxss @@ -0,0 +1,105 @@ +.container { + padding: 0 0 129rpx; + background-color: #F5F7FA; +} + +.career-top { + display: flex; + align-items: center; + padding: 20rpx 0; + flex-wrap: wrap; + margin-top: 30rpx; + padding: 20rpx 30rpx; + background-color: #ffffff; +} +.career-body { + padding: 40rpx 30rpx 0; +} +.title { + font-size: 40rpx; +} +.career-item { + margin-right: 15rpx; + padding: 8rpx 14rpx; + color: #6189FF; + font-size: 27rpx; + border: 1px solid #6189FF; + border-radius: 30rpx; + background: rgba(97, 137, 255, 0.3); +} +.all-list { + display: flex; + flex-wrap: wrap; + margin-top: 40rpx; + margin-bottom: 100rpx; +} +.all-item { + margin-right: 15rpx; + margin-bottom: 30rpx; + padding: 8rpx 14rpx; + border-radius: 30rpx; + font-size: 27rpx; + color: #9FA8B1; + border: 1px solid transparent; + background-color: #ffffff; +} + +.career-item { + margin-right: 15rpx; + padding: 8rpx 14rpx; + color: #6189FF; + font-size: 27rpx; + border: 1px solid #6189FF; + border-radius: 30rpx; + background: rgba(97, 137, 255, 0.3); +} + +.create-new { + color: #40ADFF; + margin-right: 15rpx; + margin-bottom: 30rpx; + padding: 8rpx 18rpx; + border-radius: 30rpx; + font-size: 27rpx; + border: 1px dashed #40ADFF; +} +.create-new image { + margin-right: 10rpx; + width: 20rpx; + height: 20rpx; +} +.tag { + color: #81888f; + padding: 40rpx; + box-sizing: content-box; + background-color: rgba(159, 168, 177, 0.13); +} + +.btn-wrapper { + display: flex; + align-items: center; + justify-content: space-between; + height: 90rpx; + font-size: 36rpx; + margin: 60rpx 0; +} + + .btn-wrapper .confirm { + height: 100%; + width: 320rpx; + text-align: center; + line-height: 90rpx; + color: #fff; + background-color: #40ADFF; +} + + .btn-wrapper .cancel { + height: 100%; + width: 320rpx; + text-align: center; + line-height: 90rpx; + color: #40ADFF; + background-color: #fff; + border: 1px solid #40ADFF; +} + diff --git a/src/mindspore/package-events/sign-up/sign-up.js b/src/mindspore/package-events/sign-up/sign-up.js index 3872e6d8b81360330e18565b98bdc4d34d15a7c9..49b8c00267a12a7f58b3fdba766d70e13a4c0565 100644 --- a/src/mindspore/package-events/sign-up/sign-up.js +++ b/src/mindspore/package-events/sign-up/sign-up.js @@ -38,6 +38,18 @@ let localMethods = { this.toast('请输入您的姓名'); return; } + if (!that.data.wechat) { + this.toast('请输入您的微信号'); + return; + } + if (!that.data.gender) { + this.toast('请选择性别'); + return; + } + if (!that.data.age) { + this.toast('请选择年龄段'); + return; + } if (!validationConfig.phone.regex.test(that.data.tel)) { this.toast('请输入正确的手机号码'); return; @@ -47,7 +59,19 @@ let localMethods = { return; } if (!that.data.enterprise) { - this.toast('请输入您的工作单位名称'); + this.toast('请输入您的公司名称或学校'); + return; + } + if (that.data.directionList.length === 0) { + this.toast('请选择职业方向'); + return; + } + if (that.data.nameList.length === 0) { + this.toast('请选择职业名称'); + return; + } + if (!that.data.work) { + this.toast('请选择工作年限'); return; } return true; @@ -70,11 +94,33 @@ Page({ tel: '', mail: '', enterprise: '', - occupation: '', gitee: '', id: '', + wechat:'', eventTitle: '', + directionList:[], + nameList:[], poster: 1, + gender:0, + ageShow:false, + workShow:false, + age:'', + work:'', + ageList:[ + '18岁以下', + '18-25', + '26-30', + '31-40', + '41-50', + '51-60', + '61以上' + ], + workList:[ + '0-3(不包含3年)', + '3-5(不包含5年)', + '5-10(不包含10年)', + '10年及以上', + ] }, /** @@ -93,14 +139,21 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { - remoteMethods.getUserInfo((res) => { + let pages = getCurrentPages(); + let currPage = pages[pages.length - 1]; + remoteMethods.getUserInfo((res) => { this.setData({ name: res.name || '', tel: res.telephone || '', mail: res.email || '', enterprise: res.company || '', - occupation: res.profession || '', + nameList: res.profession || '', + directionList:res.career_direction || '', + gender:res.gender||'', gitee: res.gitee_name || '', + work:res.working_years||'', + directionList:currPage.__data__.directionList ||[], + nameList:currPage.__data__.nameList|| [], }); }); }, @@ -109,6 +162,11 @@ Page({ name: e.detail.value, }); }, + wechatInput(e) { + this.setData({ + wechat: e.detail.value, + }); + }, telInput(e) { this.setData({ tel: e.detail.value, @@ -119,6 +177,26 @@ Page({ mail: e.detail.value, }); }, + ageConfirm: function () { + this.setData({ + ageShow: false, + }); + }, + workConfirm: function () { + this.setData({ + workShow: false, + }); + }, + ageRadioOnChange(e) { + this.setData({ + age: e.detail, + }); + }, + workRadioOnChange(e) { + this.setData({ + work: e.detail, + }); + }, enterpriseInput(e) { this.setData({ enterprise: e.detail.value, @@ -129,6 +207,31 @@ Page({ occupation: e.detail.value, }); }, + careerNameClick() { + wx.navigateTo({ + url: `/package-events/sign-up/career-name` + }); + }, + radioOnChange(e) { + this.setData({ + gender: e.detail + }) + }, + onAgeShow() { + this.setData({ + ageShow: true, + }) + }, + onWorkShow() { + this.setData({ + workShow: true, + }) + }, + careerClick() { + wx.navigateTo({ + url: `/package-events/sign-up/career-direction` + }); + }, giteeInput(e) { this.setData({ gitee: e.detail.value, @@ -140,10 +243,15 @@ Page({ } const postData = { company: this.data.enterprise, + wx_account:this.data.wechat, + age:this.data.age, + gender:this.data.gender, email: this.data.mail, - gitee_name: this.data.gitee, + gitee_id: this.data.gitee, name: this.data.name, - profession: this.data.occupation, + career_direction:this.data.directionList, + profession: this.data.nameList, + working_years:this.data.work, telephone: this.data.tel, activity: this.data.id, }; diff --git a/src/mindspore/package-events/sign-up/sign-up.wxml b/src/mindspore/package-events/sign-up/sign-up.wxml index 91d185ebcdc797f3dac5dba9e7a127043106ce82..ce99c422f4a669290a9fe5de95b4afa05c185beb 100644 --- a/src/mindspore/package-events/sign-up/sign-up.wxml +++ b/src/mindspore/package-events/sign-up/sign-up.wxml @@ -2,7 +2,117 @@ - + + + 您的姓名 + * + + + + + + 微信号 + * + + + + + + 性别 + * + + + + + 男 + + + 女 + + + + + + + 年龄段 + * + + + {{ age }} + + + + + + 您的手机 + * + + + + + + 您的邮箱 + * + + + + + + 就职公司/所读学校 + * + + + + + + 职业方向 + * + + + + {{ item.value }} + + + + + + 职业名称 + * + + + + {{ item.value }} + + + + + + 工作年限 + * + + + {{ work }} + + + + + + 您的Gitee ID + + + @@ -18,4 +128,40 @@ + + + 选择年龄段 + + + + + {{item}} + + + + + + + + + + + + + 选择工作年限 + + + + + {{item}} + + + + + + + + + + \ No newline at end of file diff --git a/src/mindspore/package-events/sign-up/sign-up.wxss b/src/mindspore/package-events/sign-up/sign-up.wxss index 11bc23d832daf5f0904b01625a6c1016eb683549..e8c0988e1b16080b5e516c3e2bcea7f2db9b5df4 100644 --- a/src/mindspore/package-events/sign-up/sign-up.wxss +++ b/src/mindspore/package-events/sign-up/sign-up.wxss @@ -10,6 +10,22 @@ page { padding: 30rpx 0 129rpx 0; } +.container .form .form-item image { + width: 30rpx; + height: 30rpx; +} + +.container .form .form-item .arrow { + flex: 1; + display: flex; + justify-content: space-between; + align-items: center; +} + +.container .form .form-item .arrow .sel-data { + color: #6d7278; +} + input { flex: 1; } @@ -93,8 +109,28 @@ input { background-color: #40ADFF; } +.container .form .form-item .career { + position: relative; + justify-content: start; +} + +.career image { + position: absolute; + right: 0; +} + .container .commit .meeting-reset { color: #40ADFF; background-color: #fff; border: 1px solid #40ADFF; +} + +.checked-item { + margin-right: 15rpx; + padding: 6rpx 14rpx; + color: #6189FF; + font-size: 24rpx; + border: 1px solid #6189FF; + border-radius: 19px; + background: rgba(97, 137, 255, 0.3); } \ No newline at end of file diff --git a/src/mindspore/pages/events/events.js b/src/mindspore/pages/events/events.js index 116aeeb7cacd7508ee7e7aa0ab524493ca47104e..7bb8a7d0f1dcd4793d1e5d30fbe62d66ddff809e 100644 --- a/src/mindspore/pages/events/events.js +++ b/src/mindspore/pages/events/events.js @@ -91,31 +91,7 @@ Page({ noAuthDialogShow: false, user: '', // 模拟数据上线删除 - list: [{ - activity_type: 2, - address: null, - collection_id: null, - date: "2022-02-24", - detail_address: null, - end: "21:00", - enterprise: "openEuler", - id: 61, - join_url: "https://us06web.zoom.us/j/82607632995?pwd=UUY2OC9RSTlvOWZidFRHZG51aTRtdz09", - latitude: null, - live_address: null, - longitude: null, - poster: 1, - register_count: 0, - register_id: null, - replay_url: null, - sign_url: "https://openeuler-mini-program.obs.ap-southeast-1.myhuaweicloud.com/openeuler/miniprogram/activity/61/sign_url.jpeg", - start: "19:30", - status: 3, - synopsis: "openEuler OpenStack SIG于2020年7月由联通发起成立,经历1年多的发展,目前已吸引了电信、华胜天成、华云数据等多家公司的加入,拥有活跃开发者10+,SIG用户130+。在多个openEuler的版本中共发布了5个OpenStack版本,满足了用户的使用。并在容器化、虚拟化等方面与其他SIG密切交流,推动了iSula等技术与OpenStack的结合,还在OpenStack上游社区成功推动了openEuler的原生支持,是openEuler中表现优秀的SIG之一。这些成果离不开SIG成员的共同努力,在这一年多的社区开发活动中,SIG成员在开源开发和运营能力方面都有了较大提升,本次分享邀请了SIG的几个主力开发者和maintianer,以圆桌讨论的形式,给大家带来SIG运作经验的分享,与会者也可以参与其中,进行在线提问和讨论。希望大家踊跃报名,积极参与。", - title: "openEuler OpenStack SIG运作经验分享", - user: 647, - wx_code: "https://openeuler-mini-program.obs.ap-southeast-1.myhuaweicloud.com/openeuler/miniprogram/activity/61/wx_code.jpeg", - }], + list: [], actionShow: false, actions: [], underDialogShow: false, @@ -314,7 +290,6 @@ Page({ } }, toUpdateSchedule(e) { - console.log(e.currentTarget.dataset.id); wx.navigateTo({ url: `/package-events/events/event-detail?id=${e.currentTarget.dataset.id}&type=5`, }); diff --git a/src/mindspore/static/common/add.png b/src/mindspore/static/common/add.png new file mode 100644 index 0000000000000000000000000000000000000000..0f69b234d2cd00898965a11142a43b5b099b49a5 Binary files /dev/null and b/src/mindspore/static/common/add.png differ diff --git a/src/mindspore/static/events/speaker-del.svg b/src/mindspore/static/events/speaker-del.svg new file mode 100644 index 0000000000000000000000000000000000000000..74b160437907ee51103d2e21915c4f7dfdeae50c --- /dev/null +++ b/src/mindspore/static/events/speaker-del.svg @@ -0,0 +1,9 @@ + + + 路径 + + + + + + \ No newline at end of file