hookehuyr

fix

...@@ -37,6 +37,7 @@ export default { ...@@ -37,6 +37,7 @@ export default {
37 } 37 }
38 } 38 }
39 } else { 39 } else {
40 + // tslint:disable-next-line: no-console
40 console.warn(res); 41 console.warn(res);
41 Toast({ 42 Toast({
42 icon: 'close', 43 icon: 'close',
...@@ -45,6 +46,7 @@ export default { ...@@ -45,6 +46,7 @@ export default {
45 } 46 }
46 }) 47 })
47 .catch(err => { 48 .catch(err => {
49 + // tslint:disable-next-line: no-console
48 console.error(err); 50 console.error(err);
49 }); 51 });
50 }, 52 },
...@@ -59,6 +61,7 @@ export default { ...@@ -59,6 +61,7 @@ export default {
59 this.detail[`is_${type}`] = res.data.data[`is_${type}`]; 61 this.detail[`is_${type}`] = res.data.data[`is_${type}`];
60 this.detail[`${type}_num`] = res.data.data[`${type}_num`]; 62 this.detail[`${type}_num`] = res.data.data[`${type}_num`];
61 } else { 63 } else {
64 + // tslint:disable-next-line: no-console
62 console.warn(res); 65 console.warn(res);
63 Toast({ 66 Toast({
64 icon: 'close', 67 icon: 'close',
...@@ -67,6 +70,7 @@ export default { ...@@ -67,6 +70,7 @@ export default {
67 } 70 }
68 }) 71 })
69 .catch(err => { 72 .catch(err => {
73 + // tslint:disable-next-line: no-console
70 console.error(err); 74 console.error(err);
71 }); 75 });
72 } 76 }
......
...@@ -120,15 +120,15 @@ const $router = useRouter(); ...@@ -120,15 +120,15 @@ const $router = useRouter();
120 120
121 const { toggleLanguage, onLoad, columns, prod_list, finished, loading, bookInfo, showPicker, checkLocalism, checkMandarin, onConfirm, chooseLanguage } = useVideoList($route); 121 const { toggleLanguage, onLoad, columns, prod_list, finished, loading, bookInfo, showPicker, checkLocalism, checkMandarin, onConfirm, chooseLanguage } = useVideoList($route);
122 122
123 -const gotoMe = () => {
124 - console.warn('跳转我的地址');
125 -}
126 -
127 // 判断是否显示简介的展开图标 123 // 判断是否显示简介的展开图标
128 const hasToggle = ref(false); // 判断是否有展开文字,默认没有 124 const hasToggle = ref(false); // 判断是否有展开文字,默认没有
129 const isToggle = ref(true); // 判断展开状态,默认展开 125 const isToggle = ref(true); // 判断展开状态,默认展开
130 126
131 -const onToggle = (v) => { // 展开/折叠 127 +/**
128 + * 展开/折叠
129 + * @param {*} v
130 + */
131 +const onToggle = (v) => {
132 isToggle.value = v 132 isToggle.value = v
133 } 133 }
134 134
...@@ -146,38 +146,34 @@ const onSubscribe = () => { ...@@ -146,38 +146,34 @@ const onSubscribe = () => {
146 axios.post('/srv/?a=add_subscribe', { 146 axios.post('/srv/?a=add_subscribe', {
147 book_id: $route.query.id 147 book_id: $route.query.id
148 }) 148 })
149 - .then(res => { 149 + .then(res => {
150 - if (res.data.code === 1) { 150 + if (res.data.code === 1) {
151 - if (res.data.msg === 'add subscribe OK') { 151 + if (res.data.msg === 'add subscribe OK') {
152 - bookInfo.value.is_subscribe = true; 152 + bookInfo.value.is_subscribe = true;
153 - Toast.success('订阅成功') 153 + Toast.success('订阅成功')
154 + } else {
155 + bookInfo.value.is_subscribe = false;
156 + Toast.success('取消订阅')
157 + }
154 } else { 158 } else {
155 - bookInfo.value.is_subscribe = false; 159 + console.warn(res);
156 - Toast.success('取消订阅') 160 + Toast({
161 + icon: 'close',
162 + message: res.data.msg
163 + });
157 } 164 }
158 - } else { 165 + })
159 - console.warn(res); 166 + .catch(err => {
160 - Toast({ 167 + console.error(err);
161 - icon: 'close', 168 + })
162 - message: res.data.msg
163 - });
164 - }
165 - })
166 - .catch(err => {
167 - console.error(err);
168 - })
169 } 169 }
170 170
171 // 爱心捐书 171 // 爱心捐书
172 +// TODO: 需要联调捐书接口
172 const payFor = () => { 173 const payFor = () => {
173 console.warn('弹出框'); 174 console.warn('弹出框');
174 } 175 }
175 176
176 -// 未实名认证提示
177 -const showNotice = ref(false)
178 -const onClose = () => { // 关闭提示框回调
179 - showNotice.value = false;
180 -}
181 // 跳转个人中心 177 // 跳转个人中心
182 const onSubmit = () => { 178 const onSubmit = () => {
183 $router.push({ 179 $router.push({
...@@ -188,35 +184,42 @@ const onSubmit = () => { ...@@ -188,35 +184,42 @@ const onSubmit = () => {
188 /** 184 /**
189 * 上传作品回调 185 * 上传作品回调
190 */ 186 */
187 +
188 +// 未实名认证提示
189 +const showNotice = ref(false)
190 +const onClose = () => { // 关闭提示框回调
191 + showNotice.value = false;
192 +}
193 +
191 const uploadVideo = () => { 194 const uploadVideo = () => {
192 axios.get('/srv/?a=can_upload') 195 axios.get('/srv/?a=can_upload')
193 - .then(res => { 196 + .then(res => {
194 - if (res.data.code === 1) { 197 + if (res.data.code === 1) {
195 - if (res.data.data.can_upload) { 198 + // 实名认证标识
196 - // TODO: 上传视频直接跳转?不需要表示判断是上传哪个幼儿园吗? 199 + if (res.data.data.can_upload) {
197 - // 实名认证之后直接跳转上传页面 200 + // TODO: 上传视频直接跳转?不需要表示判断是上传哪个幼儿园吗?
198 - if (Cookies.get('privacy_notice')) { // 已读隐私条例,直接跳转上传页面 201 + if (Cookies.get('privacy_notice')) { // 已读隐私条例,直接跳转上传页面
199 - location.href = 'https://jinshuju.net/f/NAGn1D'; 202 + location.href = 'https://jinshuju.net/f/NAGn1D';
203 + } else {
204 + $router.push({
205 + path: '/client/privacyNotice'
206 + })
207 + }
200 } else { 208 } else {
201 - $router.push({ 209 + // 如果没有实名认证需要提示用户实名认证
202 - path: '/client/privacyNotice' 210 + showNotice.value = true;
203 - })
204 } 211 }
205 } else { 212 } else {
206 - // 如果没有实名认证需要提示用户实名认证 213 + console.warn(res);
207 - showNotice.value = true; 214 + Toast({
215 + icon: 'close',
216 + message: res.data.msg
217 + });
208 } 218 }
209 - } else { 219 + })
210 - console.warn(res); 220 + .catch(err => {
211 - Toast({ 221 + console.error(err);
212 - icon: 'close', 222 + })
213 - message: res.data.msg
214 - });
215 - }
216 - })
217 - .catch(err => {
218 - console.error(err);
219 - })
220 } 223 }
221 </script> 224 </script>
222 225
...@@ -372,4 +375,4 @@ export default { ...@@ -372,4 +375,4 @@ export default {
372 margin-top: 1rem; 375 margin-top: 1rem;
373 margin-bottom: 5rem; 376 margin-bottom: 5rem;
374 } 377 }
375 -</style>
...\ No newline at end of file ...\ No newline at end of file
378 +</style>
......