hookehuyr

✨ feat(书籍详情页,作品详情页): 新增实名认证和上传作品判断提示

1 <template> 1 <template>
2 <div @click="handle"> 2 <div @click="handle">
3 - <img 3 + <img class="icon-me" referrerpolicy="no-referrer" :src="icon_me" />
4 - class="icon-me"
5 - referrerpolicy="no-referrer"
6 - :src="icon_me"
7 - />
8 </div> 4 </div>
9 </template> 5 </template>
10 6
...@@ -44,7 +40,7 @@ export default { ...@@ -44,7 +40,7 @@ export default {
44 z-index: 169; 40 z-index: 169;
45 position: fixed; 41 position: fixed;
46 right: 2rem; 42 right: 2rem;
47 - bottom: 5rem; 43 + bottom: 15%;
48 width: 44px; 44 width: 44px;
49 height: 44px; 45 height: 44px;
50 } 46 }
......
...@@ -57,12 +57,8 @@ ...@@ -57,12 +57,8 @@
57 </van-col> 57 </van-col>
58 </van-row> 58 </van-row>
59 <van-popup v-model:show="showPicker" round position="bottom"> 59 <van-popup v-model:show="showPicker" round position="bottom">
60 - <van-picker 60 + <van-picker :columns="columns" :columns-field-names="{ text: 'text', value: 'val', children: 'children' }"
61 - :columns="columns" 61 + @cancel="showPicker = false" @confirm="onConfirm" />
62 - :columns-field-names="{ text: 'text', value: 'val', children: 'children' }"
63 - @cancel="showPicker = false"
64 - @confirm="onConfirm"
65 - />
66 </van-popup> 62 </van-popup>
67 </div> 63 </div>
68 </van-sticky> 64 </van-sticky>
...@@ -91,6 +87,26 @@ ...@@ -91,6 +87,26 @@
91 </div> 87 </div>
92 <to-me @on-click="gotoMe()"></to-me> 88 <to-me @on-click="gotoMe()"></to-me>
93 </div> 89 </div>
90 +
91 + <!-- 上传作品时,如果没有实名认证提示弹框 -->
92 + <van-overlay :show="showNotice" z-index="1000">
93 + <div class="wrapper" @click.stop>
94 + <div class="block">
95 + <div>
96 + <van-image width="100" height="100" :src="icon_notice" />
97 + <p style="margin: 1rem; font-size: 1.15rem; font-weight: bold; color: #222222;">温馨提示</p>
98 + </div>
99 + <div style="color: #333333;">
100 + <p>您还没有实名认证</p>
101 + <p>请点击 <van-icon :name="icon_me" /> 进行实名认证</p>
102 + <p>实名认证之后再上传</p>
103 + </div>
104 + <div style="margin: 3rem 0;">
105 + <my-button @on-click="closeNotice" type="primary">返回</my-button>
106 + </div>
107 + </div>
108 + </div>
109 + </van-overlay>
94 </template> 110 </template>
95 111
96 <script setup> 112 <script setup>
...@@ -104,6 +120,8 @@ import icon_up from '@images/icon-guanbi@2x.png' ...@@ -104,6 +120,8 @@ import icon_up from '@images/icon-guanbi@2x.png'
104 import icon_down from '@images/icon-zhankai@2x.png' 120 import icon_down from '@images/icon-zhankai@2x.png'
105 import icon_subscribed from '@images/icon-dingyue01@2x.png' 121 import icon_subscribed from '@images/icon-dingyue01@2x.png'
106 import icon_unsubscribe from '@images/icon-dingyue02@2x.png' 122 import icon_unsubscribe from '@images/icon-dingyue02@2x.png'
123 +import icon_me from '@images/icon-my@2x.png'
124 +import icon_notice from '@images/que-tishi@2x.png'
107 125
108 import ToMe from '@/components/ToMe/index.vue' 126 import ToMe from '@/components/ToMe/index.vue'
109 import tools from '@/common/tool' 127 import tools from '@/common/tool'
...@@ -198,24 +216,30 @@ const onLoad = () => { ...@@ -198,24 +216,30 @@ const onLoad = () => {
198 // 书籍订阅 216 // 书籍订阅
199 let is_subscribe = ref(false); 217 let is_subscribe = ref(false);
200 const onSubscribe = () => { 218 const onSubscribe = () => {
201 - is_subscribe.value = !is_subscribe.value 219 + is_subscribe.value = !is_subscribe.value
202 } 220 }
203 221
204 // 爱心捐书 222 // 爱心捐书
205 const payFor = () => { 223 const payFor = () => {
206 - console.warn('弹出框'); 224 + console.warn('弹出框');
207 } 225 }
208 226
209 // 上传作品 227 // 上传作品
228 +const showNotice = ref(false)
229 +const closeNotice = () => {
230 + showNotice.value = false;
231 +}
210 const uploadVideo = () => { 232 const uploadVideo = () => {
211 - console.warn('跳转页面'); 233 + // 如果没有实名认证需要提示用户实名认证
234 + showNotice.value = true;
235 + // 实名认证之后直接跳转上传页面
212 } 236 }
213 </script> 237 </script>
214 238
215 <script> 239 <script>
216 import mixin from 'common/mixin'; 240 import mixin from 'common/mixin';
217 241
218 -function transCaseList (url, pic) { 242 +function transCaseList(url, pic) {
219 return { url, pic } 243 return { url, pic }
220 } 244 }
221 245
...@@ -230,7 +254,7 @@ export default { ...@@ -230,7 +254,7 @@ export default {
230 this.getList() 254 this.getList()
231 }, 255 },
232 methods: { 256 methods: {
233 - getList () { 257 + getList() {
234 _.each(this.dataList, item => { 258 _.each(this.dataList, item => {
235 let video = item.video && item.video.url ? item.video.url : 'http://static.smartisanos.cn/common/video/t1-ui.mp4'; 259 let video = item.video && item.video.url ? item.video.url : 'http://static.smartisanos.cn/common/video/t1-ui.mp4';
236 let cover = item.cover && item.cover.url ? item.cover.url : 'http://static.smartisanos.cn/pr/img/video/video_03_cc87ce5bdb.jpg'; 260 let cover = item.cover && item.cover.url ? item.cover.url : 'http://static.smartisanos.cn/pr/img/video/video_03_cc87ce5bdb.jpg';
...@@ -285,6 +309,7 @@ export default { ...@@ -285,6 +309,7 @@ export default {
285 .book-video-language { 309 .book-video-language {
286 padding: 1rem; 310 padding: 1rem;
287 background-color: white; 311 background-color: white;
312 +
288 .uncheck { 313 .uncheck {
289 background: #F7F7F7; 314 background: #F7F7F7;
290 border-radius: 15px; 315 border-radius: 15px;
...@@ -361,4 +386,21 @@ export default { ...@@ -361,4 +386,21 @@ export default {
361 } 386 }
362 } 387 }
363 } 388 }
389 +
390 +.wrapper {
391 + display: flex;
392 + align-items: center;
393 + justify-content: center;
394 + height: 100%;
395 + width: auto;
396 + text-align: center;
397 +}
398 +
399 +.block {
400 + width: 80%;
401 + // height: 25rem;
402 + background-color: #fff;
403 + border-radius: 10px;
404 + padding: 1rem;
405 +}
364 </style> 406 </style>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -75,7 +75,7 @@ const data_video = reactive({ ...@@ -75,7 +75,7 @@ const data_video = reactive({
75 "collected": false 75 "collected": false
76 }) 76 })
77 77
78 -const active = ref(1); // index 0 为简介,1 为留言 78 +const active = ref(0); // index 0 为简介,1 为留言
79 const onClickTab = ({ title }) => { 79 const onClickTab = ({ title }) => {
80 console.warn(title); 80 console.warn(title);
81 }; 81 };
...@@ -103,7 +103,6 @@ export default { ...@@ -103,7 +103,6 @@ export default {
103 } 103 }
104 }, 104 },
105 mounted() { 105 mounted() {
106 -
107 }, 106 },
108 methods: { 107 methods: {
109 108
......
...@@ -46,11 +46,35 @@ ...@@ -46,11 +46,35 @@
46 </div> 46 </div>
47 <comment-list :showPopup="showCommentListPopup" @on-close="closeCommentList"></comment-list> 47 <comment-list :showPopup="showCommentListPopup" @on-close="closeCommentList"></comment-list>
48 <comment-box :showPopup="showCommentBoxPopup" :type="commentType" @on-close="closeCommentBox"></comment-box> 48 <comment-box :showPopup="showCommentBoxPopup" :type="commentType" @on-close="closeCommentBox"></comment-box>
49 +
50 + <!-- 写评论时,如果没有上传作品提示弹框 -->
51 + <van-overlay :show="showNotice" z-index="1000">
52 + <div class="wrapper" @click.stop>
53 + <div class="block">
54 + <div>
55 + <van-image width="100" height="100" :src="icon_notice" />
56 + <p style="margin: 1rem; font-size: 1.15rem; font-weight: bold; color: #222222;">温馨提示</p>
57 + </div>
58 + <div style="color: #333333;">
59 + <p>您还没有上传作品</p>
60 + <p>请返回书籍详情页,点击 <span style="font-weight: bold; color: #713610;">上传作品</span> 按钮</p>
61 + <p>上传之后再留言</p>
62 + </div>
63 + <div style="margin: 3rem 0;">
64 + <my-button @on-click="closeNotice" type="primary">返回</my-button>
65 + </div>
66 + </div>
67 + </div>
68 + </van-overlay>
49 </template> 69 </template>
50 70
51 <script setup> 71 <script setup>
52 import CommentList from '@/components/CommentList/index.vue' 72 import CommentList from '@/components/CommentList/index.vue'
53 import CommentBox from '@/components/CommentBox/index.vue' 73 import CommentBox from '@/components/CommentBox/index.vue'
74 +import MyButton from '@/components/MyButton/index.vue'
75 +
76 +import icon_me from '@images/icon-my@2x.png'
77 +import icon_notice from '@images/que-tishi@2x.png'
54 78
55 import { ref, reactive, onMounted } from 'vue' 79 import { ref, reactive, onMounted } from 'vue'
56 import { useRoute, useRouter } from 'vue-router' 80 import { useRoute, useRouter } from 'vue-router'
...@@ -94,9 +118,22 @@ const closeCommentList = (v) => { // 查看更多回复 ...@@ -94,9 +118,22 @@ const closeCommentList = (v) => { // 查看更多回复
94 // 回复评论控件 118 // 回复评论控件
95 const showCommentBoxPopup = ref(false); 119 const showCommentBoxPopup = ref(false);
96 const commentType = ref('comment'); // 类型 comment 为评论/类型 reply 为回复 120 const commentType = ref('comment'); // 类型 comment 为评论/类型 reply 为回复
121 +const showNotice = ref(false)
122 +const closeNotice = () => { // 关闭提示框回调
123 + showNotice.value = false;
124 + $router.push({
125 + path: '/client/bookDetail'
126 + });
127 +}
128 +const flag = false; // 后台接口判断是否上传过作品
129 +// 实际调试时,点击回复需要判断是否上传过作品
97 const setComment = (v, type) => { // 回复/评论 130 const setComment = (v, type) => { // 回复/评论
98 - showCommentBoxPopup.value = true; 131 + if (flag) {
99 - commentType.value = type; 132 + showCommentBoxPopup.value = true;
133 + commentType.value = type;
134 + } else {
135 + showNotice.value = true;
136 + }
100 } 137 }
101 const closeCommentBox = (v) => { // 查看更多回复 138 const closeCommentBox = (v) => { // 查看更多回复
102 showCommentBoxPopup.value = v; 139 showCommentBoxPopup.value = v;
...@@ -164,4 +201,21 @@ export default { ...@@ -164,4 +201,21 @@ export default {
164 box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.06); 201 box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.06);
165 } 202 }
166 } 203 }
204 +
205 +.wrapper {
206 + display: flex;
207 + align-items: center;
208 + justify-content: center;
209 + height: 100%;
210 + width: auto;
211 + text-align: center;
212 +}
213 +
214 +.block {
215 + width: 80%;
216 + // height: 25rem;
217 + background-color: #fff;
218 + border-radius: 10px;
219 + padding: 1rem;
220 +}
167 </style> 221 </style>
...\ No newline at end of file ...\ No newline at end of file
......