提交 517bb1be authored 作者: haodaking's avatar haodaking

chore: update

上级 c57bedee
...@@ -38,6 +38,8 @@ ...@@ -38,6 +38,8 @@
"ignorableWatch": true, "ignorableWatch": true,
"inject": true, "inject": true,
"isDefined": true, "isDefined": true,
"isProxy": true,
"isReactive": true,
"isReadonly": true, "isReadonly": true,
"isRef": true, "isRef": true,
"logicAnd": true, "logicAnd": true,
...@@ -235,6 +237,8 @@ ...@@ -235,6 +237,8 @@
"watchIgnorable": true, "watchIgnorable": true,
"watchOnce": true, "watchOnce": true,
"watchPausable": true, "watchPausable": true,
"watchPostEffect": true,
"watchSyncEffect": true,
"watchThrottled": true, "watchThrottled": true,
"watchWithFilter": true, "watchWithFilter": true,
"whenever": true "whenever": true
......
...@@ -39,6 +39,8 @@ declare global { ...@@ -39,6 +39,8 @@ declare global {
const ignorableWatch: typeof import('@vueuse/core')['ignorableWatch'] const ignorableWatch: typeof import('@vueuse/core')['ignorableWatch']
const inject: typeof import('vue')['inject'] const inject: typeof import('vue')['inject']
const isDefined: typeof import('@vueuse/core')['isDefined'] const isDefined: typeof import('@vueuse/core')['isDefined']
const isProxy: typeof import('vue')['isProxy']
const isReactive: typeof import('vue')['isReactive']
const isReadonly: typeof import('vue')['isReadonly'] const isReadonly: typeof import('vue')['isReadonly']
const isRef: typeof import('vue')['isRef'] const isRef: typeof import('vue')['isRef']
const logicAnd: typeof import('@vueuse/core')['logicAnd'] const logicAnd: typeof import('@vueuse/core')['logicAnd']
...@@ -236,6 +238,8 @@ declare global { ...@@ -236,6 +238,8 @@ declare global {
const watchIgnorable: typeof import('@vueuse/core')['watchIgnorable'] const watchIgnorable: typeof import('@vueuse/core')['watchIgnorable']
const watchOnce: typeof import('@vueuse/core')['watchOnce'] const watchOnce: typeof import('@vueuse/core')['watchOnce']
const watchPausable: typeof import('@vueuse/core')['watchPausable'] const watchPausable: typeof import('@vueuse/core')['watchPausable']
const watchPostEffect: typeof import('vue')['watchPostEffect']
const watchSyncEffect: typeof import('vue')['watchSyncEffect']
const watchThrottled: typeof import('@vueuse/core')['watchThrottled'] const watchThrottled: typeof import('@vueuse/core')['watchThrottled']
const watchWithFilter: typeof import('@vueuse/core')['watchWithFilter'] const watchWithFilter: typeof import('@vueuse/core')['watchWithFilter']
const whenever: typeof import('@vueuse/core')['whenever'] const whenever: typeof import('@vueuse/core')['whenever']
......
...@@ -39,10 +39,10 @@ ...@@ -39,10 +39,10 @@
"eslint-plugin-vue": "^8.7.1", "eslint-plugin-vue": "^8.7.1",
"sass": "^1.52.1", "sass": "^1.52.1",
"typescript": "~4.6.4", "typescript": "~4.6.4",
"unplugin-auto-import": "^0.8.5", "unplugin-auto-import": "^0.8.6",
"vite": "^2.9.9", "vite": "^2.9.9",
"vite-plugin-checker": "^0.4.6", "vite-plugin-checker": "^0.4.6",
"vue-tsc": "^0.34.16" "vue-tsc": "^0.35.0"
} }
}, },
"node_modules/@antfu/utils": { "node_modules/@antfu/utils": {
...@@ -496,44 +496,44 @@ ...@@ -496,44 +496,44 @@
} }
}, },
"node_modules/@volar/code-gen": { "node_modules/@volar/code-gen": {
"version": "0.34.16", "version": "0.35.0",
"resolved": "https://registry.npmjs.org/@volar/code-gen/-/code-gen-0.34.16.tgz", "resolved": "https://registry.npmjs.org/@volar/code-gen/-/code-gen-0.35.0.tgz",
"integrity": "sha512-ep5us1iF66WlwzCFjTHMIdULIHzu6661228NknkSBGEAh878GPO+AgUqyQn9tY+al0KrsLuDRQVt6pwmeLoqwQ==", "integrity": "sha512-MUKPjE6VL97R2Dg3MwUexjKsdHRhX2cEQUWDtl7Zgn7fe60mULQOHcZZ+IU49eTgyOjAj0Z2hm7hub/nBxduxw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@volar/source-map": "0.34.16" "@volar/source-map": "0.35.0"
} }
}, },
"node_modules/@volar/source-map": { "node_modules/@volar/source-map": {
"version": "0.34.16", "version": "0.35.0",
"resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-0.34.16.tgz", "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-0.35.0.tgz",
"integrity": "sha512-50F1XWcVRzKVXqwO7J39hZ4qd/htzHj62dsywz7FfhZZSOaQ43XT3uEy7cBAVgw7gs+qChFaUJAhM1iHb0FyOQ==", "integrity": "sha512-VvVyCW8SEQ297zoeZNi4HOSLU8H7/xbGg4WpcpVOy080y/MXTxjIZshSlMHx45EB91U2vk0gbgd2R/d9uyY+3A==",
"dev": true "dev": true
}, },
"node_modules/@volar/vue-code-gen": { "node_modules/@volar/vue-code-gen": {
"version": "0.34.16", "version": "0.35.0",
"resolved": "https://registry.npmjs.org/@volar/vue-code-gen/-/vue-code-gen-0.34.16.tgz", "resolved": "https://registry.npmjs.org/@volar/vue-code-gen/-/vue-code-gen-0.35.0.tgz",
"integrity": "sha512-R8OGn26pCQsctXLa6mZi3BIkyXemcrhibTRGrVh1z2TqWMtnCIT/NiAYXR7kAH4UzFEpglOJAIxrjwnodJ7x6w==", "integrity": "sha512-IqIkzs3eRlJjABVXXBf5ik4/a8lQ3wqKemWMR33+KzOmj5xtXS+lgMMLNXJpj0Mw2nOLVl0I2KuIaTHFy485DQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@volar/code-gen": "0.34.16", "@volar/code-gen": "0.35.0",
"@volar/source-map": "0.34.16", "@volar/source-map": "0.35.0",
"@vue/compiler-core": "^3.2.31", "@vue/compiler-core": "^3.2.36",
"@vue/compiler-dom": "^3.2.31", "@vue/compiler-dom": "^3.2.36",
"@vue/shared": "^3.2.31" "@vue/shared": "^3.2.36"
} }
}, },
"node_modules/@volar/vue-typescript": { "node_modules/@volar/vue-typescript": {
"version": "0.34.16", "version": "0.35.0",
"resolved": "https://registry.npmjs.org/@volar/vue-typescript/-/vue-typescript-0.34.16.tgz", "resolved": "https://registry.npmjs.org/@volar/vue-typescript/-/vue-typescript-0.35.0.tgz",
"integrity": "sha512-Jmo19pKRJAIhbAmr/1974knqKws9FZlnYWuCDvvg9wimKHTFosjDhDysORIMVHZ97og/0idK70iIKbcsyDadvw==", "integrity": "sha512-Ojn98P888wWbk1qeR5f6spgtJZMwUos+OkJfZpzyafN5S21LxF58o7DhhNG8rMm1zMNUQHb+evlp5AXI5zHOmA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@volar/code-gen": "0.34.16", "@volar/code-gen": "0.35.0",
"@volar/source-map": "0.34.16", "@volar/source-map": "0.35.0",
"@volar/vue-code-gen": "0.34.16", "@volar/vue-code-gen": "0.35.0",
"@vue/compiler-sfc": "^3.2.31", "@vue/compiler-sfc": "^3.2.36",
"@vue/reactivity": "^3.2.31" "@vue/reactivity": "^3.2.36"
} }
}, },
"node_modules/@vue/compiler-core": { "node_modules/@vue/compiler-core": {
...@@ -3864,9 +3864,9 @@ ...@@ -3864,9 +3864,9 @@
} }
}, },
"node_modules/unimport": { "node_modules/unimport": {
"version": "0.2.4", "version": "0.2.5",
"resolved": "https://registry.npmjs.org/unimport/-/unimport-0.2.4.tgz", "resolved": "https://registry.npmjs.org/unimport/-/unimport-0.2.5.tgz",
"integrity": "sha512-7OEUIlZMS1s1h1uFAGkCPylMtE8hnlJ/cFurJQHdzKAqIyuGiOREFKaCLbkNtFloZicCpRAlqC0Ny2yMoz6mFg==", "integrity": "sha512-1YreHVa6vUtRANhtKROtniBY01PXM0ol857tlI3HaQHNLcuQKqWUCAfvZC/GipotKrMVm4LV9ZQ4u1s9lrrDpg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@rollup/pluginutils": "^4.2.1", "@rollup/pluginutils": "^4.2.1",
...@@ -3942,16 +3942,16 @@ ...@@ -3942,16 +3942,16 @@
} }
}, },
"node_modules/unplugin-auto-import": { "node_modules/unplugin-auto-import": {
"version": "0.8.5", "version": "0.8.6",
"resolved": "https://registry.npmjs.org/unplugin-auto-import/-/unplugin-auto-import-0.8.5.tgz", "resolved": "https://registry.npmjs.org/unplugin-auto-import/-/unplugin-auto-import-0.8.6.tgz",
"integrity": "sha512-JT43zA89fMjxtdqz+sTSkTsL9J0PNdnGmMOvcwbkpDi45yL5SU0aDCZgj0E8+qWLyQSIvvBaDBW3VuBrcc2MXg==", "integrity": "sha512-QRYwCmSzxZKHu8LQhUpTzF6t1YxYuo4b47e3cmE1kWsF4SQDO22Ysrj5/2BRY3jbYbiTZqOLopymRpov8SAYZQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@antfu/utils": "^0.5.2", "@antfu/utils": "^0.5.2",
"@rollup/pluginutils": "^4.2.1", "@rollup/pluginutils": "^4.2.1",
"local-pkg": "^0.4.1", "local-pkg": "^0.4.1",
"magic-string": "^0.26.2", "magic-string": "^0.26.2",
"unimport": "^0.2.4", "unimport": "^0.2.5",
"unplugin": "^0.6.3" "unplugin": "^0.6.3"
}, },
"engines": { "engines": {
...@@ -4361,12 +4361,12 @@ ...@@ -4361,12 +4361,12 @@
} }
}, },
"node_modules/vue-tsc": { "node_modules/vue-tsc": {
"version": "0.34.16", "version": "0.35.0",
"resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-0.34.16.tgz", "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-0.35.0.tgz",
"integrity": "sha512-9tYBQIOyl3Tz8ZrlYUKtftu5m/wXHfxCalyjR22QzSaUJoBJmZeNOoVs/QEllc0z4ideEZxvvU+pBFdoY3O16A==", "integrity": "sha512-RcL7PM3M1nSaVQU84mRPOXk1t/mAZ25QCx4L0rNQzozJYhz1wSVQWYqq9UfhE2lW8nMAQzQtLZgvjaPR4Q29ZA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@volar/vue-typescript": "0.34.16" "@volar/vue-typescript": "0.35.0"
}, },
"bin": { "bin": {
"vue-tsc": "bin/vue-tsc.js" "vue-tsc": "bin/vue-tsc.js"
...@@ -4798,44 +4798,44 @@ ...@@ -4798,44 +4798,44 @@
"requires": {} "requires": {}
}, },
"@volar/code-gen": { "@volar/code-gen": {
"version": "0.34.16", "version": "0.35.0",
"resolved": "https://registry.npmjs.org/@volar/code-gen/-/code-gen-0.34.16.tgz", "resolved": "https://registry.npmjs.org/@volar/code-gen/-/code-gen-0.35.0.tgz",
"integrity": "sha512-ep5us1iF66WlwzCFjTHMIdULIHzu6661228NknkSBGEAh878GPO+AgUqyQn9tY+al0KrsLuDRQVt6pwmeLoqwQ==", "integrity": "sha512-MUKPjE6VL97R2Dg3MwUexjKsdHRhX2cEQUWDtl7Zgn7fe60mULQOHcZZ+IU49eTgyOjAj0Z2hm7hub/nBxduxw==",
"dev": true, "dev": true,
"requires": { "requires": {
"@volar/source-map": "0.34.16" "@volar/source-map": "0.35.0"
} }
}, },
"@volar/source-map": { "@volar/source-map": {
"version": "0.34.16", "version": "0.35.0",
"resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-0.34.16.tgz", "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-0.35.0.tgz",
"integrity": "sha512-50F1XWcVRzKVXqwO7J39hZ4qd/htzHj62dsywz7FfhZZSOaQ43XT3uEy7cBAVgw7gs+qChFaUJAhM1iHb0FyOQ==", "integrity": "sha512-VvVyCW8SEQ297zoeZNi4HOSLU8H7/xbGg4WpcpVOy080y/MXTxjIZshSlMHx45EB91U2vk0gbgd2R/d9uyY+3A==",
"dev": true "dev": true
}, },
"@volar/vue-code-gen": { "@volar/vue-code-gen": {
"version": "0.34.16", "version": "0.35.0",
"resolved": "https://registry.npmjs.org/@volar/vue-code-gen/-/vue-code-gen-0.34.16.tgz", "resolved": "https://registry.npmjs.org/@volar/vue-code-gen/-/vue-code-gen-0.35.0.tgz",
"integrity": "sha512-R8OGn26pCQsctXLa6mZi3BIkyXemcrhibTRGrVh1z2TqWMtnCIT/NiAYXR7kAH4UzFEpglOJAIxrjwnodJ7x6w==", "integrity": "sha512-IqIkzs3eRlJjABVXXBf5ik4/a8lQ3wqKemWMR33+KzOmj5xtXS+lgMMLNXJpj0Mw2nOLVl0I2KuIaTHFy485DQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"@volar/code-gen": "0.34.16", "@volar/code-gen": "0.35.0",
"@volar/source-map": "0.34.16", "@volar/source-map": "0.35.0",
"@vue/compiler-core": "^3.2.31", "@vue/compiler-core": "^3.2.36",
"@vue/compiler-dom": "^3.2.31", "@vue/compiler-dom": "^3.2.36",
"@vue/shared": "^3.2.31" "@vue/shared": "^3.2.36"
} }
}, },
"@volar/vue-typescript": { "@volar/vue-typescript": {
"version": "0.34.16", "version": "0.35.0",
"resolved": "https://registry.npmjs.org/@volar/vue-typescript/-/vue-typescript-0.34.16.tgz", "resolved": "https://registry.npmjs.org/@volar/vue-typescript/-/vue-typescript-0.35.0.tgz",
"integrity": "sha512-Jmo19pKRJAIhbAmr/1974knqKws9FZlnYWuCDvvg9wimKHTFosjDhDysORIMVHZ97og/0idK70iIKbcsyDadvw==", "integrity": "sha512-Ojn98P888wWbk1qeR5f6spgtJZMwUos+OkJfZpzyafN5S21LxF58o7DhhNG8rMm1zMNUQHb+evlp5AXI5zHOmA==",
"dev": true, "dev": true,
"requires": { "requires": {
"@volar/code-gen": "0.34.16", "@volar/code-gen": "0.35.0",
"@volar/source-map": "0.34.16", "@volar/source-map": "0.35.0",
"@volar/vue-code-gen": "0.34.16", "@volar/vue-code-gen": "0.35.0",
"@vue/compiler-sfc": "^3.2.31", "@vue/compiler-sfc": "^3.2.36",
"@vue/reactivity": "^3.2.31" "@vue/reactivity": "^3.2.36"
} }
}, },
"@vue/compiler-core": { "@vue/compiler-core": {
...@@ -7360,9 +7360,9 @@ ...@@ -7360,9 +7360,9 @@
} }
}, },
"unimport": { "unimport": {
"version": "0.2.4", "version": "0.2.5",
"resolved": "https://registry.npmjs.org/unimport/-/unimport-0.2.4.tgz", "resolved": "https://registry.npmjs.org/unimport/-/unimport-0.2.5.tgz",
"integrity": "sha512-7OEUIlZMS1s1h1uFAGkCPylMtE8hnlJ/cFurJQHdzKAqIyuGiOREFKaCLbkNtFloZicCpRAlqC0Ny2yMoz6mFg==", "integrity": "sha512-1YreHVa6vUtRANhtKROtniBY01PXM0ol857tlI3HaQHNLcuQKqWUCAfvZC/GipotKrMVm4LV9ZQ4u1s9lrrDpg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@rollup/pluginutils": "^4.2.1", "@rollup/pluginutils": "^4.2.1",
...@@ -7408,16 +7408,16 @@ ...@@ -7408,16 +7408,16 @@
} }
}, },
"unplugin-auto-import": { "unplugin-auto-import": {
"version": "0.8.5", "version": "0.8.6",
"resolved": "https://registry.npmjs.org/unplugin-auto-import/-/unplugin-auto-import-0.8.5.tgz", "resolved": "https://registry.npmjs.org/unplugin-auto-import/-/unplugin-auto-import-0.8.6.tgz",
"integrity": "sha512-JT43zA89fMjxtdqz+sTSkTsL9J0PNdnGmMOvcwbkpDi45yL5SU0aDCZgj0E8+qWLyQSIvvBaDBW3VuBrcc2MXg==", "integrity": "sha512-QRYwCmSzxZKHu8LQhUpTzF6t1YxYuo4b47e3cmE1kWsF4SQDO22Ysrj5/2BRY3jbYbiTZqOLopymRpov8SAYZQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"@antfu/utils": "^0.5.2", "@antfu/utils": "^0.5.2",
"@rollup/pluginutils": "^4.2.1", "@rollup/pluginutils": "^4.2.1",
"local-pkg": "^0.4.1", "local-pkg": "^0.4.1",
"magic-string": "^0.26.2", "magic-string": "^0.26.2",
"unimport": "^0.2.4", "unimport": "^0.2.5",
"unplugin": "^0.6.3" "unplugin": "^0.6.3"
} }
}, },
...@@ -7723,12 +7723,12 @@ ...@@ -7723,12 +7723,12 @@
} }
}, },
"vue-tsc": { "vue-tsc": {
"version": "0.34.16", "version": "0.35.0",
"resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-0.34.16.tgz", "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-0.35.0.tgz",
"integrity": "sha512-9tYBQIOyl3Tz8ZrlYUKtftu5m/wXHfxCalyjR22QzSaUJoBJmZeNOoVs/QEllc0z4ideEZxvvU+pBFdoY3O16A==", "integrity": "sha512-RcL7PM3M1nSaVQU84mRPOXk1t/mAZ25QCx4L0rNQzozJYhz1wSVQWYqq9UfhE2lW8nMAQzQtLZgvjaPR4Q29ZA==",
"dev": true, "dev": true,
"requires": { "requires": {
"@volar/vue-typescript": "0.34.16" "@volar/vue-typescript": "0.35.0"
} }
}, },
"webpack-sources": { "webpack-sources": {
......
...@@ -44,9 +44,9 @@ ...@@ -44,9 +44,9 @@
"eslint-plugin-vue": "^8.7.1", "eslint-plugin-vue": "^8.7.1",
"sass": "^1.52.1", "sass": "^1.52.1",
"typescript": "~4.6.4", "typescript": "~4.6.4",
"unplugin-auto-import": "^0.8.5", "unplugin-auto-import": "^0.8.6",
"vite": "^2.9.9", "vite": "^2.9.9",
"vite-plugin-checker": "^0.4.6", "vite-plugin-checker": "^0.4.6",
"vue-tsc": "^0.34.16" "vue-tsc": "^0.35.0"
} }
} }
...@@ -12,7 +12,11 @@ defineProps<{ docs: IDocItem[]; videos: IVideoItem[] }>() ...@@ -12,7 +12,11 @@ defineProps<{ docs: IDocItem[]; videos: IVideoItem[] }>()
const router = useRouter() const router = useRouter()
function handleViewDoc(data: IDocItem) { function handleViewDoc(data: IDocItem) {
router.push('/admission/doc/' + data.id) if (data.desc_type === '2') {
location.href = data.url
} else {
router.push('/admission/doc/' + data.id)
}
} }
function showTips() { function showTips() {
Notify({ type: 'primary', message: '尚未开放' }) Notify({ type: 'primary', message: '尚未开放' })
......
...@@ -8,7 +8,11 @@ defineProps<{ docs: IDocItem[] }>() ...@@ -8,7 +8,11 @@ defineProps<{ docs: IDocItem[] }>()
const router = useRouter() const router = useRouter()
function handleViewDoc(data: IDocItem) { function handleViewDoc(data: IDocItem) {
router.push('/learn/doc/' + data.id) if (data.desc_type === '2') {
location.href = data.url
} else {
router.push('/learn/doc/' + data.id)
}
} }
</script> </script>
......
...@@ -13,7 +13,11 @@ const router = useRouter() ...@@ -13,7 +13,11 @@ const router = useRouter()
const active = ref<number>(0) const active = ref<number>(0)
function handleViewDoc(data: IDocItem) { function handleViewDoc(data: IDocItem) {
router.push('/learn/doc/' + data.id) if (data.desc_type === '2') {
location.href = data.url
} else {
router.push('/learn/doc/' + data.id)
}
} }
function showTips() { function showTips() {
......
...@@ -23,6 +23,8 @@ export interface IDocItem { ...@@ -23,6 +23,8 @@ export interface IDocItem {
id: string id: string
title: string title: string
pv: string pv: string
desc_type: '1' | '2'
url: string
} }
export { IVideoItem, ICourseItem, ITeam } export { IVideoItem, ICourseItem, ITeam }
...@@ -40,6 +40,9 @@ onMounted(() => { ...@@ -40,6 +40,9 @@ onMounted(() => {
<LearningMap :docs="data.learning_map_docs"></LearningMap> <LearningMap :docs="data.learning_map_docs"></LearningMap>
<!-- 权益查看 --> <!-- 权益查看 -->
<QueryView></QueryView> <QueryView></QueryView>
<RouterLink to="/qa">
<img src="https://webapp-pub.ezijing.com/project/prp-h5/qa_banner.png" style="width: 100%" />
</RouterLink>
<!-- 荣誉总榜 --> <!-- 荣誉总榜 -->
<TeamRanking :teams="data.ranking"></TeamRanking> <TeamRanking :teams="data.ranking"></TeamRanking>
<!-- 考试攻略 --> <!-- 考试攻略 -->
......
<script setup lang="ts"></script> <script setup lang="ts">
import { Toast } from 'vant'
import PublishItem from '@/components/PublishItem.vue'
import { getQuestionList, createQuestionComment } from '../api'
interface Info {
loading: boolean
page: number
total: number
list: any[]
}
const dataset = reactive<Info>({ loading: false, page: 1, total: 0, list: [] })
// 获取打卡评论
const getQuestions = (isReset?: boolean) => {
if (isReset) {
dataset.page = 1
}
dataset.loading = true
getQuestionList({ page: dataset.page, page_size: 10 })
.then(res => {
const { total, list } = res.data
dataset.total = total
dataset.list = isReset ? list : dataset.list.concat(list)
if (dataset.list.length <= total) {
dataset.page++
}
})
.finally(() => {
dataset.loading = false
})
}
// 滚动加载
useInfiniteScroll(
document,
() => {
!dataset.loading && getQuestions()
},
{ distance: 10 }
)
// 评论
const onSubmitComment = (data: any, action: string) => {
if (action === 'comment') {
// 评论
createQuestionComment({
question_id: data.id,
content: data.comment
}).then(() => {
Toast.success('评论成功')
getQuestions(true)
})
} else {
// 回复
createQuestionComment({
question_id: data.entity_id,
content: data.comment,
to_comment_id: data.id
}).then(() => {
Toast.success('回复成功')
getQuestions(true)
})
}
}
</script>
<template> <template>
<div class="home"></div> <RouterLink to="/share">
<img src="https://webapp-pub.ezijing.com/project/prp-h5/banner_qa.png" style="width: 100%" />
</RouterLink>
<div class="list-card">
<h2 class="title">最新动态</h2>
<div class="tips">
<p>晒出你的【知识输出者】 留下知识践行的足迹 得到你的星星权益</p>
<RouterLink to="/qa/publish" class="tips-button">去拍照得星星</RouterLink>
</div>
<div style="margin: 0.2rem">
<template v-if="dataset.list?.length">
<PublishItem v-for="item in dataset.list" :data="item" :key="item.id" @submitComment="onSubmitComment"></PublishItem>
</template>
<van-empty description="暂无内容" v-else />
</div>
</div>
</template> </template>
<style lang="scss" scoped>
.list-card {
margin-top: 0.52rem;
margin-bottom: 0.2rem;
background: #fff;
border-radius: 0.2rem;
overflow: hidden;
.title {
padding: 0 0.3rem;
font-size: 0.28rem;
line-height: 0.9rem;
background: #f7f7f7;
}
.tips {
position: relative;
margin: 0.2rem;
padding: 0.24rem;
background-color: #f7f7f7;
border-radius: 0.2rem;
p {
font-size: 0.24rem;
line-height: 0.36rem;
color: #033974;
}
.tips-button {
position: absolute;
right: 0.24rem;
bottom: 0.2rem;
padding: 0 0.15rem;
height: 0.4rem;
font-size: 0.22rem;
line-height: 0.4rem;
color: #fff;
background: linear-gradient(164deg, #f7c988 0%, #e5a448 100%);
border-radius: 0.2rem;
}
}
}
</style>
...@@ -12,7 +12,7 @@ function onSubmit() { ...@@ -12,7 +12,7 @@ function onSubmit() {
const params = Object.assign({}, form, { picture: JSON.stringify(form.picture) }) const params = Object.assign({}, form, { picture: JSON.stringify(form.picture) })
createQuestion(params).then(() => { createQuestion(params).then(() => {
Toast.success('发布成功') Toast.success('发布成功')
router.push({ path: '/#qa' }) router.push({ path: '/qa' })
}) })
} }
</script> </script>
...@@ -20,18 +20,8 @@ function onSubmit() { ...@@ -20,18 +20,8 @@ function onSubmit() {
<template> <template>
<AppContainer title="发布问题" backgroundColor="#fff" headerAlign="center"> <AppContainer title="发布问题" backgroundColor="#fff" headerAlign="center">
<van-form @submit="onSubmit"> <van-form @submit="onSubmit">
<van-field <van-field v-model="form.title" placeholder="请输入问题标题" :rules="[{ required: true, message: '请输入问题标题' }]" />
v-model="form.title" <van-field v-model="form.desc" type="textarea" placeholder="请输入问题内容" :autosize="{ minHeight: 200 }" :rules="[{ required: true, message: '请输入问题内容' }]" />
placeholder="请输入问题标题"
:rules="[{ required: true, message: '请输入问题标题' }]"
/>
<van-field
v-model="form.desc"
type="textarea"
placeholder="请输入问题内容"
:autosize="{ minHeight: 200 }"
:rules="[{ required: true, message: '请输入问题内容' }]"
/>
<van-field> <van-field>
<template #input> <template #input>
<AppUpload v-model="form.picture"></AppUpload> <AppUpload v-model="form.picture"></AppUpload>
......
...@@ -63,6 +63,11 @@ async function getShareInfo() { ...@@ -63,6 +63,11 @@ async function getShareInfo() {
} }
init() init()
} }
onMounted(() => {
getShareInfo()
})
// 生成分享二维码 // 生成分享二维码
let qrcodeUrl = $ref<string>() let qrcodeUrl = $ref<string>()
async function genQrcode() { async function genQrcode() {
...@@ -99,10 +104,6 @@ function handleDownload() { ...@@ -99,10 +104,6 @@ function handleDownload() {
saveAs(previewUrl, Date.now().toString()) saveAs(previewUrl, Date.now().toString())
} }
onMounted(() => {
getShareInfo()
})
function handleTabClick(index: number) { function handleTabClick(index: number) {
controls.active = index controls.active = index
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论