From ece975dfbbe49134c2b331033c0971d09d0b210c Mon Sep 17 00:00:00 2001 From: lixg Date: Sat, 4 Mar 2023 21:22:04 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=A2=9E=E5=8A=A0=E9=9D=A2=E6=8E=88?= =?UTF-8?q?=E8=AF=BE=E8=AF=84=E8=AE=BA=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/method.js | 40 +++++++++++++++++ src/api/utils.js | 18 +++++--- src/components/CommentReply.vue | 59 ++++++++++++++++++++----- src/components/PathDetailImage.vue | 59 ++++++++++++++++++++++--- src/store/index.js | 6 +-- src/views/discuss/DiscussDetail.vue | 30 +++++++++++-- src/views/faceteach/FaceTeach.vue | 6 +-- src/views/faceteach/FaceTeachSignUp.vue | 5 ++- src/views/pathmap/PathDetails.vue | 3 +- src/views/pathmap/PathmapPage.vue | 5 ++- 10 files changed, 195 insertions(+), 36 deletions(-) create mode 100644 src/api/method.js diff --git a/src/api/method.js b/src/api/method.js new file mode 100644 index 0000000..5b7580e --- /dev/null +++ b/src/api/method.js @@ -0,0 +1,40 @@ +/* + * @Author: lixg lixg@dongwu-inc.com + * @Date: 2022-12-19 11:35:37 + * @LastEditors: lixg lixg@dongwu-inc.com + * @LastEditTime: 2023-03-04 17:42:01 + * @FilePath: /fe-stu/src/views/project/method.js + * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + */ +// 修改时间格式---------start----------------------------- +function formatNumber(n) { + n = n.toString(); + return n[1] ? n : "0" + n; +} + +function toDate(number, format) { + var formateArr = ["Y", "M", "D", "h", "m", "s"]; + var returnArr = []; + + if (number === 0) { + return 0; + } else { + var date = new Date(number * 1000); + } + returnArr.push(date.getFullYear()); + returnArr.push(formatNumber(date.getMonth() + 1)); + returnArr.push(formatNumber(date.getDate())); + + returnArr.push(formatNumber(date.getHours())); + returnArr.push(formatNumber(date.getMinutes())); + returnArr.push(formatNumber(date.getSeconds())); + + for (var i in returnArr) { + format = format.replace(formateArr[i], returnArr[i]); + } + return format; +} +// 修改时间格式---------end----------------------------- +export { + toDate +} \ No newline at end of file diff --git a/src/api/utils.js b/src/api/utils.js index 90b37f6..e4818cd 100644 --- a/src/api/utils.js +++ b/src/api/utils.js @@ -1,6 +1,14 @@ -import {watch, ref} from "vue"; -import {boeRequest} from "@/api/request"; -import {GET_USER_LIST} from "@/api/ThirdApi"; +/* + * @Author: lixg lixg@dongwu-inc.com + * @Date: 2023-01-17 19:47:07 + * @LastEditors: lixg lixg@dongwu-inc.com + * @LastEditTime: 2023-03-04 13:22:53 + * @FilePath: /stu_h5/src/api/utils.js + * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + */ +import { watch, ref } from "vue"; +import { boeRequest } from "@/api/request"; +import { GET_USER_LIST } from "@/api/ThirdApi"; export function useImage(src) { return new URL(`../assets/image/${src}`, import.meta.url).href @@ -19,9 +27,9 @@ export function getCookie(name) { export function useUserInfo(id) { const userInfo = ref({}) watch(id, () => { - id.value && boeRequest(GET_USER_LIST, {id: id.value}).then(res => { + id.value && boeRequest(GET_USER_LIST, { id: id.value }).then(res => { userInfo.value = res.result.userInfoList[0] - userInfo.value.avatar = userInfo.value.avatar?userInfo.value.avatar:'/800e23f7-b58c-4192-820d-0c6a2b7544cc.png' + userInfo.value.avatar = userInfo.value.avatar ? userInfo.value.avatar.includes(import.meta.env.VITE_FILE_PATH) ? userInfo.value.avatar : (import.meta.env.VITE_FILE_PATH + userInfo.value.avatar) : '/800e23f7-b58c-4192-820d-0c6a2b7544cc.png' }) }) return userInfo diff --git a/src/components/CommentReply.vue b/src/components/CommentReply.vue index 62be5e3..e15fe9d 100644 --- a/src/components/CommentReply.vue +++ b/src/components/CommentReply.vue @@ -86,8 +86,10 @@
-
取消
-
发布
+ +
@@ -247,7 +249,7 @@