Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
tswj
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2022-07-01 15:39:06 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2df9b750ffd0b707200be5cc16c964fffc728e94
2df9b750
1 parent
79dfc06a
✨ feat(回复模块):判断实名认证使用新组件
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
145 deletions
src/components/CommentList/index.vue
src/components/NoticeOverlayTest/index.vue → src/components/NoticeOverlayModule/index.vue
src/utils/generateModules.js
src/views/client/bookDetail.vue
src/views/client/videoDetailComment.vue
src/views/me/index.vue
src/components/CommentList/index.vue
View file @
2df9b75
...
...
@@ -52,19 +52,13 @@
</van-popup>
<!-- 写评论时,如果没有实名认证提示弹框 -->
<notice-overlay :show="showNotice" :text="noticeText" @on-submit="onSubmit" @on-close="onClose">
<div style="color: #333333;">
<div v-html="noticeHtml" />
</div>
</notice-overlay>
<notice-overlay-module :show="showNotice" :type="userInfo.can_upload" @on-submit="onSubmit" @on-close="onClose" />
</template>
<script setup>
import CommentBox from '@/components/CommentBox/index.vue'
import NoticeOverlay
from '@/components/NoticeOverlay
/index.vue'
import NoticeOverlay
Module from '@/components/NoticeOverlayModule
/index.vue'
import no_image from '@images/que-shuju@2x.png'
import icon_x from '@images/x.png'
import icon_y from '@images/y.png'
import icon_avatar from '@images/que-touxiang@2x.png'
...
...
@@ -74,9 +68,12 @@ import axios from '@/utils/axios';
import _ from 'lodash'
import { Toast } from 'vant';
import { ref,
reactive, onMounted,
watch } from 'vue'
import { ref, watch } from 'vue'
// 获取是否实名认证
import { useDefaultPerf } from '@/composables';
import { USER_STATUS } from '@/constant'
import { useGo } from '@/hooks/useGo'
const go = useGo();
const $router = useRouter();
const $route = useRoute();
...
...
@@ -100,32 +97,17 @@ const commentType = ref('comment'); // 类型 comment 为评论/类型 reply 为
* @param {*} v 单行评论数据
* @param {*} type 类型 comment 为评论/类型 reply 为回复
*/
const noticeText = ref('')
const noticeHtml = ref('')
const commentId = ref('')
const replayUser = ref('')
const setComment = (v, type) => { //
if (userInfo.value.can_upload ===
1
) {
if (userInfo.value.can_upload ===
USER_STATUS.PASS
) {
showCommentBoxPopup.value = true;
commentType.value = type;
replayUser.value = v.name;
commentId.value = props.data.id;
} else if (userInfo.value.can_upload === -1) { // 未实名认证
closeBtn();
showNotice.value = true;
noticeText.value = '前往认证'
noticeHtml.value = `
<p>您还没有实名认证</p>
<p>请前往个人中心进行实名认证</p>
`
} else if (userInfo.value.can_upload === -2) { // 没有默认儿童
} else {
closeBtn();
showNotice.value = true;
noticeText.value = '前往新增'
noticeHtml.value = `
<p>您还没有新增儿童</p>
<p>请前往个人中心进行新增</p>
`
}
}
...
...
@@ -184,24 +166,10 @@ const onSubmit = () => {
setTimeout(() => {
showNotice.value = false;
}, 1000);
if (userInfo.value.can_upload === -1) { // 未实名认证
$router.push({
path: '/me/verifyUser',
query: {
back_url: $route.fullPath
}
});
} else if (userInfo.value.can_upload === -2) { // 没有默认儿童
$router.push({
path: '/me/handleUser',
query: {
perf_id: '',
kg_id: '',
kg_name: '',
type: 'ADD',
back_url: $route.fullPath
}
});
if (userInfo.value.can_upload === USER_STATUS.NON_VERIFIED) { // 未实名认证
go('/me/verifyUser', { back_url: $route.fullPath })
} else if (userInfo.value.can_upload === USER_STATUS.NON_DEFAULT_CHILD) { // 没有默认儿童
go('/me/handleUser', { perf_id: '', kg_id: '', kg_name: '', type: 'ADD', back_url: $route.fullPath })
}
}
...
...
@@ -279,21 +247,6 @@ const closeBtn = () => {
}
</script>
<script>
export default {
data() {
return {
}
},
mounted() {
},
watch: {
},
methods: {
}
}
</script>
<style lang="less" scoped>
.comment-wrapper {
color: #999999;
...
...
src/components/NoticeOverlay
Test
/index.vue
→
src/components/NoticeOverlay
Module
/index.vue
View file @
2df9b75
File moved
src/utils/generateModules.js
View file @
2df9b75
...
...
@@ -2,14 +2,14 @@
* @Author: hookehuyr hookehuyr@gmail.com
* @Date: 2022-05-17 11:17:58
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-0
6-30 17:49:41
* @LastEditTime: 2022-0
7-01 14:55:12
* @FilePath: /tswj/src/utils/generateModules.js
* @Description:
*/
import
MyButton
from
'@/components/MyButton/index.vue'
import
VideoCard
from
'@/components/VideoCard/index.vue'
import
NoticeOverlay
from
'@/components/NoticeOverlay/index.vue'
import
NoticeOverlay
Test
from
'@/components/NoticeOverlayTest
/index.vue'
import
NoticeOverlay
Module
from
'@/components/NoticeOverlayModule
/index.vue'
import
DonateBook
from
'@/components/DonateBook/index.vue'
import
ShortcutFixed
from
'@/components/ShortcutFixed/index.vue'
import
BookCard
from
'@/components/BookCard/index.vue'
...
...
@@ -21,7 +21,7 @@ export {
MyButton
,
VideoCard
,
NoticeOverlay
,
NoticeOverlay
Test
,
NoticeOverlay
Module
,
DonateBook
,
ShortcutFixed
,
BookCard
,
...
...
src/views/client/bookDetail.vue
View file @
2df9b75
...
...
@@ -2,7 +2,7 @@
* @Author: hookehuyr hookehuyr@gmail.com
* @Date: 2022-05-21 09:35:14
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-0
6-30 18:26:54
* @LastEditTime: 2022-0
7-01 15:14:26
* @FilePath: /tswj/src/views/client/bookDetail.vue
* @Description:
-->
...
...
@@ -109,12 +109,8 @@
</div>
<!-- 上传时,如果没有默认儿童提示弹框, 如果没有实名认证提示弹框 -->
<!-- <notice-overlay-test :show="showNotice" :type="userInfo.can_upload" @on-submit="onSubmit" @on-close="onClose" /> -->
<notice-overlay :show="showNotice" :text="noticeText" @on-submit="onSubmit" @on-close="onClose">
<div style="color: #333333;">
<div v-html="noticeHtml" />
</div>
</notice-overlay>
<notice-overlay-module :show="showNotice" :type="userInfo.can_upload" @on-submit="onSubmit" @on-close="onClose" />
<donate-flower :user-type="donateType" :show-popup="showDonate" :item="donateInfo" @on-close="closeDonate" />
<van-overlay :show="show" z-index="9999">
...
...
@@ -125,10 +121,10 @@
</template>
<script setup>
import { ref, onActivated,
nextTick,
onMounted, computed } from 'vue'
import { ref, onActivated, onMounted, computed } from 'vue'
import { useRoute, useRouter, onBeforeRouteLeave } from 'vue-router'
import { Cookies, _, storeToRefs, mainStore, Toast, hasEllipsis } from '@/utils/generatePackage'
import { MyButton, VideoCard, NoticeOverlay
, NoticeOverlayTest
, DonateFlower, ShortcutFixed } from '@/utils/generateModules'
import { MyButton, VideoCard, NoticeOverlay
Module
, DonateFlower, ShortcutFixed } from '@/utils/generateModules'
import { icon_video, icon_up, icon_down, icon_subscribed, icon_unsubscribe, no_image } from '@/utils/generateIcons'
import { JSJ_FORM_C, JSJ_FORM_MANDARIN, JSJ_FORM_LOCALISM } from '@/constant'
import { useVideoList, useDefaultPerf, useScrollTop } from '@/composables';
...
...
@@ -262,8 +258,6 @@ const onSubmit = () => {
}
}
const noticeText = ref('')
const noticeHtml = ref('')
const show = ref(false); // 跳转等待提示
const uploadVideo = () => {
if (userInfo.value.can_upload === USER_STATUS.PASS) {
...
...
@@ -280,25 +274,9 @@ const uploadVideo = () => {
setTimeout(() => {
show.value = false;
}, 2000);
} else if (userInfo.value.can_upload === USER_STATUS.NON_VERIFIED) {
showNotice.value = true;
noticeText.value = '前往认证'
noticeHtml.value = `
<p>您还没有实名认证</p>
<p>请前往个人中心进行实名认证</p>
`
} else if (userInfo.value.can_upload === USER_STATUS.NON_DEFAULT_CHILD) {
} else {
showNotice.value = true;
noticeText.value = '前往新增'
noticeHtml.value = `
<p>您还没有新增儿童</p>
<p>请前往个人中心进行新增</p>
`
}
// 测试新组件条件
// else {
// showNotice.value = true;
// }
}
/****************** keepAlive 模块 *******************/
...
...
src/views/client/videoDetailComment.vue
View file @
2df9b75
...
...
@@ -53,12 +53,8 @@
<comment-box :show-popup="showCommentBoxPopup" :type="commentType" :replay-user="replayUser"
@on-submit="submitCommentBox" @on-close="closeCommentBox" />
<!-- 写评论时,如果没有实名认证提示弹框 -->
<notice-overlay :show="showNotice" :text="noticeText" @on-submit="onSubmit" @on-close="onClose">
<div style="color: #333333;">
<div v-html="noticeHtml" />
</div>
</notice-overlay>
<!-- 提示实名认证和新增儿童提示 -->
<notice-overlay-module :show="showNotice" :type="userInfo.can_upload" @on-submit="onSubmit" @on-close="onClose" />
</template>
<script setup>
...
...
@@ -66,26 +62,26 @@ import { mainStore } from '@/store'
import CommentList from '@/components/CommentList/index.vue'
import CommentBox from '@/components/CommentBox/index.vue'
import NoticeOverlay
from '@/components/NoticeOverlay
/index.vue'
import NoticeOverlay
Module from '@/components/NoticeOverlayModule
/index.vue'
import icon_avatar from '@images/que-touxiang@2x.png'
import no_image from '@images/que-shuju@2x.png'
import { ref,
reactive, onMounted, provide, inject, nextTick
} from 'vue'
import { useRoute
, useRouter
} from 'vue-router'
import { ref,
onMounted
} from 'vue'
import { useRoute } from 'vue-router'
import axios from '@/utils/axios';
import $ from 'jquery'
import _ from 'lodash'
import { Toast } from 'vant';
import { USER_STATUS } from '@/constant'
import { useGo } from '@/hooks/useGo'
// 获取是否实名认证
import { useDefaultPerf } from '@/composables';
import { sharePage } from '@/composables/useShare.js'
// TAG:微信分享
sharePage({});
const go = useGo();
const $route = useRoute();
const $router = useRouter();
const { userInfo } = useDefaultPerf($route.query.book_id);
...
...
@@ -180,28 +176,13 @@ const onSubmit = () => {
setTimeout(() => {
showNotice.value = false;
}, 1000);
if (userInfo.value.can_upload === -1) { // 未实名认证
$router.push({
path: '/me/verifyUser',
query: {
back_url: $route.fullPath
}
});
} else if (userInfo.value.can_upload === -2) { // 没有默认儿童
$router.push({
path: '/me/handleUser',
query: {
perf_id: '',
kg_id: '',
kg_name: '',
type: 'ADD',
back_url: $route.fullPath
}
});
if (userInfo.value.can_upload === USER_STATUS.NON_VERIFIED) {
go('/me/verifyUser', { back_url: $route.fullPath })
} else if (userInfo.value.can_upload === USER_STATUS.NON_DEFAULT_CHILD) {
go('/me/handleUser', { perf_id: '', kg_id: '', kg_name: '', type: 'ADD', back_url: $route.fullPath })
}
}
/******** 留言框相关操作 START *******/
// 回复评论控件
const showCommentBoxPopup = ref(false);
...
...
@@ -212,30 +193,16 @@ const commentType = ref('comment'); // 类型 comment 为评论/类型 reply 为
* @param {*} v 单行评论数据
* @param {*} type 类型 comment 为评论/类型 reply 为回复
*/
const noticeText = ref('')
const noticeHtml = ref('')
const commentId = ref('')
const replayUser = ref('')
const setComment = (v, type) => {
if (userInfo.value.can_upload ===
1
) {
if (userInfo.value.can_upload ===
USER_STATUS.PASS
) {
showCommentBoxPopup.value = true;
commentType.value = type;
replayUser.value = v.name;
commentId.value = v.id;
} else if (userInfo.value.can_upload === -1) { // 未实名认证
showNotice.value = true;
noticeText.value = '前往认证'
noticeHtml.value = `
<p>您还没有实名认证</p>
<p>请前往个人中心进行实名认证</p>
`
} else if (userInfo.value.can_upload === -2) { // 没有默认儿童
} else {
showNotice.value = true;
noticeText.value = '前往新增'
noticeHtml.value = `
<p>您还没有新增儿童</p>
<p>请前往个人中心进行新增</p>
`
}
}
...
...
src/views/me/index.vue
View file @
2df9b75
...
...
@@ -83,20 +83,15 @@
<van-action-sheet v-model:show="show" :actions="actions" @select="onSelect" />
<!-- 如果没有实名认证,新增儿童提示弹框 -->
<notice-overlay :show="showNotice" text="前往认证" @on-submit="go('/me/verifyUser')" @on-close="onClose">
<div style="color: #333333;">
<p>您还没有实名认证</p>
<p>请前往个人中心进行实名认证</p>
</div>
</notice-overlay>
<!-- 实名认证弹框-->
<notice-overlay-module :show="showNotice" :type="USER_STATUS.NON_VERIFIED" @on-submit="go('/me/verifyUser')" @on-close="onClose" />
</template>
<script setup>
import { ref, onMounted } from 'vue'
import { useRouter } from 'vue-router'
import { _ } from '@/utils/generatePackage.js'
import { MyButton, NoticeOverlay } from '@/utils/generateModules.js'
import { MyButton, NoticeOverlay
Module
} from '@/utils/generateModules.js'
import { icon_avatar } from '@/utils/generateIcons.js'
import { changePerformerAPI, myInfoAPI, myPerformerAPI } from '@/api/C/me.js'
import meRoute from '@/router/routes/modules/me'
...
...
@@ -104,6 +99,7 @@ import meRoute from '@/router/routes/modules/me'
import { styleObject7, styleObject4, styleObject5, styleObject6 } from '@/settings/designSetting.js'
import { useGo } from '@/hooks/useGo'
import { killPages } from '@/hooks/useKeepAlive'
import { USER_STATUS } from '@/constant'
const go = useGo();
const $router = useRouter();
...
...
Please
register
or
login
to post a comment