From 1693c2db1d1f923a091caae159d2f78b0c3e5711 Mon Sep 17 00:00:00 2001 From: yuping <82253452@qq.com> Date: Sun, 11 Dec 2022 23:56:13 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=20=E7=AC=AC=E4=B8=80=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/api.js | 1 + src/api/request.js | 25 ++++++------ src/api/utils.js | 12 +++++- src/views/discuss/DiscussPage.vue | 45 +++++++++++----------- src/views/login/login.vue | 64 +++++++++++++++++++++++++++++++ 5 files changed, 111 insertions(+), 36 deletions(-) create mode 100644 src/views/login/login.vue diff --git a/src/api/api.js b/src/api/api.js index 3359976..fd80dfc 100644 --- a/src/api/api.js +++ b/src/api/api.js @@ -7,6 +7,7 @@ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ export const BASE = 'http://111.231.196.214:30001/manageApi' +export const LOGIN = '/admin/CheckUser/userLogin post' // export const FILE_UPLOAD = 'http://111.231.196.214:30001/file/upload' export const FILE_UPLOAD = '/file/upload' export const COMMON_TOKEN = 'https://upload-z2.qiniup.com' diff --git a/src/api/request.js b/src/api/request.js index 79e8f87..689d18b 100644 --- a/src/api/request.js +++ b/src/api/request.js @@ -1,5 +1,5 @@ import router from "@/router"; -import { ref, watch } from "vue"; +import {ref, watch} from "vue"; import axios from 'axios'; export function useRequest(_url, params = {}) { @@ -30,7 +30,7 @@ export function useRequest(_url, params = {}) { export async function request(_url, params) { const s = _url.split(' ') let url = s[0] - const method = s[1] || 'get' + const method = s[1]?.toLowerCase() || 'get' if (method === 'get') { let paramsArray = []; //拼接参数 @@ -49,22 +49,23 @@ export async function request(_url, params) { method, headers: { 'X-Token': localStorage.getItem('token'), - ...method !== 'get' ? { 'Content-Type': 'application/json' } : {} + ...method !== 'get' ? {'Content-Type': 'application/json'} : {} }, baseURL: '', - ...method !== 'get' ? { data: JSON.stringify(body) } : {} + ...method !== 'get' ? {data: JSON.stringify(body)} : {} }).then(resp => resp.data).then(response => { if (response.code !== 200 && response.code !== 0) { - if (response.code === 3 || response.code === 4 || response.code === 100) { - // router.push({path: '/login'}) - return + console.log(1111111111) + console.log(response.code) + if (import.meta.env.DEV && response.code === 1000) { + router.push({path: '/login'}) } else { - // response.showMsg && notification.open({ - // message: response.showMsg, - // duration: 2, - // }); - return + // response.showMsg && notification.open({ + // message: response.showMsg, + // duration: 2, + // }); } + throw new Error('接口异常') } return response }).catch(e => { diff --git a/src/api/utils.js b/src/api/utils.js index b749636..bf71f6e 100644 --- a/src/api/utils.js +++ b/src/api/utils.js @@ -1,3 +1,13 @@ -export function useImage(src){ +export function useImage(src) { return new URL(`../assets/image/${src}`, import.meta.url).href +} + +export function setCookie(name, value, perpetual) { + const d = new Date() + d.setDate(perpetual * 24 * 60 * 60 * 1000) + document.cookie = `${name}=${value};expires=${d.toGMTString()};path=/` +} + +export function getCookie(name) { + return document.cookie?.split(";").find(e => e.includes(name)).replace(`${name}=`, '') || '' } \ No newline at end of file diff --git a/src/views/discuss/DiscussPage.vue b/src/views/discuss/DiscussPage.vue index fcbfd6c..3fdd151 100644 --- a/src/views/discuss/DiscussPage.vue +++ b/src/views/discuss/DiscussPage.vue @@ -63,18 +63,18 @@ {{ d.discussExplain }}
-
+
-
{{ d.discussReviewCount }}
+
{{ d.commentNum || 0 }}
-
- -
{{ d.discussLikeCount }}
+
+ +
{{ d.praiseNum || 0 }}
-
+
-
{{ d.discussCollectionCount }}
+ :style="{color:d.collected?'red':'#b3bdc4',marginLeft: '19px'}"> +
{{ d.collectionNum || 0 }}
@@ -87,7 +87,11 @@ diff --git a/src/views/login/login.vue b/src/views/login/login.vue new file mode 100644 index 0000000..6fd8bcd --- /dev/null +++ b/src/views/login/login.vue @@ -0,0 +1,64 @@ + + From ea0d1f6fa670a03eb5e94579b6480289b2fee071 Mon Sep 17 00:00:00 2001 From: yuping <82253452@qq.com> Date: Mon, 12 Dec 2022 12:29:04 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E8=AE=A8=E8=AE=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/api.js | 2 +- src/api/request.js | 52 +++++-- src/views/discuss/DiscussPage.vue | 19 +-- src/views/discussdetail/DiscussDetail.vue | 168 ++++++++++------------ 4 files changed, 130 insertions(+), 111 deletions(-) diff --git a/src/api/api.js b/src/api/api.js index e5ffb5a..9358e99 100644 --- a/src/api/api.js +++ b/src/api/api.js @@ -34,7 +34,7 @@ export const EXAMINATION_QUERYEXAMINATIONDETAILBYID = '/examination/queryExamina export const DISCUSS_COLLECTION = '/discussSubmit/clickDiscussCollectionCountOr post' export const DISCUSS_LIKE = '/discussSubmit/clickDiscussLikeCountOr post' export const DISCUSS_LIST = '/discussSubmit/list' -export const DISCUSS_DETAIL = '/discuss/getDiscussDetail' +export const DISCUSS_DETAIL = '/discussSubmit/detail' export const DISCUSS_SUBMIT_REVIEW_LIST = '/discussSubmit/queryDiscussSubmitAndReview' export const COMMENT_LIST = '/comment/list' diff --git a/src/api/request.js b/src/api/request.js index 689d18b..bfe5eb0 100644 --- a/src/api/request.js +++ b/src/api/request.js @@ -1,28 +1,64 @@ import router from "@/router"; -import {ref, watch} from "vue"; +import {reactive, ref, toRefs, watch} from "vue"; import axios from 'axios'; +export function usePage(_url, param) { + + const state = reactive({ + data: {}, + loading: false, + total: 0, + size: 10, + current: 1, + params: {pageNo: 1, pageSize: 10, ...param} + }) + + watch(param, () => { + state.params = {...state.params, ...param} + fetchData() + }) + + function fetchData() { + state.loading = true + request(_url, state.params).then(r => { + state.params.pageNo === 1 ? (state.data = r.data.records) : (state.data = [...state.data, ...r.data.records]) + state.size = r.data.size + state.total = r.data.total + state.current = r.data.current + state.loading = false + }) + } + + fetchData() + return { + ...toRefs(state), + fetchData, + }; +} + export function useRequest(_url, params = {}) { - const data = ref({}) - const loading = ref(false) + const state = reactive({ + data: {}, + loading: false, + + }) watch(params, () => { fetchData() }) function fetchData() { - loading.value = true + state.loading = true request(_url, params).then(r => { - data.value = r.data - loading.value = false + state.data = r.data + state.loading = false }) } fetchData() return { - data, - loading, + ...toRefs(state), fetchData, }; } diff --git a/src/views/discuss/DiscussPage.vue b/src/views/discuss/DiscussPage.vue index 3fdd151..68bcbd9 100644 --- a/src/views/discuss/DiscussPage.vue +++ b/src/views/discuss/DiscussPage.vue @@ -39,21 +39,18 @@
{{ projectInfo.name }}
- - +
{{ item.name }}
-
进行中
- - - +
@@ -115,13 +112,13 @@ function comment({discussId: id}) { function like(d) { d.praised ? (d.praiseNum -= 1) : (d.praiseNum += 1) d.praised = !d.praised - request(COMMENT_PRAISE, {targetId: d.discussId, type: 5}) + request(COMMENT_PRAISE, {targetId: d.discussId, type: 3}) } function collection(d) { d.collected ? (d.collectionNum -= 1) : (d.collectionNum += 1) d.collected = !d.collected - request(COMMENT_COLLECTION, {targetId: d.discussId, type: 6}) + request(COMMENT_COLLECTION, {targetId: d.discussId, type: 4}) } @@ -174,9 +171,7 @@ function collection(d) { background: #ffffff; border-radius: 8px; margin-top: 24px; - // display: flex; - // flex-direction: column; - // align-items: center; + display: block; .middletitle { display: flex; margin-top: 64px; @@ -216,7 +211,7 @@ function collection(d) { .line { display: flex; margin: 47px 45px 0 75px; - max-width: 1810px; + //max-width: 1810px; // height: 50px; background: #f9f9f9; position: relative; diff --git a/src/views/discussdetail/DiscussDetail.vue b/src/views/discussdetail/DiscussDetail.vue index 31a25d2..f06f442 100644 --- a/src/views/discussdetail/DiscussDetail.vue +++ b/src/views/discussdetail/DiscussDetail.vue @@ -37,37 +37,36 @@
- {{ disDetail.discussName }} + {{ disDetail.projectName }}
-
-
{{ disDetail.discussExplain }}
+
{{ disDetail.stageName }}
-
进行中
-
{{ data.discussSubmitTitle }}
-
{{ disDetail.discussName }}
+
- -
{{ data.discussLikeCount }}
+ +
{{ disDetail.praiseNum || 0 }}
-
-
{{ data.discussCollectionCount }}
+ :style="{color: disDetail.collected?'red':'#b3bdc4',marginLeft: '19px'}"> +
{{ disDetail.collectionNum || 0 }}
- {{ data.discussSubmitTitle }} + {{ disDetail.discussExplain }}
@@ -75,15 +74,14 @@
-
{{ textarealength }}/100
+
{{ disComment.content.length }}/100
@@ -105,62 +103,61 @@
-
+
-
{{ row.stuName }}
- +
{{ row.userName }}
(显示事业)
理性思考,崇尚科学
- {{ row.discussReviewContent }} + {{ row.content }}
- -
{{ row.createTime }}
+
{{ row.ctime }}
- -
{{ row.discussLikeCount }}
+ +
- -
{{ row.discussLikeCount }}
+ +
{{ row.praiseNum || 0 }}
-
+
-
{{ replay.stuName }}
+
{{ replay.userName }}
回复
-
{{ row.stuName }}
-
{{ replay.createTime }}
+
{{ row.userName }}
+
{{ replay.ctime }}
- {{ replay.replyContent }} + {{ replay.content }}
-
{{ replay.discussLikeCount }}
+
- -
{{ replay.discussLikeCount }}
+ +
{{ replay.praiseNum || 0 }}
@@ -171,15 +168,14 @@
-
{{ textarealength2 }}/100
+
{{ replayComment.content.length }}/100
@@ -194,8 +190,7 @@
上传图片
- - +
@@ -209,51 +204,33 @@ @@ -378,7 +367,6 @@ function submitComment() { .line { display: flex; margin: 47px 45px 0 75px; - max-width: 1810px; height: 50px; background: #f9f9f9; position: relative; From 0a7360606fdd9eb1a8ca6737f0411976456077f1 Mon Sep 17 00:00:00 2001 From: yuping <82253452@qq.com> Date: Mon, 12 Dec 2022 12:57:46 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E8=AE=A8=E8=AE=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/discussdetail/DiscussDetail.vue | 49 ++++++++++++++++++----- 1 file changed, 40 insertions(+), 9 deletions(-) diff --git a/src/views/discussdetail/DiscussDetail.vue b/src/views/discussdetail/DiscussDetail.vue index f06f442..8996358 100644 --- a/src/views/discussdetail/DiscussDetail.vue +++ b/src/views/discussdetail/DiscussDetail.vue @@ -89,16 +89,18 @@
- - - - +
+
+ + + +
- +
@@ -529,6 +531,35 @@ function submitReplayComment() { .uploadAnd { margin-top: 21px; + .btwwo{ + cursor: pointer; + + .image { + padding-top: 8px; + width: 18px; + height: 17px; + // margin-top: 10px; + margin-left: -60px; + } + + .shangchuan { + position: absolute; + right: 20px; + top: 7px; + display: inline-block; + margin-left: 10px; + font-size: 14px; + font-weight: 500; + color: #2478ff; + line-height: 24px; + } + + width: 126px; + height: 36px; + border: none; + background-color: #fff; + } + .btnone { cursor: pointer; position: absolute; @@ -578,7 +609,7 @@ function submitReplayComment() { } .thinline { - margin-top: 26px; + margin-top: 66px; // width: 1635px; border-top: 1px solid #878b92; margin-left: -50px; From 0b848318eddfd8e02617fe647f13fd71d4291bd8 Mon Sep 17 00:00:00 2001 From: yuping <82253452@qq.com> Date: Mon, 12 Dec 2022 13:17:02 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E8=AE=A8=E8=AE=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/api.js | 4 ++-- src/views/moreActive/MoreActive.vue | 29 +++++++++-------------------- 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/src/api/api.js b/src/api/api.js index 9358e99..a44d761 100644 --- a/src/api/api.js +++ b/src/api/api.js @@ -15,8 +15,8 @@ export const ROUTER_CHAPTER_LIST = '/stu/router/chapterList' export const ROUTER_LIST = '/stu/router/list post' export const ROUTER_PROCESS = '/stu/router/process' export const ROUTER_UNCOMPLETE_LIST = '/stu/router/unCompleteTaskList' -export const TAS_ACTIVITY_DETAIL = '/stu/task/activity/detail' -export const TASK_ACTIVITY_SIGN = '/stu/task/activity/sign' +export const TAS_ACTIVITY_DETAIL = '/activity' +export const TASK_ACTIVITY_SIGN = '/activitySubmit/updateActivitySignInStatus post' export const TASK_BROADCAST_COMMIT = '/stu/task/broadcast/commit' export const TASK_BROADCAST_DETAIL = '/stu/task/broadcast/detail' export const TASK_BROADCAST_SIGN = '/stu/task/broadcast/sign' diff --git a/src/views/moreActive/MoreActive.vue b/src/views/moreActive/MoreActive.vue index 9387653..968cc95 100644 --- a/src/views/moreActive/MoreActive.vue +++ b/src/views/moreActive/MoreActive.vue @@ -21,10 +21,10 @@
-
{{ data.detail?.workName }}
+
{{ data?.activityName }}
-
{{ data.detail?.createTime }}
+
{{ data?.createTime }}
-
{{ data.detail?.workEnclosureAddress }}
+
{{ data?.activityAddress }}
-
签到
+
签到
@@ -54,7 +54,7 @@
-
+
@@ -70,17 +70,7 @@
- 为拓宽人民群众的表达途径、畅听民意,及时了解 - 和解决人民群众反映强烈的公共法律服务问题,我 - 局将在浈江区公共法律服务中心开展领导干部接待 - 活动,现将2022年8月的活动安排公告如下:
- 一、接待时间
- 工作日上午9:00-12:00。
- 二、接待地点
- 浈江区公共法律服务中心(浈江区新韶镇乐土路3号 - 曲仁田螺冲党群服务中心一楼)。
- 三、接待受理范围
(一)听取人民群众对公共法律服务工作的批评和 - 意见建议。
(二)解答或接收公共法律服务相关业务咨询。
+ {{ data.activityNotice }}
@@ -93,12 +83,11 @@ import {TAS_ACTIVITY_DETAIL, TASK_ACTIVITY_SIGN} from "@/api/api"; import {request, useRequest} from "@/api/request"; -const {data} = useRequest(TAS_ACTIVITY_DETAIL, {}) +const {data} = useRequest(TAS_ACTIVITY_DETAIL, {activityId: 22}) const signClick = (tab, event) => { - request(TASK_ACTIVITY_SIGN, {}).then(res => { - console.log(22) - data.value.signFlag = 1 + request(TASK_ACTIVITY_SIGN, {activitySubmitId:data.activityId,signInStatus:1}).then(res => { + data.value.activityFlag = 1 }) }; From 17b0a38a7b47e229a16490ff46812deb0eb90471 Mon Sep 17 00:00:00 2001 From: yuping <82253452@qq.com> Date: Mon, 12 Dec 2022 13:29:58 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E7=9B=B4=E6=92=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/api.js | 2 +- src/views/liveBroadcast/LiveBroadcast.vue | 18 ++++++------------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/api/api.js b/src/api/api.js index a44d761..103054a 100644 --- a/src/api/api.js +++ b/src/api/api.js @@ -18,7 +18,7 @@ export const ROUTER_UNCOMPLETE_LIST = '/stu/router/unCompleteTaskList' export const TAS_ACTIVITY_DETAIL = '/activity' export const TASK_ACTIVITY_SIGN = '/activitySubmit/updateActivitySignInStatus post' export const TASK_BROADCAST_COMMIT = '/stu/task/broadcast/commit' -export const TASK_BROADCAST_DETAIL = '/stu/task/broadcast/detail' +export const TASK_BROADCAST_DETAIL = '/liveBroadcast' export const TASK_BROADCAST_SIGN = '/stu/task/broadcast/sign' export const TASK_VOTE_COMMIT = '/stu/task/vote/commit' export const TASK_VOTE_DETAIL = '/stu/task/vote/detail' diff --git a/src/views/liveBroadcast/LiveBroadcast.vue b/src/views/liveBroadcast/LiveBroadcast.vue index a6231fe..2fe47fc 100644 --- a/src/views/liveBroadcast/LiveBroadcast.vue +++ b/src/views/liveBroadcast/LiveBroadcast.vue @@ -20,10 +20,10 @@
-
【直播】{{ data.detail?.liveName }}
+
【直播】{{ data?.liveName }}
-
{{ data.detail?.liveStartTime }}
+
{{ data?.liveStartTime }}
直播公告
-
+
@@ -128,9 +128,9 @@
- {{ el.name }} + {{ data.userInfoBo.userName }}
-
{{ el.introduce }}
+
{{ data.userInfoBo.bandDesc }}
@@ -148,7 +148,7 @@ import {request, useRequest} from "@/api/request"; import {TASK_BROADCAST_COMMIT, TASK_BROADCAST_DETAIL, TASK_BROADCAST_SIGN} from "@/api/api"; -const {data} = useRequest(TASK_BROADCAST_DETAIL, {}) +const {data} = useRequest(TASK_BROADCAST_DETAIL, {liveId:352}) const state = reactive({ activeName: "first", teacher: [ @@ -159,12 +159,6 @@ const state = reactive({ "教师是学生的镜子,学生是老师的影子。教师是学生的镜子,学生是老师的影子。教师是学生的镜子,学生是老师的影子。", peopleimg: img, }, - { - id: 2, - name: "王星天(显示事业)", - introduce: "教师是学生的镜子,学生是老师的影子。", - peopleimg: img, - }, ], }); const {activeName, teacher} = toRefs(state)