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-05-18 16:17:58 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8addf0d29338e9655ce47047c5744bf8d77cf827
8addf0d2
1 parent
785e8c1e
留言权限相关页面调整
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
33 additions
and
48 deletions
.env.development
src/components/CommentList/index.vue
src/components/VideoCard/index.vue
src/composables/useDefaultPerf.js
src/views/client/bookDetail.vue
src/views/client/finishUpload.vue
src/views/client/videoDetail.vue
src/views/client/videoDetailComment.vue
src/views/me/callMe.vue
.env.development
View file @
8addf0d
...
...
@@ -5,7 +5,7 @@ VITE_BASE = /
VITE_OPENID = api-test-openid
# B端账号
VITE_ID = 13
812345678
VITE_ID = 13
761653761
# 验证码
VITE_PIN = 8888
...
...
src/components/CommentList/index.vue
View file @
8addf0d
...
...
@@ -82,10 +82,12 @@ import { Toast } from 'vant';
import { ref, reactive, onMounted, watch } from 'vue'
// 获取是否实名认证
import { idCard } from '@/composables/useValidIdCard.js'
const validIdCard = idCard();
import { useDefaultPerf } from '@/composables';
const $router = useRouter();
const $route = useRoute();
const { userInfo } = useDefaultPerf($route.query.book_id);
const props = defineProps({
showPopup: Boolean,
...
...
@@ -106,8 +108,8 @@ const commentType = ref('comment'); // 类型 comment 为评论/类型 reply 为
*/
const commentId = ref('')
const replayUser = ref('')
const setComment = (v, type) => { //
if (
validIdCard.can_use.value
) {
const setComment = (v, type) => { //
if (
userInfo.value.can_upload
) {
showCommentBoxPopup.value = true;
commentType.value = type;
replayUser.value = v.name;
...
...
src/components/VideoCard/index.vue
View file @
8addf0d
...
...
@@ -104,6 +104,7 @@ export default {
path: '/client/videoDetail',
query: {
prod_id: this.item.id,
book_id: this.item.book_id,
type: this.item.type // 特殊标识,判断入口 为keepAlive使用
}
});
...
...
@@ -112,7 +113,8 @@ export default {
this.$router.push({
path: '/client/videoDetail/comment',
query: {
prod_id: this.item.id
prod_id: this.item.id,
book_id: this.item.book_id
}
});
}
...
...
src/composables/useDefaultPerf.js
View file @
8addf0d
...
...
@@ -4,7 +4,7 @@ import { Toast } from 'vant';
export
const
useDefaultPerf
=
(
bookId
)
=>
{
// 金数据准备数据
const
donateItem
=
ref
({})
const
userInfo
=
ref
({})
/**
* 获取默认儿童信息
...
...
@@ -17,7 +17,7 @@ export const useDefaultPerf = (bookId) => {
})
.
then
(
res
=>
{
if
(
res
.
data
.
code
===
1
)
{
donateItem
.
value
=
{
userInfo
.
value
=
{
book_id
:
res
.
data
.
data
.
book_id
,
avatar
:
res
.
data
.
data
.
book_cover
,
name
:
res
.
data
.
data
.
book_name
,
...
...
@@ -26,6 +26,7 @@ export const useDefaultPerf = (bookId) => {
perf_id
:
res
.
data
.
data
.
perf_id
,
perf_name
:
res
.
data
.
data
.
perf_name
,
can_upload
:
res
.
data
.
data
.
can_upload
,
// can_upload :1=可上传,-1=用户没有实名,-2=用户没有儿童表演者
// can_upload: -1, // can_upload :1=可上传,-1=用户没有实名,-2=用户没有儿童表演者
}
}
else
{
console
.
warn
(
res
);
...
...
@@ -40,6 +41,6 @@ export const useDefaultPerf = (bookId) => {
console
.
error
(
err
);
});
return
{
donateItem
userInfo
}
}
...
...
src/views/client/bookDetail.vue
View file @
8addf0d
...
...
@@ -94,7 +94,7 @@
</div>
</notice-overlay>
<donate-book :showPopup="showDonate" :item="
donateItem
" @on-close="closeDonate"></donate-book>
<donate-book :showPopup="showDonate" :item="
userInfo
" @on-close="closeDonate"></donate-book>
<van-overlay :show="show" z-index="9999">
<div class="wrapper" @click.stop>
...
...
@@ -119,7 +119,7 @@ const $route = useRoute();
const $router = useRouter();
const { toggleLanguage, onLoad, columns, prod_list, finished, loading, bookInfo, showPicker, checkLocalism, checkMandarin, onConfirm, chooseLanguage, finishedTextStatus, emptyStatus } = useVideoList($route);
const {
donateItem
} = useDefaultPerf($route.query.id);
const {
userInfo
} = useDefaultPerf($route.query.id);
// 判断是否显示简介的展开图标
const hasToggle = ref(false); // 判断是否有展开文字,默认没有
...
...
@@ -195,10 +195,10 @@ const noticeText = ref('')
const noticeHtml = ref('')
const show = ref(false); // 跳转等待提示
const uploadVideo = () => {
if (
donateItem
.value.can_upload === 1) { // 可以上传
if (
userInfo
.value.can_upload === 1) { // 可以上传
show.value = true;
// x_field_1 是金数据表单传入的参数,家长上传的格式为:user_id-book_id-perf_id,perf_id是当前缺省的儿童id
const str = `${
donateItem.value.user_id}-${$route.query.id}-${donateItem
.value.perf_id}`;
const str = `${
userInfo.value.user_id}-${$route.query.id}-${userInfo
.value.perf_id}`;
// 已读隐私条例,直接跳转上传页面
if (Cookies.get('privacy_notice')) {
location.href = `${JSJ_FORM_C}?x_field_1=${str}`;
...
...
@@ -214,14 +214,14 @@ const uploadVideo = () => {
}
})
}
} else if (
donateItem
.value.can_upload === -1) { // 未实名认证
} else if (
userInfo
.value.can_upload === -1) { // 未实名认证
showNotice.value = true;
noticeText.value = '前往认证'
noticeHtml.value = `
<p>您还没有实名认证</p>
<p>请前往个人中心进行实名认证</p>
`
} else if (
donateItem
.value.can_upload === -2) { // 没有默认儿童
} else if (
userInfo
.value.can_upload === -2) { // 没有默认儿童
showNotice.value = true;
noticeText.value = '前往新增'
noticeHtml.value = `
...
...
src/views/client/finishUpload.vue
View file @
8addf0d
...
...
@@ -18,7 +18,7 @@
</div>
</div>
<donate-book :showPopup="showDonate" :item="
donateItem
" @on-close="closeDonate"></donate-book>
<donate-book :showPopup="showDonate" :item="
userInfo
" @on-close="closeDonate"></donate-book>
</template>
<script setup>
...
...
@@ -38,7 +38,7 @@ const $router = useRouter();
/*************** 捐书模块START ***************/
const book_id = $route.query.x_field_1 ? $route.query.x_field_1.split('-')[1] : '';
const {
donateItem
} = useDefaultPerf(book_id);
const {
userInfo
} = useDefaultPerf(book_id);
if (!book_id) {
Toast.fail('书籍数据不全');
}
...
...
@@ -60,7 +60,7 @@ const goBack = () => {
$router.push({
path: '/client/bookDetail',
query: {
id:
donateItem
.value.book_id
id:
userInfo
.value.book_id
}
})
}
...
...
src/views/client/videoDetail.vue
View file @
8addf0d
...
...
@@ -25,7 +25,7 @@
<van-tab title="简介" :title-style="tabClass">
<div class="intro">{{ videoInfo.note }}</div>
</van-tab>
<van-tab :title="'留言 ' + comment_num" :title-style="tabClass" :to="'/client/videoDetail/comment?prod_id=' + $route.query.prod_id">
<van-tab :title="'留言 ' + comment_num" :title-style="tabClass" :to="'/client/videoDetail/comment?prod_id=' + $route.query.prod_id
+ '&book_id=' + $route.query.book_id
">
<router-view></router-view>
</van-tab>
</van-tabs>
...
...
src/views/client/videoDetailComment.vue
View file @
8addf0d
...
...
@@ -76,12 +76,12 @@ import _ from 'lodash'
import { Toast } from 'vant';
// 获取是否实名认证
import { idCard } from '@/composables/useValidIdCard.js'
const validIdCard = idCard();
import { useDefaultPerf } from '@/composables';
const $route = useRoute();
const $router = useRouter();
const { userInfo } = useDefaultPerf($route.query.book_id);
/******** 留言列表相关操作 START *******/
const loading = ref(false);
...
...
@@ -188,7 +188,7 @@ const commentType = ref('comment'); // 类型 comment 为评论/类型 reply 为
const commentId = ref('')
const replayUser = ref('')
const setComment = (v, type) => {
if (
validIdCard.can_use.value
) {
if (
userInfo.value.can_upload
) {
showCommentBoxPopup.value = true;
commentType.value = type;
replayUser.value = v.name;
...
...
src/views/me/callMe.vue
View file @
8addf0d
...
...
@@ -49,13 +49,6 @@
/>
<comment-box :showPopup="showCommentBoxPopup" :type="commentType" :replayUser="replayUser" @on-submit="submitCommentBox" @on-close="closeCommentBox"></comment-box>
<!-- 写评论时,如果没有实名认证提示弹框 -->
<notice-overlay :show="showNotice" text="前往认证" @on-submit="onSubmit" @on-close="onClose">
<div style="color: #333333;">
<p>您还没有实名认证</p>
<p>请前往个人中心进行实名认证</p>
</div>
</notice-overlay>
</template>
<script setup>
...
...
@@ -64,19 +57,14 @@ import { mainStore } from '@/store'
// import icon_player from '@images/bofang@2x.png'
import no_image from '@images/que-shuju@2x.png'
import CommentBox from '@/components/CommentBox/index.vue'
import NoticeOverlay from '@/components/NoticeOverlay/index.vue'
import icon_avatar from '@images/que-touxiang@2x.png'
import { ref,
reactive,
onActivated } from 'vue'
import { useRoute, useRouter
, onBeforeRouteLeave
} from 'vue-router'
import { ref, onActivated } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import axios from '@/utils/axios';
import _ from 'lodash'
import { Toast } from 'vant';
// 获取是否实名认证
import { idCard } from '@/composables/useValidIdCard.js'
const validIdCard = idCard();
const $route = useRoute();
const $router = useRouter();
...
...
@@ -133,10 +121,6 @@ const onLoad = () => {
// 立即执行一次
// onLoad();
const showNotice = ref(false)
const onClose = () => { // 关闭提示框回调
showNotice.value = false;
}
// 跳转个人中心
const onSubmit = () => {
$router.push({
...
...
@@ -157,14 +141,10 @@ const commentType = ref('comment'); // 类型 comment 为评论/类型 reply 为
const commentId = ref('')
const replayUser = ref('')
const setComment = (v, type) => {
if (validIdCard.can_use.value) {
showCommentBoxPopup.value = true;
commentType.value = type;
replayUser.value = v.name;
commentId.value = v.id;
} else {
showNotice.value = true;
}
showCommentBoxPopup.value = true;
commentType.value = type;
replayUser.value = v.name;
commentId.value = v.id;
}
/**
...
...
Please
register
or
login
to post a comment