提交 593eeb13 authored 作者: 王鹏飞's avatar 王鹏飞

feat: 新增海报分享

上级 ab40f2af
NODE_ENV=production
VITE_LOGIN_URL=https://login.ezijing.com/auth/login/index VITE_LOGIN_URL=https://login.ezijing.com/auth/login/index
NODE_ENV=development
VITE_LOGIN_URL=https://login.ezijing.com/auth/login/index VITE_LOGIN_URL=https://login.ezijing.com/auth/login/index
\ No newline at end of file
差异被折叠。
...@@ -13,14 +13,17 @@ ...@@ -13,14 +13,17 @@
"deploy": "node ./deploy.js" "deploy": "node ./deploy.js"
}, },
"dependencies": { "dependencies": {
"@vueuse/core": "^8.4.2", "@vueuse/core": "^8.5.0",
"axios": "^0.27.2", "axios": "^0.27.2",
"blueimp-md5": "^2.19.0", "blueimp-md5": "^2.19.0",
"dayjs": "^1.11.2",
"file-saver": "^2.0.5",
"html2canvas": "^1.4.1",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"pinia": "^2.0.14", "pinia": "^2.0.14",
"qs": "^6.10.3", "qs": "^6.10.3",
"sass": "^1.51.0", "sass": "^1.51.0",
"swiper": "^8.1.4", "swiper": "^8.1.5",
"vant": "^3.4.9", "vant": "^3.4.9",
"vue": "^3.2.33", "vue": "^3.2.33",
"vue-infinite-scroll": "^2.0.2", "vue-infinite-scroll": "^2.0.2",
...@@ -29,8 +32,9 @@ ...@@ -29,8 +32,9 @@
"devDependencies": { "devDependencies": {
"@rushstack/eslint-patch": "^1.1.3", "@rushstack/eslint-patch": "^1.1.3",
"@types/blueimp-md5": "^2.18.0", "@types/blueimp-md5": "^2.18.0",
"@types/file-saver": "^2.0.5",
"@types/lodash-es": "^4.17.6", "@types/lodash-es": "^4.17.6",
"@types/node": "^17.0.33", "@types/node": "^17.0.34",
"@types/qs": "^6.9.7", "@types/qs": "^6.9.7",
"@vitejs/plugin-vue": "^2.3.3", "@vitejs/plugin-vue": "^2.3.3",
"@vue/eslint-config-typescript": "^10.0.0", "@vue/eslint-config-typescript": "^10.0.0",
......
...@@ -46,11 +46,7 @@ const hideComment = () => { ...@@ -46,11 +46,7 @@ const hideComment = () => {
// 提交评论 // 提交评论
const onSubmitComment = (data: any) => { const onSubmitComment = (data: any) => {
data.comment = commentActive.value ? commentPlaceholder.value + data.comment : data.comment data.comment = commentActive.value ? commentPlaceholder.value + data.comment : data.comment
emit( emit('submitComment', Object.assign({}, commentActive.value || props.data, data), commentActive.value ? 'reply' : 'comment')
'submitComment',
Object.assign({}, commentActive.value || props.data, data),
commentActive.value ? 'reply' : 'comment'
)
hideComment() hideComment()
} }
</script> </script>
...@@ -81,22 +77,13 @@ const onSubmitComment = (data: any) => { ...@@ -81,22 +77,13 @@ const onSubmitComment = (data: any) => {
<div class="comment-item-hd">{{ item.user_name }}</div> <div class="comment-item-hd">{{ item.user_name }}</div>
<div class="comment-item-bd">{{ item.content }}</div> <div class="comment-item-bd">{{ item.content }}</div>
</div> </div>
<!-- <div class="comment-more" v-if="data.comments.total > data.comments.list.length" @click="viewItem"> <div class="comment-more" v-if="data.comments.total > data.comments.list.length" @click="$emit('load')">查看{{ data.comments.total }}条评论 <van-icon name="arrow" /></div>
查看{{ data.comments.total }}条评论 <van-icon name="arrow" />
</div> -->
</div> </div>
</div> </div>
</div> </div>
<div class="comment" v-if="commentVisible"> <div class="comment" v-if="commentVisible">
<van-form @submit="onSubmitComment"> <van-form @submit="onSubmitComment">
<van-field <van-field v-model="commentValue" name="comment" :placeholder="commentPlaceholder" autosize ref="commentInput" @blur="hideComment" />
v-model="commentValue"
name="comment"
:placeholder="commentPlaceholder"
autosize
ref="commentInput"
@blur="hideComment"
/>
</van-form> </van-form>
</div> </div>
</template> </template>
......
...@@ -11,6 +11,7 @@ import ExamStrategy from '../components/ExamStrategy.vue' ...@@ -11,6 +11,7 @@ import ExamStrategy from '../components/ExamStrategy.vue'
import TeamRanking from '../components/TeamRanking.vue' import TeamRanking from '../components/TeamRanking.vue'
import Questions from '../components/Questions.vue' import Questions from '../components/Questions.vue'
const isDev = import.meta.env.DEV
const data = ref<HomeInfo>({ const data = ref<HomeInfo>({
banner: [], banner: [],
admission_guide_docs: [], admission_guide_docs: [],
...@@ -33,17 +34,17 @@ onMounted(() => { ...@@ -33,17 +34,17 @@ onMounted(() => {
<template> <template>
<Banner :list="data.banner"></Banner> <Banner :list="data.banner"></Banner>
<Menu></Menu> <Menu v-if="isDev"></Menu>
<!-- 入学指南 --> <!-- 入学指南 -->
<AdmissionGuide :docs="data.admission_guide_docs" :videos="data.admission_guide_videos"></AdmissionGuide> <AdmissionGuide :docs="data.admission_guide_docs" :videos="data.admission_guide_videos" v-if="isDev"></AdmissionGuide>
<!-- 学习地图 --> <!-- 学习地图 -->
<LearningMap :docs="data.learning_map_docs"></LearningMap> <LearningMap :docs="data.learning_map_docs"></LearningMap>
<!-- 权益查看 --> <!-- 权益查看 -->
<QueryView></QueryView> <QueryView v-if="isDev"></QueryView>
<!-- 荣誉总榜 --> <!-- 荣誉总榜 -->
<TeamRanking :teams="data.ranking"></TeamRanking> <TeamRanking :teams="data.ranking" v-if="isDev"></TeamRanking>
<!-- 考试攻略 --> <!-- 考试攻略 -->
<ExamStrategy :docs="data.exam_strategy_docs"></ExamStrategy> <ExamStrategy :docs="data.exam_strategy_docs" v-if="isDev"></ExamStrategy>
<!-- 陪伴问答 --> <!-- 陪伴问答 -->
<Questions :data="data.questions"></Questions> <Questions :data="data.questions" v-if="isDev"></Questions>
</template> </template>
import httpRequest from '@/utils/axios'
// 获取分享信息
export function getShare() {
return httpRequest.get('/api/psp/v1/share/index')
}
// 获取二维码
export function getQrcode(params: { url: string }): Promise<{ url: string }> {
return httpRequest.get('https://learn-api.ezijing.com/api/lms/util/pcode', { params, headers: { tenant: 'ciis' } })
}
// 获取二维码
export function imageTransfer(params: { source: string }) {
return httpRequest.get('/api/usercenter/tool/transfer-image', { params })
}
import type { RouteRecordRaw } from 'vue-router'
export const routes: Array<RouteRecordRaw> = [
{
path: '/share',
component: () => import('./views/Index.vue'),
meta: { requireLogin: true }
}
]
/* 用户信息 */
export interface TypeUser {
name: string
avatar: string
time: number
}
/* 背景 */
export interface TypeBackground {
url: string
color: string
}
/* 金句 */
export interface TypeText {
text: string
isCustom?: boolean
}
export interface TypeTextGroup {
id: string
title: string
content: TypeText[]
}
/* tab */
export interface TypeTab {
index: number
text: string
}
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论