Showing
9 changed files
with
33 additions
and
48 deletions
| ... | @@ -82,10 +82,12 @@ import { Toast } from 'vant'; | ... | @@ -82,10 +82,12 @@ import { Toast } from 'vant'; |
| 82 | 82 | ||
| 83 | import { ref, reactive, onMounted, watch } from 'vue' | 83 | import { ref, reactive, onMounted, watch } from 'vue' |
| 84 | // 获取是否实名认证 | 84 | // 获取是否实名认证 |
| 85 | -import { idCard } from '@/composables/useValidIdCard.js' | 85 | +import { useDefaultPerf } from '@/composables'; |
| 86 | -const validIdCard = idCard(); | ||
| 87 | 86 | ||
| 88 | const $router = useRouter(); | 87 | const $router = useRouter(); |
| 88 | +const $route = useRoute(); | ||
| 89 | + | ||
| 90 | +const { userInfo } = useDefaultPerf($route.query.book_id); | ||
| 89 | 91 | ||
| 90 | const props = defineProps({ | 92 | const props = defineProps({ |
| 91 | showPopup: Boolean, | 93 | showPopup: Boolean, |
| ... | @@ -106,8 +108,8 @@ const commentType = ref('comment'); // 类型 comment 为评论/类型 reply 为 | ... | @@ -106,8 +108,8 @@ const commentType = ref('comment'); // 类型 comment 为评论/类型 reply 为 |
| 106 | */ | 108 | */ |
| 107 | const commentId = ref('') | 109 | const commentId = ref('') |
| 108 | const replayUser = ref('') | 110 | const replayUser = ref('') |
| 109 | -const setComment = (v, type) => { // | 111 | +const setComment = (v, type) => { // |
| 110 | - if (validIdCard.can_use.value) { | 112 | + if (userInfo.value.can_upload) { |
| 111 | showCommentBoxPopup.value = true; | 113 | showCommentBoxPopup.value = true; |
| 112 | commentType.value = type; | 114 | commentType.value = type; |
| 113 | replayUser.value = v.name; | 115 | replayUser.value = v.name; | ... | ... |
| ... | @@ -104,6 +104,7 @@ export default { | ... | @@ -104,6 +104,7 @@ export default { |
| 104 | path: '/client/videoDetail', | 104 | path: '/client/videoDetail', |
| 105 | query: { | 105 | query: { |
| 106 | prod_id: this.item.id, | 106 | prod_id: this.item.id, |
| 107 | + book_id: this.item.book_id, | ||
| 107 | type: this.item.type // 特殊标识,判断入口 为keepAlive使用 | 108 | type: this.item.type // 特殊标识,判断入口 为keepAlive使用 |
| 108 | } | 109 | } |
| 109 | }); | 110 | }); |
| ... | @@ -112,7 +113,8 @@ export default { | ... | @@ -112,7 +113,8 @@ export default { |
| 112 | this.$router.push({ | 113 | this.$router.push({ |
| 113 | path: '/client/videoDetail/comment', | 114 | path: '/client/videoDetail/comment', |
| 114 | query: { | 115 | query: { |
| 115 | - prod_id: this.item.id | 116 | + prod_id: this.item.id, |
| 117 | + book_id: this.item.book_id | ||
| 116 | } | 118 | } |
| 117 | }); | 119 | }); |
| 118 | } | 120 | } | ... | ... |
| ... | @@ -4,7 +4,7 @@ import { Toast } from 'vant'; | ... | @@ -4,7 +4,7 @@ import { Toast } from 'vant'; |
| 4 | 4 | ||
| 5 | export const useDefaultPerf = (bookId) => { | 5 | export const useDefaultPerf = (bookId) => { |
| 6 | // 金数据准备数据 | 6 | // 金数据准备数据 |
| 7 | - const donateItem = ref({}) | 7 | + const userInfo = ref({}) |
| 8 | 8 | ||
| 9 | /** | 9 | /** |
| 10 | * 获取默认儿童信息 | 10 | * 获取默认儿童信息 |
| ... | @@ -17,7 +17,7 @@ export const useDefaultPerf = (bookId) => { | ... | @@ -17,7 +17,7 @@ export const useDefaultPerf = (bookId) => { |
| 17 | }) | 17 | }) |
| 18 | .then(res => { | 18 | .then(res => { |
| 19 | if (res.data.code === 1) { | 19 | if (res.data.code === 1) { |
| 20 | - donateItem.value = { | 20 | + userInfo.value = { |
| 21 | book_id: res.data.data.book_id, | 21 | book_id: res.data.data.book_id, |
| 22 | avatar: res.data.data.book_cover, | 22 | avatar: res.data.data.book_cover, |
| 23 | name: res.data.data.book_name, | 23 | name: res.data.data.book_name, |
| ... | @@ -26,6 +26,7 @@ export const useDefaultPerf = (bookId) => { | ... | @@ -26,6 +26,7 @@ export const useDefaultPerf = (bookId) => { |
| 26 | perf_id: res.data.data.perf_id, | 26 | perf_id: res.data.data.perf_id, |
| 27 | perf_name: res.data.data.perf_name, | 27 | perf_name: res.data.data.perf_name, |
| 28 | can_upload: res.data.data.can_upload, // can_upload :1=可上传,-1=用户没有实名,-2=用户没有儿童表演者 | 28 | can_upload: res.data.data.can_upload, // can_upload :1=可上传,-1=用户没有实名,-2=用户没有儿童表演者 |
| 29 | + // can_upload: -1, // can_upload :1=可上传,-1=用户没有实名,-2=用户没有儿童表演者 | ||
| 29 | } | 30 | } |
| 30 | } else { | 31 | } else { |
| 31 | console.warn(res); | 32 | console.warn(res); |
| ... | @@ -40,6 +41,6 @@ export const useDefaultPerf = (bookId) => { | ... | @@ -40,6 +41,6 @@ export const useDefaultPerf = (bookId) => { |
| 40 | console.error(err); | 41 | console.error(err); |
| 41 | }); | 42 | }); |
| 42 | return { | 43 | return { |
| 43 | - donateItem | 44 | + userInfo |
| 44 | } | 45 | } |
| 45 | } | 46 | } | ... | ... |
| ... | @@ -94,7 +94,7 @@ | ... | @@ -94,7 +94,7 @@ |
| 94 | </div> | 94 | </div> |
| 95 | </notice-overlay> | 95 | </notice-overlay> |
| 96 | 96 | ||
| 97 | - <donate-book :showPopup="showDonate" :item="donateItem" @on-close="closeDonate"></donate-book> | 97 | + <donate-book :showPopup="showDonate" :item="userInfo" @on-close="closeDonate"></donate-book> |
| 98 | 98 | ||
| 99 | <van-overlay :show="show" z-index="9999"> | 99 | <van-overlay :show="show" z-index="9999"> |
| 100 | <div class="wrapper" @click.stop> | 100 | <div class="wrapper" @click.stop> |
| ... | @@ -119,7 +119,7 @@ const $route = useRoute(); | ... | @@ -119,7 +119,7 @@ const $route = useRoute(); |
| 119 | const $router = useRouter(); | 119 | const $router = useRouter(); |
| 120 | 120 | ||
| 121 | const { toggleLanguage, onLoad, columns, prod_list, finished, loading, bookInfo, showPicker, checkLocalism, checkMandarin, onConfirm, chooseLanguage, finishedTextStatus, emptyStatus } = useVideoList($route); | 121 | const { toggleLanguage, onLoad, columns, prod_list, finished, loading, bookInfo, showPicker, checkLocalism, checkMandarin, onConfirm, chooseLanguage, finishedTextStatus, emptyStatus } = useVideoList($route); |
| 122 | -const { donateItem } = useDefaultPerf($route.query.id); | 122 | +const { userInfo } = useDefaultPerf($route.query.id); |
| 123 | 123 | ||
| 124 | // 判断是否显示简介的展开图标 | 124 | // 判断是否显示简介的展开图标 |
| 125 | const hasToggle = ref(false); // 判断是否有展开文字,默认没有 | 125 | const hasToggle = ref(false); // 判断是否有展开文字,默认没有 |
| ... | @@ -195,10 +195,10 @@ const noticeText = ref('') | ... | @@ -195,10 +195,10 @@ const noticeText = ref('') |
| 195 | const noticeHtml = ref('') | 195 | const noticeHtml = ref('') |
| 196 | const show = ref(false); // 跳转等待提示 | 196 | const show = ref(false); // 跳转等待提示 |
| 197 | const uploadVideo = () => { | 197 | const uploadVideo = () => { |
| 198 | - if (donateItem.value.can_upload === 1) { // 可以上传 | 198 | + if (userInfo.value.can_upload === 1) { // 可以上传 |
| 199 | show.value = true; | 199 | show.value = true; |
| 200 | // x_field_1 是金数据表单传入的参数,家长上传的格式为:user_id-book_id-perf_id,perf_id是当前缺省的儿童id | 200 | // x_field_1 是金数据表单传入的参数,家长上传的格式为:user_id-book_id-perf_id,perf_id是当前缺省的儿童id |
| 201 | - const str = `${donateItem.value.user_id}-${$route.query.id}-${donateItem.value.perf_id}`; | 201 | + const str = `${userInfo.value.user_id}-${$route.query.id}-${userInfo.value.perf_id}`; |
| 202 | // 已读隐私条例,直接跳转上传页面 | 202 | // 已读隐私条例,直接跳转上传页面 |
| 203 | if (Cookies.get('privacy_notice')) { | 203 | if (Cookies.get('privacy_notice')) { |
| 204 | location.href = `${JSJ_FORM_C}?x_field_1=${str}`; | 204 | location.href = `${JSJ_FORM_C}?x_field_1=${str}`; |
| ... | @@ -214,14 +214,14 @@ const uploadVideo = () => { | ... | @@ -214,14 +214,14 @@ const uploadVideo = () => { |
| 214 | } | 214 | } |
| 215 | }) | 215 | }) |
| 216 | } | 216 | } |
| 217 | - } else if (donateItem.value.can_upload === -1) { // 未实名认证 | 217 | + } else if (userInfo.value.can_upload === -1) { // 未实名认证 |
| 218 | showNotice.value = true; | 218 | showNotice.value = true; |
| 219 | noticeText.value = '前往认证' | 219 | noticeText.value = '前往认证' |
| 220 | noticeHtml.value = ` | 220 | noticeHtml.value = ` |
| 221 | <p>您还没有实名认证</p> | 221 | <p>您还没有实名认证</p> |
| 222 | <p>请前往个人中心进行实名认证</p> | 222 | <p>请前往个人中心进行实名认证</p> |
| 223 | ` | 223 | ` |
| 224 | - } else if (donateItem.value.can_upload === -2) { // 没有默认儿童 | 224 | + } else if (userInfo.value.can_upload === -2) { // 没有默认儿童 |
| 225 | showNotice.value = true; | 225 | showNotice.value = true; |
| 226 | noticeText.value = '前往新增' | 226 | noticeText.value = '前往新增' |
| 227 | noticeHtml.value = ` | 227 | noticeHtml.value = ` | ... | ... |
| ... | @@ -18,7 +18,7 @@ | ... | @@ -18,7 +18,7 @@ |
| 18 | </div> | 18 | </div> |
| 19 | </div> | 19 | </div> |
| 20 | 20 | ||
| 21 | - <donate-book :showPopup="showDonate" :item="donateItem" @on-close="closeDonate"></donate-book> | 21 | + <donate-book :showPopup="showDonate" :item="userInfo" @on-close="closeDonate"></donate-book> |
| 22 | </template> | 22 | </template> |
| 23 | 23 | ||
| 24 | <script setup> | 24 | <script setup> |
| ... | @@ -38,7 +38,7 @@ const $router = useRouter(); | ... | @@ -38,7 +38,7 @@ const $router = useRouter(); |
| 38 | /*************** 捐书模块START ***************/ | 38 | /*************** 捐书模块START ***************/ |
| 39 | 39 | ||
| 40 | const book_id = $route.query.x_field_1 ? $route.query.x_field_1.split('-')[1] : ''; | 40 | const book_id = $route.query.x_field_1 ? $route.query.x_field_1.split('-')[1] : ''; |
| 41 | -const { donateItem } = useDefaultPerf(book_id); | 41 | +const { userInfo } = useDefaultPerf(book_id); |
| 42 | if (!book_id) { | 42 | if (!book_id) { |
| 43 | Toast.fail('书籍数据不全'); | 43 | Toast.fail('书籍数据不全'); |
| 44 | } | 44 | } |
| ... | @@ -60,7 +60,7 @@ const goBack = () => { | ... | @@ -60,7 +60,7 @@ const goBack = () => { |
| 60 | $router.push({ | 60 | $router.push({ |
| 61 | path: '/client/bookDetail', | 61 | path: '/client/bookDetail', |
| 62 | query: { | 62 | query: { |
| 63 | - id: donateItem.value.book_id | 63 | + id: userInfo.value.book_id |
| 64 | } | 64 | } |
| 65 | }) | 65 | }) |
| 66 | } | 66 | } | ... | ... |
| ... | @@ -25,7 +25,7 @@ | ... | @@ -25,7 +25,7 @@ |
| 25 | <van-tab title="简介" :title-style="tabClass"> | 25 | <van-tab title="简介" :title-style="tabClass"> |
| 26 | <div class="intro">{{ videoInfo.note }}</div> | 26 | <div class="intro">{{ videoInfo.note }}</div> |
| 27 | </van-tab> | 27 | </van-tab> |
| 28 | - <van-tab :title="'留言 ' + comment_num" :title-style="tabClass" :to="'/client/videoDetail/comment?prod_id=' + $route.query.prod_id"> | 28 | + <van-tab :title="'留言 ' + comment_num" :title-style="tabClass" :to="'/client/videoDetail/comment?prod_id=' + $route.query.prod_id + '&book_id=' + $route.query.book_id"> |
| 29 | <router-view></router-view> | 29 | <router-view></router-view> |
| 30 | </van-tab> | 30 | </van-tab> |
| 31 | </van-tabs> | 31 | </van-tabs> | ... | ... |
| ... | @@ -76,12 +76,12 @@ import _ from 'lodash' | ... | @@ -76,12 +76,12 @@ import _ from 'lodash' |
| 76 | import { Toast } from 'vant'; | 76 | import { Toast } from 'vant'; |
| 77 | 77 | ||
| 78 | // 获取是否实名认证 | 78 | // 获取是否实名认证 |
| 79 | -import { idCard } from '@/composables/useValidIdCard.js' | 79 | +import { useDefaultPerf } from '@/composables'; |
| 80 | -const validIdCard = idCard(); | ||
| 81 | 80 | ||
| 82 | const $route = useRoute(); | 81 | const $route = useRoute(); |
| 83 | const $router = useRouter(); | 82 | const $router = useRouter(); |
| 84 | 83 | ||
| 84 | +const { userInfo } = useDefaultPerf($route.query.book_id); | ||
| 85 | 85 | ||
| 86 | /******** 留言列表相关操作 START *******/ | 86 | /******** 留言列表相关操作 START *******/ |
| 87 | const loading = ref(false); | 87 | const loading = ref(false); |
| ... | @@ -188,7 +188,7 @@ const commentType = ref('comment'); // 类型 comment 为评论/类型 reply 为 | ... | @@ -188,7 +188,7 @@ const commentType = ref('comment'); // 类型 comment 为评论/类型 reply 为 |
| 188 | const commentId = ref('') | 188 | const commentId = ref('') |
| 189 | const replayUser = ref('') | 189 | const replayUser = ref('') |
| 190 | const setComment = (v, type) => { | 190 | const setComment = (v, type) => { |
| 191 | - if (validIdCard.can_use.value) { | 191 | + if (userInfo.value.can_upload) { |
| 192 | showCommentBoxPopup.value = true; | 192 | showCommentBoxPopup.value = true; |
| 193 | commentType.value = type; | 193 | commentType.value = type; |
| 194 | replayUser.value = v.name; | 194 | replayUser.value = v.name; | ... | ... |
| ... | @@ -49,13 +49,6 @@ | ... | @@ -49,13 +49,6 @@ |
| 49 | /> | 49 | /> |
| 50 | 50 | ||
| 51 | <comment-box :showPopup="showCommentBoxPopup" :type="commentType" :replayUser="replayUser" @on-submit="submitCommentBox" @on-close="closeCommentBox"></comment-box> | 51 | <comment-box :showPopup="showCommentBoxPopup" :type="commentType" :replayUser="replayUser" @on-submit="submitCommentBox" @on-close="closeCommentBox"></comment-box> |
| 52 | - <!-- 写评论时,如果没有实名认证提示弹框 --> | ||
| 53 | - <notice-overlay :show="showNotice" text="前往认证" @on-submit="onSubmit" @on-close="onClose"> | ||
| 54 | - <div style="color: #333333;"> | ||
| 55 | - <p>您还没有实名认证</p> | ||
| 56 | - <p>请前往个人中心进行实名认证</p> | ||
| 57 | - </div> | ||
| 58 | - </notice-overlay> | ||
| 59 | </template> | 52 | </template> |
| 60 | 53 | ||
| 61 | <script setup> | 54 | <script setup> |
| ... | @@ -64,19 +57,14 @@ import { mainStore } from '@/store' | ... | @@ -64,19 +57,14 @@ import { mainStore } from '@/store' |
| 64 | // import icon_player from '@images/bofang@2x.png' | 57 | // import icon_player from '@images/bofang@2x.png' |
| 65 | import no_image from '@images/que-shuju@2x.png' | 58 | import no_image from '@images/que-shuju@2x.png' |
| 66 | import CommentBox from '@/components/CommentBox/index.vue' | 59 | import CommentBox from '@/components/CommentBox/index.vue' |
| 67 | -import NoticeOverlay from '@/components/NoticeOverlay/index.vue' | ||
| 68 | import icon_avatar from '@images/que-touxiang@2x.png' | 60 | import icon_avatar from '@images/que-touxiang@2x.png' |
| 69 | 61 | ||
| 70 | -import { ref, reactive, onActivated } from 'vue' | 62 | +import { ref, onActivated } from 'vue' |
| 71 | -import { useRoute, useRouter, onBeforeRouteLeave } from 'vue-router' | 63 | +import { useRoute, useRouter } from 'vue-router' |
| 72 | import axios from '@/utils/axios'; | 64 | import axios from '@/utils/axios'; |
| 73 | import _ from 'lodash' | 65 | import _ from 'lodash' |
| 74 | import { Toast } from 'vant'; | 66 | import { Toast } from 'vant'; |
| 75 | 67 | ||
| 76 | -// 获取是否实名认证 | ||
| 77 | -import { idCard } from '@/composables/useValidIdCard.js' | ||
| 78 | -const validIdCard = idCard(); | ||
| 79 | - | ||
| 80 | const $route = useRoute(); | 68 | const $route = useRoute(); |
| 81 | const $router = useRouter(); | 69 | const $router = useRouter(); |
| 82 | 70 | ||
| ... | @@ -133,10 +121,6 @@ const onLoad = () => { | ... | @@ -133,10 +121,6 @@ const onLoad = () => { |
| 133 | // 立即执行一次 | 121 | // 立即执行一次 |
| 134 | // onLoad(); | 122 | // onLoad(); |
| 135 | 123 | ||
| 136 | -const showNotice = ref(false) | ||
| 137 | -const onClose = () => { // 关闭提示框回调 | ||
| 138 | - showNotice.value = false; | ||
| 139 | -} | ||
| 140 | // 跳转个人中心 | 124 | // 跳转个人中心 |
| 141 | const onSubmit = () => { | 125 | const onSubmit = () => { |
| 142 | $router.push({ | 126 | $router.push({ |
| ... | @@ -157,14 +141,10 @@ const commentType = ref('comment'); // 类型 comment 为评论/类型 reply 为 | ... | @@ -157,14 +141,10 @@ const commentType = ref('comment'); // 类型 comment 为评论/类型 reply 为 |
| 157 | const commentId = ref('') | 141 | const commentId = ref('') |
| 158 | const replayUser = ref('') | 142 | const replayUser = ref('') |
| 159 | const setComment = (v, type) => { | 143 | const setComment = (v, type) => { |
| 160 | - if (validIdCard.can_use.value) { | 144 | + showCommentBoxPopup.value = true; |
| 161 | - showCommentBoxPopup.value = true; | 145 | + commentType.value = type; |
| 162 | - commentType.value = type; | 146 | + replayUser.value = v.name; |
| 163 | - replayUser.value = v.name; | 147 | + commentId.value = v.id; |
| 164 | - commentId.value = v.id; | ||
| 165 | - } else { | ||
| 166 | - showNotice.value = true; | ||
| 167 | - } | ||
| 168 | } | 148 | } |
| 169 | 149 | ||
| 170 | /** | 150 | /** | ... | ... |
-
Please register or login to post a comment