From a67f5ffb68241f9e249c888cfe5be660976934f6 Mon Sep 17 00:00:00 2001 From: lynn Date: Mon, 23 Jun 2025 19:54:14 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=A0=A1=E5=8F=8B?= =?UTF-8?q?=E6=9D=83=E7=9B=8A=E5=89=8D=E7=AB=AF=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/chat/chatWindow.vue | 158 +++++++++++++++++++++ packages/chat/index.vue | 123 ++++++++++++++++ packages/library/index.vue | 210 +++++++++++++++++++++++++++ packages/supply/detail.vue | 189 +++++++++++++++++++++++++ packages/supply/index.vue | 261 ++++++++++++++++++++++++++++++++++ packages/supply/publish.vue | 267 +++++++++++++++++++++++++++++++++++ pages.json | 72 +++++++--- pages/book/index.vue | 234 +++++++++++++++++++----------- 8 files changed, 1407 insertions(+), 107 deletions(-) create mode 100644 packages/chat/chatWindow.vue create mode 100644 packages/chat/index.vue create mode 100644 packages/library/index.vue create mode 100644 packages/supply/detail.vue create mode 100644 packages/supply/index.vue create mode 100644 packages/supply/publish.vue diff --git a/packages/chat/chatWindow.vue b/packages/chat/chatWindow.vue new file mode 100644 index 0000000..9cb0b26 --- /dev/null +++ b/packages/chat/chatWindow.vue @@ -0,0 +1,158 @@ + + + + + \ No newline at end of file diff --git a/packages/chat/index.vue b/packages/chat/index.vue new file mode 100644 index 0000000..30962b9 --- /dev/null +++ b/packages/chat/index.vue @@ -0,0 +1,123 @@ + + + + + \ No newline at end of file diff --git a/packages/library/index.vue b/packages/library/index.vue new file mode 100644 index 0000000..855e484 --- /dev/null +++ b/packages/library/index.vue @@ -0,0 +1,210 @@ + + + + + \ No newline at end of file diff --git a/packages/supply/detail.vue b/packages/supply/detail.vue new file mode 100644 index 0000000..56c75a7 --- /dev/null +++ b/packages/supply/detail.vue @@ -0,0 +1,189 @@ + + + + + \ No newline at end of file diff --git a/packages/supply/index.vue b/packages/supply/index.vue new file mode 100644 index 0000000..a1d54c3 --- /dev/null +++ b/packages/supply/index.vue @@ -0,0 +1,261 @@ + + + + + \ No newline at end of file diff --git a/packages/supply/publish.vue b/packages/supply/publish.vue new file mode 100644 index 0000000..4555753 --- /dev/null +++ b/packages/supply/publish.vue @@ -0,0 +1,267 @@ + + + + + \ No newline at end of file diff --git a/pages.json b/pages.json index d440f12..aa64e2e 100644 --- a/pages.json +++ b/pages.json @@ -20,7 +20,7 @@ } }, { "path": "pages/me/index", - "style": { + "style": { "navigationBarTitleText": "我的" } }], @@ -28,105 +28,135 @@ "root": "packages", "pages": [{ "path": "my/index", - "style": { + "style": { "navigationBarTitleText": "个人信息" } },{ "path": "course/detail", - "style": { + "style": { "navigationBarTitleText": "" } },{ "path": "course/freeDetail", - "style": { + "style": { "navigationBarTitleText": "" } },{ "path": "register/index", - "style": { + "style": { "navigationBarTitleText": "注册" } },{ "path": "register/login", - "style": { + "style": { "navigationBarTitleText": "登录", "navigationStyle": "custom" } },{ "path": "apply/index", - "style": { + "style": { "navigationBarTitleText": "在线报名" } },{ "path": "booksubmit/index", - "style": { + "style": { "navigationBarTitleText": "我要预约" } },{ "path": "booksubmit/appointment", - "style": { + "style": { "navigationBarTitleText": "场地预约" } },{ "path": "schoolmate/index", - "style": { + "style": { "navigationBarTitleText": "校友库" } },{ "path": "mycourse/index", - "style": { + "style": { "navigationBarTitleText": "我的课程" } },{ "path": "mycourse/detail", - "style": { + "style": { "navigationBarTitleText": "课程详情" } },{ "path": "mycourse/courseStatus", - "style": { + "style": { "navigationBarTitleText": "报名状态" } },{ "path": "mycourse/coursePay", - "style": { + "style": { "navigationBarTitleText": "报名缴费" } },{ "path": "mycourse/courseContents", - "style": { + "style": { "navigationBarTitleText": "" } },{ "path": "mycourse/courseTxl", - "style": { + "style": { "navigationBarTitleText": "本班通讯录" } },{ "path": "mybook/index", - "style": { + "style": { "navigationBarTitleText": "我的预约" } },{ "path": "mybook/detail", - "style": { + "style": { "navigationBarTitleText": "预约详情" } },{ "path": "donate/index", - "style": { + "style": { "navigationBarTitleText": "校友捐赠" } },{ "path": "webview/index", - "style": { + "style": { "navigationBarTitleText": "苏州科技商学院" } },{ "path": "avatarUpload/index", - "style": { + "style": { "navigationBarTitleText": "更换头像" } + },{ + "path": "library/index", + "style": { + "navigationBarTitleText": "图书馆" + } + },{ + "path": "supply/index", + "style": { + "navigationBarTitleText": "供需发布" + } + },{ + "path": "supply/publish", + "style": { + "navigationBarTitleText": "发布供需" + } + },{ + "path": "supply/detail", + "style": { + "navigationBarTitleText": "供需详情" + } + },{ + "path": "chat/index", + "style": { + "navigationBarTitleText": "校友私信" + } + },{ + "path": "chat/chatWindow", + "style": { + "navigationBarTitleText": "校友私信" + } }] }], "preloadRule": { diff --git a/pages/book/index.vue b/pages/book/index.vue index a69d221..9535cd4 100644 --- a/pages/book/index.vue +++ b/pages/book/index.vue @@ -1,14 +1,37 @@ @@ -22,22 +45,20 @@ data() { return { user: {}, - can_appointment: false, - enter_schoolmate: 0, - door_appointments: false, // 当前是否有预约 + enter_schoolmate: 0 + } + }, + onShareAppMessage() { + return{ + title:"苏州科技商学院", + imageUrl:"/static/share.jpg" + } + }, + onShareTimeline() { + return{ + title:"苏州科技商学院", + imageUrl:"/static/share.jpg" } - }, - onShareAppMessage() { - return{ - title:"苏州科技商学院", - imageUrl:"/static/share.jpg" - } - }, - onShareTimeline() { - return{ - title:"苏州科技商学院", - imageUrl:"/static/share.jpg" - } }, onShow() { this.getUser() @@ -49,48 +70,47 @@ this.$u.api.user().then(res => { console.log("res", res) this.enter_schoolmate = res.enter_schoolmate - if (res.user.appointment_total - res.user.pass_appointments > 0) { - this.can_appointment = true - } else { - this.can_appointment = false - } - // this.door_appointments = res.door_appointments ? true : false this.$u.vuex('vuex_user', res.user) }) }, - async toUrl(type) { - if (type === 1) { - uni.navigateTo({ - url: '/packages/booksubmit/appointment' - }) - // await this.$u.api.user().then(res => { - // if (res.user.appointment_total - res.user.pass_appointments > 0) { - // this.can_appointment = true - // uni.navigateTo({ - // url: '/packages/booksubmit/appointment' - // }) - // } else { - // this.can_appointment = false - // this.base.toast("您当前没有可预约次数") - // } - // }) - } else if (type === 2) { - if (this.enter_schoolmate) { + goToProfile() { + uni.navigateTo({ + url: '/packages/chat/index' + }); + }, + handleButtonClick(type) { + switch (type) { + case 'alumni': + if (this.enter_schoolmate) { + uni.navigateTo({ + url: '/packages/schoolmate/index' + }) + } else { + this.base.toast("您还不是校友,无权查看", 1000, function() { + setTimeout(function() { + uni.switchTab({ + url: '/pages/course/index' + }) + }, 1000) + + }) + } + break; + case 'booking': uni.navigateTo({ - url: '/packages/schoolmate/index' + url: '/packages/booksubmit/appointment' }) - } else { - this.base.toast("您还不是校友,无权查看",1000,function(){ - setTimeout(function(){ - uni.switchTab({ - url: '/pages/course/index' - }) - },1000) - - }) - - } - + break; + case 'supply-demand': + uni.navigateTo({ + url: '/packages/supply/index' + }) + break; + case 'library': + uni.navigateTo({ + url: '/packages/library/index' + }) + break; } } }, @@ -103,6 +123,10 @@ width: 100%; height: 100vh; padding-bottom: 200rpx; + display: flex; + justify-content: center; + align-items: center; + position: relative; .cbg { position: absolute; @@ -110,34 +134,72 @@ left: 0; width: 100%; height: 100vh; - } - .btn{ - width:320rpx; - // height:136rpx; - position: absolute; - image{ - width:100%; - height:100%; - } - view{ - text-align: center; - margin-top:10rpx; - color:#806e5c; - font-size:30rpx; - } - } - .schoolmate{ - - top: 300rpx; - left: 40rpx; - } - .book{ - bottom: 300rpx; - right: 40rpx; - } + z-index: -1; + } + + .profile-icon { + position: absolute; + top: 80rpx; + right: 60rpx; + width: 60rpx; + height: 60rpx; + z-index: 10; + } + + .button-grid { + display: grid; + grid-template-columns: repeat(2, 1fr); + gap: 20rpx; + width: 100%; + padding: 0 40rpx; + box-sizing: border-box; + } + + .grid-item { + position: relative; + width: 100%; + padding-top: 127.8125%; + /* Creates a 320:409 aspect ratio */ + } + + .item-bg { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + } + + .item-content { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: flex-start; + padding: 60rpx 40rpx; + box-sizing: border-box; + } + .icon { + width: 90rpx; + height: 90rpx; + margin-bottom: 60rpx; + } - + .label-1 { + font-size: 34rpx; + font-weight: bold; + color: #4f4a7b; + } + .label-2 { + font-size: 34rpx; + font-weight: bold; + color: #8f6e4d; + } } \ No newline at end of file From be2b86ad2a584a2ef39a7e02850cd9ab5ea869ab Mon Sep 17 00:00:00 2001 From: lynn Date: Tue, 24 Jun 2025 14:50:20 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=AE=8C=E6=88=90=E4=BE=9B=E5=BA=94?= =?UTF-8?q?=E9=9C=80=E6=B1=82API=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/http.api.js | 42 +++++++++++++++++++++++-------------- packages/supply/publish.vue | 26 +++++++++++++++++------ 2 files changed, 46 insertions(+), 22 deletions(-) diff --git a/common/http.api.js b/common/http.api.js index 8a2ada5..20d2e01 100644 --- a/common/http.api.js +++ b/common/http.api.js @@ -19,7 +19,7 @@ let apiApp = { courseUpdateSign: "/api/mobile/course/update-sign", courseContent: '/api/mobile/course/contents', courseUserList: "/api/mobile/course/user-list", - courseGetSign: "/api/mobile/course/get-sign", + courseGetSign: "/api/mobile/course/get-sign", myCourseContent:'/api/mobile/course/my-course-content', // 资讯 courseNews: "/api/mobile/course/news", @@ -27,16 +27,19 @@ let apiApp = { scheduleIndex: '/api/mobile/schedule/index', scheduleSave: '/api/mobile/schedule/save', scheduleDetail: '/api/mobile/schedule/detail', - scheduleCheck: '/api/mobile/schedule/check', - scheduleCancel: '/api/mobile/schedule/cancel', + scheduleCheck: '/api/mobile/schedule/check', + scheduleCancel: '/api/mobile/schedule/cancel', // 其他 otherConfig: '/api/mobile/other/config', otherBanner: '/api/mobile/other/banner', otherUploadFile: '/api/mobile/upload-file', getparameter: '/api/admin/parameter/show', - updateDonates: '/api/mobile/user/update-donates', - uploadFile:'/api/mobile/upload-file' + updateDonates: '/api/mobile/user/update-donates', + uploadFile:'/api/mobile/upload-file', + + // 供应需求 + supplyDemandSave: '/api/mobile/supply-demand/save', } // 此处第二个参数vm,就是我们在页面使用的this,你可以通过vm获取vuex等操作 @@ -60,8 +63,8 @@ const install = (Vue, vm) => { let courseUpdateSign = (params = {}) => vm.$u.post(apiApp.courseUpdateSign, params); let courseContent = (params = {}) => vm.$u.get(apiApp.courseContent, params); let courseUserList = (params = {}) => vm.$u.get(apiApp.courseUserList, params); - let courseGetSign = (params = {}) => vm.$u.get(apiApp.courseGetSign, params); - let myCourseContent = (params = {}) => vm.$u.get(apiApp.myCourseContent, params); + let courseGetSign = (params = {}) => vm.$u.get(apiApp.courseGetSign, params); + let myCourseContent = (params = {}) => vm.$u.get(apiApp.myCourseContent, params); // 资讯 @@ -71,9 +74,9 @@ const install = (Vue, vm) => { let scheduleIndex = (params = {}) => vm.$u.get(apiApp.scheduleIndex, params); let scheduleSave = (params = {}) => vm.$u.post(apiApp.scheduleSave, params); let scheduleDetail = (params = {}) => vm.$u.get(apiApp.scheduleDetail, params); - let scheduleCheck = (params = {}) => vm.$u.get(apiApp.scheduleCheck, params); - let scheduleCancel = (params = {}) => vm.$u.get(apiApp.scheduleCancel, params); - + let scheduleCheck = (params = {}) => vm.$u.get(apiApp.scheduleCheck, params); + let scheduleCancel = (params = {}) => vm.$u.get(apiApp.scheduleCancel, params); + // 其他 @@ -81,9 +84,13 @@ const install = (Vue, vm) => { let otherBanner = (params = {}) => vm.$u.get(apiApp.otherBanner, params); let otherUploadFile = (params = {}) => vm.$u.post(apiApp.otherUploadFile, params); let getparameter = (params = {}) => vm.$u.get(apiApp.getparameter, params); - let updateDonates = (params = {}) => vm.$u.post(apiApp.updateDonates, params); + let updateDonates = (params = {}) => vm.$u.post(apiApp.updateDonates, params); let uploadFile = (params = {}) => vm.$u.post(apiApp.uploadFile, params); + + // 供应需求 + let supplyDemandSave = (params = {}) => vm.$u.post(apiApp.supplyDemandSave, params); + // 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下 vm.$u.api = { // 用户 @@ -105,13 +112,13 @@ const install = (Vue, vm) => { courseUpdateSign, courseContent, courseUserList, - courseGetSign, + courseGetSign, myCourseContent, // 预约 scheduleIndex, scheduleSave, scheduleDetail, - scheduleCheck, + scheduleCheck, scheduleCancel, // 资讯 courseNews, @@ -119,9 +126,12 @@ const install = (Vue, vm) => { otherConfig, otherBanner, otherUploadFile, - getparameter: getparameter, - updateDonates:updateDonates, - uploadFile:uploadFile + getparameter: getparameter, + updateDonates:updateDonates, + uploadFile:uploadFile, + + // 供应需求 + supplyDemandSave, }; } diff --git a/packages/supply/publish.vue b/packages/supply/publish.vue index 4555753..81b9e30 100644 --- a/packages/supply/publish.vue +++ b/packages/supply/publish.vue @@ -117,12 +117,26 @@ this.form.tags.splice(index, 1); }, submit() { - // 提交逻辑 - console.log(this.form) - uni.showToast({ - title: '发布成功', - icon: 'success' - }) + const params = { + title: this.form.title, + type: this.form.type === 'supply' ? 1 : 2, + content: this.form.description, + tag: this.form.tags.join(','), + wechat: this.form.contactType === 'wechat' ? this.form.contactValue : '', + mobile: this.form.contactType === 'phone' ? this.form.contactValue : '', + email: this.form.contactType === 'email' ? this.form.contactValue : '' + }; + this.$u.api.supplyDemandSave(params).then(res => { + uni.showToast({ + title: '发布成功', + icon: 'success', + success: () => { + setTimeout(() => { + uni.navigateBack(); + }, 1200); + } + }); + }); } } } From 61faf51f9f1eb81fa561ea49222ad7476f59d76f Mon Sep 17 00:00:00 2001 From: lynn Date: Tue, 24 Jun 2025 18:10:04 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=AE=8C=E6=88=90=E4=BE=9B=E9=9C=80API?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/http.api.js | 6 ++ packages/supply/detail.vue | 96 +++++++++++++--------- packages/supply/index.vue | 159 +++++++++++++++++++++++++------------ 3 files changed, 173 insertions(+), 88 deletions(-) diff --git a/common/http.api.js b/common/http.api.js index 20d2e01..987bcab 100644 --- a/common/http.api.js +++ b/common/http.api.js @@ -40,6 +40,8 @@ let apiApp = { // 供应需求 supplyDemandSave: '/api/mobile/supply-demand/save', + supplyDemandList: '/api/mobile/supply-demand/index', + supplyDemandDetail: '/api/mobile/supply-demand/detail', } // 此处第二个参数vm,就是我们在页面使用的this,你可以通过vm获取vuex等操作 @@ -90,6 +92,8 @@ const install = (Vue, vm) => { // 供应需求 let supplyDemandSave = (params = {}) => vm.$u.post(apiApp.supplyDemandSave, params); + let supplyDemandList = (params = {}) => vm.$u.get(apiApp.supplyDemandList, params); + let supplyDemandDetail = (params = {}) => vm.$u.get(apiApp.supplyDemandDetail, params); // 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下 vm.$u.api = { @@ -132,6 +136,8 @@ const install = (Vue, vm) => { // 供应需求 supplyDemandSave, + supplyDemandList, + supplyDemandDetail, }; } diff --git a/packages/supply/detail.vue b/packages/supply/detail.vue index 56c75a7..ba4481d 100644 --- a/packages/supply/detail.vue +++ b/packages/supply/detail.vue @@ -1,67 +1,83 @@ + + diff --git a/packages/library/index.vue b/packages/library/index.vue index 855e484..38fa2ff 100644 --- a/packages/library/index.vue +++ b/packages/library/index.vue @@ -1,8 +1,8 @@