diff --git a/src/mindspore/app.json b/src/mindspore/app.json index 926017a9830c018495c5010ccd0cb2c1bec31534..7db45e0f94960c5bd2bd0fa999442e707126c3c5 100644 --- a/src/mindspore/app.json +++ b/src/mindspore/app.json @@ -36,14 +36,9 @@ "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", "events/sign", - "events/sign-success", - "sign-up/save-success" + "events/sign-success" ] }, { diff --git a/src/mindspore/components/meeting-list/meeting-list.js b/src/mindspore/components/meeting-list/meeting-list.js index 41b3746cfe2b0e7b6754f61216c8762697ba96f2..62a1a3b973466150adfd72004b8978d03891d146 100644 --- a/src/mindspore/components/meeting-list/meeting-list.js +++ b/src/mindspore/components/meeting-list/meeting-list.js @@ -291,7 +291,7 @@ Component({ }, del: function () { that = this; - remoteMethods.delMeeting(this.data.curMmid, function (data) { + remoteMethods.delMeeting(this.data.curMid, function (data) { if (data.code == 200) { wx.redirectTo({ url: that.properties.isHome diff --git a/src/mindspore/components/meeting-list/meeting-list.wxml b/src/mindspore/components/meeting-list/meeting-list.wxml index 789b6359573ec0611b11d8ea338220c9c9ba49a8..31e1da2dfb05643ecb00c7301ae4682f48d0b6c0 100644 --- a/src/mindspore/components/meeting-list/meeting-list.wxml +++ b/src/mindspore/components/meeting-list/meeting-list.wxml @@ -1,77 +1,77 @@ - -{{isHome?'最近':'今天'}}的会议({{list.length}}) - - - - - - {{curFilterName}} - - - - - - - - {{item.topic}} - - - - {{item.named}} - - - - {{item.dates||item.date}} {{item.start}}-{{item.end}} (可回放) - - {{item.dates||item.date}} {{item.start}}-{{item.end}} - - - - {{item.group_names}} - - - - {{item.agenda}} - - - - - - - - - - 暂无会议! - 当前暂无任何会议哦 - - - - - {{curMid}} - {{curJoinUrl}} - - - - - - - - - - 请确认删除当前会议 - - - - - - - - - - - - - - - + +{{isHome?'最近':'今天'}}的会议({{list.length}}) + + + + + + {{curFilterName}} + + + + + + + + {{item.topic}} + + + + {{item.named}} + + + + {{item.dates||item.date}} {{item.start}}-{{item.end}} (可回放) + + {{item.dates||item.date}} {{item.start}}-{{item.end}} + + + + {{item.group_names}} + + + + {{item.agenda}} + + + + + + + + + + 暂无会议! + 当前暂无任何会议哦 + + + + + {{curMid}} + {{curJoinUrl}} + + + + + + + + + + 请确认删除当前会议 + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/mindspore/config/constants.js b/src/mindspore/config/constants.js index 641038cce6c0a12f45a9b94a92699e95093c1af6..bf5c7cc5a5c862a9bfd621052612ead49a864493 100644 --- a/src/mindspore/config/constants.js +++ b/src/mindspore/config/constants.js @@ -1,21 +1,20 @@ -/** - * 常量配置 - */ -var _ = require('../utils/underscore-extend.js'); - -// 服务连接配置 -var serviceConfig = { - // SERVICE_URL: 'https://api.mindspore.cn/meetings', // 正式环境 - SERVICE_URL: "http://119.8.32.82", // 测试环境 - -}; - -// 存储配置 -var storageConfig = { - APP_USERINFO_SESSION: '_app_userinfo_session', -}; - -// 所有配置 -var constants = _.deepExtend(true, serviceConfig, storageConfig); - -module.exports = constants; +/** + * 常量配置 + */ +var _ = require('../utils/underscore-extend.js'); + +// 服务连接配置 +var serviceConfig = { + SERVICE_URL: 'https://api.mindspore.cn/meetings', // 正式环境 + // SERVICE_URL: "http://119.8.32.82", // 测试环境 +}; + +// 存储配置 +var storageConfig = { + APP_USERINFO_SESSION: '_app_userinfo_session', +}; + +// 所有配置 +var constants = _.deepExtend(true, serviceConfig, storageConfig); + +module.exports = constants; diff --git a/src/mindspore/package-events/events/event-detail.js b/src/mindspore/package-events/events/event-detail.js index c96bebd5626812acd53fbc4629491d2f7908667a..ab13189b05255bfd0c6b2e9307058bcea4fc4d32 100644 --- a/src/mindspore/package-events/events/event-detail.js +++ b/src/mindspore/package-events/events/event-detail.js @@ -1,367 +1,379 @@ -// package-events/events/event-detail.js -const appAjax = require('./../../utils/app-ajax'); -const sessionUtil = require('../../utils/app-session.js'); - -let that = null; -let remoteMethods = { - getDraftDetail: function (_callback) { - let service = 'EVENT_DETAIL'; - if (that.data.type == 5) { - service = 'EVENT_DETAIL'; - } else if (that.data.type == 1) { - service = 'EXAMINE_DETAIL'; - } else if (that.data.type == 4) { - service = 'DRAFT_DETAIL'; - } - appAjax.postJson({ - autoShowWait: true, - type: 'GET', - service, - otherParams: { - id: that.data.id, - }, - success: function (ret) { - _callback && _callback(ret); - }, - }); - }, - reject: function (_callback) { - appAjax.postJson({ - autoShowWait: true, - type: 'PUT', - service: 'REJECT_PUBLISH', - otherParams: { - id: that.data.id || '', - }, - success: function (ret) { - _callback && _callback(ret); - }, - }); - }, - resolve: function (_callback) { - appAjax.postJson({ - autoShowWait: true, - type: 'PUT', - service: 'RESOLVE_PUBLISH', - otherParams: { - id: that.data.id || '', - }, - success: function (ret) { - _callback && _callback(ret); - }, - }); - }, - draftPublish: function (postData, _callback) { - appAjax.postJson({ - autoShowWait: true, - type: 'PUT', - service: 'EDIT_DETAIL_PUBLISH', - data: postData, - otherParams: { - id: that.data.id || '', - }, - success: function (ret) { - _callback && _callback(ret); - }, - }); - }, - collect: function (_callback) { - appAjax.postJson({ - autoShowWait: true, - type: 'POST', - service: 'EVENT_COLLECT', - data: { - activity: that.data.id, - }, - success: function (ret) { - _callback && _callback(ret); - }, - }); - }, - unCollect: function (_callback) { - appAjax.postJson({ - autoShowWait: true, - type: 'DELETE', - service: 'EVENT_UNCOLLECT', - otherParams: { - id: that.data.info.collection_id, - }, - success: function (ret) { - _callback && _callback(ret); - }, - }); - }, -}; -Page({ - /** - * 页面的初始数据 - */ - - data: { - info: {}, - showReplay:false, - id: '', - startTime:'', - endTime:'', - steps: [], - tabIndex: 0, - activeNames:0, - betweenDay:[], - showDialog:false, - type: 0, - level: 1, - user: '', - scene: '', - isIphoneX: false, - }, - - onLoad: function (options) { - that = this; - this.setData({ - id: options.id || decodeURIComponent(options.scene), - scene: decodeURIComponent(options.scene) || '', - type: options.type, - level: sessionUtil.getUserInfoByKey('eventLevel') || 1, - }); - wx.getSystemInfo({ - success(res) { - if (res.model.indexOf('iPhone X') >= 0 || res.model.indexOf('iPhone 11') >= 0) { - that.setData({ - isIphoneX: true, - }); - } - }, - }); - }, - - onShow: function () { - this.setData({ - 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((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 - }) - }, - colseDiglog() { - this.setData({ - showReplay:false, - showDialog:false - }) - }, - maskClick () { - if (this.data.info.replay_url && this.data.info.status == 5) { - this.setData({ - showReplay:true - }) - } else { - this.setData({ - showDialog:true - }) - } - - }, - copyLink(e) { - let link = e.currentTarget.dataset.link - let that = this - wx.setClipboardData({ - data: link, - success: function () { - that.setData({ - showDialog: false, - showReplay:false - }) - }, - fail:function () { - that.setData({ - showDialog: false, - showReplay: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, - }); - }, - openLocation(e) { - if (e.currentTarget.dataset.item.activity_type == 2) { - return; - } - wx.openLocation({ - latitude: Number(e.currentTarget.dataset.item.latitude), - longitude: Number(e.currentTarget.dataset.item.longitude), - name: e.currentTarget.dataset.item.detail_address, // 名称 - address: e.currentTarget.dataset.item.address, // 地址 - }); - }, - toEditDraft() { - wx.redirectTo({ - url: `/package-events/publish/publish?id=${this.data.id}&type=${this.data.type}`, - }); - }, - draftPublish() { - let postData = this.data.info; - postData.schedules = JSON.parse(postData.schedules); - remoteMethods.draftPublish(postData, (res) => { - if (res.code === 201) { - wx.redirectTo({ - url: '/package-events/publish/success?type=2', - }); - } else { - setTimeout(function () { - wx.showToast( - { - title: res.message, - icon: 'none', - duration: 2000, - }, - 100 - ); - }); - } - }); - }, - reject() { - remoteMethods.reject(() => { - wx.navigateBack(); - }); - }, - resolve() { - remoteMethods.resolve(() => { - wx.navigateBack(); - }); - }, - editSchedule() { - wx.redirectTo({ - url: `/package-events/publish/publish?id=${this.data.id}&type=${this.data.type}`, - }); - }, - switchTab2() { - this.setData({ - tabIndex: 1, - }); - }, - 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}` - }) -}, - onShareAppMessage() { - return { - title: '活动详情', - path: `/package-events/events/event-detail?id=${that.data.id}&type=5`, - }; - }, - toPoster(e) { - wx.navigateTo({ - url: `/package-events/events/poster?isDraft=${e.currentTarget.dataset.flag || ''}&id=${this.data.info.id}`, - }); - }, - redrictLogin() { - if (this.data.scene) { - wx.navigateTo({ - url: '/pages/auth/auth?id=' + that.data.id, - }); - } else { - wx.navigateTo({ - url: '/pages/auth/auth', - }); - } - }, - collect() { - if (!this.data.info.collection_id) { - remoteMethods.collect(() => { - this.onShow(); - }); - } else { - remoteMethods.unCollect(() => { - this.onShow(); - }); - } - }, -}); +// package-events/events/event-detail.js +const appAjax = require('./../../utils/app-ajax'); +const sessionUtil = require('../../utils/app-session.js'); + +let that = null; +let remoteMethods = { + getDraftDetail: function (_callback) { + let service = 'EVENT_DETAIL'; + if (that.data.type == 5) { + service = 'EVENT_DETAIL'; + } else if (that.data.type == 1) { + service = 'EXAMINE_DETAIL'; + } else if (that.data.type == 4) { + service = 'DRAFT_DETAIL'; + } + appAjax.postJson({ + autoShowWait: true, + type: 'GET', + service, + otherParams: { + id: that.data.id, + }, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, + reject: function (_callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'PUT', + service: 'REJECT_PUBLISH', + otherParams: { + id: that.data.id || '', + }, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, + resolve: function (_callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'PUT', + service: 'RESOLVE_PUBLISH', + otherParams: { + id: that.data.id || '', + }, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, + draftPublish: function (postData, _callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'PUT', + service: 'EDIT_DETAIL_PUBLISH', + data: postData, + otherParams: { + id: that.data.id || '', + }, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, + collect: function (_callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'POST', + service: 'EVENT_COLLECT', + data: { + activity: that.data.id, + }, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, + unCollect: function (_callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'DELETE', + service: 'EVENT_UNCOLLECT', + otherParams: { + id: that.data.info.collection_id, + }, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, +}; +Page({ + /** + * 页面的初始数据 + */ + + data: { + info: {}, + showReplay:false, + id: '', + startTime:'', + endTime:'', + steps: [], + tabIndex: 0, + activeNames:0, + betweenDay:[], + showDialog:false, + showRegister:false, + type: 0, + level: 1, + user: '', + scene: '', + isIphoneX: false, + }, + + onLoad: function (options) { + that = this; + this.setData({ + id: options.id || decodeURIComponent(options.scene), + scene: decodeURIComponent(options.scene) || '', + type: options.type, + level: sessionUtil.getUserInfoByKey('eventLevel') || 1, + }); + wx.getSystemInfo({ + success(res) { + if (res.model.indexOf('iPhone X') >= 0 || res.model.indexOf('iPhone 11') >= 0) { + that.setData({ + isIphoneX: true, + }); + } + }, + }); + }, + + onShow: function () { + this.setData({ + 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((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 + }) + }, + colseDiglog() { + this.setData({ + showReplay:false, + showDialog:false, + showRegister:false, + }) + }, + maskClick () { + if (this.data.info.replay_url && this.data.info.status == 5) { + this.setData({ + showReplay:true + }) + } else { + this.setData({ + showDialog:true + }) + } + + }, + copyLink(e) { + let link = e.currentTarget.dataset.link + let that = this + wx.setClipboardData({ + data: link, + success: function () { + that.setData({ + showDialog: false, + showReplay:false, + showRegister:false, + }) + }, + fail:function () { + that.setData({ + showDialog: false, + showReplay:false, + showRegister:false + }) + } + }) + }, + getBetweenDateStr(starDay, endDay) { + let startDate = Date.parse(starDay); + let endDate = Date.parse(endDay); + if (startDate > endDate) { + return false; + } else if (startDate == endDate) { + starDay = starDay.split('') + starDay[4] = '年' + starDay[7] = '月' + starDay[10] = '日' + starDay = starDay.join('') + return [starDay] + } + let arr = []; + let dates = []; + + // 设置两个日期UTC时间 + let db = new Date(starDay); + let de = new Date(endDay); + + // 获取两个日期GTM时间 + let s = db.getTime() - 24 * 60 * 60 * 1000; + let d = de.getTime() - 24 * 60 * 60 * 1000; + + // 获取到两个日期之间的每一天的毫秒数 + for (let i = s; i <= d;) { + i = i + 24 * 60 * 60 * 1000; + arr.push(parseInt(i)) + } + + // 获取每一天的时间 YY-MM-DD + for (let j in arr) { + let time = new Date(arr[j]); + let year = time.getFullYear(time); + let mouth = (time.getMonth() + 1) >= 10 ? (time.getMonth() + 1) : ('0' + (time.getMonth() + 1)); + let day = time.getDate() >= 10 ? time.getDate() : ('0' + time.getDate()); + let YYMMDD =year + '年-' + mouth + '月' + '-' + day + '日'; + dates.push(YYMMDD) + } + + return dates + }, + dateChange(event) { + this.setData({ + activeNames: event.detail, + }); + }, + switchTab(e) { + this.setData({ + tabIndex: e.currentTarget.dataset.index, + }); + }, + openLocation(e) { + if (e.currentTarget.dataset.item.activity_type == 2) { + return; + } + wx.openLocation({ + latitude: Number(e.currentTarget.dataset.item.latitude), + longitude: Number(e.currentTarget.dataset.item.longitude), + name: e.currentTarget.dataset.item.detail_address, // 名称 + address: e.currentTarget.dataset.item.address, // 地址 + }); + }, + toEditDraft() { + wx.redirectTo({ + url: `/package-events/publish/publish?id=${this.data.id}&type=${this.data.type}`, + }); + }, + draftPublish() { + let postData = this.data.info; + postData.schedules = JSON.parse(postData.schedules); + remoteMethods.draftPublish(postData, (res) => { + if (res.code === 201) { + wx.redirectTo({ + url: '/package-events/publish/success?type=2', + }); + } else { + setTimeout(function () { + wx.showToast( + { + title: res.message, + icon: 'none', + duration: 2000, + }, + 100 + ); + }); + } + }); + }, + reject() { + remoteMethods.reject(() => { + wx.navigateBack(); + }); + }, + resolve() { + remoteMethods.resolve(() => { + wx.navigateBack(); + }); + }, + editSchedule() { + wx.redirectTo({ + url: `/package-events/publish/publish?id=${this.data.id}&type=${this.data.type}`, + }); + }, + switchTab2() { + this.setData({ + tabIndex: 1, + }); + }, + 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}` + // }) + this.setData({ + showRegister:true + }) +}, + onShareAppMessage() { + return { + title: '活动详情', + path: `/package-events/events/event-detail?id=${that.data.id}&type=5`, + }; + }, + toPoster(e) { + wx.navigateTo({ + url: `/package-events/events/poster?isDraft=${e.currentTarget.dataset.flag || ''}&id=${this.data.info.id}`, + }); + }, + redrictLogin() { + if (this.data.scene) { + wx.navigateTo({ + url: '/pages/auth/auth?id=' + that.data.id, + }); + } else { + wx.navigateTo({ + url: '/pages/auth/auth', + }); + } + }, + collect() { + if (!this.data.info.collection_id) { + remoteMethods.collect(() => { + this.onShow(); + }); + } else { + remoteMethods.unCollect(() => { + this.onShow(); + }); + } + }, +}); diff --git a/src/mindspore/package-events/events/event-detail.wxml b/src/mindspore/package-events/events/event-detail.wxml index 37f79a4baedacae9d3c6264af889e76157e7d215..9482fbe7f448c2979c59dabe76bd2720e34ccb82 100644 --- a/src/mindspore/package-events/events/event-detail.wxml +++ b/src/mindspore/package-events/events/event-detail.wxml @@ -145,6 +145,16 @@ + + + + {{info.register_url}} + + + + + + diff --git a/src/mindspore/package-events/manage/member-detail.wxml b/src/mindspore/package-events/manage/member-detail.wxml index bccb84f1a17b2ed8b5824273f82238f9fa62ba10..76667bd5b931cc5e60201124e25827f2384a4fb6 100644 --- a/src/mindspore/package-events/manage/member-detail.wxml +++ b/src/mindspore/package-events/manage/member-detail.wxml @@ -9,10 +9,10 @@ 输入ID - 输入手机 - - 输入邮箱 - + 备注一 + + 备注二 + diff --git a/src/mindspore/package-events/publish/publish.js b/src/mindspore/package-events/publish/publish.js index 292326ea8bfdeb29a2edab34bc862a5f24ba3294..fc3332ee2e28515102288a38bdbe86691b895b90 100644 --- a/src/mindspore/package-events/publish/publish.js +++ b/src/mindspore/package-events/publish/publish.js @@ -1,909 +1,907 @@ -// package-events/publish/publish.js -const appAjax = require('./../../utils/app-ajax'); -const utils = require('./../../utils/utils.js'); -utils.formateDate(); -let that = null; -let remoteMethods = { - addEvents: function (postData, _callback) { - let type = 'POST'; - let service = 'PUBLISH_EVENT'; - if (that.data.detailType == 4) { - type = 'PUT'; - service = 'EDIT_DETAIL_PUBLISH'; - } - appAjax.postJson({ - autoShowWait: true, - type, - service, - data: postData, - otherParams: { - id: that.data.id || '', - }, - success: function (ret) { - if (ret.code == 400) { - localMethods.toast(ret.msg); - return; - } - _callback && _callback(ret); - }, - }); - }, - saveDraft: function (postData, _callback) { - let type = 'POST'; - let service = 'SAVE_DRAFT'; - if (that.data.detailType == 4) { - type = 'PUT'; - service = 'EDIT_DETAIL'; - } else if (that.data.detailType == 5) { - type = 'PUT'; - service = 'EDIT_SCHEDULE'; - } - appAjax.postJson({ - autoShowWait: true, - type, - service, - data: postData, - otherParams: { - id: that.data.id || '', - }, - success: function (ret) { - if (ret.code == 400) { - localMethods.toast(ret.msg); - return; - } - _callback && _callback(ret); - }, - }); - }, - getDraftDetail: function (_callback) { - let service = 'DRAFT_DETAIL'; - if (that.data.detailType == 5) { - service = 'EVENT_DETAIL'; - } - appAjax.postJson({ - autoShowWait: true, - type: 'GET', - service, - otherParams: { - id: that.data.id, - }, - success: function (ret) { - _callback && _callback(ret); - }, - }); - }, -}; -let localMethods = { - validation: function (data) { - if (data.activity_type === 1) { - if (!data.title) { - this.toast('请输入活动标题'); - return; - } - if (!data.start_date) { - this.toast('请选择活动起始日期'); - return; - } - if (!data.end_date) { - this.toast('请选择活动结束日期'); - return; - } - if (!data.address) { - this.toast('请输入活动城市'); - return; - } - if (!data.detail_address) { - this.toast('请输入具体地址'); - return; - } - if (data.register_method === 2 && data.register_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.activity_type === 2) { - if (!data.title) { - this.toast('请输入活动标题'); - return; - } - if (data.activity_category === 2) { - this.toast('MSG活动需添加线下地址'); - return; - } - if (!data.online_url) { - this.toast('请输入线上链接地址'); - return; - } - if (data.register_method === 2 && data.register_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.start_date) { - this.toast('请选择活动起始日期'); - return; - } - 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; - } - if (data.register_method === 2 && data.register_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; - } - } - - return true; - }, - toast: function (msg) { - wx.showToast({ - title: msg, - icon: 'none', - duration: 2000, - }); - }, -}; -Page({ - data: { - isStar: false, - isEnd: false, - starTime: '', - endTime: '', - id: '', - playback:'', - activeNames: [0], - detailType: 0, - title: '', - date: '', - type: '课程', - form: ['1'], - mode: '小程序报名', - address: '', - addressName: '', - registerUrl:'', - desc: '', - betweenDay: [], - schedule: [{ - start: '', - end: '', - topic: '', - speakerList: [{ - name: '', - title: '', - mail: '' - }] - }, ], - allSchedule: [], - typeList: [ - '课程', - 'MSG', - '赛事', - '其他' - ], - modeList: [ - '小程序报名', - '跳转其他链接报名' - ], - datePopShow: false, - timePopShow: false, - formShow: false, - curDate: new Date().getTime(), - currentDate: new Date().getTime(), - minDate: new Date().getTime(), - startTimeIndex: 0, - endTimeIndex: 0, - start: '', - end: '', - currentTime: '08:00', - method:1, - actegory:1, - tiemIndex: 1, - minTime: 8, - maxTime: 22, - minEndTime: 8, - maxEndTime: 22, - filter(type, options) { - if (type === 'minute') { - return options.filter((option) => option % 15 === 0); - } - return options; - }, - endTimePopShow: false, - currentEndTime: '08:00', - topicSelIndex: 1, - longitude: '', - latitude: '', - liveAddress: '', - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - that = this; - this.setData({ - id: options.id, - detailType: options.type || 0, - }); - 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, - starTime: res.start_date, - endTime: res.end_date, - actegory:res.activity_category, - form: res.activity_type, - playback:res.replay_url ||'', - method:res.register_method, - type:this.data.typeList[res.activity_category-1], - mode:this.data.modeList[res.register_method-1], - registerUrl:res.register_url || '', - liveAddress: res.online_url || '', - longitude: res.longitude || '', - latitude: res.latitude || '', - address: res.address || '', - addressName: res.detail_address || '', - desc: res.synopsis || '', - betweenDay:this.getBetweenDateStr(res.start_date,res.end_date), - topicSelIndex: res.poster, - allSchedule: JSON.parse(res.schedules), - }); - }); - } - }, - /** - * 生命周期函数--监听页面显示 - */ - onShow: function () {}, - titleInput(e) { - this.setData({ - title: e.detail.value, - }); - }, - playbackInput(e) { - this.setData({ - playback:e.detail.value - }) - }, - setStar: function () { - this.setData({ - datePopShow: true, - isStar: true - }); - }, - setEnd: function () { - this.setData({ - datePopShow: true, - isEnd: true - }); - }, - dateChange(event) { - this.setData({ - activeNames: event.detail, - }); - }, - 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({ - modeShow: true, - }) - }, - dateCancel: function () { - this.setData({ - datePopShow: false, - isStar: false, - isEnd: false - }); - }, - dateOnInput: function (e) { - this.setData({ - currentDate: e.detail, - }); - }, - dateConfirm: function () { - let time = new Date(this.data.currentDate).Format('yyyy-MM-dd') - let between = [] - if (this.data.isStar) { - 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: time - }) - } - this.setData({ - datePopShow: false, - isStar: false, - isEnd: false - }); - }, - radioOnChange(e) { - this.setData({ - form: e.detail, - }); - }, - typeRadioOnChange: function (e) { - this.setData({ - 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) { - that.setData({ - address: res.address, - addressName: res.name, - longitude: res.longitude, - latitude: res.latitude, - }); - }, - }); - }, - addressNameInput(e) { - this.setData({ - addressName: e.detail.value, - }); - }, - registerUrlInput(e) { - this.setData({ - registerUrl: e.detail.value, - }); - }, - descInput(e) { - this.setData({ - desc: e.detail.value, - }); - }, - scheduleTitleInput(e) { - const key = `allSchedule[${e.currentTarget.dataset.dayindex}][${e.currentTarget.dataset.index}].topic`; - this.setData({ - [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 = `allSchedule[${e.currentTarget.dataset.dayindex}][${e.currentTarget.dataset.index}].speaker`; - this.setData({ - [key]: e.detail.value, - }); - }, - scheduleDescInput(e) { - const key = `allSchedule[${e.currentTarget.dataset.dayindex}][${e.currentTarget.dataset.index}].desc`; - this.setData({ - [key]: e.detail.value, - }); - }, - addSchedule(e) { - let arrTemp = this.data.allSchedule; - let index = e.currentTarget.dataset.index - arrTemp[index].push({ - start: '', - end: '', - topic: '', - speakerList: [] - }) - this.setData({ - allSchedule: arrTemp - }) - }, - delSchedule(e) { - let index = e.currentTarget.dataset.index - let arrTemp = this.data.allSchedule; - arrTemp[e.currentTarget.dataset.dayindex].splice(index, 1); - this.setData({ - 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, - }); - }, - timeCancel: function () { - this.setData({ - timePopShow: false, - }); - }, - timeOnInput: function (e) { - this.setData({ - currentTime: e.detail, - }); - }, - timeConfirm: function () { - const key = `allSchedule[${this.data.tiemIndex}][${this.data.startTimeIndex}].start`; - this.setData({ - [key]: this.data.currentTime, - timePopShow: false, - }); - }, - typeCancel: function () { - this.setData({ - typeShow: false, - }); - }, - typeConfirm: function () { - this.setData({ - 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, - }); - }, - endTimeOnInput: function (e) { - this.setData({ - currentEndTime: e.detail, - }); - }, - endTimeConfirm: function () { - const key = `allSchedule[${this.data.tiemIndex}][${this.data.endTimeIndex}].end`; - this.setData({ - [key]: this.data.currentEndTime, - endTimePopShow: false, - }); - }, - endTimeCancel: function () { - this.setData({ - endTimePopShow: false, - }); - }, - selTop(e) { - this.setData({ - topicSelIndex: e.currentTarget.dataset.index, - }); - }, - liveAddressInput(e) { - this.setData({ - liveAddress: e.detail.value, - }); - }, - publish() { - let postData = {}; - 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, - activity_category: this.data.actegory, - activity_type:1, - register_method:this.data.method, - register_url:this.data.registerUrl, - start_date: this.data.starTime, - detail_address: this.data.addressName, - end_date: this.data.endTime, - synopsis: this.data.desc, - address: this.data.address, - longitude: this.data.longitude, - latitude: this.data.latitude, - poster: this.data.topicSelIndex, - 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, - register_url:this.data.registerUrl, - 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, - }; - } else { - postData = { - title: this.data.title, - activity_category: this.data.actegory, - register_method:this.data.method, - register_url:this.data.registerUrl, - activity_type:3, - online_url: this.data.liveAddress, - 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.allSchedule, - }; - } - if (!localMethods.validation(postData)) { - return; - } - remoteMethods.addEvents(postData, () => { - wx.redirectTo({ - url: '/package-events/publish/success?type=2', - }); - }); - }, - saveDraft() { - let postData = {}; - if (this.data.form[0] == 1 && this.data.form.length !== 2) { - postData = { - title: this.data.title, - activity_category: this.data.actegory, - activity_type:1, - register_method:this.data.method, - register_url:this.data.registerUrl, - 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.allSchedule, - }; - } else if (this.data.form[0] == 2 && this.data.form.length !== 2) { - postData = { - title: this.data.title, - activity_category: this.data.actegory, - activity_type:2, - register_url:this.data.registerUrl, - register_method:this.data.method, - 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, - activity_category: this.data.actegory, - activity_type:3, - register_method:this.data.method, - register_url:this.data.registerUrl, - online_url: this.data.liveAddress, - 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.allSchedule, - }; - } - if (!localMethods.validation(postData)) { - return; - } - remoteMethods.saveDraft(postData, () => { - wx.redirectTo({ - url: '/package-events/publish/success?type=1', - }); - }); - }, - cancelEditSchedule() { - wx.navigateBack(); - }, - editScheduleConfirm() { - let postData = {}; - if (this.data.form[0] == 1 && this.data.form.length !== 2) { - postData = { - title: this.data.title, - activity_category: this.actegory, - activity_type:1, - replay_url:this.data.playback, - register_method:this.data.method, - register_url:this.data.registerUrl, - 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.allSchedule, - }; - } else if (this.data.form[0] == 2 && this.data.form.length !== 2) { - postData = { - title: this.data.title, - activity_category: this.data.actegory, - activity_type:2, - replay_url:this.data.playback, - register_url:this.data.registerUrl, - register_method:this.data.method, - 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, - activity_category: this.data.actegory, - activity_type:3, - replay_url:this.data.playback, - register_method:this.data.method, - register_url:this.data.registerUrl, - online_url: this.data.liveAddress, - 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.allSchedule, - }; - } - if (!localMethods.validation(postData)) { - return; - } - postData.schedules = JSON.stringify(this.data.allSchedule); - remoteMethods.saveDraft(postData, () => { - wx.redirectTo({ - url: '/package-events/publish/success?type=3', - }); - }); - }, - toPoster() { - 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}&starTime=${this.data.starTime}&endTime=${this.data.endTime}&address=${address}&poster=${this.data.topicSelIndex}&liveAddress=${liveAddress}&activity_type=${activityType}`, - }); - }, +// package-events/publish/publish.js +const appAjax = require('./../../utils/app-ajax'); +const utils = require('./../../utils/utils.js'); +utils.formateDate(); +let that = null; +let remoteMethods = { + addEvents: function (postData, _callback) { + let type = 'POST'; + let service = 'PUBLISH_EVENT'; + if (that.data.detailType == 4) { + type = 'PUT'; + service = 'EDIT_DETAIL_PUBLISH'; + } + appAjax.postJson({ + autoShowWait: true, + type, + service, + data: postData, + otherParams: { + id: that.data.id || '', + }, + success: function (ret) { + if (ret.code == 400) { + localMethods.toast(ret.msg); + return; + } + _callback && _callback(ret); + }, + }); + }, + saveDraft: function (postData, _callback) { + let type = 'POST'; + let service = 'SAVE_DRAFT'; + if (that.data.detailType == 4) { + type = 'PUT'; + service = 'EDIT_DETAIL'; + } else if (that.data.detailType == 5) { + type = 'PUT'; + service = 'EDIT_SCHEDULE'; + } + appAjax.postJson({ + autoShowWait: true, + type, + service, + data: postData, + otherParams: { + id: that.data.id || '', + }, + success: function (ret) { + if (ret.code == 400) { + localMethods.toast(ret.msg); + return; + } + _callback && _callback(ret); + }, + }); + }, + getDraftDetail: function (_callback) { + let service = 'DRAFT_DETAIL'; + if (that.data.detailType == 5) { + service = 'EVENT_DETAIL'; + } + appAjax.postJson({ + autoShowWait: true, + type: 'GET', + service, + otherParams: { + id: that.data.id, + }, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, +}; +let localMethods = { + validation: function (data) { + if (data.activity_type === 1) { + if (!data.title) { + this.toast('请输入活动名称'); + return; + } + if (!data.start_date) { + this.toast('请选择活动起始日期'); + return; + } + if (!data.end_date) { + this.toast('请选择活动结束日期'); + return; + } + if (!data.address) { + this.toast('请输入活动城市'); + return; + } + if (!data.detail_address) { + this.toast('请输入具体地址'); + return; + } + if (data.register_method === 2 && data.register_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.activity_type === 2) { + if (!data.title) { + this.toast('请输入活动标题'); + return; + } + if (!data.online_url) { + this.toast('请输入线上链接地址'); + return; + } + if (data.register_method === 2 && data.register_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.start_date) { + this.toast('请选择活动起始日期'); + return; + } + 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; + } + if (data.register_method === 2 && data.register_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; + } + } + + return true; + }, + toast: function (msg) { + wx.showToast({ + title: msg, + icon: 'none', + duration: 2000, + }); + }, +}; +Page({ + data: { + isStar: false, + isEnd: false, + starTime: '', + endTime: '', + id: '', + playback:'', + activeNames: [0], + detailType: 0, + title: '', + date: '', + type: '课程', + form: ['1'], + mode: '小程序报名', + address: '', + addressName: '', + registerUrl:'', + desc: '', + betweenDay: [], + schedule: [{ + start: '', + end: '', + topic: '', + speakerList: [{ + name: '', + title: '', + mail: '' + }] + }, ], + allSchedule: [], + typeList: [ + '课程', + 'MSG', + '赛事', + '其他' + ], + modeList: [ + '小程序报名', + '跳转其他链接报名' + ], + datePopShow: false, + timePopShow: false, + formShow: false, + curDate: new Date().getTime(), + currentDate: new Date().getTime(), + minDate: new Date().getTime(), + startTimeIndex: 0, + endTimeIndex: 0, + start: '', + end: '', + currentTime: '08:00', + method:1, + actegory:1, + tiemIndex: 1, + minTime: 8, + maxTime: 22, + minEndTime: 8, + maxEndTime: 22, + filter(type, options) { + if (type === 'minute') { + return options.filter((option) => option % 5 === 0); + } + return options; + }, + endTimePopShow: false, + currentEndTime: '08:00', + topicSelIndex: 1, + longitude: '', + latitude: '', + liveAddress: '', + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + that = this; + this.setData({ + id: options.id, + detailType: options.type || 0, + }); + 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, + starTime: res.start_date, + endTime: res.end_date, + actegory:res.activity_category, + form: res.activity_type, + playback:res.replay_url ||'', + method:res.register_method, + type:this.data.typeList[res.activity_category-1], + mode:this.data.modeList[res.register_method-1], + registerUrl:res.register_url || '', + liveAddress: res.online_url || '', + longitude: res.longitude || '', + latitude: res.latitude || '', + address: res.address || '', + addressName: res.detail_address || '', + desc: res.synopsis || '', + betweenDay:this.getBetweenDateStr(res.start_date,res.end_date), + topicSelIndex: res.poster, + allSchedule: JSON.parse(res.schedules), + }); + }); + } + }, + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () {}, + titleInput(e) { + this.setData({ + title: e.detail.value, + }); + }, + playbackInput(e) { + this.setData({ + playback:e.detail.value + }) + }, + setStar: function () { + this.setData({ + datePopShow: true, + isStar: true + }); + }, + setEnd: function () { + this.setData({ + datePopShow: true, + isEnd: true + }); + }, + dateChange(event) { + this.setData({ + activeNames: event.detail, + }); + }, + onTypeShow: function () { + this.setData({ + typeShow: true, + }) + }, + getBetweenDateStr(starDay, endDay) { + let startDate = Date.parse(starDay); + let endDate = Date.parse(endDay); + if (startDate > endDate) { + return false; + } else if (startDate == endDate) { + starDay = starDay.split('') + starDay[4] = '年' + starDay[7] = '月' + starDay[10] = '日' + starDay = starDay.join('') + return [starDay] + } + let arr = []; + let dates = []; + + // 设置两个日期UTC时间 + let db = new Date(starDay); + let de = new Date(endDay); + + // 获取两个日期GTM时间 + let s = db.getTime() - 24 * 60 * 60 * 1000; + let d = de.getTime() - 24 * 60 * 60 * 1000; + + // 获取到两个日期之间的每一天的毫秒数 + for (let i = s; i <= d;) { + i = i + 24 * 60 * 60 * 1000; + arr.push(parseInt(i)) + } + + // 获取每一天的时间 YY-MM-DD + for (let j in arr) { + let time = new Date(arr[j]); + let year = time.getFullYear(time); + let mouth = (time.getMonth() + 1) >= 10 ? (time.getMonth() + 1) : ('0' + (time.getMonth() + 1)); + let day = time.getDate() >= 10 ? time.getDate() : ('0' + time.getDate()); + let YYMMDD =year + '年-' + mouth + '月' + '-' + day + '日'; + dates.push(YYMMDD) + } + + return dates + }, + onModeShow: function () { + this.setData({ + modeShow: true, + }) + }, + dateCancel: function () { + this.setData({ + datePopShow: false, + isStar: false, + isEnd: false + }); + }, + dateOnInput: function (e) { + this.setData({ + currentDate: e.detail, + }); + }, + dateConfirm: function () { + let time = new Date(this.data.currentDate).Format('yyyy-MM-dd') + let between = [] + if (this.data.isStar) { + 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: time + }) + } + this.setData({ + datePopShow: false, + isStar: false, + isEnd: false + }); + }, + radioOnChange(e) { + this.setData({ + form: e.detail, + }); + }, + typeRadioOnChange: function (e) { + this.setData({ + 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) { + that.setData({ + address: res.address, + addressName: res.name, + longitude: res.longitude, + latitude: res.latitude, + }); + }, + fail:function(res) { + console.log(res); + } + }); + }, + addressNameInput(e) { + this.setData({ + addressName: e.detail.value, + }); + }, + registerUrlInput(e) { + this.setData({ + registerUrl: e.detail.value, + }); + }, + descInput(e) { + this.setData({ + desc: e.detail.value, + }); + }, + scheduleTitleInput(e) { + const key = `allSchedule[${e.currentTarget.dataset.dayindex}][${e.currentTarget.dataset.index}].topic`; + this.setData({ + [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 = `allSchedule[${e.currentTarget.dataset.dayindex}][${e.currentTarget.dataset.index}].speaker`; + this.setData({ + [key]: e.detail.value, + }); + }, + scheduleDescInput(e) { + const key = `allSchedule[${e.currentTarget.dataset.dayindex}][${e.currentTarget.dataset.index}].desc`; + this.setData({ + [key]: e.detail.value, + }); + }, + addSchedule(e) { + let arrTemp = this.data.allSchedule; + let index = e.currentTarget.dataset.index + arrTemp[index].push({ + start: '', + end: '', + topic: '', + speakerList: [] + }) + this.setData({ + allSchedule: arrTemp + }) + }, + delSchedule(e) { + let index = e.currentTarget.dataset.index + let arrTemp = this.data.allSchedule; + arrTemp[e.currentTarget.dataset.dayindex].splice(index, 1); + this.setData({ + 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, + }); + }, + timeCancel: function () { + this.setData({ + timePopShow: false, + }); + }, + timeOnInput: function (e) { + this.setData({ + currentTime: e.detail, + }); + }, + timeConfirm: function () { + const key = `allSchedule[${this.data.tiemIndex}][${this.data.startTimeIndex}].start`; + this.setData({ + [key]: this.data.currentTime, + timePopShow: false, + }); + }, + typeCancel: function () { + this.setData({ + typeShow: false, + }); + }, + typeConfirm: function () { + this.setData({ + 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, + }); + }, + endTimeOnInput: function (e) { + this.setData({ + currentEndTime: e.detail, + }); + }, + endTimeConfirm: function () { + const key = `allSchedule[${this.data.tiemIndex}][${this.data.endTimeIndex}].end`; + this.setData({ + [key]: this.data.currentEndTime, + endTimePopShow: false, + }); + }, + endTimeCancel: function () { + this.setData({ + endTimePopShow: false, + }); + }, + selTop(e) { + this.setData({ + topicSelIndex: e.currentTarget.dataset.index, + }); + }, + liveAddressInput(e) { + this.setData({ + liveAddress: e.detail.value, + }); + }, + publish() { + let postData = {}; + 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, + activity_category: this.data.actegory, + activity_type:1, + register_method:this.data.method, + register_url:this.data.registerUrl, + start_date: this.data.starTime, + detail_address: this.data.addressName, + end_date: this.data.endTime, + synopsis: this.data.desc, + address: this.data.address, + longitude: this.data.longitude, + latitude: this.data.latitude, + poster: this.data.topicSelIndex, + schedules: this.data.allSchedule, + }; + } else if (this.data.form[0] - 0 === 2 && this.data.form.length !== 2) { + postData = { + title: this.data.title, + activity_category: this.data.actegory, + register_method:this.data.method, + register_url:this.data.registerUrl, + activity_type:2, + start_date: this.data.starTime, + end_date: this.data.endTime, + synopsis: this.data.desc, + online_url: this.data.liveAddress, + poster: this.data.topicSelIndex, + schedules: this.data.allSchedule, + }; + } else { + postData = { + title: this.data.title, + activity_category: this.data.actegory, + register_method:this.data.method, + register_url:this.data.registerUrl, + activity_type:3, + online_url: this.data.liveAddress, + 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.allSchedule, + }; + } + if (!localMethods.validation(postData)) { + return; + } + remoteMethods.addEvents(postData, () => { + wx.redirectTo({ + url: '/package-events/publish/success?type=2', + }); + }); + }, + saveDraft() { + let postData = {}; + if (this.data.form[0] == 1 && this.data.form.length !== 2) { + postData = { + title: this.data.title, + activity_category: this.data.actegory, + activity_type:1, + register_method:this.data.method, + register_url:this.data.registerUrl, + 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.allSchedule, + }; + } else if (this.data.form[0] == 2 && this.data.form.length !== 2) { + postData = { + title: this.data.title, + activity_category: this.data.actegory, + activity_type:2, + register_url:this.data.registerUrl, + register_method:this.data.method, + start_date: this.data.starTime, + end_date: this.data.endTime, + synopsis: this.data.desc, + online_url: this.data.liveAddress, + poster: this.data.topicSelIndex, + schedules: this.data.allSchedule, + }; + } else { + postData = { + title: this.data.title, + activity_category: this.data.actegory, + activity_type:3, + register_method:this.data.method, + register_url:this.data.registerUrl, + online_url: this.data.liveAddress, + 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.allSchedule, + }; + } + if (!localMethods.validation(postData)) { + return; + } + remoteMethods.saveDraft(postData, () => { + wx.redirectTo({ + url: '/package-events/publish/success?type=1', + }); + }); + }, + cancelEditSchedule() { + wx.navigateBack(); + }, + editScheduleConfirm() { + let postData = {}; + if (this.data.form[0] == 1 && this.data.form.length !== 2) { + postData = { + title: this.data.title, + activity_category: this.actegory, + activity_type:1, + replay_url:this.data.playback, + register_method:this.data.method, + register_url:this.data.registerUrl, + 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.allSchedule, + }; + } else if (this.data.form[0] == 2 && this.data.form.length !== 2) { + postData = { + title: this.data.title, + activity_category: this.data.actegory, + activity_type:2, + replay_url:this.data.playback, + register_url:this.data.registerUrl, + register_method:this.data.method, + start_date: this.data.starTime, + end_date: this.data.endTime, + synopsis: this.data.desc, + online_url: this.data.liveAddress, + poster: this.data.topicSelIndex, + schedules: this.data.allSchedule, + }; + } else { + postData = { + title: this.data.title, + activity_category: this.data.actegory, + activity_type:3, + replay_url:this.data.playback, + register_method:this.data.method, + register_url:this.data.registerUrl, + online_url: this.data.liveAddress, + 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.allSchedule, + }; + } + if (!localMethods.validation(postData)) { + return; + } + postData.schedules = JSON.stringify(this.data.allSchedule); + remoteMethods.saveDraft(postData, () => { + wx.redirectTo({ + url: '/package-events/publish/success?type=3', + }); + }); + }, + toPoster() { + 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}&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 6226eb991adc7c0945f063f041372faf914c2056..9b9a81b570ccf8cec0913388347581d3bc2ef127 100644 --- a/src/mindspore/package-events/publish/publish.wxml +++ b/src/mindspore/package-events/publish/publish.wxml @@ -77,7 +77,7 @@ - + + 报名链接 * diff --git a/src/mindspore/package-events/sign-up/career-direction.js b/src/mindspore/package-events/sign-up/career-direction.js deleted file mode 100644 index 1a89d423604fcb39bea7dde0b7d27c180bcef0f3..0000000000000000000000000000000000000000 --- a/src/mindspore/package-events/sign-up/career-direction.js +++ /dev/null @@ -1,176 +0,0 @@ -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: '' - }, - onLoad(options) { - let active = JSON.parse(options.directionList); - let render = this.data.allCareer - try { - active.forEach(item =>{ - render[item.index].isActive = true - }) - } catch (error) { - render = this.data.allCareer - } - this.setData({ - renderList:render, - checkedList:active - }) - }, - 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 deleted file mode 100644 index 77623236e940325e0500253e4378bd75f889409c..0000000000000000000000000000000000000000 --- a/src/mindspore/package-events/sign-up/career-direction.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "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 deleted file mode 100644 index 3a946060c4999772e699508624bf8b3bf420ef09..0000000000000000000000000000000000000000 --- a/src/mindspore/package-events/sign-up/career-direction.wxml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - {{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 deleted file mode 100644 index 86d713d0e1ae859a355f23130da4a15deac86365..0000000000000000000000000000000000000000 --- a/src/mindspore/package-events/sign-up/career-direction.wxss +++ /dev/null @@ -1,105 +0,0 @@ -.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 deleted file mode 100644 index cc925fe4877864c41eb1057376e7d3bce0a127b3..0000000000000000000000000000000000000000 --- a/src/mindspore/package-events/sign-up/career-name.js +++ /dev/null @@ -1,239 +0,0 @@ -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: '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: '' - }, - onLoad(options) { - let active = JSON.parse(options.nameList); - let render = this.data.allCareer - try { - active.forEach(item =>{ - render[item.index].isActive = true - }) - } catch (error) { - render = this.data.allCareer - } - this.setData({ - renderList:render, - checkedList:JSON.parse(options.nameList) - }) - }, - 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({ - 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.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-name.json b/src/mindspore/package-events/sign-up/career-name.json deleted file mode 100644 index 910d3947471a83ab4bfb3fa9cfcab64a68748845..0000000000000000000000000000000000000000 --- a/src/mindspore/package-events/sign-up/career-name.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "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 deleted file mode 100644 index b11bb1ee948d526e4f3c7e504529c5f3027ac7e4..0000000000000000000000000000000000000000 --- a/src/mindspore/package-events/sign-up/career-name.wxml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - {{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 deleted file mode 100644 index 86d713d0e1ae859a355f23130da4a15deac86365..0000000000000000000000000000000000000000 --- a/src/mindspore/package-events/sign-up/career-name.wxss +++ /dev/null @@ -1,105 +0,0 @@ -.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/save-success.js b/src/mindspore/package-events/sign-up/save-success.js deleted file mode 100644 index f7ad4c7501fab576f9a8845796e928c938c7ab10..0000000000000000000000000000000000000000 --- a/src/mindspore/package-events/sign-up/save-success.js +++ /dev/null @@ -1,11 +0,0 @@ -Page({ - - data: { - - }, - toList() { - wx.navigateTo({ - url: '../../package-events/events/event-list', - }) - } -}) \ No newline at end of file diff --git a/src/mindspore/package-events/sign-up/sign-up.js b/src/mindspore/package-events/sign-up/sign-up.js deleted file mode 100644 index e5b0944f4ed97697271548544985b62287ece411..0000000000000000000000000000000000000000 --- a/src/mindspore/package-events/sign-up/sign-up.js +++ /dev/null @@ -1,278 +0,0 @@ -// package-events/sign-up/sign-up.js -const appAjax = require('./../../utils/app-ajax'); -const sessionUtil = require('../../utils/app-session.js'); -const validationConfig = require('./../../config/field-validate-rules'); - -let that = null; - -let remoteMethods = { - getUserInfo: function (_callback) { - appAjax.postJson({ - autoShowWait: true, - type: 'GET', - service: 'APPLICANT_INFO', - otherParams: { - id: sessionUtil.getUserInfoByKey('userId'), - }, - success: function (ret) { - _callback && _callback(ret); - }, - }); - }, - signUp: function (postData, _callback) { - appAjax.postJson({ - autoShowWait: true, - type: 'POST', - data: postData, - service: 'SAVE_SIGNUP_INFO', - success: function (ret) { - _callback && _callback(ret); - }, - }); - }, -}; - -let localMethods = { - validation() { - if (!that.data.name) { - 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; - } - if (!validationConfig.email.regex.test(that.data.mail)) { - this.toast('请输入正确的邮箱地址'); - return; - } - if (!that.data.enterprise) { - 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; - }, - toast(msg) { - wx.showToast({ - title: msg, - icon: 'none', - duration: 2000, - }); - }, -}; - -Page({ - /** - * 页面的初始数据 - */ - data: { - name: '', - tel: '', - mail: '', - enterprise: '', - 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年及以上', - ] - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - that = this; - this.setData({ - - }); - }, - - /** - * 生命周期函数--监听页面显示 - */ - onLoad: function (options) { - that = this; - let pages = getCurrentPages(); - let currPage = pages[pages.length - 1]; - remoteMethods.getUserInfo((res) => { - let nameList = null; - let directionList =null; - currPage.__data__.nameList.length ===0 ? nameList = JSON.parse(res.profession) : nameList = currPage.__data__.nameList - currPage.__data__.directionList.length === 0 ? directionList = JSON.parse(res.career_direction):directionList = currPage.__data__.directionList - this.setData({ - name: res.name || '', - tel: res.telephone || '', - mail: res.email || '', - wechat:res.wx_account || '', - enterprise: res.company || '', - gender:res.gender||'', - work:res.working_years||'', - age:res.age||'', - gitee: res.gitee_name || '', - work:res.working_years||'', - nameList: nameList, - directionList:directionList, - id: options.id, - eventTitle: options.title, - poster: options.poster, - }); - }); - }, - nameInput(e) { - this.setData({ - name: e.detail.value, - }); - }, - wechatInput(e) { - this.setData({ - wechat: e.detail.value, - }); - }, - telInput(e) { - this.setData({ - tel: e.detail.value, - }); - }, - mailInput(e) { - this.setData({ - 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, - }); - }, - occupationInput(e) { - this.setData({ - occupation: e.detail.value, - }); - }, - careerNameClick() { - wx.navigateTo({ - url: `/package-events/sign-up/career-name?nameList=${JSON.stringify(this.data.nameList)}` - }); - }, - 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?directionList=${JSON.stringify(this.data.directionList)}` - }); - }, - giteeInput(e) { - this.setData({ - gitee: e.detail.value, - }); - }, - signUp() { - if (!localMethods.validation()) { - return; - } - const postData = { - company: this.data.enterprise, - wx_account:this.data.wechat, - age:this.data.age, - gender:this.data.gender, - email: this.data.mail, - gitee_id: this.data.gitee, - name: this.data.name, - career_direction:JSON.stringify(this.data.directionList), - profession: JSON.stringify(this.data.nameList), - working_years:this.data.work, - telephone: this.data.tel, - activity: this.data.id, - }; - remoteMethods.signUp(postData, () => { - wx.redirectTo({ - url: `/package-events/sign-up/sign-up-success?name=${encodeURIComponent( - this.data.name - )}&title=${encodeURIComponent(this.data.eventTitle)}&tel=${encodeURIComponent( - this.data.tel - )}&poster=${encodeURIComponent(this.data.poster)}&id=${encodeURIComponent(this.data.id)}`, - }); - }); - }, - back() { - wx.navigateBack(); - }, -}); diff --git a/src/mindspore/package-events/sign-up/sign-up.wxml b/src/mindspore/package-events/sign-up/sign-up.wxml deleted file mode 100644 index ce99c422f4a669290a9fe5de95b4afa05c185beb..0000000000000000000000000000000000000000 --- a/src/mindspore/package-events/sign-up/sign-up.wxml +++ /dev/null @@ -1,167 +0,0 @@ - - - - - - - 您的姓名 - * - - - - - - 微信号 - * - - - - - - 性别 - * - - - - - 男 - - - 女 - - - - - - - 年龄段 - * - - - {{ age }} - - - - - - 您的手机 - * - - - - - - 您的邮箱 - * - - - - - - 就职公司/所读学校 - * - - - - - - 职业方向 - * - - - - {{ item.value }} - - - - - - 职业名称 - * - - - - {{ item.value }} - - - - - - 工作年限 - * - - - {{ work }} - - - - - - 您的Gitee ID - - - - - - - - - - * - 号为必填项 - - - - - - - - - - 选择年龄段 - - - - - {{item}} - - - - - - - - - - - - - 选择工作年限 - - - - - {{item}} - - - - - - - - - - - \ No newline at end of file diff --git a/src/mindspore/package-events/sign-up/wxml-to-canvas.js b/src/mindspore/package-events/sign-up/wxml-to-canvas.js deleted file mode 100644 index 1cfe6c7fbec1d78d682f7f7cee861bc8c5f155c1..0000000000000000000000000000000000000000 --- a/src/mindspore/package-events/sign-up/wxml-to-canvas.js +++ /dev/null @@ -1,97 +0,0 @@ -const wxml = (data) => { - return ` - - - - - 报名成功! - ${data.title} - 您的参会凭证 - 姓名: ${data.name} - 手机: ${data.tel} - - - - `; -}; - -const style = () => { - return { - container: { - width: 375, - height: 750, - flexDirection: 'column', - alignItems: 'center', - }, - absolute: { - width: 375, - height: 750, - flexDirection: 'column', - alignItems: 'center', - }, - avatar: { - marginTop: 110, - width: 176, - height: 58, - }, - successText: { - color: '#333333', - fontSize: 20, - marginTop: 80, - fontWeight: 500, - height: 28, - width: 100, - textAlign: 'center', - }, - title: { - color: '#40ADFF', - fontSize: 17, - marginTop: 15, - height: 25, - width: 300, - textAlign: 'center', - }, - voucher: { - color: '#333333', - fontSize: 17, - marginTop: 15, - height: 25, - width: 300, - textAlign: 'center', - }, - name: { - marginTop: 33, - fontSize: 17, - color: '#40ADFF', - height: 25, - width: 300, - textAlign: 'center', - }, - tel: { - marginTop: 15, - fontSize: 17, - color: '#40ADFF', - height: 25, - width: 350, - textAlign: 'center', - }, - qrcode: { - marginTop: 30, - height: 150, - width: 150, - borderRadius: 75 - }, - bgImg: { - position: 'absolute', - width: 375, - height: 750, - top: 0, - left: 0, - }, - }; -}; - -module.exports = { - wxml, - style, -}; diff --git a/src/mindspore/package-meeting/meeting/detail.wxml b/src/mindspore/package-meeting/meeting/detail.wxml index 7399a6c61a3b55182adf93c1859baaa6abe459d2..0c4617bff83823db33e9936be56f2b36e174fcb8 100644 --- a/src/mindspore/package-meeting/meeting/detail.wxml +++ b/src/mindspore/package-meeting/meeting/detail.wxml @@ -1,73 +1,74 @@ - - - - {{info.topic}} - - - {{info.date}} {{info.start}}-{{info.end}} - - - - - {{info.group_name}} - - - - {{info.agenda}} - - - - Etherpad链接 - - - {{info.etherpad}} - - - - - - - 腾讯会议 - - - ID: {{info.mid}} - - - - {{info.join_url}} - - - - - - - - - 录屏上传链接 - - - {{info.replay_url}} - - - - - - - - - - 一键收藏此会议,即可收到会议提醒通知哦! - + + + + {{info.topic}} + + + {{info.date}} {{info.start}}-{{info.end}} + + + + + {{info.group_name}} + + + + {{info.agenda}} + + + + Etherpad链接 + + + {{info.etherpad}} + + + + + + + 腾讯会议 + WeLink + + + ID: {{info.mid}} + + + + {{info.join_url}} + + + + + + + + + 录屏上传链接 + + + {{info.replay_url}} + + + + + + + + + + 一键收藏此会议,即可收到会议提醒通知哦! + \ No newline at end of file diff --git a/src/mindspore/package-meeting/reserve/reserve.js b/src/mindspore/package-meeting/reserve/reserve.js index bea736d8c0333e0503392c61ca540896df35f76b..93a9faca66e6d5655cc68ecda9c757e3d0fbaea7 100644 --- a/src/mindspore/package-meeting/reserve/reserve.js +++ b/src/mindspore/package-meeting/reserve/reserve.js @@ -1,708 +1,733 @@ -// pages/reserve/reserve.js -var appAjax = require('./../../utils/app-ajax'); -var appSession = require('./../../utils/app-session.js'); -var utils = require('./../../utils/utils.js'); -const sessionUtil = require('../../utils/app-session.js'); -const appUser = require('../../utils/app-user.js'); -utils.formateDate(); -let remoteMethods = { - getUserGroup: function (id, _callback) { - appAjax.postJson({ - autoShowWait: true, - type: 'GET', - service: 'GET_USER_GROUP', - otherParams: { - id: id, - }, - success: function (ret) { - _callback && _callback(ret); - }, - }); - }, - saveMeeting: function (postData, _callback) { - appAjax.postJson({ - autoShowWait: true, - type: 'POST', - service: 'SAVE_MEETING', - data: postData, - success: function (ret) { - _callback && _callback(ret); - }, - }); - }, - getMsgList: function (keyword, _callback) { - appAjax.postJson({ - autoShowWait: true, - type: 'GET', - service: 'MSG_LIST', - data: { - search: keyword, - }, - success: function (ret) { - _callback && _callback(ret); - }, - }); - }, - getSigList: function (keyword, _callback) { - appAjax.postJson({ - autoShowWait: true, - type: 'GET', - service: 'SIG_LIST', - data: { - search: keyword, - }, - success: function (ret) { - _callback && _callback(ret); - }, - }); - }, - getUserCityList:function (keyword, _callback) { - appAjax.postJson({ - autoShowWait: true, - type: 'GET', - service: 'GROUP_USER_CITY', - otherParams: { - id: keyword - }, - success: function (ret) { - _callback && _callback(ret); - }, - }); - }, -}; -let localMethods = { - validation: function (that) { - if (!that.data.topic) { - this.toast('请输入会议名称'); - return; - } - if (!that.data.sponsor) { - this.toast('请联系管理员编辑您的gitee name'); - return; - } - if (!that.data.typeMeeting) { - this.toast('请选择会议类型'); - return; - } - if (that.data.meeting_type == 1 && !that.data.sigResult) { - this.toast('请选择所在SIG'); - return; - } - if (that.data.meeting_type == 2 && !that.data.msgResult) { - this.toast('请选择所在城市'); - return; - } - if (!that.data.date) { - this.toast('请选择日期'); - return; - } - if (!that.data.start) { - this.toast('请选择开始时间'); - return; - } - if (!that.data.end) { - this.toast('请选择结束时间'); - return; - } - if ( - that.data.start.split(':')[0] > that.data.end.split(':')[0] || - (that.data.start.split(':')[0] == that.data.end.split(':')[0] && - that.data.start.split(':')[1] >= that.data.end.split(':')[1]) - ) { - this.toast('开始时间必须小于结束时间'); - return; - } - return true; - }, - toast: function (msg) { - wx.showToast({ - title: msg, - icon: 'none', - duration: 2000, - }); - }, -}; -Page({ - /** - * 页面的初始数据 - */ - data: { - record: false, - topic: '', - sponsor: '', - date: '', - start: '', - end: '', - etherpad: '', - agenda: '', - emaillist: '', - sigPopShow: false, - msgPopShow:false, - typeResult: '', - typeMeeting:'', - group_name: '', - city:'', - meeting_type: 1, - sigResult: '', - msgResult:'', - sigList: ['abc','bbc'], - msgList: ['上海','北京'], - datePopShow: false, - curDate: new Date().getTime(), - currentDate: new Date().getTime(), - minDate: new Date().getTime(), - timePopShow: false, - currentTime: '08:00', - minTime: 8, - maxTime: 22, - endTimePopShow: false, - currentEndTime: '08:00', - minEndTime: 8, - maxEndTime: 22, - showDialogWarn: false, - isSig: false, - isMSG:false, - showMeetType: false, - allData: [], - typeKey:'', - type:{ - Tech:'专家委员会', - MSG:'MSG会议', - SIG:'SIG会议' - }, - msgListAll:[], - sigListAll:[], - permission:[], - msgCityList:[], - tipsType:'', - filter(type, options) { - if (type === 'minute') { - return options.filter((option) => option % 15 === 0); - } - - return options; - }, - level:'' - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function () { - let that=this - let e=sessionUtil.getUserInfoByKey('avatarUrl') - appUser.updateUserInfo(function () { - that.setData({ - level: sessionUtil.getUserInfoByKey('level'), - }); - }); - }, - /** - * 生命周期函数--监听页面显示 - */ - onShow: function () { - this.setData({ - sponsor: appSession.getUserInfoByKey('gitee') || '', - }); - let that = this; - const level=sessionUtil.getUserInfoByKey('level') - // appSession.getUserInfoByKey('userId') - if(level==3){ - remoteMethods.getMsgList('', function (list) { - let tempList=[] - list.forEach(item=>{ - tempList.push(item.name) - }) - that.setData({ - msgListAll: list, - permission:['Tech','MSG','SIG'], - msgList:tempList, - msgCityList:list - }); - }); - remoteMethods.getSigList('',function (list) { - let tempList=[] - list.forEach(item=>{ - tempList.push(item.name) - }) - that.setData({ - sigListAll: list, - sigList:tempList - }); - }) - }else{ - remoteMethods.getUserGroup(appSession.getUserInfoByKey('userId'), function (data) { - let permissionTemp=[] - { - // if (data && data.length) { - // that.setData({ - // allData: data, - // }); - // let temp = []; - // let sigValue = ''; - // let typeTemp = []; - // data.forEach((item) => { - // if (item.group_type == '1') { - // temp.push(item.group_name); - // sigValue = item.description; - // if(!permissionTemp.includes("SIG")){ - // permissionTemp.push('SIG') - // } - // } else { - // typeTemp.push(item.description); - // if(item.group_type == '2'&&!permissionTemp.includes("MSG")){ - // permissionTemp.push('MSG') - // } - // if(item.group_type == '3'&&!permissionTemp.includes("Tech")){ - // permissionTemp.push('Tech') - // } - // } - // }); - // if (sigValue) { - // typeTemp.push(sigValue); - // } - // that.setData({ - // sigList: temp, - // typeList: typeTemp, - // }); - // if (that.data.typeList[0].includes('SIG')) { - // that.setData({ - // typeResult: that.data.typeList[0], - // isSig: true, - // }); - // } else { - // that.data.allData.forEach((item) => { - // if (item.group_type != 1) { - // if (item.group_name == 'MSG' && that.data.typeList[0].includes('MSG')) { - // that.setData({ - // typeResult: that.data.typeList[0], - // etherpad: item.etherpad, - // group_name: item.group_name, - // meeting_type: item.group_type, - // }); - // } else if (item.group_name == 'Tech' && that.data.typeList[0].includes('专家')) { - // that.setData({ - // typeResult: that.data.typeList[0], - // etherpad: item.etherpad, - // group_name: item.group_name, - // meeting_type: item.group_type, - // }); - - // } - // } - // }); - // } - // } - } - if(data && data.length){ - that.setData({ - allData: data, - }); - let msgListAll=[] - let sigListAll=[] - let sigList=[] - data.forEach((item)=>{ - if(item.group_type==3){ - permissionTemp.push('Tech') - }else if(item.group_type==2){ - permissionTemp.push('MSG') - }else if(item.group_type==1){ - item.name=item.group_name - permissionTemp.push('SIG') - sigList.push(item.group_name) - sigListAll.push(item) - } - }) - permissionTemp=[...new Set(permissionTemp)] - that.setData({ - permission:permissionTemp, - sigListAll:sigListAll, - sigList:sigList - }) - if(permissionTemp.includes('MSG')){ - remoteMethods.getUserCityList(appSession.getUserInfoByKey('userId'),function(data){ - let tempList=[] - data.forEach(item=>{ - item.name=item.city_name - tempList.push(item.city_name) - }) - that.setData({ - msgListAll:data, - msgList:tempList - }) - }) - remoteMethods.getMsgList('', function (list) { - that.setData({ - msgCityList:list - }) - }) - } - } - - }); - } - }, - recordoOnChange: function (event) { - this.setData({ - record: event.detail, - }); - }, - reset: function () { - this.setData({ - topic: '', - typeResult: '', - sigResult: '', - msgResult:'', - date: '', - start: '', - end: '', - etherpad: '', - agenda: '', - emaillist: '', - record: '', - }); - }, - meeting: function () { - if (!localMethods.validation(this)) { - return; - } - let that = this; - wx.requestSubscribeMessage({ - tmplIds: ['tK51rqE72oFo5e5ajCnvkPwnsCncfydgcV1jb9ed6Qc'], - success() {}, - complete() { - let param={ - topic: that.data.topic, - sponsor: that.data.sponsor, - group_name: that.data.group_name, - date: that.data.date, - start: that.data.start, - end: that.data.end, - etherpad: that.data.etherpad, - meeting_type: that.data.meeting_type, - emaillist: that.data.emaillist, - record: that.data.record ? 'cloud' : '', - agenda: that.data.agenda, - } - if(that.data.meeting_type==2){ - param.city=that.data.city - } - remoteMethods.saveMeeting( - param, - function (data) { - if (data.id) { - wx.redirectTo({ - url: '/package-meeting/meeting/meeting-success?id=' + data.id, - }); - } else { - setTimeout(function () { - wx.showToast( - { - title: data.message, - icon: 'none', - duration: 2000, - }, - 100 - ); - }); - } - } - ); - }, - }); - }, - sigNameInput: function (e) { - this.setData({ - topic: e.detail.value, - }); - }, - etherInput: function (e) { - this.setData({ - etherpad: e.detail.value, - }); - }, - agendaInput: function (e) { - this.setData({ - agenda: e.detail.value, - }); - }, - emailInput: function (e) { - this.setData({ - emaillist: e.detail.value, - }); - }, - sigConfirm: function () { - // this.data.allData.forEach((item) => { - // if (item.group_name == this.data.sigResult) { - // this.setData({ - // etherpad: item.etherpad, - // sigPopShow: false, - // group_name: item.group_name, - // }); - // } - // }); - this.data.sigListAll.forEach((item)=>{ - if(item.name==this.data.sigResult){ - this.setData({ - etherpad: item.etherpad, - sigPopShow: false, - group_name: item.name, - city:'' - }); - } - }) - }, - msgConfirm:function(){ - // this.data.msgListAll.forEach((item)=>{ - // if(item.name==this.data.msgResult){ - // this.setData({ - // etherpad: item.etherpad||'', - // msgPopShow: false, - // city: item.name, - // group_name:'MSG' - // }); - // } - // }) - this.data.msgCityList.forEach((item)=>{ - if(item.name==this.data.msgResult){ - this.setData({ - etherpad: item.etherpad, - msgPopShow: false, - city: item.name, - group_name:'MSG' - }); - } - }) - }, - typeConfirm: function (e) { - this.setData({ - typeMeeting:this.data.type[this.data.typeKey] - }) - if(this.data.typeKey=='Tech'){ - if(this.data.permission.includes(this.data.typeKey)){ - this.setData({ - showMeetType: false, - meeting_type: 3, - isSig: false, - isMSG:false, - city:'', - group_name:'Tech', - etherpad: 'https://etherpad.mindspore.cn/p/meetings-Tech', - sigResult:'', - msgResult:'' - }); - }else{ - this.setData({ - showDialogWarn: true, - tipsType:'Tech' - }); - } - }else if(this.data.typeKey=='SIG'){ - if(this.data.permission.includes(this.data.typeKey)){ - this.setData({ - showMeetType: false, - isMSG:false, - isSig: true, - meeting_type: 1, - etherpad:'', - sigResult:'', - msgResult:'' - }); - }else{ - this.setData({ - showDialogWarn: true, - tipsType:'SIG' - }); - } - }else if(this.data.typeKey=='MSG'){ - if(this.data.permission.includes(this.data.typeKey)){ - this.setData({ - showMeetType: false, - isSig: false, - meeting_type: 2, - isMSG:true, - etherpad:'', - sigResult:'', - msgResult:'' - }); - }else{ - this.setData({ - showDialogWarn: true, - tipsType:'MSG' - }); - } - } - - // if (this.data.typeResult.includes('SIG')) { - // this.setData({ - // isSig: true, - // showMeetType: false, - // meeting_type: 1, - // }); - // } else { - // this.setData({ - // showMeetType: false, - // isSig: false, - // }); - // this.data.allData.forEach((item) => { - // if (item.group_type != 1) { - // if (this.data.typeResult.includes('MSG') && item.group_name == 'MSG') { - // this.setData({ - // etherpad: item.etherpad, - // group_name: 'MSG', - // meeting_type: 2, - // }); - // } else { - // this.setData({ - // etherpad: item.etherpad, - // group_name: 'Tech', - // meeting_type: 3, - // }); - // } - // } - // }); - // } - }, - dateConfirm: function () { - this.setData({ - date: new Date(this.data.currentDate).Format('yyyy-MM-dd'), - datePopShow: false, - }); - }, - timeConfirm: function () { - this.setData({ - start: this.data.currentTime, - timePopShow: false, - }); - }, - endTimeConfirm: function () { - this.setData({ - end: this.data.currentEndTime, - endTimePopShow: false, - }); - }, - - typeRadioOnChange: function (e) { - this.setData({ - typeKey: e.detail, - }); - }, - sigRadioOnChange: function (e) { - this.setData({ - sigResult:e.detail - }) - }, - msgRadioOnChange: function (e) { - this.setData({ - msgResult:e.detail - }) - }, - selType: function () { - this.setData({ - showMeetType: true, - }); - }, - selSig: function () { - if (!this.data.msgList.length) { - this.setData({ - showDialogWarn: true, - }); - return; - } - this.setData({ - sigPopShow: true, - }); - }, - selMSG:function(){ - if (!this.data.msgList.length) { - this.setData({ - showDialogWarn: true, - }); - return; - } - this.setData({ - msgPopShow:true - }) - }, - warnCancel: function () { - this.setData({ - showDialogWarn: false, - }); - }, - sigCancel: function () { - this.setData({ - sigPopShow: false, - sigResult:'' - }); - }, - msgCancel:function(){ - this.setData({ - msgPopShow: false, - msgResult:'' - }); - }, - typeCancel: function () { - this.setData({ - showMeetType: false, - }); - }, - selDate: function () { - this.setData({ - datePopShow: true, - }); - }, - selTime: function () { - this.setData({ - timePopShow: true, - }); - }, - selEndTime: function () { - this.setData({ - endTimePopShow: true, - }); - }, - dateCancel: function () { - this.setData({ - datePopShow: false, - }); - }, - timeCancel: function () { - this.setData({ - timePopShow: false, - }); - }, - endTimeCancel: function () { - this.setData({ - endTimePopShow: false, - }); - }, - dateOnInput: function (e) { - this.setData({ - currentDate: e.detail, - }); - }, - timeOnInput: function (e) { - this.setData({ - currentTime: e.detail, - }); - }, - endTimeOnInput: function (e) { - this.setData({ - currentEndTime: e.detail, - }); - }, - copyWechat() { - wx.setClipboardData({ - data: 'mindspore0328', - success: () => { - this.setData({ - showDialogWarn: false, - tipsType:'', - typeMeeting:'', - isSig:false, - isMSG:false - }); - }, - }); - }, -}); +// pages/reserve/reserve.js +var appAjax = require('./../../utils/app-ajax'); +var appSession = require('./../../utils/app-session.js'); +var utils = require('./../../utils/utils.js'); +const sessionUtil = require('../../utils/app-session.js'); +const appUser = require('../../utils/app-user.js'); +utils.formateDate(); +let remoteMethods = { + getUserGroup: function (id, _callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'GET', + service: 'GET_USER_GROUP', + otherParams: { + id: id, + }, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, + saveMeeting: function (postData, _callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'POST', + service: 'SAVE_MEETING', + data: postData, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, + getMsgList: function (keyword, _callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'GET', + service: 'MSG_LIST', + data: { + search: keyword, + }, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, + getSigList: function (keyword, _callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'GET', + service: 'SIG_LIST', + data: { + search: keyword, + }, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, + getUserCityList:function (keyword, _callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'GET', + service: 'GROUP_USER_CITY', + otherParams: { + id: keyword + }, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, +}; +let localMethods = { + validation: function (that) { + if (!that.data.topic) { + this.toast('请输入会议名称'); + return; + } + if (!that.data.sponsor) { + this.toast('请联系管理员编辑您的gitee name'); + return; + } + if (!that.data.typeMeeting) { + this.toast('请选择会议类型'); + return; + } + if (that.data.meeting_type == 1 && !that.data.sigResult) { + this.toast('请选择所在SIG'); + return; + } + if (that.data.meeting_type == 2 && !that.data.msgResult) { + this.toast('请选择所在城市'); + return; + } + if (!that.data.date) { + this.toast('请选择日期'); + return; + } + if (!that.data.start) { + this.toast('请选择开始时间'); + return; + } + if (!that.data.end) { + this.toast('请选择结束时间'); + return; + } + if ( + that.data.start.split(':')[0] > that.data.end.split(':')[0] || + (that.data.start.split(':')[0] == that.data.end.split(':')[0] && + that.data.start.split(':')[1] >= that.data.end.split(':')[1]) + ) { + this.toast('开始时间必须小于结束时间'); + return; + } + return true; + }, + toast: function (msg) { + wx.showToast({ + title: msg, + icon: 'none', + duration: 2000, + }); + }, +}; +Page({ + /** + * 页面的初始数据 + */ + data: { + record: false, + topic: '', + sponsor: '', + date: '', + start: '', + end: '', + meetingType:'腾讯会议', + typeList:['腾讯会议','WeLink(蓝版)'], + etherpad: '', + agenda: '', + emaillist: '', + sigPopShow: false, + msgPopShow:false, + typeResult: '', + typeMeeting:'', + group_name: '', + city:'', + meeting_type: 1, + sigResult: '', + msgResult:'', + sigList: ['abc','bbc'], + msgList: ['上海','北京'], + datePopShow: false, + curDate: new Date().getTime(), + currentDate: new Date().getTime(), + minDate: new Date().getTime(), + timePopShow: false, + currentTime: '08:00', + minTime: 8, + maxTime: 22, + endTimePopShow: false, + currentEndTime: '08:00', + minEndTime: 8, + maxEndTime: 22, + showDialogWarn: false, + isSig: false, + isMSG:false, + showMeetType: false, + allData: [], + typeKey:'', + type:{ + Tech:'专家委员会', + MSG:'MSG会议', + SIG:'SIG会议' + }, + msgListAll:[], + sigListAll:[], + permission:[], + msgCityList:[], + tipsType:'', + filter(type, options) { + if (type === 'minute') { + return options.filter((option) => option % 15 === 0); + } + + return options; + }, + level:'' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function () { + let that=this + let e=sessionUtil.getUserInfoByKey('avatarUrl') + appUser.updateUserInfo(function () { + that.setData({ + level: sessionUtil.getUserInfoByKey('level'), + }); + }); + }, + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + this.setData({ + sponsor: appSession.getUserInfoByKey('gitee') || '', + }); + let that = this; + const level=sessionUtil.getUserInfoByKey('level') + // appSession.getUserInfoByKey('userId') + if(level==3){ + remoteMethods.getMsgList('', function (list) { + let tempList=[] + list.forEach(item=>{ + tempList.push(item.name) + }) + that.setData({ + msgListAll: list, + permission:['Tech','MSG','SIG'], + msgList:tempList, + msgCityList:list + }); + }); + remoteMethods.getSigList('',function (list) { + let tempList=[] + list.forEach(item=>{ + tempList.push(item.name) + }) + that.setData({ + sigListAll: list, + sigList:tempList + }); + }) + }else{ + remoteMethods.getUserGroup(appSession.getUserInfoByKey('userId'), function (data) { + let permissionTemp=[] + { + // if (data && data.length) { + // that.setData({ + // allData: data, + // }); + // let temp = []; + // let sigValue = ''; + // let typeTemp = []; + // data.forEach((item) => { + // if (item.group_type == '1') { + // temp.push(item.group_name); + // sigValue = item.description; + // if(!permissionTemp.includes("SIG")){ + // permissionTemp.push('SIG') + // } + // } else { + // typeTemp.push(item.description); + // if(item.group_type == '2'&&!permissionTemp.includes("MSG")){ + // permissionTemp.push('MSG') + // } + // if(item.group_type == '3'&&!permissionTemp.includes("Tech")){ + // permissionTemp.push('Tech') + // } + // } + // }); + // if (sigValue) { + // typeTemp.push(sigValue); + // } + // that.setData({ + // sigList: temp, + // typeList: typeTemp, + // }); + // if (that.data.typeList[0].includes('SIG')) { + // that.setData({ + // typeResult: that.data.typeList[0], + // isSig: true, + // }); + // } else { + // that.data.allData.forEach((item) => { + // if (item.group_type != 1) { + // if (item.group_name == 'MSG' && that.data.typeList[0].includes('MSG')) { + // that.setData({ + // typeResult: that.data.typeList[0], + // etherpad: item.etherpad, + // group_name: item.group_name, + // meeting_type: item.group_type, + // }); + // } else if (item.group_name == 'Tech' && that.data.typeList[0].includes('专家')) { + // that.setData({ + // typeResult: that.data.typeList[0], + // etherpad: item.etherpad, + // group_name: item.group_name, + // meeting_type: item.group_type, + // }); + + // } + // } + // }); + // } + // } + } + if(data && data.length){ + that.setData({ + allData: data, + }); + let msgListAll=[] + let sigListAll=[] + let sigList=[] + data.forEach((item)=>{ + if(item.group_type==3){ + permissionTemp.push('Tech') + }else if(item.group_type==2){ + permissionTemp.push('MSG') + }else if(item.group_type==1){ + item.name=item.group_name + permissionTemp.push('SIG') + sigList.push(item.group_name) + sigListAll.push(item) + } + }) + permissionTemp=[...new Set(permissionTemp)] + that.setData({ + permission:permissionTemp, + sigListAll:sigListAll, + sigList:sigList + }) + if(permissionTemp.includes('MSG')){ + remoteMethods.getUserCityList(appSession.getUserInfoByKey('userId'),function(data){ + let tempList=[] + data.forEach(item=>{ + item.name=item.city_name + tempList.push(item.city_name) + }) + that.setData({ + msgListAll:data, + msgList:tempList + }) + }) + remoteMethods.getMsgList('', function (list) { + that.setData({ + msgCityList:list + }) + }) + } + } + + }); + } + }, + recordoOnChange: function (event) { + this.setData({ + record: event.detail, + }); + }, + reset: function () { + this.setData({ + topic: '', + typeResult: '', + sigResult: '', + msgResult:'', + date: '', + start: '', + end: '', + etherpad: '', + agenda: '', + emaillist: '', + record: '', + }); + }, + meeting: function () { + if (!localMethods.validation(this)) { + return; + } + let that = this; + wx.requestSubscribeMessage({ + tmplIds: ['tK51rqE72oFo5e5ajCnvkPwnsCncfydgcV1jb9ed6Qc'], + success() {}, + complete() { + let platform = ''; + that.data.meetingType.includes('WeLink') ? platform = that.data.meetingType.slice(0,6):platform = 'tencent'; + let param={ + topic: that.data.topic, + sponsor: that.data.sponsor, + platform:platform, + group_name: that.data.group_name, + date: that.data.date, + start: that.data.start, + end: that.data.end, + etherpad: that.data.etherpad, + meeting_type: that.data.meeting_type, + emaillist: that.data.emaillist, + record: that.data.record ? 'cloud' : '', + agenda: that.data.agenda, + } + if(that.data.meeting_type==2){ + param.city=that.data.city + } + remoteMethods.saveMeeting( + param, + function (data) { + if (data.id) { + wx.redirectTo({ + url: '/package-meeting/meeting/meeting-success?id=' + data.id, + }); + } else { + setTimeout(function () { + wx.showToast( + { + title: data.message, + icon: 'none', + duration: 2000, + }, + 100 + ); + }); + } + } + ); + }, + }); + }, + sigNameInput: function (e) { + this.setData({ + topic: e.detail.value, + }); + }, + etherInput: function (e) { + this.setData({ + etherpad: e.detail.value, + }); + }, + agendaInput: function (e) { + this.setData({ + agenda: e.detail.value, + }); + }, + emailInput: function (e) { + this.setData({ + emaillist: e.detail.value, + }); + }, + sigConfirm: function () { + // this.data.allData.forEach((item) => { + // if (item.group_name == this.data.sigResult) { + // this.setData({ + // etherpad: item.etherpad, + // sigPopShow: false, + // group_name: item.group_name, + // }); + // } + // }); + this.data.sigListAll.forEach((item)=>{ + if(item.name==this.data.sigResult){ + this.setData({ + etherpad: item.etherpad, + sigPopShow: false, + group_name: item.name, + city:'' + }); + } + }) + }, + msgConfirm:function(){ + // this.data.msgListAll.forEach((item)=>{ + // if(item.name==this.data.msgResult){ + // this.setData({ + // etherpad: item.etherpad||'', + // msgPopShow: false, + // city: item.name, + // group_name:'MSG' + // }); + // } + // }) + this.data.msgCityList.forEach((item)=>{ + if(item.name==this.data.msgResult){ + this.setData({ + etherpad: item.etherpad, + msgPopShow: false, + city: item.name, + group_name:'MSG' + }); + } + }) + }, + onTypeShow: function () { + this.setData({ + typeShow: true, + }) + }, + platformTypeCancel: function () { + this.setData({ + typeShow: false, + }); + }, + platformTypeConfirm: function () { + this.setData({ + typeShow: false, + }); + }, + typeRadioOnChange1: function (e) { + this.setData({ + meetingType:e.detail + }); + }, + typeConfirm: function (e) { + this.setData({ + typeMeeting:this.data.type[this.data.typeKey] + }) + if(this.data.typeKey=='Tech'){ + if(this.data.permission.includes(this.data.typeKey)){ + this.setData({ + showMeetType: false, + meeting_type: 3, + isSig: false, + isMSG:false, + city:'', + group_name:'Tech', + etherpad: 'https://etherpad.mindspore.cn/p/meetings-Tech', + sigResult:'', + msgResult:'' + }); + }else{ + this.setData({ + showDialogWarn: true, + tipsType:'Tech' + }); + } + }else if(this.data.typeKey=='SIG'){ + if(this.data.permission.includes(this.data.typeKey)){ + this.setData({ + showMeetType: false, + isMSG:false, + isSig: true, + meeting_type: 1, + etherpad:'', + sigResult:'', + msgResult:'' + }); + }else{ + this.setData({ + showDialogWarn: true, + tipsType:'SIG' + }); + } + }else if(this.data.typeKey=='MSG'){ + if(this.data.permission.includes(this.data.typeKey)){ + this.setData({ + showMeetType: false, + isSig: false, + meeting_type: 2, + isMSG:true, + etherpad:'', + sigResult:'', + msgResult:'' + }); + }else{ + this.setData({ + showDialogWarn: true, + tipsType:'MSG' + }); + } + } + + // if (this.data.typeResult.includes('SIG')) { + // this.setData({ + // isSig: true, + // showMeetType: false, + // meeting_type: 1, + // }); + // } else { + // this.setData({ + // showMeetType: false, + // isSig: false, + // }); + // this.data.allData.forEach((item) => { + // if (item.group_type != 1) { + // if (this.data.typeResult.includes('MSG') && item.group_name == 'MSG') { + // this.setData({ + // etherpad: item.etherpad, + // group_name: 'MSG', + // meeting_type: 2, + // }); + // } else { + // this.setData({ + // etherpad: item.etherpad, + // group_name: 'Tech', + // meeting_type: 3, + // }); + // } + // } + // }); + // } + }, + dateConfirm: function () { + this.setData({ + date: new Date(this.data.currentDate).Format('yyyy-MM-dd'), + datePopShow: false, + }); + }, + timeConfirm: function () { + this.setData({ + start: this.data.currentTime, + timePopShow: false, + }); + }, + endTimeConfirm: function () { + this.setData({ + end: this.data.currentEndTime, + endTimePopShow: false, + }); + }, + + typeRadioOnChange: function (e) { + this.setData({ + typeKey: e.detail, + }); + }, + sigRadioOnChange: function (e) { + this.setData({ + sigResult:e.detail + }) + }, + msgRadioOnChange: function (e) { + this.setData({ + msgResult:e.detail + }) + }, + selType: function () { + this.setData({ + showMeetType: true, + }); + }, + selSig: function () { + if (!this.data.msgList.length) { + this.setData({ + showDialogWarn: true, + }); + return; + } + this.setData({ + sigPopShow: true, + }); + }, + selMSG:function(){ + if (!this.data.msgList.length) { + this.setData({ + showDialogWarn: true, + }); + return; + } + this.setData({ + msgPopShow:true + }) + }, + warnCancel: function () { + this.setData({ + showDialogWarn: false, + }); + }, + sigCancel: function () { + this.setData({ + sigPopShow: false, + sigResult:'' + }); + }, + msgCancel:function(){ + this.setData({ + msgPopShow: false, + msgResult:'' + }); + }, + typeCancel: function () { + this.setData({ + showMeetType: false, + }); + }, + selDate: function () { + this.setData({ + datePopShow: true, + }); + }, + selTime: function () { + this.setData({ + timePopShow: true, + }); + }, + selEndTime: function () { + this.setData({ + endTimePopShow: true, + }); + }, + dateCancel: function () { + this.setData({ + datePopShow: false, + }); + }, + timeCancel: function () { + this.setData({ + timePopShow: false, + }); + }, + endTimeCancel: function () { + this.setData({ + endTimePopShow: false, + }); + }, + dateOnInput: function (e) { + this.setData({ + currentDate: e.detail, + }); + }, + timeOnInput: function (e) { + this.setData({ + currentTime: e.detail, + }); + }, + endTimeOnInput: function (e) { + this.setData({ + currentEndTime: e.detail, + }); + }, + copyWechat() { + wx.setClipboardData({ + data: 'mindspore0328', + success: () => { + this.setData({ + showDialogWarn: false, + tipsType:'', + typeMeeting:'', + isSig:false, + isMSG:false + }); + }, + }); + }, +}); diff --git a/src/mindspore/package-meeting/reserve/reserve.wxml b/src/mindspore/package-meeting/reserve/reserve.wxml index 4db65eb9917bef1c8218eaa53f525ffb0ee790d5..515314fe65c42946d20c43249e5b1960caf81549 100644 --- a/src/mindspore/package-meeting/reserve/reserve.wxml +++ b/src/mindspore/package-meeting/reserve/reserve.wxml @@ -1,214 +1,242 @@ - - - - - - - - 会议名称 - * - - - - - 发起人 - - - - - 会议类型 - * - - - {{typeMeeting}} - - - - - - 选取所属SIG - * - - - {{sigResult}} - - - - - - 选取所属城市 - * - - - {{msgResult}} - - - - - - 日期 - * - - - {{date}} - - - - - - 时间 - * - - - {{start||'请选择'}} - - {{end||'请选择'}} - - - - Etherpad链接 - - - - - 是否自动录制会议 - - - - - - - - - 勾选此项进入会议自动开启录屏,录制服务由Zoom提供,会后自动上传至B站mindspore的账号下 - - - - 会议内容 - - - - 邮件地址 - - - - - - - 多个邮箱地址用分号;隔开 - - - - - * - 号为必填项 - - - - - - - - - - 选择所属SIG - - - - - {{item}} - - - - - - - - - - - - - 选择所属城市 - - - - - {{item}} - - - - - - - - - - - - - 选择会议类型 - - - - - {{value}} - - - - - - - - - - - - - 选择预定会议日期 - - - - - - - - - - 选择会议开始时间 - - - - - - - - - - 选择会议结束时间 - - - - - - - - - - 当前您不属于任何SIG组,请联系 - 小助手(微信号mindspore0328) 为您关联SIG组 - - 当前您不属于专家委员会,请联系 - 小助手(微信号mindspore0328) 为您关联专家委员会 - - 当前您不属于任何MSG,请联系 - 小助手(微信号mindspore0328) 为您关联MSG城市 - - - - - - + + + + + + + + 会议名称 + * + + + + + 发起人 + + + + + 会议平台 + * + + + {{meetingType}} + + + + + + 会议类型 + * + + + {{typeMeeting}} + + + + + + 选取所属SIG + * + + + {{sigResult}} + + + + + + 选取所属城市 + * + + + {{msgResult}} + + + + + + 日期 + * + + + {{date}} + + + + + + 时间 + * + + + {{start||'请选择'}} + + {{end||'请选择'}} + + + + Etherpad链接 + + + + + 是否自动录制会议 + + + + + + + + + 勾选此项进入会议自动开启录屏,录制服务由{{meetingType}}提供,会后自动上传至B站mindspore的账号下 + + + + 会议内容 + + + + 邮件地址 + + + + + + + 多个邮箱地址用分号;隔开 + + + + + * + 号为必填项 + + + + + + + + + + 选择所属SIG + + + + + {{item}} + + + + + + + + + + + + + 选择所属城市 + + + + + {{item}} + + + + + + + + + + + + + 选择会议类型 + + + + + {{value}} + + + + + + + + + + + + + 选择预定会议日期 + + + + + + + + + + 选择会议开始时间 + + + + + + + + + + 选择会议结束时间 + + + + + + + + + + 当前您不属于任何SIG组,请联系 + 小助手(微信号mindspore0328) 为您关联SIG组 + + 当前您不属于专家委员会,请联系 + 小助手(微信号mindspore0328) 为您关联专家委员会 + + 当前您不属于任何MSG,请联系 + 小助手(微信号mindspore0328) 为您关联MSG城市 + + + + + + + + + 选择会议平台 + + + + + {{item}} + + + + + + + + + + \ No newline at end of file diff --git a/src/mindspore/package-meeting/sig/member-detail.js b/src/mindspore/package-meeting/sig/member-detail.js index 2ab36fffac1acc3291d752aede66a8c9cbc9bc1a..ec7ec692f306b04572bba37dcbe6652dc59508c0 100644 --- a/src/mindspore/package-meeting/sig/member-detail.js +++ b/src/mindspore/package-meeting/sig/member-detail.js @@ -12,7 +12,7 @@ let remoteMethods = { data: { gitee_name: postData.gitee_name, email: postData.email, - telephone: postData.email, + telephone: postData.telephone, }, success: function (ret) { _callback && _callback(ret); diff --git a/src/mindspore/package-meeting/sig/member-detail.wxml b/src/mindspore/package-meeting/sig/member-detail.wxml index 6cc5d767d57f5355014ca7c1fdc647241e5dcb9e..3a89a19a1bc2cc9601a7364f6957366944b2c2a1 100644 --- a/src/mindspore/package-meeting/sig/member-detail.wxml +++ b/src/mindspore/package-meeting/sig/member-detail.wxml @@ -13,10 +13,10 @@ 输入ID - 输入手机 - - 输入邮箱 - + 备注一 + + 备注二 + diff --git a/src/mindspore/package-my/events/my-list.wxml b/src/mindspore/package-my/events/my-list.wxml index cd51139a3ef02fd9707794419f88bff0e6ae626a..d9693e69cc02c74ad1746045d6fe91ce086881c8 100644 --- a/src/mindspore/package-my/events/my-list.wxml +++ b/src/mindspore/package-my/events/my-list.wxml @@ -34,9 +34,9 @@ - + + + diff --git a/src/mindspore/pages/auth/auth.js b/src/mindspore/pages/auth/auth.js index 6f6078e99e74a51d4a8dd10b3bacafc115a5ba03..957aefdb59a0435c81305e588ebbe943994594da 100644 --- a/src/mindspore/pages/auth/auth.js +++ b/src/mindspore/pages/auth/auth.js @@ -35,7 +35,7 @@ Page( if (res.authSetting['scope.userInfo']) { appUser.wxLogin(function () { const pages = getCurrentPages(); // 当前页面 - const beforePage = pages[pages.length - 2]; // 前一个页面 + const beforePage = ((pages[pages.length - 2].route === 'pages/auth/auth') ? pages[pages.length - 3] : pages[pages.length - 2]); // 前一个页面 const id = beforePage.options.id || that.data.id; const url = id ? '/' + beforePage.route + '?id=' + id : '/' + beforePage.route; wx.reLaunch({ @@ -52,7 +52,7 @@ Page( success: (res) => { appUser.wxGetUserProfileLogin(function () { const pages = getCurrentPages(); // 当前页面 - const beforePage = pages[pages.length - 2]; // 前一个页面 + const beforePage = ((pages[pages.length - 2].route === 'pages/auth/auth') ? pages[pages.length - 3] : pages[pages.length - 2]); // 前一个页面 const id = beforePage.options.id || that.data.id; const url = id ? '/' + beforePage.route + '?id=' + id : '/' + beforePage.route; wx.reLaunch({ diff --git a/src/mindspore/static/index/banner-2.png b/src/mindspore/static/index/banner-2.png new file mode 100644 index 0000000000000000000000000000000000000000..fb7bc361f53e8bdc2c2d0a488defe1e478b6fafb Binary files /dev/null and b/src/mindspore/static/index/banner-2.png differ diff --git a/src/mindspore/utils/app-user.js b/src/mindspore/utils/app-user.js index c7b4636a3a67d440c9c3f2805ccd277f75c0a2aa..4d4636d7eca4909f0674e79cbb6f298f20fe214c 100644 --- a/src/mindspore/utils/app-user.js +++ b/src/mindspore/utils/app-user.js @@ -169,38 +169,6 @@ var appUser = { * 获取微信地址 * @param {Object} callback 回调 */ - getWxAddress: function (self, callback) { - wx.getSetting({ - success(res) { - var status = res.authSetting['scope.address']; - if (status == undefined) { - wx.authorize({ - scope: 'scope.address', - success() { - // 用户已经同意小程序使用地址功能,后续调用地址接口不会弹窗询问 - wx.chooseAddress({ - success: function (result) { - callback && callback(result); - }, - }); - }, - fail() { - self.setData({ - wxAddressShow: true, - }); - }, - }); - } else if (status) { - // 已获取权限 - wx.chooseAddress({ - success: function (result) { - callback && callback(result); - }, - }); - } - }, - }); - }, /** * 微信登录 diff --git a/src/openeuler/.gitignore b/src/openeuler/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..cac557056a071f9dd48542e4fba1064ba45a7011 --- /dev/null +++ b/src/openeuler/.gitignore @@ -0,0 +1,2 @@ +/node_modules +/package-lock.json \ No newline at end of file diff --git a/src/openeuler/app.js b/src/openeuler/app.js new file mode 100644 index 0000000000000000000000000000000000000000..7428e5d2e9845f5687bd24614ac618bf097b6f65 --- /dev/null +++ b/src/openeuler/app.js @@ -0,0 +1,50 @@ +//app.js +var appSession = require("./utils/app-session.js"); +App({ + onLaunch: function () { + var self = this + //判断微信版本是否 兼容小程序更新机制API的使用 + if (wx.canIUse('getUpdateManager')) { + //创建 UpdateManager 实例 + const updateManager = wx.getUpdateManager(); + console.log('是否进入模拟更新'); + //检测版本更新 + updateManager.onCheckForUpdate(function (res) { + console.log('是否获取版本'); + // 请求完新版本信息的回调 + if (res.hasUpdate) { + //监听小程序有版本更新事件 + updateManager.onUpdateReady(function () { + + updateManager.applyUpdate(); + }) + updateManager.onUpdateFailed(function () { + wx.showModal({ + title: '已经有新版本喽~', + content: '请您删除当前小程序,到微信 “发现-小程序” 页,重新搜索打开哦~', + }) + }) + } + }) + } else { + wx.showModal({ + title: '溫馨提示', + content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。' + }) + } + wx.getSystemInfo({ + success(res) { + if (res.model.indexOf('iPhone X') >= 0) { + self.globalData.iPhoneX = true; + } + } + }) + + }, + + onShow() {}, + loginCallback: null, + globalData: { + iphoneX: false + } +}) \ No newline at end of file diff --git a/src/openeuler/app.json b/src/openeuler/app.json new file mode 100644 index 0000000000000000000000000000000000000000..be6162097f8f07a15254a9238e1bd046f8486f63 --- /dev/null +++ b/src/openeuler/app.json @@ -0,0 +1,123 @@ +{ + "pages": [ + "pages/index/index", + "pages/auth/auth", + "components/user-info/user-info", + "pages/meeting/meeting", + "pages/events/events", + "pages/my/my" + ], + "subpackages": [ + { + "root": "package-meeting", + "pages": [ + "sig/sig-list", + "reserve/reserve", + "sig/add-sig-member", + "sig/add-member", + "sig/del-member", + "meeting/detail", + "meeting/meeting-success", + "meeting/meeting-list" + ] + }, + { + "root": "package-events", + "pages": [ + "events/event-list", + "manage/enterprise-list", + "manage/add-member", + "manage/del-member", + "publish/publish", + "publish/success", + "events/event-detail", + "sign-up/sign-up", + "sign-up/sign-up-success", + "events/poster", + "events/sign", + "events/sign-success" + ] + }, + { + "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": "openEuler", + "navigationBarTextStyle": "black", + "backgroundColor": "#fff" + }, + "usingComponents": { + "van-swipe-cell": "@vant/weapp/swipe-cell/index", + "van-dialog": "@vant/weapp/dialog/index", + "van-checkbox": "@vant/weapp/checkbox/index", + "van-checkbox-group": "@vant/weapp/checkbox-group/index", + "van-popup": "@vant/weapp/popup/index", + "van-radio": "@vant/weapp/radio/index", + "van-radio-group": "@vant/weapp/radio-group/index", + "van-datetime-picker": "@vant/weapp/datetime-picker/index", + "van-picker": "@vant/weapp/picker/index", + "van-action-sheet": "@vant/weapp/action-sheet/index", + "wxml-to-canvas": "wxml-to-canvas" + }, + "sitemapLocation": "sitemap.json", + "tabBar": { + "custom": true, + "color": "#000000", + "selectedColor": "#002fa7", + "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/openeuler/app.wxss b/src/openeuler/app.wxss new file mode 100644 index 0000000000000000000000000000000000000000..eaf3dc42b785905e1a76db6c9d6e67f3b6190e71 --- /dev/null +++ b/src/openeuler/app.wxss @@ -0,0 +1,175 @@ +/**app.wxss**/ +page { + height: 100vh; + background-color: #fff; + font-family: PingFangSC-Regular, PingFangSC; + font-weight: 400; +} + +.container { + padding: 0 30rpx 129rpx 30rpx; +} + +.container-x { + padding-bottom: 195rpx; +} + +page, +view, +scroll-view, +swiper, +swiper-item, +movable-area, +movable-view, +cover-view, +cover-image, +icon, +text, +rich-text, +progress, +button, +checkbox-group, +checkbox, +form, +input, +label, +picker, +picker-view, +radio-group, +radio, +slider, +switch, +textarea, +navigator, +functional-page-navigator, +image, +video, +camera, +live-player, +live-pusher, +map, +canvas, +open-data, +web-view, +ad { + box-sizing: border-box; +} + +.dialog-index--sig-dialog { + border-radius: 8rpx; + width: 550rpx; +} + +.van-dialog__header { + padding-top: 30rpx; + color: #222; + font-size: 36rpx; + line-height: 50rpx; +} + +.dialog-slot-content { + color: #6d7278; + font-size: 32rpx; +} + +.dialog-slot-content text { + word-break: break-all; + display: inherit; + text-align: center; + overflow: hidden; + line-height: 45rpx; + margin-top: 19rpx; + padding: 0 30rpx; +} + +.dialog-slot-content .blue { + color: #002fa7; + margin-top: 0; +} + +.dialog-slot-content view { + margin-top: 52rpx; + border-top: 1px solid #f0f3f7; + height: 88rpx; + display: flex; + align-items: center; + justify-content: space-around; +} + +.dialog-slot-content view button { + font-size: 28rpx; + line-height: 88rpx; + text-align: center; + background-color: #fff; + color: #002fa7; +} + + +.sig-pop-wrapper { + padding: 0 30rpx; +} + +.sig-pop-wrapper .title { + margin: 30rpx 0 40rpx 0; + color: #222; + font-size: 36rpx; +} + +.sig-pop-wrapper .item .radio { + flex-direction: row-reverse; + justify-content: space-between; +} + +.sig-pop-wrapper .item .name { + font-size: 34rpx; + color: #6d7278; + width: 600rpx; +} + +.sig-pop-wrapper .item { + height: 108rpx; + display: flex; + align-items: center; + border-bottom: 1px solid #f0f3f7; +} + +.sig-pop-wrapper .item:last-child { + border: none; +} + +.sig-pop-wrapper .btn-wrapper { + display: flex; + align-items: center; + justify-content: space-between; + height: 90rpx; + font-size: 36rpx; + margin: 60rpx 0; +} + +.sig-pop-wrapper .btn-wrapper .confirm { + height: 100%; + width: 320rpx; + text-align: center; + line-height: 90rpx; + color: #fff; + background-color: #002fa7; +} + +.sig-pop-wrapper .btn-wrapper .cancel { + height: 100%; + width: 320rpx; + text-align: center; + line-height: 90rpx; + color: #002fa7; + background-color: #fff; + border: 1px solid #002fa7; +} + + +button::after { + content: unset; +} + +button { + background-color: unset; +} diff --git a/src/openeuler/components/meeting-list/meeting-list.js b/src/openeuler/components/meeting-list/meeting-list.js new file mode 100644 index 0000000000000000000000000000000000000000..dbd38cc5293a80e88e33e8078c19bd0f67da88dd --- /dev/null +++ b/src/openeuler/components/meeting-list/meeting-list.js @@ -0,0 +1,416 @@ +// components/meeting-list/meeting-list.js +const appAjax = require('./../../utils/app-ajax'); +const sessionUtil = require("../../utils/app-session.js"); +let that = null; +const remoteMethods = { + getSigList: function (_callback) { + appAjax.postJson({ + type: 'GET', + service: "SIG_LIST", + success: function (ret) { + _callback && _callback(ret); + } + }); + }, + getMeettingData: function (_callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'GET', + service: that.properties.apiUrl, + success: function (ret) { + _callback && _callback(ret); + if (that.properties.pageType === 2) { + that.setData({ + filterList: ret + }) + localMethod.filterData(); + } + } + }); + }, + delMeeting: function (id, _callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'DELETE', + service: "DEL_MEETING", + otherParams: { + id: id + }, + success: function (ret) { + _callback && _callback(ret); + } + }); + }, + collect: function (id, _callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'POST', + service: "COLLECT", + data: { + meeting: id + }, + success: function (ret) { + _callback && _callback(ret); + } + }); + }, + uncollect: function (id, _callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'DELETE', + service: "UNCOLLECT", + otherParams: { + id: id + }, + success: function (ret) { + _callback && _callback(ret); + } + }); + } +} +const localMethod = { + filterData: function () { + let listTemp = []; + if (that.data.curFilterSigId === '' && that.data.curKeyword === '') { + that.setData({ + list: that.data.filterList + }) + return; + } + if (that.data.curFilterSigId === '') { + that.data.filterList.forEach(function (item, index) { + if (item.topic.toLowerCase().includes(that.data.curKeyword.toLowerCase()) || item.group_name.toLowerCase().includes(that.data.curKeyword.toLowerCase())) { + listTemp.push(item); + } + }) + that.setData({ + list: listTemp + }) + return; + } + if (that.data.curKeyword === '') { + that.data.filterList.forEach(function (item, index) { + if (item.group_name.includes(that.data.filterSigName)) { + listTemp.push(item); + } + }) + that.setData({ + list: listTemp + }) + return; + } + that.data.filterList.forEach(function (item, index) { + if (item.group_name.includes(that.data.filterSigName) && item.topic.toLowerCase().includes(that.data.curKeyword.toLowerCase())) { + listTemp.push(item); + } + }) + that.setData({ + list: listTemp + }) + }, + checkLogin() { + if (!sessionUtil.getUserInfoByKey('access')) { + wx.navigateTo({ + url: '/pages/auth/auth' + }) + return; + } + return true; + } +} +Component({ + /** + * 组件的属性列表 + * apiUrl: 接口资源路径 + * pageType: 1、首页 2、会议列表页 3、我的会议页面 4、我的收藏会议页面 + */ + properties: { + apiUrl: { + type: String, + value: 'GET_MEETING_DAILY' + }, + pageType: { + type: Number, + value: 1 + }, + isHome: { + type: Boolean, + value: false + } + }, + + /** + * 组件的初始数据 + */ + data: { + list: [], + curMid: '', + curJoinUrl: '', + collectionId: '', + id: '', + showDialog: false, + showDialogDel: false, + actionShow: false, + actions: [], + popShow: false, + filterSigId: '', + filterSigName: '全部SIG', + columns: [], + curKeyword: '', + curFilterSigId: '', + curFilterSigName: '全部SIG', + filterList: [], + }, + attached() { + this.properties.pageType === 2 && remoteMethods.getSigList(function (data) { + if (data && data.length) { + data.unshift({ + group_name: '全部SIG', + id: '' + }) + that.setData({ + columns: data + }) + } + }) + }, + pageLifetimes: { + // 组件所在页面的生命周期函数 + show: function () { + that = this; + if((this.properties.pageType === 3) || (this.properties.pageType === 4)){ + this.initData(); + } + } + }, + /** + * 组件的方法列表 + */ + methods: { + collect: function (e) { + if (this.data.collectionId) { + remoteMethods.uncollect(this.data.collectionId, function (res) { + remoteMethods.getMeettingData(function (data) { + that.setData({ + list: data + }) + }) + }) + } else { + wx.requestSubscribeMessage({ + tmplIds: ['2xSske0tAcOVKNG9EpBjlb1I-cjPWSZrpwPDTgqAmWI', 'UpxRbZf8Z9QiEPlZeRCgp_MKvvqHlo6tcToY8fToK50'], + success(res) { + remoteMethods.collect(that.data.id, function (res) { + if (res.code == 201) { + remoteMethods.getMeettingData(function (data) { + that.setData({ + list: data + }) + }) + } + }) + } + }) + + } + }, + getAddr: function (e) { + this.setData({ + showDialog: true + }) + + }, + copyLink: function () { + wx.setClipboardData({ + data: this.data.curJoinUrl, + success: function (res) { + that.setData({ + showDialog: false + }) + } + }) + + }, + copyId: function () { + wx.setClipboardData({ + data: this.data.curMid, + success: function (res) { + that.setData({ + showDialog: false + }) + } + }) + }, + closeDialog: function () { + this.setData({ + showDialog: false + }) + }, + delMeeting: function () { + this.setData({ + showDialogDel: true + }) + }, + del: function () { + remoteMethods.delMeeting(this.data.curMid, function (data) { + if (data.code == 204) { + that.setData({ + showDialogDel: false + }) + remoteMethods.getMeettingData(function (data) { + that.setData({ + list: data + }) + }) + } + }) + }, + delCancel: function () { + this.setData({ + showDialogDel: false + }) + }, + toDetail: function (e) { + if(!localMethod.checkLogin()){ + return; + } + wx.navigateTo({ + url: '/package-meeting/meeting/detail?id=' + e.currentTarget.dataset.id + }) + }, + initData() { + remoteMethods.getMeettingData(function (data) { + that.setData({ + list: data + }) + }) + }, + getMore(e) { + if(!localMethod.checkLogin()){ + return; + } + this.setData({ + curMid: e.currentTarget.dataset.item.mid, + curJoinUrl: e.currentTarget.dataset.item.join_url, + collectionId: e.currentTarget.dataset.item.collection_id || '', + id: e.currentTarget.dataset.item.id + }) + const collectDesc = this.data.collectionId ? '取消收藏' : '收藏会议'; + const userId = e.currentTarget.dataset.item.user_id; + if (sessionUtil.getUserInfoByKey('level') === 1) { + this.setData({ + actions: [{ + name: collectDesc, + operaType: 1 + }, { + name: '获取地址', + operaType: 2 + }] + }) + } else if (sessionUtil.getUserInfoByKey('level') === 2) { + if (sessionUtil.getUserInfoByKey('userId') === userId) { + this.setData({ + actions: [{ + name: collectDesc, + operaType: 1 + }, { + name: '获取地址', + operaType: 2 + }, { + name: '删除会议', + operaType: 3 + }] + }) + } else { + this.setData({ + actions: [{ + name: collectDesc, + operaType: 1 + }, { + name: '获取地址', + operaType: 2 + }] + }) + } + } else { + this.setData({ + actions: [{ + name: collectDesc, + operaType: 1 + }, { + name: '获取地址', + operaType: 2 + }, { + name: '删除会议', + operaType: 3 + }] + }) + } + this.setData({ + actionShow: true + }) + this.triggerEvent("action-status", 1); + }, + onActionClose() { + this.setData({ + actionShow: false + }) + this.triggerEvent("action-status", 0); + }, + onActionSelect(e) { + if (e.detail.operaType === 1) { + this.collect(); + } else if (e.detail.operaType === 2) { + this.getAddr(); + } else { + this.delMeeting(); + } + }, + filterSig: function () { + this.setData({ + popShow: true + }) + }, + popCancel: function () { + this.setData({ + popShow: false + }) + this.setData({ + filterSigId: this.data.curFilterSigId, + filterSigName: this.data.curFilterSigName + }) + }, + pickerChange: function (e) { + this.setData({ + filterSigId: e.detail.value.id, + filterSigName: e.detail.value.group_name + }) + }, + popConfirm: function () { + this.setData({ + popShow: false, + curFilterSigId: this.data.filterSigId, + curFilterSigName: this.data.filterSigName + }) + localMethod.filterData(); + }, + popCancel: function () { + this.setData({ + popShow: false, + filterSigId: this.data.curFilterSigId, + filterSigName: this.data.curFilterSigName + }) + }, + search: function (e) { + this.setData({ + curKeyword: e.detail.value + }) + localMethod.filterData(); + } + }, + ready() { + if ((this.properties.pageType === 1) || (this.properties.pageType === 2)) { + this.initData(); + } + } +}) \ No newline at end of file diff --git a/src/openeuler/components/meeting-list/meeting-list.json b/src/openeuler/components/meeting-list/meeting-list.json new file mode 100644 index 0000000000000000000000000000000000000000..2e31abd5be997e69b8dc05d2ffbbd56b358eaf0b --- /dev/null +++ b/src/openeuler/components/meeting-list/meeting-list.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/src/openeuler/components/meeting-list/meeting-list.wxml b/src/openeuler/components/meeting-list/meeting-list.wxml new file mode 100644 index 0000000000000000000000000000000000000000..d61006749e57d40bfde3e87c05c927085184cf0a --- /dev/null +++ b/src/openeuler/components/meeting-list/meeting-list.wxml @@ -0,0 +1,81 @@ + +{{isHome?'最近':'今天'}}的会议({{list.length}}) + + + + + + {{curFilterSigName}} + + + + + + + + {{item.group_name}} + + + + {{item.topic}} + + + {{item.date}} {{item.start}}-{{item.end}} (可回放) + {{item.date}} {{item.start}}-{{item.end}} + + + + {{item.agenda||'暂无描述'}} + + + + + + + + + + 暂无收藏! + 当前暂未收藏任何会议哦 + + + + 暂无会议! + 当前暂未创建任何会议哦 + + + + 暂无会议! + 当前暂无任何会议哦 + + + + + {{curMid}} + {{curJoinUrl}} + + + + + + + + + + 请确认删除当前会议 + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/openeuler/components/meeting-list/meeting-list.wxss b/src/openeuler/components/meeting-list/meeting-list.wxss new file mode 100644 index 0000000000000000000000000000000000000000..519aad16459ec09f5db22e1986a7a42ac611a035 --- /dev/null +++ b/src/openeuler/components/meeting-list/meeting-list.wxss @@ -0,0 +1,175 @@ +/* components/meeting-list/meeting-list.wxss */ +@import "../../app.wxss"; + +.today-meeting { + margin-bottom: 30rpx; + font-size: 36rpx; + font-weight: 400; + color: #333; + line-height: 50rpx; +} + +.list { + color: #6d7278; + font-size: 28rpx; + font-weight: 400; +} + +.list .item { + position: relative; + margin-bottom: 30rpx; + background-color: #fff; + box-shadow: 0rpx 5rpx 15rpx 0rpx rgba(0, 47, 167, 0.1); + border-radius: 8rpx; + font-size: 24rpx; +} + +.list .item .collection { + width: 40rpx; + height: 26rpx; + position: absolute; + top: 33rpx; + left: 0; +} + +.list .item .name { + font-size: 30rpx; + color: #333; + font-weight: 400; + line-height: 48rpx; + margin-top: 0; +} + +.list .item .header { + height: 90rpx; + border-bottom: 2rpx solid #f0f3f7; + display: flex; + justify-content: space-between; + align-items: center; + padding: 0 30rpx; + color: #333; + font-size: 28rpx; +} + +.list .item .isCollection { + padding-left: 60rpx; +} + +.list .item .header image { + height: 36rpx; + width: 8rpx; +} + +.list .item .wrapper { + line-height: 40rpx; + padding: 20rpx 30rpx 30rpx; +} + +.list .item .wrapper image { + vertical-align: middle; + width: 28rpx; + height: 28rpx; + margin-right: 22rpx; +} + +.list .item .wrapper text { + vertical-align: middle; +} + +.list .item .wrapper .date { + margin: 20rpx 0; +} + +.list .item .desc { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + display: flex; + align-items: baseline; +} + +.input-wraper { + box-sizing: border-box; + margin: 20rpx 0 30rpx; + height: 108rpx; + position: relative; + box-shadow: 0px 5px 15px 0px rgba(225, 230, 238, 1); + border-radius: 8rpx; + overflow: hidden; + background-color: #fff; +} + +.input-wraper .keyword { + padding-left: 94rpx; + border-left: 1px solid #f0f3f7; + height: 108rpx; + position: absolute; + top: 0; + right: 0; + width: 70%; + font-size: 28rpx; + line-height: 40rpx; +} + +.input-wraper .keyword .search-icon { + height: 39rpx; + width: 39rpx; + display: inline-block; + position: absolute; + top: 34rpx; + left: 32rpx; +} + +.input-wraper .filter-wraper { + position: absolute; + height: 108rpx; + left: 0; + top: 0; + width: 30%; + display: flex; + align-items: center; + justify-content: center; +} + +.input-wraper .filter-wraper text { + width: 110rpx; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + font-size: 28rpx; + color: #6d7278; +} + +.input-wraper .filter-wraper image { + margin-left: 17rpx; + width: 30rpx; + height: 30rpx; +} + +.empty-status .suc-wrapper { + position: absolute; + top: 50%; + transform: translate(-50%, -50%); + left: 50%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +.empty-status .suc-wrapper image { + width: 234rpx; + height: 218rpx; +} + +.empty-status .suc-wrapper text { + text-align: center; + margin-top: 20rpx; + font-size: 34rpx; + color: #333; +} + +.empty-status .suc-wrapper text:last-child { + font-size: 28rpx; + color: #6d7278; +} \ No newline at end of file diff --git a/src/openeuler/components/user-info/user-info.js b/src/openeuler/components/user-info/user-info.js new file mode 100644 index 0000000000000000000000000000000000000000..f9b51c3b7050d5bf0a7ba8486eb9cb1460451c81 --- /dev/null +++ b/src/openeuler/components/user-info/user-info.js @@ -0,0 +1,72 @@ +// components/user-info/user-info.js +const sessionUtil = require("../../utils/app-session.js"); +const localMethods = { + getCurText() { + var timestamp = Date.parse(new Date()); + timestamp = timestamp / 1000; + var n = timestamp * 1000; + var date = new Date(n); + var h = date.getHours(); + var m = date.getMinutes(); + var hm = parseFloat(h + '.' + m); + if (23 < hm || hm <= 6) { + return '请睡吧'; + } + if (6 < hm && hm <= 12) { + return '上午好'; + } + if (12 < hm && hm <= 14) { + return '中午好'; + } + if (14 < hm && hm <= 18) { + return '下午好'; + } + if (18 < hm && hm <= 23) { + return '晚上好'; + } + } +} +Component({ + /** + * 组件的属性列表 + */ + properties: { + + }, + + /** + * 组件的初始数据 + */ + data: { + isLogin: false, + avatarUrl: '', + text: '', + nickName: '' + }, + pageLifetimes: { + // 组件所在页面的生命周期函数 + + show: function () { + this.setData({ + isLogin: sessionUtil.getUserInfoByKey('access') + }) + if (this.data.isLogin) { + this.setData({ + avatarUrl: sessionUtil.getUserInfoByKey('avatarUrl'), + text: localMethods.getCurText(), + nickName: sessionUtil.getUserInfoByKey('nickName') + }) + } + } + }, + /** + * 组件的方法列表 + */ + methods: { + login() { + wx.navigateTo({ + url: '/pages/auth/auth' + }) + } + } +}) \ No newline at end of file diff --git a/src/openeuler/components/user-info/user-info.json b/src/openeuler/components/user-info/user-info.json new file mode 100644 index 0000000000000000000000000000000000000000..2e31abd5be997e69b8dc05d2ffbbd56b358eaf0b --- /dev/null +++ b/src/openeuler/components/user-info/user-info.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/src/openeuler/components/user-info/user-info.wxml b/src/openeuler/components/user-info/user-info.wxml new file mode 100644 index 0000000000000000000000000000000000000000..39492cbcefbe370831bddcba3230f4514b156ea8 --- /dev/null +++ b/src/openeuler/components/user-info/user-info.wxml @@ -0,0 +1,9 @@ + + + + 登录 + + + + {{text}},{{nickName}} + \ No newline at end of file diff --git a/src/openeuler/components/user-info/user-info.wxss b/src/openeuler/components/user-info/user-info.wxss new file mode 100644 index 0000000000000000000000000000000000000000..39de9299e0c1df023493ad464bc6c3c4ebe99617 --- /dev/null +++ b/src/openeuler/components/user-info/user-info.wxss @@ -0,0 +1,22 @@ +/* components/user-info/user-info.wxss */ +.userinfo { + padding-top: 30rpx; + margin-bottom: 30rpx; + line-height: 84rpx; +} + +.userinfo .image { + vertical-align: middle; + height: 84rpx; + width: 84rpx; + border-radius: 100%; + margin-right: 30rpx; +} + +.userinfo .text { + vertical-align: middle; + font-size: 36rpx; + line-height: 50rpx; + font-weight: 400; + color: #333; +} \ No newline at end of file diff --git a/src/openeuler/config/constants.js b/src/openeuler/config/constants.js new file mode 100644 index 0000000000000000000000000000000000000000..337d2572f3bea9a0c2556ec391162ce2af26ed16 --- /dev/null +++ b/src/openeuler/config/constants.js @@ -0,0 +1,23 @@ +/** + * 常量配置 + */ +var _ = require('../utils/underscore-extend.js'); + +// 服务连接配置 +var serviceConfig = { + SERVICE_URL: "https://api.openeuler.org/meetings", // 正式环境 + // SERVICE_URL: "http://119.8.32.82", // 测试环境 +}; + +// 存储配置 +var storageConfig = { + APP_USERINFO_SESSION: "_app_userinfo_session" +}; + +// 所有配置 +var constants = _.deepExtend(true, + serviceConfig, + storageConfig +); + +module.exports = constants; \ No newline at end of file diff --git a/src/openeuler/config/field-validate-rules.js b/src/openeuler/config/field-validate-rules.js new file mode 100644 index 0000000000000000000000000000000000000000..281719b60070d858344a7e1a9be3f468832730c1 --- /dev/null +++ b/src/openeuler/config/field-validate-rules.js @@ -0,0 +1,267 @@ +const rules = { + + // 6位数字验证码 + "numberCode6" : { + "regex": /^\d{6,6}$/, + "errorMsg": "请输入6位数字验证码" + }, + + // 8位数字验证码 + "numberCode8" : { + "regex": /^\d{8,8}$/, + "errorMsg": "请输入8位数字验证码" + }, + + // 手机号码校验 + "phone": { + "regex": /(^1[3456789]\d{9}$)|^$/, + "errorMsg": "请输入正确的手机号码" + }, + + // 电子邮箱校验 + "email": { + "regex": /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i, + "errorMsg": " 无效的邮件地址" + }, + + // 电子邮箱和手机号码校验 + "emailOrPhone": { + "regex": /(^1[34578]\d{9}$)|(^[0-9a-z_][_.0-9a-z-]{0,31}@([0-9a-z][0-9a-z-]{0,30}\.){1,4}[a-z]{2,4}$)/, + "errorMsg": " 无效的手机号/邮箱" + }, + + // 金额类型 + "money": { + "regex": /^(\d+)(\.\d+)?$/, + "errorMsg": "请输入正确的金额" + }, + + // 最多输入两位小数 + "validateTwoDecimal": { + "regex": /^(\d+)(\.\d+)?$/, + "errorMsg": "最多输入两位小数" + }, + + // 正整数类型 + "checkUnsignInt": { + "regex": /^[1-9]{1}\d*$/, + "errorMsg": "请输入正整数" + }, + + // 整数类型 + "integer": { + "regex": /^[\-\+]?\d+$/, + "errorMsg": " 无效的整数" + }, + + // 数字类型 + "number": { + "regex": /^[\-\+]?((([0-9]{1,3})([,][0-9]{3})*)|([0-9]+))?([\.]([0-9]+))?$/, + "errorMsg": " 无效的数值" + }, + + // 浮点数类型 + "float": { + "regex": /^(-?\d+)(\.\d+)?$/, + "errorMsg": "请输入正确的浮点数" + }, + + // 日期YYYY-MM-DD + "date": { + "regex": /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/, + "errorMsg": " 无效的日期,格式必需为 YYYY-MM-DD" + }, + + // 校验日期格式 + "dateFormat": { + "regex": /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$|^(?:(?:(?:0?[13578]|1[02])(\/|-)31)|(?:(?:0?[1,3-9]|1[0-2])(\/|-)(?:29|30)))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(?:(?:0?[1-9]|1[0-2])(\/|-)(?:0?[1-9]|1\d|2[0-8]))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(0?2(\/|-)29)(\/|-)(?:(?:0[48]00|[13579][26]00|[2468][048]00)|(?:\d\d)?(?:0[48]|[2468][048]|[13579][26]))$/, + "errorMsg": " 无效的日期格式" + }, + + // 日期时间校验 + "dateTimeFormat": { + "regex": /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])\s+(1[012]|0?[1-9]){1}:(0?[1-5]|[0-6][0-9]){1}:(0?[0-6]|[0-6][0-9]){1}\s+(am|pm|AM|PM){1}$|^(?:(?:(?:0?[13578]|1[02])(\/|-)31)|(?:(?:0?[1,3-9]|1[0-2])(\/|-)(?:29|30)))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^((1[012]|0?[1-9]){1}\/(0?[1-9]|[12][0-9]|3[01]){1}\/\d{2,4}\s+(1[012]|0?[1-9]){1}:(0?[1-5]|[0-6][0-9]){1}:(0?[0-6]|[0-6][0-9]){1}\s+(am|pm|AM|PM){1})$/, + "errorMsg": " 无效的日期或时间格式" + }, + + // ipv4地址校验 + "ipv4": { + "regex": /^((([01]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))[.]){3}(([0-1]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))$/, + "errorMsg": " 无效的 IP 地址" + }, + + // 网址校验 + "url": { + "regex": /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i, + "errorMsg": " 无效的网址" + }, + + // 校验英文字母 + "onlyLetter": { + "regex": /^[a-zA-Z\ \']+$/, + "errorMsg": " 只能填写英文字母" + }, + + // 英文和数字校验 + "onlyLetterNumber": { + "regex": /^[0-9a-zA-Z]+$/, + "errorMsg": " 只能填写数字与英文字母" + }, + + // 汉字校验 + "chinese": { + "regex": /^[\u4E00-\u9FA5]+$/, + "errorMsg": " 只能填写中文汉字" + }, + + // 身份证校验 + "chinaId": { + "regex": /^[1-9]\d{5}[1-9]\d{3}(((0[13578]|1[02])(0[1-9]|[12]\d|3[0-1]))|((0[469]|11)(0[1-9]|[12]\d|30))|(02(0[1-9]|[12]\d)))(\d{4}|\d{3}[xX])$/, + "errorMsg": " 无效的身份证号码" + }, + + // 邮政编码校验 + "chinaZip": { + "regex": /^\d{6}$/, + "errorMsg": " 无效的邮政编码" + }, + + // QQ号码校验 + "qq": { + "regex": /(^[0-9]{5,15}$)|^$/, + "errorMsg": " 无效的 QQ 号码" + }, + // 密码验证 + "checkPassword618": { + "regex": /^([\w~`!@#$%^&*()_+-=\[\]\{\}\|\\:;'"<>,\.\?\/]{6,18}|[\w~`!@#$%^&*()_+-=\[\]\{\}\|\\:;'"<>,\.\?\/]{32}|^)$/, + "errorMsg": " 请输入6-18位密码" + }, + + // 密码验证-字母和数字组合 + "checkPasswordLetterNumber": { + "regex": /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,18}$/, + "errorMsg": "密码应为6-18位字母和数字组合" + }, + + // 姓名格式验证 + "checkRealName": { + "regex": /^[A-Za-z\u4e00-\u9fa5]{0,15}$/, + "errorMsg": "最多可输入15字,包含中文、字母" + }, + + // 验证昵称 + "checkName": { + "regex": /^[0-9A-Za-z\u4e00-\u9fa5]{0,15}$/, + "errorMsg": " 最多可输入15字,包含中文,字母,数字" + }, + // 验证邮编 + "checkCode": { + "regex": /^[0-9]{6}$/, + "errorMsg": " 请输入合法的邮政编码" + }, + + // 验证公司名称、工作描述 + "checkSomeName": { + "regex": /^[0-9A-Za-z\u4e00-\u9fa5]{0,30}$/, + "errorMsg": " 最多可输入30字,包含中文、字母、数字" + }, + + // 验证政府事业单位中(组织机构代码)包含数字或字母,且长度为15-30位 + "checkOrganizationCode": { + "regex": /^[0-9A-Za-z]{15,30}$/, + "errorMsg": " 请输入正确的组织机构代码" + }, + + // 企业认证-验证企业名称 + "chenckCompanyName": { + "regex": /^[0-9A-Za-z\u4e00-\u9fa5\()\()]{0,50}$/, + "errorMsg": "最多可输入50字,包含中文、字母、数字" + }, + + // 企业认证-验证证件号 + "checkCertificateLicense": { + "regex": /^[0-9A-Za-z()-]{9,30}$/, + "errorMsg": "请输入正确的证件号" + }, + + // 验证法定代表人 + "validateLegalPerson": { + "regex": /^[A-Za-z\u4e00-\u9fa5]{0,15}$/, + "errorMsg": "请输入正确的法定代表人" + }, + + // 验证微信号 + "validateWeixin": { + "regex": /^(([A-Za-z]+[0-9A-Za-z_-]*))*$/, + "errorMsg": "请输入正确的微信号" + }, + + // 验证微博地址 + "validateWeibo": { + "regex": /^(http[s]{0,1}:\/\/.+)*$/, + "errorMsg": "请输入正确的微博地址" + }, + + // 银行卡号验证 + "validateBankCard": { + "regex": /^[0-9]{10,19}$/, + "errorMsg": "请输入正确的银行卡号验证" + }, + + // 用户输入内容 + "checkIntro": { + "regex": /^[0-9A-Za-z\u4e00-\u9fa5]{0,500}$/, + "errorMsg": "只能包含汉字、字母、数字,且最多为500字" + }, + + // 校验手机号码 + "phonenumber": { + "regex": /^[\-\+]?((([0-9]{1,3})([,][0-9]{3})*)|([0-9]+))?([\.]([0-9]+))?$/, + "errorMsg": " 无效的电话号码" + }, + + // 校验护照 + "validatePassport" : { + "regex" : /^1[45][0-9]{7}|([P|p|S|s]\\d{7})|([S|s|G|g]\\d{8})|([Gg|Tt|Ss|Ll|Qq|Dd|Aa|Ff]\\d{8})|([H|h|M|m]\\d{8,10})$/, + "errorMsg" : "请输入正确的护照" + }, + + // 校验香港身份证 + "validateIdentityHK": { + "regex": /^[A-Z]\d{6}\(\d|[A-Z]\)$/, + "errorMsg": "请输入正确的香港身份证" + }, + + // 澳门身份证验证 + "validateIdentityMC": { + "regex": /^\d{7}\(\d\)$/, + "errorMsg": "请输入正确的澳门身份证" + }, + + // 台湾身份证验证 + "validateIdentityTW": { + "regex": /^[A-Z]\d{9}$/, + "errorMsg": "请输入正确的台湾身份证" + }, + + // 关键词校验 + "keywordcheck": { + "regex": /^[A-Za-z0-9\u4e00-\u9fa5]+(,[A-Za-z0-9\u4e00-\u9fa5]{1,15})*$/, + "errorMsg":'必须以","(英文逗号)分隔符,最后一个关键词不需要逗号' + }, + + // 关键词最多输入10个 + "validateKeywordMax10": { + "regex": /^([A-Za-z0-9\u4e00-\u9fa5]+(\;|\;){0,1}){1,10}$/, + "errorMsg": "请输入正确的关键词格式:最多可输入10个,以;隔开" + }, + + // 敏感词最多输入十个 + "sensitiveWordsMax10": { + "regex": /^[A-Za-z0-9\u4e00-\u9fa5]{1,10}$/, + "errorMsg": "请输入需要新增的敏感词" + } + +}; + +module.exports = rules; diff --git a/src/openeuler/config/services-config.js b/src/openeuler/config/services-config.js new file mode 100644 index 0000000000000000000000000000000000000000..40884df48771e5cb5df4f3450d39990ebb3f9f6c --- /dev/null +++ b/src/openeuler/config/services-config.js @@ -0,0 +1,176 @@ +var _ = require('../utils/underscore-extend.js'); + +// 通用接口配置 +var commonServiceConfig = { + + // 登录接口 + LOGIN : "/login/", + + // 登录接口 + SIG_LIST : "/groups/", + + // 获取sig组已添加成员列表 + SIG_MEMBER_LIST: "/users_include/{id}/", + + // 获取sig组未添加成员列表 + SIG_EXCLUDE_MEMBER_LIST: "/users_exclude/{id}/", + + // 获取sig组未添加成员列表 + ADD_MEMBER_LIST: "/groupuser/action/new/", + + // 获取sig组已添加成员列表 + SIG_CLUDE_MEMBER_LIST: "/users_include/{id}/", + + // 获取sig组未添加成员列表 + DEL_MEMBER_LIST: "/groupuser/action/del/", + + // 获取sig组未添加成员列表 + GET_USER_GROUP: "/usergroup/{id}/", + + // 创建会议 + SAVE_MEETING: "/meetings/", + + // 获取会议详情 + GET_MEETING_DETAIL: "/meetings/{id}/", + + // 获取当日会议列表 + GET_MEETING_DAILY: "/meetings_daily/", + + // 获取前后一周会议列表 + GET_MEETING_WEEKLY: "/meetings_weekly/", + + // 删除会议 + DEL_MEETING: "/meeting/{id}/", + + // 获取用户状态 + GET_USER_STATUS: "/userinfo/{id}/", + + // 保存用户giteename + SAVE_MEMBER_DETAIL: '/user/{id}/', + + // 我创建的会议列表 + MY_MEETINGS_LIST: '/mymeetings/', + + // 收藏会议 + COLLECT: '/collect/', + + // 取消收藏 + UNCOLLECT: '/collect/{id}/', + + // 收藏列表 + MY_COLLECT_LIST: '/collections/', + + // 获取发起人列表 + ENTERPRISE_MEMBER_LIST: '/sponsors/', + + // 获取未添加发起人名单 + ENTERPRISE_EXCLUDE_MEMBER_LIST: '/nonsponsors/', + + // 添加发起人 + ENTERPRISE_ADD_MEMBER_LIST: '/sponsor/action/new/', + + // 编辑发起人信息 + ENTERPRISE_SAVE_MEMBER_DETAIL: '/sponsorinfo/{id}/', + + // 删除发起人 + ENTERPRISE_DEL_MEMBER_LIST: '/sponsor/action/del/', + + // 发布 + PUBLISH_EVENT: '/activity/', + + // 保存草稿 + SAVE_DRAFT: '/activitydraft/', + + // 获取草稿箱活动列表 + GET_DRAFT_LIST: '/activitiesdraft/', + + // 获取全量待发布 + DRAFTS: '/drafts/', + + //草稿详情 + DRAFT_DETAIL: '/sponsoractivitydraft/{id}/', + + // 修改草稿 + EDIT_DETAIL: '/draftupdate/{id}/', + + // 修改草稿并发布 + + EDIT_DETAIL_PUBLISH: '/draftpublish/{id}/', + + // 驳回活动发布 + REJECT_PUBLISH: '/activityreject/{id}/', + + // 活动审核通过 + RESOLVE_PUBLISH: '/activitypublish/{id}/', + + // 活动审核通过 + PUBLISHER_EVENTS_LIST: '/sponsoractivitiespublishing/', + + // 我发布的活动 + MY_EVENTS_LIST: '/sponsoractivities/', + + // 我发布的活动 + DEL_EVENT: '/activitydel/{id}/', + + // 所有活动 + ALL_EVENTS_LIST: '/activities/', + + // 所有活动 + EVENT_DETAIL: '/activity/{id}/', + + // 修改日程 + EDIT_SCHEDULE: '/activityupdate/{id}/', + + // 修改日程 + EXAMINE_DETAIL: '/draft/{id}/', + + // 修改日程 + EVENT_COLLECT: '/collectactivity/', + + // 修改日程 + EVENT_UNCOLLECT: '/collectactivitydel/{id}/', + + // 活动收藏列表 + EVENT_COLLECT_LIST: '/collectactivities/', + + // 最新活动列表 + LATEST_EVENTS: '/recentactivities/', + + // 获取报名者信息 + APPLICANT_INFO: '/applicantinfo/{id}/', + + // 报名 + SAVE_SIGNUP_INFO: '/activityregister/', + + // 我报名的活动 + MY_SIGNUP_EVENTS: '/registeractivities/', + + // 报名表单 + SEND_SIGNUP_INFO: '/applicantsinfo/', + + // 保存意见反馈 + SAVE_FEEDBACK: '/feedback/', + + // 获取已发布分类数量 + GET_EVENTS_COUNT: '/countactivities/', + + // 获取我的页面各类计数 + GET_MY_COUNT: '/mycounts/', + + // 获取我的活动报名信息 + GET_SIGNUP_INFO: '/ticket/{id}/', + + // 最近的会议列表 + RECENTLY_MEETINGS: '/meetings_recently/', + + // 签到 + SIGN: '/activitysign/' +}; + + + +let servicesConfig = _.deepExtend(true, + commonServiceConfig +); + +module.exports = servicesConfig; \ No newline at end of file diff --git a/src/openeuler/custom-tab-bar/index.js b/src/openeuler/custom-tab-bar/index.js new file mode 100644 index 0000000000000000000000000000000000000000..199f86f0358f8ca5d106b874ee44ce2f9d435f3d --- /dev/null +++ b/src/openeuler/custom-tab-bar/index.js @@ -0,0 +1,57 @@ +// custom-tab-bar/index.js +const sessionUtil = require("./../utils/app-session.js"); +Component({ + /** + * 组件的属性列表 + */ + properties: { + + }, + + /** + * 组件的初始数据 + */ + data: { + show: true, + _tabbat: 0, + iPhoneX: null, + urls: [ + '/pages/index/index', + '/pages/meeting/meeting', + '/pages/events/events', + '/pages/my/my' + ] + }, + attached() { + var self = this + wx.getSystemInfo({ + success(res) { + if ((res.model.indexOf('iPhone X') >= 0) || (res.model.indexOf('iPhone 11') >= 0)) { + self.setData({ + iPhoneX: true + }); + } + } + }) + }, + /** + * 组件的方法列表 + */ + methods: { + switchTap: function (e) { + if(!sessionUtil.getUserInfoByKey('access')){ + wx.navigateTo({ + url: '/pages/auth/auth' + }) + return; + } + var self = this + var index = e.currentTarget.dataset.index; + var urls = self.data.urls + wx.switchTab({ + url: urls[index], + }) + + } + } +}) \ No newline at end of file diff --git a/src/mindspore/package-events/sign-up/save-success.json b/src/openeuler/custom-tab-bar/index.json similarity index 39% rename from src/mindspore/package-events/sign-up/save-success.json rename to src/openeuler/custom-tab-bar/index.json index 65a24d12eba22ca0cf7bd47bd6c2eddb69d71765..fa590336b4927e544ac83a1d2803e685f240451e 100644 --- a/src/mindspore/package-events/sign-up/save-success.json +++ b/src/openeuler/custom-tab-bar/index.json @@ -1,4 +1,4 @@ -{ - "usingComponents": {}, - "navigationBarTitleText": "保存成功" +{ + "usingComponents": {}, + "component": true } \ No newline at end of file diff --git a/src/openeuler/custom-tab-bar/index.wxml b/src/openeuler/custom-tab-bar/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..4419a3633839c42c4f8e1d4edebcddadc327841f --- /dev/null +++ b/src/openeuler/custom-tab-bar/index.wxml @@ -0,0 +1,19 @@ + + + + + 首页 + + + + 会议 + + + + 活动 + + + + 我的 + + \ No newline at end of file diff --git a/src/openeuler/custom-tab-bar/index.wxss b/src/openeuler/custom-tab-bar/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..f9d2d4cda274b2b478dcd3f3b854d12c0a1bb9fb --- /dev/null +++ b/src/openeuler/custom-tab-bar/index.wxss @@ -0,0 +1,36 @@ +/* custom-tab-bar/index.wxss */ +._tabbar { + width: 100%; + height: 99rpx; + display: flex; + align-items: center; + background: #fff; + font-size: 20rpx; + color: #c7cad0; + box-shadow: 0px -3px 10px 0px rgba(185, 192, 203, 0.47); +} + +._tabbar .titem { + text-align: center; + width: 25%; +} + +._tabbar .titem .img { + display: block; + margin: auto; + width: 54rpx; + height: 54rpx; + margin-bottom: 6rpx; +} + +._tabbar .tCdk { + color: #002fa7; +} + +._iPhoneX { + height: 165rpx; +} + +._iPhoneX .titem { + margin-bottom: 66rpx; +} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.js new file mode 100644 index 0000000000000000000000000000000000000000..946264e82c6ed93f2dae4c3d1a5f6edef6e25632 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.js @@ -0,0 +1,64 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var component_1 = require('../common/component'); +var button_1 = require('../mixins/button'); +var open_type_1 = require('../mixins/open-type'); +component_1.VantComponent({ + mixins: [button_1.button, open_type_1.openType], + props: { + show: Boolean, + title: String, + cancelText: String, + description: String, + round: { + type: Boolean, + value: true, + }, + zIndex: { + type: Number, + value: 100, + }, + actions: { + type: Array, + value: [], + }, + overlay: { + type: Boolean, + value: true, + }, + closeOnClickOverlay: { + type: Boolean, + value: true, + }, + closeOnClickAction: { + type: Boolean, + value: true, + }, + safeAreaInsetBottom: { + type: Boolean, + value: true, + }, + }, + methods: { + onSelect: function (event) { + var index = event.currentTarget.dataset.index; + var item = this.data.actions[index]; + if (item && !item.disabled && !item.loading) { + this.$emit('select', item); + if (this.data.closeOnClickAction) { + this.onClose(); + } + } + }, + onCancel: function () { + this.$emit('cancel'); + }, + onClose: function () { + this.$emit('close'); + }, + onClickOverlay: function () { + this.$emit('click-overlay'); + this.onClose(); + }, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.json new file mode 100644 index 0000000000000000000000000000000000000000..b3548bd8665eaffd79661be32c0c0c3e1ab6e2ce --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.json @@ -0,0 +1,8 @@ +{ + "component": true, + "usingComponents": { + "van-icon": "../icon/index", + "van-popup": "../popup/index", + "van-loading": "../loading/index" + } +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..ba802e8cf5ef560c832aade4f76702745af7cf3f --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.wxml @@ -0,0 +1,69 @@ + + + + + {{ title }} + + + + {{ description }} + + + + + + + + + + {{ cancelText }} + + + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..9b247d5d81acaf35e41a90a4c959f6e48738de1f --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/action-sheet/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-action-sheet{max-height:90%!important;max-height:var(--action-sheet-max-height,90%)!important;color:#323233;color:var(--action-sheet-item-text-color,#323233)}.van-action-sheet__cancel,.van-action-sheet__item{padding:14px 16px;text-align:center;font-size:16px;font-size:var(--action-sheet-item-font-size,16px);line-height:22px;line-height:var(--action-sheet-item-line-height,22px);background-color:#fff;background-color:var(--action-sheet-item-background,#fff)}.van-action-sheet__cancel--hover,.van-action-sheet__item--hover{background-color:#f2f3f5;background-color:var(--active-color,#f2f3f5)}.van-action-sheet__cancel:after,.van-action-sheet__item:after{border-width:0}.van-action-sheet__cancel{color:#646566;color:var(--action-sheet-cancel-text-color,#646566)}.van-action-sheet__gap{display:block;height:8px;height:var(--action-sheet-cancel-padding-top,8px);background-color:#f7f8fa;background-color:var(--action-sheet-cancel-padding-color,#f7f8fa)}.van-action-sheet__item--disabled{color:#c8c9cc;color:var(--action-sheet-item-disabled-text-color,#c8c9cc)}.van-action-sheet__item--disabled.van-action-sheet__item--hover{background-color:#fff;background-color:var(--action-sheet-item-background,#fff)}.van-action-sheet__subname{margin-top:8px;margin-top:var(--padding-xs,8px);font-size:12px;font-size:var(--action-sheet-subname-font-size,12px);color:#969799;color:var(--action-sheet-subname-color,#969799);line-height:20px;line-height:var(--action-sheet-subname-line-height,20px)}.van-action-sheet__header{text-align:center;font-weight:500;font-weight:var(--font-weight-bold,500);font-size:16px;font-size:var(--action-sheet-header-font-size,16px);line-height:48px;line-height:var(--action-sheet-header-height,48px)}.van-action-sheet__description{text-align:center;padding:20px 16px;padding:20px var(--padding-md,16px);color:#969799;color:var(--action-sheet-description-color,#969799);font-size:14px;font-size:var(--action-sheet-description-font-size,14px);line-height:20px;line-height:var(--action-sheet-description-line-height,20px)}.van-action-sheet__close{position:absolute!important;top:0;right:0;line-height:inherit!important;padding:0 16px;padding:var(--action-sheet-close-icon-padding,0 16px);font-size:22px!important;font-size:var(--action-sheet-close-icon-size,22px)!important;color:#c8c9cc;color:var(--action-sheet-close-icon-color,#c8c9cc)}.van-action-sheet__loading{display:-webkit-flex!important;display:flex!important} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/area/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/area/index.js new file mode 100644 index 0000000000000000000000000000000000000000..a194ddeebd15a2113c8a3c3e8240dad6a43b41c6 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/area/index.js @@ -0,0 +1,263 @@ +'use strict'; +var __assign = + (this && this.__assign) || + function () { + __assign = + Object.assign || + function (t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); + }; +Object.defineProperty(exports, '__esModule', { value: true }); +var component_1 = require('../common/component'); +var shared_1 = require('../picker/shared'); +var utils_1 = require('../common/utils'); +var EMPTY_CODE = '000000'; +component_1.VantComponent({ + classes: ['active-class', 'toolbar-class', 'column-class'], + props: __assign(__assign({}, shared_1.pickerProps), { + value: { + type: String, + observer: function (value) { + this.code = value; + this.setValues(); + }, + }, + areaList: { + type: Object, + value: {}, + observer: 'setValues', + }, + columnsNum: { + type: null, + value: 3, + }, + columnsPlaceholder: { + type: Array, + observer: function (val) { + this.setData({ + typeToColumnsPlaceholder: { + province: val[0] || '', + city: val[1] || '', + county: val[2] || '', + }, + }); + }, + }, + }), + data: { + columns: [{ values: [] }, { values: [] }, { values: [] }], + typeToColumnsPlaceholder: {}, + }, + mounted: function () { + var _this = this; + utils_1.requestAnimationFrame(function () { + _this.setValues(); + }); + }, + methods: { + getPicker: function () { + if (this.picker == null) { + this.picker = this.selectComponent('.van-area__picker'); + } + return this.picker; + }, + onCancel: function (event) { + this.emit('cancel', event.detail); + }, + onConfirm: function (event) { + var index = event.detail.index; + var value = event.detail.value; + value = this.parseValues(value); + this.emit('confirm', { value: value, index: index }); + }, + emit: function (type, detail) { + detail.values = detail.value; + delete detail.value; + this.$emit(type, detail); + }, + parseValues: function (values) { + var columnsPlaceholder = this.data.columnsPlaceholder; + return values.map(function (value, index) { + if ( + value && + (!value.code || value.name === columnsPlaceholder[index]) + ) { + return __assign(__assign({}, value), { code: '', name: '' }); + } + return value; + }); + }, + onChange: function (event) { + var _this = this; + var _a = event.detail, + index = _a.index, + picker = _a.picker, + value = _a.value; + this.code = value[index].code; + this.setValues().then(function () { + _this.$emit('change', { + picker: picker, + values: _this.parseValues(picker.getValues()), + index: index, + }); + }); + }, + getConfig: function (type) { + var areaList = this.data.areaList; + return (areaList && areaList[type + '_list']) || {}; + }, + getList: function (type, code) { + if (type !== 'province' && !code) { + return []; + } + var typeToColumnsPlaceholder = this.data.typeToColumnsPlaceholder; + var list = this.getConfig(type); + var result = Object.keys(list).map(function (code) { + return { + code: code, + name: list[code], + }; + }); + if (code != null) { + // oversea code + if (code[0] === '9' && type === 'city') { + code = '9'; + } + result = result.filter(function (item) { + return item.code.indexOf(code) === 0; + }); + } + if (typeToColumnsPlaceholder[type] && result.length) { + // set columns placeholder + var codeFill = + type === 'province' + ? '' + : type === 'city' + ? EMPTY_CODE.slice(2, 4) + : EMPTY_CODE.slice(4, 6); + result.unshift({ + code: '' + code + codeFill, + name: typeToColumnsPlaceholder[type], + }); + } + return result; + }, + getIndex: function (type, code) { + var compareNum = type === 'province' ? 2 : type === 'city' ? 4 : 6; + var list = this.getList(type, code.slice(0, compareNum - 2)); + // oversea code + if (code[0] === '9' && type === 'province') { + compareNum = 1; + } + code = code.slice(0, compareNum); + for (var i = 0; i < list.length; i++) { + if (list[i].code.slice(0, compareNum) === code) { + return i; + } + } + return 0; + }, + setValues: function () { + var picker = this.getPicker(); + if (!picker) { + return; + } + var code = this.code || this.getDefaultCode(); + var provinceList = this.getList('province'); + var cityList = this.getList('city', code.slice(0, 2)); + var stack = []; + var indexes = []; + var columnsNum = this.data.columnsNum; + if (columnsNum >= 1) { + stack.push(picker.setColumnValues(0, provinceList, false)); + indexes.push(this.getIndex('province', code)); + } + if (columnsNum >= 2) { + stack.push(picker.setColumnValues(1, cityList, false)); + indexes.push(this.getIndex('city', code)); + if (cityList.length && code.slice(2, 4) === '00') { + code = cityList[0].code; + } + } + if (columnsNum === 3) { + stack.push( + picker.setColumnValues( + 2, + this.getList('county', code.slice(0, 4)), + false + ) + ); + indexes.push(this.getIndex('county', code)); + } + return Promise.all(stack) + .catch(function () {}) + .then(function () { + return picker.setIndexes(indexes); + }) + .catch(function () {}); + }, + getDefaultCode: function () { + var columnsPlaceholder = this.data.columnsPlaceholder; + if (columnsPlaceholder.length) { + return EMPTY_CODE; + } + var countyCodes = Object.keys(this.getConfig('county')); + if (countyCodes[0]) { + return countyCodes[0]; + } + var cityCodes = Object.keys(this.getConfig('city')); + if (cityCodes[0]) { + return cityCodes[0]; + } + return ''; + }, + getValues: function () { + var picker = this.getPicker(); + if (!picker) { + return []; + } + return this.parseValues( + picker.getValues().filter(function (value) { + return !!value; + }) + ); + }, + getDetail: function () { + var values = this.getValues(); + var area = { + code: '', + country: '', + province: '', + city: '', + county: '', + }; + if (!values.length) { + return area; + } + var names = values.map(function (item) { + return item.name; + }); + area.code = values[values.length - 1].code; + if (area.code[0] === '9') { + area.country = names[1] || ''; + area.province = names[2] || ''; + } else { + area.province = names[0] || ''; + area.city = names[1] || ''; + area.county = names[2] || ''; + } + return area; + }, + reset: function (code) { + this.code = code || ''; + return this.setValues(); + }, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/area/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/area/index.json new file mode 100644 index 0000000000000000000000000000000000000000..9176008a698d51dccffe6d7e89c018fcb3ea3a94 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/area/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-picker": "../picker/index" + } +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/area/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/area/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..9ee9bd932191b8fc8a7c9ad46c1340ab4ebf8616 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/area/index.wxml @@ -0,0 +1,20 @@ + + + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/area/index.wxs b/src/openeuler/miniprogram_npm/@vant/weapp/area/index.wxs new file mode 100644 index 0000000000000000000000000000000000000000..bd1072ca56e3932b98c035d3b8ffe632aa386081 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/area/index.wxs @@ -0,0 +1,8 @@ +/* eslint-disable */ +function displayColumns(columns, columnsNum) { + return columns.slice(0, +columnsNum); +} + +module.exports = { + displayColumns: displayColumns, +}; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/area/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/area/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..99694d603361421fe8f1acfc76a09eae443cb3aa --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/area/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss'; \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/button/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/button/index.js new file mode 100644 index 0000000000000000000000000000000000000000..7466dfe30f7b174a4a3a41402260be1b95ff2a6e --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/button/index.js @@ -0,0 +1,60 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var component_1 = require('../common/component'); +var button_1 = require('../mixins/button'); +var open_type_1 = require('../mixins/open-type'); +var version_1 = require('../common/version'); +var mixins = [button_1.button, open_type_1.openType]; +if (version_1.canIUseFormFieldButton()) { + mixins.push('wx://form-field-button'); +} +component_1.VantComponent({ + mixins: mixins, + classes: ['hover-class', 'loading-class'], + data: { + baseStyle: '', + }, + props: { + formType: String, + icon: String, + classPrefix: { + type: String, + value: 'van-icon', + }, + plain: Boolean, + block: Boolean, + round: Boolean, + square: Boolean, + loading: Boolean, + hairline: Boolean, + disabled: Boolean, + loadingText: String, + customStyle: String, + loadingType: { + type: String, + value: 'circular', + }, + type: { + type: String, + value: 'default', + }, + dataset: null, + size: { + type: String, + value: 'normal', + }, + loadingSize: { + type: String, + value: '20px', + }, + color: String, + }, + methods: { + onClick: function () { + if (!this.data.loading) { + this.$emit('click'); + } + }, + noop: function () {}, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/button/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/button/index.json new file mode 100644 index 0000000000000000000000000000000000000000..8e23ad65ccf807f24fa7798cd2cc046a78153e59 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/button/index.json @@ -0,0 +1,7 @@ +{ + "component": true, + "usingComponents": { + "van-icon": "../icon/index", + "van-loading": "../loading/index" + } +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/button/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/button/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..a0059c73811b736483915a1eb6d4edaa4ffb8d9d --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/button/index.wxml @@ -0,0 +1,53 @@ + + + + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/button/index.wxs b/src/openeuler/miniprogram_npm/@vant/weapp/button/index.wxs new file mode 100644 index 0000000000000000000000000000000000000000..f5b7ab2b6ae3a164807ddf1f711517bb0e43cd33 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/button/index.wxs @@ -0,0 +1,39 @@ +/* eslint-disable */ +var style = require('../wxs/style.wxs'); + +function rootStyle(data) { + if (!data.color) { + return data.customStyle; + } + + var properties = { + color: data.plain ? data.color : '#fff', + background: data.plain ? null : data.color, + }; + + // hide border when color is linear-gradient + if (data.color.indexOf('gradient') !== -1) { + properties.border = 0; + } else { + properties['border-color'] = data.color; + } + + return style([properties, data.customStyle]); +} + +function loadingColor(data) { + if (data.plain) { + return data.color ? data.color : '#c9c9c9'; + } + + if (data.type === 'default') { + return '#c9c9c9'; + } + + return '#fff'; +} + +module.exports = { + rootStyle: rootStyle, + loadingColor: loadingColor, +}; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/button/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/button/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..5a591fbd5ebe777d649cc7e6378a25d40615767f --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/button/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-button{position:relative;display:-webkit-inline-flex;display:inline-flex;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;padding:0;text-align:center;vertical-align:middle;-webkit-appearance:none;-webkit-text-size-adjust:100%;height:44px;height:var(--button-default-height,44px);line-height:20px;line-height:var(--button-line-height,20px);font-size:16px;font-size:var(--button-default-font-size,16px);transition:opacity .2s;transition:opacity var(--animation-duration-fast,.2s);border-radius:2px;border-radius:var(--button-border-radius,2px)}.van-button:before{position:absolute;top:50%;left:50%;width:100%;height:100%;border:inherit;border-radius:inherit;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);opacity:0;content:" ";background-color:#000;background-color:var(--black,#000);border-color:#000;border-color:var(--black,#000)}.van-button:after{border-width:0}.van-button--active:before{opacity:.15}.van-button--unclickable:after{display:none}.van-button--default{color:#323233;color:var(--button-default-color,#323233);background:#fff;background:var(--button-default-background-color,#fff);border:1px solid #ebedf0;border:var(--button-border-width,1px) solid var(--button-default-border-color,#ebedf0)}.van-button--primary{color:#fff;color:var(--button-primary-color,#fff);background:#07c160;background:var(--button-primary-background-color,#07c160);border:1px solid #07c160;border:var(--button-border-width,1px) solid var(--button-primary-border-color,#07c160)}.van-button--info{color:#fff;color:var(--button-info-color,#fff);background:#1989fa;background:var(--button-info-background-color,#1989fa);border:1px solid #1989fa;border:var(--button-border-width,1px) solid var(--button-info-border-color,#1989fa)}.van-button--danger{color:#fff;color:var(--button-danger-color,#fff);background:#ee0a24;background:var(--button-danger-background-color,#ee0a24);border:1px solid #ee0a24;border:var(--button-border-width,1px) solid var(--button-danger-border-color,#ee0a24)}.van-button--warning{color:#fff;color:var(--button-warning-color,#fff);background:#ff976a;background:var(--button-warning-background-color,#ff976a);border:1px solid #ff976a;border:var(--button-border-width,1px) solid var(--button-warning-border-color,#ff976a)}.van-button--plain{background:#fff;background:var(--button-plain-background-color,#fff)}.van-button--plain.van-button--primary{color:#07c160;color:var(--button-primary-background-color,#07c160)}.van-button--plain.van-button--info{color:#1989fa;color:var(--button-info-background-color,#1989fa)}.van-button--plain.van-button--danger{color:#ee0a24;color:var(--button-danger-background-color,#ee0a24)}.van-button--plain.van-button--warning{color:#ff976a;color:var(--button-warning-background-color,#ff976a)}.van-button--large{width:100%;height:50px;height:var(--button-large-height,50px)}.van-button--normal{padding:0 15px;font-size:14px;font-size:var(--button-normal-font-size,14px)}.van-button--small{min-width:60px;min-width:var(--button-small-min-width,60px);height:30px;height:var(--button-small-height,30px);padding:0 8px;padding:0 var(--padding-xs,8px);font-size:12px;font-size:var(--button-small-font-size,12px)}.van-button--mini{display:inline-block;min-width:50px;min-width:var(--button-mini-min-width,50px);height:22px;height:var(--button-mini-height,22px);font-size:10px;font-size:var(--button-mini-font-size,10px)}.van-button--mini+.van-button--mini{margin-left:5px}.van-button--block{display:-webkit-flex;display:flex;width:100%}.van-button--round{border-radius:999px;border-radius:var(--button-round-border-radius,999px)}.van-button--square{border-radius:0}.van-button--disabled{opacity:.5;opacity:var(--button-disabled-opacity,.5)}.van-button__text{display:inline}.van-button__icon+.van-button__text:not(:empty),.van-button__loading-text{margin-left:4px}.van-button__icon{min-width:1em;line-height:inherit!important;vertical-align:top}.van-button--hairline{padding-top:1px;border-width:0}.van-button--hairline:after{border-color:inherit;border-width:1px;border-radius:4px;border-radius:calc(var(--button-border-radius, 2px)*2)}.van-button--hairline.van-button--round:after{border-radius:999px;border-radius:var(--button-round-border-radius,999px)}.van-button--hairline.van-button--square:after{border-radius:0} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/calendar.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/calendar.wxml new file mode 100644 index 0000000000000000000000000000000000000000..b59ffe9e6a2b05583b3fe70a12bd09d490356703 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/calendar.wxml @@ -0,0 +1,65 @@ + +
+ +
+ + + + + + + + + + + + {{ + computed.getButtonDisabled(type, currentDate) + ? confirmDisabledText + : confirmText + }} + + +
diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.js new file mode 100644 index 0000000000000000000000000000000000000000..f4d70c2676457705ed0f7706ad983f9af3df1622 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.js @@ -0,0 +1,18 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var component_1 = require('../../../common/component'); +component_1.VantComponent({ + props: { + title: { + type: String, + value: '日期选择', + }, + subtitle: String, + showTitle: Boolean, + showSubtitle: Boolean, + }, + data: { + weekdays: ['日', '一', '二', '三', '四', '五', '六'], + }, + methods: {}, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.json new file mode 100644 index 0000000000000000000000000000000000000000..efdc3c823a323c17832b921a6bccbcd398609183 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..08e62a6fa83d9f3fe19f47792a9c7c448ee74d24 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxml @@ -0,0 +1,16 @@ + + + + {{ title }} + + + + {{ subtitle }} + + + + + {{ item }} + + + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..4075e48f17ccea9eb15348c86b332b9464d534aa --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxss @@ -0,0 +1 @@ +@import '../../../common/index.wxss';.van-calendar__header{-webkit-flex-shrink:0;flex-shrink:0;box-shadow:0 2px 10px rgba(125,126,128,.16);box-shadow:var(--calendar-header-box-shadow,0 2px 10px rgba(125,126,128,.16))}.van-calendar__header-subtitle,.van-calendar__header-title{text-align:center;height:44px;height:var(--calendar-header-title-height,44px);font-weight:500;font-weight:var(--font-weight-bold,500);line-height:44px;line-height:var(--calendar-header-title-height,44px)}.van-calendar__header-title+.van-calendar__header-title,.van-calendar__header-title:empty{display:none}.van-calendar__header-title:empty+.van-calendar__header-title{display:block!important}.van-calendar__weekdays{display:-webkit-flex;display:flex}.van-calendar__weekday{-webkit-flex:1;flex:1;text-align:center;font-size:12px;font-size:var(--calendar-weekdays-font-size,12px);line-height:30px;line-height:var(--calendar-weekdays-height,30px)} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.js new file mode 100644 index 0000000000000000000000000000000000000000..470b31b51a42c1d688b8fe13dabddd41603d7bcd --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.js @@ -0,0 +1,167 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var component_1 = require('../../../common/component'); +var utils_1 = require('../../utils'); +component_1.VantComponent({ + props: { + date: { + type: null, + observer: 'setDays', + }, + type: { + type: String, + observer: 'setDays', + }, + color: String, + minDate: { + type: null, + observer: 'setDays', + }, + maxDate: { + type: null, + observer: 'setDays', + }, + showMark: Boolean, + rowHeight: null, + formatter: { + type: null, + observer: 'setDays', + }, + currentDate: { + type: null, + observer: 'setDays', + }, + allowSameDay: Boolean, + showSubtitle: Boolean, + showMonthTitle: Boolean, + }, + data: { + visible: true, + days: [], + }, + methods: { + onClick: function (event) { + var index = event.currentTarget.dataset.index; + var item = this.data.days[index]; + if (item.type !== 'disabled') { + this.$emit('click', item); + } + }, + setDays: function () { + var days = []; + var startDate = new Date(this.data.date); + var year = startDate.getFullYear(); + var month = startDate.getMonth(); + var totalDay = utils_1.getMonthEndDay( + startDate.getFullYear(), + startDate.getMonth() + 1 + ); + for (var day = 1; day <= totalDay; day++) { + var date = new Date(year, month, day); + var type = this.getDayType(date); + var config = { + date: date, + type: type, + text: day, + bottomInfo: this.getBottomInfo(type), + }; + if (this.data.formatter) { + config = this.data.formatter(config); + } + days.push(config); + } + this.setData({ days: days }); + }, + getMultipleDayType: function (day) { + var currentDate = this.data.currentDate; + if (!Array.isArray(currentDate)) { + return ''; + } + var isSelected = function (date) { + return currentDate.some(function (item) { + return utils_1.compareDay(item, date) === 0; + }); + }; + if (isSelected(day)) { + var prevDay = utils_1.getPrevDay(day); + var nextDay = utils_1.getNextDay(day); + var prevSelected = isSelected(prevDay); + var nextSelected = isSelected(nextDay); + if (prevSelected && nextSelected) { + return 'multiple-middle'; + } + if (prevSelected) { + return 'end'; + } + return nextSelected ? 'start' : 'multiple-selected'; + } + return ''; + }, + getRangeDayType: function (day) { + var _a = this.data, + currentDate = _a.currentDate, + allowSameDay = _a.allowSameDay; + if (!Array.isArray(currentDate)) { + return; + } + var startDay = currentDate[0], + endDay = currentDate[1]; + if (!startDay) { + return; + } + var compareToStart = utils_1.compareDay(day, startDay); + if (!endDay) { + return compareToStart === 0 ? 'start' : ''; + } + var compareToEnd = utils_1.compareDay(day, endDay); + if (compareToStart === 0 && compareToEnd === 0 && allowSameDay) { + return 'start-end'; + } + if (compareToStart === 0) { + return 'start'; + } + if (compareToEnd === 0) { + return 'end'; + } + if (compareToStart > 0 && compareToEnd < 0) { + return 'middle'; + } + }, + getDayType: function (day) { + var _a = this.data, + type = _a.type, + minDate = _a.minDate, + maxDate = _a.maxDate, + currentDate = _a.currentDate; + if ( + utils_1.compareDay(day, minDate) < 0 || + utils_1.compareDay(day, maxDate) > 0 + ) { + return 'disabled'; + } + if (type === 'single') { + return utils_1.compareDay(day, currentDate) === 0 ? 'selected' : ''; + } + if (type === 'multiple') { + return this.getMultipleDayType(day); + } + /* istanbul ignore else */ + if (type === 'range') { + return this.getRangeDayType(day); + } + }, + getBottomInfo: function (type) { + if (this.data.type === 'range') { + if (type === 'start') { + return '开始'; + } + if (type === 'end') { + return '结束'; + } + if (type === 'start-end') { + return '开始/结束'; + } + } + }, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.json new file mode 100644 index 0000000000000000000000000000000000000000..efdc3c823a323c17832b921a6bccbcd398609183 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..b4b431ad8ad33d179e28862bb1c76d71b02ea88b --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxml @@ -0,0 +1,39 @@ + + + + + + {{ computed.formatMonthTitle(date) }} + + + + + {{ computed.getMark(date) }} + + + + + {{ item.topInfo }} + {{ item.text }} + + {{ item.bottomInfo }} + + + + + {{ item.topInfo }} + {{ item.text }} + + {{ item.bottomInfo }} + + + + + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxs b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxs new file mode 100644 index 0000000000000000000000000000000000000000..00c909dbc5704e755ca2bd288f7ed3fd2ebd2c0b --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxs @@ -0,0 +1,67 @@ +/* eslint-disable */ +var utils = require('../../utils.wxs'); + +function getMark(date) { + return getDate(date).getMonth() + 1; +} + +var ROW_HEIGHT = 64; + +function getDayStyle(type, index, date, rowHeight, color) { + var style = []; + var offset = getDate(date).getDay(); + + if (index === 0) { + style.push(['margin-left', (100 * offset) / 7 + '%']); + } + + if (rowHeight !== ROW_HEIGHT) { + style.push(['height', rowHeight + 'px']); + } + + if (color) { + if ( + type === 'start' || + type === 'end' || + type === 'multiple-selected' || + type === 'multiple-middle' + ) { + style.push(['background', color]); + } else if (type === 'middle') { + style.push(['color', color]); + } + } + + return style + .map(function(item) { + return item.join(':'); + }) + .join(';'); +} + +function formatMonthTitle(date) { + date = getDate(date); + return date.getFullYear() + '年' + (date.getMonth() + 1) + '月'; +} + +function getMonthStyle(visible, date, rowHeight) { + if (!visible) { + date = getDate(date); + + var totalDay = utils.getMonthEndDay( + date.getFullYear(), + date.getMonth() + 1 + ); + var offset = getDate(date).getDay(); + var padding = Math.ceil((totalDay + offset) / 7) * rowHeight; + + return 'padding-bottom:' + padding + 'px'; + } +} + +module.exports = { + getMark: getMark, + getDayStyle: getDayStyle, + formatMonthTitle: formatMonthTitle, + getMonthStyle: getMonthStyle +}; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..17c12f4e60009cbbe9457f4370d57e30953fc0d4 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxss @@ -0,0 +1 @@ +@import '../../../common/index.wxss';.van-calendar{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;height:100%;background-color:#fff;background-color:var(--calendar-background-color,#fff)}.van-calendar__month-title{text-align:center;height:44px;height:var(--calendar-header-title-height,44px);font-weight:500;font-weight:var(--font-weight-bold,500);font-size:14px;font-size:var(--calendar-month-title-font-size,14px);line-height:44px;line-height:var(--calendar-header-title-height,44px)}.van-calendar__days{position:relative;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap;-webkit-user-select:none;user-select:none}.van-calendar__month-mark{position:absolute;top:50%;left:50%;z-index:0;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);pointer-events:none;color:rgba(242,243,245,.8);color:var(--calendar-month-mark-color,rgba(242,243,245,.8));font-size:160px;font-size:var(--calendar-month-mark-font-size,160px)}.van-calendar__day,.van-calendar__selected-day{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;text-align:center}.van-calendar__day{position:relative;width:14.285%;height:64px;height:var(--calendar-day-height,64px);font-size:16px;font-size:var(--calendar-day-font-size,16px)}.van-calendar__day--end,.van-calendar__day--multiple-middle,.van-calendar__day--multiple-selected,.van-calendar__day--start,.van-calendar__day--start-end{color:#fff;color:var(--calendar-range-edge-color,#fff);background-color:#ee0a24;background-color:var(--calendar-range-edge-background-color,#ee0a24)}.van-calendar__day--start{border-radius:4px 0 0 4px;border-radius:var(--border-radius-md,4px) 0 0 var(--border-radius-md,4px)}.van-calendar__day--end{border-radius:0 4px 4px 0;border-radius:0 var(--border-radius-md,4px) var(--border-radius-md,4px) 0}.van-calendar__day--multiple-selected,.van-calendar__day--start-end{border-radius:4px;border-radius:var(--border-radius-md,4px)}.van-calendar__day--middle{color:#ee0a24;color:var(--calendar-range-middle-color,#ee0a24)}.van-calendar__day--middle:after{position:absolute;top:0;right:0;bottom:0;left:0;background-color:currentColor;content:"";opacity:.1;opacity:var(--calendar-range-middle-background-opacity,.1)}.van-calendar__day--disabled{cursor:default;color:#c8c9cc;color:var(--calendar-day-disabled-color,#c8c9cc)}.van-calendar__bottom-info,.van-calendar__top-info{position:absolute;right:0;left:0;font-size:10px;font-size:var(--calendar-info-font-size,10px);line-height:14px;line-height:var(--calendar-info-line-height,14px)}@media (max-width:350px){.van-calendar__bottom-info,.van-calendar__top-info{font-size:9px}}.van-calendar__top-info{top:6px}.van-calendar__bottom-info{bottom:6px}.van-calendar__selected-day{width:54px;width:var(--calendar-selected-day-size,54px);height:54px;height:var(--calendar-selected-day-size,54px);color:#fff;color:var(--calendar-selected-day-color,#fff);background-color:#ee0a24;background-color:var(--calendar-selected-day-background-color,#ee0a24);border-radius:4px;border-radius:var(--border-radius-md,4px)} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.js new file mode 100644 index 0000000000000000000000000000000000000000..f64f31873f142245e3442db75114f37ac834c516 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.js @@ -0,0 +1,325 @@ +'use strict'; +var __spreadArrays = + (this && this.__spreadArrays) || + function () { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) + s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; + }; +var __importDefault = + (this && this.__importDefault) || + function (mod) { + return mod && mod.__esModule ? mod : { default: mod }; + }; +Object.defineProperty(exports, '__esModule', { value: true }); +var component_1 = require('../common/component'); +var utils_1 = require('./utils'); +var toast_1 = __importDefault(require('../toast/toast')); +var utils_2 = require('../common/utils'); +component_1.VantComponent({ + props: { + title: { + type: String, + value: '日期选择', + }, + color: String, + show: { + type: Boolean, + observer: function (val) { + if (val) { + this.initRect(); + this.scrollIntoView(); + } + }, + }, + formatter: null, + confirmText: { + type: String, + value: '确定', + }, + rangePrompt: String, + defaultDate: { + type: null, + observer: function (val) { + this.setData({ currentDate: val }); + this.scrollIntoView(); + }, + }, + allowSameDay: Boolean, + confirmDisabledText: String, + type: { + type: String, + value: 'single', + observer: 'reset', + }, + minDate: { + type: null, + value: Date.now(), + }, + maxDate: { + type: null, + value: new Date( + new Date().getFullYear(), + new Date().getMonth() + 6, + new Date().getDate() + ).getTime(), + }, + position: { + type: String, + value: 'bottom', + }, + rowHeight: { + type: null, + value: utils_1.ROW_HEIGHT, + }, + round: { + type: Boolean, + value: true, + }, + poppable: { + type: Boolean, + value: true, + }, + showMark: { + type: Boolean, + value: true, + }, + showTitle: { + type: Boolean, + value: true, + }, + showConfirm: { + type: Boolean, + value: true, + }, + showSubtitle: { + type: Boolean, + value: true, + }, + safeAreaInsetBottom: { + type: Boolean, + value: true, + }, + closeOnClickOverlay: { + type: Boolean, + value: true, + }, + maxRange: { + type: null, + value: null, + }, + }, + data: { + subtitle: '', + currentDate: null, + scrollIntoView: '', + }, + created: function () { + this.setData({ + currentDate: this.getInitialDate(), + }); + }, + mounted: function () { + if (this.data.show || !this.data.poppable) { + this.initRect(); + this.scrollIntoView(); + } + }, + methods: { + reset: function () { + this.setData({ currentDate: this.getInitialDate() }); + this.scrollIntoView(); + }, + initRect: function () { + var _this = this; + if (this.contentObserver != null) { + this.contentObserver.disconnect(); + } + var contentObserver = this.createIntersectionObserver({ + thresholds: [0, 0.1, 0.9, 1], + observeAll: true, + }); + this.contentObserver = contentObserver; + contentObserver.relativeTo('.van-calendar__body'); + contentObserver.observe('.month', function (res) { + if (res.boundingClientRect.top <= res.relativeRect.top) { + // @ts-ignore + _this.setData({ + subtitle: utils_1.formatMonthTitle(res.dataset.date), + }); + } + }); + }, + getInitialDate: function () { + var _a = this.data, + type = _a.type, + defaultDate = _a.defaultDate, + minDate = _a.minDate; + if (type === 'range') { + var _b = defaultDate || [], + startDay = _b[0], + endDay = _b[1]; + return [ + startDay || minDate, + endDay || utils_1.getNextDay(new Date(minDate)).getTime(), + ]; + } + if (type === 'multiple') { + return defaultDate || [minDate]; + } + return defaultDate || minDate; + }, + scrollIntoView: function () { + var _this = this; + utils_2.requestAnimationFrame(function () { + var _a = _this.data, + currentDate = _a.currentDate, + type = _a.type, + show = _a.show, + poppable = _a.poppable, + minDate = _a.minDate, + maxDate = _a.maxDate; + // @ts-ignore + var targetDate = type === 'single' ? currentDate : currentDate[0]; + var displayed = show || !poppable; + if (!targetDate || !displayed) { + return; + } + var months = utils_1.getMonths(minDate, maxDate); + months.some(function (month, index) { + if (utils_1.compareMonth(month, targetDate) === 0) { + _this.setData({ scrollIntoView: 'month' + index }); + return true; + } + return false; + }); + }); + }, + onOpen: function () { + this.$emit('open'); + }, + onOpened: function () { + this.$emit('opened'); + }, + onClose: function () { + this.$emit('close'); + }, + onClosed: function () { + this.$emit('closed'); + }, + onClickDay: function (event) { + var date = event.detail.date; + var _a = this.data, + type = _a.type, + currentDate = _a.currentDate, + allowSameDay = _a.allowSameDay; + if (type === 'range') { + // @ts-ignore + var startDay = currentDate[0], + endDay = currentDate[1]; + if (startDay && !endDay) { + var compareToStart = utils_1.compareDay(date, startDay); + if (compareToStart === 1) { + this.select([startDay, date], true); + } else if (compareToStart === -1) { + this.select([date, null]); + } else if (allowSameDay) { + this.select([date, date]); + } + } else { + this.select([date, null]); + } + } else if (type === 'multiple') { + var selectedIndex_1; + // @ts-ignore + var selected = currentDate.some(function (dateItem, index) { + var equal = utils_1.compareDay(dateItem, date) === 0; + if (equal) { + selectedIndex_1 = index; + } + return equal; + }); + if (selected) { + // @ts-ignore + var cancelDate = currentDate.splice(selectedIndex_1, 1); + this.setData({ currentDate: currentDate }); + this.unselect(cancelDate); + } else { + // @ts-ignore + this.select(__spreadArrays(currentDate, [date])); + } + } else { + this.select(date, true); + } + }, + unselect: function (dateArray) { + var date = dateArray[0]; + if (date) { + this.$emit('unselect', utils_1.copyDates(date)); + } + }, + select: function (date, complete) { + if (complete && this.data.type === 'range') { + var valid = this.checkRange(date); + if (!valid) { + // auto selected to max range if showConfirm + if (this.data.showConfirm) { + this.emit([ + date[0], + utils_1.getDayByOffset(date[0], this.data.maxRange - 1), + ]); + } else { + this.emit(date); + } + return; + } + } + this.emit(date); + if (complete && !this.data.showConfirm) { + this.onConfirm(); + } + }, + emit: function (date) { + var getTime = function (date) { + return date instanceof Date ? date.getTime() : date; + }; + this.setData({ + currentDate: Array.isArray(date) ? date.map(getTime) : getTime(date), + }); + this.$emit('select', utils_1.copyDates(date)); + }, + checkRange: function (date) { + var _a = this.data, + maxRange = _a.maxRange, + rangePrompt = _a.rangePrompt; + if (maxRange && utils_1.calcDateNum(date) > maxRange) { + toast_1.default({ + context: this, + message: + rangePrompt || + '\u9009\u62E9\u5929\u6570\u4E0D\u80FD\u8D85\u8FC7 ' + + maxRange + + ' \u5929', + }); + return false; + } + return true; + }, + onConfirm: function () { + var _this = this; + if ( + this.data.type === 'range' && + !this.checkRange(this.data.currentDate) + ) { + return; + } + wx.nextTick(function () { + // @ts-ignore + _this.$emit('confirm', utils_1.copyDates(_this.data.currentDate)); + }); + }, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.json new file mode 100644 index 0000000000000000000000000000000000000000..fbb2d4e379fdd94391af589637a6c5b2f327a885 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.json @@ -0,0 +1,10 @@ +{ + "component": true, + "usingComponents": { + "header": "./components/header/index", + "month": "./components/month/index", + "van-button": "../button/index", + "van-popup": "../popup/index", + "van-toast": "../toast/index" + } +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..9a194ce0176db78ce5662238f5fd7b1c3bb0abee --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.wxml @@ -0,0 +1,25 @@ + + + + + + + + + + + + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.wxs b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.wxs new file mode 100644 index 0000000000000000000000000000000000000000..f4647137931d6d61cf04a14fcfd28acc39978724 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.wxs @@ -0,0 +1,37 @@ +/* eslint-disable */ +var utils = require('./utils.wxs'); + +function getMonths(minDate, maxDate) { + var months = []; + var cursor = getDate(minDate); + + cursor.setDate(1); + + do { + months.push(cursor.getTime()); + cursor.setMonth(cursor.getMonth() + 1); + } while (utils.compareMonth(cursor, getDate(maxDate)) !== 1); + + return months; +} + +function getButtonDisabled(type, currentDate) { + if (currentDate == null) { + return true; + } + + if (type === 'range') { + return !currentDate[0] || !currentDate[1]; + } + + if (type === 'multiple') { + return !currentDate.length; + } + + return !currentDate; +} + +module.exports = { + getMonths: getMonths, + getButtonDisabled: getButtonDisabled +}; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..9d78e0f4be3971db4a709cab484ee70dd38e61ce --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-calendar{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;height:100%;height:var(--calendar-height,100%);background-color:#fff;background-color:var(--calendar-background-color,#fff)}.van-calendar__close-icon{top:11px}.van-calendar__popup--bottom,.van-calendar__popup--top{height:80%;height:var(--calendar-popup-height,80%)}.van-calendar__popup--left,.van-calendar__popup--right{height:100%}.van-calendar__body{-webkit-flex:1;flex:1;overflow:auto;-webkit-overflow-scrolling:touch}.van-calendar__footer{-webkit-flex-shrink:0;flex-shrink:0;padding:0 16px;padding:0 var(--padding-md,16px)}.van-calendar__footer--safe-area-inset-bottom{padding-bottom:env(safe-area-inset-bottom)}.van-calendar__footer+.van-calendar__footer,.van-calendar__footer:empty{display:none}.van-calendar__footer:empty+.van-calendar__footer{display:block!important}.van-calendar__confirm{height:36px!important;height:var(--calendar-confirm-button-height,36px)!important;margin:7px 0!important;margin:var(--calendar-confirm-button-margin,7px 0)!important;line-height:34px!important;line-height:var(--calendar-confirm-button-line-height,34px)!important} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/utils.js b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..39b9916821e6d85bb5634368c22520bce0576c51 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/utils.js @@ -0,0 +1,91 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +exports.getMonths = exports.getMonthEndDay = exports.copyDates = exports.calcDateNum = exports.getNextDay = exports.getPrevDay = exports.getDayByOffset = exports.compareDay = exports.compareMonth = exports.formatMonthTitle = exports.ROW_HEIGHT = void 0; +exports.ROW_HEIGHT = 64; +function formatMonthTitle(date) { + if (!(date instanceof Date)) { + date = new Date(date); + } + return date.getFullYear() + '\u5E74' + (date.getMonth() + 1) + '\u6708'; +} +exports.formatMonthTitle = formatMonthTitle; +function compareMonth(date1, date2) { + if (!(date1 instanceof Date)) { + date1 = new Date(date1); + } + if (!(date2 instanceof Date)) { + date2 = new Date(date2); + } + var year1 = date1.getFullYear(); + var year2 = date2.getFullYear(); + var month1 = date1.getMonth(); + var month2 = date2.getMonth(); + if (year1 === year2) { + return month1 === month2 ? 0 : month1 > month2 ? 1 : -1; + } + return year1 > year2 ? 1 : -1; +} +exports.compareMonth = compareMonth; +function compareDay(day1, day2) { + if (!(day1 instanceof Date)) { + day1 = new Date(day1); + } + if (!(day2 instanceof Date)) { + day2 = new Date(day2); + } + var compareMonthResult = compareMonth(day1, day2); + if (compareMonthResult === 0) { + var date1 = day1.getDate(); + var date2 = day2.getDate(); + return date1 === date2 ? 0 : date1 > date2 ? 1 : -1; + } + return compareMonthResult; +} +exports.compareDay = compareDay; +function getDayByOffset(date, offset) { + date = new Date(date); + date.setDate(date.getDate() + offset); + return date; +} +exports.getDayByOffset = getDayByOffset; +function getPrevDay(date) { + return getDayByOffset(date, -1); +} +exports.getPrevDay = getPrevDay; +function getNextDay(date) { + return getDayByOffset(date, 1); +} +exports.getNextDay = getNextDay; +function calcDateNum(date) { + var day1 = new Date(date[0]).getTime(); + var day2 = new Date(date[1]).getTime(); + return (day2 - day1) / (1000 * 60 * 60 * 24) + 1; +} +exports.calcDateNum = calcDateNum; +function copyDates(dates) { + if (Array.isArray(dates)) { + return dates.map(function (date) { + if (date === null) { + return date; + } + return new Date(date); + }); + } + return new Date(dates); +} +exports.copyDates = copyDates; +function getMonthEndDay(year, month) { + return 32 - new Date(year, month - 1, 32).getDate(); +} +exports.getMonthEndDay = getMonthEndDay; +function getMonths(minDate, maxDate) { + var months = []; + var cursor = new Date(minDate); + cursor.setDate(1); + do { + months.push(cursor.getTime()); + cursor.setMonth(cursor.getMonth() + 1); + } while (compareMonth(cursor, maxDate) !== 1); + return months; +} +exports.getMonths = getMonths; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/calendar/utils.wxs b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/utils.wxs new file mode 100644 index 0000000000000000000000000000000000000000..2efe4a6ad16501f679a4a36286a4888d6f4b5542 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/calendar/utils.wxs @@ -0,0 +1,25 @@ +/* eslint-disable */ +function getMonthEndDay(year, month) { + return 32 - getDate(year, month - 1, 32).getDate(); +} + +function compareMonth(date1, date2) { + date1 = getDate(date1); + date2 = getDate(date2); + + var year1 = date1.getFullYear(); + var year2 = date2.getFullYear(); + var month1 = date1.getMonth(); + var month2 = date2.getMonth(); + + if (year1 === year2) { + return month1 === month2 ? 0 : month1 > month2 ? 1 : -1; + } + + return year1 > year2 ? 1 : -1; +} + +module.exports = { + getMonthEndDay: getMonthEndDay, + compareMonth: compareMonth +}; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/card/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/card/index.js new file mode 100644 index 0000000000000000000000000000000000000000..fa32fb919a81c811c6d6fc22a64572b075a0e341 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/card/index.js @@ -0,0 +1,51 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var link_1 = require('../mixins/link'); +var component_1 = require('../common/component'); +component_1.VantComponent({ + classes: [ + 'num-class', + 'desc-class', + 'thumb-class', + 'title-class', + 'price-class', + 'origin-price-class', + ], + mixins: [link_1.link], + props: { + tag: String, + num: String, + desc: String, + thumb: String, + title: String, + price: { + type: String, + observer: 'updatePrice', + }, + centered: Boolean, + lazyLoad: Boolean, + thumbLink: String, + originPrice: String, + thumbMode: { + type: String, + value: 'aspectFit', + }, + currency: { + type: String, + value: '¥', + }, + }, + methods: { + updatePrice: function () { + var price = this.data.price; + var priceArr = price.toString().split('.'); + this.setData({ + integerStr: priceArr[0], + decimalStr: priceArr[1] ? '.' + priceArr[1] : '', + }); + }, + onClickThumb: function () { + this.jumpLink('thumbLink'); + }, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/card/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/card/index.json new file mode 100644 index 0000000000000000000000000000000000000000..2b603f213877cd6d6cec8f82d69537e8026166ad --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/card/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-tag": "../tag/index" + } +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/card/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/card/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..c00776fe84780cff0b125ccbf8bafe9c780ffdd9 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/card/index.wxml @@ -0,0 +1,56 @@ + + + + + + + + + {{ tag }} + + + + + + + {{ title }} + + + {{ desc }} + + + + + + + + + {{ currency }} + {{ integerStr }} + {{ decimalStr }} + + + {{ currency }} {{ originPrice }} + + x {{ num }} + + + + + + + + + + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/card/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/card/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..a21a5995810a30a1ba04a92fcd830d1b79b32ee6 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/card/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-card{position:relative;box-sizing:border-box;padding:8px 16px;padding:var(--card-padding,8px 16px);font-size:12px;font-size:var(--card-font-size,12px);color:#323233;color:var(--card-text-color,#323233);background-color:#fafafa;background-color:var(--card-background-color,#fafafa)}.van-card__header{display:-webkit-flex;display:flex}.van-card__header--center{-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center}.van-card__thumb{position:relative;-webkit-flex:none;flex:none;width:88px;width:var(--card-thumb-size,88px);height:88px;height:var(--card-thumb-size,88px);margin-right:8px;margin-right:var(--padding-xs,8px)}.van-card__thumb:empty{display:none}.van-card__img{width:100%;height:100%;border-radius:8px;border-radius:var(--border-radius-lg,8px)}.van-card__content{position:relative;display:-webkit-flex;display:flex;-webkit-flex:1;flex:1;-webkit-flex-direction:column;flex-direction:column;-webkit-justify-content:space-between;justify-content:space-between;min-width:0;min-height:88px;min-height:var(--card-thumb-size,88px)}.van-card__content--center{-webkit-justify-content:center;justify-content:center}.van-card__desc,.van-card__title{word-wrap:break-word}.van-card__title{font-weight:700;line-height:16px;line-height:var(--card-title-line-height,16px)}.van-card__desc{line-height:20px;line-height:var(--card-desc-line-height,20px);color:#646566;color:var(--card-desc-color,#646566)}.van-card__bottom{line-height:20px}.van-card__price{display:inline-block;font-weight:700;color:#ee0a24;color:var(--card-price-color,#ee0a24);font-size:12px;font-size:var(--card-price-font-size,12px)}.van-card__price-integer{font-size:16px;font-size:var(--card-price-integer-font-size,16px)}.van-card__price-decimal,.van-card__price-integer{font-family:Avenir-Heavy,PingFang SC,Helvetica Neue,Arial,sans-serif;font-family:var(--card-price-font-family,Avenir-Heavy,PingFang SC,Helvetica Neue,Arial,sans-serif)}.van-card__origin-price{display:inline-block;margin-left:5px;text-decoration:line-through;font-size:10px;font-size:var(--card-origin-price-font-size,10px);color:#646566;color:var(--card-origin-price-color,#646566)}.van-card__num{float:right}.van-card__tag{position:absolute!important;top:2px;left:0}.van-card__footer{-webkit-flex:none;flex:none;width:100%;text-align:right} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.js new file mode 100644 index 0000000000000000000000000000000000000000..45b8ab61c580c091e22f191ede1ae85d421b82a9 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.js @@ -0,0 +1,12 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var component_1 = require('../common/component'); +component_1.VantComponent({ + props: { + title: String, + border: { + type: Boolean, + value: true, + }, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.json new file mode 100644 index 0000000000000000000000000000000000000000..efdc3c823a323c17832b921a6bccbcd398609183 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..88351a4e1687200fcf09ceb8db46c9343e29bf57 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.wxml @@ -0,0 +1,9 @@ + + {{ title }} + + + + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..edbccd5958c63dccfd0b9c3a53630e63d1ef483c --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/cell-group/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-cell-group__title{padding:16px 16px 8px;padding:var(--cell-group-title-padding,16px 16px 8px);font-size:14px;font-size:var(--cell-group-title-font-size,14px);line-height:16px;line-height:var(--cell-group-title-line-height,16px);color:#969799;color:var(--cell-group-title-color,#969799)} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.js new file mode 100644 index 0000000000000000000000000000000000000000..75691a1ae149f4a6ca36730753d887be7746385c --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.js @@ -0,0 +1,40 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var link_1 = require('../mixins/link'); +var component_1 = require('../common/component'); +component_1.VantComponent({ + classes: [ + 'title-class', + 'label-class', + 'value-class', + 'right-icon-class', + 'hover-class', + ], + mixins: [link_1.link], + props: { + title: null, + value: null, + icon: String, + size: String, + label: String, + center: Boolean, + isLink: Boolean, + required: Boolean, + clickable: Boolean, + titleWidth: String, + customStyle: String, + arrowDirection: String, + useLabelSlot: Boolean, + border: { + type: Boolean, + value: true, + }, + titleStyle: String, + }, + methods: { + onClick: function (event) { + this.$emit('click', event.detail); + this.jumpLink(); + }, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.json new file mode 100644 index 0000000000000000000000000000000000000000..8abfe203d0f960f68e62ffbf80021664bc8aae0a --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-icon": "../icon/index" + } +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..dac1fbffe0d7b5b142a922830faad5fc25b6f3b8 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.wxml @@ -0,0 +1,46 @@ + + + + + + + + + {{ title }} + + + + + {{ label }} + + + + + {{ value }} + + + + + + + + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.wxs b/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.wxs new file mode 100644 index 0000000000000000000000000000000000000000..8bceeae2660afd236d524a6fa13923b8df51c6d3 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.wxs @@ -0,0 +1,17 @@ +/* eslint-disable */ +var style = require('../wxs/style.wxs'); +var addUnit = require('../wxs/add-unit.wxs'); + +function titleStyle(data) { + return style([ + { + 'max-width': addUnit(data.titleWidth), + 'min-width': addUnit(data.titleWidth), + }, + data.titleStyle, + ]); +} + +module.exports = { + titleStyle: titleStyle, +}; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..605570db7dd8b26f23fb33fe3e8ca8a312e2d559 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/cell/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-cell{position:relative;display:-webkit-flex;display:flex;box-sizing:border-box;width:100%;padding:10px 16px;padding:var(--cell-vertical-padding,10px) var(--cell-horizontal-padding,16px);font-size:14px;font-size:var(--cell-font-size,14px);line-height:24px;line-height:var(--cell-line-height,24px);color:#323233;color:var(--cell-text-color,#323233);background-color:#fff;background-color:var(--cell-background-color,#fff)}.van-cell:after{position:absolute;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;content:" ";pointer-events:none;right:16px;bottom:0;left:16px;border-bottom:1px solid #ebedf0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.van-cell--borderless:after{display:none}.van-cell-group{background-color:#fff;background-color:var(--cell-background-color,#fff)}.van-cell__label{margin-top:3px;margin-top:var(--cell-label-margin-top,3px);font-size:12px;font-size:var(--cell-label-font-size,12px);line-height:18px;line-height:var(--cell-label-line-height,18px);color:#969799;color:var(--cell-label-color,#969799)}.van-cell__value{overflow:hidden;text-align:right;vertical-align:middle;color:#969799;color:var(--cell-value-color,#969799)}.van-cell__title,.van-cell__value{-webkit-flex:1;flex:1}.van-cell__title:empty,.van-cell__value:empty{display:none}.van-cell__left-icon-wrap,.van-cell__right-icon-wrap{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;height:24px;height:var(--cell-line-height,24px);font-size:16px;font-size:var(--cell-icon-size,16px)}.van-cell__left-icon-wrap{margin-right:4px;margin-right:var(--padding-base,4px)}.van-cell__right-icon-wrap{margin-left:4px;margin-left:var(--padding-base,4px);color:#969799;color:var(--cell-right-icon-color,#969799)}.van-cell__left-icon{vertical-align:middle}.van-cell__left-icon,.van-cell__right-icon{line-height:24px;line-height:var(--cell-line-height,24px)}.van-cell--clickable.van-cell--hover{background-color:#f2f3f5;background-color:var(--cell-active-color,#f2f3f5)}.van-cell--required{overflow:visible}.van-cell--required:before{position:absolute;content:"*";left:8px;left:var(--padding-xs,8px);font-size:14px;font-size:var(--cell-font-size,14px);color:#ee0a24;color:var(--cell-required-color,#ee0a24)}.van-cell--center{-webkit-align-items:center;align-items:center}.van-cell--large{padding-top:12px;padding-top:var(--cell-large-vertical-padding,12px);padding-bottom:12px;padding-bottom:var(--cell-large-vertical-padding,12px)}.van-cell--large .van-cell__title{font-size:16px;font-size:var(--cell-large-title-font-size,16px)}.van-cell--large .van-cell__value{font-size:16px;font-size:var(--cell-large-value-font-size,16px)}.van-cell--large .van-cell__label{font-size:14px;font-size:var(--cell-large-label-font-size,14px)} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.js new file mode 100644 index 0000000000000000000000000000000000000000..9836f097951fc0f983f12f7eead6b98fe5b9d0b6 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.js @@ -0,0 +1,38 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var relation_1 = require('../common/relation'); +var component_1 = require('../common/component'); +component_1.VantComponent({ + field: true, + relation: relation_1.useChildren('checkbox', function (target) { + this.updateChild(target); + }), + props: { + max: Number, + value: { + type: Array, + observer: 'updateChildren', + }, + disabled: { + type: Boolean, + observer: 'updateChildren', + }, + }, + methods: { + updateChildren: function () { + var _this = this; + this.children.forEach(function (child) { + return _this.updateChild(child); + }); + }, + updateChild: function (child) { + var _a = this.data, + value = _a.value, + disabled = _a.disabled; + child.setData({ + value: value.indexOf(child.data.name) !== -1, + parentDisabled: disabled, + }); + }, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.json new file mode 100644 index 0000000000000000000000000000000000000000..efdc3c823a323c17832b921a6bccbcd398609183 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..a8f3249c75c420f5ca13ed393b8ad0b91965d968 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.wxml @@ -0,0 +1 @@ + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..99694d603361421fe8f1acfc76a09eae443cb3aa --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox-group/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss'; \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.js new file mode 100644 index 0000000000000000000000000000000000000000..93fc39ad0e427cf7f41002f3e77e41473de8c90b --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.js @@ -0,0 +1,83 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var relation_1 = require('../common/relation'); +var component_1 = require('../common/component'); +function emit(target, value) { + target.$emit('input', value); + target.$emit('change', value); +} +component_1.VantComponent({ + field: true, + relation: relation_1.useParent('checkbox-group'), + classes: ['icon-class', 'label-class'], + props: { + value: Boolean, + disabled: Boolean, + useIconSlot: Boolean, + checkedColor: String, + labelPosition: { + type: String, + value: 'right', + }, + labelDisabled: Boolean, + shape: { + type: String, + value: 'round', + }, + iconSize: { + type: null, + value: 20, + }, + }, + data: { + parentDisabled: false, + }, + methods: { + emitChange: function (value) { + if (this.parent) { + this.setParentValue(this.parent, value); + } else { + emit(this, value); + } + }, + toggle: function () { + var _a = this.data, + parentDisabled = _a.parentDisabled, + disabled = _a.disabled, + value = _a.value; + if (!disabled && !parentDisabled) { + this.emitChange(!value); + } + }, + onClickLabel: function () { + var _a = this.data, + labelDisabled = _a.labelDisabled, + parentDisabled = _a.parentDisabled, + disabled = _a.disabled, + value = _a.value; + if (!disabled && !labelDisabled && !parentDisabled) { + this.emitChange(!value); + } + }, + setParentValue: function (parent, value) { + var parentValue = parent.data.value.slice(); + var name = this.data.name; + var max = parent.data.max; + if (value) { + if (max && parentValue.length >= max) { + return; + } + if (parentValue.indexOf(name) === -1) { + parentValue.push(name); + emit(parent, parentValue); + } + } else { + var index = parentValue.indexOf(name); + if (index !== -1) { + parentValue.splice(index, 1); + emit(parent, parentValue); + } + } + }, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.json new file mode 100644 index 0000000000000000000000000000000000000000..8abfe203d0f960f68e62ffbf80021664bc8aae0a --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-icon": "../icon/index" + } +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..4b3e8d3d2869675a34e7c0f9b020da3458098b19 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.wxml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.wxs b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.wxs new file mode 100644 index 0000000000000000000000000000000000000000..6ae3d25149a6fcc6440d03569d4edb737052feb5 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.wxs @@ -0,0 +1,20 @@ +/* eslint-disable */ +var style = require('../wxs/style.wxs'); +var addUnit = require('../wxs/add-unit.wxs'); + +function iconStyle(checkedColor, value, disabled, parentDisabled, iconSize) { + var styles = { + 'font-size': addUnit(iconSize), + }; + + if (checkedColor && value && !disabled && !parentDisabled) { + styles['border-color'] = checkedColor; + styles['background-color'] = checkedColor; + } + + return style(styles); +} + +module.exports = { + iconStyle: iconStyle, +}; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..afaf37bec1fdd0db46f6e8521e46a44f07e8cb1f --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/checkbox/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-checkbox{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;overflow:hidden;-webkit-user-select:none;user-select:none}.van-checkbox__icon-wrap,.van-checkbox__label{line-height:20px;line-height:var(--checkbox-size,20px)}.van-checkbox__icon-wrap{-webkit-flex:none;flex:none}.van-checkbox__icon{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;width:1em;height:1em;color:transparent;text-align:center;transition-property:color,border-color,background-color;font-size:20px;font-size:var(--checkbox-size,20px);border:1px solid #c8c9cc;border:1px solid var(--checkbox-border-color,#c8c9cc);transition-duration:.2s;transition-duration:var(--checkbox-transition-duration,.2s)}.van-checkbox__icon--round{border-radius:100%}.van-checkbox__icon--checked{color:#fff;color:var(--white,#fff);background-color:#1989fa;background-color:var(--checkbox-checked-icon-color,#1989fa);border-color:#1989fa;border-color:var(--checkbox-checked-icon-color,#1989fa)}.van-checkbox__icon--disabled{background-color:#ebedf0;background-color:var(--checkbox-disabled-background-color,#ebedf0);border-color:#c8c9cc;border-color:var(--checkbox-disabled-icon-color,#c8c9cc)}.van-checkbox__icon--disabled.van-checkbox__icon--checked{color:#c8c9cc;color:var(--checkbox-disabled-icon-color,#c8c9cc)}.van-checkbox__label{word-wrap:break-word;margin-left:10px;margin-left:var(--checkbox-label-margin,10px);color:#323233;color:var(--checkbox-label-color,#323233)}.van-checkbox__label--left{float:left;margin:0 10px 0 0;margin:0 var(--checkbox-label-margin,10px) 0 0}.van-checkbox__label--disabled{color:#c8c9cc;color:var(--checkbox-disabled-label-color,#c8c9cc)}.van-checkbox__label:empty{margin:0} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/circle/canvas.js b/src/openeuler/miniprogram_npm/@vant/weapp/circle/canvas.js new file mode 100644 index 0000000000000000000000000000000000000000..932a42aa1eeefb98a9c287ff2e7d8e77b3448a10 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/circle/canvas.js @@ -0,0 +1,47 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +exports.adaptor = void 0; +function adaptor(ctx) { + // @ts-ignore + return Object.assign(ctx, { + setStrokeStyle: function (val) { + ctx.strokeStyle = val; + }, + setLineWidth: function (val) { + ctx.lineWidth = val; + }, + setLineCap: function (val) { + ctx.lineCap = val; + }, + setFillStyle: function (val) { + ctx.fillStyle = val; + }, + setFontSize: function (val) { + ctx.font = String(val); + }, + setGlobalAlpha: function (val) { + ctx.globalAlpha = val; + }, + setLineJoin: function (val) { + ctx.lineJoin = val; + }, + setTextAlign: function (val) { + ctx.textAlign = val; + }, + setMiterLimit: function (val) { + ctx.miterLimit = val; + }, + setShadow: function (offsetX, offsetY, blur, color) { + ctx.shadowOffsetX = offsetX; + ctx.shadowOffsetY = offsetY; + ctx.shadowBlur = blur; + ctx.shadowColor = color; + }, + setTextBaseline: function (val) { + ctx.textBaseline = val; + }, + createCircularGradient: function () {}, + draw: function () {}, + }); +} +exports.adaptor = adaptor; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/circle/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/circle/index.js new file mode 100644 index 0000000000000000000000000000000000000000..c3313ba1e0d3dfe73db4cf8838b86743d9f5692b --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/circle/index.js @@ -0,0 +1,211 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var color_1 = require('../common/color'); +var component_1 = require('../common/component'); +var utils_1 = require('../common/utils'); +var validator_1 = require('../common/validator'); +var version_1 = require('../common/version'); +var canvas_1 = require('./canvas'); +function format(rate) { + return Math.min(Math.max(rate, 0), 100); +} +var PERIMETER = 2 * Math.PI; +var BEGIN_ANGLE = -Math.PI / 2; +var STEP = 1; +component_1.VantComponent({ + props: { + text: String, + lineCap: { + type: String, + value: 'round', + }, + value: { + type: Number, + value: 0, + observer: 'reRender', + }, + speed: { + type: Number, + value: 50, + }, + size: { + type: Number, + value: 100, + observer: function () { + this.drawCircle(this.currentValue); + }, + }, + fill: String, + layerColor: { + type: String, + value: color_1.WHITE, + }, + color: { + type: null, + value: color_1.BLUE, + observer: function () { + var _this = this; + this.setHoverColor().then(function () { + _this.drawCircle(_this.currentValue); + }); + }, + }, + type: { + type: String, + value: '', + }, + strokeWidth: { + type: Number, + value: 4, + }, + clockwise: { + type: Boolean, + value: true, + }, + }, + data: { + hoverColor: color_1.BLUE, + }, + methods: { + getContext: function () { + var _this = this; + var _a = this.data, + type = _a.type, + size = _a.size; + if (type === '' || !version_1.canIUseCanvas2d()) { + var ctx = wx.createCanvasContext('van-circle', this); + return Promise.resolve(ctx); + } + var dpr = utils_1.getSystemInfoSync().pixelRatio; + return new Promise(function (resolve) { + wx.createSelectorQuery() + .in(_this) + .select('#van-circle') + .node() + .exec(function (res) { + var canvas = res[0].node; + var ctx = canvas.getContext(type); + if (!_this.inited) { + _this.inited = true; + canvas.width = size * dpr; + canvas.height = size * dpr; + ctx.scale(dpr, dpr); + } + resolve(canvas_1.adaptor(ctx)); + }); + }); + }, + setHoverColor: function () { + var _this = this; + var _a = this.data, + color = _a.color, + size = _a.size; + if (validator_1.isObj(color)) { + return this.getContext().then(function (context) { + var LinearColor = context.createLinearGradient(size, 0, 0, 0); + Object.keys(color) + .sort(function (a, b) { + return parseFloat(a) - parseFloat(b); + }) + .map(function (key) { + return LinearColor.addColorStop( + parseFloat(key) / 100, + color[key] + ); + }); + _this.hoverColor = LinearColor; + }); + } + this.hoverColor = color; + return Promise.resolve(); + }, + presetCanvas: function (context, strokeStyle, beginAngle, endAngle, fill) { + var _a = this.data, + strokeWidth = _a.strokeWidth, + lineCap = _a.lineCap, + clockwise = _a.clockwise, + size = _a.size; + var position = size / 2; + var radius = position - strokeWidth / 2; + context.setStrokeStyle(strokeStyle); + context.setLineWidth(strokeWidth); + context.setLineCap(lineCap); + context.beginPath(); + context.arc(position, position, radius, beginAngle, endAngle, !clockwise); + context.stroke(); + if (fill) { + context.setFillStyle(fill); + context.fill(); + } + }, + renderLayerCircle: function (context) { + var _a = this.data, + layerColor = _a.layerColor, + fill = _a.fill; + this.presetCanvas(context, layerColor, 0, PERIMETER, fill); + }, + renderHoverCircle: function (context, formatValue) { + var clockwise = this.data.clockwise; + // 结束角度 + var progress = PERIMETER * (formatValue / 100); + var endAngle = clockwise + ? BEGIN_ANGLE + progress + : 3 * Math.PI - (BEGIN_ANGLE + progress); + this.presetCanvas(context, this.hoverColor, BEGIN_ANGLE, endAngle); + }, + drawCircle: function (currentValue) { + var _this = this; + var size = this.data.size; + this.getContext().then(function (context) { + context.clearRect(0, 0, size, size); + _this.renderLayerCircle(context); + var formatValue = format(currentValue); + if (formatValue !== 0) { + _this.renderHoverCircle(context, formatValue); + } + context.draw(); + }); + }, + reRender: function () { + var _this = this; + // tofector 动画暂时没有想到好的解决方案 + var _a = this.data, + value = _a.value, + speed = _a.speed; + if (speed <= 0 || speed > 1000) { + this.drawCircle(value); + return; + } + this.clearInterval(); + this.currentValue = this.currentValue || 0; + this.interval = setInterval(function () { + if (_this.currentValue !== value) { + if (_this.currentValue < value) { + _this.currentValue += STEP; + } else { + _this.currentValue -= STEP; + } + _this.drawCircle(_this.currentValue); + } else { + _this.clearInterval(); + } + }, 1000 / speed); + }, + clearInterval: function () { + if (this.interval) { + clearInterval(this.interval); + this.interval = null; + } + }, + }, + mounted: function () { + var _this = this; + this.currentValue = this.data.value; + this.setHoverColor().then(function () { + _this.drawCircle(_this.currentValue); + }); + }, + destroyed: function () { + this.clearInterval(); + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/circle/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/circle/index.json new file mode 100644 index 0000000000000000000000000000000000000000..efdc3c823a323c17832b921a6bccbcd398609183 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/circle/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/circle/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/circle/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..010ae1a5211994c4726b9e19bcca4c71cc55f2b6 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/circle/index.wxml @@ -0,0 +1,9 @@ + + + + + + + + {{ text }} + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/circle/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/circle/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..3ab63dfd1e7220e500bd44170a7368236f93949d --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/circle/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-circle{position:relative;display:inline-block;text-align:center}.van-circle__text{position:absolute;top:50%;left:0;width:100%;-webkit-transform:translateY(-50%);transform:translateY(-50%);color:#323233;color:var(--circle-text-color,#323233)} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/col/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/col/index.js new file mode 100644 index 0000000000000000000000000000000000000000..47d89c7aad4a02394c509eb4a1a8a39a2969aeb0 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/col/index.js @@ -0,0 +1,11 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var relation_1 = require('../common/relation'); +var component_1 = require('../common/component'); +component_1.VantComponent({ + relation: relation_1.useParent('row'), + props: { + span: Number, + offset: Number, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/col/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/col/index.json new file mode 100644 index 0000000000000000000000000000000000000000..efdc3c823a323c17832b921a6bccbcd398609183 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/col/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/col/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/col/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..aa603b98b1ac4524f95b2ad49458bad842a20c6b --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/col/index.wxml @@ -0,0 +1,9 @@ + + + + + + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/col/index.wxs b/src/openeuler/miniprogram_npm/@vant/weapp/col/index.wxs new file mode 100644 index 0000000000000000000000000000000000000000..2e65493b33e0ad7cc72e12559afe3be538c17ffb --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/col/index.wxs @@ -0,0 +1,18 @@ +/* eslint-disable */ +var style = require('../wxs/style.wxs'); +var addUnit = require('../wxs/add-unit.wxs'); + +function rootStyle(data) { + if (!data.gutter) { + return ''; + } + + return style({ + 'padding-right': addUnit(data.gutter / 2), + 'padding-left': addUnit(data.gutter / 2), + }); +} + +module.exports = { + rootStyle: rootStyle, +}; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/col/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/col/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..44c896a3ea71de650188e5d7c02ac697db680110 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/col/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-col{float:left;box-sizing:border-box}.van-col--1{width:4.16666667%}.van-col--offset-1{margin-left:4.16666667%}.van-col--2{width:8.33333333%}.van-col--offset-2{margin-left:8.33333333%}.van-col--3{width:12.5%}.van-col--offset-3{margin-left:12.5%}.van-col--4{width:16.66666667%}.van-col--offset-4{margin-left:16.66666667%}.van-col--5{width:20.83333333%}.van-col--offset-5{margin-left:20.83333333%}.van-col--6{width:25%}.van-col--offset-6{margin-left:25%}.van-col--7{width:29.16666667%}.van-col--offset-7{margin-left:29.16666667%}.van-col--8{width:33.33333333%}.van-col--offset-8{margin-left:33.33333333%}.van-col--9{width:37.5%}.van-col--offset-9{margin-left:37.5%}.van-col--10{width:41.66666667%}.van-col--offset-10{margin-left:41.66666667%}.van-col--11{width:45.83333333%}.van-col--offset-11{margin-left:45.83333333%}.van-col--12{width:50%}.van-col--offset-12{margin-left:50%}.van-col--13{width:54.16666667%}.van-col--offset-13{margin-left:54.16666667%}.van-col--14{width:58.33333333%}.van-col--offset-14{margin-left:58.33333333%}.van-col--15{width:62.5%}.van-col--offset-15{margin-left:62.5%}.van-col--16{width:66.66666667%}.van-col--offset-16{margin-left:66.66666667%}.van-col--17{width:70.83333333%}.van-col--offset-17{margin-left:70.83333333%}.van-col--18{width:75%}.van-col--offset-18{margin-left:75%}.van-col--19{width:79.16666667%}.van-col--offset-19{margin-left:79.16666667%}.van-col--20{width:83.33333333%}.van-col--offset-20{margin-left:83.33333333%}.van-col--21{width:87.5%}.van-col--offset-21{margin-left:87.5%}.van-col--22{width:91.66666667%}.van-col--offset-22{margin-left:91.66666667%}.van-col--23{width:95.83333333%}.van-col--offset-23{margin-left:95.83333333%}.van-col--24{width:100%}.van-col--offset-24{margin-left:100%} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/animate.js b/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/animate.js new file mode 100644 index 0000000000000000000000000000000000000000..255025c0739d820debdcc4bea86b83d55eec7197 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/animate.js @@ -0,0 +1,77 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +exports.setContentAnimate = void 0; +var version_1 = require('../common/version'); +var utils_1 = require('../common/utils'); +function useAnimate(context, expanded, mounted, height) { + var selector = '.van-collapse-item__wrapper'; + if (expanded) { + context.animate( + selector, + [ + { height: 0, ease: 'ease-in-out', offset: 0 }, + { height: height + 'px', ease: 'ease-in-out', offset: 1 }, + { height: 'auto', ease: 'ease-in-out', offset: 1 }, + ], + mounted ? 300 : 0, + function () { + context.clearAnimation(selector); + } + ); + return; + } + context.animate( + selector, + [ + { height: height + 'px', ease: 'ease-in-out', offset: 0 }, + { height: 0, ease: 'ease-in-out', offset: 1 }, + ], + 300, + function () { + context.clearAnimation(selector); + } + ); +} +function useAnimation(context, expanded, mounted, height) { + var animation = wx.createAnimation({ + duration: 0, + timingFunction: 'ease-in-out', + }); + if (expanded) { + if (height === 0) { + animation.height('auto').top(1).step(); + } else { + animation + .height(height) + .top(1) + .step({ + duration: mounted ? 300 : 1, + }) + .height('auto') + .step(); + } + context.setData({ + animation: animation.export(), + }); + return; + } + animation.height(height).top(0).step({ duration: 1 }).height(0).step({ + duration: 300, + }); + context.setData({ + animation: animation.export(), + }); +} +function setContentAnimate(context, expanded, mounted) { + utils_1 + .getRect(context, '.van-collapse-item__content') + .then(function (rect) { + return rect.height; + }) + .then(function (height) { + version_1.canIUseAnimate() + ? useAnimate(context, expanded, mounted, height) + : useAnimation(context, expanded, mounted, height); + }); +} +exports.setContentAnimate = setContentAnimate; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.js new file mode 100644 index 0000000000000000000000000000000000000000..288ab825e5aff288f99b2a54c13019505456ea2e --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.js @@ -0,0 +1,68 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var component_1 = require('../common/component'); +var relation_1 = require('../common/relation'); +var animate_1 = require('./animate'); +component_1.VantComponent({ + classes: ['title-class', 'content-class'], + relation: relation_1.useParent('collapse'), + props: { + name: null, + title: null, + value: null, + icon: String, + label: String, + disabled: Boolean, + clickable: Boolean, + border: { + type: Boolean, + value: true, + }, + isLink: { + type: Boolean, + value: true, + }, + }, + data: { + expanded: false, + }, + mounted: function () { + this.updateExpanded(); + this.mounted = true; + }, + methods: { + updateExpanded: function () { + if (!this.parent) { + return; + } + var _a = this.parent.data, + value = _a.value, + accordion = _a.accordion; + var _b = this.parent.children, + children = _b === void 0 ? [] : _b; + var name = this.data.name; + var index = children.indexOf(this); + var currentName = name == null ? index : name; + var expanded = accordion + ? value === currentName + : (value || []).some(function (name) { + return name === currentName; + }); + if (expanded !== this.data.expanded) { + animate_1.setContentAnimate(this, expanded, this.mounted); + } + this.setData({ index: index, expanded: expanded }); + }, + onClick: function () { + if (this.data.disabled) { + return; + } + var _a = this.data, + name = _a.name, + expanded = _a.expanded; + var index = this.parent.children.indexOf(this); + var currentName = name == null ? index : name; + this.parent.switch(currentName, !expanded); + }, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.json new file mode 100644 index 0000000000000000000000000000000000000000..7069216d021a1a9b865d67964a61326b17debebb --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-cell": "../cell/index" + } +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..94705ff87e29fd7b94a7dde39792ffbb45f43c82 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.wxml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..0bb936c00343dc591c86395261d00f2e08c00cb3 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/collapse-item/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-collapse-item__title .van-cell__right-icon{-webkit-transform:rotate(90deg);transform:rotate(90deg);transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;transition:-webkit-transform var(--collapse-item-transition-duration,.3s);transition:transform var(--collapse-item-transition-duration,.3s);transition:transform var(--collapse-item-transition-duration,.3s),-webkit-transform var(--collapse-item-transition-duration,.3s)}.van-collapse-item__title--expanded .van-cell__right-icon{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.van-collapse-item__title--disabled .van-cell,.van-collapse-item__title--disabled .van-cell__right-icon{color:#c8c9cc!important;color:var(--collapse-item-title-disabled-color,#c8c9cc)!important}.van-collapse-item__title--disabled .van-cell--hover{background-color:#fff!important;background-color:var(--white,#fff)!important}.van-collapse-item__wrapper{overflow:hidden}.van-collapse-item__content{padding:15px;padding:var(--collapse-item-content-padding,15px);color:#969799;color:var(--collapse-item-content-text-color,#969799);font-size:13px;font-size:var(--collapse-item-content-font-size,13px);line-height:1.5;line-height:var(--collapse-item-content-line-height,1.5);background-color:#fff;background-color:var(--collapse-item-content-background-color,#fff)} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/collapse/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/collapse/index.js new file mode 100644 index 0000000000000000000000000000000000000000..3d90fb38ce10d3d00bc776086dd3c146c6dba03f --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/collapse/index.js @@ -0,0 +1,50 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var component_1 = require('../common/component'); +var relation_1 = require('../common/relation'); +component_1.VantComponent({ + relation: relation_1.useChildren('collapse-item'), + props: { + value: { + type: null, + observer: 'updateExpanded', + }, + accordion: { + type: Boolean, + observer: 'updateExpanded', + }, + border: { + type: Boolean, + value: true, + }, + }, + methods: { + updateExpanded: function () { + this.children.forEach(function (child) { + child.updateExpanded(); + }); + }, + switch: function (name, expanded) { + var _a = this.data, + accordion = _a.accordion, + value = _a.value; + var changeItem = name; + if (!accordion) { + name = expanded + ? (value || []).concat(name) + : (value || []).filter(function (activeName) { + return activeName !== name; + }); + } else { + name = expanded ? name : ''; + } + if (expanded) { + this.$emit('open', changeItem); + } else { + this.$emit('close', changeItem); + } + this.$emit('change', name); + this.$emit('input', name); + }, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/collapse/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/collapse/index.json new file mode 100644 index 0000000000000000000000000000000000000000..efdc3c823a323c17832b921a6bccbcd398609183 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/collapse/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/collapse/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/collapse/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..f689405bf2d062fdd2564e5087b066b9b049f296 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/collapse/index.wxml @@ -0,0 +1,3 @@ + + + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/collapse/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/collapse/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..99694d603361421fe8f1acfc76a09eae443cb3aa --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/collapse/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss'; \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/common/color.js b/src/openeuler/miniprogram_npm/@vant/weapp/common/color.js new file mode 100644 index 0000000000000000000000000000000000000000..11be12add21a2b2fa2ccb7cacad0a26dae4c5965 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/common/color.js @@ -0,0 +1,10 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +exports.GRAY_DARK = exports.GRAY = exports.ORANGE = exports.GREEN = exports.WHITE = exports.BLUE = exports.RED = void 0; +exports.RED = '#ee0a24'; +exports.BLUE = '#1989fa'; +exports.WHITE = '#fff'; +exports.GREEN = '#07c160'; +exports.ORANGE = '#ff976a'; +exports.GRAY = '#323233'; +exports.GRAY_DARK = '#969799'; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/common/component.js b/src/openeuler/miniprogram_npm/@vant/weapp/common/component.js new file mode 100644 index 0000000000000000000000000000000000000000..6401bad7580d0384d38ae4ec0693948e7d4e5163 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/common/component.js @@ -0,0 +1,48 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +exports.VantComponent = void 0; +var basic_1 = require('../mixins/basic'); +function mapKeys(source, target, map) { + Object.keys(map).forEach(function (key) { + if (source[key]) { + target[map[key]] = source[key]; + } + }); +} +function VantComponent(vantOptions) { + var options = {}; + mapKeys(vantOptions, options, { + data: 'data', + props: 'properties', + mixins: 'behaviors', + methods: 'methods', + beforeCreate: 'created', + created: 'attached', + mounted: 'ready', + destroyed: 'detached', + classes: 'externalClasses', + }); + // add default externalClasses + options.externalClasses = options.externalClasses || []; + options.externalClasses.push('custom-class'); + // add default behaviors + options.behaviors = options.behaviors || []; + options.behaviors.push(basic_1.basic); + // add relations + var relation = vantOptions.relation; + if (relation) { + options.relations = relation.relations; + options.behaviors.push(relation.mixin); + } + // map field to form-field behavior + if (vantOptions.field) { + options.behaviors.push('wx://form-field'); + } + // add default options + options.options = { + multipleSlots: true, + addGlobalClass: true, + }; + Component(options); +} +exports.VantComponent = VantComponent; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/common/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/common/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..976825d7bfe20937b22d9ba32315561e6cadf953 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/common/index.wxss @@ -0,0 +1 @@ +.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-multi-ellipsis--l2{-webkit-line-clamp:2}.van-multi-ellipsis--l2,.van-multi-ellipsis--l3{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-box-orient:vertical}.van-multi-ellipsis--l3{-webkit-line-clamp:3}.van-clearfix:after{display:table;clear:both;content:""}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{position:absolute;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;content:" ";pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid #ebedf0;-webkit-transform:scale(.5);transform:scale(.5)}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/common/relation.js b/src/openeuler/miniprogram_npm/@vant/weapp/common/relation.js new file mode 100644 index 0000000000000000000000000000000000000000..a7372bc9335ce2adfcbfc631513ed2a9c22525e5 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/common/relation.js @@ -0,0 +1,79 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +exports.useChildren = exports.useParent = void 0; +function useParent(name, onEffect) { + var _a; + var path = '../' + name + '/index'; + return { + relations: + ((_a = {}), + (_a[path] = { + type: 'ancestor', + linked: function () { + onEffect && onEffect.call(this); + }, + linkChanged: function () { + onEffect && onEffect.call(this); + }, + unlinked: function () { + onEffect && onEffect.call(this); + }, + }), + _a), + mixin: Behavior({ + created: function () { + var _this = this; + Object.defineProperty(this, 'parent', { + get: function () { + return _this.getRelationNodes(path)[0]; + }, + }); + Object.defineProperty(this, 'index', { + // @ts-ignore + get: function () { + var _a, _b; + return (_b = + (_a = _this.parent) === null || _a === void 0 + ? void 0 + : _a.children) === null || _b === void 0 + ? void 0 + : _b.indexOf(_this); + }, + }); + }, + }), + }; +} +exports.useParent = useParent; +function useChildren(name, onEffect) { + var _a; + var path = '../' + name + '/index'; + return { + relations: + ((_a = {}), + (_a[path] = { + type: 'descendant', + linked: function (target) { + onEffect && onEffect.call(this, target); + }, + linkChanged: function (target) { + onEffect && onEffect.call(this, target); + }, + unlinked: function (target) { + onEffect && onEffect.call(this, target); + }, + }), + _a), + mixin: Behavior({ + created: function () { + var _this = this; + Object.defineProperty(this, 'children', { + get: function () { + return _this.getRelationNodes(path) || []; + }, + }); + }, + }), + }; +} +exports.useChildren = useChildren; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/common/style/clearfix.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/common/style/clearfix.wxss new file mode 100644 index 0000000000000000000000000000000000000000..a0ca83843c90df59e257b60edac727b42dd94c90 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/common/style/clearfix.wxss @@ -0,0 +1 @@ +.van-clearfix:after{display:table;clear:both;content:""} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/common/style/ellipsis.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/common/style/ellipsis.wxss new file mode 100644 index 0000000000000000000000000000000000000000..1e9dbc9e0952cef028b287b07744fa8b3343e980 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/common/style/ellipsis.wxss @@ -0,0 +1 @@ +.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-multi-ellipsis--l2{-webkit-line-clamp:2}.van-multi-ellipsis--l2,.van-multi-ellipsis--l3{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-box-orient:vertical}.van-multi-ellipsis--l3{-webkit-line-clamp:3} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/common/style/hairline.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/common/style/hairline.wxss new file mode 100644 index 0000000000000000000000000000000000000000..49b9e656fcb701be7db42660c9040740158d48f4 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/common/style/hairline.wxss @@ -0,0 +1 @@ +.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{position:absolute;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;content:" ";pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid #ebedf0;-webkit-transform:scale(.5);transform:scale(.5)}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/common/style/mixins/clearfix.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/common/style/mixins/clearfix.wxss new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/common/style/mixins/ellipsis.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/common/style/mixins/ellipsis.wxss new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/common/style/mixins/hairline.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/common/style/mixins/hairline.wxss new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/common/style/theme.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/common/style/theme.wxss new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/common/style/var.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/common/style/var.wxss new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/common/utils.js b/src/openeuler/miniprogram_npm/@vant/weapp/common/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..6f445065d077acdbc1cab13b77c7a54defec099b --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/common/utils.js @@ -0,0 +1,113 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +exports.getCurrentPage = exports.toPromise = exports.groupSetData = exports.getAllRect = exports.getRect = exports.pickExclude = exports.requestAnimationFrame = exports.addUnit = exports.getSystemInfoSync = exports.nextTick = exports.range = void 0; +var validator_1 = require('./validator'); +var version_1 = require('./version'); +function range(num, min, max) { + return Math.min(Math.max(num, min), max); +} +exports.range = range; +function nextTick(cb) { + if (version_1.canIUseNextTick()) { + wx.nextTick(cb); + } else { + setTimeout(function () { + cb(); + }, 1000 / 30); + } +} +exports.nextTick = nextTick; +var systemInfo; +function getSystemInfoSync() { + if (systemInfo == null) { + systemInfo = wx.getSystemInfoSync(); + } + return systemInfo; +} +exports.getSystemInfoSync = getSystemInfoSync; +function addUnit(value) { + if (!validator_1.isDef(value)) { + return undefined; + } + value = String(value); + return validator_1.isNumber(value) ? value + 'px' : value; +} +exports.addUnit = addUnit; +function requestAnimationFrame(cb) { + var systemInfo = getSystemInfoSync(); + if (systemInfo.platform === 'devtools') { + return setTimeout(function () { + cb(); + }, 1000 / 30); + } + return wx + .createSelectorQuery() + .selectViewport() + .boundingClientRect() + .exec(function () { + cb(); + }); +} +exports.requestAnimationFrame = requestAnimationFrame; +function pickExclude(obj, keys) { + if (!validator_1.isPlainObject(obj)) { + return {}; + } + return Object.keys(obj).reduce(function (prev, key) { + if (!keys.includes(key)) { + prev[key] = obj[key]; + } + return prev; + }, {}); +} +exports.pickExclude = pickExclude; +function getRect(context, selector) { + return new Promise(function (resolve) { + wx.createSelectorQuery() + .in(context) + .select(selector) + .boundingClientRect() + .exec(function (rect) { + if (rect === void 0) { + rect = []; + } + return resolve(rect[0]); + }); + }); +} +exports.getRect = getRect; +function getAllRect(context, selector) { + return new Promise(function (resolve) { + wx.createSelectorQuery() + .in(context) + .selectAll(selector) + .boundingClientRect() + .exec(function (rect) { + if (rect === void 0) { + rect = []; + } + return resolve(rect[0]); + }); + }); +} +exports.getAllRect = getAllRect; +function groupSetData(context, cb) { + if (version_1.canIUseGroupSetData()) { + context.groupSetData(cb); + } else { + cb(); + } +} +exports.groupSetData = groupSetData; +function toPromise(promiseLike) { + if (validator_1.isPromise(promiseLike)) { + return promiseLike; + } + return Promise.resolve(promiseLike); +} +exports.toPromise = toPromise; +function getCurrentPage() { + var pages = getCurrentPages(); + return pages[pages.length - 1]; +} +exports.getCurrentPage = getCurrentPage; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/common/validator.js b/src/openeuler/miniprogram_npm/@vant/weapp/common/validator.js new file mode 100644 index 0000000000000000000000000000000000000000..e61af2c89e6cd07990ddb591fb73e191c223edcf --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/common/validator.js @@ -0,0 +1,42 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +exports.isVideoUrl = exports.isImageUrl = exports.isBoolean = exports.isNumber = exports.isObj = exports.isDef = exports.isPromise = exports.isPlainObject = exports.isFunction = void 0; +function isFunction(val) { + return typeof val === 'function'; +} +exports.isFunction = isFunction; +function isPlainObject(val) { + return val !== null && typeof val === 'object' && !Array.isArray(val); +} +exports.isPlainObject = isPlainObject; +function isPromise(val) { + return isPlainObject(val) && isFunction(val.then) && isFunction(val.catch); +} +exports.isPromise = isPromise; +function isDef(value) { + return value !== undefined && value !== null; +} +exports.isDef = isDef; +function isObj(x) { + var type = typeof x; + return x !== null && (type === 'object' || type === 'function'); +} +exports.isObj = isObj; +function isNumber(value) { + return /^\d+(\.\d+)?$/.test(value); +} +exports.isNumber = isNumber; +function isBoolean(value) { + return typeof value === 'boolean'; +} +exports.isBoolean = isBoolean; +var IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i; +var VIDEO_REGEXP = /\.(mp4|mpg|mpeg|dat|asf|avi|rm|rmvb|mov|wmv|flv|mkv)/i; +function isImageUrl(url) { + return IMAGE_REGEXP.test(url); +} +exports.isImageUrl = isImageUrl; +function isVideoUrl(url) { + return VIDEO_REGEXP.test(url); +} +exports.isVideoUrl = isVideoUrl; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/common/version.js b/src/openeuler/miniprogram_npm/@vant/weapp/common/version.js new file mode 100644 index 0000000000000000000000000000000000000000..3a5d83754e4eb4478101c199055812958cddcc10 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/common/version.js @@ -0,0 +1,54 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +exports.canIUseCanvas2d = exports.canIUseNextTick = exports.canIUseGroupSetData = exports.canIUseAnimate = exports.canIUseFormFieldButton = exports.canIUseModel = void 0; +var utils_1 = require('./utils'); +function compareVersion(v1, v2) { + v1 = v1.split('.'); + v2 = v2.split('.'); + var len = Math.max(v1.length, v2.length); + while (v1.length < len) { + v1.push('0'); + } + while (v2.length < len) { + v2.push('0'); + } + for (var i = 0; i < len; i++) { + var num1 = parseInt(v1[i], 10); + var num2 = parseInt(v2[i], 10); + if (num1 > num2) { + return 1; + } + if (num1 < num2) { + return -1; + } + } + return 0; +} +function gte(version) { + var system = utils_1.getSystemInfoSync(); + return compareVersion(system.SDKVersion, version) >= 0; +} +function canIUseModel() { + return gte('2.9.3'); +} +exports.canIUseModel = canIUseModel; +function canIUseFormFieldButton() { + return gte('2.10.3'); +} +exports.canIUseFormFieldButton = canIUseFormFieldButton; +function canIUseAnimate() { + return gte('2.9.0'); +} +exports.canIUseAnimate = canIUseAnimate; +function canIUseGroupSetData() { + return gte('2.4.0'); +} +exports.canIUseGroupSetData = canIUseGroupSetData; +function canIUseNextTick() { + return wx.canIUse('nextTick'); +} +exports.canIUseNextTick = canIUseNextTick; +function canIUseCanvas2d() { + return gte('2.9.0'); +} +exports.canIUseCanvas2d = canIUseCanvas2d; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.js new file mode 100644 index 0000000000000000000000000000000000000000..f88ea09ff948628efb0ee7331d08a92ab669d7d4 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.js @@ -0,0 +1,103 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var component_1 = require('../common/component'); +var utils_1 = require('./utils'); +function simpleTick(fn) { + return setTimeout(fn, 30); +} +component_1.VantComponent({ + props: { + useSlot: Boolean, + millisecond: Boolean, + time: { + type: Number, + observer: 'reset', + }, + format: { + type: String, + value: 'HH:mm:ss', + }, + autoStart: { + type: Boolean, + value: true, + }, + }, + data: { + timeData: utils_1.parseTimeData(0), + formattedTime: '0', + }, + destroyed: function () { + clearTimeout(this.tid); + this.tid = null; + }, + methods: { + // 开始 + start: function () { + if (this.counting) { + return; + } + this.counting = true; + this.endTime = Date.now() + this.remain; + this.tick(); + }, + // 暂停 + pause: function () { + this.counting = false; + clearTimeout(this.tid); + }, + // 重置 + reset: function () { + this.pause(); + this.remain = this.data.time; + this.setRemain(this.remain); + if (this.data.autoStart) { + this.start(); + } + }, + tick: function () { + if (this.data.millisecond) { + this.microTick(); + } else { + this.macroTick(); + } + }, + microTick: function () { + var _this = this; + this.tid = simpleTick(function () { + _this.setRemain(_this.getRemain()); + if (_this.remain !== 0) { + _this.microTick(); + } + }); + }, + macroTick: function () { + var _this = this; + this.tid = simpleTick(function () { + var remain = _this.getRemain(); + if (!utils_1.isSameSecond(remain, _this.remain) || remain === 0) { + _this.setRemain(remain); + } + if (_this.remain !== 0) { + _this.macroTick(); + } + }); + }, + getRemain: function () { + return Math.max(this.endTime - Date.now(), 0); + }, + setRemain: function (remain) { + this.remain = remain; + var timeData = utils_1.parseTimeData(remain); + if (this.data.useSlot) { + this.$emit('change', timeData); + } + this.setData({ + formattedTime: utils_1.parseFormat(this.data.format, timeData), + }); + if (remain === 0) { + this.pause(); + this.$emit('finish'); + } + }, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.json new file mode 100644 index 0000000000000000000000000000000000000000..efdc3c823a323c17832b921a6bccbcd398609183 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..49c4db299dd42ceb13c0fe9904970977a6ea465a --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.wxml @@ -0,0 +1,4 @@ + + + {{ formattedTime }} + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..bc33f5dc8faedad81144c8c4fac06c831727e29f --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/count-down/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-count-down{color:#323233;color:var(--count-down-text-color,#323233);font-size:14px;font-size:var(--count-down-font-size,14px);line-height:20px;line-height:var(--count-down-line-height,20px)} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/count-down/utils.js b/src/openeuler/miniprogram_npm/@vant/weapp/count-down/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..ef6f9823674232999ab9b7cedbf65fb5fbc9fa2b --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/count-down/utils.js @@ -0,0 +1,65 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +exports.isSameSecond = exports.parseFormat = exports.parseTimeData = void 0; +function padZero(num, targetLength) { + if (targetLength === void 0) { + targetLength = 2; + } + var str = num + ''; + while (str.length < targetLength) { + str = '0' + str; + } + return str; +} +var SECOND = 1000; +var MINUTE = 60 * SECOND; +var HOUR = 60 * MINUTE; +var DAY = 24 * HOUR; +function parseTimeData(time) { + var days = Math.floor(time / DAY); + var hours = Math.floor((time % DAY) / HOUR); + var minutes = Math.floor((time % HOUR) / MINUTE); + var seconds = Math.floor((time % MINUTE) / SECOND); + var milliseconds = Math.floor(time % SECOND); + return { + days: days, + hours: hours, + minutes: minutes, + seconds: seconds, + milliseconds: milliseconds, + }; +} +exports.parseTimeData = parseTimeData; +function parseFormat(format, timeData) { + var days = timeData.days; + var hours = timeData.hours, + minutes = timeData.minutes, + seconds = timeData.seconds, + milliseconds = timeData.milliseconds; + if (format.indexOf('DD') === -1) { + hours += days * 24; + } else { + format = format.replace('DD', padZero(days)); + } + if (format.indexOf('HH') === -1) { + minutes += hours * 60; + } else { + format = format.replace('HH', padZero(hours)); + } + if (format.indexOf('mm') === -1) { + seconds += minutes * 60; + } else { + format = format.replace('mm', padZero(minutes)); + } + if (format.indexOf('ss') === -1) { + milliseconds += seconds * 1000; + } else { + format = format.replace('ss', padZero(seconds)); + } + return format.replace('SSS', padZero(milliseconds, 3)); +} +exports.parseFormat = parseFormat; +function isSameSecond(time1, time2) { + return Math.floor(time1 / 1000) === Math.floor(time2 / 1000); +} +exports.isSameSecond = isSameSecond; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/datetime-picker/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/datetime-picker/index.js new file mode 100644 index 0000000000000000000000000000000000000000..d2e4a03776d620f61298052ad061e19b6f2329af --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/datetime-picker/index.js @@ -0,0 +1,381 @@ +'use strict'; +var __assign = + (this && this.__assign) || + function () { + __assign = + Object.assign || + function (t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); + }; +var __spreadArrays = + (this && this.__spreadArrays) || + function () { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) + s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; + }; +Object.defineProperty(exports, '__esModule', { value: true }); +var component_1 = require('../common/component'); +var validator_1 = require('../common/validator'); +var shared_1 = require('../picker/shared'); +var currentYear = new Date().getFullYear(); +function isValidDate(date) { + return validator_1.isDef(date) && !isNaN(new Date(date).getTime()); +} +function range(num, min, max) { + return Math.min(Math.max(num, min), max); +} +function padZero(val) { + return ('00' + val).slice(-2); +} +function times(n, iteratee) { + var index = -1; + var result = Array(n < 0 ? 0 : n); + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} +function getTrueValue(formattedValue) { + if (formattedValue === undefined) { + formattedValue = '1'; + } + while (isNaN(parseInt(formattedValue, 10))) { + formattedValue = formattedValue.slice(1); + } + return parseInt(formattedValue, 10); +} +function getMonthEndDay(year, month) { + return 32 - new Date(year, month - 1, 32).getDate(); +} +var defaultFormatter = function (type, value) { + return value; +}; +component_1.VantComponent({ + classes: ['active-class', 'toolbar-class', 'column-class'], + props: __assign(__assign({}, shared_1.pickerProps), { + value: { + type: null, + observer: 'updateValue', + }, + filter: null, + type: { + type: String, + value: 'datetime', + observer: 'updateValue', + }, + showToolbar: { + type: Boolean, + value: true, + }, + formatter: { + type: null, + value: defaultFormatter, + }, + minDate: { + type: Number, + value: new Date(currentYear - 10, 0, 1).getTime(), + observer: 'updateValue', + }, + maxDate: { + type: Number, + value: new Date(currentYear + 10, 11, 31).getTime(), + observer: 'updateValue', + }, + minHour: { + type: Number, + value: 0, + observer: 'updateValue', + }, + maxHour: { + type: Number, + value: 23, + observer: 'updateValue', + }, + minMinute: { + type: Number, + value: 0, + observer: 'updateValue', + }, + maxMinute: { + type: Number, + value: 59, + observer: 'updateValue', + }, + }), + data: { + innerValue: Date.now(), + columns: [], + }, + methods: { + updateValue: function () { + var _this = this; + var data = this.data; + var val = this.correctValue(data.value); + var isEqual = val === data.innerValue; + if (!isEqual) { + this.updateColumnValue(val).then(function () { + _this.$emit('input', val); + }); + } else { + this.updateColumns(); + } + }, + getPicker: function () { + if (this.picker == null) { + this.picker = this.selectComponent('.van-datetime-picker'); + var picker_1 = this.picker; + var setColumnValues_1 = picker_1.setColumnValues; + picker_1.setColumnValues = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return setColumnValues_1.apply( + picker_1, + __spreadArrays(args, [false]) + ); + }; + } + return this.picker; + }, + updateColumns: function () { + var _a = this.data.formatter, + formatter = _a === void 0 ? defaultFormatter : _a; + var results = this.getOriginColumns().map(function (column) { + return { + values: column.values.map(function (value) { + return formatter(column.type, value); + }), + }; + }); + return this.set({ columns: results }); + }, + getOriginColumns: function () { + var filter = this.data.filter; + var results = this.getRanges().map(function (_a) { + var type = _a.type, + range = _a.range; + var values = times(range[1] - range[0] + 1, function (index) { + var value = range[0] + index; + value = type === 'year' ? '' + value : padZero(value); + return value; + }); + if (filter) { + values = filter(type, values); + } + return { type: type, values: values }; + }); + return results; + }, + getRanges: function () { + var data = this.data; + if (data.type === 'time') { + return [ + { + type: 'hour', + range: [data.minHour, data.maxHour], + }, + { + type: 'minute', + range: [data.minMinute, data.maxMinute], + }, + ]; + } + var _a = this.getBoundary('max', data.innerValue), + maxYear = _a.maxYear, + maxDate = _a.maxDate, + maxMonth = _a.maxMonth, + maxHour = _a.maxHour, + maxMinute = _a.maxMinute; + var _b = this.getBoundary('min', data.innerValue), + minYear = _b.minYear, + minDate = _b.minDate, + minMonth = _b.minMonth, + minHour = _b.minHour, + minMinute = _b.minMinute; + var result = [ + { + type: 'year', + range: [minYear, maxYear], + }, + { + type: 'month', + range: [minMonth, maxMonth], + }, + { + type: 'day', + range: [minDate, maxDate], + }, + { + type: 'hour', + range: [minHour, maxHour], + }, + { + type: 'minute', + range: [minMinute, maxMinute], + }, + ]; + if (data.type === 'date') result.splice(3, 2); + if (data.type === 'year-month') result.splice(2, 3); + return result; + }, + correctValue: function (value) { + var data = this.data; + // validate value + var isDateType = data.type !== 'time'; + if (isDateType && !isValidDate(value)) { + value = data.minDate; + } else if (!isDateType && !value) { + var minHour = data.minHour; + value = padZero(minHour) + ':00'; + } + // time type + if (!isDateType) { + var _a = value.split(':'), + hour = _a[0], + minute = _a[1]; + hour = padZero(range(hour, data.minHour, data.maxHour)); + minute = padZero(range(minute, data.minMinute, data.maxMinute)); + return hour + ':' + minute; + } + // date type + value = Math.max(value, data.minDate); + value = Math.min(value, data.maxDate); + return value; + }, + getBoundary: function (type, innerValue) { + var _a; + var value = new Date(innerValue); + var boundary = new Date(this.data[type + 'Date']); + var year = boundary.getFullYear(); + var month = 1; + var date = 1; + var hour = 0; + var minute = 0; + if (type === 'max') { + month = 12; + date = getMonthEndDay(value.getFullYear(), value.getMonth() + 1); + hour = 23; + minute = 59; + } + if (value.getFullYear() === year) { + month = boundary.getMonth() + 1; + if (value.getMonth() + 1 === month) { + date = boundary.getDate(); + if (value.getDate() === date) { + hour = boundary.getHours(); + if (value.getHours() === hour) { + minute = boundary.getMinutes(); + } + } + } + } + return ( + (_a = {}), + (_a[type + 'Year'] = year), + (_a[type + 'Month'] = month), + (_a[type + 'Date'] = date), + (_a[type + 'Hour'] = hour), + (_a[type + 'Minute'] = minute), + _a + ); + }, + onCancel: function () { + this.$emit('cancel'); + }, + onConfirm: function () { + this.$emit('confirm', this.data.innerValue); + }, + onChange: function () { + var _this = this; + var data = this.data; + var value; + var picker = this.getPicker(); + var originColumns = this.getOriginColumns(); + if (data.type === 'time') { + var indexes = picker.getIndexes(); + value = + +originColumns[0].values[indexes[0]] + + ':' + + +originColumns[1].values[indexes[1]]; + } else { + var indexes = picker.getIndexes(); + var values = indexes.map(function (value, index) { + return originColumns[index].values[value]; + }); + var year = getTrueValue(values[0]); + var month = getTrueValue(values[1]); + var maxDate = getMonthEndDay(year, month); + var date = getTrueValue(values[2]); + if (data.type === 'year-month') { + date = 1; + } + date = date > maxDate ? maxDate : date; + var hour = 0; + var minute = 0; + if (data.type === 'datetime') { + hour = getTrueValue(values[3]); + minute = getTrueValue(values[4]); + } + value = new Date(year, month - 1, date, hour, minute); + } + value = this.correctValue(value); + this.updateColumnValue(value).then(function () { + _this.$emit('input', value); + _this.$emit('change', picker); + }); + }, + updateColumnValue: function (value) { + var _this = this; + var values = []; + var type = this.data.type; + var formatter = this.data.formatter || defaultFormatter; + var picker = this.getPicker(); + if (type === 'time') { + var pair = value.split(':'); + values = [formatter('hour', pair[0]), formatter('minute', pair[1])]; + } else { + var date = new Date(value); + values = [ + formatter('year', '' + date.getFullYear()), + formatter('month', padZero(date.getMonth() + 1)), + ]; + if (type === 'date') { + values.push(formatter('day', padZero(date.getDate()))); + } + if (type === 'datetime') { + values.push( + formatter('day', padZero(date.getDate())), + formatter('hour', padZero(date.getHours())), + formatter('minute', padZero(date.getMinutes())) + ); + } + } + return this.set({ innerValue: value }) + .then(function () { + return _this.updateColumns(); + }) + .then(function () { + return picker.setValues(values); + }); + }, + }, + created: function () { + var _this = this; + var innerValue = this.correctValue(this.data.value); + this.updateColumnValue(innerValue).then(function () { + _this.$emit('input', innerValue); + }); + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/datetime-picker/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/datetime-picker/index.json new file mode 100644 index 0000000000000000000000000000000000000000..9176008a698d51dccffe6d7e89c018fcb3ea3a94 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/datetime-picker/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-picker": "../picker/index" + } +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/datetime-picker/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/datetime-picker/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..33659f2e902e0feabef6b14011ade4e3e4f2c17f --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/datetime-picker/index.wxml @@ -0,0 +1,16 @@ + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/datetime-picker/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/datetime-picker/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..99694d603361421fe8f1acfc76a09eae443cb3aa --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/datetime-picker/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss'; \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/definitions/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/definitions/index.js new file mode 100644 index 0000000000000000000000000000000000000000..ce03781e221944df94f81c1abe468aadc42e2599 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/definitions/index.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dialog/dialog.js b/src/openeuler/miniprogram_npm/@vant/weapp/dialog/dialog.js new file mode 100644 index 0000000000000000000000000000000000000000..64c5f5f378dd5136da2b89007a4049f2b89f3987 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/dialog/dialog.js @@ -0,0 +1,104 @@ +'use strict'; +var __assign = + (this && this.__assign) || + function () { + __assign = + Object.assign || + function (t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); + }; +Object.defineProperty(exports, '__esModule', { value: true }); +var queue = []; +var defaultOptions = { + show: false, + title: '', + width: null, + theme: 'default', + message: '', + zIndex: 100, + overlay: true, + selector: '#van-dialog', + className: '', + asyncClose: false, + beforeClose: null, + transition: 'scale', + customStyle: '', + messageAlign: '', + overlayStyle: '', + confirmButtonText: '确认', + cancelButtonText: '取消', + showConfirmButton: true, + showCancelButton: false, + closeOnClickOverlay: false, + confirmButtonOpenType: '', +}; +var currentOptions = __assign({}, defaultOptions); +function getContext() { + var pages = getCurrentPages(); + return pages[pages.length - 1]; +} +var Dialog = function (options) { + options = __assign(__assign({}, currentOptions), options); + return new Promise(function (resolve, reject) { + var context = options.context || getContext(); + var dialog = context.selectComponent(options.selector); + delete options.context; + delete options.selector; + if (dialog) { + dialog.setData( + __assign( + { + callback: function (action, instance) { + action === 'confirm' ? resolve(instance) : reject(instance); + }, + }, + options + ) + ); + wx.nextTick(function () { + dialog.setData({ show: true }); + }); + queue.push(dialog); + } else { + console.warn( + '未找到 van-dialog 节点,请确认 selector 及 context 是否正确' + ); + } + }); +}; +Dialog.alert = function (options) { + return Dialog(options); +}; +Dialog.confirm = function (options) { + return Dialog(__assign({ showCancelButton: true }, options)); +}; +Dialog.close = function () { + queue.forEach(function (dialog) { + dialog.close(); + }); + queue = []; +}; +Dialog.stopLoading = function () { + queue.forEach(function (dialog) { + dialog.stopLoading(); + }); +}; +Dialog.currentOptions = currentOptions; +Dialog.defaultOptions = defaultOptions; +Dialog.setDefaultOptions = function (options) { + currentOptions = __assign(__assign({}, currentOptions), options); + Dialog.currentOptions = currentOptions; +}; +Dialog.resetDefaultOptions = function () { + currentOptions = __assign({}, defaultOptions); + Dialog.currentOptions = currentOptions; +}; +Dialog.resetDefaultOptions(); +exports.default = Dialog; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.js new file mode 100644 index 0000000000000000000000000000000000000000..3f26daab9a67016555a9d863fe6f544f00044ffa --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.js @@ -0,0 +1,127 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var component_1 = require('../common/component'); +var button_1 = require('../mixins/button'); +var open_type_1 = require('../mixins/open-type'); +var color_1 = require('../common/color'); +var utils_1 = require('../common/utils'); +component_1.VantComponent({ + mixins: [button_1.button, open_type_1.openType], + props: { + show: { + type: Boolean, + observer: function (show) { + !show && this.stopLoading(); + }, + }, + title: String, + message: String, + theme: { + type: String, + value: 'default', + }, + useSlot: Boolean, + className: String, + customStyle: String, + asyncClose: Boolean, + messageAlign: String, + beforeClose: null, + overlayStyle: String, + useTitleSlot: Boolean, + showCancelButton: Boolean, + closeOnClickOverlay: Boolean, + confirmButtonOpenType: String, + width: null, + zIndex: { + type: Number, + value: 2000, + }, + confirmButtonText: { + type: String, + value: '确认', + }, + cancelButtonText: { + type: String, + value: '取消', + }, + confirmButtonColor: { + type: String, + value: color_1.RED, + }, + cancelButtonColor: { + type: String, + value: color_1.GRAY, + }, + showConfirmButton: { + type: Boolean, + value: true, + }, + overlay: { + type: Boolean, + value: true, + }, + transition: { + type: String, + value: 'scale', + }, + }, + data: { + loading: { + confirm: false, + cancel: false, + }, + callback: function () {}, + }, + methods: { + onConfirm: function () { + this.handleAction('confirm'); + }, + onCancel: function () { + this.handleAction('cancel'); + }, + onClickOverlay: function () { + this.close('overlay'); + }, + close: function (action) { + var _this = this; + this.setData({ show: false }); + wx.nextTick(function () { + _this.$emit('close', action); + var callback = _this.data.callback; + if (callback) { + callback(action, _this); + } + }); + }, + stopLoading: function () { + this.setData({ + loading: { + confirm: false, + cancel: false, + }, + }); + }, + handleAction: function (action) { + var _a; + var _this = this; + this.$emit(action, { dialog: this }); + var _b = this.data, + asyncClose = _b.asyncClose, + beforeClose = _b.beforeClose; + if (!asyncClose && !beforeClose) { + this.close(action); + return; + } + this.setData(((_a = {}), (_a['loading.' + action] = true), _a)); + if (beforeClose) { + utils_1.toPromise(beforeClose(action)).then(function (value) { + if (value) { + _this.close(action); + } else { + _this.stopLoading(); + } + }); + } + }, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.json new file mode 100644 index 0000000000000000000000000000000000000000..d45a906d16bae75c4cfbe25a6d9ae0406a3276cb --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.json @@ -0,0 +1,9 @@ +{ + "component": true, + "usingComponents": { + "van-popup": "../popup/index", + "van-button": "../button/index", + "van-goods-action": "../goods-action/index", + "van-goods-action-button": "../goods-action-button/index" + } +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..886d471018c8ee754d470747fa05fe265d885e3f --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.wxml @@ -0,0 +1,113 @@ + + + + + + {{ title }} + + + + + {{ message }} + + + + + {{ cancelButtonText }} + + + {{ confirmButtonText }} + + + + + + {{ cancelButtonText }} + + + {{ confirmButtonText }} + + + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..c6bac95745e625478d4203d82168e6e7f4f6bbf0 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/dialog/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-dialog{top:45%!important;overflow:hidden;width:320px;width:var(--dialog-width,320px);font-size:16px;font-size:var(--dialog-font-size,16px);border-radius:16px;border-radius:var(--dialog-border-radius,16px);background-color:#fff;background-color:var(--dialog-background-color,#fff)}@media (max-width:321px){.van-dialog{width:90%;width:var(--dialog-small-screen-width,90%)}}.van-dialog__header{text-align:center;padding-top:24px;padding-top:var(--dialog-header-padding-top,24px);font-weight:500;font-weight:var(--dialog-header-font-weight,500);line-height:24px;line-height:var(--dialog-header-line-height,24px)}.van-dialog__header--isolated{padding:24px 0;padding:var(--dialog-header-isolated-padding,24px 0)}.van-dialog__message{overflow-y:auto;text-align:center;-webkit-overflow-scrolling:touch;font-size:14px;font-size:var(--dialog-message-font-size,14px);line-height:20px;line-height:var(--dialog-message-line-height,20px);max-height:60vh;max-height:var(--dialog-message-max-height,60vh);padding:24px;padding:var(--dialog-message-padding,24px)}.van-dialog__message-text{word-wrap:break-word}.van-dialog__message--hasTitle{padding-top:8px;padding-top:var(--dialog-has-title-message-padding-top,8px);color:#646566;color:var(--dialog-has-title-message-text-color,#646566)}.van-dialog__message--round-button{padding-bottom:16px;color:#323233}.van-dialog__message--left{text-align:left}.van-dialog__message--right{text-align:right}.van-dialog__footer{display:-webkit-flex;display:flex}.van-dialog__footer--round-button{position:relative!important;padding:8px 24px 16px!important}.van-dialog__button{-webkit-flex:1;flex:1}.van-dialog__cancel,.van-dialog__confirm{border:0!important}.van-dialog-bounce-enter{-webkit-transform:translate3d(-50%,-50%,0) scale(.7);transform:translate3d(-50%,-50%,0) scale(.7);opacity:0}.van-dialog-bounce-leave-active{-webkit-transform:translate3d(-50%,-50%,0) scale(.9);transform:translate3d(-50%,-50%,0) scale(.9);opacity:0} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.js new file mode 100644 index 0000000000000000000000000000000000000000..d039925e878270342cbde27d534f232c4afdd604 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.js @@ -0,0 +1,14 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var component_1 = require('../common/component'); +component_1.VantComponent({ + props: { + dashed: Boolean, + hairline: Boolean, + contentPosition: String, + fontSize: String, + borderColor: String, + textColor: String, + customStyle: String, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.json new file mode 100644 index 0000000000000000000000000000000000000000..f71941163b8dc6bf6ccd68ed33b662fdf6c9b725 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..45e267e213b7e02ed6981a553f36658116877fb5 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.wxml @@ -0,0 +1,9 @@ + + + + + + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.wxs b/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.wxs new file mode 100644 index 0000000000000000000000000000000000000000..6ecf3c4722e5c4b3c115b4f8df2bb8c0e2badc20 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.wxs @@ -0,0 +1,18 @@ +/* eslint-disable */ +var style = require('../wxs/style.wxs'); +var addUnit = require('../wxs/add-unit.wxs'); + +function rootStyle(data) { + return style([ + { + 'border-color': data.borderColor, + color: data.textColor, + 'font-size': addUnit(data.fontSize), + }, + data.customStyle, + ]); +} + +module.exports = { + rootStyle: rootStyle, +}; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..c055e3af96b3f03d78fefbcc8405efa234bcc84b --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/divider/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-divider{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;margin:16px 0;margin:var(--divider-margin,16px 0);color:#969799;color:var(--divider-text-color,#969799);font-size:14px;font-size:var(--divider-font-size,14px);line-height:24px;line-height:var(--divider-line-height,24px);border:0 solid #ebedf0;border-color:var(--divider-border-color,#ebedf0)}.van-divider:after,.van-divider:before{display:block;-webkit-flex:1;flex:1;box-sizing:border-box;height:1px;border-color:inherit;border-style:inherit;border-width:1px 0 0}.van-divider:before{content:""}.van-divider--hairline:after,.van-divider--hairline:before{-webkit-transform:scaleY(.5);transform:scaleY(.5)}.van-divider--dashed{border-style:dashed}.van-divider--center:before,.van-divider--left:before,.van-divider--right:before{margin-right:16px;margin-right:var(--divider-content-padding,16px)}.van-divider--center:after,.van-divider--left:after,.van-divider--right:after{content:"";margin-left:16px;margin-left:var(--divider-content-padding,16px)}.van-divider--left:before{max-width:10%;max-width:var(--divider-content-left-width,10%)}.van-divider--right:after{max-width:10%;max-width:var(--divider-content-right-width,10%)} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.js new file mode 100644 index 0000000000000000000000000000000000000000..b97d1d9c8af7a18168774563b53062a7084dc5b6 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.js @@ -0,0 +1,117 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var relation_1 = require('../common/relation'); +var component_1 = require('../common/component'); +component_1.VantComponent({ + field: true, + relation: relation_1.useParent('dropdown-menu', function () { + this.updateDataFromParent(); + }), + props: { + value: { + type: null, + observer: 'rerender', + }, + title: { + type: String, + observer: 'rerender', + }, + disabled: Boolean, + titleClass: { + type: String, + observer: 'rerender', + }, + options: { + type: Array, + value: [], + observer: 'rerender', + }, + popupStyle: String, + }, + data: { + transition: true, + showPopup: false, + showWrapper: false, + displayTitle: '', + }, + methods: { + rerender: function () { + var _this = this; + wx.nextTick(function () { + var _a; + (_a = _this.parent) === null || _a === void 0 + ? void 0 + : _a.updateItemListData(); + }); + }, + updateDataFromParent: function () { + if (this.parent) { + var _a = this.parent.data, + overlay = _a.overlay, + duration = _a.duration, + activeColor = _a.activeColor, + closeOnClickOverlay = _a.closeOnClickOverlay, + direction = _a.direction; + this.setData({ + overlay: overlay, + duration: duration, + activeColor: activeColor, + closeOnClickOverlay: closeOnClickOverlay, + direction: direction, + }); + } + }, + onOpen: function () { + this.$emit('open'); + }, + onOpened: function () { + this.$emit('opened'); + }, + onClose: function () { + this.$emit('close'); + }, + onClosed: function () { + this.$emit('closed'); + this.setData({ showWrapper: false }); + }, + onOptionTap: function (event) { + var option = event.currentTarget.dataset.option; + var value = option.value; + var shouldEmitChange = this.data.value !== value; + this.setData({ showPopup: false, value: value }); + this.$emit('close'); + this.rerender(); + if (shouldEmitChange) { + this.$emit('change', value); + } + }, + toggle: function (show, options) { + var _this = this; + var _a; + if (options === void 0) { + options = {}; + } + var showPopup = this.data.showPopup; + if (typeof show !== 'boolean') { + show = !showPopup; + } + if (show === showPopup) { + return; + } + this.setData({ + transition: !options.immediate, + showPopup: show, + }); + if (show) { + (_a = this.parent) === null || _a === void 0 + ? void 0 + : _a.getChildWrapperStyle().then(function (wrapperStyle) { + _this.setData({ wrapperStyle: wrapperStyle, showWrapper: true }); + _this.rerender(); + }); + } else { + this.rerender(); + } + }, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.json new file mode 100644 index 0000000000000000000000000000000000000000..b30d74be9bb3648d9710fd814ad7058e9c4b09d1 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.json @@ -0,0 +1,8 @@ +{ + "component": true, + "usingComponents": { + "van-popup": "../popup/index", + "van-cell": "../cell/index", + "van-icon": "../icon/index" + } +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..f09727670adf14a988e9c92b36af22c2ebaa1495 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.wxml @@ -0,0 +1,48 @@ + + + + + + + {{ item.text }} + + + + + + + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..7cab3f28a7de958bc08be86cb2012f7a2076eb3e --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-dropdown-item{position:fixed;right:0;left:0;overflow:hidden}.van-dropdown-item__option{text-align:left}.van-dropdown-item__option--active .van-dropdown-item__icon,.van-dropdown-item__option--active .van-dropdown-item__title{color:#ee0a24;color:var(--dropdown-menu-option-active-color,#ee0a24)}.van-dropdown-item--up{top:0}.van-dropdown-item--down{bottom:0}.van-dropdown-item__icon{display:block;line-height:inherit} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/shared.js b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/shared.js new file mode 100644 index 0000000000000000000000000000000000000000..b02af38ed8e9883ec026b8a465e4eb3b069ba683 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-item/shared.js @@ -0,0 +1,2 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.js new file mode 100644 index 0000000000000000000000000000000000000000..98c9eb56bda878aa90530ff28b238273bb11ab62 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.js @@ -0,0 +1,126 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var component_1 = require('../common/component'); +var relation_1 = require('../common/relation'); +var utils_1 = require('../common/utils'); +var ARRAY = []; +component_1.VantComponent({ + field: true, + relation: relation_1.useChildren('dropdown-item', function () { + this.updateItemListData(); + }), + props: { + activeColor: { + type: String, + observer: 'updateChildrenData', + }, + overlay: { + type: Boolean, + value: true, + observer: 'updateChildrenData', + }, + zIndex: { + type: Number, + value: 10, + }, + duration: { + type: Number, + value: 200, + observer: 'updateChildrenData', + }, + direction: { + type: String, + value: 'down', + observer: 'updateChildrenData', + }, + closeOnClickOverlay: { + type: Boolean, + value: true, + observer: 'updateChildrenData', + }, + closeOnClickOutside: { + type: Boolean, + value: true, + }, + }, + data: { + itemListData: [], + }, + beforeCreate: function () { + var windowHeight = utils_1.getSystemInfoSync().windowHeight; + this.windowHeight = windowHeight; + ARRAY.push(this); + }, + destroyed: function () { + var _this = this; + ARRAY = ARRAY.filter(function (item) { + return item !== _this; + }); + }, + methods: { + updateItemListData: function () { + this.setData({ + itemListData: this.children.map(function (child) { + return child.data; + }), + }); + }, + updateChildrenData: function () { + this.children.forEach(function (child) { + child.updateDataFromParent(); + }); + }, + toggleItem: function (active) { + this.children.forEach(function (item, index) { + var showPopup = item.data.showPopup; + if (index === active) { + item.toggle(); + } else if (showPopup) { + item.toggle(false, { immediate: true }); + } + }); + }, + close: function () { + this.children.forEach(function (child) { + child.toggle(false, { immediate: true }); + }); + }, + getChildWrapperStyle: function () { + var _this = this; + var _a = this.data, + zIndex = _a.zIndex, + direction = _a.direction; + return utils_1.getRect(this, '.van-dropdown-menu').then(function (rect) { + var _a = rect.top, + top = _a === void 0 ? 0 : _a, + _b = rect.bottom, + bottom = _b === void 0 ? 0 : _b; + var offset = direction === 'down' ? bottom : _this.windowHeight - top; + var wrapperStyle = 'z-index: ' + zIndex + ';'; + if (direction === 'down') { + wrapperStyle += 'top: ' + utils_1.addUnit(offset) + ';'; + } else { + wrapperStyle += 'bottom: ' + utils_1.addUnit(offset) + ';'; + } + return wrapperStyle; + }); + }, + onTitleTap: function (event) { + var _this = this; + var index = event.currentTarget.dataset.index; + var child = this.children[index]; + if (!child.data.disabled) { + ARRAY.forEach(function (menuItem) { + if ( + menuItem && + menuItem.data.closeOnClickOutside && + menuItem !== _this + ) { + menuItem.close(); + } + }); + this.toggleItem(index); + } + }, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.json new file mode 100644 index 0000000000000000000000000000000000000000..efdc3c823a323c17832b921a6bccbcd398609183 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..2d3451fc06e8f2000393453ee3fce944a50e134f --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxml @@ -0,0 +1,23 @@ + + + + + + + + {{ computed.displayTitle(item) }} + + + + + + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxs b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxs new file mode 100644 index 0000000000000000000000000000000000000000..ffa262f144e3191b7f2d6aaf5c0d9b68636ca298 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxs @@ -0,0 +1,16 @@ +/* eslint-disable */ +function displayTitle(item) { + if (item.title) { + return item.title; + } + + var match = item.options.filter(function(option) { + return option.value === item.value; + }); + var displayTitle = match.length ? match[0].text : ''; + return displayTitle; +} + +module.exports = { + displayTitle: displayTitle +}; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..ec6caff634f767b19e169b2a74d8434bb512fa48 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-dropdown-menu{display:-webkit-flex;display:flex;box-shadow:0 2px 12px rgba(100,101,102,.12);-webkit-user-select:none;user-select:none;height:50px;height:var(--dropdown-menu-height,50px);background-color:#fff;background-color:var(--dropdown-menu-background-color,#fff)}.van-dropdown-menu__item{display:-webkit-flex;display:flex;-webkit-flex:1;flex:1;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;min-width:0}.van-dropdown-menu__item:active{opacity:.7}.van-dropdown-menu__item--disabled:active{opacity:1}.van-dropdown-menu__item--disabled .van-dropdown-menu__title{color:#969799;color:var(--dropdown-menu-title-disabled-text-color,#969799)}.van-dropdown-menu__title{position:relative;box-sizing:border-box;max-width:100%;padding:0 8px;padding:var(--dropdown-menu-title-padding,0 8px);color:#323233;color:var(--dropdown-menu-title-text-color,#323233);font-size:15px;font-size:var(--dropdown-menu-title-font-size,15px);line-height:18px;line-height:var(--dropdown-menu-title-line-height,18px)}.van-dropdown-menu__title:after{position:absolute;top:50%;right:-4px;margin-top:-5px;border-color:transparent transparent currentcolor currentcolor;border-style:solid;border-width:3px;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);opacity:.8;content:""}.van-dropdown-menu__title--active{color:#ee0a24;color:var(--dropdown-menu-title-active-text-color,#ee0a24)}.van-dropdown-menu__title--down:after{margin-top:-1px;-webkit-transform:rotate(135deg);transform:rotate(135deg)} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.js new file mode 100644 index 0000000000000000000000000000000000000000..fa0bac93e10634aedbe308461298dd7ede08705c --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.js @@ -0,0 +1,12 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var component_1 = require('../common/component'); +component_1.VantComponent({ + props: { + description: String, + image: { + type: String, + value: 'default', + }, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.json new file mode 100644 index 0000000000000000000000000000000000000000..011372eb4664a095246f98b09f2373710d11a4d7 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..75f6788e4cd5b85e923811514f95ffe35195832d --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.wxml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + {{ description }} + + + + + + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.wxs b/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.wxs new file mode 100644 index 0000000000000000000000000000000000000000..b7089d665f2b44b35a1d8ade9fb4c4e037c07aa7 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.wxs @@ -0,0 +1,14 @@ +/* eslint-disable */ +var PRESETS = ['error', 'search', 'default', 'network']; + +function imageUrl(image) { + if (PRESETS.indexOf(image) !== -1) { + return 'https://img.yzcdn.cn/vant/empty-image-' + image + '.png'; + } + + return image; +} + +module.exports = { + imageUrl: imageUrl, +}; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..aeb9d4b1506b5b2f37a288b8d5f41e6d209dbb92 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/empty/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-empty{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;padding:32px 0}.van-empty__image{width:160px;height:160px}.van-empty__image:empty{display:none}.van-empty__image__img{width:100%;height:100%}.van-empty__image:not(:empty)+.van-empty__image{display:none}.van-empty__description{margin-top:16px;padding:0 60px;color:#969799;font-size:14px;line-height:20px}.van-empty__description:empty,.van-empty__description:not(:empty)+.van-empty__description{display:none}.van-empty__bottom{margin-top:24px} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/field/index.js b/src/openeuler/miniprogram_npm/@vant/weapp/field/index.js new file mode 100644 index 0000000000000000000000000000000000000000..b2ea182357219d7860b3074241eae313f4b149f8 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/field/index.js @@ -0,0 +1,151 @@ +'use strict'; +var __assign = + (this && this.__assign) || + function () { + __assign = + Object.assign || + function (t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); + }; +Object.defineProperty(exports, '__esModule', { value: true }); +var utils_1 = require('../common/utils'); +var component_1 = require('../common/component'); +var props_1 = require('./props'); +component_1.VantComponent({ + field: true, + classes: ['input-class', 'right-icon-class', 'label-class'], + props: __assign( + __assign( + __assign(__assign({}, props_1.commonProps), props_1.inputProps), + props_1.textareaProps + ), + { + size: String, + icon: String, + label: String, + error: Boolean, + center: Boolean, + isLink: Boolean, + leftIcon: String, + rightIcon: String, + autosize: null, + required: Boolean, + iconClass: String, + clickable: Boolean, + inputAlign: String, + customStyle: String, + errorMessage: String, + arrowDirection: String, + showWordLimit: Boolean, + errorMessageAlign: String, + readonly: { + type: Boolean, + observer: 'setShowClear', + }, + clearable: { + type: Boolean, + observer: 'setShowClear', + }, + border: { + type: Boolean, + value: true, + }, + titleWidth: { + type: String, + value: '6.2em', + }, + } + ), + data: { + focused: false, + innerValue: '', + showClear: false, + }, + created: function () { + this.value = this.data.value; + this.setData({ innerValue: this.value }); + }, + methods: { + onInput: function (event) { + var _a = (event.detail || {}).value, + value = _a === void 0 ? '' : _a; + this.value = value; + this.setShowClear(); + this.emitChange(); + }, + onFocus: function (event) { + this.focused = true; + this.setShowClear(); + this.$emit('focus', event.detail); + }, + onBlur: function (event) { + this.focused = false; + this.setShowClear(); + this.$emit('blur', event.detail); + }, + onClickIcon: function () { + this.$emit('click-icon'); + }, + onClickInput: function (event) { + this.$emit('click-input', event.detail); + }, + onClear: function () { + var _this = this; + this.setData({ innerValue: '' }); + this.value = ''; + this.setShowClear(); + utils_1.nextTick(function () { + _this.emitChange(); + _this.$emit('clear', ''); + }); + }, + onConfirm: function (event) { + var _a = (event.detail || {}).value, + value = _a === void 0 ? '' : _a; + this.value = value; + this.setShowClear(); + this.$emit('confirm', value); + }, + setValue: function (value) { + this.value = value; + this.setShowClear(); + if (value === '') { + this.setData({ innerValue: '' }); + } + this.emitChange(); + }, + onLineChange: function (event) { + this.$emit('linechange', event.detail); + }, + onKeyboardHeightChange: function (event) { + this.$emit('keyboardheightchange', event.detail); + }, + emitChange: function () { + var _this = this; + this.setData({ value: this.value }); + utils_1.nextTick(function () { + _this.$emit('input', _this.value); + _this.$emit('change', _this.value); + }); + }, + setShowClear: function () { + var _a = this.data, + clearable = _a.clearable, + readonly = _a.readonly; + var _b = this, + focused = _b.focused, + value = _b.value; + this.setData({ + showClear: !!clearable && !!focused && !!value && !readonly, + }); + }, + noop: function () {}, + }, +}); diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/field/index.json b/src/openeuler/miniprogram_npm/@vant/weapp/field/index.json new file mode 100644 index 0000000000000000000000000000000000000000..2c5d25e5a9fce2ef87ff76d00cb10b109a200aac --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/field/index.json @@ -0,0 +1,7 @@ +{ + "component": true, + "usingComponents": { + "van-cell": "../cell/index", + "van-icon": "../icon/index" + } +} diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/field/index.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/field/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..d40e8506011205e7ef6e1e0c7506b44215c17811 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/field/index.wxml @@ -0,0 +1,56 @@ + + + + + + + {{ label }} + + + + + + + + + + + + + + + + + + + + + {{ value.length >= maxlength ? maxlength : value.length }}/{{ maxlength }} + + + {{ errorMessage }} + + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/field/index.wxs b/src/openeuler/miniprogram_npm/@vant/weapp/field/index.wxs new file mode 100644 index 0000000000000000000000000000000000000000..6b90dd2c9a5bea346ef94b64fe2d02746f6c8bac --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/field/index.wxs @@ -0,0 +1,18 @@ +/* eslint-disable */ +var style = require('../wxs/style.wxs'); +var addUnit = require('../wxs/add-unit.wxs'); + +function inputStyle(autosize) { + if (autosize && autosize.constructor === 'Object') { + return style({ + 'min-height': addUnit(autosize.minHeight), + 'max-height': addUnit(autosize.maxHeight), + }); + } + + return ''; +} + +module.exports = { + inputStyle: inputStyle, +}; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/field/index.wxss b/src/openeuler/miniprogram_npm/@vant/weapp/field/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..171f6133ee799d41f6454361fa4b9a37674cc70b --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/field/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-field{--cell-icon-size:16px;--cell-icon-size:var(--field-icon-size,16px)}.van-field__label{color:#646566;color:var(--field-label-color,#646566)}.van-field__label--disabled{color:#c8c9cc;color:var(--field-disabled-text-color,#c8c9cc)}.van-field__body{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center}.van-field__body--textarea{box-sizing:border-box;padding:3.6px 0;line-height:1.2em;min-height:24px;min-height:var(--cell-line-height,24px)}.van-field__control:empty+.van-field__control{display:block}.van-field__control{position:relative;display:none;box-sizing:border-box;width:100%;margin:0;padding:0;line-height:inherit;text-align:left;background-color:initial;border:0;resize:none;color:#323233;color:var(--field-input-text-color,#323233);height:24px;height:var(--cell-line-height,24px);min-height:24px;min-height:var(--cell-line-height,24px)}.van-field__control:empty{display:none}.van-field__control--textarea{height:18px;height:var(--field-text-area-min-height,18px);min-height:18px;min-height:var(--field-text-area-min-height,18px)}.van-field__control--error{color:#ee0a24;color:var(--field-input-error-text-color,#ee0a24)}.van-field__control--disabled{background-color:initial;opacity:1;color:#c8c9cc;color:var(--field-input-disabled-text-color,#c8c9cc)}.van-field__control--center{text-align:center}.van-field__control--right{text-align:right}.van-field__control--custom{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;min-height:24px;min-height:var(--cell-line-height,24px)}.van-field__placeholder{position:absolute;top:0;right:0;left:0;pointer-events:none;color:#c8c9cc;color:var(--field-placeholder-text-color,#c8c9cc)}.van-field__placeholder--error{color:#ee0a24;color:var(--field-error-message-color,#ee0a24)}.van-field__icon-root{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;min-height:24px;min-height:var(--cell-line-height,24px)}.van-field__clear-root,.van-field__icon-container{line-height:inherit;vertical-align:middle;padding:0 8px;padding:0 var(--padding-xs,8px);margin-right:-8px;margin-right:-var(--padding-xs,8px)}.van-field__button,.van-field__clear-root,.van-field__icon-container{-webkit-flex-shrink:0;flex-shrink:0}.van-field__clear-root{font-size:16px;font-size:var(--field-clear-icon-size,16px);color:#c8c9cc;color:var(--field-clear-icon-color,#c8c9cc)}.van-field__icon-container{font-size:16px;font-size:var(--field-icon-size,16px);color:#969799;color:var(--field-icon-container-color,#969799)}.van-field__icon-container:empty{display:none}.van-field__button{padding-left:8px;padding-left:var(--padding-xs,8px)}.van-field__button:empty{display:none}.van-field__error-message{text-align:left;font-size:12px;font-size:var(--field-error-message-text-font-size,12px);color:#ee0a24;color:var(--field-error-message-color,#ee0a24)}.van-field__error-message--center{text-align:center}.van-field__error-message--right{text-align:right}.van-field__word-limit{text-align:right;margin-top:4px;margin-top:var(--padding-base,4px);color:#646566;color:var(--field-word-limit-color,#646566);font-size:12px;font-size:var(--field-word-limit-font-size,12px);line-height:16px;line-height:var(--field-word-limit-line-height,16px)}.van-field__word-num{display:inline}.van-field__word-num--full{color:#ee0a24;color:var(--field-word-num-full-color,#ee0a24)} \ No newline at end of file diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/field/input.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/field/input.wxml new file mode 100644 index 0000000000000000000000000000000000000000..06680df7406afe1e50e2799f62c0874165a91b80 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/field/input.wxml @@ -0,0 +1,27 @@ + diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/field/props.js b/src/openeuler/miniprogram_npm/@vant/weapp/field/props.js new file mode 100644 index 0000000000000000000000000000000000000000..6de6d6cc655e476f9c0f26a9ff08436911da3aca --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/field/props.js @@ -0,0 +1,66 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +exports.textareaProps = exports.inputProps = exports.commonProps = void 0; +exports.commonProps = { + value: { + type: String, + observer: function (value) { + if (value !== this.value) { + this.setData({ innerValue: value }); + this.value = value; + } + }, + }, + placeholder: String, + placeholderStyle: String, + placeholderClass: String, + disabled: Boolean, + maxlength: { + type: Number, + value: -1, + }, + cursorSpacing: { + type: Number, + value: 50, + }, + autoFocus: Boolean, + focus: Boolean, + cursor: { + type: Number, + value: -1, + }, + selectionStart: { + type: Number, + value: -1, + }, + selectionEnd: { + type: Number, + value: -1, + }, + adjustPosition: { + type: Boolean, + value: true, + }, + holdKeyboard: Boolean, +}; +exports.inputProps = { + type: { + type: String, + value: 'text', + }, + password: Boolean, + confirmType: String, + confirmHold: Boolean, +}; +exports.textareaProps = { + autoHeight: Boolean, + fixed: Boolean, + showConfirmBar: { + type: Boolean, + value: true, + }, + disableDefaultPadding: { + type: Boolean, + value: true, + }, +}; diff --git a/src/openeuler/miniprogram_npm/@vant/weapp/field/textarea.wxml b/src/openeuler/miniprogram_npm/@vant/weapp/field/textarea.wxml new file mode 100644 index 0000000000000000000000000000000000000000..cceecb4b55a5b0652993f1b4c623f32c7d369182 --- /dev/null +++ b/src/openeuler/miniprogram_npm/@vant/weapp/field/textarea.wxml @@ -0,0 +1,29 @@ + + +
+ + + + 议题 {{index+1}} + 日程 + + + + + + + + 时间 + * + + + {{item.start||'请选择'}} + + {{item.end||'请选择'}} + + + + + 议题 + * + + + + + + Speaker {{index1+1}} + + + + + + + Name + * + + + + + Title + + + + + Mail + * + + Mail + + + + + + 继续添加Speaker + + + + + 继续添加日程 + + + 海报主题 + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + * + 号为必填项 + + + + + 点击 【保存草稿】 后,您可以在“我的 > 我的活动 > 草稿箱”中查看此活动,并继续编辑 + + + + 点击 【申请发布】 后,你的活动将进入发布阶段,正式发布后,您仅能修改活动日程 + + + + + + + + + + + + + + 选择所属SIG + + + + + {{item.group_name}} + + + + + + + + + + + + + 选择活动日期 + + + + + + + + + + 选择日程开始时间 + + + + + + + + + + 选择日程结束时间 + + + + + + + +
\ No newline at end of file diff --git a/src/openeuler/package-events/publish/publish.wxss b/src/openeuler/package-events/publish/publish.wxss new file mode 100644 index 0000000000000000000000000000000000000000..475b6191dafd87292c6a437f6704a663985cfcbb --- /dev/null +++ b/src/openeuler/package-events/publish/publish.wxss @@ -0,0 +1,414 @@ +/* package-events/publish/publish.wxss */ +page { + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHwAAAAeCAYAAADuInrvAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACdSURBVGhD7dbBDYAwDAPAbsTYjFnEDn5YyT34WinWpT3nea9v0T9Q9qKyf9wKV7gVP/maI5xwwglfpkDhCh9z9Y05yGSVybMpfNn2UrjCvdKTK7Qti3DCCW9TmZyHcMIJT4pqyyKccMLbVCbnIZxwwpOi2rIIJ5zwNpXJeQgnnPCkqLYswgknvE1lch7CCSc8Kaoti3DCCW9TGZznA1f9oK8GgBpHAAAAAElFTkSuQmCC) no-repeat; + background-size: 100% 108rpx; + background-color: #f5f7fa !important; + padding: 0 30rpx; +} + +.container { + padding: 30rpx 0 129rpx 0; +} + +textarea { + height: 45rpx; + flex: 1; +} + +input { + flex: 1; +} + +.require { + color: #f76270; +} + +.blue { + color: #002fa7; +} + +.gray { + color: #c7cad0; +} + +.placeholder { + color: #c7cad0; +} + +.radio-class { + font-size: 28rpx; +} + +.van-radio { + margin-right: 10rpx !important; +} + +.van-radio__label { + margin-left: 5rpx !important; +} + +.container .form .form-item { + padding: 0 30rpx; + background-color: #fff; + height: 108rpx; + color: #333; + font-size: 28rpx; + display: flex; + align-items: center; + justify-content: start; + border-bottom: 2rpx solid #f0f3f7; +} + +.container .form > .form-item { + box-shadow: 0rpx 5rpx 15rpx 0rpx rgba(0, 47, 167, 0.1); + border-radius: 8rpx; +} + +.container .form .form-wrapper { + box-shadow: 0rpx 5rpx 15rpx 0rpx rgba(0, 47, 167, 0.1); + border-radius: 8rpx; + background-color: #fff; + overflow: hidden; +} + +.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; +} + +.container .form .form-item .sel-time { + flex: 1; + color: #333; + display: flex; + align-items: center; + justify-content: start; +} + +.container .form .form-item .sel-time .time { + color: #6d7278; + margin: 0 20rpx; + border: 1px solid #c7cad0; + background-color: #f0f3f7; + padding: 0 20rpx; + border-radius: 8rpx; +} + +.container .form .form-item .sel-time .start-time { + margin-left: 0; +} + +.container .form .form-item .label { + margin-right: 40rpx; + font-size: 34rpx; +} + +.container .form .form-item input { + color: #6d7278; +} + +.container .form .form-item .etherpad { + display: block; + color: #6d7278; + overflow-x: scroll; + flex: 1; +} + +.container .form .form-item textarea { + color: #6d7278; +} + +.container .form .form-item image { + width: 30rpx; + height: 30rpx; +} + +.container .form .meeting-desc { + margin-top: 20rpx; + padding-top: 30rpx; + align-items: flex-start; + height: 244rpx; +} + +.container .form .meeting-desc textarea { + height: 184rpx; + position: relative; +} + +.container .form .meeting-desc textarea .hint { + position: absolute; + right: 0; + bottom: 0; + color: #c7cad0; + font-size: 28rpx; +} + +.container .info { + font-size: 29rpx; + color: #6d7278; + margin-bottom: 60rpx; +} + +.container .info view { + margin: 30rpx 0; +} + +.container .info-online { + margin-bottom: 0; +} + +.container .info view image { + width: 28rpx; + height: 28rpx; + margin-right: 15rpx; + vertical-align: middle; +} + +.container .commit { + display: flex; + justify-content: space-between; + height: 90rpx; + font-size: 36rpx; +} + +.container .commit button { + width: 210rpx; + text-align: center; + line-height: 90rpx; + height: 100%; + border-radius: 8rpx; + padding: 0; +} + +.container .type5 button { + width: 330rpx; +} + +.container .commit .meeting-btn { + color: #fff; + background-color: #002fa7; +} + +.container .commit .meeting-reset { + color: #002fa7; + background-color: #fff; + border: 1px solid #002fa7; +} + +.container .sig-pop-wrapper { + padding: 0 30rpx; +} + +.container .sig-pop-wrapper .title { + margin: 30rpx 0 40rpx 0; + color: #222; + font-size: 36rpx; +} + +.container .sig-pop-wrapper .item .radio { + flex-direction: row-reverse; + justify-content: space-between; +} + +.container .sig-pop-wrapper .item .name { + font-size: 34rpx; + color: #6d7278; + width: 600rpx; +} + +.container .sig-pop-wrapper .item { + height: 108rpx; + display: flex; + align-items: center; + border-bottom: 1px solid #f0f3f7; +} + +.container .sig-pop-wrapper .item:last-child { + border: none; +} + +.container .sig-pop-wrapper .btn-wrapper { + display: flex; + align-items: center; + justify-content: space-between; + height: 90rpx; + font-size: 36rpx; + margin: 60rpx 0; +} + +.container .sig-pop-wrapper .btn-wrapper .confirm { + height: 100%; + width: 320rpx; + text-align: center; + line-height: 90rpx; + color: #fff; + background-color: #002fa7; +} + +.container .sig-pop-wrapper .btn-wrapper .cancel { + height: 100%; + width: 320rpx; + text-align: center; + line-height: 90rpx; + color: #002fa7; + background-color: #fff; + border: 1px solid #002fa7; +} + +.container .form .schedule { + margin-top: 20rpx; + border: 2rpx dashed #3265e8; +} + +.container .form .schedule .form-item { + padding: 0 60rpx !important; +} + +.container .form .schedule .speaker-del-wrapper { + justify-content: space-between; +} + +.container .form .schedule .speaker-del-wrapper .del-btn image { + width: 30rpx; + height: 30rpx; +} + +.container .form .schedule .form-item .label { + font-size: 30rpx; + color: #6d7278; +} + +.container .form .schedule .header { + display: flex; + justify-content: space-between; + margin-top: 30rpx; +} + +.container .form .schedule .header .left .icon { + padding: 0 12rpx; + height: 26rpx; + background-color: #3265e8; + color: #fff; + border-radius: 0 26rpx 26rpx 0; + margin-right: 20rpx; + font-size: 25rpx; +} + +.container .form .schedule .header .left .title { + font-size: 34rpx; + line-height: 48rpx; + color: #333; +} + +.container .form .schedule .header .del-btn { + margin-right: 34rpx; +} + +.container .form .schedule .header .del-btn image { + height: 40rpx; + width: 40rpx; +} + +.container .form .add-shedule { + height: 108rpx; + line-height: 108rpx; + text-align: center; + border: 2rpx dashed #3265e8; + box-shadow: 0rpx 5rpx 15rpx 0rpx rgba(0, 47, 167, 0.1); + border-radius: 8rpx; + color: #6d7278; + background-color: #fff; + margin-top: 20rpx; +} + +.container .form .topic { + margin-top: 20rpx; + padding: 30rpx; + box-shadow: 0rpx 5rpx 15rpx 0rpx rgba(0, 47, 167, 0.1); + border-radius: 8rpx; + background-color: #fff; + font-size: 34rpx; + color: #333; +} + +.container .form .topic .header { + margin-bottom: 30rpx; +} + +.container .form .topic .img-wrapper { + margin-bottom: 30rpx; + display: flex; + justify-content: space-between; +} + +.container .form .topic .mb0 { + margin-bottom: 0; +} + +.container .form .topic .img-wrapper view { + width: 300rpx; + height: 150rpx; + border-radius: 8rpx; + overflow: hidden; + position: relative; +} + +.container .form .topic .img-wrapper view .sel { + position: absolute; + top: 14rpx; + left: 14rpx; + width: 40rpx; + height: 40rpx; +} + +.container .form .topic .img-wrapper view .img { + width: 300rpx; + height: 150rpx; +} + +.container .relative { + position: relative; +} + +.container .mask { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: #000; + opacity: 0.2; + z-index: 1000; +} + +.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 .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; +} \ No newline at end of file diff --git a/src/openeuler/package-events/publish/success.js b/src/openeuler/package-events/publish/success.js new file mode 100644 index 0000000000000000000000000000000000000000..38f4ecd460eba4a0b1a62add64523985c249a923 --- /dev/null +++ b/src/openeuler/package-events/publish/success.js @@ -0,0 +1,42 @@ +// package-events/publish/success.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + type: 1, + typeCn: '', + typeDesc: '' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + if (options.type == 1) { + this.setData({ + type: 1, + typeCn: '保存', + typeDesc: '您可以在“我的 > 我的活动 > 草稿箱”查看此活动并继续修改内容' + }) + } else if(options.type == 2) { + this.setData({ + type: 2, + typeCn: '申请', + typeDesc: '审核通过后您的活动将在openEuler官网和小程序上发布,请耐心等待,您可以在“我的 > 我的活动 > 发布中”查看此活动' + }) + } else if(options.type == 3) { + this.setData({ + type: 2, + typeCn: '修改', + typeDesc: '您可以在“我的 > 我的活动 > 已发布”查看此活动并继续修改日程' + }) + } + }, + toList() { + wx.switchTab({ + url: '/pages/events/events' + }) + } +}) \ No newline at end of file diff --git a/src/openeuler/package-events/publish/success.json b/src/openeuler/package-events/publish/success.json new file mode 100644 index 0000000000000000000000000000000000000000..e6aee5ddb43a864944f5ee94cd624890c055a864 --- /dev/null +++ b/src/openeuler/package-events/publish/success.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "活动申请" +} \ No newline at end of file diff --git a/src/mindspore/package-events/sign-up/save-success.wxml b/src/openeuler/package-events/publish/success.wxml similarity index 40% rename from src/mindspore/package-events/sign-up/save-success.wxml rename to src/openeuler/package-events/publish/success.wxml index 80938f9a8a95208ea79ace502d839a04be5f5622..a914b106ff106e798d029730379b472dcf9f3d95 100644 --- a/src/mindspore/package-events/sign-up/save-success.wxml +++ b/src/openeuler/package-events/publish/success.wxml @@ -1,8 +1,9 @@ - - - - 保存成功 - 快去相册看看吧! - - - + + + + + {{typeCn}}成功! + {{typeDesc}} + + + diff --git a/src/mindspore/package-events/sign-up/save-success.wxss b/src/openeuler/package-events/publish/success.wxss similarity index 91% rename from src/mindspore/package-events/sign-up/save-success.wxss rename to src/openeuler/package-events/publish/success.wxss index 5b75c4e2d79546346b71c10953937285ff9da340..06442e89f1b62d6f36f8ef6c96eabb62978b1e47 100644 --- a/src/mindspore/package-events/sign-up/save-success.wxss +++ b/src/openeuler/package-events/publish/success.wxss @@ -1,46 +1,46 @@ -/* package-events/publish/success.wxss */ -page { - background-color: #f5f7fa !important; -} - -.container { - height: 100%; - padding: 0 72rpx; -} - -.container .suc-wrapper { - margin-top: 423rpx; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; -} - -.container .suc-wrapper image { - width: 234rpx; - height: 218rpx; -} - -.container .suc-wrapper text { - text-align: center; - margin-top: 20rpx; - font-size: 34rpx; - color: #333; -} - -.container .suc-wrapper text:last-child { - font-size: 28rpx; - color: #6d7278; -} - -.container button { - margin-top: 186rpx; - width: 500rpx; - height: 90rpx; - line-height: 90rpx; - text-align: center; - font-size: 36rpx; - color: #fff; - background-color: #40ADFF; - border-radius: 8rpx; +/* package-events/publish/success.wxss */ +page { + background-color: #f5f7fa !important; +} + +.container { + height: 100%; + padding: 0 72rpx; +} + +.container .suc-wrapper { + margin-top: 423rpx; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +.container .suc-wrapper image { + width: 234rpx; + height: 218rpx; +} + +.container .suc-wrapper text { + text-align: center; + margin-top: 20rpx; + font-size: 34rpx; + color: #333; +} + +.container .suc-wrapper text:last-child { + font-size: 28rpx; + color: #6d7278; +} + +.container button { + margin-top: 186rpx; + width: 500rpx; + height: 90rpx; + line-height: 90rpx; + text-align: center; + font-size: 36rpx; + color: #fff; + background-color: #002fa7; + border-radius: 8rpx; } \ No newline at end of file diff --git a/src/mindspore/package-events/sign-up/sign-up-success.js b/src/openeuler/package-events/sign-up/sign-up-success.js similarity index 88% rename from src/mindspore/package-events/sign-up/sign-up-success.js rename to src/openeuler/package-events/sign-up/sign-up-success.js index fe491d85d84d91fea7b97ed0f5d3905d5569e76e..e120e3de0248514ce06b8c3259fc23bdd9a581f2 100644 --- a/src/mindspore/package-events/sign-up/sign-up-success.js +++ b/src/openeuler/package-events/sign-up/sign-up-success.js @@ -1,100 +1,102 @@ -// package-events/sign-up/sign-up-success.js -const appAjax = require('./../../utils/app-ajax'); -const { - wxml, - style -} = require('./wxml-to-canvas.js'); -let that = null; - -let remoteMethods = { - getDetail: function (_callback) { - let service = 'EVENT_DETAIL'; - appAjax.postJson({ - autoShowWait: true, - type: 'GET', - service, - otherParams: { - id: that.data.id - }, - success: function (ret) { - _callback && _callback(ret); - } - }); - } -} -Page({ - - /** - * 页面的初始数据 - */ - data: { - poster: 1, - title: '', - name: '', - tel: '', - id: '', - qrcode: '' - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - that = this; - this.widget = this.selectComponent('.widget'); - this.setData({ - poster: decodeURIComponent(options.poster), - title: decodeURIComponent(options.title), - name: decodeURIComponent(options.name), - tel: decodeURIComponent(options.tel), - id: decodeURIComponent(options.id) - }) - remoteMethods.getDetail((res) => { - this.setData({ - qrcode: res.wx_code - }) - }) - - }, - saveToAlbum() { - wx.showLoading({ - title : '保存中', - mask: true - }); - const p1 = this.widget.renderToCanvas({ - wxml: wxml({ - title: that.data.title, - name: that.data.name, - tel: that.data.tel, - poster: that.data.poster, - qrcode: that.data.qrcode - }), - style: style() - }) - p1.then(() => { - const p2 = this.widget.canvasToTempFilePath(); - p2.then(res => { - wx.getSetting({ - success() { - wx.saveImageToPhotosAlbum({ - filePath: res.tempFilePath, - success: function () { - wx.navigateTo({ - url: './save-success', - }) - }, - fail: function (err) { - console.log(err); - }, - complete(res) { - wx.hideLoading(); - console.log(res); - } - }); - } - }); - }) - }) - - } +// package-events/sign-up/sign-up-success.js +const appAjax = require('./../../utils/app-ajax'); +const { + wxml, + style +} = require('./wxml-to-canvas.js'); +let that = null; + +let remoteMethods = { + getDetail: function (_callback) { + let service = 'EVENT_DETAIL'; + appAjax.postJson({ + autoShowWait: true, + type: 'GET', + service, + otherParams: { + id: that.data.id + }, + success: function (ret) { + _callback && _callback(ret); + } + }); + } +} +Page({ + + /** + * 页面的初始数据 + */ + data: { + poster: 1, + title: '', + name: '', + tel: '', + id: '', + qrcode: '' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + that = this; + this.widget = this.selectComponent('.widget'); + this.setData({ + poster: decodeURIComponent(options.poster), + title: decodeURIComponent(options.title), + name: decodeURIComponent(options.name), + tel: decodeURIComponent(options.tel), + id: decodeURIComponent(options.id) + }) + remoteMethods.getDetail((res) => { + this.setData({ + qrcode: res.wx_code + }) + }) + + }, + saveToAlbum() { + wx.showLoading({ + title : '保存中', + mask: true + }); + const p1 = this.widget.renderToCanvas({ + wxml: wxml({ + title: that.data.title, + name: that.data.name, + tel: that.data.tel, + poster: that.data.poster, + qrcode: that.data.qrcode + }), + style: style() + }) + p1.then(() => { + const p2 = this.widget.canvasToTempFilePath(); + p2.then(res => { + wx.getSetting({ + success() { + wx.saveImageToPhotosAlbum({ + filePath: res.tempFilePath, + success: function () { + wx.showToast({ + title: "保存成功", + icon: "success", + duration: 2000 + }); + }, + fail: function (err) { + console.log(err); + }, + complete(res) { + wx.hideLoading(); + console.log(res); + } + }); + } + }); + }) + }) + + } }) \ No newline at end of file diff --git a/src/mindspore/package-events/sign-up/sign-up-success.json b/src/openeuler/package-events/sign-up/sign-up-success.json similarity index 95% rename from src/mindspore/package-events/sign-up/sign-up-success.json rename to src/openeuler/package-events/sign-up/sign-up-success.json index c30d35786814f385ca77a5a958e102705a38abd4..00969ec64219814b75c540fd2ba115840d266d67 100644 --- a/src/mindspore/package-events/sign-up/sign-up-success.json +++ b/src/openeuler/package-events/sign-up/sign-up-success.json @@ -1,4 +1,4 @@ -{ - "usingComponents": {}, - "navigationBarTitleText": "活动报名" +{ + "usingComponents": {}, + "navigationBarTitleText": "活动报名" } \ No newline at end of file diff --git a/src/mindspore/package-events/sign-up/sign-up-success.wxml b/src/openeuler/package-events/sign-up/sign-up-success.wxml similarity index 66% rename from src/mindspore/package-events/sign-up/sign-up-success.wxml rename to src/openeuler/package-events/sign-up/sign-up-success.wxml index 31f79f3d6debb1f99d77d1074c9a002662a686c0..35e64f167777903b80c0acb7a6bdb3ec532a8223 100644 --- a/src/mindspore/package-events/sign-up/sign-up-success.wxml +++ b/src/openeuler/package-events/sign-up/sign-up-success.wxml @@ -1,15 +1,16 @@ - - - - 报名成功! - {{title}} - 您的参会凭证 - 姓名: {{name}} - 手机: {{tel}} - - - - - - - + + + + openEuler + 报名成功! + {{title}} + 您的参会凭证 + 姓名: {{name}} + 手机: {{tel}} + + + + + + + diff --git a/src/mindspore/package-events/sign-up/sign-up-success.wxss b/src/openeuler/package-events/sign-up/sign-up-success.wxss similarity index 60% rename from src/mindspore/package-events/sign-up/sign-up-success.wxss rename to src/openeuler/package-events/sign-up/sign-up-success.wxss index 02c8ff2c461db8fb19baee3518f12cbe6e982fbf..c1664a382c853fe0020ef181949613a0babcb2b2 100644 --- a/src/mindspore/package-events/sign-up/sign-up-success.wxss +++ b/src/openeuler/package-events/sign-up/sign-up-success.wxss @@ -1,94 +1,92 @@ -/* package-events/sign-up/sign-up-success.wxss */ -.container { - height: 1502rpx; - background-size: 100% 100% !important; - display: flex; - flex-direction: column; - align-items: center; - overflow: hidden; -} - -.bg1 { - background: url(https://community-meeting-minutes.obs.cn-north-4.myhuaweicloud.com:443/imgs/sign-up/bg1.png) no-repeat; -} - -.bg2 { - background: url(https://community-meeting-minutes.obs.cn-north-4.myhuaweicloud.com:443/imgs/sign-up/bg2.png) no-repeat; -} - -.bg3 { - background: url(https://community-meeting-minutes.obs.cn-north-4.myhuaweicloud.com:443/imgs/sign-up/bg3.png) no-repeat; -} - -.bg4 { - background: url(https://community-meeting-minutes.obs.cn-north-4.myhuaweicloud.com:443/imgs/sign-up/bg4.png) no-repeat; -} - -.container .avatar { - margin-top: 188rpx; - width: 300rpx; - height: 100rpx; -} - -.container .open-euler { - margin-top: 20rpx; - color: #333; - font-size: 34rpx; - line-height: 48rpx; -} - -.container .success-text { - color: #333; - font-size: 40rpx; - margin-top: 130rpx; - font-weight: 500; -} - -.container .title { - color: #40ADFF; - font-size: 34rpx; - margin-top: 30rpx; -} - -.container .voucher { - color: #333; - font-size: 34rpx; - margin-top: 30rpx; -} - -.container .name { - margin-top: 60rpx; - font-size: 34rpx; -} -.name text { - color: #40ADFF; -} - -.tel text { - color: #40ADFF; -} -.container .tel { - margin-top: 30rpx; - font-size: 34rpx; -} - -.container button { - margin-top: 128rpx; - width: 500rpx; - height: 90rpx; - line-height: 90rpx; - border-radius: 8rpx; - background-color: #40ADFF; - text-align: center; - color: #fff; -} -.container .qrcode { - margin-top: 60rpx; - width: 309rpx; - height: 309rpx; - border-radius: 50%; -} -.canvas { - height: 0; - overflow: hidden; +/* package-events/sign-up/sign-up-success.wxss */ +.container { + height: 1502rpx; + background-size: 100% 100% !important; + display: flex; + flex-direction: column; + align-items: center; + overflow: hidden; +} + +.bg1 { + background: url(https://openeuler-website.obs.ap-southeast-1.myhuaweicloud.com/sign-up/bg1.png) no-repeat; +} + +.bg2 { + background: url(https://openeuler-website.obs.ap-southeast-1.myhuaweicloud.com/sign-up/bg2.png) no-repeat; +} + +.bg3 { + background: url(https://openeuler-website.obs.ap-southeast-1.myhuaweicloud.com/sign-up/bg3.png) no-repeat; +} + +.bg4 { + background: url(https://openeuler-website.obs.ap-southeast-1.myhuaweicloud.com/sign-up/bg4.png) no-repeat; +} + +.container .avatar { + margin-top: 188rpx; + width: 128rpx; + height: 128rpx; + border-radius: 100%; +} + +.container .open-euler { + margin-top: 20rpx; + color: #333; + font-size: 34rpx; + line-height: 48rpx; +} + +.container .success-text { + color: #333; + font-size: 40rpx; + margin-top: 60rpx; + font-weight: 500; +} + +.container .title { + color: #002fa7; + font-size: 34rpx; + margin-top: 30rpx; +} + +.container .voucher { + color: #333; + font-size: 34rpx; + margin-top: 30rpx; +} + +.container .name { + margin-top: 128rpx; + font-size: 34rpx; + color: #002fa7; +} + +.container .tel { + margin-top: 30rpx; + font-size: 34rpx; + color: #002fa7; +} + +.container button { + margin-top: 27rpx; + width: 500rpx; + height: 90rpx; + line-height: 90rpx; + border-radius: 8rpx; + background-color: #002fa7; + text-align: center; + color: #fff; +} + +.container .qrcode { + width: 309rpx; + height: 309rpx; + margin-top: 60rpx; +} + +.canvas { + height: 0; + overflow: hidden; } \ No newline at end of file diff --git a/src/openeuler/package-events/sign-up/sign-up.js b/src/openeuler/package-events/sign-up/sign-up.js new file mode 100644 index 0000000000000000000000000000000000000000..d061f7362c444690c986d2c5580e84b2f3759b7c --- /dev/null +++ b/src/openeuler/package-events/sign-up/sign-up.js @@ -0,0 +1,182 @@ +// package-events/sign-up/sign-up.js +const appAjax = require('./../../utils/app-ajax'); +const sessionUtil = require("../../utils/app-session.js"); +const validationConfig = require('./../../config/field-validate-rules'); + +let that = null; + +let remoteMethods = { + getUserInfo: function (_callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'GET', + service: 'APPLICANT_INFO', + otherParams: { + id: sessionUtil.getUserInfoByKey('userId') + }, + success: function (ret) { + _callback && _callback(ret); + } + }); + }, + signUp: function (postData, _callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'POST', + data: postData, + service: 'SAVE_SIGNUP_INFO', + success: function (ret) { + _callback && _callback(ret); + } + }); + } +} + +let localMethods = { + validation() { + if (!that.data.name) { + this.toast('请输入您的姓名'); + return; + } + if (!validationConfig.phone.regex.test(that.data.tel)) { + this.toast('请输入正确的手机号码'); + return; + } + if (!validationConfig.email.regex.test(that.data.mail)) { + this.toast('请输入正确的邮箱地址'); + return; + } + if (!that.data.enterprise) { + this.toast('请输入您的工作单位名称'); + return; + } + return true; + }, + toast(msg) { + wx.showToast({ + title: msg, + icon: "none", + duration: 2000 + }); + } +} + +Page({ + + /** + * 页面的初始数据 + */ + data: { + name: '', + tel: '', + mail: '', + enterprise: '', + occupation: '', + gitee: '', + id: '', + eventTitle: '', + poster: 1, + tips: 'Gitee ID为https://gitee.com/{{gitee_id}} 中的gitee_id' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + that = this; + this.setData({ + id: options.id, + eventTitle: options.title, + poster: options.poster, + isScan: options.isScan || 0 + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + remoteMethods.getUserInfo(res => { + this.setData({ + name: res.name || '', + tel: res.telephone || '', + mail: res.email || '', + enterprise: res.company || '', + occupation: res.profession || '', + gitee: res.gitee_name || '' + }) + }) + }, + nameInput(e) { + this.setData({ + name: e.detail.value + }) + }, + telInput(e) { + this.setData({ + tel: e.detail.value + }) + }, + mailInput(e) { + this.setData({ + mail: e.detail.value + }) + }, + enterpriseInput(e) { + this.setData({ + enterprise: e.detail.value + }) + }, + occupationInput(e) { + this.setData({ + occupation: e.detail.value + }) + }, + giteeInput(e) { + this.setData({ + gitee: e.detail.value + }) + }, + signUp() { + if (!localMethods.validation()) { + return; + } + const postData = { + company: this.data.enterprise, + email: this.data.mail, + gitee_name: this.data.gitee, + name: this.data.name, + profession: this.data.occupation, + telephone: this.data.tel, + activity: this.data.id + } + remoteMethods.signUp(postData, (res) => { + if (res.code === 400) { + wx.showToast({ + title: res.msg, + icon : "none", + duration: 2000 + }); + return; + } + if (this.data.isScan) { + wx.redirectTo({ + url: `/package-events/events/sign-success?id=${this.data.id}` + }) + return; + } + wx.redirectTo({ + url: `/package-events/sign-up/sign-up-success?name=${encodeURIComponent(this.data.name)}&title=${encodeURIComponent(this.data.eventTitle)}&tel=${encodeURIComponent(this.data.tel)}&poster=${encodeURIComponent(this.data.poster)}&id=${encodeURIComponent(this.data.id)}` + }) + }) + }, + 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/sign-up.json b/src/openeuler/package-events/sign-up/sign-up.json similarity index 68% rename from src/mindspore/package-events/sign-up/sign-up.json rename to src/openeuler/package-events/sign-up/sign-up.json index 17a91848596dc0ff6ccd9f665b9ee41737d37bec..c8296ff7bad4dd9c8d71d90cc383f9672b21b5ff 100644 --- a/src/mindspore/package-events/sign-up/sign-up.json +++ b/src/openeuler/package-events/sign-up/sign-up.json @@ -1,6 +1,6 @@ -{ - "usingComponents": {}, - "navigationBarTitleText": "活动报名", - "navigationBarBackgroundColor": "#40ADFF", - "navigationBarTextStyle": "white" +{ + "usingComponents": {}, + "navigationBarTitleText": "活动报名", + "navigationBarBackgroundColor": "#002fa7", + "navigationBarTextStyle": "white" } \ No newline at end of file diff --git a/src/openeuler/package-events/sign-up/sign-up.wxml b/src/openeuler/package-events/sign-up/sign-up.wxml new file mode 100644 index 0000000000000000000000000000000000000000..b89e89345f77c532268ca7b1ac9d5131c9ff85be --- /dev/null +++ b/src/openeuler/package-events/sign-up/sign-up.wxml @@ -0,0 +1,64 @@ + + + + + + + 您的姓名 + * + + + + + + 您的手机 + * + + + + + + 您的邮箱 + * + + + + + + 您的单位 + * + + + + + + 您的职业 + + + + + + 您的Gitee ID + + + + + + + + + + * + 号为必填项; + + + + + {{tips}} + + + + + + + \ No newline at end of file diff --git a/src/mindspore/package-events/sign-up/sign-up.wxss b/src/openeuler/package-events/sign-up/sign-up.wxss similarity index 60% rename from src/mindspore/package-events/sign-up/sign-up.wxss rename to src/openeuler/package-events/sign-up/sign-up.wxss index a3d40aeb81d1ac321b6e4b3b1a68347da0d0c84f..9e4650cb85052afec1ac8188b0ddbcad3dc25ae0 100644 --- a/src/mindspore/package-events/sign-up/sign-up.wxss +++ b/src/openeuler/package-events/sign-up/sign-up.wxss @@ -1,136 +1,100 @@ -/* package-events/sign-up/sign-up.wxss */ -page { - background: url(data:image/jpg;base64,iVBORw0KGgoAAAANSUhEUgAAAK8AAAAlCAYAAAA0ubnLAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAB5SURBVHhe7dJBDQAgAAMxpGEYjUPHJX3UQc99GxTJS5a8ZMlLlrxkyUuWvGTJS5a8ZMlLlrxkyUuWvGTJS5a8ZMlLlrxkyUuWvGTJS5a8ZMlLlrxkyUuWvGTJS5a8ZMlLlrxkyUuWvGTJS5a8ZMlLlrxkyUuWvERtH4Xg0iHi5cqkAAAAAElFTkSuQmCC) no-repeat; - background-size: 100% 108rpx; - background-color: #f5f7fa !important; - padding: 0 30rpx; -} - -.container { - 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; -} - -.require { - color: #f76270; -} - -.placeholder { - color: #c7cad0; -} - -.container .form .form-item { - padding: 0 30rpx; - background-color: #fff; - height: 108rpx; - color: #333; - font-size: 28rpx; - display: flex; - align-items: center; - justify-content: start; - border-bottom: 2rpx solid #f0f3f7; -} - -.container .form > .form-item { - box-shadow: 0rpx 5rpx 15rpx 0rpx rgba(0, 47, 167, 0.1); - border-radius: 8rpx; -} - -.container .form .form-wrapper { - box-shadow: 0rpx 5rpx 15rpx 0rpx rgba(0, 47, 167, 0.1); - border-radius: 8rpx; - background-color: #fff; - overflow: hidden; -} - -.container .form .form-item .label { - margin-right: 40rpx; - font-size: 34rpx; -} - -.container .form .form-item input { - color: #6d7278; -} - -.container .info { - font-size: 29rpx; - color: #6d7278; - margin-bottom: 60rpx; -} - -.container .info view { - margin: 30rpx 0; -} - -.container .info view image { - width: 28rpx; - height: 28rpx; - margin-right: 15rpx; - vertical-align: middle; -} - -.container .commit { - display: flex; - justify-content: space-between; - height: 90rpx; - font-size: 36rpx; -} - -.container .commit button { - width: 330rpx; - text-align: center; - line-height: 90rpx; - height: 100%; - border-radius: 8rpx; - padding: 0; -} - -.container .commit .meeting-btn { - color: #fff; - 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); +/* package-events/sign-up/sign-up.wxss */ +page { + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHwAAAAeCAYAAADuInrvAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACdSURBVGhD7dbBDYAwDAPAbsTYjFnEDn5YyT34WinWpT3nea9v0T9Q9qKyf9wKV7gVP/maI5xwwglfpkDhCh9z9Y05yGSVybMpfNn2UrjCvdKTK7Qti3DCCW9TmZyHcMIJT4pqyyKccMLbVCbnIZxwwpOi2rIIJ5zwNpXJeQgnnPCkqLYswgknvE1lch7CCSc8Kaoti3DCCW9TGZznA1f9oK8GgBpHAAAAAElFTkSuQmCC) no-repeat; + background-size: 100% 108rpx; + background-color: #f5f7fa !important; + padding: 0 30rpx; +} + +.container { + padding: 30rpx 0 129rpx 0; +} + +input { + flex: 1; +} + +.require { + color: #f76270; +} + +.placeholder { + color: #c7cad0; +} + +.container .form .form-item { + padding: 0 30rpx; + background-color: #fff; + height: 108rpx; + color: #333; + font-size: 28rpx; + display: flex; + align-items: center; + justify-content: start; + border-bottom: 2rpx solid #f0f3f7; +} + +.container .form > .form-item { + box-shadow: 0rpx 5rpx 15rpx 0rpx rgba(0, 47, 167, 0.1); + border-radius: 8rpx; +} + +.container .form .form-wrapper { + box-shadow: 0rpx 5rpx 15rpx 0rpx rgba(0, 47, 167, 0.1); + border-radius: 8rpx; + background-color: #fff; + overflow: hidden; +} + +.container .form .form-item .label { + margin-right: 40rpx; + font-size: 34rpx; +} + +.container .form .form-item input { + color: #6d7278; +} + +.container .info { + font-size: 29rpx; + color: #6d7278; + margin-bottom: 60rpx; +} + +.container .info view { + margin: 30rpx 0; +} + +.container .info view image { + width: 28rpx; + height: 28rpx; + margin-right: 15rpx; + vertical-align: middle; +} + +.container .commit { + display: flex; + justify-content: space-between; + height: 90rpx; + font-size: 36rpx; +} + +.container .commit button { + width: 330rpx; + text-align: center; + line-height: 90rpx; + height: 100%; + border-radius: 8rpx; + padding: 0; +} + +.container .commit .meeting-btn { + color: #fff; + background-color: #002fa7; +} + +.container .commit .meeting-reset { + color: #002fa7; + background-color: #fff; + border: 1px solid #002fa7; } \ No newline at end of file diff --git a/src/openeuler/package-events/sign-up/wxml-to-canvas.js b/src/openeuler/package-events/sign-up/wxml-to-canvas.js new file mode 100644 index 0000000000000000000000000000000000000000..40849982bf8db33d3fcddd06f6a33742450d8ae1 --- /dev/null +++ b/src/openeuler/package-events/sign-up/wxml-to-canvas.js @@ -0,0 +1,106 @@ +const wxml = (data) => { + return ` + + + + + openEuler + 报名成功! + ${data.title} + 您的参会凭证 + 姓名: ${data.name} + 手机: ${data.tel} + + + + ` +} + +const style = () => { + return { + container: { + width: 375, + height: 750, + flexDirection: 'column', + alignItems: 'center' + }, + absolute: { + width: 375, + height: 750, + flexDirection: 'column', + alignItems: 'center' + }, + avatar: { + marginTop: 110, + width: 64, + height: 64 + }, + openEuler: { + marginTop: 10, + color: '#333333', + fontSize: 17, + lineHeight: 24, + height: 24, + width: 100, + textAlign: 'center' + }, + successText: { + color: '#333333', + fontSize: 20, + marginTop: 30, + fontWeight: 500, + height: 28, + width: 100, + textAlign: 'center' + }, + title: { + color: '#002fa7', + fontSize: 17, + marginTop: 15, + height: 25, + width: 300, + textAlign: 'center' + }, + voucher: { + color: '#333333', + fontSize: 17, + marginTop: 15, + height: 25, + width: 300, + textAlign: 'center' + }, + name: { + marginTop: 64, + fontSize: 17, + color: '#002fa7', + height: 25, + width: 300, + textAlign: 'center' + }, + tel: { + marginTop: 15, + fontSize: 17, + color: '#002fa7', + height: 25, + width: 350, + textAlign: 'center' + }, + qrcode: { + marginTop: 30, + height: 150, + width: 150 + }, + bgImg: { + position: 'absolute', + width: 375, + height: 750, + top: 0, + left: 0 + } + } +} + +module.exports = { + wxml, + style +} \ No newline at end of file diff --git a/src/openeuler/package-meeting/meeting/detail.js b/src/openeuler/package-meeting/meeting/detail.js new file mode 100644 index 0000000000000000000000000000000000000000..350259c923c31301ad88739a291508acd11c44bc --- /dev/null +++ b/src/openeuler/package-meeting/meeting/detail.js @@ -0,0 +1,122 @@ +// pages/meeting/detail.js +var appAjax = require('./../../utils/app-ajax'); +const sessionUtil = require('../../utils/app-session.js'); +let remoteMethods = { + getMeetingDetail: function (id, _callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'GET', + service: 'GET_MEETING_DETAIL', + otherParams: { + id: id, + }, + // headers: { + // Authorization: '', + // }, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, + collect: function (id, _callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'POST', + service: 'COLLECT', + data: { + meeting: id, + }, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, + uncollect: function (id, _callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'DELETE', + service: 'UNCOLLECT', + otherParams: { + id: id, + }, + success: function (ret) { + _callback && _callback(ret); + }, + }); + }, +}; +Page({ + /** + * 页面的初始数据 + */ + data: { + id: '', + info: {}, + collection_id: null + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + id: options.id + }); + }, + copy: function (e) { + wx.setClipboardData({ + data: e.currentTarget.dataset.copy, + success: function () {}, + }); + }, + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + let that = this; + remoteMethods.getMeetingDetail(this.data.id, function (data) { + if (data) { + that.setData({ + info: data, + collection_id: data.collection_id || null + }); + } + }); + }, + + onShareAppMessage: function () { + return { + title: '会议详情', + path: `/package-meeting/meeting/detail?id=${this.data.id}`, + }; + }, + collect: function () { + let that = this + if (!sessionUtil.getUserInfoByKey('access')) { + wx.navigateTo({ + url: '/pages/auth/auth', + }); + return; + } + if (this.data.collection_id != null) { + remoteMethods.uncollect(this.data.collection_id, function (res) { + that.setData({ + collection_id: null + }) + }); + } else { + wx.requestSubscribeMessage({ + tmplIds: ['2xSske0tAcOVKNG9EpBjlb1I-cjPWSZrpwPDTgqAmWI', 'UpxRbZf8Z9QiEPlZeRCgp_MKvvqHlo6tcToY8fToK50'], + success(res) { + remoteMethods.collect(that.data.id, function (res) { + if (res.code == 201) { + that.setData({ + collection_id: res.collection_id || '' + }) + } + }) + } + }) + } + }, +}); \ No newline at end of file diff --git a/src/openeuler/package-meeting/meeting/detail.json b/src/openeuler/package-meeting/meeting/detail.json new file mode 100644 index 0000000000000000000000000000000000000000..68c6372334f09c64599297d5c88f67b2d6819c6a --- /dev/null +++ b/src/openeuler/package-meeting/meeting/detail.json @@ -0,0 +1,5 @@ +{ + "navigationBarTitleText": "会议详情", + "navigationBarBackgroundColor": "#002fa7", + "navigationBarTextStyle": "white" +} \ No newline at end of file diff --git a/src/openeuler/package-meeting/meeting/detail.wxml b/src/openeuler/package-meeting/meeting/detail.wxml new file mode 100644 index 0000000000000000000000000000000000000000..0d7e60fe53022b48260fc79ed590b831a07d692b --- /dev/null +++ b/src/openeuler/package-meeting/meeting/detail.wxml @@ -0,0 +1,63 @@ + + + + {{info.topic}} + + + {{info.date}} {{info.start}}-{{info.end}} + + + + + {{info.group_name}} + + + + {{info.agenda}} + + + + Etherpad链接 + + + {{info.etherpad}} + + + + + + + Zoom + WeLink + + + ID: {{info.mid}} + + + + {{info.join_url}} + + + + + + + + 回放链接 + + + {{info.video_url}} + + + + + + + + + 一键收藏此会议,即可收到会议提醒通知哦! + + \ No newline at end of file diff --git a/src/openeuler/package-meeting/meeting/detail.wxss b/src/openeuler/package-meeting/meeting/detail.wxss new file mode 100644 index 0000000000000000000000000000000000000000..7222396f3a59ac245befa2bba03d6ece9058d726 --- /dev/null +++ b/src/openeuler/package-meeting/meeting/detail.wxss @@ -0,0 +1,94 @@ +/* pages/meeting/detail.wxss */ +page { + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHwAAAAeCAYAAADuInrvAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACdSURBVGhD7dbBDYAwDAPAbsTYjFnEDn5YyT34WinWpT3nea9v0T9Q9qKyf9wKV7gVP/maI5xwwglfpkDhCh9z9Y05yGSVybMpfNn2UrjCvdKTK7Qti3DCCW9TmZyHcMIJT4pqyyKccMLbVCbnIZxwwpOi2rIIJ5zwNpXJeQgnnPCkqLYswgknvE1lch7CCSc8Kaoti3DCCW9TGZznA1f9oK8GgBpHAAAAAElFTkSuQmCC) no-repeat; + background-size: 100% 108rpx; + background-color: #f5f7fa !important; +} + +.container { + padding-top: 20rpx; +} + +.container .detail-item { + background-color: #fff; + margin-bottom: 20rpx; + box-shadow: 0rpx 5rpx 15rpx 0rpx rgba(0, 47, 167, 0.1); + border-radius: 8rpx; + padding: 30rpx; + color: #6d7278; + font-size: 32rpx; + font-weight: 400; +} + +.container .detail-item .name { + font-size: 36rpx; + color: #333; + font-weight: 400; + line-height: 50rpx; + margin-top: 0; +} + +.container .detail-item view { + margin-top: 20rpx; + line-height: 45rpx; +} + +.container .detail-item view image { + vertical-align: middle; + width: 30rpx; + height: 30rpx; + margin-right: 22rpx; +} + +.container .detail-item view text { + text-align: justify; + word-wrap: break-word; + word-break: break-all; + vertical-align: middle; +} + +.container .detail-item .btn-wraper { + display: flex; + justify-content: space-around; +} + +.container .detail-item .btn-wraper button { + height: 78rpx; + width: 220rpx; + border: 1px solid #002fa7; + border-radius: 8rpx; + color: #002fa7; + text-align: center; + line-height: 78rpx; +} +.container .detail-item { + background-color: #fff; + margin-bottom: 20rpx; + box-shadow: 0rpx 5rpx 15rpx 0rpx rgba(0, 47, 167, 0.1); + border-radius: 8rpx; + padding: 30rpx; + color: #6d7278; + font-size: 32rpx; + font-weight: 400; +} +.container .collect-item { + margin-bottom: 20rpx; + border-radius: 8rpx; + padding: 30rpx; + color: #6d7278; + font-size: 32rpx; + font-weight: 400; +} +.container .collect-item button{ + color: #002fa7; + border: 1px solid #002fa7; + width: 330rpx; + margin-top: 78rpx; + font-size: 36rpx; +} +.container .collect-item .tips{ + font-size: 28rpx; + line-height: 40rpx; + margin-top: 30rpx; + text-align: center; +} \ No newline at end of file diff --git a/src/openeuler/package-meeting/meeting/meeting-list.js b/src/openeuler/package-meeting/meeting/meeting-list.js new file mode 100644 index 0000000000000000000000000000000000000000..a0f154054799c269ab014f624f571da794c7c5b2 --- /dev/null +++ b/src/openeuler/package-meeting/meeting/meeting-list.js @@ -0,0 +1,43 @@ +// package-meeting/meeting/meeting-list.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + meetingConponent: null + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + this.setData({ + meetingConponent: this.selectComponent('#meeting') + }) + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + wx.stopPullDownRefresh(); + this.data.meetingConponent.initData(); + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/src/openeuler/package-meeting/meeting/meeting-list.json b/src/openeuler/package-meeting/meeting/meeting-list.json new file mode 100644 index 0000000000000000000000000000000000000000..b3fd7ad0891f70d123c8ca84c7047b860c36a92d --- /dev/null +++ b/src/openeuler/package-meeting/meeting/meeting-list.json @@ -0,0 +1,9 @@ +{ + "usingComponents": { + "meeting-list": "/components/meeting-list/meeting-list" + }, + "navigationBarTitleText": "会议列表", + "enablePullDownRefresh": true, + "backgroundTextStyle": "dark", + "backgroundColor": "#fff" +} \ No newline at end of file diff --git a/src/openeuler/package-meeting/meeting/meeting-list.wxml b/src/openeuler/package-meeting/meeting/meeting-list.wxml new file mode 100644 index 0000000000000000000000000000000000000000..5227cff775e7c33cbef32f741340cc29810760a7 --- /dev/null +++ b/src/openeuler/package-meeting/meeting/meeting-list.wxml @@ -0,0 +1,4 @@ + + + + diff --git a/src/openeuler/package-meeting/meeting/meeting-list.wxss b/src/openeuler/package-meeting/meeting/meeting-list.wxss new file mode 100644 index 0000000000000000000000000000000000000000..440d3139ad9d1602ca1b48ba653cd3719958834c --- /dev/null +++ b/src/openeuler/package-meeting/meeting/meeting-list.wxss @@ -0,0 +1,4 @@ +/* package-meeting/meeting/meeting-list.wxss */ +page { + background-color: #f5f7fa !important; +} \ No newline at end of file diff --git a/src/openeuler/package-meeting/meeting/meeting-success.js b/src/openeuler/package-meeting/meeting/meeting-success.js new file mode 100644 index 0000000000000000000000000000000000000000..03082378ef82913e8d0a00a67d33b24e68229054 --- /dev/null +++ b/src/openeuler/package-meeting/meeting/meeting-success.js @@ -0,0 +1,31 @@ +// pages/meeting/meeting-success.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + id: '' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + id: options.id + }) + }, + toDetail: function () { + wx.redirectTo({ + url: '/package-meeting/meeting/detail?id=' + this.data.id + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + } +}) \ No newline at end of file diff --git a/src/openeuler/package-meeting/meeting/meeting-success.json b/src/openeuler/package-meeting/meeting/meeting-success.json new file mode 100644 index 0000000000000000000000000000000000000000..469605bcec2bfc86e9bfca5e45768168aab05ef5 --- /dev/null +++ b/src/openeuler/package-meeting/meeting/meeting-success.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "预定会议" +} \ No newline at end of file diff --git a/src/openeuler/package-meeting/meeting/meeting-success.wxml b/src/openeuler/package-meeting/meeting/meeting-success.wxml new file mode 100644 index 0000000000000000000000000000000000000000..753dd2abb573988bd0d816e7bd63a420a8a59733 --- /dev/null +++ b/src/openeuler/package-meeting/meeting/meeting-success.wxml @@ -0,0 +1,9 @@ + + + + + 预定成功 + 您已成功预定会议 + + + \ No newline at end of file diff --git a/src/openeuler/package-meeting/meeting/meeting-success.wxss b/src/openeuler/package-meeting/meeting/meeting-success.wxss new file mode 100644 index 0000000000000000000000000000000000000000..9864dc718d58e57dd4292921e6b2e18a1cd5c187 --- /dev/null +++ b/src/openeuler/package-meeting/meeting/meeting-success.wxss @@ -0,0 +1,48 @@ +/* pages/meeting/meeting-success.wxss */ +.container { + background-color: #fff; + height: 100%; + margin-top: 20rpx; + position: relative +} + +.container .suc-wrapper { + position: absolute; + top: 386rpx; + left: 254rpx; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +.container .suc-wrapper image { + width: 234rpx; + height: 218rpx; +} + +.container .suc-wrapper text { + text-align: center; + margin-top: 20rpx; + font-size: 34rpx; + color: #333; +} + +.container .suc-wrapper text:last-child { + font-size: 28rpx; + color: #6d7278; +} + +.container button { + position: absolute; + top: 858rpx; + left: 125rpx; + width: 500rpx; + height: 90rpx; + line-height: 90rpx; + text-align: center; + font-size: 36rpx; + color: #fff; + background-color: #002fa7; + border-radius: 8rpx; +} \ No newline at end of file diff --git a/src/openeuler/package-meeting/reserve/reserve.js b/src/openeuler/package-meeting/reserve/reserve.js new file mode 100644 index 0000000000000000000000000000000000000000..ef58d4d79d12d6cf878dd0ba31b815dc78631434 --- /dev/null +++ b/src/openeuler/package-meeting/reserve/reserve.js @@ -0,0 +1,360 @@ +// pages/reserve/reserve.js +var appAjax = require('./../../utils/app-ajax'); +var appSession = require("./../../utils/app-session.js"); +var utils = require("./../../utils/utils.js"); +utils.formateDate(); +let that = null; +let remoteMethods = { + getUserGroup: function (id, _callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'GET', + service: "GET_USER_GROUP", + otherParams: { + id: id + }, + success: function (ret) { + _callback && _callback(ret); + } + }); + }, + saveMeeting: function (postData, _callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'POST', + service: "SAVE_MEETING", + data: postData, + success: function (ret) { + _callback && _callback(ret); + } + }); + } +} +let localMethods = { + validation: function (that) { + if (!that.data.topic) { + this.toast('请输入会议名称'); + return; + } + if (!that.data.sponsor) { + this.toast('请联系管理员编辑您的gitee name'); + return; + } + if (!that.data.groupId) { + this.toast('请选择所属SIG'); + return; + } + if (!that.data.date) { + this.toast('请选择日期'); + return; + } + if (!that.data.start) { + this.toast('请选择开始时间'); + return; + } + if (!that.data.end) { + this.toast('请选择结束时间'); + return; + } + if ((that.data.start.split(':')[0] > that.data.end.split(':')[0]) || (that.data.start.split(':')[0] == that.data.end.split(':')[0] && that.data.start.split(':')[1] >= that.data.end.split(':')[1])) { + this.toast('开始时间必须小于结束时间'); + return; + } + return true; + }, + toast: function (msg) { + wx.showToast({ + title: msg, + icon: "none", + duration: 2000 + }); + } +} +Page({ + + /** + * 页面的初始数据 + */ + data: { + record: false, + sendDev:false, + meetingType:'Zoom', + typeList:['Zoom','WeLink(蓝版)'], + topic: '', + sponsor: '', + groupName: '', + groupId: '', + date: '', + start: '', + end: '', + etherpad: '', + agenda: '', + emaillist: '', + sigPopShow: false, + sigResult: '', + sigList: [], + datePopShow: false, + curDate: new Date().getTime(), + currentDate: new Date().getTime(), + minDate: new Date().getTime(), + timePopShow: false, + currentTime: '08:00', + minTime: 8, + maxTime: 22, + endTimePopShow: false, + currentEndTime: '08:00', + minEndTime: 8, + maxEndTime: 22, + showDialogWarn: false, + filter(type, options) { + if (type === 'minute') { + return options.filter((option) => option % 15 === 0); + } + + return options; + } + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + recordoOnChange: function (event) { + this.setData({ + record: event.detail + }); + }, + devOnChange: function (event) { + this.setData({ + sendDev: event.detail, + }); + }, + reset: function () { + this.setData({ + topic: '', + groupName: '', + group_name: '', + group_id: '', + groupId: '', + date: '', + start: '', + end: '', + etherpad: '', + agenda: '', + emaillist: '' + }) + }, + meeting: function () { + if (!localMethods.validation(this)) { + return; + } + let that = this; + wx.requestSubscribeMessage({ + tmplIds: ['2xSske0tAcOVKNG9EpBjlb1I-cjPWSZrpwPDTgqAmWI'], + success(res) { + let platform = ''; + that.data.meetingType.includes('WeLink') ? platform = that.data.meetingType.slice(0,6):platform = that.data.meetingType + let email = null; + if(that.data.sendDev) { + if (that.data.emaillist.charAt(that.data.emaillist.length-1) == ';' || that.data.emaillist.charAt(that.data.emaillist.length-1) ==';'|| that.data.emaillist.charAt(that.data.emaillist.length-1) =='') { + email = `${that.data.emaillist}dev@openeuler.org;`; + } else { + email = `${that.data.emaillist};dev@openeuler.org;`; + } + } else { + email = that.data.emaillist + } + remoteMethods.saveMeeting({ + topic: that.data.topic, + sponsor: that.data.sponsor, + group_name: that.data.groupName, + group_id: that.data.groupId, + date: that.data.date, + start: that.data.start, + end: that.data.end, + platform:platform, + etherpad: that.data.etherpad, + agenda: that.data.agenda, + emaillist: email, + record: that.data.record ? 'cloud' : '' + }, function (data) { + if (data.id) { + wx.redirectTo({ + url: '/package-meeting/meeting/meeting-success?id=' + data.id, + }) + } else { + setTimeout(function () { + wx.showToast({ + title: data.message, + icon: "none", + duration: 4000 + }, 100); + }) + } + }) + } + }) + + }, + sigNameInput: function (e) { + this.setData({ + topic: e.detail.value + }) + }, + etherInput: function (e) { + this.setData({ + etherpad: e.detail.value + }) + }, + agendaInput: function (e) { + this.setData({ + agenda: e.detail.value + }) + }, + emailInput: function (e) { + this.setData({ + emaillist: e.detail.value + }) + }, + sigConfirm: function () { + let that = this; + let sigObj = this.data.sigList.filter(function (item) { + return item.group === that.data.sigResult; + }); + sigObj = sigObj.length ? sigObj[0] : {} + this.setData({ + groupName: sigObj.group_name || '', + groupId: sigObj.group || '', + etherpad: sigObj.etherpad || '', + sigPopShow: false + }) + }, + dateConfirm: function () { + this.setData({ + date: (new Date(this.data.currentDate)).Format("yyyy-MM-dd"), + datePopShow: false + }) + }, + timeConfirm: function () { + this.setData({ + start: this.data.currentTime, + timePopShow: false + }) + }, + endTimeConfirm: function () { + this.setData({ + end: this.data.currentEndTime, + endTimePopShow: false + }) + }, + onTypeShow: function () { + this.setData({ + typeShow: true, + }) + }, + typeCancel: function () { + this.setData({ + typeShow: false, + }); + }, + typeConfirm: function () { + this.setData({ + typeShow: false, + }); + }, + typeRadioOnChange: function (e) { + this.setData({ + meetingType:e.detail + }); + }, + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + that = this; + this.setData({ + sponsor: appSession.getUserInfoByKey('gitee') || '' + }) + let that = this; + remoteMethods.getUserGroup(appSession.getUserInfoByKey('userId'), function (data) { + if (data && data.length) { + that.setData({ + sigList: data + }) + } + }) + }, + sigRadioOnChange: function (e) { + this.setData({ + sigResult: e.detail + }) + }, + selSig: function () { + if (!this.data.sigList.length) { + this.setData({ + showDialogWarn: true + }) + return; + } + this.setData({ + sigPopShow: true + }) + }, + warnCancel: function () { + this.setData({ + showDialogWarn: false + }) + }, + sigCancel: function () { + this.setData({ + sigPopShow: false + }) + }, + selDate: function () { + this.setData({ + datePopShow: true + }) + }, + selTime: function () { + this.setData({ + timePopShow: true + }) + }, + selEndTime: function () { + this.setData({ + endTimePopShow: true + }) + }, + dateCancel: function () { + this.setData({ + datePopShow: false + }) + }, + timeCancel: function () { + this.setData({ + timePopShow: false + }) + }, + endTimeCancel: function () { + this.setData({ + endTimePopShow: false + }) + }, + dateOnInput: function (e) { + this.setData({ + currentDate: e.detail + }) + }, + timeOnInput: function (e) { + this.setData({ + currentTime: e.detail + }) + }, + endTimeOnInput: function (e) { + this.setData({ + currentEndTime: e.detail + }) + }, +}) \ No newline at end of file diff --git a/src/openeuler/package-meeting/reserve/reserve.json b/src/openeuler/package-meeting/reserve/reserve.json new file mode 100644 index 0000000000000000000000000000000000000000..65c2333e18dbb152951cb08ff6ec477165c531e6 --- /dev/null +++ b/src/openeuler/package-meeting/reserve/reserve.json @@ -0,0 +1,6 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "预定会议", + "navigationBarBackgroundColor": "#002fa7", + "navigationBarTextStyle": "white" +} \ No newline at end of file diff --git a/src/openeuler/package-meeting/reserve/reserve.wxml b/src/openeuler/package-meeting/reserve/reserve.wxml new file mode 100644 index 0000000000000000000000000000000000000000..7ec75254c4b9e5eda6e3587120a1ffbbc1ba9f45 --- /dev/null +++ b/src/openeuler/package-meeting/reserve/reserve.wxml @@ -0,0 +1,186 @@ + + + + + + + 会议名称 + * + + + + + + 会议平台 + * + + + {{meetingType}} + + + + + 发起人 + + + + + 选取所属SIG + * + + + {{groupName}} + + + + + + 日期 + * + + + {{date}} + + + + + + 时间 + * + + + {{start||'请选择'}} + + {{end||'请选择'}} + + + + Etherpad链接 + {{etherpad}} + + + + 自动录制会议 + + + + + + + + + 勾选此项进入会议自动开启录屏,录制服务由{{meetingType}}提供,会后自动上传至B站openEuler的账号下 + + + + 会议内容 + + + + + + + + 多个邮箱地址用分号;隔开 + + + + + * + 号为必填项 + + + + + + + + + + 选择所属SIG + + + + + {{item.group_name}} + + + + + + + + + + + + + 选择预定会议日期 + + + + + + + + + + 选择会议开始时间 + + + + + + + + + + 选择会议结束时间 + + + + + + + + + + 当前您不属于任何SIG组,请先在SIG管理中关联SIG组 + + + + + + + + + 选择会议平台 + + + + + {{item}} + + + + + + + + + + + \ No newline at end of file diff --git a/src/openeuler/package-meeting/reserve/reserve.wxss b/src/openeuler/package-meeting/reserve/reserve.wxss new file mode 100644 index 0000000000000000000000000000000000000000..3e18e3660c70a09a6902334cb82895dbdae4b879 --- /dev/null +++ b/src/openeuler/package-meeting/reserve/reserve.wxss @@ -0,0 +1,246 @@ +/* pages/reserve/reserve.wxss */ +page { + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHwAAAAeCAYAAADuInrvAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACdSURBVGhD7dbBDYAwDAPAbsTYjFnEDn5YyT34WinWpT3nea9v0T9Q9qKyf9wKV7gVP/maI5xwwglfpkDhCh9z9Y05yGSVybMpfNn2UrjCvdKTK7Qti3DCCW9TmZyHcMIJT4pqyyKccMLbVCbnIZxwwpOi2rIIJ5zwNpXJeQgnnPCkqLYswgknvE1lch7CCSc8Kaoti3DCCW9TGZznA1f9oK8GgBpHAAAAAElFTkSuQmCC) no-repeat; + background-size: 100% 108rpx; + background-color: #f5f7fa !important; + padding: 0 30rpx; +} + +.container { + padding: 30rpx 0 129rpx 0; +} + +textarea { + height: 45rpx; + flex: 1; +} + +input { + flex: 1; +} + +.require { + color: #f76270; +} + +.placeholder { + color: #c7cad0; +} + +.container .form .form-item { + padding: 0 30rpx; + background-color: #fff; + height: 108rpx; + color: #333; + font-size: 34rpx; + display: flex; + align-items: center; + justify-content: start; + border-bottom: 2rpx solid #f0f3f7; +} + +.container .form > .form-item { + box-shadow: 0rpx 5rpx 15rpx 0rpx rgba(0, 47, 167, 0.1); + border-radius: 8rpx; +} +.form .email-box { + overflow: hidden; + box-shadow: 0rpx 5rpx 15rpx 0rpx rgba(0, 47, 167, 0.1); + border-radius: 8rpx; +} +.container .form .form-wrapper { + box-shadow: 0rpx 5rpx 15rpx 0rpx rgba(0, 47, 167, 0.1); + border-radius: 8rpx; + background-color: #fff; + overflow: hidden; +} + +.container .form .form-item .arrow { + flex: 1; + display: flex; + justify-content: space-between; + align-items: center; +} + +.container .form .form-item .record { + justify-content: flex-end; +} + +.container .form .form-item .arrow .sel-data { + color: #6d7278; +} + +.container .form .form-item .sel-time { + flex: 1; + color: #333; + display: flex; + align-items: center; + justify-content: start; +} + +.container .form .form-item .sel-time .time { + color: #6d7278; + margin: 0 20rpx; + border: 1px solid #c7cad0; + background-color: #f0f3f7; + padding: 0 20rpx; + border-radius: 8rpx; +} + +.container .form .form-item .sel-time .start-time { + margin-left: 0; +} + +.container .form .form-item .label { + margin-right: 60rpx; +} + +.container .form .form-item input { + color: #6d7278; +} + +.container .form .form-item .etherpad { + display: block; + color: #6d7278; + overflow-x: scroll; + flex: 1; +} + +.container .form .form-item textarea { + color: #6d7278; +} + +.container .form .form-item image { + width: 30rpx; + height: 30rpx; +} + +.container .form .meeting-desc { + padding-top: 30rpx; + align-items: flex-start; + height: 244rpx; + margin-bottom: 20rpx; +} + +.container .form .meeting-desc textarea { + height: 184rpx; + position: relative; +} + +.container .form .meeting-desc textarea .hint { + position: absolute; + right: 0; + bottom: 0; + color: #c7cad0; + font-size: 28rpx; +} + +.container .info { + font-size: 29rpx; + color: #6d7278; + margin-bottom: 20rpx; +} + +.container .info view { + margin: 30rpx 0; +} + +.container .info view image { + width: 28rpx; + height: 28rpx; + margin-right: 15rpx; + vertical-align: middle; +} + +.container .commit { + display: flex; + justify-content: space-between; + height: 90rpx; + font-size: 36rpx; +} + +.container .commit button { + width: 320rpx; + text-align: center; + line-height: 90rpx; + height: 100%; + border-radius: 8rpx; +} + +.container .commit .meeting-btn { + color: #fff; + background-color: #002fa7; +} + +.container .commit .meeting-reset { + color: #002fa7; + background-color: #fff; + border: 1px solid #002fa7; +} + +.container .sig-pop-wrapper { + padding: 0 30rpx; +} + +.container .sig-pop-wrapper .title { + margin: 30rpx 0 40rpx 0; + color: #222; + font-size: 36rpx; +} + +.container .sig-pop-wrapper .item .radio { + flex-direction: row-reverse; + justify-content: space-between; +} + +.container .sig-pop-wrapper .item .name { + font-size: 34rpx; + color: #6d7278; + width: 600rpx; +} + +.container .sig-pop-wrapper .item { + height: 108rpx; + display: flex; + align-items: center; + border-bottom: 1px solid #f0f3f7; +} + +.container .sig-pop-wrapper .item:last-child { + border: none; +} + +.container .sig-pop-wrapper .btn-wrapper { + display: flex; + align-items: center; + justify-content: space-between; + height: 90rpx; + font-size: 36rpx; + margin: 60rpx 0; +} + +.container .sig-pop-wrapper .btn-wrapper .confirm { + height: 100%; + width: 320rpx; + text-align: center; + line-height: 90rpx; + color: #fff; + background-color: #002fa7; +} + +.container .sig-pop-wrapper .btn-wrapper .cancel { + height: 100%; + width: 320rpx; + text-align: center; + line-height: 90rpx; + color: #002fa7; + background-color: #fff; + border: 1px solid #002fa7; +} + +.container .dialog-slot-content text { + white-space: unset; + overflow: unset; + text-overflow: unset; + +} \ No newline at end of file diff --git a/src/openeuler/package-meeting/sig/add-member.js b/src/openeuler/package-meeting/sig/add-member.js new file mode 100644 index 0000000000000000000000000000000000000000..02d852b3206c7408650b8dab627fe9cf54c08ef3 --- /dev/null +++ b/src/openeuler/package-meeting/sig/add-member.js @@ -0,0 +1,116 @@ +// pages/sig/add-member.js +var appAjax = require('./../../utils/app-ajax'); +let remoteMethods = { + getExcludeMemberList: function (postData, _callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'GET', + service: "SIG_EXCLUDE_MEMBER_LIST", + otherParams: { + id: postData.id + }, + data: { + search: postData.nickname || '' + }, + success: function (ret) { + _callback && _callback(ret); + } + }); + }, + addMemberList: function (postData, _callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'POST', + service: "ADD_MEMBER_LIST", + data: postData, + success: function (ret) { + _callback && _callback(ret); + } + }); + } +} +Page({ + + /** + * 页面的初始数据 + */ + data: { + list: [], + result: [], + sigId: '', + keyword: '' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + sigId: options.sigId + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + let that = this; + remoteMethods.getExcludeMemberList({ + id: this.data.sigId + }, function (data) { + that.setData({ + list: data + }) + }) + }, + onChange: function (e) { + this.setData({ + result: e.detail + }) + }, + comfirm: function () { + let that = this; + if (!this.data.result.length) { + wx.showToast({ + title: '请选择人员', + icon: "none", + duration: 2000 + }); + return; + } + let postData = { + ids: this.data.result.join('-'), + group_id: this.data.sigId + } + remoteMethods.addMemberList(postData, function (data) { + if (data.code === 201) { + wx.showToast({ + title: '操作成功', + icon: "success", + duration: 2000 + }); + wx.navigateBack(); + } else { + wx.showToast({ + title: '操作失败', + icon: "none", + duration: 2000 + }); + } + }) + }, + searchInput: function (e) { + let that = this; + this.setData({ + keyword: e.detail.value + }) + remoteMethods.getExcludeMemberList({ + id: this.data.sigId, + nickname: this.data.keyword + }, function (data) { + that.setData({ + list: data + }) + }) + } +}) \ No newline at end of file diff --git a/src/openeuler/package-meeting/sig/add-member.json b/src/openeuler/package-meeting/sig/add-member.json new file mode 100644 index 0000000000000000000000000000000000000000..1552ab1c6ac2d2024c02d9821723876540e8fe68 --- /dev/null +++ b/src/openeuler/package-meeting/sig/add-member.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "选择成员" +} \ No newline at end of file diff --git a/src/openeuler/package-meeting/sig/add-member.wxml b/src/openeuler/package-meeting/sig/add-member.wxml new file mode 100644 index 0000000000000000000000000000000000000000..41a47e080839d07b1b3165acffd553bb3e7e76ac --- /dev/null +++ b/src/openeuler/package-meeting/sig/add-member.wxml @@ -0,0 +1,21 @@ + + + + + + + {{list.length?'':('没有找到 '+(keyword||' ')+' 相关成员')}} + + + + + + + {{item.nickname}} + + + + + + + \ No newline at end of file diff --git a/src/openeuler/package-meeting/sig/add-member.wxss b/src/openeuler/package-meeting/sig/add-member.wxss new file mode 100644 index 0000000000000000000000000000000000000000..e5635eaa0576ee863b59721e4ae624e336c093d3 --- /dev/null +++ b/src/openeuler/package-meeting/sig/add-member.wxss @@ -0,0 +1,88 @@ +/* pages/sig/add-member.wxss */ +.container { + background-color: #fff; + margin-top: 20rpx; + margin-bottom: 150rpx; + padding: 0; +} + +.container .fill { + width: 100%; + text-align: center; + font-size: 28rpx; + color: #6d7278; + height: 28rpx; + background-color: #f5f7fa; +} + +.container .input-wraper { + box-sizing: border-box; + margin: 20rpx 0 0 0; + height: 108rpx; + position: relative; +} + +.container .input-wraper .keyword { + padding-left: 94rpx; + background-color: #fff; + border-radius: 8rpx; + height: 108rpx; + position: absolute; + top: 0; + width: 100%; + font-size: 28rpx; + line-height: 40rpx; +} + +.container .input-wraper .search-icon { + height: 39rpx; + width: 39rpx; + display: inline-block; + position: absolute; + top: 34rpx; + left: 32rpx; +} + +.container .add-item { + border-bottom: 1px solid #c7cad0; + padding: 0 30rpx; + height: 108rpx; + line-height: 108rpx; + display: flex; + align-items: center; +} + +.container .add-item image { + width: 72rpx; + height: 72rpx; + border-radius: 8rpx; + display: inline-block; + border: 1px solid #979797; + margin: 0 20rpx 0 10rpx; +} + +.container .add-item text { + display: inline-block; + height: 100%; +} + +.container .add-item .inner { + height: 100%; + display: flex; + align-items: center; +} + +.container .add-btn { + position: fixed; + bottom: 60rpx; + left: 125rpx; + width: 500rpx; + height: 90rpx; + line-height: 90rpx; + font-size: 36rpx; + color: #fff; + background-color: #002fa7; + border-radius: 8rpx; + text-align: center; + box-shadow: 0px 5px 20px 0px rgba(126, 146, 178, 0.7); +} \ No newline at end of file diff --git a/src/openeuler/package-meeting/sig/add-sig-member.js b/src/openeuler/package-meeting/sig/add-sig-member.js new file mode 100644 index 0000000000000000000000000000000000000000..b707e742ca3f1d4a76854fc5a92de4d7416afaf4 --- /dev/null +++ b/src/openeuler/package-meeting/sig/add-sig-member.js @@ -0,0 +1,64 @@ +// pages/sig/add-sig-member.js +var appAjax = require('./../../utils/app-ajax'); +let remoteMethods = { + getSigMemberList: function (id, _callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'GET', + service: "SIG_MEMBER_LIST", + otherParams: { + id: id + }, + success: function (ret) { + _callback && _callback(ret); + } + }); + } +} +Page({ + + /** + * 页面的初始数据 + */ + data: { + memberList: [], + id: "" + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + wx.setNavigationBarTitle({ + title: options.name + }) + this.setData({ + id: options.id + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + let that = this; + remoteMethods.getSigMemberList(this.data.id, function (list) { + that.setData({ + memberList: list + }) + }); + }, + toDetail: function (e) { + + }, + addMember: function () { + wx.navigateTo({ + url: '/package-meeting/sig/add-member?sigId=' + this.data.id + }) + }, + delMember: function () { + wx.navigateTo({ + url: '/package-meeting/sig/del-member?sigId=' + this.data.id + }) + } +}) \ No newline at end of file diff --git a/src/openeuler/package-meeting/sig/add-sig-member.json b/src/openeuler/package-meeting/sig/add-sig-member.json new file mode 100644 index 0000000000000000000000000000000000000000..6f5247b050d616d1d9ab35b9dec4da0b673757b8 --- /dev/null +++ b/src/openeuler/package-meeting/sig/add-sig-member.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/src/openeuler/package-meeting/sig/add-sig-member.wxml b/src/openeuler/package-meeting/sig/add-sig-member.wxml new file mode 100644 index 0000000000000000000000000000000000000000..646060dc95238887c34283df4febf89137ad80d9 --- /dev/null +++ b/src/openeuler/package-meeting/sig/add-sig-member.wxml @@ -0,0 +1,35 @@ + + + + + + + {{item.nickname}} + + + + + + + + + + + + + + + + + + + + + 该组暂无成员! + + + + \ No newline at end of file diff --git a/src/openeuler/package-meeting/sig/add-sig-member.wxss b/src/openeuler/package-meeting/sig/add-sig-member.wxss new file mode 100644 index 0000000000000000000000000000000000000000..9c9f3d3a02213e5eaf7f40becd0ad4dcf289ec7a --- /dev/null +++ b/src/openeuler/package-meeting/sig/add-sig-member.wxss @@ -0,0 +1,115 @@ +/* pages/sig/add-sig-member.wxss */ +page { + padding: 20rpx 0 0 0; +} + +.bg { + background-color: unset !important; +} + +.container { + height: 100%; + background-color: #fff; + padding: 30rpx; +} + +.container .sig-members { + width: 100%; + display: flex; + flex-wrap: wrap; +} + +.container .sig-members .item { + flex: 0 0 20%; + margin-bottom: 20rpx; + color: #b2b2b2; + font-size: 23rpx; + line-height: 33rpx; + font-weight: 400; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; +} + +.container .sig-members .item:nth-child(5n) { + margin-right: 0; +} + +.container .sig-members .item image { + display: block; + width: 100rpx; + height: 100rpx; + margin-bottom: 2rpx; + border-radius: 8rpx; + border: 1px solid #979797; +} + +.container .sig-members .item text { + display: inline-block; + width: 100rpx; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + text-align: center; +} + +.container .sig-members .item view { + width: 100rpx; + height: 100rpx; + text-align: center; + line-height: 100rpx; + border-radius: 8rpx; + border: 1px solid #c7cad0; +} + +.container .sig-members .opera-item { + justify-content: start; +} + +.container .sig-members .item view image { + display: inline-block; + height: 44rpx; + width: 44rpx; + border: none; + vertical-align: middle; +} + +.container .empty-wraper .img-wraper { + position: fixed; + top: 471rpx; + left: 260rpx; + display: flex; + flex-direction: column; + align-items: center; +} + +.container .empty-wraper .img-wraper image { + height: 256rpx; + width: 241rpx; +} + +.container .empty-wraper .img-wraper { + color: #333; + font-size: 34rpx; + line-height: 38rpx; +} + +.container .empty-wraper button { + width: 500rpx; + height: 90rpx; + line-height: 90rpx; + text-align: center; + background-color: #002fa7; + color: #fff; + font-size: 36rpx; + border-radius: 8rpx; + position: fixed; + top: 996rpx; + left: 125rpx; +} + +.container .empty-wraper button image { + width: 35rpx; + height: 35rpx; +} \ No newline at end of file diff --git a/src/openeuler/package-meeting/sig/del-member.js b/src/openeuler/package-meeting/sig/del-member.js new file mode 100644 index 0000000000000000000000000000000000000000..b07950e6cb07b8b96041675eca886c37c7b6732f --- /dev/null +++ b/src/openeuler/package-meeting/sig/del-member.js @@ -0,0 +1,98 @@ +// pages/sig/del-member.js +var appAjax = require('./../../utils/app-ajax'); +let remoteMethods = { + getCludeMemberList: function (postData, _callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'GET', + service: "SIG_CLUDE_MEMBER_LIST", + otherParams: { + id: postData.id + }, + success: function (ret) { + _callback && _callback(ret); + } + }); + }, + delMemberList: function (postData, _callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'POST', + service: "DEL_MEMBER_LIST", + data: postData, + success: function (ret) { + _callback && _callback(ret); + } + }); + } +} +Page({ + + /** + * 页面的初始数据 + */ + data: { + list: [], + result: [], + sigId: '' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + sigId: options.sigId + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + let that = this; + remoteMethods.getCludeMemberList({ + id: this.data.sigId + }, function (data) { + that.setData({ + list: data + }) + }) + }, + onChange: function (e) { + this.setData({ + result: e.detail + }) + }, + del: function () { + let that = this; + if (!this.data.result.length) { + wx.showToast({ + title: '请选择人员', + icon: "none", + duration: 2000 + }); + return; + } + let postData = { + ids: this.data.result.join('-'), + group_id: this.data.sigId + } + remoteMethods.delMemberList(postData, function (data) { + if (data.code === 204) { + wx.showToast({ + title: '操作成功', + icon: "success", + duration: 2000 + }); + wx.navigateBack(); + } else { + wx.showToast({ + title: '操作失败', + icon: "none", + duration: 2000 + }); + } + }) + } +}) \ No newline at end of file diff --git a/src/openeuler/package-meeting/sig/del-member.json b/src/openeuler/package-meeting/sig/del-member.json new file mode 100644 index 0000000000000000000000000000000000000000..1552ab1c6ac2d2024c02d9821723876540e8fe68 --- /dev/null +++ b/src/openeuler/package-meeting/sig/del-member.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "选择成员" +} \ No newline at end of file diff --git a/src/openeuler/package-meeting/sig/del-member.wxml b/src/openeuler/package-meeting/sig/del-member.wxml new file mode 100644 index 0000000000000000000000000000000000000000..4f4ebd3025ba5644f03f1d6d529183f0a5a2a93a --- /dev/null +++ b/src/openeuler/package-meeting/sig/del-member.wxml @@ -0,0 +1,16 @@ + + + + + + + + + {{item.nickname}} + + + + + + + \ No newline at end of file diff --git a/src/openeuler/package-meeting/sig/del-member.wxss b/src/openeuler/package-meeting/sig/del-member.wxss new file mode 100644 index 0000000000000000000000000000000000000000..ea73f423f1e1fc72395c4a25ae75640cceb3c545 --- /dev/null +++ b/src/openeuler/package-meeting/sig/del-member.wxss @@ -0,0 +1,51 @@ +/* pages/sig/del-member.wxss */ +.container { + background-color: #fff; + margin-top: 20rpx; + margin-bottom: 150rpx; + padding: 0; +} + +.container .del-item { + border-bottom: 1px solid #c7cad0; + padding: 0 30rpx; + height: 108rpx; + line-height: 108rpx; + display: flex; + align-items: center; +} + +.container .del-item image { + width: 72rpx; + height: 72rpx; + border-radius: 8rpx; + display: inline-block; + border: 1px solid #979797; + margin: 0 20rpx 0 10rpx; +} + +.container .del-item text { + display: inline-block; + height: 100%; +} + +.container .del-item .inner { + height: 100%; + display: flex; + align-items: center; +} + +.container .del-btn { + position: fixed; + bottom: 60rpx; + left: 125rpx; + width: 500rpx; + height: 90rpx; + line-height: 90rpx; + font-size: 36rpx; + color: #fff; + background-color: #002fa7; + border-radius: 8rpx; + text-align: center; + box-shadow: 0px 5px 20px 0px rgba(126, 146, 178, 0.7); +} \ No newline at end of file diff --git a/src/openeuler/package-meeting/sig/sig-list.js b/src/openeuler/package-meeting/sig/sig-list.js new file mode 100644 index 0000000000000000000000000000000000000000..64fd2b1a319aab92dc3e06532727c4401bb73a41 --- /dev/null +++ b/src/openeuler/package-meeting/sig/sig-list.js @@ -0,0 +1,64 @@ +// pages/sig/sig-list.js +var appAjax = require('./../../utils/app-ajax'); +let remoteMethods = { + getSigList: function (keyword, _callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'GET', + service: "SIG_LIST", + data: { + search: keyword + }, + success: function (ret) { + _callback && _callback(ret); + } + }); + } +} +Page({ + + /** + * 页面的初始数据 + */ + data: { + keyword: '', + list: [] + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + let that = this; + remoteMethods.getSigList("", function (list) { + that.setData({ + list: list + }); + }) + }, + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + toAddMember: function (e) { + wx.navigateTo({ + url: '/package-meeting/sig/add-sig-member?id=' + e.currentTarget.dataset.id + '&name=' + e.currentTarget.dataset.name + }) + }, + searchInput: function (e) { + let that = this; + remoteMethods.getSigList(e.detail.value, function (list) { + that.setData({ + list: list + }); + }) + } +}) \ No newline at end of file diff --git a/src/openeuler/package-meeting/sig/sig-list.json b/src/openeuler/package-meeting/sig/sig-list.json new file mode 100644 index 0000000000000000000000000000000000000000..f8acfeae82fb0800cada89fd6edec56a284f79a8 --- /dev/null +++ b/src/openeuler/package-meeting/sig/sig-list.json @@ -0,0 +1,7 @@ +{ + "usingComponents": { + "van-cell": "@vant/weapp/cell/index", + "van-cell-group": "@vant/weapp/cell-group/index" + }, + "navigationBarTitleText": "SIG组管理" +} \ No newline at end of file diff --git a/src/openeuler/package-meeting/sig/sig-list.wxml b/src/openeuler/package-meeting/sig/sig-list.wxml new file mode 100644 index 0000000000000000000000000000000000000000..5ecc2c7d371566058393104ea729ac3f60e61e11 --- /dev/null +++ b/src/openeuler/package-meeting/sig/sig-list.wxml @@ -0,0 +1,15 @@ + + + + + + + + + + {{item.group_name}} + + + + + \ No newline at end of file diff --git a/src/openeuler/package-meeting/sig/sig-list.wxss b/src/openeuler/package-meeting/sig/sig-list.wxss new file mode 100644 index 0000000000000000000000000000000000000000..4ed2ca29b6fc4e6324b4ca62050fc5ea8451b175 --- /dev/null +++ b/src/openeuler/package-meeting/sig/sig-list.wxss @@ -0,0 +1,53 @@ +/* pages/sig/sig-list.wxss */ +.container .input-wraper { + box-sizing: border-box; + margin: 20rpx 0 30rpx; + height: 108rpx; + position: relative; +} + +.container .input-wraper .keyword { + padding-left: 94rpx; + background-color: #fff; + border-radius: 8rpx; + box-shadow: 0px 5px 15px 0px rgba(225, 230, 238, 1); + height: 108rpx; + position: absolute; + top: 0; + width: 100%; + font-size: 28rpx; + line-height: 40rpx; +} + +.container .input-wraper .search-icon { + height: 39rpx; + width: 39rpx; + display: inline-block; + position: absolute; + top: 34rpx; + left: 32rpx; +} + +.container .sig-list .item { + height: 108rpx; + background-color: #fff; + font-size: 34rpx; + color: #333; + border-radius: 8rpx; + display: flex; + justify-content: space-between; + align-items: center; + box-shadow: 0px 5px 15px 0px rgba(225, 230, 238, 1); + padding: 0 30rpx; + margin-bottom: 20rpx; +} + +.container .sig-list .item text { + line-height: 48rpx; +} + +.container .sig-list .item image { + flex-shrink: 1; + width: 31rpx; + height: 31rpx; +} \ No newline at end of file diff --git a/src/openeuler/package-my/events/my-list.js b/src/openeuler/package-my/events/my-list.js new file mode 100644 index 0000000000000000000000000000000000000000..41362f80c969af66f6dc0e33c5d9ef69d8adca34 --- /dev/null +++ b/src/openeuler/package-my/events/my-list.js @@ -0,0 +1,351 @@ +// package-my/events/under-release.js +const appAjax = require('./../../utils/app-ajax'); +const sessionUtil = require("../../utils/app-session.js"); + +let that = null; +let remoteMethods = { + getList: function (_callback) { + let service = ''; + if (that.data.type == 4) { + service = 'GET_DRAFT_LIST' + } else if (that.data.type == 1) { + service = 'DRAFTS' + } else if (that.data.type == 5) { + service = 'PUBLISHER_EVENTS_LIST' + } else if (that.data.type == 2) { + if (that.data.level == 2) { + service = 'MY_EVENTS_LIST' + } else { + service = 'ALL_EVENTS_LIST' + } + + } else if (that.data.type == 6) { + service = 'EVENT_COLLECT_LIST' + } else if (that.data.type == 7) { + service = 'MY_SIGNUP_EVENTS' + } else if (that.data.type == 3) { + if (that.data.level == 2) { + service = 'MY_EVENTS_LIST' + } else { + service = 'ALL_EVENTS_LIST' + } + + } + appAjax.postJson({ + autoShowWait: true, + type: 'GET', + service, + success: function (ret) { + _callback && _callback(ret); + } + }); + }, + delDraft: function (_callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'DELETE', + service: 'DRAFT_DETAIL', + otherParams: { + id: that.data.curId + }, + success: function (ret) { + _callback && _callback(ret); + } + }); + }, + delEvent: function (_callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'PUT', + service: 'DEL_EVENT', + otherParams: { + id: that.data.curId + }, + success: function (ret) { + _callback && _callback(ret); + } + }); + }, + collect: function (_callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'POST', + service: 'EVENT_COLLECT', + data: { + activity: that.data.curId + }, + success: function (ret) { + _callback && _callback(ret); + } + }); + }, + unCollect: function (_callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'DELETE', + service: 'EVENT_UNCOLLECT', + otherParams: { + id: that.data.collectionId + }, + success: function (ret) { + _callback && _callback(ret); + } + }); + }, + getSignUpInfo: function (id, _callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'GET', + service: 'GET_SIGNUP_INFO', + otherParams: { + id + }, + success: function (ret) { + _callback && _callback(ret); + } + }); + } +} +Page({ + + /** + * 页面的初始数据 + */ + data: { + type: 1, + list: [], + level: 1, + actionShow: false, + actions: [], + curId: '', + userId: '', + collectionId: '', + showDialogDel: false, + noAuthDialogShow: false, + user: '', + registerId: '' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + type: options.type, + level: sessionUtil.getUserInfoByKey('eventLevel'), + user: sessionUtil.getUserInfoByKey('userId') + }) + that = this; + let title = ''; + if (options.type == 1) { + title = '待发布'; + } else if (options.type == 2) { + title = '已发布'; + } else if (options.type == 3) { + title = '报名表单'; + } else if (options.type == 4) { + title = '草稿箱'; + } else if (options.type == 5) { + title = '发布中'; + } else if (options.type == 6) { + title = '我收藏的活动'; + } else if (options.type == 7) { + title = '我报名的活动'; + } + wx.setNavigationBarTitle({ + title + }) + }, + + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + remoteMethods.getList(res => { + this.setData({ + list: res + }) + + }) + }, + toSign(e) { + wx.navigateTo({ + url: `/package-events/events/sign?id=${e.currentTarget.dataset.id}` + }) + }, + editDraft(e) { + wx.navigateTo({ + url: `/package-events/events/event-detail?id=${e.currentTarget.dataset.id}&type=4` + }) + }, + onActionClose() { + this.setData({ + actionShow: false + }) + }, + onActionSelect(e) { + if (this.data.type == 4) { + remoteMethods.delDraft(() => { + this.onShow(); + }) + } else if ((this.data.type == 2) || (this.data.type == 6) || (this.data.type == 7)) { + if (this.data.level == 3) { + if (e.detail.operaType == 1) { + if (this.data.collectionId) { + remoteMethods.unCollect(() => { + this.onShow(); + }) + } else { + remoteMethods.collect(() => { + this.onShow(); + }) + } + } else { + this.setData({ + showDialogDel: true + }) + } + } else { + if (e.detail.operaType == 1) { + if (this.data.collectionId) { + remoteMethods.unCollect(() => { + this.onShow(); + }) + } else { + remoteMethods.collect(() => { + this.onShow(); + }) + } + } else if(e.detail.operaType == 3) { + remoteMethods.getSignUpInfo(this.data.curId, (res) => { + wx.navigateTo({ + url: `/package-events/sign-up/sign-up-success?name=${encodeURIComponent(res.name)}&title=${encodeURIComponent(res.title)}&tel=${encodeURIComponent(res.telephone)}&poster=${encodeURIComponent(res.poster)}&id=${encodeURIComponent(this.data.curId)}` + }) + }) + } else { + this.setData({ + noAuthDialogShow: true + }) + } + } + + } + }, + onMore(e) { + this.setData({ + actionShow: true, + curId: e.currentTarget.dataset.item.id, + userId: e.currentTarget.dataset.item.user, + collectionId: e.currentTarget.dataset.item.collection_id || '', + registerId: e.currentTarget.dataset.item.register_id || '' + }) + const strTemp = this.data.collectionId ? '取消收藏' : '收藏活动'; + if (this.data.type == 4) { + this.setData({ + actions: [{ + name: '删除', + operaType: 1 + }] + }) + } else if ((this.data.type == 2) || (this.data.type == 6) || (this.data.type == 7)) { + if (this.data.level == 3) { + this.setData({ + actions: [{ + name: strTemp, + operaType: 1 + }, + { + name: '下架活动', + operaType: 2 + } + ] + }) + } else { + if (this.data.user == this.data.userId) { + this.setData({ + actions: [{ + name: strTemp, + operaType: 1 + }, + { + name: '下架活动', + operaType: 2 + } + ] + }) + } else { + this.setData({ + actions: [{ + name: strTemp, + operaType: 1 + }] + }) + } + + if (this.data.registerId) { + let tempArr = this.data.actions; + tempArr.unshift({ + name: '查看门票', + operaType: 3 + }) + this.setData({ + actions: tempArr + }) + } + } + } + + }, + toExamine(e) { + wx.navigateTo({ + url: `/package-events/events/event-detail?id=${e.currentTarget.dataset.id}&type=1` + }) + }, + del() { + this.setData({ + showDialogDel: false + }) + remoteMethods.delEvent(() => { + remoteMethods.getList(res => { + this.setData({ + list: res + }) + + }); + }) + }, + delCancel() { + this.setData({ + showDialogDel: false + }) + }, + toUpdateSchedule(e) { + if (this.data.type == 4) { + this.editDraft(e); + } else if ((this.data.type == 2) || (this.data.type == 6) || (this.data.type == 7)) { + wx.navigateTo({ + url: `/package-events/events/event-detail?id=${e.currentTarget.dataset.id}&type=5` + }) + } else if (this.data.type == 3) { + this.sendEmail(e); + } + + }, + copyWechat() { + wx.setClipboardData({ + data: 'openeuler123', + success: () => { + this.setData({ + noAuthDialogShow: false + }) + } + }) + + }, + sendEmail(e) { + wx.navigateTo({ + url: `/package-my/events/send-email?id=${e.currentTarget.dataset.id}` + }) + } +}) \ No newline at end of file diff --git a/src/openeuler/package-my/events/my-list.json b/src/openeuler/package-my/events/my-list.json new file mode 100644 index 0000000000000000000000000000000000000000..6f5247b050d616d1d9ab35b9dec4da0b673757b8 --- /dev/null +++ b/src/openeuler/package-my/events/my-list.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/src/openeuler/package-my/events/my-list.wxml b/src/openeuler/package-my/events/my-list.wxml new file mode 100644 index 0000000000000000000000000000000000000000..09b1063e3e1ccad012be86d2e692a46d1fb171f2 --- /dev/null +++ b/src/openeuler/package-my/events/my-list.wxml @@ -0,0 +1,106 @@ + + + + + + + {{item.enterprise}} + + + + + + + + {{item.title}} + + + {{item.date}} + + + + {{item.address||item.join_url}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 已报名 {{item.register_count}}人 + + + + + + + + + + + + + + + + + 暂无活动! + + + + + 请确认下架当前活动 + + + + + + + + + + 活动一经发布,暂不支持自行下架删除。如有需要,请联系 + 小助手 (微信号openeuler123) + 下架活动 + + + + + + + \ No newline at end of file diff --git a/src/openeuler/package-my/events/my-list.wxss b/src/openeuler/package-my/events/my-list.wxss new file mode 100644 index 0000000000000000000000000000000000000000..c51749d69bb442b28fd5db47aa7379adf7024ad5 --- /dev/null +++ b/src/openeuler/package-my/events/my-list.wxss @@ -0,0 +1,210 @@ +/* package-my/events/under-release.wxss */ +page { + background-color: #f5f7fa !important; +} + +.container .event-list-wrapper { + padding: 30rpx 0 0; +} + +.container .event-list-wrapper .event-item { + margin-bottom: 30rpx; + box-shadow: 0rpx 5rpx 15rpx 0rpx rgba(0, 47, 167, 0.1); + border-radius: 8rpx; + overflow: hidden; + position: relative; + background-color: #fff; +} + +.container .event-list-wrapper .event-item .collection { + width: 40rpx; + height: 26rpx; + position: absolute; + top: 33rpx; + left: 0; +} + +.container .event-list-wrapper .event-item .header { + height: 90rpx; + padding: 0 30rpx; + display: flex; + justify-content: space-between; + align-items: center; + font-size: 28rpx; + color: #333; + border-bottom: 2rpx solid #f0f3f7; +} + +.container .event-list-wrapper .event-item .isCollection { + padding-left: 60rpx; +} + +.container .event-list-wrapper .event-item .header image { + height: 36rpx; + width: 8rpx; +} + +.container .event-list-wrapper .event-item .body { + padding: 30rpx; + display: flex; +} + +.container .event-list-wrapper .event-item .body .left { + margin-right: 20rpx; +} + +.container .event-list-wrapper .event-item .body .left image { + width: 241rpx; + height: 241rpx; + border-radius: 8rpx; +} + +.container .event-list-wrapper .event-item .body .right .title { + font-size: 30rpx; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + margin-bottom: 20rpx; + width: 380rpx; +} + +.container .event-list-wrapper .event-item .body .right .date { + margin-bottom: 20rpx; + font-size: 24rpx; + color: #6d7278; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + width: 380rpx; +} + +.container .event-list-wrapper .event-item .body .right .date image { + height: 28rpx; + width: 28rpx; + margin-right: 16rpx; + vertical-align: middle; +} +.container .event-list-wrapper .event-item .body .right .date text { + vertical-align: middle; +} + +.container .event-list-wrapper .event-item .body .right .address { + font-size: 24rpx; + color: #6d7278; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + width: 380rpx; + margin-bottom: 30rpx; +} + +.container .event-list-wrapper .event-item .body .right .address image { + height: 28rpx; + width: 28rpx; + margin-right: 16rpx; + vertical-align: middle; +} + +.container .event-list-wrapper .event-item .body .right .address image text { + vertical-align: middle; +} + +.container .event-list-wrapper .event-item .body .right .button { + text-align: right; + height: 68rpx; +} + +.container .event-list-wrapper .event-item .body .right .button button { + height: 68rpx; + width: 172rpx; + text-align: center; + line-height: 68rpx; + color: #fff; + background-color: #002fa7; + border-radius: 8rpx; + font-size: 28rpx; + display: inline-block; +} + +.container .event-list-wrapper .event-item .body .right .button .sign-btn { + margin-right: 30rpx; +} + +.container .event-list-wrapper .event-item .body .right .button .register { + background-color: #6682ca; +} + +.container .event-list-wrapper .event-item .mask { + position: absolute; + height: 100%; + width: 100%; + background-color: #002fa7; + opacity: 0.65; + top: 0; + left: 0; +} + +.container .event-list-wrapper .event-item .mask .mask-img { + position: absolute; + height: 137rpx; + width: 180rpx; + left: 50%; + top: 50%; + margin-left: -90rpx; + margin-top: -68rpx; +} + +.empty-status .suc-wrapper { + position: absolute; + top: 50%; + transform: translate(-50%, -50%); + left: 50%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +.empty-status .suc-wrapper image { + width: 234rpx; + height: 218rpx; +} + +.empty-status .suc-wrapper text { + text-align: center; + margin-top: 20rpx; + font-size: 34rpx; + color: #333; +} + +.container .event-list-wrapper .event-item .sendSignUpInfo { + height: 118rpx; + display: flex; + padding: 0 30rpx; + align-items: center; + justify-content: space-between; + border-top: 2rpx solid #f0f3f7; +} + +.container .event-list-wrapper .event-item .sendSignUpInfo .signUpNum { + font-size: 24rpx; + color: #002fa7; +} + +.container .event-list-wrapper .event-item .sendSignUpInfo .sendBtn { + height: 68rpx; + width: 236rpx; + text-align: center; + line-height: 68rpx; + background-color: #002fa7; + color: #fff; + border-radius: 8rpx ; + margin: unset; + font-size: 28rpx; + padding: unset; +} + +.container .event-list-wrapper .event-item .body .small image { + width: 180rpx; + height: 180rpx; +} \ No newline at end of file diff --git a/src/openeuler/package-my/events/send-email.js b/src/openeuler/package-my/events/send-email.js new file mode 100644 index 0000000000000000000000000000000000000000..34f89b9ff3fe2d77c2225dffa2b7be12dd7e5ffe --- /dev/null +++ b/src/openeuler/package-my/events/send-email.js @@ -0,0 +1,68 @@ +// package-my/events/send-email.js +const appAjax = require('./../../utils/app-ajax'); +const validationConfig = require('./../../config/field-validate-rules'); + +let that = null; + +let remoteMethods = { + sendEmail: function (_callback) { + if(!validationConfig.email.regex.test(that.data.emailAddress)){ + wx.showToast({ + title: '请输入正确的邮箱地址', + icon: "none", + duration: 2000 + }); + return; + } + appAjax.postJson({ + autoShowWait: true, + type: 'POST', + service: "SEND_SIGNUP_INFO", + data: { + activity: that.data.id, + mailto: that.data.emailAddress + }, + success: function (ret) { + _callback && _callback(ret); + } + }); + } +} +Page({ + + /** + * 页面的初始数据 + */ + data: { + emailAddress: '', + id: '' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + that = this; + this.setData({ + id: options.id + }) + }, + onInput: function (e) { + this.setData({ + emailAddress: e.detail.value + }) + }, + confirm() { + remoteMethods.sendEmail(() => { + wx.showToast({ + title: '发送成功', + icon: "success", + duration: 2000, + mask: true + }); + setTimeout(() => { + wx.navigateBack(); + }, 2000) + }) + } +}) \ No newline at end of file diff --git a/src/openeuler/package-my/events/send-email.json b/src/openeuler/package-my/events/send-email.json new file mode 100644 index 0000000000000000000000000000000000000000..ca6b4b5aae836072946488de3ad51e18cf36bc56 --- /dev/null +++ b/src/openeuler/package-my/events/send-email.json @@ -0,0 +1,3 @@ +{ + "navigationBarTitleText": "报名表单" +} \ No newline at end of file diff --git a/src/openeuler/package-my/events/send-email.wxml b/src/openeuler/package-my/events/send-email.wxml new file mode 100644 index 0000000000000000000000000000000000000000..e953eff997b9e64399eb4063af81f20f476807b2 --- /dev/null +++ b/src/openeuler/package-my/events/send-email.wxml @@ -0,0 +1,8 @@ + + + 邮箱地址 + + + + + \ No newline at end of file diff --git a/src/openeuler/package-my/events/send-email.wxss b/src/openeuler/package-my/events/send-email.wxss new file mode 100644 index 0000000000000000000000000000000000000000..b9fa2341b1442927aa70cbe1d642ce268dd8f1fd --- /dev/null +++ b/src/openeuler/package-my/events/send-email.wxss @@ -0,0 +1,46 @@ +/* package-my/events/send-email.wxss */ +page { + background-color: #f5f7fa !important; +} +.container { + padding: 20rpx 0; +} + +.container .input-title { + padding-left: 30rpx; + margin: 30rpx 0; + color: #333; + font-size: 34rpx; + line-height: 48rpx; + font-weight: 400; +} + +.container input { + height: 108rpx; + color: #333; + line-height: 45rpx; + font-size: 32rpx; + font-weight: 400rpx; + padding-left: 30rpx; + background-color: #fff; +} + +.container .btn-wraper { + margin-top: 128rpx; + display: flex; + justify-content: space-between; + padding: 0 30rpx; +} + +.container .btn-wraper button { + width: 500rpx; + height: 90rpx; + font-size: 36rpx; + line-height: 90rpx; + text-align: center; +} + +.container .btn-wraper .confirm { + color: #fff; + background-color: #002fa7; +} \ No newline at end of file diff --git a/src/openeuler/package-my/my/feedback.js b/src/openeuler/package-my/my/feedback.js new file mode 100644 index 0000000000000000000000000000000000000000..e3ed7c49ed6b844034b8dd74bc88523980c0bb34 --- /dev/null +++ b/src/openeuler/package-my/my/feedback.js @@ -0,0 +1,82 @@ +// package-my/my/feedback.js +const appAjax = require('./../../utils/app-ajax'); +const validationConfig = require('./../../config/field-validate-rules'); + +let that = null; + +let remoteMethods = { + saveFeedback: function (_callback) { + if(!that.data.content){ + wx.showToast({ + title: '请输入留言反馈', + icon: "none", + duration: 2000 + }); + return; + } + if(!validationConfig.email.regex.test(that.data.email)){ + wx.showToast({ + title: '请输入正确的邮箱地址', + icon: "none", + duration: 2000 + }); + return; + } + appAjax.postJson({ + autoShowWait: true, + type: 'POST', + service: "SAVE_FEEDBACK", + data: { + feedback_type: that.data.type, + feedback_content: that.data.content, + feedback_email: that.data.email + }, + success: function (ret) { + _callback && _callback(ret); + } + }); + } +} +Page({ + + /** + * 页面的初始数据 + */ + data: { + type: 1, + content: '', + email: '' + }, + onLoad() { + that = this; + }, + switchTab(e) { + this.setData({ + type: e.currentTarget.dataset.index + }) + }, + contentInput(e) { + this.setData({ + content: e.detail.value + }) + }, + emailInput(e) { + this.setData({ + email: e.detail.value + }) + }, + saveFeedback() { + remoteMethods.saveFeedback(() => { + wx.showToast({ + title: '提交成功', + icon: "success", + duration: 2000, + mask: true + }); + setTimeout(() => { + wx.navigateBack(); + }, 2000) + }) + } + +}) \ No newline at end of file diff --git a/src/openeuler/package-my/my/feedback.json b/src/openeuler/package-my/my/feedback.json new file mode 100644 index 0000000000000000000000000000000000000000..49e89594aba96235038a41afaf901326ac4d46ca --- /dev/null +++ b/src/openeuler/package-my/my/feedback.json @@ -0,0 +1,3 @@ +{ + "navigationBarTitleText": "留言反馈" +} \ No newline at end of file diff --git a/src/openeuler/package-my/my/feedback.wxml b/src/openeuler/package-my/my/feedback.wxml new file mode 100644 index 0000000000000000000000000000000000000000..9bd9b9e4f986b962fc9a0442bb5869da6184b21d --- /dev/null +++ b/src/openeuler/package-my/my/feedback.wxml @@ -0,0 +1,40 @@ + + + + + 反馈类型 + + 问题反馈 + 产品建议 + + + + + 留言反馈 + * + + + + + + 邮箱地址 + * + + + + + + + + + * + 号为必填项 + + + + + + + \ No newline at end of file diff --git a/src/openeuler/package-my/my/feedback.wxss b/src/openeuler/package-my/my/feedback.wxss new file mode 100644 index 0000000000000000000000000000000000000000..06d4dabcfe1aff0f9cf2635ed666d50ecb6260fb --- /dev/null +++ b/src/openeuler/package-my/my/feedback.wxss @@ -0,0 +1,140 @@ +/* package-my/my/feedback.wxss */ +page { + background-color: #f5f7fa !important; +} + +.container { + padding: 20rpx 0 129rpx 0; +} + +textarea { + height: 45rpx; + flex: 1; +} + +input { + flex: 1; +} + +.require { + color: #f76270; +} + +.placeholder { + color: #c7cad0; +} + +.container .form .form-item { + padding: 0 30rpx; + background-color: #fff; + height: 108rpx; + color: #333; + font-size: 34rpx; + display: flex; + align-items: center; + justify-content: start; +} + +.container .form .form-wrapper { + box-shadow: 0rpx 5rpx 15rpx 0rpx rgba(0, 47, 167, 0.1); + border-radius: 8rpx; + background-color: #fff; + overflow: hidden; +} + + + +.container .form .form-item .label { + margin-right: 60rpx; +} + +.container .form .form-item input { + color: #6d7278; +} + + +.container .form .form-item textarea { + color: #6d7278; +} + +.container .form .form-item image { + width: 30rpx; + height: 30rpx; +} + +.container .form .meeting-desc { + padding-top: 30rpx; + align-items: flex-start; + height: 244rpx; + margin: 20rpx 0; +} + +.container .form .meeting-desc textarea { + height: 184rpx; + position: relative; +} + +.container .form .meeting-desc textarea .hint { + position: absolute; + right: 0; + bottom: 0; + color: #c7cad0; + font-size: 28rpx; +} + +.container .info { + font-size: 29rpx; + color: #6d7278; + margin-bottom: 20rpx; + padding: 0 30rpx; +} + +.container .info view { + margin: 30rpx 0; +} + +.container .info view image { + width: 28rpx; + height: 28rpx; + margin-right: 15rpx; + vertical-align: middle; +} + +.container .commit { + display: flex; + justify-content: space-between; + height: 90rpx; + font-size: 36rpx; + margin-top: 108rpx; +} + +.container .commit button { + width: 500rpx; + text-align: center; + line-height: 90rpx; + height: 100%; + border-radius: 8rpx; +} + +.container .commit .meeting-btn { + color: #fff; + background-color: #002fa7; +} + +.container .form .form-item .type .tab { + width: 152rpx; + height: 56rpx; + border: 2rpx solid #c7cad0; + border-radius: 8rpx; + color:#c7cad0; + font-size: 28rpx; + text-align: center; + line-height: 56rpx; + margin-right: 20rpx; + display: inline-block; +} + +.container .form .form-item .type .active { + border: 2rpx solid #002fa7; + color:#002fa7; +} \ No newline at end of file diff --git a/src/openeuler/package-my/my/help.js b/src/openeuler/package-my/my/help.js new file mode 100644 index 0000000000000000000000000000000000000000..4f7f4a504f7ba2d01edb6be466fddff59ad7f08b --- /dev/null +++ b/src/openeuler/package-my/my/help.js @@ -0,0 +1,35 @@ +// pages/my/help.js +const resourceUrl = 'https://openeuler-website.obs.ap-southeast-1.myhuaweicloud.com/help'; + +Page({ + + /** + * 页面的初始数据 + */ + data: { + list: [ + { + name: '会议攻略', + contentImg: [ + resourceUrl + '/11.png', + resourceUrl + '/12.png', + resourceUrl + '/13.png' + ] + }, + { + name: '活动攻略', + contentImg: [ + resourceUrl + '/21.png', + resourceUrl + '/22.png', + resourceUrl + '/23.png' + ] + } + ], + curIndex: 0 + }, + switchTab(e) { + this.setData({ + curIndex: e.currentTarget.dataset.index + }) + } +}) \ No newline at end of file diff --git a/src/openeuler/package-my/my/help.json b/src/openeuler/package-my/my/help.json new file mode 100644 index 0000000000000000000000000000000000000000..99296ebde26b8b9711880d6d8e763bc068c2a761 --- /dev/null +++ b/src/openeuler/package-my/my/help.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "小程序使用攻略" +} \ No newline at end of file diff --git a/src/openeuler/package-my/my/help.wxml b/src/openeuler/package-my/my/help.wxml new file mode 100644 index 0000000000000000000000000000000000000000..84f62002729bcfd026b0ddb546506c1d8e815f5b --- /dev/null +++ b/src/openeuler/package-my/my/help.wxml @@ -0,0 +1,12 @@ + + + + {{item.name}} + + + + + + + + \ No newline at end of file diff --git a/src/openeuler/package-my/my/help.wxss b/src/openeuler/package-my/my/help.wxss new file mode 100644 index 0000000000000000000000000000000000000000..f8522a7e1adf1b03cd244f89dd3f7c7738e3fd56 --- /dev/null +++ b/src/openeuler/package-my/my/help.wxss @@ -0,0 +1,41 @@ +/* pages/my/help.wxss */ +page { + background-color: #f5f7fa; +} + +.container { + padding: 0 !important; +} + +.container .tabs { + height: 134rpx; + display: flex; + justify-content: space-around; + align-items: center; + margin-bottom: 20rpx; + background-color: #fff; +} + +.container .tabs .tab-item { + color: #c7cad0; + font-size: 34rpx; + height: 100%; + line-height: 134rpx; +} + +.container .tabs .active { + border-bottom: 10rpx solid #3265e8; + color: #333; + border-radius: 0 0 5px 5px; +} + +.container .tab-content { + background-color: #fff; + padding: 40rpx 30rpx 0; +} + +.container .tab-content image { + width: 690rpx; + height: 1100rpx; + margin-bottom: 40rpx; +} \ No newline at end of file diff --git a/src/openeuler/package-my/my/my-collection.js b/src/openeuler/package-my/my/my-collection.js new file mode 100644 index 0000000000000000000000000000000000000000..a155d0534e2d9e601672d3b3c2315110d61198a8 --- /dev/null +++ b/src/openeuler/package-my/my/my-collection.js @@ -0,0 +1,10 @@ +// pages/my/my-collection.js + +Page({ + + /** + * 页面的初始数据 + */ + data: { + } +}) \ No newline at end of file diff --git a/src/openeuler/package-my/my/my-collection.json b/src/openeuler/package-my/my/my-collection.json new file mode 100644 index 0000000000000000000000000000000000000000..669e3288c1280eee561c6498c99c5273b0a20fb2 --- /dev/null +++ b/src/openeuler/package-my/my/my-collection.json @@ -0,0 +1,6 @@ +{ + "usingComponents": { + "meeting-list": "/components/meeting-list/meeting-list" + }, + "navigationBarTitleText": "我收藏的会议" +} \ No newline at end of file diff --git a/src/openeuler/package-my/my/my-collection.wxml b/src/openeuler/package-my/my/my-collection.wxml new file mode 100644 index 0000000000000000000000000000000000000000..c7b754a832da0e03dee62726a338fced2876fbe3 --- /dev/null +++ b/src/openeuler/package-my/my/my-collection.wxml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/openeuler/package-my/my/my-collection.wxss b/src/openeuler/package-my/my/my-collection.wxss new file mode 100644 index 0000000000000000000000000000000000000000..9ff0e18274f78a045da4be6f18afb2cd45fe1859 --- /dev/null +++ b/src/openeuler/package-my/my/my-collection.wxss @@ -0,0 +1,7 @@ +/* pages/my/my-collection.wxss */ +page { + background-color: #f5f7fa !important; +} +.container { + padding-top: 30rpx; +} \ No newline at end of file diff --git a/src/openeuler/package-my/my/my-meetings.js b/src/openeuler/package-my/my/my-meetings.js new file mode 100644 index 0000000000000000000000000000000000000000..361bc3f40ff946ef21887199742b63cf182cd5f1 --- /dev/null +++ b/src/openeuler/package-my/my/my-meetings.js @@ -0,0 +1,10 @@ +// pages/my/my-meetings.js + +Page({ + + /** + * 页面的初始数据 + */ + data: { + } +}) \ No newline at end of file diff --git a/src/openeuler/package-my/my/my-meetings.json b/src/openeuler/package-my/my/my-meetings.json new file mode 100644 index 0000000000000000000000000000000000000000..168d7ff70d23cc9fa27fcd08be7ef0deb4556e2d --- /dev/null +++ b/src/openeuler/package-my/my/my-meetings.json @@ -0,0 +1,6 @@ +{ + "usingComponents": { + "meeting-list": "/components/meeting-list/meeting-list" + }, + "navigationBarTitleText": "我创建的会议" +} \ No newline at end of file diff --git a/src/openeuler/package-my/my/my-meetings.wxml b/src/openeuler/package-my/my/my-meetings.wxml new file mode 100644 index 0000000000000000000000000000000000000000..94b3f5160f5fbdcb839882eaf98a2dde465fe058 --- /dev/null +++ b/src/openeuler/package-my/my/my-meetings.wxml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/openeuler/package-my/my/my-meetings.wxss b/src/openeuler/package-my/my/my-meetings.wxss new file mode 100644 index 0000000000000000000000000000000000000000..0254da61198987fa3b7ad74207a471188c4cdd2c --- /dev/null +++ b/src/openeuler/package-my/my/my-meetings.wxss @@ -0,0 +1,7 @@ +/* pages/my/my-meetings.wxss */ +page { + background-color: #f5f7fa !important; +} +.container { + padding-top: 30rpx; +} \ No newline at end of file diff --git a/src/openeuler/package-my/my/privecy.js b/src/openeuler/package-my/my/privecy.js new file mode 100644 index 0000000000000000000000000000000000000000..142b35e59457443687e299f1339958d9dab1d22d --- /dev/null +++ b/src/openeuler/package-my/my/privecy.js @@ -0,0 +1,66 @@ +// pages/my/privecy.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/src/openeuler/package-my/my/privecy.json b/src/openeuler/package-my/my/privecy.json new file mode 100644 index 0000000000000000000000000000000000000000..3423d3d0801156ceffd76783be92f9592fee27aa --- /dev/null +++ b/src/openeuler/package-my/my/privecy.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "社区隐私声明" +} \ No newline at end of file diff --git a/src/openeuler/package-my/my/privecy.wxml b/src/openeuler/package-my/my/privecy.wxml new file mode 100644 index 0000000000000000000000000000000000000000..427e8e2e3ce2893cbc72391c33e6865333f530ae --- /dev/null +++ b/src/openeuler/package-my/my/privecy.wxml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/openeuler/package-my/my/privecy.wxss b/src/openeuler/package-my/my/privecy.wxss new file mode 100644 index 0000000000000000000000000000000000000000..bb8d74b6f0ae1d9c18d963fed84fdbbf0370b82d --- /dev/null +++ b/src/openeuler/package-my/my/privecy.wxss @@ -0,0 +1,8 @@ +/* pages/my/privecy.wxss */ +page { + background-color: #fff; +} + +.container image { + width: 100%; +} \ No newline at end of file diff --git a/src/openeuler/package-my/my/qrcode.js b/src/openeuler/package-my/my/qrcode.js new file mode 100644 index 0000000000000000000000000000000000000000..715ff69db087765f0d38e94be138065be4980d71 --- /dev/null +++ b/src/openeuler/package-my/my/qrcode.js @@ -0,0 +1,65 @@ +// package-my/my/qrcode.js +const resourceUrl = 'https://openeuler-website.obs.ap-southeast-1.myhuaweicloud.com/qrcode/'; +Page({ + + /** + * 页面的初始数据 + */ + data: { + type: 0, + data: [ + { + avatar: resourceUrl + '编组.png', + name: 'openEuler', + qrcode: resourceUrl + 'openeuler公众号.png' + }, + { + avatar: resourceUrl + 'Bilibili-B站.png', + name: 'bilibili', + qrcode: resourceUrl + 'openeuler哩哩哔哔.png' + }, + { + avatar: resourceUrl + '今日头条.png', + name: '今日头条', + qrcode: resourceUrl + 'openeuler今日头条.png' + } + ] + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + type: options.type - 1 + }) + }, + saveQrcode() { + const that = this; + wx.getSetting({ + success(res) { + wx.downloadFile({ + url: that.data.data[that.data.type].qrcode, + success: function(res) { + wx.saveImageToPhotosAlbum({ + filePath: res.tempFilePath, + success: function(data) { + wx.showToast({ + title: "保存成功", + icon: "success", + duration: 2000 + }); + }, + fail: function(err) { + console.log(err); + }, + complete(res) { + console.log(res); + } + }); + } + }); + } + }); + } +}) \ No newline at end of file diff --git a/src/openeuler/package-my/my/qrcode.json b/src/openeuler/package-my/my/qrcode.json new file mode 100644 index 0000000000000000000000000000000000000000..6f5247b050d616d1d9ab35b9dec4da0b673757b8 --- /dev/null +++ b/src/openeuler/package-my/my/qrcode.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/src/openeuler/package-my/my/qrcode.wxml b/src/openeuler/package-my/my/qrcode.wxml new file mode 100644 index 0000000000000000000000000000000000000000..fec6e4d05e4a120ab1935f1406479e52567771e9 --- /dev/null +++ b/src/openeuler/package-my/my/qrcode.wxml @@ -0,0 +1,9 @@ + + + + {{data[type].name}} + + 1.保存二维码 → 2.用微信从相册选图扫描 → 3.关注 + + + diff --git a/src/openeuler/package-my/my/qrcode.wxss b/src/openeuler/package-my/my/qrcode.wxss new file mode 100644 index 0000000000000000000000000000000000000000..9c78ff2e4b68518b70eb5776df9eb074d3861885 --- /dev/null +++ b/src/openeuler/package-my/my/qrcode.wxss @@ -0,0 +1,53 @@ +/* package-my/my/qrcode.wxss */ +.container { + height: 1502rpx; + background: url(https://openeuler-website.obs.ap-southeast-1.myhuaweicloud.com/qrcode/back.png) no-repeat; + background-size: 100% 100%; + display: flex; + flex-direction: column; + align-items: center; +} + +.container .avatar { + margin-top: 188rpx; + width: 128rpx; + height: 128rpx; + border-radius: 100%; +} + +.container .name { + margin-top: 20rpx; + color: #333; + font-size: 34rpx; + line-height: 48rpx; +} +.container .line { + height: 2rpx; + width: 500rpx; + border-top: 2rpx solid #f0f3f7; + margin-top: 30rpx; +} + +.container .qrcode-desc { + margin-top: 128rpx; + font-size: 24rpx; + line-height: 38rpx; + color: #6d7278; +} + +.container .qrcode { + margin-top: 30rpx; + width: 300rpx; + height: 300rpx; +} + +.container button { + margin-top: 128rpx; + width: 500rpx; + height: 90rpx; + line-height: 90rpx; + border-radius: 8rpx; + background-color: #002fa7; + text-align: center; + color: #fff; +} \ No newline at end of file diff --git a/src/openeuler/package.json b/src/openeuler/package.json new file mode 100644 index 0000000000000000000000000000000000000000..30006d8d79bc826c966013d0e8ec698bbae59804 --- /dev/null +++ b/src/openeuler/package.json @@ -0,0 +1,6 @@ +{ + "dependencies": { + "@vant/weapp": "^1.6.8", + "wxml-to-canvas": "^1.1.1" + } +} diff --git a/src/openeuler/pages/auth/auth.js b/src/openeuler/pages/auth/auth.js new file mode 100644 index 0000000000000000000000000000000000000000..d13ca7647bda68eb65fe5e4ac2c008d593f1f59e --- /dev/null +++ b/src/openeuler/pages/auth/auth.js @@ -0,0 +1,74 @@ +// pages/auth/auth.js +const mixin = require("../../utils/page-mixin.js").$pageMixin; +const appUser = require("../../utils/app-user.js"); +const app = getApp(); +let that = null; +Page(mixin({ + + /** + * 页面的初始数据 + */ + data: { + id: '', + canIUseGetUserProfile: false + }, + onLoad(options) { + that = this; + if (options.id) { + this.setData({ + id: options.id + }) + } + if (wx.getUserProfile) { + this.setData({ + canIUseGetUserProfile: true + }) + } + }, + onShow() { + + }, + /** + * 绑定获取用户信息 + */ + bindGetUserInfo: function (e) { + + wx.getSetting({ + success: function (res) { + + if (res.authSetting['scope.userInfo']) { + appUser.wxLogin(function (result) { + const pages = getCurrentPages(); // 当前页面 + const beforePage = ((pages[pages.length - 2].route === 'pages/auth/auth') ? pages[pages.length - 3] : pages[pages.length - 2]); // 前一个页面 + const id = beforePage.options.id || beforePage.options.scene || that.data.id; + const url = id ? '/' + beforePage.route + '?id=' + id : '/' + beforePage.route + wx.reLaunch({ + url: url + }) + }); + } + } + }); + }, + bindGetUserProfile() { + wx.getUserProfile({ + desc: '用于会议和活动所需信息', + success: (res) => { + appUser.wxGetUserProfileLogin(function (result) { + const pages = getCurrentPages(); // 当前页面 + const beforePage = ((pages[pages.length - 2].route === 'pages/auth/auth') ? pages[pages.length - 3] : pages[pages.length - 2]); // 前一个页面 + const id = beforePage.options.id || beforePage.options.scene || that.data.id; + const url = id ? '/' + beforePage.route + '?id=' + id : '/' + beforePage.route + wx.reLaunch({ + url: url + }) + }, res.userInfo); + } + }) + }, + toPrivacy() { + wx.navigateTo({ + url: '/package-my/my/privecy' + }) + } +})) \ No newline at end of file diff --git a/src/openeuler/pages/auth/auth.json b/src/openeuler/pages/auth/auth.json new file mode 100644 index 0000000000000000000000000000000000000000..1ce07e26295d210a03ed6bc2bee94b6ecb5c870f --- /dev/null +++ b/src/openeuler/pages/auth/auth.json @@ -0,0 +1,3 @@ +{ + "navigationBarTitleText": "登录" +} \ No newline at end of file diff --git a/src/openeuler/pages/auth/auth.wxml b/src/openeuler/pages/auth/auth.wxml new file mode 100644 index 0000000000000000000000000000000000000000..f92fce713fc77e2eaa77772cc63829e1e3999a1b --- /dev/null +++ b/src/openeuler/pages/auth/auth.wxml @@ -0,0 +1,20 @@ + + + + 为便于您在使用 openEuler 会议预定小程序的过程中能够获得所有操作权限, 需要您允许授权使用微信用户信息。 + + + + 登录即表示同意隐私条款 + + \ No newline at end of file diff --git a/src/openeuler/pages/auth/auth.wxss b/src/openeuler/pages/auth/auth.wxss new file mode 100644 index 0000000000000000000000000000000000000000..94266aa2e4f2ab9c2df2059f490263e791100836 --- /dev/null +++ b/src/openeuler/pages/auth/auth.wxss @@ -0,0 +1,69 @@ +/* pages/auth/auth.wxss */ +page { + background-color: #fff; + height: unset; +} + +.container { + padding: 0 !important; +} + +.container .img { + display: block; + width: 503rpx; + height: 408rpx; + margin: 160rpx auto; +} + +.container .p { + margin-top: 196rpx; + line-height: 48rpx; + font-size: 34rpx; + color: #6d7278; + margin-bottom: 120rpx; + padding: 0 60rpx; + font-weight: 400; +} + +.container .button { + line-height: 90rpx; + padding: 0; + height: 90rpx; + width: 500rpx; + margin: 0 auto; + color: #fff; + font-size: 36rpx; + background-color: #002fa7; + border-radius: 8rpx; + font-weight: normal; + box-shadow: 0px 5px 20px 0px rgba(126, 146, 178, 0.7); +} + +.container .button view { + height: 100%; + display: flex; + align-items: center; + justify-content: center; +} + +.container .button text { + vertical-align: middle; +} + +.container .button .wechat-icon { + vertical-align: middle; + margin-right: 20rpx; + width: 44rpx; + height: 36rpx; +} + +.container .privacy { + color: #6d7278; + font-size: 28prpx; + text-align: center; + margin-top: 30rpx; +} + +.container .privacy text { + color: #002fa7; +} \ No newline at end of file diff --git a/src/openeuler/pages/events/events.js b/src/openeuler/pages/events/events.js new file mode 100644 index 0000000000000000000000000000000000000000..b222ac97fc1654a04890ebacb1012cb1cacbe530 --- /dev/null +++ b/src/openeuler/pages/events/events.js @@ -0,0 +1,311 @@ +// pages/events/events.js +const appAjax = require('./../../utils/app-ajax'); +const sessionUtil = require("../../utils/app-session.js"); +const appUser = require("../../utils/app-user.js"); +let that = null; + +let remoteMethods = { + getList: function (_callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'GET', + service: 'LATEST_EVENTS', + success: function (ret) { + _callback && _callback(ret); + } + }); + }, + delDraft: function (_callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'DELETE', + service: 'DRAFT_DETAIL', + otherParams: { + id: that.data.curId + }, + success: function (ret) { + _callback && _callback(ret); + } + }); + }, + delEvent: function (_callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'PUT', + service: 'DEL_EVENT', + otherParams: { + id: that.data.curId + }, + success: function (ret) { + _callback && _callback(ret); + } + }); + }, + collect: function (_callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'POST', + service: 'EVENT_COLLECT', + data: { + activity: that.data.curId + }, + success: function (ret) { + _callback && _callback(ret); + } + }); + }, + unCollect: function (_callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'DELETE', + service: 'EVENT_UNCOLLECT', + otherParams: { + id: that.data.collectionId + }, + success: function (ret) { + _callback && _callback(ret); + } + }); + }, + getSignUpInfo: function (id, _callback) { + appAjax.postJson({ + autoShowWait: true, + type: 'GET', + service: 'GET_SIGNUP_INFO', + otherParams: { + id + }, + success: function (ret) { + _callback && _callback(ret); + } + }); + } +} +Page({ + + /** + * 页面的初始数据 + */ + data: { + iphoneX: false, + level: 1, + noAuthDialogShow: false, + user: '', + list: [], + actionShow: false, + actions: [], + underDialogShow: false, + showDialogDel: false, + curId: '', + userId: '', + collectionId: '', + registerId: '' + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + that = this; + this.setData({ + iphoneX: this.getTabBar().data.iPhoneX + }) + appUser.updateUserInfo(function () { + that.setData({ + level: sessionUtil.getUserInfoByKey('eventLevel') || 1, + user: sessionUtil.getUserInfoByKey('userId') + }) + remoteMethods.getList(res => { + that.setData({ + list: res + }) + + }) + }); + }, + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + this.getTabBar().setData({ + _tabbat: 2 + }) + }, + navigateTo(e) { + const url = e.currentTarget.dataset.url; + if ((this.data.level === 1) && url.includes('publish')) { + this.setData({ + noAuthDialogShow: true + }) + return; + } + wx.navigateTo({ + url + }) + }, + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + wx.stopPullDownRefresh(); + appUser.updateUserInfo(function () { + that.setData({ + level: sessionUtil.getUserInfoByKey('eventLevel') || 1 + }) + }); + }, + copyWechat() { + wx.setClipboardData({ + data: 'openeuler123', + success: () => { + this.setData({ + noAuthDialogShow: false, + underDialogShow: false + }) + } + }) + + }, + onActionClose() { + this.setData({ + actionShow: false + }) + this.getTabBar().setData({ + show: true + }) + + }, + onActionSelect(e) { + if (this.data.level == 3) { + if (e.detail.operaType == 1) { + if (this.data.collectionId) { + remoteMethods.unCollect(() => { + this.onLoad(); + }) + } else { + remoteMethods.collect(() => { + this.onLoad(); + }) + } + } else { + this.setData({ + showDialoogDel: true + }) + } + } else { + if (e.detail.operaType == 1) { + if (this.data.collectionId) { + remoteMethods.unCollect(() => { + this.onLoad(); + }) + } else { + remoteMethods.collect(() => { + this.onLoad(); + }) + } + } else if(e.detail.operaType == 3) { + remoteMethods.getSignUpInfo(this.data.curId, (res) => { + wx.navigateTo({ + url: `/package-events/sign-up/sign-up-success?name=${encodeURIComponent(res.name)}&title=${encodeURIComponent(res.title)}&tel=${encodeURIComponent(res.telephone)}&poster=${encodeURIComponent(res.poster)}&id=${encodeURIComponent(this.data.curId)}` + }) + }) + } else { + this.setData({ + underDialogShow: true + }) + } + } + }, + del() { + this.setData({ + showDialogDel: false + }) + remoteMethods.delEvent(() => { + remoteMethods.getList(res => { + this.setData({ + list: res + }) + + }); + }) + }, + delCancel() { + this.setData({ + showDialogDel: false + }) + }, + onMore(e) { + this.getTabBar().setData({ + show: false + }) + this.setData({ + actionShow: true, + curId: e.currentTarget.dataset.item.id, + userId: e.currentTarget.dataset.item.user, + collectionId: e.currentTarget.dataset.item.collection_id || '', + registerId: e.currentTarget.dataset.item.register_id || '' + }) + const strTemp = this.data.collectionId ? '取消收藏' : '收藏活动'; + if (this.data.level == 3) { + this.setData({ + actions: [{ + name: strTemp, + operaType: 1 + }, + { + name: '下架活动', + operaType: 2 + } + ] + }) + } else { + if (this.data.user == this.data.userId) { + this.setData({ + actions: [{ + name: strTemp, + operaType: 1 + }, + { + name: '下架活动', + operaType: 2 + } + ] + }) + } else { + this.setData({ + actions: [{ + name: strTemp, + operaType: 1 + }] + }) + } + + if (this.data.registerId) { + let tempArr = this.data.actions; + tempArr.unshift({ + name: '查看门票', + operaType: 3 + }) + this.setData({ + actions: tempArr + }) + } + + } + + }, + toUpdateSchedule(e) { + if (!sessionUtil.getUserInfoByKey('access')) { + wx.navigateTo({ + url: '/pages/auth/auth' + }) + return; + } + wx.navigateTo({ + url: `/package-events/events/event-detail?id=${e.currentTarget.dataset.id}&type=5` + }) + }, + onPullDownRefresh: function () { + wx.stopPullDownRefresh(); + this.onLoad(); + }, +}) \ No newline at end of file diff --git a/src/openeuler/pages/events/events.json b/src/openeuler/pages/events/events.json new file mode 100644 index 0000000000000000000000000000000000000000..16a3ae09d3228549920b5335ab5deeeedd0a93f8 --- /dev/null +++ b/src/openeuler/pages/events/events.json @@ -0,0 +1,9 @@ +{ + "usingComponents": { + "user-info": "/components/user-info/user-info" + }, + "navigationBarTitleText": "openEuler活动管理", + "enablePullDownRefresh": true, + "backgroundTextStyle": "dark", + "backgroundColor": "#fff" +} \ No newline at end of file diff --git a/src/openeuler/pages/events/events.wxml b/src/openeuler/pages/events/events.wxml new file mode 100644 index 0000000000000000000000000000000000000000..bfa0b2996bfc22e3d2753afddac2060ac22a9782 --- /dev/null +++ b/src/openeuler/pages/events/events.wxml @@ -0,0 +1,115 @@ + + + + + + + 发起人管理 + + + + + 查看活动 + + + + 发布活动 + + + + 最新活动({{list.length}}) + + + + + {{item.enterprise}} + + + + + + + + {{item.title}} + + + {{item.date}} + + + + {{item.address||item.join_url}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 暂无活动! + + + + + 请确认下架当前活动 + + + + + + + + + + 活动一经发布,暂不支持自行下架删除。如有需要,请联系 + 小助手 (微信号openeuler123) + 下架活动 + + + + + + + + + + 您暂时没有发布活动的权限,请联系 + 小助手 (微信号openeuler123) + 提交发布活动权限申请 + + + + + + + \ No newline at end of file diff --git a/src/openeuler/pages/events/events.wxss b/src/openeuler/pages/events/events.wxss new file mode 100644 index 0000000000000000000000000000000000000000..84f2c7ff88cde62d5af1a4458219366156c1d766 --- /dev/null +++ b/src/openeuler/pages/events/events.wxss @@ -0,0 +1,211 @@ +/* pages/events/events.wxss */ +.container .meeting-level-wrapper { + margin: 60rpx 0; + font-size: 36rpx; + color: #333; +} + +.container .meeting-level-wrapper .sig-manage-btn { + margin-bottom: 30rpx; + background-color: #fff; + box-shadow: 0rpx 5rpx 15rpx 0rpx rgba(0, 47, 167, 0.1); + border-radius: 8rpx; + height: 110rpx; + display: flex; + justify-content: center; + align-items: center; +} + +.container .meeting-level-wrapper .icon { + height: 63rpx; + width: 64rpx; + margin-right: 21rpx; +} + +.container .meeting-level-wrapper .tab-btn-wrapper { + display: flex; + justify-content: space-between; +} + +.container .meeting-level-wrapper .tab-btn-wrapper .btn { + height: 110rpx; + box-shadow: 0rpx 5rpx 15rpx 0rpx rgba(0, 47, 167, 0.1); + border-radius: 8rpx; + width: 330rpx; + display: flex; + align-items: center; + justify-content: center; +} + +.container .latest-events { + margin-bottom: 30rpx; + color: #333; + font-size: 36rpx; + +} + +.container .event-list-wrapper .event-item { + margin-bottom: 30rpx; + box-shadow: 0rpx 5rpx 15rpx 0rpx rgba(0, 47, 167, 0.1); + border-radius: 8rpx; + overflow: hidden; + position: relative; + background-color: #fff; +} + +.container .event-list-wrapper .event-item .collection { + width: 40rpx; + height: 26rpx; + position: absolute; + top: 33rpx; + left: 0; +} + +.container .event-list-wrapper .event-item .header { + height: 90rpx; + padding: 0 30rpx; + display: flex; + justify-content: space-between; + align-items: center; + font-size: 28rpx; + color: #333; + border-bottom: 2rpx solid #f0f3f7; +} + +.container .event-list-wrapper .event-item .isCollection { + padding-left: 60rpx; +} + +.container .event-list-wrapper .event-item .header image { + height: 36rpx; + width: 8rpx; +} + +.container .event-list-wrapper .event-item .body { + padding: 30rpx; + display: flex; +} + +.container .event-list-wrapper .event-item .body .left { + margin-right: 20rpx; +} + +.container .event-list-wrapper .event-item .body .left image { + width: 241rpx; + height: 241rpx; + border-radius: 8rpx; +} + +.container .event-list-wrapper .event-item .body .right .title { + font-size: 30rpx; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + margin-bottom: 20rpx; + width: 380rpx; +} + +.container .event-list-wrapper .event-item .body .right .date { + margin-bottom: 20rpx; + font-size: 24rpx; + color: #6d7278; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + width: 380rpx; +} + +.container .event-list-wrapper .event-item .body .right .date image { + height: 28rpx; + width: 28rpx; + margin-right: 16rpx; + vertical-align: middle; +} +.container .event-list-wrapper .event-item .body .right .date text { + vertical-align: middle; +} + +.container .event-list-wrapper .event-item .body .right .address { + font-size: 24rpx; + color: #6d7278; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + width: 380rpx; + margin-bottom: 30rpx; +} + +.container .event-list-wrapper .event-item .body .right .address image { + height: 28rpx; + width: 28rpx; + margin-right: 16rpx; + vertical-align: middle; +} + +.container .event-list-wrapper .event-item .body .right .address image text { + vertical-align: middle; +} + +.container .event-list-wrapper .event-item .body .right .button { + text-align: right; + height: 68rpx; +} + +.container .event-list-wrapper .event-item .body .right .button button { + height: 68rpx; + width: 172rpx; + text-align: center; + line-height: 68rpx; + color: #fff; + background-color: #002fa7; + border-radius: 8rpx; + font-size: 28rpx; + display: inline-block; +} + +.container .event-list-wrapper .event-item .body .right .button .register { + background-color: #6682ca; +} + +.container .event-list-wrapper .event-item .mask { + position: absolute; + height: 100%; + width: 100%; + background-color: #002fa7; + opacity: 0.65; + top: 0; + left: 0; +} + +.container .event-list-wrapper .event-item .mask .mask-img { + position: absolute; + height: 137rpx; + width: 180rpx; + left: 50%; + top: 50%; + margin-left: -90rpx; + margin-top: -68rpx; +} + +.empty-status .suc-wrapper { + position: absolute; + top: 50%; + transform: translate(-50%, -50%); + left: 50%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +.empty-status .suc-wrapper image { + width: 234rpx; + height: 218rpx; +} + +.empty-status .suc-wrapper text { + text-align: center; + margin-top: 20rpx; + font-size: 34rpx; + color: #333; +} \ No newline at end of file diff --git a/src/openeuler/pages/index/index.js b/src/openeuler/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..aff73177a6fbc6877a378609fad307d59d6bc489 --- /dev/null +++ b/src/openeuler/pages/index/index.js @@ -0,0 +1,105 @@ +//index.js +const mixin = require("../../utils/page-mixin.js").$pageMixin; +const sessionUtil = require("../../utils/app-session.js"); +const appUser = require("../../utils/app-user.js"); +let that = null; +Page(mixin({ + data: { + imgUrls: [{ + type: 1, + url: 'https://openeuler-website-beijing.obs.cn-north-4.myhuaweicloud.com/MoocStudio/MoocStudio%E7%9A%84%E8%A7%86%E9%A2%911920X1080_small.mp4', + poster: 'https://openeuler-website-beijing.obs.cn-north-4.myhuaweicloud.com/detail-banner/mooc-banner.png' + }, ], + iphoneX: false, + meetingConponent: null, + autoplay: false + }, + handleContact(e) { + if (!sessionUtil.getUserInfoByKey('access')) { + wx.navigateTo({ + url: '/pages/auth/auth' + }) + return; + } + wx.navigateTo({ + url: e.currentTarget.dataset.src + }) + }, + swithTab(e) { + if (!sessionUtil.getUserInfoByKey('access')) { + wx.navigateTo({ + url: '/pages/auth/auth' + }) + return; + } + wx.switchTab({ + url: e.currentTarget.dataset.url + }) + }, + previewImage(e) { + + const current = e.target.dataset.src //获取当前点击的 图片 url + wx.previewImage({ + current, + urls: [current] + }) + }, + onLoad: function () { + wx.showShareMenu({ + withShareTicket: true, + menus: ['shareAppMessage', 'shareTimeline'] + }) + that = this; + appUser.updateUserInfo(function () { + that.setData({ + meetingConponent: that.selectComponent('#meeting'), + iphoneX: that.getTabBar().data.iPhoneX, + }) + }); + }, + onShow: function () { + this.getTabBar().setData({ + _tabbat: 0 + }) + }, + onPullDownRefresh: function () { + wx.stopPullDownRefresh(); + appUser.updateUserInfo(function () { + that.data.meetingConponent.initData(); + }); + }, + actionStatus(e) { + if (e.detail === 1) { + this.getTabBar().setData({ + show: false + }) + } else { + this.getTabBar().setData({ + show: true + }) + } + }, + checkLogin() { + if (!sessionUtil.getUserInfoByKey('access')) { + wx.navigateTo({ + url: '/pages/auth/auth' + }) + return; + } + }, + play() { + this.setData({ + autoplay: false + }) + }, + pause() { + this.setData({ + autoplay: true + }) + }, + ended() { + this.setData({ + autoplay: true + }) + } +})) \ No newline at end of file diff --git a/src/openeuler/pages/index/index.json b/src/openeuler/pages/index/index.json new file mode 100644 index 0000000000000000000000000000000000000000..b78d91865a56f3c269006c3745804377676109da --- /dev/null +++ b/src/openeuler/pages/index/index.json @@ -0,0 +1,10 @@ +{ + "usingComponents": { + "user-info": "/components/user-info/user-info", + "meeting-list": "/components/meeting-list/meeting-list" + }, + "navigationBarTitleText": "openEuler", + "enablePullDownRefresh": true, + "backgroundTextStyle": "dark", + "backgroundColor":"#fff" +} \ No newline at end of file diff --git a/src/openeuler/pages/index/index.wxml b/src/openeuler/pages/index/index.wxml new file mode 100644 index 0000000000000000000000000000000000000000..5ec907fef9a2d812836a5c01adb3c68fa877aafb --- /dev/null +++ b/src/openeuler/pages/index/index.wxml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + 会议 + + + + + 活动 + + + + + \ No newline at end of file diff --git a/src/openeuler/pages/index/index.wxss b/src/openeuler/pages/index/index.wxss new file mode 100644 index 0000000000000000000000000000000000000000..c75b798abb90b36a5a4cea9333a621aa1c57ae3d --- /dev/null +++ b/src/openeuler/pages/index/index.wxss @@ -0,0 +1,58 @@ +/**index.wxss**/ +page { + background-color: #fff; +} + +.container swiper { + height: 378rpx; + border-radius: 8rpx; + overflow: hidden; + box-shadow: 0px 5px 15px 0px rgba(225, 230, 238, 1); +} + +.container swiper .slide-image { + height: 378rpx; + width: 690rpx; +} + +.container .tab-btn-wrapper { + margin: 60rpx 0; + display: flex; + justify-content: space-between; +} + +.container .tab-btn-wrapper .btn { + width: 330rpx; + height: 110rpx; + background-color: #fff; + box-shadow: 0rpx 5rpx 15rpx 0rpx rgba(0, 47, 167, 0.1); + border-radius: 8rpx; + display: flex; + justify-content: center; + align-items: center; + background: url(data:image/jpg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAARCABuAUoDAREAAhEBAxEB/8QAGwABAAMBAQEBAAAAAAAAAAAAAAQFBgMCAQr/xAAzEAACAQMCBAMFCAMBAAAAAAAAAQIDBBEhMQUSQVETcYEiMmGRoRRCQ1JikrHBIzRzs//EABkBAQADAQEAAAAAAAAAAAAAAAACAwQBBf/EAC8RAQABAQUHBAEFAAMAAAAAAAABAgMRITFRQWFxgZGx0RKhwfDhEyIyQlJicvH/2gAMAwEAAhEDEQA/AP3mXd3UuakvaapJtQgm1HlT0lJdZPdt5xnC0NtFEURGEeq7Gdt+nDZhmoqqmZ3bI+7UMm4AAAAAAAAANpSlzUqcvzU4S+cU/wCzBVF0zGkzHSV8TfETrF7ocdAAAAAAAAAAAAAAAAAAAAzvGG/tFNdPBTXbLnUz9Es+hqsP4zr6viLvlVXnHD5lUlyAAAveDN4uF0zSa7ZfiZ+iWfQz2+dOuPxd8rLPby+V2Z1gAAAAAAABhz0GcAAAAAAAAAANja/61v8A8KP/AJxMNf8AOr/tV3lfTlHCOzuRdAAAAAAAAAAAAAAAAAAAAquK28qtKNaCzKlnmS3dN6t468jWemIuTexdY1XVTTP9suMee90IVxhfps4/fu3OGpUAANVw+3dvbpTWKlR880945SUYvs0llp7SbRjtavVVhlGEb9Z69YXURdHHFOK0gAAAAAAADDnoM4AAAAAAAAAAbOguWhRj+WlTXygkYasaqp/5T3XxhEcIdSLoAAAAAAAAAAAAAAAAAAAACquOFUqsnOjLwpPVxxmm31wlhwz8MxWyii6m2qjCqPVvyn899ZQmiNmGu3795wlwe4zrUo47pzbx5eGl6Z9Sz9enSq/l3v8AhH0TrHv4WNrw2lbyU5vxai2bSUIvvGOXqujbeGspRZVXa1VRdH7YnPbM89OERvSiiIzxm/BYlSYAAAAAAAAAw56DOAAAAAAAAAPdODqVIQW85xgvOUkv7OTN0TOkTPQjGYjVtUsLC2WiMDQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYc9BnAAAAAAAAAFhwyl4l1FtZjSTqPtlezH15pJryfYrtarqJ1nDz7Yc0qYvqjr0agxrgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADDnoM4AAAAAAAAA0nCqHh0HVa9qs8r4QjlR+bcn8VymW2qvqimMqY95/F3DFZRGc8vv3YtClYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYc9BnAAAAAAAAJFtQlc1oUllJvM5L7sF7z8+izvJpdSNdUUUzM8t87IdiL5uja18YqMYxikoxSjFLZJLCS+CSwYZm+Zmc5xldEXRdo+h0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAw56DOAAAAAAAJNvCWW9Elu32A1PD7T7NS5pr/LUSc+8V0h6by7y01UUzJa1+ubo/jGW/WfG7itopuxnOeyeVJgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADDnoM4AAAAAAC+4dYOLjcVliW9KD6dpyXfrFdPeeuMZ7W0v8A20zxmO3nplesop2zHCPldGdYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGHPQZwAAAAfUnJqMU228JJNtt7JJatvshlmL6x4byNVrhJyWsKW6i+kp9HLtHVLd5ekc1pa3/tpy2zrujdv27NZspo2z08+FyULAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYc9BnAAACbb2FxcYaj4dN/iTTSa/Sven8Gly50ckQqtKac5vnSM+enfc7ETOUc9jQW1lRtVmK5qmNakve13UVtFfBataNsy12lVeeEaRl+VsUxG+fuSWQSAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAx6tLp7W9b1pzX8pG710f6p6x5UXTpPSXaHDryf4XKu85Rj9MuX0Iza0Rtv3RE/8Anu76KtPeEynweT1rVor9NNOT/dLlx+1kJt4/rTM8cPaL+8O/pztmO/hZUbC2oYcafNJffqPnl5pP2Yv4ximVVWldW26NIw/M85TiiI38fHm9MK0gAAAAAOMrihF4lXoxfaVSCfyciXpq/wA1dJ8OXxrHWHSM4TWYTjNd4yUl802cmJjOJjjFxfE5TEvRx0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4XFxTtqbqT8oxXvTl2X8t7Ja66Jyopmubo5zshGqr0wzNxe17lvmm4we1OLagl0z+Z93LOuyS0NdNnTTGEXzrOf45KpmZzRCbj1GcoSUoSlCS2lFtNeqwxMROcRPHEXljxJzlGjcNZekKuiy+kZ9MvZSWMvCks5kZ7Syuvqp50+O93TRZTXOU9crl0Z1gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADLcSrSq3M4vPLSbpxXbHvPzlLrvhRT2NllTEURO2cZnt086qapvmd2HvKAWIgAABq+H1pVraEp5cot05N/e5cYfm4tZb1byzHa0xTXMRlndpeuom+OGHtCaVpAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/9k=) no-repeat; + background-size:100% 100%; +} + +.container .tab-btn-wrapper .events { + background: url(data:image/jpg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAARCABuAUoDAREAAhEBAxEB/8QAGwABAAIDAQEAAAAAAAAAAAAAAAUGAQIDBAr/xAA0EAACAgECAwYEBQMFAAAAAAAAAQIDEQQxIUFRBRIiYXGREzJigRQjQlJyNENzgpKxs8H/xAAZAQEAAwEBAAAAAAAAAAAAAAAAAQMEAgX/xAAsEQEBAAEBBgUEAgMBAAAAAAAAAQIRAyExQVFxEmGBkbGh0eHwIjJCcsFS/9oADAMBAAIRAxEAPwD7+AAAAAAAAAFZ7T07pvdiX5dzck1sp/ri+jb8S6p8NnjXsspljpzx3enK/wDP2Kcppe+/68EaWuQABlJtpJNtvCS4tt7JLm2BbNFp/wAPp4QaxN5nZ/KXL/Sko9OGVuYtpl4srZw4TtPvxXYzSd9/bhues4dAAAAAAAAAAAAAAAGlkPiV2V/vhOH+6Lj/AOky6WXpZfZF3y9lLlFxlKMliUW4yXRp4a+zRvl1ms4XfFDAADrRW7rq6ks9+aT8o5zJ/aKbfPhw4nOV8ONvSX35fVMmtk+FzMK8AAAAAAAAAAAAAAAAAAHO2qu+uVdke9GXunyafJrk/s8ptE45XG6zdYiyWaVXdR2ZfS2607q904rxpdJQ3bXWOU9+Gy1Y7XHKb/43z4el+/5VXGzz7a/VHSjKLxKLi+kk0/Zlrl2q019zSrqnLPPDUV6yeIr7s5uWOPGyfPtxNLeEtTui7OjQ1ba1O1cYpfLX6Z+aXnhJcllKRn2m1uX8cd2PPrftPnn0W44ab7y4aJQpdgAAAAAAAAAAAAAAAABE6/s93N3U4VmPHDZWY5pvgp4wnnClu2nnN+z2vhnhy4cr08r5fWec4cZY63Wev4/KBsqsqeLITg08eKLXs3wa6NZTXFcDRMpeFl7VVpejNdF1zSqrnPPNJ91esniK9W1x4bkXLHHjZPXf7cUyW8J5LFodCtKnObUrpLDa2gucYvm3w70uG2Fwy5ZtptPHum7Ge9vW+XSet8rMcdN94/TTckSp2AAAAAAAAAOK1Gne19L9LYP/AIkdeHL/AM5e1+yNZ1nvHVSjJZjJSXVNNe6OUsgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACjnoM7KlKLzFuL6ptP3Qsl3WazpR669fq6trZTXSzxr3lmS+0kcXZ4X/ABk7bvjd7p8WU535+UlT2xF4V9fd+uvLjnzg/El6Sk/Iqy2F/wAbr5X7z7R3M+s9v37Jaq6q6PeqnGcebi+KfSS3i/JpMouNxulln7yvC+juWXhfTm6EJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUc9BnAAADeuydUlOucoSWzi8P0fVPmnlPmiLJZpZLPMTml7VjPFepxCWytXCD/mv0v6l4eqikZ89jZvw1vlz9Ovbj3WTPr7/f8JlNNZTynxTWzXUoWAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUc9BnAAAAAAktFr56dquxudD4Y3dfnHn3esNuccPOatpsplvm7L6Xv5+fvry6xy07LJGUZxU4NSjJZjJPKafNGWyy6XdYul13xsQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABRz0GcAAAAAABJaDWvTzVdjzRN8c/wBtv9S+n966eJcVh1bXZ+Kaz+0+s6d+ns6xy07LMmmsp5T4prZrqZFwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUc9BnAAAAAAAAJ/srV9+P4ab8UFmpvnBbw9Y7x+nK4KJm22Gl8U53f36+vPz7rMLy9vsmShYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKOegzgAAAAAAAG9dkqpxsg8ShJST81yfVPZrmm0RZLLLws0FxptjdVC2PyzipJc0+cX5xeU/NMw5S42y8Zf2+q+XWS+/d0ISAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUc9BnAAAAAAAAAE92RdmNlDfy/mQ691vE16KXdfrJmfb475l13X5n/fZZheM9f395JozrAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACjnoM4AAAAAAAAA9mgs+Fq6nynL4b9J+Fe0nF/Y42k1wy8pr7b/hOP8Aad/ncthiXgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFHPQZwAAAAAAAABmLcZKS3i016p5Qs1ll4XdRdotSjGS2kk16NZR5/BoZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAo56DOAAAAAAAAAAFy0772nob501P3hFmHP+2X+1+avx4TtPh2OUgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK72hofhSlfXJfDnJtwee9GT4tRwsOOctZaxtxSyatltPFpjZdZOPKydfP31VZY6b+Vvt+ESXOAAAAAAAAABcdL/Taf8AwU/9cTDn/fL/AGy+avx4TtPh3OUgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/2Q==) no-repeat; + background-size:100% 100%; +} + +.container .tab-btn-wrapper .btn .icon { + width: 54rpx; + height: 54rpx; + margin-right: 14rpx; +} + +.container .tab-btn-wrapper .btn text { + color: #333; + font-size: 36rpx; + margin-right: 48rpx; +} + +.container .tab-btn-wrapper .btn .arrow { + width: 30rpx; + height: 30rpx; + margin-right: -33px; +} \ No newline at end of file diff --git a/src/openeuler/pages/meeting/meeting.js b/src/openeuler/pages/meeting/meeting.js new file mode 100644 index 0000000000000000000000000000000000000000..14a4b878ba58baa6b948cfdd581ac5fff67a5414 --- /dev/null +++ b/src/openeuler/pages/meeting/meeting.js @@ -0,0 +1,86 @@ +// pages/meeting/meeting.js +const mixin = require("../../utils/page-mixin.js").$pageMixin; +const sessionUtil = require("../../utils/app-session.js"); +const appUser = require("../../utils/app-user.js"); +let that = null; + +Page(mixin({ + + /** + * 页面的初始数据 + */ + data: { + noAuthDialogShow: false, + iphoneX: false, + meetingConponent: null + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + iphoneX: this.getTabBar().data.iPhoneX, + meetingConponent: this.selectComponent('#meeting') + }) + let that = this; + + appUser.updateUserInfo(function () { + that.setData({ + level: sessionUtil.getUserInfoByKey('level') + }) + }); + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + that = this; + this.getTabBar().setData({ + _tabbat: 1 + }) + }, + onPullDownRefresh: function () { + wx.stopPullDownRefresh(); + appUser.updateUserInfo(function () { + that.setData({ + level: sessionUtil.getUserInfoByKey('level') + }) + that.data.meetingConponent.initData(); + }); + }, + actionStatus(e) { + if (e.detail === 1) { + this.getTabBar().setData({ + show: false + }) + } else { + this.getTabBar().setData({ + show: true + }) + } + }, + navigateTo(e) { + const url = e.currentTarget.dataset.url; + if ((this.data.level === 1) && url.includes('reserve')) { + this.setData({ + noAuthDialogShow: true + }) + return; + } + wx.navigateTo({ + url + }) + }, + copyWechat() { + wx.setClipboardData({ + data: 'openeuler123', + success: () => { + this.setData({ + noAuthDialogShow: false + }) + } + }) + + } +})) \ No newline at end of file diff --git a/src/openeuler/pages/meeting/meeting.json b/src/openeuler/pages/meeting/meeting.json new file mode 100644 index 0000000000000000000000000000000000000000..045065d8df79ca5b83e8be477f9b24ea1c611854 --- /dev/null +++ b/src/openeuler/pages/meeting/meeting.json @@ -0,0 +1,10 @@ +{ + "usingComponents": { + "user-info": "/components/user-info/user-info", + "meeting-list": "/components/meeting-list/meeting-list" + }, + "navigationBarTitleText": "openEuler会议管理", + "enablePullDownRefresh": true, + "backgroundTextStyle": "dark", + "backgroundColor": "#fff" +} \ No newline at end of file diff --git a/src/openeuler/pages/meeting/meeting.wxml b/src/openeuler/pages/meeting/meeting.wxml new file mode 100644 index 0000000000000000000000000000000000000000..9a622d63e2dc40471197fe17856d8c1bc02c3f77 --- /dev/null +++ b/src/openeuler/pages/meeting/meeting.wxml @@ -0,0 +1,29 @@ + + + + + + + SIG组管理 + + + + + 查看会议 + + + + 预定会议 + + + + + + + 您暂时没有预定会议的权限,请联系小助手 (微信号openeuler123) 提交预定会议权限申请 + + + + + + \ No newline at end of file diff --git a/src/openeuler/pages/meeting/meeting.wxss b/src/openeuler/pages/meeting/meeting.wxss new file mode 100644 index 0000000000000000000000000000000000000000..e514c907a300b4b5dedfd7ef67d7beff931270a9 --- /dev/null +++ b/src/openeuler/pages/meeting/meeting.wxss @@ -0,0 +1,42 @@ +/* pages/meeting/meeting.wxss */ +.container { + background-color: #fff; +} + +.container .meeting-level-wrapper { + margin: 60rpx 0; + font-size: 36rpx; + color: #333; +} + +.container .meeting-level-wrapper .sig-manage-btn { + margin-bottom: 30rpx; + background-color: #fff; + box-shadow: 0rpx 5rpx 15rpx 0rpx rgba(0, 47, 167, 0.1); + border-radius: 8rpx; + height: 110rpx; + display: flex; + justify-content: center; + align-items: center; +} + +.container .meeting-level-wrapper .icon { + height: 63rpx; + width: 64rpx; + margin-right: 21rpx; +} + +.container .meeting-level-wrapper .tab-btn-wrapper { + display: flex; + justify-content: space-between; +} + +.container .meeting-level-wrapper .tab-btn-wrapper .btn { + height: 110rpx; + box-shadow: 0rpx 5rpx 15rpx 0rpx rgba(0, 47, 167, 0.1); + border-radius: 8rpx; + width: 330rpx; + display: flex; + align-items: center; + justify-content: center; +} diff --git a/src/openeuler/pages/my/my.js b/src/openeuler/pages/my/my.js new file mode 100644 index 0000000000000000000000000000000000000000..69a05f0ca4457dd36579ae35596a6be44317f2aa --- /dev/null +++ b/src/openeuler/pages/my/my.js @@ -0,0 +1,71 @@ +// pages/my/my.js +const appAjax = require('./../../utils/app-ajax'); +const sessionUtil = require("../../utils/app-session.js"); +let that = this; + +let remoteMethods = { + getMyCount: function (_callback) { + appAjax.postJson({ + type: 'GET', + service: 'GET_MY_COUNT', + success: function (ret) { + _callback && _callback(ret); + } + }); + } +} +Page({ + + /** + * 页面的初始数据 + */ + data: { + iphoneX: false, + avatarUrl: '', + nickName: '', + level: 1, + avtivityLevel: 1, + myCount: {} + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + that = this; + this.setData({ + iphoneX: this.getTabBar().data.iPhoneX, + avatarUrl: sessionUtil.getUserInfoByKey('avatarUrl'), + nickName: sessionUtil.getUserInfoByKey('nickName'), + level: sessionUtil.getUserInfoByKey('level'), + avtivityLevel: sessionUtil.getUserInfoByKey('eventLevel') + }) + remoteMethods.getMyCount(res => { + this.setData({ + myCount: res + }) + }) + }, + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + this.getTabBar().setData({ + _tabbat: 3 + }) + + }, + go(e) { + wx.navigateTo({ + url: e.currentTarget.dataset.url + }) + }, + onPullDownRefresh() { + wx.stopPullDownRefresh(); + remoteMethods.getMyCount(res => { + this.setData({ + myCount: res + }) + }) + }, +}) \ No newline at end of file diff --git a/src/openeuler/pages/my/my.json b/src/openeuler/pages/my/my.json new file mode 100644 index 0000000000000000000000000000000000000000..f0e9773bcc01902e54f4ba9a8f590d66eecf3609 --- /dev/null +++ b/src/openeuler/pages/my/my.json @@ -0,0 +1,9 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "我的", + "navigationBarBackgroundColor": "#002fa7", + "navigationBarTextStyle": "white", + "enablePullDownRefresh": true, + "backgroundTextStyle": "light", + "backgroundColor": "#002fa7" +} \ No newline at end of file diff --git a/src/openeuler/pages/my/my.wxml b/src/openeuler/pages/my/my.wxml new file mode 100644 index 0000000000000000000000000000000000000000..7337b9b86189b45f817002a02ed5befd96996acb --- /dev/null +++ b/src/openeuler/pages/my/my.wxml @@ -0,0 +1,80 @@ + + + + + 我的活动 + + + {{myCount.published_activities_count||0}} + 已发布 + + + {{myCount.register_table_count||0}} + 报名表单 + + + {{myCount.drafts_count||0}} + 草稿箱 + + + {{myCount.publishing_activities_count||0}} + {{avtivityLevel===3?'待发布':'发布中'}} + + + {{myCount.collected_activities_count||0}} + 已收藏 + + + {{myCount.registerd_activities_count||0}} + 已报名 + + + + + 常用功能 + + + + 使用帮助 + + + + 留言反馈 + + + + 隐私声明 + + + + 关注公众号 + + + + B站直播 + + + + 关注头条号 + + + + \ No newline at end of file diff --git a/src/openeuler/pages/my/my.wxss b/src/openeuler/pages/my/my.wxss new file mode 100644 index 0000000000000000000000000000000000000000..d4d020fc9cd0af436f6c6182e8061988fe936979 --- /dev/null +++ b/src/openeuler/pages/my/my.wxss @@ -0,0 +1,113 @@ +/* pages/my/my.wxss */ +page { + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHwAAAAeCAYAAADuInrvAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACdSURBVGhD7dbBDYAwDAPAbsTYjFnEDn5YyT34WinWpT3nea9v0T9Q9qKyf9wKV7gVP/maI5xwwglfpkDhCh9z9Y05yGSVybMpfNn2UrjCvdKTK7Qti3DCCW9TmZyHcMIJT4pqyyKccMLbVCbnIZxwwpOi2rIIJ5zwNpXJeQgnnPCkqLYswgknvE1lch7CCSc8Kaoti3DCCW9TGZznA1f9oK8GgBpHAAAAAElFTkSuQmCC) no-repeat; + background-size: 100% 150rpx; + background-color: #f5f7fa !important; + height: unset !important; +} + +.container { + margin-top: 97rpx; + padding: 0 !important; + margin-bottom: 99rpx; +} + +.container .user-info-wrapper { + background-color: #fff; + border-radius: 24rpx 24rpx 0 0; + padding: 0 30rpx; +} + +.container .user-info-wrapper .my-user-info { + height: 110rpx; +} + +.container .user-info-wrapper .my-user-info image { + border-radius: 100%; + height: 135rpx; + width: 135rpx; + border: 2rpx solid rgba(0, 47, 167, 0.15); + position: relative; + top: -67.5rpx; + margin-right: 20rpx; +} + +.container .user-info-wrapper .my-user-info text { + color: #fff; + font-size: 36rpx; + position: relative; + line-height: 50rpx; + top: -157.5rpx; +} + +.container .common-list .header { + font-size: 34rpx; + color: #333; +} + +.container .common-list .list { + display: flex; + flex-wrap: wrap; +} + +.container .common-list .list .item { + flex: 0 0 33.333333333333333%; + display: flex; + justify-content: center; + margin: 30rpx 0; + flex-direction: column; +} + +.container .common-list .list .item .count { + font-size: 40rpx; + margin-bottom: 10rpx; + text-align: center; +} + +.container .common-list .list .item .text { + font-size: 26rpx; + color: #6d7278; + text-align: center; +} + +.container .my-events, .container .common-functions { + padding: 0 30rpx; + background-color: #fff; + margin-top: 20rpx; +} + +.container .my-events .header, .container .common-functions .header { + padding-top: 30rpx; +} + +.container .common-functions .header { + font-size: 34rpx; + color: #333; +} + +.container .common-functions .list { + display: flex; + flex-wrap: wrap; +} + +.container .common-functions .list .item { + flex: 0 0 33.333333333333333%; + display: flex; + justify-content: center; + margin: 30rpx 0; + flex-direction: column; + align-items: center; +} + +.container .common-functions .list .item image { + width: 54rpx; + height: 54rpx; + margin-bottom: 10rpx; + text-align: center; +} + +.container .common-functions .list .item text { + font-size: 26rpx; + color: #6d7278; + text-align: center; +} diff --git a/src/openeuler/project.private.config.json b/src/openeuler/project.private.config.json new file mode 100644 index 0000000000000000000000000000000000000000..8592ea8ba39bf2c023594a9acb6fa9c2c7a774fd --- /dev/null +++ b/src/openeuler/project.private.config.json @@ -0,0 +1,30 @@ +{ + "setting": {}, + "condition": { + "plugin": { + "list": [] + }, + "game": { + "list": [] + }, + "gamePlugin": { + "list": [] + }, + "miniprogram": { + "list": [ + { + "name": "package-events/events/event-detail", + "pathName": "package-events/events/event-detail", + "query": "scene=33", + "scene": 1047 + }, + { + "name": "package-events/events/sign-success", + "pathName": "package-events/events/sign-success", + "query": "scene=49", + "scene": 1011 + } + ] + } + } +} \ No newline at end of file diff --git a/src/openeuler/sitemap.json b/src/openeuler/sitemap.json new file mode 100644 index 0000000000000000000000000000000000000000..bb97574e040a6493ff110afc3bf0657c6b2e65d8 --- /dev/null +++ b/src/openeuler/sitemap.json @@ -0,0 +1,7 @@ +{ + "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html", + "rules": [{ + "action": "allow", + "page": "*" + }] +} \ No newline at end of file diff --git a/src/openeuler/static/auth/auth.png b/src/openeuler/static/auth/auth.png new file mode 100644 index 0000000000000000000000000000000000000000..20fd3b20de7adc35cb94de4e722f0fbbd48403bf Binary files /dev/null and b/src/openeuler/static/auth/auth.png differ diff --git a/src/openeuler/static/auth/wechat-icon.svg b/src/openeuler/static/auth/wechat-icon.svg new file mode 100644 index 0000000000000000000000000000000000000000..36f560753348062ea79618bd4f90c723f8bd8f7c --- /dev/null +++ b/src/openeuler/static/auth/wechat-icon.svg @@ -0,0 +1,36 @@ + + + Fill 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/openeuler/static/common/arrow-down.svg b/src/openeuler/static/common/arrow-down.svg new file mode 100644 index 0000000000000000000000000000000000000000..01c7cbd7e9b628f4f0be039246fecd317707b9b6 --- /dev/null +++ b/src/openeuler/static/common/arrow-down.svg @@ -0,0 +1,9 @@ + + + Style备份 3 + + + + + + \ No newline at end of file diff --git a/src/openeuler/static/common/arrow-right.svg b/src/openeuler/static/common/arrow-right.svg new file mode 100644 index 0000000000000000000000000000000000000000..87507cac7ff1e20f68cad49bbd45f7c85a5b4220 --- /dev/null +++ b/src/openeuler/static/common/arrow-right.svg @@ -0,0 +1,9 @@ + + + Style备份 + + + + + + \ No newline at end of file diff --git a/src/openeuler/static/common/arrow-up.svg b/src/openeuler/static/common/arrow-up.svg new file mode 100644 index 0000000000000000000000000000000000000000..b671d19a574a7001255def3c929f37a3de98e1b8 --- /dev/null +++ b/src/openeuler/static/common/arrow-up.svg @@ -0,0 +1,9 @@ + + + Style备份 2 + + + + + + \ No newline at end of file diff --git a/src/openeuler/static/common/blue-bg.png b/src/openeuler/static/common/blue-bg.png new file mode 100644 index 0000000000000000000000000000000000000000..7ab558ee496a7e43c88d6d7094fc4cd79732c198 Binary files /dev/null and b/src/openeuler/static/common/blue-bg.png differ diff --git a/src/openeuler/static/common/collection-icon.svg b/src/openeuler/static/common/collection-icon.svg new file mode 100644 index 0000000000000000000000000000000000000000..7ccc6d32a49ef7e9459ce3e3d538fbb7882926c8 --- /dev/null +++ b/src/openeuler/static/common/collection-icon.svg @@ -0,0 +1,15 @@ + + + 编组 10 + + + + + + + + + + + + \ No newline at end of file diff --git a/src/openeuler/static/common/default-avatar.png b/src/openeuler/static/common/default-avatar.png new file mode 100644 index 0000000000000000000000000000000000000000..933b575bbfc8294d936d9b761a427150939e5629 Binary files /dev/null and b/src/openeuler/static/common/default-avatar.png differ diff --git a/src/openeuler/static/common/location.svg b/src/openeuler/static/common/location.svg new file mode 100644 index 0000000000000000000000000000000000000000..ac9cdcecda46ac0474cfb43eb5f4bbaa8bf3f4e8 --- /dev/null +++ b/src/openeuler/static/common/location.svg @@ -0,0 +1,18 @@ + + + 定位 + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/openeuler/static/common/more.svg b/src/openeuler/static/common/more.svg new file mode 100644 index 0000000000000000000000000000000000000000..b7ba38bca398a82ff90f7fae1503ee6f6b1292de --- /dev/null +++ b/src/openeuler/static/common/more.svg @@ -0,0 +1,14 @@ + + + 编组 2 + + + + + + + + + + + \ No newline at end of file diff --git a/src/openeuler/static/common/search-icon.svg b/src/openeuler/static/common/search-icon.svg new file mode 100644 index 0000000000000000000000000000000000000000..de378daebc5fb3155cfcf4ece0a6537745448952 --- /dev/null +++ b/src/openeuler/static/common/search-icon.svg @@ -0,0 +1,31 @@ + + + Outlined/UI/search + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/openeuler/static/common/swiper-tips.svg b/src/openeuler/static/common/swiper-tips.svg new file mode 100644 index 0000000000000000000000000000000000000000..686ca716c9e0b2d4b7f49c2d0565bcc7b19e751a --- /dev/null +++ b/src/openeuler/static/common/swiper-tips.svg @@ -0,0 +1,17 @@ + + + 编组 + + + + + + + 向左滑动可收藏会议和获取地址 + + + + + + + \ No newline at end of file diff --git a/src/openeuler/static/events/1.png b/src/openeuler/static/events/1.png new file mode 100644 index 0000000000000000000000000000000000000000..66fd19aa1cc1b222926fb669e3b5d2e39f238144 Binary files /dev/null and b/src/openeuler/static/events/1.png differ diff --git a/src/openeuler/static/events/2.png b/src/openeuler/static/events/2.png new file mode 100644 index 0000000000000000000000000000000000000000..ee03d0cfc9494bc485fe00081914da6fc08249db Binary files /dev/null and b/src/openeuler/static/events/2.png differ diff --git a/src/openeuler/static/events/3.png b/src/openeuler/static/events/3.png new file mode 100644 index 0000000000000000000000000000000000000000..5bdd25f5ea1e731d1936c24c68f8cafba60e6422 Binary files /dev/null and b/src/openeuler/static/events/3.png differ diff --git a/src/openeuler/static/events/4.png b/src/openeuler/static/events/4.png new file mode 100644 index 0000000000000000000000000000000000000000..fe7aa0272846f51495b0e891deadd92b99ee33ea Binary files /dev/null and b/src/openeuler/static/events/4.png differ diff --git a/src/openeuler/static/events/collect.svg b/src/openeuler/static/events/collect.svg new file mode 100644 index 0000000000000000000000000000000000000000..083b4560f1daa3d864d96755920d651451bf4206 --- /dev/null +++ b/src/openeuler/static/events/collect.svg @@ -0,0 +1,11 @@ + + + 收藏备份 3 + + + + + + + + \ No newline at end of file diff --git a/src/openeuler/static/events/empty-events.png b/src/openeuler/static/events/empty-events.png new file mode 100644 index 0000000000000000000000000000000000000000..154a0bb3c1b5b03966d6c2d0fb1f08c46131a5fa Binary files /dev/null and b/src/openeuler/static/events/empty-events.png differ diff --git a/src/openeuler/static/events/enterprise-manage.svg b/src/openeuler/static/events/enterprise-manage.svg new file mode 100644 index 0000000000000000000000000000000000000000..f1307b11b07e9bc7375789df5c5b53b432711dc8 --- /dev/null +++ b/src/openeuler/static/events/enterprise-manage.svg @@ -0,0 +1,15 @@ + + + 功能区-发起人管理 + + + + + + + + + + + + \ No newline at end of file diff --git a/src/openeuler/static/events/list-pic/1.png b/src/openeuler/static/events/list-pic/1.png new file mode 100644 index 0000000000000000000000000000000000000000..90a37b08dcc2086da68649dde1745e8b84411553 Binary files /dev/null and b/src/openeuler/static/events/list-pic/1.png differ diff --git a/src/openeuler/static/events/list-pic/2.png b/src/openeuler/static/events/list-pic/2.png new file mode 100644 index 0000000000000000000000000000000000000000..9f9b887a7e7b8a0ba2221bdc1fe5874e50d5f577 Binary files /dev/null and b/src/openeuler/static/events/list-pic/2.png differ diff --git a/src/openeuler/static/events/list-pic/3.png b/src/openeuler/static/events/list-pic/3.png new file mode 100644 index 0000000000000000000000000000000000000000..2209beb3057ad6bb8001318789898527c6f6f32e Binary files /dev/null and b/src/openeuler/static/events/list-pic/3.png differ diff --git a/src/openeuler/static/events/list-pic/4.png b/src/openeuler/static/events/list-pic/4.png new file mode 100644 index 0000000000000000000000000000000000000000..d7731571f41c6377946eded6f9ea8ffae9c2c295 Binary files /dev/null and b/src/openeuler/static/events/list-pic/4.png differ diff --git a/src/openeuler/static/events/look-event.svg b/src/openeuler/static/events/look-event.svg new file mode 100644 index 0000000000000000000000000000000000000000..cb16c5a558ee00b00cc7cf1c074b48bffe6c9458 --- /dev/null +++ b/src/openeuler/static/events/look-event.svg @@ -0,0 +1,18 @@ + + + 功能区-查看活动 + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/openeuler/static/events/play.png b/src/openeuler/static/events/play.png new file mode 100644 index 0000000000000000000000000000000000000000..323526d37ce59a5dda51fb94705e026d92bdbd5c Binary files /dev/null and b/src/openeuler/static/events/play.png differ diff --git a/src/openeuler/static/events/publish-event.svg b/src/openeuler/static/events/publish-event.svg new file mode 100644 index 0000000000000000000000000000000000000000..a1f8b6a1be440863ad0d83e987247fe769b2cc9f --- /dev/null +++ b/src/openeuler/static/events/publish-event.svg @@ -0,0 +1,16 @@ + + + 功能区-发布活动 + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/openeuler/static/events/schedule-del.svg b/src/openeuler/static/events/schedule-del.svg new file mode 100644 index 0000000000000000000000000000000000000000..bf0a137febae37b4e38153d020c9d56655cdc92f --- /dev/null +++ b/src/openeuler/static/events/schedule-del.svg @@ -0,0 +1,16 @@ + + + 删除 + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/openeuler/static/events/selected.svg b/src/openeuler/static/events/selected.svg new file mode 100644 index 0000000000000000000000000000000000000000..8d9075b0e07a2bf83ddbd7749d84c4e09d3d4f3b --- /dev/null +++ b/src/openeuler/static/events/selected.svg @@ -0,0 +1,12 @@ + + + 编组 2 + + + + + + + + + \ No newline at end of file diff --git a/src/openeuler/static/events/share.svg b/src/openeuler/static/events/share.svg new file mode 100644 index 0000000000000000000000000000000000000000..efd2abd7a64140272183228553831dda27d62e52 --- /dev/null +++ b/src/openeuler/static/events/share.svg @@ -0,0 +1,11 @@ + + + 分享 (1)备份 + + + + + + + + \ No newline at end of file diff --git a/src/openeuler/static/events/speaker-del.svg b/src/openeuler/static/events/speaker-del.svg new file mode 100644 index 0000000000000000000000000000000000000000..662900a7a5742d98c830b7b5a4e3351f43dc6b39 --- /dev/null +++ b/src/openeuler/static/events/speaker-del.svg @@ -0,0 +1,9 @@ + + + 路径 + + + + + + \ No newline at end of file diff --git a/src/openeuler/static/events/uncollect.svg b/src/openeuler/static/events/uncollect.svg new file mode 100644 index 0000000000000000000000000000000000000000..e662ef9070476757867abd19356bc6ffd6daf162 --- /dev/null +++ b/src/openeuler/static/events/uncollect.svg @@ -0,0 +1,11 @@ + + + 收藏备份 + + + + + + + + \ No newline at end of file diff --git a/src/openeuler/static/index/date.svg b/src/openeuler/static/index/date.svg new file mode 100644 index 0000000000000000000000000000000000000000..e016d5bb8eccce96bd12eec5830fcb71eca06977 --- /dev/null +++ b/src/openeuler/static/index/date.svg @@ -0,0 +1,18 @@ + + + Outlined/UI/time + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/openeuler/static/index/desc.svg b/src/openeuler/static/index/desc.svg new file mode 100644 index 0000000000000000000000000000000000000000..96af81bda07c1cb2cd399b30bf8fe425ba458239 --- /dev/null +++ b/src/openeuler/static/index/desc.svg @@ -0,0 +1,18 @@ + + + Outlined/UI/userguide + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/openeuler/static/index/events-bg.jpg b/src/openeuler/static/index/events-bg.jpg new file mode 100644 index 0000000000000000000000000000000000000000..44e632799db61fec9508aa353e018a2c3302be77 Binary files /dev/null and b/src/openeuler/static/index/events-bg.jpg differ diff --git a/src/openeuler/static/index/events-btn.svg b/src/openeuler/static/index/events-btn.svg new file mode 100644 index 0000000000000000000000000000000000000000..6d1ece172da2cee72bd79a904158ec4722582e49 --- /dev/null +++ b/src/openeuler/static/index/events-btn.svg @@ -0,0 +1,15 @@ + + + 编组 + + + + + + + + + + + + \ No newline at end of file diff --git a/src/openeuler/static/index/finger.svg b/src/openeuler/static/index/finger.svg new file mode 100644 index 0000000000000000000000000000000000000000..0be0df94aa9b963db7b0679d31fc94c0a6730ee2 --- /dev/null +++ b/src/openeuler/static/index/finger.svg @@ -0,0 +1,36 @@ + + + shoushi + + + + + + + + + + + + + + + + + + + 会议讨论内容会议讨论内容会议讨论内容内容内内容… + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/openeuler/static/index/group.svg b/src/openeuler/static/index/group.svg new file mode 100644 index 0000000000000000000000000000000000000000..86d6140a5bedf6fdd2084ed7fb9b18ac251eb09b --- /dev/null +++ b/src/openeuler/static/index/group.svg @@ -0,0 +1,18 @@ + + + Outlined/UI/account_group + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/openeuler/static/index/link.svg b/src/openeuler/static/index/link.svg new file mode 100644 index 0000000000000000000000000000000000000000..249878d61c0cd73e43f7829f0d5f7cb2f1e71a61 --- /dev/null +++ b/src/openeuler/static/index/link.svg @@ -0,0 +1,18 @@ + + + Outlined/UI/link + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/openeuler/static/index/meeting-bg.jpg b/src/openeuler/static/index/meeting-bg.jpg new file mode 100644 index 0000000000000000000000000000000000000000..daaa37f33f90c70ee90498e0892935eb6291bc9d Binary files /dev/null and b/src/openeuler/static/index/meeting-bg.jpg differ diff --git a/src/openeuler/static/index/meeting-btn.svg b/src/openeuler/static/index/meeting-btn.svg new file mode 100644 index 0000000000000000000000000000000000000000..fb37717dc5c5fee88555db2fbe04d8d7cc725d92 --- /dev/null +++ b/src/openeuler/static/index/meeting-btn.svg @@ -0,0 +1,19 @@ + + + 编组 + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/openeuler/static/index/sponsor.svg b/src/openeuler/static/index/sponsor.svg new file mode 100644 index 0000000000000000000000000000000000000000..70148ca4d4b2c99a09295dcb2b02286120c86a42 --- /dev/null +++ b/src/openeuler/static/index/sponsor.svg @@ -0,0 +1,18 @@ + + + Outlined/UI/account + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/openeuler/static/meeting/look-meeting.svg b/src/openeuler/static/meeting/look-meeting.svg new file mode 100644 index 0000000000000000000000000000000000000000..f017bbc40a60f96db189c5edd2763911acba8db9 --- /dev/null +++ b/src/openeuler/static/meeting/look-meeting.svg @@ -0,0 +1,17 @@ + + + 功能区-查看会议 + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/openeuler/static/meeting/no-meeting.png b/src/openeuler/static/meeting/no-meeting.png new file mode 100644 index 0000000000000000000000000000000000000000..2cc284643a011dbf1a31afb4616a949d0dc8a48f Binary files /dev/null and b/src/openeuler/static/meeting/no-meeting.png differ diff --git a/src/openeuler/static/meeting/reserve-meeting.svg b/src/openeuler/static/meeting/reserve-meeting.svg new file mode 100644 index 0000000000000000000000000000000000000000..cb39f8977968d14c0c7c40ad13122b82d187bd28 --- /dev/null +++ b/src/openeuler/static/meeting/reserve-meeting.svg @@ -0,0 +1,17 @@ + + + 功能区-预定会议 + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/openeuler/static/meeting/sig-manage.svg b/src/openeuler/static/meeting/sig-manage.svg new file mode 100644 index 0000000000000000000000000000000000000000..9c8a6020f9e02ab6a427974f2c2af88edce2fde0 --- /dev/null +++ b/src/openeuler/static/meeting/sig-manage.svg @@ -0,0 +1,14 @@ + + + 功能区-SIG管理 + + + + + + + + + + + \ No newline at end of file diff --git a/src/openeuler/static/my/collection.png b/src/openeuler/static/my/collection.png new file mode 100644 index 0000000000000000000000000000000000000000..b5733a21abca440330d2594557a11781574d3952 Binary files /dev/null and b/src/openeuler/static/my/collection.png differ diff --git a/src/openeuler/static/my/common-functions/feedback.svg b/src/openeuler/static/my/common-functions/feedback.svg new file mode 100644 index 0000000000000000000000000000000000000000..2a52bac42ffd42b5e3756957102dfab1aaa0c11e --- /dev/null +++ b/src/openeuler/static/my/common-functions/feedback.svg @@ -0,0 +1,12 @@ + + + 用户反馈 + + + + + + + + + \ No newline at end of file diff --git a/src/openeuler/static/my/common-functions/headlines.svg b/src/openeuler/static/my/common-functions/headlines.svg new file mode 100644 index 0000000000000000000000000000000000000000..61138570ced16999dd619a5dbaa7e9e6ad4b55dc --- /dev/null +++ b/src/openeuler/static/my/common-functions/headlines.svg @@ -0,0 +1,12 @@ + + + 头条 + + + + + + + + + \ No newline at end of file diff --git a/src/openeuler/static/my/common-functions/help.svg b/src/openeuler/static/my/common-functions/help.svg new file mode 100644 index 0000000000000000000000000000000000000000..edd71224e4a7f7cabb8555c973cc2d0233fbbc62 --- /dev/null +++ b/src/openeuler/static/my/common-functions/help.svg @@ -0,0 +1,12 @@ + + + 建房攻略 + + + + + + + + + \ No newline at end of file diff --git a/src/openeuler/static/my/common-functions/living.svg b/src/openeuler/static/my/common-functions/living.svg new file mode 100644 index 0000000000000000000000000000000000000000..0b0bc3a5935e7cb3bdf997a082880c99dd2badd0 --- /dev/null +++ b/src/openeuler/static/my/common-functions/living.svg @@ -0,0 +1,12 @@ + + + 电视 直播 观看 视频 播放 媒体 + + + + + + + + + \ No newline at end of file diff --git a/src/openeuler/static/my/common-functions/official-account.svg b/src/openeuler/static/my/common-functions/official-account.svg new file mode 100644 index 0000000000000000000000000000000000000000..1f427ed51d6a6ddbc90e0a8d388ae84c0433ab29 --- /dev/null +++ b/src/openeuler/static/my/common-functions/official-account.svg @@ -0,0 +1,12 @@ + + + 公众号 + + + + + + + + + \ No newline at end of file diff --git a/src/openeuler/static/my/common-functions/privacy.svg b/src/openeuler/static/my/common-functions/privacy.svg new file mode 100644 index 0000000000000000000000000000000000000000..8a4fae34795700b6acb03a762658b10460088c2d --- /dev/null +++ b/src/openeuler/static/my/common-functions/privacy.svg @@ -0,0 +1,17 @@ + + + 编组 + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/openeuler/static/my/create.png b/src/openeuler/static/my/create.png new file mode 100644 index 0000000000000000000000000000000000000000..2dbb24d902b9ab1bc0c3cefe204a12501526b41d Binary files /dev/null and b/src/openeuler/static/my/create.png differ diff --git a/src/openeuler/static/my/no-collection.png b/src/openeuler/static/my/no-collection.png new file mode 100644 index 0000000000000000000000000000000000000000..09f76532ec6fc5f51b9d2ec2bc3773279efac580 Binary files /dev/null and b/src/openeuler/static/my/no-collection.png differ diff --git a/src/openeuler/static/my/privecy.png b/src/openeuler/static/my/privecy.png new file mode 100644 index 0000000000000000000000000000000000000000..039fb6c42f4535e659f0ea1748c4a61ff972dad9 Binary files /dev/null and b/src/openeuler/static/my/privecy.png differ diff --git a/src/openeuler/static/my/publishing.png b/src/openeuler/static/my/publishing.png new file mode 100644 index 0000000000000000000000000000000000000000..20784c0e7e012374495f0a5820b9e2e0b3856af6 Binary files /dev/null and b/src/openeuler/static/my/publishing.png differ diff --git a/src/openeuler/static/my/under-release.png b/src/openeuler/static/my/under-release.png new file mode 100644 index 0000000000000000000000000000000000000000..cfe33cd5df661a529ee62ec3fbbbab63ce592335 Binary files /dev/null and b/src/openeuler/static/my/under-release.png differ diff --git a/src/openeuler/static/reserve/info.svg b/src/openeuler/static/reserve/info.svg new file mode 100644 index 0000000000000000000000000000000000000000..e7f0a622eaf8ff6a5c1f9ace1300355dbc2c0dde --- /dev/null +++ b/src/openeuler/static/reserve/info.svg @@ -0,0 +1,9 @@ + + + Style + + + + + + \ No newline at end of file diff --git a/src/openeuler/static/reserve/meeting-success.png b/src/openeuler/static/reserve/meeting-success.png new file mode 100644 index 0000000000000000000000000000000000000000..5040a4fc52a85cf19de7909b22aa0c6463ed6a28 Binary files /dev/null and b/src/openeuler/static/reserve/meeting-success.png differ diff --git a/src/openeuler/static/sig/add.svg b/src/openeuler/static/sig/add.svg new file mode 100644 index 0000000000000000000000000000000000000000..c9642eb545868ba0debc52e77d99ac98a662feee --- /dev/null +++ b/src/openeuler/static/sig/add.svg @@ -0,0 +1,9 @@ + + + Style + + + + + + \ No newline at end of file diff --git a/src/openeuler/static/sig/del.svg b/src/openeuler/static/sig/del.svg new file mode 100644 index 0000000000000000000000000000000000000000..1b7ebf732751a24cdb0b0e46bec393311dd61728 --- /dev/null +++ b/src/openeuler/static/sig/del.svg @@ -0,0 +1,9 @@ + + + Style + + + + + + \ No newline at end of file diff --git a/src/openeuler/static/sig/empty-img.png b/src/openeuler/static/sig/empty-img.png new file mode 100644 index 0000000000000000000000000000000000000000..8c1bad4c1e692075b9d5be1eaec319e3559afb47 Binary files /dev/null and b/src/openeuler/static/sig/empty-img.png differ diff --git a/src/openeuler/static/tabbar/events-selected.png b/src/openeuler/static/tabbar/events-selected.png new file mode 100644 index 0000000000000000000000000000000000000000..4c1f8f7f303145b7b27e7f05eb3a9cfacf9028d2 Binary files /dev/null and b/src/openeuler/static/tabbar/events-selected.png differ diff --git a/src/openeuler/static/tabbar/events.png b/src/openeuler/static/tabbar/events.png new file mode 100644 index 0000000000000000000000000000000000000000..33b19b1929163d82c6b49c7f30590734afa66a0a Binary files /dev/null and b/src/openeuler/static/tabbar/events.png differ diff --git a/src/openeuler/static/tabbar/home-selected.png b/src/openeuler/static/tabbar/home-selected.png new file mode 100644 index 0000000000000000000000000000000000000000..a9a2b93725dd15b33200ec680de81f22a7062318 Binary files /dev/null and b/src/openeuler/static/tabbar/home-selected.png differ diff --git a/src/openeuler/static/tabbar/home.png b/src/openeuler/static/tabbar/home.png new file mode 100644 index 0000000000000000000000000000000000000000..195b9837f6c8e5b671d9f7703d92125c9a21c82c Binary files /dev/null and b/src/openeuler/static/tabbar/home.png differ diff --git a/src/openeuler/static/tabbar/meeting-selected.png b/src/openeuler/static/tabbar/meeting-selected.png new file mode 100644 index 0000000000000000000000000000000000000000..3207a3619a83bc0fbf0620b219b58a7776e2b1cd Binary files /dev/null and b/src/openeuler/static/tabbar/meeting-selected.png differ diff --git a/src/openeuler/static/tabbar/meeting.png b/src/openeuler/static/tabbar/meeting.png new file mode 100644 index 0000000000000000000000000000000000000000..7eebb976b1a90ac908404df08b49717e0f9e17d1 Binary files /dev/null and b/src/openeuler/static/tabbar/meeting.png differ diff --git a/src/openeuler/static/tabbar/my-selected.png b/src/openeuler/static/tabbar/my-selected.png new file mode 100644 index 0000000000000000000000000000000000000000..06abf8e66fcdac350a6999af31b707bdac4dd739 Binary files /dev/null and b/src/openeuler/static/tabbar/my-selected.png differ diff --git a/src/openeuler/static/tabbar/my.png b/src/openeuler/static/tabbar/my.png new file mode 100644 index 0000000000000000000000000000000000000000..e5b358d0e5821c86b32ae1a2321601e88625e2a8 Binary files /dev/null and b/src/openeuler/static/tabbar/my.png differ diff --git a/src/openeuler/utils/app-ajax.js b/src/openeuler/utils/app-ajax.js new file mode 100644 index 0000000000000000000000000000000000000000..2a9a08cda4c80c2da830845377c06db677c14ef0 --- /dev/null +++ b/src/openeuler/utils/app-ajax.js @@ -0,0 +1,189 @@ +/** + * 请求方法 + */ + +var appSession = require('./app-session.js'); +var underscore = require('./underscore-extend.js'); +const servicesConfig = require('../config/services-config.js'); +const CONSTANTS = require('../config/constants.js'); +const app = getApp(); + +var isLoadingButton = false; +var tempLoading = {}; + +/* 基础通信参数 */ +var _authClient = function() { + var deviceId = "miniprogram"; + + var auth = { + authParams: { + timestamp: new Date().getTime(), + deviceId: deviceId, + }, + clientParams: { + os: "mini", + network: "", + deviceId: deviceId, + appVersion: CONSTANTS.APP_VERSION + }, + openId: appSession.getUserInfoByKey("openId") || '', + appId: CONSTANTS.APP_ID, + areaCode: CONSTANTS.AREA_CODE, + miniId: CONSTANTS.MINI_ID + }; + + return auth; +}; + +/** + * 获取service + * @param {Object} params + */ +var _getInterfaceUrl = function(params){ + var interfaceUrl; + if(!params.otherParams){ + return servicesConfig[params["service"]]; + } + for(var key in params.otherParams){ + interfaceUrl = (interfaceUrl || servicesConfig[params["service"]]).replace("{" +key + "}", params.otherParams[key]); + } + + return interfaceUrl; +}; + +var _addUrlParam = function(data){ + + var postData = ""; + for(var key in data){ + if(!postData){ + postData = "?" + key + "=" + data[key]; + }else{ + postData += "&" + key + "=" + data[key]; + } + } + + return postData; +}; + +var appAjax = { + + /** + * 提交请求 + * @param {Object} options + * service: "" // 接口名 + * data: "", // 请求参数 + * otherParams: "", // 通过url传递的参数 + * type : "", // 请求类型 + * success: "", // 成功回调 + * error: "", // 失败回调 + * complete: "" // 完成回调 + */ + postJson : function(params) { + + var authClient = _authClient(); + + // 默认参数 + var defaultParams = { + service : "", // 服务的配置名称 + success : function(d){}, // 成功后回调 + error : null, // 失败后回调 + autoShowWait : false, // 自动显示菊花 + loadingText : "加载中...", // 加载的提示语 + autoCloseWait : true, // 自动关闭菊花 + headers : { + "base-params" : JSON.stringify(authClient), + "Authorization" : appSession.getToken()?("Bearer " + appSession.getToken()) : "" + }, + isAsync : true + }; + var ajaxParams = underscore.deepExtend(true, defaultParams, params); + // rest请求路径 + ajaxParams["url"] = CONSTANTS["SERVICE_URL"] + _getInterfaceUrl(ajaxParams); + if((ajaxParams.type == "GET" || ajaxParams.type == "DELETE") && ajaxParams.data && typeof(ajaxParams.data) == "object"){ + ajaxParams["url"] = ajaxParams["url"] + _addUrlParam(ajaxParams.data); + } + + + + // 是否展示loading + if(ajaxParams.autoShowWait && wx.showLoading) { + wx.showLoading({ + title : ajaxParams.loadingText, + mask: true + }); + } + wx.request({ + url : ajaxParams.url, + header : ajaxParams.headers, + method : ajaxParams["type"] || 'POST', + data : ajaxParams.data, + success: function( res ) { + if(res.statusCode === 401){ + wx.removeStorageSync('_app_userinfo_session'); + ajaxParams.success(0, res); + var pages = getCurrentPages(); + var currentPage = pages[pages.length-1]; + var url = currentPage.route; + if (url === 'pages/auth/auth') { + return; + } + wx.navigateTo({ + url: '/pages/auth/auth' + }) + return; + } + if(res.statusCode.toString()[0] != 2){ + var message = "有点忙开个小差,稍后再试~"; + if(ajaxParams.error){ + ajaxParams.error(message, res); + }else{ + wx.showToast({ + title: message, + icon : "none", + duration: 2000 + }); + } + return; + } + ajaxParams.success(res.data, res); + + }, + fail: function(res) { + var message = "有点忙开个小差,稍后再试~"; + ajaxParams.error && ajaxParams.error(message, res); + }, + complete : function(res) { + if(!res.errMsg.includes('ok')){ + wx.showToast({ + title: res.errMsg, + icon : "none", + duration: 2000 + }); + } + // 关闭loading + if(ajaxParams.autoShowWait && wx.hideLoading) { + wx.hideLoading(); + } + } + }); + + }, + + /** + * 上下拉 + */ + datalistParam: function() { + return { + lastdate: 0, + pageSize: 20, + type: "DOWN" // DOWN UP + }; + }, + + // 下拉 + scrollDown: "DOWN", + // 上拉 + scrollUp: "UP" +}; + +module.exports = appAjax; \ No newline at end of file diff --git a/src/openeuler/utils/app-session.js b/src/openeuler/utils/app-session.js new file mode 100644 index 0000000000000000000000000000000000000000..95c62ab28f904194d91d6a7c975092ebabd5f277 --- /dev/null +++ b/src/openeuler/utils/app-session.js @@ -0,0 +1,68 @@ +var constants = require("../config/constants.js"); +/** + * 获取用户信息 + */ +var _getUserinfo = function(){ + var userInfo = wx.getStorageSync(constants.APP_USERINFO_SESSION); + + return userInfo; +}; + +/** + * 通过key获取值 + * @params key + */ +var _getValueByKey = function(key){ + if (!key) { + return ; + } + + var userinfo = _getUserinfo(); + + if(!userinfo){ + return ; + } + return userinfo[key]; +}; + +module.exports = { + + /** + * 从缓存获取token + */ + getToken : function(){ + return _getValueByKey("access"); + }, + + /** + * 通过key获取对应信息 + */ + getUserInfoByKey : function(key){ + return _getValueByKey(key); + }, + + /** + * 获取用户信息 + */ + getUserinfo : function(){ + return _getUserinfo(); + }, + + /** + * 清楚用户信息 + */ + clearUserInfo : function(){ + wx.removeStorageSync(constants.APP_USERINFO_SESSION); + }, + + /** + * 判断是否登录 + */ + loginCheck : function(){ + + if(_getUserinfo() && _getValueByKey("access")){ + return true; + } + return false; + } +}; \ No newline at end of file diff --git a/src/openeuler/utils/app-user.js b/src/openeuler/utils/app-user.js new file mode 100644 index 0000000000000000000000000000000000000000..247198a1ba535881094d4c98f0586ef5aac78776 --- /dev/null +++ b/src/openeuler/utils/app-user.js @@ -0,0 +1,278 @@ +var appAjax = require('./app-ajax.js'); +var appSession = require("./app-session.js"); +var constants = require("../config/constants") +var app = getApp(); + +var remote = { + + /** + * 绑定手机 + * @param {Object} phone + * @param {Object} _callback + */ + _bindUserPhone: function (phone, _callback) { + appAjax.postJson({ + service: "BIND_PHONE", + data: { + phone: phone + }, + success: function (ret) { + _callback && _callback(ret); + } + }); + } +}; + +var privateMethods = { + + /** + * 登录 + * @param {Object} callback + */ + _login: function (callback) { + + + wx.showToast({ + title: "登录中", + icon: "loading", + mask: true + }); + + wx.login({ + success: function (data) { + + wx.getUserInfo({ + success: function (res) { + // 登录 + appAjax.postJson({ + headers: { + Authorization: '' + }, + service: "LOGIN", + data: { + userInfo: res.userInfo, + code: data.code + }, + success: function (result) { + res.userInfo.access = result.access; + res.userInfo.level = result.level; + res.userInfo.eventLevel = result.activity_level; + res.userInfo.gitee = result.gitee_name; + res.userInfo.userId = result.user_id; + // // 缓存用户信息 + appUser.saveLoginInfo(res.userInfo || {}); + + // // 回调 + callback && callback(res.userInfo || {}); + + } + }); + }, + fail: function (e) { + wx.hideToast(); + } + }); + } + + }) + } +} + +var appUser = { + + /** + * 需要登录的跳转 + * page为空不能传null 要 "" + */ + loginRedirect: function (page, callback) { + + // 是否有登录 + if (!appSession.loginCheck()) { + appUser.login(function (result) { + if (result && !result.phone) { + wx.navigateTo({ + url: '../register/bind-phone?page=' + page + }) + } else { + wx.navigateTo({ + url: page + }) + } + + // 支持回调 + callback && callback(); + }); + } else { + wx.navigateTo({ + url: page + }) + } + }, + + /** + * 需要登录的操作 + * @param page 操作页 page为空不能传null 要 "" + * @param callback + */ + loginHandle: function (page, callback) { + + // 是否有登录 + if (!appSession.loginCheck()) { + appUser.login(function (result) { + + if (result && !result.phone) { + wx.navigateTo({ + url: "../register/bind-phone?page=" + page + }); + } else { + callback && callback(); + } + }); + } else { + callback && callback(); + } + }, + + bindPhone: remote._bindUserPhone, + + /** + * 登录 + * @param {Object} successCallback + * @param {Object} failCallback + */ + login: function (callback, failCallback) { + var that = this; + + // 查看是否授权 + wx.getSetting({ + success: function (res) { + if (res.authSetting['scope.userInfo']) { + + // 已经授权,可以直接调用 getUserInfo 获取头像昵称 + privateMethods._login(callback); + } else { + app.loginCallback = function () { + privateMethods._login(callback); + }; + wx.navigateTo({ + url: '/pages/auth/auth' + }); + } + } + }); + }, + + /** + * 退出登录 + */ + logOut: function (callback) { + var that = this; + wx.showModal({ + title: '', + content: '确定要退出您的账号?', + success: function (res) { + if (res.confirm) { + + // 清理用户信息 + appSession.clearUserInfo(); + callback && callback(); + } + } + }); + }, + + + /** + * 微信登录 + * @param {Object} callback + * @param {Object} failCallback + */ + wxLogin: function (callback, failCallback) { + + appUser.login(function (result) { + callback && callback(result || {}); + }, failCallback); + }, + + /** + * 保存用户信息 + * @param {Object} result + */ + saveLoginInfo: function (result) { + + wx.setStorageSync(constants.APP_USERINFO_SESSION, result); + }, + + updateUserInfo: function (callback) { + let userInfo = wx.getStorageSync(constants.APP_USERINFO_SESSION); + if (userInfo && userInfo.userId) { + appAjax.postJson({ + type: 'GET', + service: "GET_USER_STATUS", + otherParams: { + id: userInfo.userId + }, + success: function (ret) { + if (ret) { + userInfo.gitee = ret.gitee_name; + userInfo.level = ret.level; + userInfo.eventLevel = ret.activity_level; + wx.setStorageSync(constants.APP_USERINFO_SESSION, userInfo); + } + callback && callback(); + } + }); + + } else { + callback && callback(); + } + }, + /** + * 兼容登录方法 + * @param {Object} callback + * @param {Object} userInfo + */ + wxGetUserProfileLogin(callback, userInfo) { + + wx.showToast({ + title: "登录中", + icon: "loading", + mask: true + }); + + wx.login({ + success: function (data) { + + appAjax.postJson({ + headers: { + Authorization: '' + }, + service: "LOGIN", + data: { + userInfo: userInfo, + code: data.code + }, + success: function (result) { + userInfo.access = result.access; + userInfo.level = result.level; + userInfo.eventLevel = result.activity_level; + userInfo.gitee = result.gitee_name; + userInfo.userId = result.user_id; + // // 缓存用户信息 + appUser.saveLoginInfo(userInfo || {}); + + // 回调 + callback && callback(userInfo || {}); + + } + }); + }, + complete() { + wx.hideToast(); + } + + }) + } +}; + +module.exports = appUser; \ No newline at end of file diff --git a/src/openeuler/utils/page-mixin.js b/src/openeuler/utils/page-mixin.js new file mode 100644 index 0000000000000000000000000000000000000000..51997040fbeb936bb4b55298f716d6467e5b6dc4 --- /dev/null +++ b/src/openeuler/utils/page-mixin.js @@ -0,0 +1,145 @@ +/** + * 页面通用方法 + * author xzx + * since 2020-8-20 + */ + +const _ = require("./underscore-extend"); +const constants = require("../config/constants"); +const { + deepExtend: $extend +} = _; +const app = getApp(); + +// 页面数据 +const data = { + isIphoneX : app.globalData.isIphoneX +}; + +// 页面方法 +const methods = { + + /** + * 设置监听器 + */ + $setWatcher(data, watch) { // 接收index.js传过来的data对象和watch对象 + watch && Object.keys(watch).forEach(v => { // 将watch对象内的key遍历 + this.$observe(data, v, watch[v]); // 监听data内的v属性,传入watch内对应函数以调用 + }) + }, + + /** + * 监听属性 并执行监听函数 + */ + $observe(obj, key, watchFun) { + var val = obj[key]; // 给该属性设默认值 + var that = this; + Object.defineProperty(obj, key, { + configurable: true, + enumerable: true, + set(value) { + val = value; + watchFun.call(that, value, val); // 赋值(set)时,调用对应函数 + }, + get() { + return val; + } + }) + }, + + /** + * 页面跳转 + */ + $navigateTo(event) { + wx.navigateTo({ + url: event.currentTarget.dataset.url + }) + }, + + $stopPropagation() {} +}; + +// 生命周期 +const lifeCycle = { + onLoad: { + before() { + this.$setWatcher(this.data, this.watch); // 设置监听器 + + var pages = getCurrentPages() //获取加载的页面 + var currentPage = pages[pages.length-1] //获取当前页面的对象 + var url = currentPage.route //当前页面url + + // 判断是否登录 + let userInfo = wx.getStorageSync(constants.APP_USERINFO_SESSION); + + if(url != 'pages/auth/auth') { + // wx.navigateTo({ + // url: `/package-events/events/sign-success?id=46` + // }) + if(!userInfo && !userInfo.access) { + // app.globalData.tourist = true; + } + } + }, + after() { + } + }, + + onShow : { + before() { + wx.hideHomeButton && wx.hideHomeButton(); + } + } +}; + +var local = { + + getLifeCycle(rewriteList, lifeCycle, pageConfig) { + let config = {}; + + rewriteList.forEach((i) => { + if(i in pageConfig) { + config[i] = function() { + (i in lifeCycle) && ('before' in lifeCycle[i]) && lifeCycle[i].before.call(this, ...arguments); + pageConfig[i].call(this, ...arguments); + (i in lifeCycle) && ('after' in lifeCycle[i]) && lifeCycle[i].after.call(this, ...arguments); + } + } + }); + + return config; + } +}; + +var $pageMixin = function(pageConfig) { + + let rewriteList = [ + 'onLoad', // 生命周期函数--监听页面加载 + // 'onReady', // 生命周期函数--监听页面初次渲染完成 + // 'onShow', // 生命周期函数--监听页面显示 + // 'onHide', // 生命周期函数--监听页面隐藏 + // 'onUnload', // 生命周期函数--监听页面卸载 + // 'onPullDownRefresh', // 页面相关事件处理函数--监听用户下拉动作 + // 'onReachBottom', // 页面上拉触底事件的处理函数 + // 'onShareAppMessage' // 用户点击右上角分享 + ]; + + let lifeConfig = local.getLifeCycle(rewriteList, lifeCycle, pageConfig); + + let baseConfig = { + data, + ...methods + }; + + return $extend({}, + baseConfig, + pageConfig, + lifeConfig + ); +}; + +module.exports = { + _, + $pageMixin, + $extend +}; \ No newline at end of file diff --git a/src/openeuler/utils/underscore-extend.js b/src/openeuler/utils/underscore-extend.js new file mode 100644 index 0000000000000000000000000000000000000000..00a44930e24dedf54616c409414109b112b5bf63 --- /dev/null +++ b/src/openeuler/utils/underscore-extend.js @@ -0,0 +1,49 @@ +/** + * underscore扩展方法 + */ + +var _ = require('./underscore.js'); + +_.mixin({ + + /** + * 对象深拷贝 + */ + deepExtend: function(target) { + var deep = true, args = [].slice.call(arguments, 1); + + var extend = function(target, source, deep) { + var isArray = _.isArray; + var isWindow = function(obj) { + return obj != null && obj == obj.window; + }; + var isPlainObject = function(obj) { + return _.isObject(obj) && !isWindow(obj) && obj.__proto__ == Object.prototype; + }; + for(var key in source){ + + //如果深度扩展 + if(deep && (isPlainObject(source[key]) || isArray(source[key]))) { + //如果要扩展的数据是对象且target相对应的key不是对象 + if(isPlainObject(source[key]) && !isPlainObject(target[key])) target[key] = {} + //如果要扩展的数据是数组且target相对应的key不是数组 + if(isArray(source[key]) && !isArray(target[key])) target[key] = [] + extend(target[key], source[key], deep) + } else if(source[key] !== undefined) target[key] = source[key] + } + }; + + if(typeof target == 'boolean') { //当第一个参数为boolean类型的值时,表示是否深度扩展 + deep = target + target = args.shift() //target取第二个参数 + } + + //遍历后面的参数,全部扩展到target上 + args.forEach(function(arg) { + extend(target, arg, deep) + }); + return target; + } +}); + +module.exports = _; \ No newline at end of file diff --git a/src/openeuler/utils/underscore.js b/src/openeuler/utils/underscore.js new file mode 100644 index 0000000000000000000000000000000000000000..2ebe814af2704603691af366e8ef33492977adda --- /dev/null +++ b/src/openeuler/utils/underscore.js @@ -0,0 +1,6 @@ +// Underscore.js 1.8.2 +// http://underscorejs.org +// (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors +// Underscore may be freely distributed under the MIT license. +(function(){function n(n){function t(t,r,e,u,i,o){for(;i>=0&&o>i;i+=n){var a=u?u[i]:i;e=r(e,t[a],a,t)}return e}return function(r,e,u,i){e=d(e,i,4);var o=!w(r)&&m.keys(r),a=(o||r).length,c=n>0?0:a-1;return arguments.length<3&&(u=r[o?o[c]:c],c+=n),t(r,e,u,o,c,a)}}function t(n){return function(t,r,e){r=b(r,e);for(var u=null!=t&&t.length,i=n>0?0:u-1;i>=0&&u>i;i+=n)if(r(t[i],i,t))return i;return-1}}function r(n,t){var r=S.length,e=n.constructor,u=m.isFunction(e)&&e.prototype||o,i="constructor";for(m.has(n,i)&&!m.contains(t,i)&&t.push(i);r--;)i=S[r],i in n&&n[i]!==u[i]&&!m.contains(t,i)&&t.push(i)}var e=this,u=e._,i=Array.prototype,o=Object.prototype,a=Function.prototype,c=i.push,l=i.slice,f=o.toString,s=o.hasOwnProperty,p=Array.isArray,h=Object.keys,v=a.bind,g=Object.create,y=function(){},m=function(n){return n instanceof m?n:this instanceof m?void(this._wrapped=n):new m(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=m),exports._=m):e._=m,m.VERSION="1.8.2";var d=function(n,t,r){if(t===void 0)return n;switch(null==r?3:r){case 1:return function(r){return n.call(t,r)};case 2:return function(r,e){return n.call(t,r,e)};case 3:return function(r,e,u){return n.call(t,r,e,u)};case 4:return function(r,e,u,i){return n.call(t,r,e,u,i)}}return function(){return n.apply(t,arguments)}},b=function(n,t,r){return null==n?m.identity:m.isFunction(n)?d(n,t,r):m.isObject(n)?m.matcher(n):m.property(n)};m.iteratee=function(n,t){return b(n,t,1/0)};var x=function(n,t){return function(r){var e=arguments.length;if(2>e||null==r)return r;for(var u=1;e>u;u++)for(var i=arguments[u],o=n(i),a=o.length,c=0;a>c;c++){var l=o[c];t&&r[l]!==void 0||(r[l]=i[l])}return r}},_=function(n){if(!m.isObject(n))return{};if(g)return g(n);y.prototype=n;var t=new y;return y.prototype=null,t},j=Math.pow(2,53)-1,w=function(n){var t=n&&n.length;return"number"==typeof t&&t>=0&&j>=t};m.each=m.forEach=function(n,t,r){t=d(t,r);var e,u;if(w(n))for(e=0,u=n.length;u>e;e++)t(n[e],e,n);else{var i=m.keys(n);for(e=0,u=i.length;u>e;e++)t(n[i[e]],i[e],n)}return n},m.map=m.collect=function(n,t,r){t=b(t,r);for(var e=!w(n)&&m.keys(n),u=(e||n).length,i=Array(u),o=0;u>o;o++){var a=e?e[o]:o;i[o]=t(n[a],a,n)}return i},m.reduce=m.foldl=m.inject=n(1),m.reduceRight=m.foldr=n(-1),m.find=m.detect=function(n,t,r){var e;return e=w(n)?m.findIndex(n,t,r):m.findKey(n,t,r),e!==void 0&&e!==-1?n[e]:void 0},m.filter=m.select=function(n,t,r){var e=[];return t=b(t,r),m.each(n,function(n,r,u){t(n,r,u)&&e.push(n)}),e},m.reject=function(n,t,r){return m.filter(n,m.negate(b(t)),r)},m.every=m.all=function(n,t,r){t=b(t,r);for(var e=!w(n)&&m.keys(n),u=(e||n).length,i=0;u>i;i++){var o=e?e[i]:i;if(!t(n[o],o,n))return!1}return!0},m.some=m.any=function(n,t,r){t=b(t,r);for(var e=!w(n)&&m.keys(n),u=(e||n).length,i=0;u>i;i++){var o=e?e[i]:i;if(t(n[o],o,n))return!0}return!1},m.contains=m.includes=m.include=function(n,t,r){return w(n)||(n=m.values(n)),m.indexOf(n,t,"number"==typeof r&&r)>=0},m.invoke=function(n,t){var r=l.call(arguments,2),e=m.isFunction(t);return m.map(n,function(n){var u=e?t:n[t];return null==u?u:u.apply(n,r)})},m.pluck=function(n,t){return m.map(n,m.property(t))},m.where=function(n,t){return m.filter(n,m.matcher(t))},m.findWhere=function(n,t){return m.find(n,m.matcher(t))},m.max=function(n,t,r){var e,u,i=-1/0,o=-1/0;if(null==t&&null!=n){n=w(n)?n:m.values(n);for(var a=0,c=n.length;c>a;a++)e=n[a],e>i&&(i=e)}else t=b(t,r),m.each(n,function(n,r,e){u=t(n,r,e),(u>o||u===-1/0&&i===-1/0)&&(i=n,o=u)});return i},m.min=function(n,t,r){var e,u,i=1/0,o=1/0;if(null==t&&null!=n){n=w(n)?n:m.values(n);for(var a=0,c=n.length;c>a;a++)e=n[a],i>e&&(i=e)}else t=b(t,r),m.each(n,function(n,r,e){u=t(n,r,e),(o>u||1/0===u&&1/0===i)&&(i=n,o=u)});return i},m.shuffle=function(n){for(var t,r=w(n)?n:m.values(n),e=r.length,u=Array(e),i=0;e>i;i++)t=m.random(0,i),t!==i&&(u[i]=u[t]),u[t]=r[i];return u},m.sample=function(n,t,r){return null==t||r?(w(n)||(n=m.values(n)),n[m.random(n.length-1)]):m.shuffle(n).slice(0,Math.max(0,t))},m.sortBy=function(n,t,r){return t=b(t,r),m.pluck(m.map(n,function(n,r,e){return{value:n,index:r,criteria:t(n,r,e)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index-t.index}),"value")};var A=function(n){return function(t,r,e){var u={};return r=b(r,e),m.each(t,function(e,i){var o=r(e,i,t);n(u,e,o)}),u}};m.groupBy=A(function(n,t,r){m.has(n,r)?n[r].push(t):n[r]=[t]}),m.indexBy=A(function(n,t,r){n[r]=t}),m.countBy=A(function(n,t,r){m.has(n,r)?n[r]++:n[r]=1}),m.toArray=function(n){return n?m.isArray(n)?l.call(n):w(n)?m.map(n,m.identity):m.values(n):[]},m.size=function(n){return null==n?0:w(n)?n.length:m.keys(n).length},m.partition=function(n,t,r){t=b(t,r);var e=[],u=[];return m.each(n,function(n,r,i){(t(n,r,i)?e:u).push(n)}),[e,u]},m.first=m.head=m.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:m.initial(n,n.length-t)},m.initial=function(n,t,r){return l.call(n,0,Math.max(0,n.length-(null==t||r?1:t)))},m.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:m.rest(n,Math.max(0,n.length-t))},m.rest=m.tail=m.drop=function(n,t,r){return l.call(n,null==t||r?1:t)},m.compact=function(n){return m.filter(n,m.identity)};var k=function(n,t,r,e){for(var u=[],i=0,o=e||0,a=n&&n.length;a>o;o++){var c=n[o];if(w(c)&&(m.isArray(c)||m.isArguments(c))){t||(c=k(c,t,r));var l=0,f=c.length;for(u.length+=f;f>l;)u[i++]=c[l++]}else r||(u[i++]=c)}return u};m.flatten=function(n,t){return k(n,t,!1)},m.without=function(n){return m.difference(n,l.call(arguments,1))},m.uniq=m.unique=function(n,t,r,e){if(null==n)return[];m.isBoolean(t)||(e=r,r=t,t=!1),null!=r&&(r=b(r,e));for(var u=[],i=[],o=0,a=n.length;a>o;o++){var c=n[o],l=r?r(c,o,n):c;t?(o&&i===l||u.push(c),i=l):r?m.contains(i,l)||(i.push(l),u.push(c)):m.contains(u,c)||u.push(c)}return u},m.union=function(){return m.uniq(k(arguments,!0,!0))},m.intersection=function(n){if(null==n)return[];for(var t=[],r=arguments.length,e=0,u=n.length;u>e;e++){var i=n[e];if(!m.contains(t,i)){for(var o=1;r>o&&m.contains(arguments[o],i);o++);o===r&&t.push(i)}}return t},m.difference=function(n){var t=k(arguments,!0,!0,1);return m.filter(n,function(n){return!m.contains(t,n)})},m.zip=function(){return m.unzip(arguments)},m.unzip=function(n){for(var t=n&&m.max(n,"length").length||0,r=Array(t),e=0;t>e;e++)r[e]=m.pluck(n,e);return r},m.object=function(n,t){for(var r={},e=0,u=n&&n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},m.indexOf=function(n,t,r){var e=0,u=n&&n.length;if("number"==typeof r)e=0>r?Math.max(0,u+r):r;else if(r&&u)return e=m.sortedIndex(n,t),n[e]===t?e:-1;if(t!==t)return m.findIndex(l.call(n,e),m.isNaN);for(;u>e;e++)if(n[e]===t)return e;return-1},m.lastIndexOf=function(n,t,r){var e=n?n.length:0;if("number"==typeof r&&(e=0>r?e+r+1:Math.min(e,r+1)),t!==t)return m.findLastIndex(l.call(n,0,e),m.isNaN);for(;--e>=0;)if(n[e]===t)return e;return-1},m.findIndex=t(1),m.findLastIndex=t(-1),m.sortedIndex=function(n,t,r,e){r=b(r,e,1);for(var u=r(t),i=0,o=n.length;o>i;){var a=Math.floor((i+o)/2);r(n[a])i;i++,n+=r)u[i]=n;return u};var O=function(n,t,r,e,u){if(!(e instanceof t))return n.apply(r,u);var i=_(n.prototype),o=n.apply(i,u);return m.isObject(o)?o:i};m.bind=function(n,t){if(v&&n.bind===v)return v.apply(n,l.call(arguments,1));if(!m.isFunction(n))throw new TypeError("Bind must be called on a function");var r=l.call(arguments,2),e=function(){return O(n,e,t,this,r.concat(l.call(arguments)))};return e},m.partial=function(n){var t=l.call(arguments,1),r=function(){for(var e=0,u=t.length,i=Array(u),o=0;u>o;o++)i[o]=t[o]===m?arguments[e++]:t[o];for(;e=e)throw new Error("bindAll must be passed function names");for(t=1;e>t;t++)r=arguments[t],n[r]=m.bind(n[r],n);return n},m.memoize=function(n,t){var r=function(e){var u=r.cache,i=""+(t?t.apply(this,arguments):e);return m.has(u,i)||(u[i]=n.apply(this,arguments)),u[i]};return r.cache={},r},m.delay=function(n,t){var r=l.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},m.defer=m.partial(m.delay,m,1),m.throttle=function(n,t,r){var e,u,i,o=null,a=0;r||(r={});var c=function(){a=r.leading===!1?0:m.now(),o=null,i=n.apply(e,u),o||(e=u=null)};return function(){var l=m.now();a||r.leading!==!1||(a=l);var f=t-(l-a);return e=this,u=arguments,0>=f||f>t?(o&&(clearTimeout(o),o=null),a=l,i=n.apply(e,u),o||(e=u=null)):o||r.trailing===!1||(o=setTimeout(c,f)),i}},m.debounce=function(n,t,r){var e,u,i,o,a,c=function(){var l=m.now()-o;t>l&&l>=0?e=setTimeout(c,t-l):(e=null,r||(a=n.apply(i,u),e||(i=u=null)))};return function(){i=this,u=arguments,o=m.now();var l=r&&!e;return e||(e=setTimeout(c,t)),l&&(a=n.apply(i,u),i=u=null),a}},m.wrap=function(n,t){return m.partial(t,n)},m.negate=function(n){return function(){return!n.apply(this,arguments)}},m.compose=function(){var n=arguments,t=n.length-1;return function(){for(var r=t,e=n[t].apply(this,arguments);r--;)e=n[r].call(this,e);return e}},m.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},m.before=function(n,t){var r;return function(){return--n>0&&(r=t.apply(this,arguments)),1>=n&&(t=null),r}},m.once=m.partial(m.before,2);var F=!{toString:null}.propertyIsEnumerable("toString"),S=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];m.keys=function(n){if(!m.isObject(n))return[];if(h)return h(n);var t=[];for(var e in n)m.has(n,e)&&t.push(e);return F&&r(n,t),t},m.allKeys=function(n){if(!m.isObject(n))return[];var t=[];for(var e in n)t.push(e);return F&&r(n,t),t},m.values=function(n){for(var t=m.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},m.mapObject=function(n,t,r){t=b(t,r);for(var e,u=m.keys(n),i=u.length,o={},a=0;i>a;a++)e=u[a],o[e]=t(n[e],e,n);return o},m.pairs=function(n){for(var t=m.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},m.invert=function(n){for(var t={},r=m.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},m.functions=m.methods=function(n){var t=[];for(var r in n)m.isFunction(n[r])&&t.push(r);return t.sort()},m.extend=x(m.allKeys),m.extendOwn=m.assign=x(m.keys),m.findKey=function(n,t,r){t=b(t,r);for(var e,u=m.keys(n),i=0,o=u.length;o>i;i++)if(e=u[i],t(n[e],e,n))return e},m.pick=function(n,t,r){var e,u,i={},o=n;if(null==o)return i;m.isFunction(t)?(u=m.allKeys(o),e=d(t,r)):(u=k(arguments,!1,!1,1),e=function(n,t,r){return t in r},o=Object(o));for(var a=0,c=u.length;c>a;a++){var l=u[a],f=o[l];e(f,l,o)&&(i[l]=f)}return i},m.omit=function(n,t,r){if(m.isFunction(t))t=m.negate(t);else{var e=m.map(k(arguments,!1,!1,1),String);t=function(n,t){return!m.contains(e,t)}}return m.pick(n,t,r)},m.defaults=x(m.allKeys,!0),m.clone=function(n){return m.isObject(n)?m.isArray(n)?n.slice():m.extend({},n):n},m.tap=function(n,t){return t(n),n},m.isMatch=function(n,t){var r=m.keys(t),e=r.length;if(null==n)return!e;for(var u=Object(n),i=0;e>i;i++){var o=r[i];if(t[o]!==u[o]||!(o in u))return!1}return!0};var E=function(n,t,r,e){if(n===t)return 0!==n||1/n===1/t;if(null==n||null==t)return n===t;n instanceof m&&(n=n._wrapped),t instanceof m&&(t=t._wrapped);var u=f.call(n);if(u!==f.call(t))return!1;switch(u){case"[object RegExp]":case"[object String]":return""+n==""+t;case"[object Number]":return+n!==+n?+t!==+t:0===+n?1/+n===1/t:+n===+t;case"[object Date]":case"[object Boolean]":return+n===+t}var i="[object Array]"===u;if(!i){if("object"!=typeof n||"object"!=typeof t)return!1;var o=n.constructor,a=t.constructor;if(o!==a&&!(m.isFunction(o)&&o instanceof o&&m.isFunction(a)&&a instanceof a)&&"constructor"in n&&"constructor"in t)return!1}r=r||[],e=e||[];for(var c=r.length;c--;)if(r[c]===n)return e[c]===t;if(r.push(n),e.push(t),i){if(c=n.length,c!==t.length)return!1;for(;c--;)if(!E(n[c],t[c],r,e))return!1}else{var l,s=m.keys(n);if(c=s.length,m.keys(t).length!==c)return!1;for(;c--;)if(l=s[c],!m.has(t,l)||!E(n[l],t[l],r,e))return!1}return r.pop(),e.pop(),!0};m.isEqual=function(n,t){return E(n,t)},m.isEmpty=function(n){return null==n?!0:w(n)&&(m.isArray(n)||m.isString(n)||m.isArguments(n))?0===n.length:0===m.keys(n).length},m.isElement=function(n){return!(!n||1!==n.nodeType)},m.isArray=p||function(n){return"[object Array]"===f.call(n)},m.isObject=function(n){var t=typeof n;return"function"===t||"object"===t&&!!n},m.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(n){m["is"+n]=function(t){return f.call(t)==="[object "+n+"]"}}),m.isArguments(arguments)||(m.isArguments=function(n){return m.has(n,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(m.isFunction=function(n){return"function"==typeof n||!1}),m.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},m.isNaN=function(n){return m.isNumber(n)&&n!==+n},m.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"===f.call(n)},m.isNull=function(n){return null===n},m.isUndefined=function(n){return n===void 0},m.has=function(n,t){return null!=n&&s.call(n,t)},m.noConflict=function(){return e._=u,this},m.identity=function(n){return n},m.constant=function(n){return function(){return n}},m.noop=function(){},m.property=function(n){return function(t){return null==t?void 0:t[n]}},m.propertyOf=function(n){return null==n?function(){}:function(t){return n[t]}},m.matcher=m.matches=function(n){return n=m.extendOwn({},n),function(t){return m.isMatch(t,n)}},m.times=function(n,t,r){var e=Array(Math.max(0,n));t=d(t,r,1);for(var u=0;n>u;u++)e[u]=t(u);return e},m.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))},m.now=Date.now||function(){return(new Date).getTime()};var M={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},N=m.invert(M),I=function(n){var t=function(t){return n[t]},r="(?:"+m.keys(n).join("|")+")",e=RegExp(r),u=RegExp(r,"g");return function(n){return n=null==n?"":""+n,e.test(n)?n.replace(u,t):n}};m.escape=I(M),m.unescape=I(N),m.result=function(n,t,r){var e=null==n?void 0:n[t];return e===void 0&&(e=r),m.isFunction(e)?e.call(n):e};var B=0;m.uniqueId=function(n){var t=++B+"";return n?n+t:t},m.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var T=/(.)^/,R={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},q=/\\|'|\r|\n|\u2028|\u2029/g,K=function(n){return"\\"+R[n]};m.template=function(n,t,r){!t&&r&&(t=r),t=m.defaults({},t,m.templateSettings);var e=RegExp([(t.escape||T).source,(t.interpolate||T).source,(t.evaluate||T).source].join("|")+"|$","g"),u=0,i="__p+='";n.replace(e,function(t,r,e,o,a){return i+=n.slice(u,a).replace(q,K),u=a+t.length,r?i+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":e?i+="'+\n((__t=("+e+"))==null?'':__t)+\n'":o&&(i+="';\n"+o+"\n__p+='"),t}),i+="';\n",t.variable||(i="with(obj||{}){\n"+i+"}\n"),i="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{var o=new Function(t.variable||"obj","_",i)}catch(a){throw a.source=i,a}var c=function(n){return o.call(this,n,m)},l=t.variable||"obj";return c.source="function("+l+"){\n"+i+"}",c},m.chain=function(n){var t=m(n);return t._chain=!0,t};var z=function(n,t){return n._chain?m(t).chain():t};m.mixin=function(n){m.each(m.functions(n),function(t){var r=m[t]=n[t];m.prototype[t]=function(){var n=[this._wrapped];return c.apply(n,arguments),z(this,r.apply(m,n))}})},m.mixin(m),m.each(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=i[n];m.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!==n&&"splice"!==n||0!==r.length||delete r[0],z(this,r)}}),m.each(["concat","join","slice"],function(n){var t=i[n];m.prototype[n]=function(){return z(this,t.apply(this._wrapped,arguments))}}),m.prototype.value=function(){return this._wrapped},m.prototype.valueOf=m.prototype.toJSON=m.prototype.value,m.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return m})}).call(this || module.exports); +//# sourceMappingURL=underscore-min.map \ No newline at end of file diff --git a/src/openeuler/utils/util.js b/src/openeuler/utils/util.js new file mode 100644 index 0000000000000000000000000000000000000000..0cbb61a50789cb4fa00423e040782675fbedece0 --- /dev/null +++ b/src/openeuler/utils/util.js @@ -0,0 +1,19 @@ +const formatTime = date => { + const year = date.getFullYear() + const month = date.getMonth() + 1 + const day = date.getDate() + const hour = date.getHours() + const minute = date.getMinutes() + const second = date.getSeconds() + + return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':') +} + +const formatNumber = n => { + n = n.toString() + return n[1] ? n : '0' + n +} + +module.exports = { + formatTime: formatTime +} diff --git a/src/openeuler/utils/utils.js b/src/openeuler/utils/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..9edc78137782d6225ebd61d2c35c2dccace6a4bb --- /dev/null +++ b/src/openeuler/utils/utils.js @@ -0,0 +1,278 @@ +/** + * 工具类 + */ + +var _ = require("./underscore-extend"); + +var utils = { + + /** + * underscore工具库 + */ + _ : _, + + /** + * 深拷贝工具 + */ + deepExtend : _.deepExtend, + + /** + * 获取时间差(小于一天) + * @param {Object} startTime 开始时间 long 毫秒数 + * @param {Object} endTime 结束时间 long 毫秒数 + * return { + * "days" : days, + * "hours" : hours, + * "minutes" : minutes, + * "seconds" : seconds + * } + */ + getDiffTime: function(startTime, endTime) { + // 相差时间 + var diffTime = endTime - startTime; + if(diffTime <= 0) { + return false; + } + // 计算出相差天数 + var days = Math.floor(diffTime / (24 * 3600 * 1000)); + // 计算出小时数 + var leave1 = diffTime % (24 * 3600 * 1000); //计算天数后剩余的毫秒数 + var hours = Math.floor(leave1 / (3600 * 1000)); + // 计算相差分钟数 + var leave2 = leave1 % (3600 * 1000); //计算小时数后剩余的毫秒数 + var minutes = Math.floor(leave2 / (60 * 1000)); + // 计算相差秒数 + var leave3 = leave2 % (60 * 1000); //计算分钟数后剩余的毫秒数 + var seconds = Math.round(leave3 / 1000); + + return { + "days": days, + "hours": hours, + "minutes": minutes, + "seconds": seconds + }; + }, + + /** + * 返回定时器格式(若天和小时为0则隐藏天和小时) + * @param {Object} time + */ + getTiktokStr: function(time) { + var str = time.seconds + "秒"; + if(time.days != 0) { + str = time.days + "天" + time.hours + "小时" + time.minutes + "分钟" + str; + } else if(time.hours != 0) { + str = time.hours + "小时" + time.minutes + "分钟" + str; + } else if(time.minutes != 0) { + str = time.minutes + "分钟" + str; + } + return str; + }, + + /** + * 倒计时方法 + * @param {Object} startTime long 开始时间 + * @param {Object} endTime long 结束时间 + * @param {Object} renderFunc 回调渲染函数 + * @param {Object} endFunc 倒计时结束回调函数 + */ + intervalTime: function(startTime, endTime, renderFunc, endFunc) { + + if(!startTime || !endTime) { + return; + } + startTime = parseInt(startTime); + endTime = parseInt(endTime); + + var that = this; + + var diffTime = that.getDiffTime(startTime, endTime); + diffTime = that.getTiktokStr(diffTime); + renderFunc && renderFunc(diffTime); + startTime += 1000; + + var interval = setInterval(function() { + diffTime = that.getDiffTime(startTime, endTime); + if(diffTime) { + startTime += 1000; + diffTime = that.getTiktokStr(diffTime); + renderFunc && renderFunc(diffTime); + } else { + clearInterval(interval); + endFunc && endFunc(); + } + }, 1000); + }, + + /** + * 判断对象是否为空 + */ + isEmptyObject: function(obj) { + var t; + for(t in obj) { + return false; + } + return true; + }, + + /** + * 获取当前页面url + */ + getCurrentUrl: function() { + + var pageStack = getCurrentPages(); + var thisPage = pageStack[pageStack.length - 1]; + + var baseUrl = thisPage.route; + var paramObj = thisPage.options; + var params = ""; + + if(this.isEmptyObject(paramObj)) { + return baseUrl; + } else { + for(var i in paramObj) { + if(params.indexOf("?") >= 0) { + params += "&"; + } else { + params += "?"; + } + params += i + "=" + paramObj[i]; + } + } + + return baseUrl + params; + }, + + /** + * 替换html特殊字符串 + */ + replaceHtmlString: function(str) { + str = str.replace(/ /g, ' '); + return str; + }, + + /** + * 添加URL的参数 + * @param name 名称 + * @param value 值 + * @param url 链接地址 + */ + addUrlParam: function(name, value, url) { + + if(!value) { + return url; + } + + if(url.indexOf(name + "=") > -1){ + return url; + } + var tmpUrl = url; + + // 判断是否已经有其他参数 + if(tmpUrl.indexOf("?") >= 0) { + tmpUrl += "&"; + } else { + tmpUrl += "?"; + } + tmpUrl += name + "=" + value; + + return tmpUrl; + }, + + /** + * 日期格式化 + */ + formateDate : function() { + + // 对Date的扩展,将 Date 转化为指定格式的String + // 月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符, + // 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字) + // 例子: + // (new Date()).Format("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423 + // (new Date()).Format("yyyy-M-d h:m:s.S") ==> 2006-7-2 8:9:4.18 + Date.prototype.Format = function (fmt) { + var o = { + "M+": this.getMonth() + 1, //月份 + "d+": this.getDate(), //日 + "h+": this.getHours(), //小时 + "m+": this.getMinutes(), //分 + "s+": this.getSeconds(), //秒 + "q+": Math.floor((this.getMonth() + 3) / 3), //季度 + "S": this.getMilliseconds() //毫秒 + }; + if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length)); + for (var k in o) + if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length))); + return fmt; + } + }, + + /** + * 版本比较 + * param {string} v1 > v2 ? 1 : -1 ; 相等返回0 + */ + compareVersion : function(v1,v2){ + v1 = v1.split('.'); + v2 = v2.split('.'); + var len = Math.max(v1.length, v2.length); + + while (v1.length < len) { + v1.push('0'); + } + + while (v2.length < len) { + v2.push('0'); + } + + for (var i = 0; i < len; i++) { + var num1 = parseInt(v1[i]); + var num2 = parseInt(v2[i]); + + if(num1 > num2) { + return 1; + }else if (num1 < num2) { + return -1; + } + } + + return 0; + }, + + /** + * 静态资源定时清理缓存用的后缀 + */ + resourceSuffix : function() { + var randomStr = '?' + new Date().getTime().toString().slice(0,7) + '000000'; + return randomStr; + }, + + /** + * 资讯跳转方法(文章、图集) + * @param {Object} options + * jumpType:跳转方法名, + * infoType:资讯类型1文章 2图集 3视频 4链接(不支持), + * id:资讯详情id + */ + jumpToInfo : function(options) { + + var id = options.id ? options.id : ""; + var type = options.infoType ? options.infoType : 1; + var jumpType = (options.jumpType && + (options.jumpType in wx) && + (typeof wx[options.jumpType] == 'function')) ? options.jumpType : "navigateTo"; + + // 1文章 2图集 3视频 4链接(不支持) + var infoConfig = { + 1 : "/pages/discovery/info", + 2 : "/pages/discovery/picture-info" + }; + + var path = (type in infoConfig) ? (infoConfig[type] + "?id=" + id) : (infoConfig[1] + "?id=" + id); + + wx[jumpType]({ + url: path + }); + } +}; + +module.exports = utils; \ No newline at end of file diff --git a/src/openeuler/utils/wx-validate.js b/src/openeuler/utils/wx-validate.js new file mode 100644 index 0000000000000000000000000000000000000000..36d069d6f47b98dcc2012290f8ccfecc8ee0974d --- /dev/null +++ b/src/openeuler/utils/wx-validate.js @@ -0,0 +1,417 @@ +/** + * 表单验证 + * @param {Object} rules 验证字段的规则 + * @param {Object} messages 验证字段的提示信息 + */ + +class WxValidate { + constructor(rules = {}, messages = {}) { + Object.assign(this, { + data: {}, + rules, + messages, + }) + this.__init() + } + + /** + * __init + */ + __init() { + this.__initMethods() + this.__initDefaults() + this.__initData() + } + + /** + * 初始化数据 + */ + __initData() { + this.form = {} + this.errorList = [] + } + + /** + * 初始化默认提示信息 + */ + __initDefaults() { + this.defaults = { + messages: { + required: '这是必填字段。', + email: '请输入有效的电子邮件地址。', + tel: '请输入11位的手机号码。', + url: '请输入有效的网址。', + date: '请输入有效的日期。', + dateISO: '请输入有效的日期(ISO),例如:2009-06-23,1998/01/22。', + number: '请输入有效的数字。', + digits: '只能输入数字。', + idcard: '请输入18位的有效身份证。', + equalTo: this.formatTpl('输入值必须和 {0} 相同。'), + contains: this.formatTpl('输入值必须包含 {0}。'), + minlength: this.formatTpl('最少要输入 {0} 个字符。'), + maxlength: this.formatTpl('最多可以输入 {0} 个字符。'), + rangelength: this.formatTpl('请输入长度在 {0} 到 {1} 之间的字符。'), + min: this.formatTpl('请输入不小于 {0} 的数值。'), + max: this.formatTpl('请输入不大于 {0} 的数值。'), + range: this.formatTpl('请输入范围在 {0} 到 {1} 之间的数值。'), + } + } + } + + /** + * 初始化默认验证方法 + */ + __initMethods() { + const that = this + that.methods = { + /** + * 验证必填元素 + */ + required(value, param) { + if(!that.depend(param)) { + return 'dependency-mismatch' + } else if(typeof value === 'number') { + value = value.toString() + } else if(typeof value === 'boolean') { + return !0 + } + + return value.length > 0 + }, + /** + * 验证电子邮箱格式 + */ + email(value) { + return that.optional(value) || /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(value) + }, + /** + * 验证手机格式 + */ + tel(value) { + return that.optional(value) || /^1[3456789]\d{9}$/.test(value) + }, + /** + * 验证URL格式 + */ + url(value) { + return that.optional(value) || /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(value) + }, + /** + * 验证日期格式 + */ + date(value) { + return that.optional(value) || !/Invalid|NaN/.test(new Date(value).toString()) + }, + /** + * 验证ISO类型的日期格式 + */ + dateISO(value) { + return that.optional(value) || /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value) + }, + /** + * 验证十进制数字 + */ + number(value) { + return that.optional(value) || /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value) + }, + /** + * 验证整数 + */ + digits(value) { + return that.optional(value) || /^\d+$/.test(value) + }, + /** + * 验证身份证号码 + */ + idcard(value) { + return that.optional(value) || /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value) + }, + /** + * 验证两个输入框的内容是否相同 + */ + equalTo(value, param) { + return that.optional(value) || value === that.data[param] + }, + /** + * 验证是否包含某个值 + */ + contains(value, param) { + return that.optional(value) || value.indexOf(param) >= 0 + }, + /** + * 验证最小长度 + */ + minlength(value, param) { + return that.optional(value) || value.length >= param + }, + /** + * 验证最大长度 + */ + maxlength(value, param) { + return that.optional(value) || value.length <= param + }, + /** + * 验证一个长度范围[min, max] + */ + rangelength(value, param) { + return that.optional(value) || (value.length >= param[0] && value.length <= param[1]) + }, + /** + * 验证最小值 + */ + min(value, param) { + return that.optional(value) || value >= param + }, + /** + * 验证最大值 + */ + max(value, param) { + return that.optional(value) || value <= param + }, + /** + * 验证一个值范围[min, max] + */ + range(value, param) { + return that.optional(value) || (value >= param[0] && value <= param[1]) + } + } + } + + /** + * 添加自定义验证方法 + * @param {String} name 方法名 + * @param {Function} method 函数体,接收两个参数(value, param),value表示元素的值,param表示参数 + * @param {String} message 提示信息 + */ + addMethod(name, method, message) { + this.methods[name] = method + this.defaults.messages[name] = message !== undefined ? message : this.defaults.messages[name] + } + + /** + * 判断验证方法是否存在 + */ + isValidMethod(value) { + let methods = [] + for(let method in this.methods) { + if(method && typeof this.methods[method] === 'function') { + methods.push(method) + } + } + return methods.indexOf(value) !== -1 + } + + /** + * 格式化提示信息模板 + */ + formatTpl(source, params) { + const that = this + if(arguments.length === 1) { + return function() { + let args = Array.from(arguments) + args.unshift(source) + return that.formatTpl.apply(this, args) + } + } + if(params === undefined) { + return source + } + if(arguments.length > 2 && params.constructor !== Array) { + params = Array.from(arguments).slice(1) + } + if(params.constructor !== Array) { + params = [params] + } + params.forEach(function(n, i) { + source = source.replace(new RegExp("\\{" + i + "\\}", "g"), function() { + return n + }) + }) + return source + } + + /** + * 判断规则依赖是否存在 + */ + depend(param) { + switch(typeof param) { + case 'boolean': + param = param + break + case 'string': + param = !!param.length + break + case 'function': + param = param() + default: + param = !0 + } + return param + } + + /** + * 判断输入值是否为空 + */ + optional(value) { + return !this.methods.required(value) && 'dependency-mismatch' + } + + /** + * 获取自定义字段的提示信息 + * @param {String} param 字段名 + * @param {Object} rule 规则 + */ + customMessage(param, rule) { + const params = this.messages[param] + const isObject = typeof params === 'object' + if(params && isObject) return params[rule.method] + } + + /** + * 获取某个指定字段的提示信息 + * @param {String} param 字段名 + * @param {Object} rule 规则 + */ + defaultMessage(param, rule) { + let message = this.customMessage(param, rule) || this.defaults.messages[rule.method] + let type = typeof message + + if(type === 'undefined') { + message = `Warning: No message defined for ${rule.method}.` + } else if(type === 'function') { + message = message.call(this, rule.parameters) + } + + return message + } + + /** + * 缓存错误信息 + * @param {String} param 字段名 + * @param {Object} rule 规则 + * @param {String} value 元素的值 + */ + formatTplAndAdd(param, rule, value) { + let msg = this.defaultMessage(param, rule) + + this.errorList.push({ + param: param, + msg: msg, + value: value, + }) + } + + /** + * 验证某个指定字段的规则 + * @param {String} param 字段名 + * @param {Object} rules 规则 + * @param {Object} data 需要验证的数据对象 + */ + checkParam(param, rules, data) { + + // 缓存数据对象 + this.data = data + + // 缓存字段对应的值 + const value = data[param] !== null && data[param] !== undefined ? data[param] : '' + + // 遍历某个指定字段的所有规则,依次验证规则,否则缓存错误信息 + for(let method in rules) { + + // 判断验证方法是否存在 + if(this.isValidMethod(method)) { + + // 缓存规则的属性及值 + const rule = { + method: method, + parameters: rules[method] + } + + // 调用验证方法 + const result = this.methods[method](value, rule.parameters) + + // 若result返回值为dependency-mismatch,则说明该字段的值为空或非必填字段 + if(result === 'dependency-mismatch') { + continue + } + + this.setValue(param, method, result, value) + + // 判断是否通过验证,否则缓存错误信息,跳出循环 + if(!result) { + this.formatTplAndAdd(param, rule, value) + break + } + } + } + } + + /** + * 设置字段的默认验证值 + * @param {String} param 字段名 + */ + setView(param) { + this.form[param] = { + $name: param, + $valid: true, + $invalid: false, + $error: {}, + $success: {}, + $viewValue: ``, + } + } + + /** + * 设置字段的验证值 + * @param {String} param 字段名 + * @param {String} method 字段的方法 + * @param {Boolean} result 是否通过验证 + * @param {String} value 字段的值 + */ + setValue(param, method, result, value) { + const params = this.form[param] + params.$valid = result + params.$invalid = !result + params.$error[method] = !result + params.$success[method] = result + params.$viewValue = value + } + + /** + * 验证所有字段的规则,返回验证是否通过 + * @param {Object} data 需要验证数据对象 + */ + checkForm(data) { + this.__initData() + + for(let param in this.rules) { + this.setView(param) + this.checkParam(param, this.rules[param], data) + } + + return this.valid() + } + + /** + * 返回验证是否通过 + */ + valid() { + return this.size() === 0 + } + + /** + * 返回错误信息的个数 + */ + size() { + return this.errorList.length + } + + /** + * 返回所有错误信息 + */ + validationErrors() { + return this.errorList + } +} + +module.exports = WxValidate;