hookehuyr

🐞 fix: 修改Toast组件的引用方式

...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
26 "mui-player": "^1.6.0", 26 "mui-player": "^1.6.0",
27 "typescript": "^4.7.3", 27 "typescript": "^4.7.3",
28 "uuid": "^8.3.2", 28 "uuid": "^8.3.2",
29 - "vant": "^4.0.0-alpha.3", 29 + "vant": "^4.9.9",
30 "vconsole": "^3.14.6", 30 "vconsole": "^3.14.6",
31 "vite-plugin-dynamic-import": "^0.9.6", 31 "vite-plugin-dynamic-import": "^0.9.6",
32 "vite-plugin-mp": "^1.6.1", 32 "vite-plugin-mp": "^1.6.1",
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
51 "qs": "^6.10.3", 51 "qs": "^6.10.3",
52 "tslint": "^6.1.3", 52 "tslint": "^6.1.3",
53 "unplugin-auto-import": "^0.8.8", 53 "unplugin-auto-import": "^0.8.8",
54 + "unplugin-vue-components": "^0.27.4",
54 "unplugin-vue-define-options": "^0.6.1", 55 "unplugin-vue-define-options": "^0.6.1",
55 "vite": "^2.9.9", 56 "vite": "^2.9.9",
56 "vite-plugin-style-import": "1.4.1", 57 "vite-plugin-style-import": "1.4.1",
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
19 import { mainStore, useTitle } from '@/utils/generatePackage' 19 import { mainStore, useTitle } from '@/utils/generatePackage'
20 import { computed, watchEffect, onMounted } from 'vue'; 20 import { computed, watchEffect, onMounted } from 'vue';
21 import { useRoute } from 'vue-router' 21 import { useRoute } from 'vue-router'
22 -import { Toast } from 'vant'; 22 +import { showSuccessToast, showFailToast } from 'vant';
23 // 会根据配置判断是否显示调试控件 23 // 会根据配置判断是否显示调试控件
24 // eslint-disable-next-line no-unused-vars 24 // eslint-disable-next-line no-unused-vars
25 import vConsole from '@/utils/vconsole' 25 import vConsole from '@/utils/vconsole'
......
1 /* 1 /*
2 * @Date: 2022-05-18 22:56:08 2 * @Date: 2022-05-18 22:56:08
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2022-07-05 23:27:51 4 + * @LastEditTime: 2024-11-26 12:47:58
5 * @FilePath: /tswj/src/api/fn.js 5 * @FilePath: /tswj/src/api/fn.js
6 * @Description: 文件描述 6 * @Description: 文件描述
7 */ 7 */
8 import axios from '@/utils/axios'; 8 import axios from '@/utils/axios';
9 -import { Toast } from 'vant'; 9 +import { showToast } from 'vant';
10 import qs from 'Qs' 10 import qs from 'Qs'
11 11
12 /** 12 /**
...@@ -23,7 +23,7 @@ export const fn = (api) => { ...@@ -23,7 +23,7 @@ export const fn = (api) => {
23 // tslint:disable-next-line: no-console 23 // tslint:disable-next-line: no-console
24 console.warn(res); 24 console.warn(res);
25 if (!res.data.show) return false; 25 if (!res.data.show) return false;
26 - Toast({ 26 + showToast({
27 icon: 'close', 27 icon: 'close',
28 message: res.data.msg 28 message: res.data.msg
29 }); 29 });
...@@ -41,8 +41,8 @@ export const fn = (api) => { ...@@ -41,8 +41,8 @@ export const fn = (api) => {
41 41
42 /** 42 /**
43 * 七牛返回格式 43 * 七牛返回格式
44 - * @param {*} api 44 + * @param {*} api
45 - * @returns 45 + * @returns
46 */ 46 */
47 export const uploadFn = (api) => { 47 export const uploadFn = (api) => {
48 return api 48 return api
......
1 +/*
2 + * @Date: 2024-05-15 10:28:10
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2024-11-26 12:49:10
5 + * @FilePath: /tswj/src/common/mixin.js
6 + * @Description: 文件描述
7 + */
1 import axios from 'axios'; 8 import axios from 'axios';
2 -import { Toast } from 'vant'; 9 +import { showToast, showSuccessToast } from 'vant';
3 10
4 export default { 11 export default {
5 // 初始化设置 12 // 初始化设置
...@@ -25,22 +32,22 @@ export default { ...@@ -25,22 +32,22 @@ export default {
25 if (res.data.msg === `${type}-add-OK`) { // 动作操作成功 32 if (res.data.msg === `${type}-add-OK`) { // 动作操作成功
26 this.getProductDetail(type, id); 33 this.getProductDetail(type, id);
27 if (type === 'favor') { 34 if (type === 'favor') {
28 - Toast('收藏成功'); 35 + showSuccessToast('收藏成功');
29 } 36 }
30 if (type === 'like') { 37 if (type === 'like') {
31 - Toast('点赞成功'); 38 + showSuccessToast('点赞成功');
32 } 39 }
33 } else { // 取消操作 40 } else { // 取消操作
34 this.getProductDetail(type, id); 41 this.getProductDetail(type, id);
35 if (type !== 'play') { 42 if (type !== 'play') {
36 - Toast('取消成功'); 43 + showSuccessToast('取消成功');
37 } 44 }
38 } 45 }
39 } else { 46 } else {
40 // tslint:disable-next-line: no-console 47 // tslint:disable-next-line: no-console
41 console.warn(res); 48 console.warn(res);
42 if (!res.data.show) return false; 49 if (!res.data.show) return false;
43 - Toast({ 50 + showToast({
44 icon: 'close', 51 icon: 'close',
45 message: res.data.msg 52 message: res.data.msg
46 }); 53 });
...@@ -48,7 +55,7 @@ export default { ...@@ -48,7 +55,7 @@ export default {
48 }) 55 })
49 .catch(err => { 56 .catch(err => {
50 // tslint:disable-next-line: no-console 57 // tslint:disable-next-line: no-console
51 - console.error(err); 58 + console.error(err);
52 }); 59 });
53 }, 60 },
54 getProductDetail (type, id) { // 查询更新作品详情 61 getProductDetail (type, id) { // 查询更新作品详情
...@@ -65,7 +72,7 @@ export default { ...@@ -65,7 +72,7 @@ export default {
65 // tslint:disable-next-line: no-console 72 // tslint:disable-next-line: no-console
66 console.warn(res); 73 console.warn(res);
67 if (!res.data.show) return false; 74 if (!res.data.show) return false;
68 - Toast({ 75 + showToast({
69 icon: 'close', 76 icon: 'close',
70 message: res.data.msg 77 message: res.data.msg
71 }); 78 });
...@@ -73,7 +80,7 @@ export default { ...@@ -73,7 +80,7 @@ export default {
73 }) 80 })
74 .catch(err => { 81 .catch(err => {
75 // tslint:disable-next-line: no-console 82 // tslint:disable-next-line: no-console
76 - console.error(err); 83 + console.error(err);
77 }); 84 });
78 } 85 }
79 } 86 }
......
...@@ -114,7 +114,7 @@ import _ from 'lodash'; ...@@ -114,7 +114,7 @@ import _ from 'lodash';
114 import tools from '@/common/tool' 114 import tools from '@/common/tool'
115 import { styleColor } from '@/constant.js'; 115 import { styleColor } from '@/constant.js';
116 116
117 -import { Toast } from 'vant'; 117 +import { showSuccessToast, showFailToast } from 'vant';
118 import { DEFAULT_COVER } from '@/constant' 118 import { DEFAULT_COVER } from '@/constant'
119 119
120 const props = defineProps({ 120 const props = defineProps({
...@@ -162,7 +162,7 @@ const onRefuse = () => { // 不通过审核 ...@@ -162,7 +162,7 @@ const onRefuse = () => { // 不通过审核
162 const handleAudit = async (status) => { 162 const handleAudit = async (status) => {
163 const { code } = await checkProdAPI({ prod_id: props.item.id, status, check_note: message.value, }) 163 const { code } = await checkProdAPI({ prod_id: props.item.id, status, check_note: message.value, })
164 if (code === 1) { 164 if (code === 1) {
165 - Toast.success('操作成功'); 165 + showSuccessToast('操作成功');
166 message.value = ''; 166 message.value = '';
167 showNotice.value = false; 167 showNotice.value = false;
168 show.value = false; 168 show.value = false;
...@@ -291,15 +291,15 @@ export default { ...@@ -291,15 +291,15 @@ export default {
291 .book-handle { 291 .book-handle {
292 padding: 0 1rem; 292 padding: 0 1rem;
293 .disagree-btn { 293 .disagree-btn {
294 - background: #B4B4B3; 294 + background: #B4B4B3;
295 - border-radius: 15px; 295 + border-radius: 15px;
296 - color: #FFFFFF; 296 + color: #FFFFFF;
297 padding: 0.25rem 0.8rem; 297 padding: 0.25rem 0.8rem;
298 } 298 }
299 .agree-btn { 299 .agree-btn {
300 - background: @base-color; 300 + background: @base-color;
301 - border-radius: 15px; 301 + border-radius: 15px;
302 - color: @base-font-color; 302 + color: @base-font-color;
303 padding: 0.25rem 1.5rem; 303 padding: 0.25rem 1.5rem;
304 } 304 }
305 } 305 }
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
38 38
39 <script setup> 39 <script setup>
40 import icon_y from '@images/y.png' 40 import icon_y from '@images/y.png'
41 -import { Toast } from 'vant'; 41 +import { showSuccessToast, showFailToast } from 'vant';
42 42
43 import { ref, watch } from 'vue' 43 import { ref, watch } from 'vue'
44 44
...@@ -64,7 +64,7 @@ const submitComment = () => { ...@@ -64,7 +64,7 @@ const submitComment = () => {
64 emit('on-submit', message.value); 64 emit('on-submit', message.value);
65 message.value = ''; 65 message.value = '';
66 } else { 66 } else {
67 - Toast.fail('留言不能为空'); 67 + showFailToast('留言不能为空');
68 } 68 }
69 } 69 }
70 70
......
...@@ -66,7 +66,7 @@ import { useRoute, useRouter } from 'vue-router' ...@@ -66,7 +66,7 @@ import { useRoute, useRouter } from 'vue-router'
66 66
67 import axios from '@/utils/axios'; 67 import axios from '@/utils/axios';
68 import _ from 'lodash' 68 import _ from 'lodash'
69 -import { Toast } from 'vant'; 69 +import { showSuccessToast, showFailToast } from 'vant';
70 70
71 import { ref, watch } from 'vue' 71 import { ref, watch } from 'vue'
72 // 获取是否实名认证 72 // 获取是否实名认证
...@@ -136,7 +136,7 @@ const submitCommentBox = (note) => { ...@@ -136,7 +136,7 @@ const submitCommentBox = (note) => {
136 .then(res => { 136 .then(res => {
137 showCommentBoxPopup.value = false; 137 showCommentBoxPopup.value = false;
138 if (res.data.code === 1) { 138 if (res.data.code === 1) {
139 - Toast.success('发布成功') 139 + showSuccessToast('发布成功')
140 onReload() 140 onReload()
141 } else { 141 } else {
142 console.warn(res); 142 console.warn(res);
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
2 * @Author: hookehuyr hookehuyr@gmail.com 2 * @Author: hookehuyr hookehuyr@gmail.com
3 * @Date: 2022-05-23 14:33:37 3 * @Date: 2022-05-23 14:33:37
4 * @LastEditors: hookehuyr hookehuyr@gmail.com 4 * @LastEditors: hookehuyr hookehuyr@gmail.com
5 - * @LastEditTime: 2022-06-02 13:14:23 5 + * @LastEditTime: 2024-11-26 12:49:30
6 * @FilePath: /tswj/src/components/MuiVideo/methods.js 6 * @FilePath: /tswj/src/components/MuiVideo/methods.js
7 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE 7 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
8 */ 8 */
9 import { prodActionAPI } from '@/api/C/prod.js' 9 import { prodActionAPI } from '@/api/C/prod.js'
10 -import { Toast } from 'vant'; 10 +import { showSuccessToast } from 'vant';
11 11
12 export const goToDetail = ({ id, book_id, type, perf_id }, $router) => { 12 export const goToDetail = ({ id, book_id, type, perf_id }, $router) => {
13 $router.push({ 13 $router.push({
...@@ -35,14 +35,14 @@ export const prodAction = async (action_type, prod_id) => { ...@@ -35,14 +35,14 @@ export const prodAction = async (action_type, prod_id) => {
35 const { msg } = await prodActionAPI({ action_type, prod_id }); 35 const { msg } = await prodActionAPI({ action_type, prod_id });
36 if (msg === `${action_type}-add-OK`) { // 动作操作成功 36 if (msg === `${action_type}-add-OK`) { // 动作操作成功
37 if (action_type === 'favor') { 37 if (action_type === 'favor') {
38 - Toast('收藏成功'); 38 + showSuccessToast('收藏成功');
39 } 39 }
40 if (action_type === 'like') { 40 if (action_type === 'like') {
41 - Toast('点赞成功'); 41 + showSuccessToast('点赞成功');
42 } 42 }
43 } else { // 取消操作 43 } else { // 取消操作
44 if (action_type !== 'play') { 44 if (action_type !== 'play') {
45 - Toast('取消成功'); 45 + showSuccessToast('取消成功');
46 } 46 }
47 } 47 }
48 return true; 48 return true;
......
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
2 * @Author: hookehuyr hookehuyr@gmail.com 2 * @Author: hookehuyr hookehuyr@gmail.com
3 * @Date: 2022-05-07 17:46:54 3 * @Date: 2022-05-07 17:46:54
4 * @LastEditors: hookehuyr hookehuyr@gmail.com 4 * @LastEditors: hookehuyr hookehuyr@gmail.com
5 - * @LastEditTime: 2022-06-12 22:55:58 5 + * @LastEditTime: 2024-11-26 12:49:46
6 * @FilePath: /tswj/src/composables/useBookList.js 6 * @FilePath: /tswj/src/composables/useBookList.js
7 - * @Description: 7 + * @Description:
8 */ 8 */
9 import { ref } from 'vue' 9 import { ref } from 'vue'
10 import axios from '@/utils/axios'; 10 import axios from '@/utils/axios';
11 -import { Toast } from 'vant'; 11 +import { showToast } from 'vant';
12 import { useRoute } from 'vue-router'; 12 import { useRoute } from 'vue-router';
13 import { kgBookListAPI } from '@/api/C/kg' 13 import { kgBookListAPI } from '@/api/C/kg'
14 14
...@@ -47,7 +47,7 @@ export const useBookList = () => { ...@@ -47,7 +47,7 @@ export const useBookList = () => {
47 // tslint:disable-next-line: no-console 47 // tslint:disable-next-line: no-console
48 console.warn(res); 48 console.warn(res);
49 if (!res.data.show) return false; 49 if (!res.data.show) return false;
50 - Toast({ 50 + showToast({
51 icon: 'close', 51 icon: 'close',
52 message: res.data.msg 52 message: res.data.msg
53 }); 53 });
...@@ -74,7 +74,7 @@ export const useBookList = () => { ...@@ -74,7 +74,7 @@ export const useBookList = () => {
74 // tslint:disable-next-line: no-console 74 // tslint:disable-next-line: no-console
75 console.warn(res); 75 console.warn(res);
76 if (!res.data.show) return false; 76 if (!res.data.show) return false;
77 - Toast({ 77 + showToast({
78 icon: 'close', 78 icon: 'close',
79 message: res.data.msg 79 message: res.data.msg
80 }); 80 });
......
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
4 * @LastEditors: hookehuyr hookehuyr@gmail.com 4 * @LastEditors: hookehuyr hookehuyr@gmail.com
5 * @LastEditTime: 2022-05-30 10:18:19 5 * @LastEditTime: 2022-05-30 10:18:19
6 * @FilePath: /tswj/src/composables/useDefaultPerf.js 6 * @FilePath: /tswj/src/composables/useDefaultPerf.js
7 - * @Description: 7 + * @Description:
8 */ 8 */
9 import { ref } from 'vue' 9 import { ref } from 'vue'
10 import axios from '@/utils/axios'; 10 import axios from '@/utils/axios';
11 -import { Toast } from 'vant'; 11 +import { showToast } from 'vant';
12 12
13 /** 13 /**
14 * @description: 获取默认儿童信息 14 * @description: 获取默认儿童信息
...@@ -51,7 +51,7 @@ export const useDefaultPerf = (bookId) => { ...@@ -51,7 +51,7 @@ export const useDefaultPerf = (bookId) => {
51 } else { 51 } else {
52 console.warn(res); 52 console.warn(res);
53 if (!res.data.show) return false; 53 if (!res.data.show) return false;
54 - Toast({ 54 + showToast({
55 icon: 'close', 55 icon: 'close',
56 message: res.data.msg 56 message: res.data.msg
57 }); 57 });
......
1 import { ref } from 'vue' 1 import { ref } from 'vue'
2 import axios from '@/utils/axios'; 2 import axios from '@/utils/axios';
3 import _ from 'lodash' 3 import _ from 'lodash'
4 -import { Toast } from 'vant'; 4 +import { showToast } from 'vant';
5 5
6 export const useUnwatchList = () => { 6 export const useUnwatchList = () => {
7 // 绑定页面数据 7 // 绑定页面数据
...@@ -51,7 +51,7 @@ export const useUnwatchList = () => { ...@@ -51,7 +51,7 @@ export const useUnwatchList = () => {
51 // tslint:disable-next-line: no-console 51 // tslint:disable-next-line: no-console
52 console.warn(res); 52 console.warn(res);
53 if (!res.data.show) return false; 53 if (!res.data.show) return false;
54 - Toast({ 54 + showToast({
55 icon: 'close', 55 icon: 'close',
56 message: res.data.msg 56 message: res.data.msg
57 }); 57 });
......
1 +/*
2 + * @Date: 2024-05-15 10:28:10
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2024-11-26 12:50:03
5 + * @FilePath: /tswj/src/composables/useValidIdCard.js
6 + * @Description: 文件描述
7 + */
1 import { ref } from 'vue' 8 import { ref } from 'vue'
2 import axios from '@/utils/axios'; 9 import axios from '@/utils/axios';
3 -import { Toast } from 'vant'; 10 +import { showToast } from 'vant';
4 11
5 export const idCard = () => { 12 export const idCard = () => {
6 /** 13 /**
...@@ -14,7 +21,7 @@ export const idCard = () => { ...@@ -14,7 +21,7 @@ export const idCard = () => {
14 } else { 21 } else {
15 console.warn(res); 22 console.warn(res);
16 if (!res.data.show) return false; 23 if (!res.data.show) return false;
17 - Toast({ 24 + showToast({
18 icon: 'close', 25 icon: 'close',
19 message: res.data.msg 26 message: res.data.msg
20 }); 27 });
......
1 /* 1 /*
2 * @Date: 2022-05-05 18:07:16 2 * @Date: 2022-05-05 18:07:16
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2022-10-01 21:13:07 4 + * @LastEditTime: 2024-11-26 12:50:17
5 * @FilePath: /tswj/src/composables/useVideoList.js 5 * @FilePath: /tswj/src/composables/useVideoList.js
6 * @Description: 文件描述 6 * @Description: 文件描述
7 */ 7 */
8 import { ref } from 'vue' 8 import { ref } from 'vue'
9 import axios from '@/utils/axios'; 9 import axios from '@/utils/axios';
10 import _ from 'lodash' 10 import _ from 'lodash'
11 -import { Toast } from 'vant'; 11 +import { showToast } from 'vant';
12 import { useRoute } from 'vue-router' 12 import { useRoute } from 'vue-router'
13 import { bookInfoAPI } from '@/api/C/book' 13 import { bookInfoAPI } from '@/api/C/book'
14 import { flowFn } from '@/hooks/useFlowFn' 14 import { flowFn } from '@/hooks/useFlowFn'
...@@ -62,7 +62,7 @@ export const useVideoList = () => { ...@@ -62,7 +62,7 @@ export const useVideoList = () => {
62 // tslint:disable-next-line: no-console 62 // tslint:disable-next-line: no-console
63 console.warn(res); 63 console.warn(res);
64 if (!res.data.show) return false; 64 if (!res.data.show) return false;
65 - Toast({ 65 + showToast({
66 icon: 'close', 66 icon: 'close',
67 message: res.data.msg 67 message: res.data.msg
68 }); 68 });
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
4 * @LastEditors: hookehuyr hookehuyr@gmail.com 4 * @LastEditors: hookehuyr hookehuyr@gmail.com
5 * @LastEditTime: 2022-06-29 22:00:37 5 * @LastEditTime: 2022-06-29 22:00:37
6 * @FilePath: /tswj/src/main.js 6 * @FilePath: /tswj/src/main.js
7 - * @Description: 7 + * @Description:
8 */ 8 */
9 import { createApp } from 'vue'; 9 import { createApp } from 'vue';
10 import { Button, Image as VanImage, Col, Row, Icon, Form, Field, CellGroup, ConfigProvider, Toast, Uploader, Empty, Tab, Tabs, Overlay, NumberKeyboard, Lazyload, List, PullRefresh, Popup, Picker, Sticky, Stepper, Tag, Swipe, SwipeItem, Dialog, ActionSheet, Loading, Checkbox, Search } from 'vant'; 10 import { Button, Image as VanImage, Col, Row, Icon, Form, Field, CellGroup, ConfigProvider, Toast, Uploader, Empty, Tab, Tabs, Overlay, NumberKeyboard, Lazyload, List, PullRefresh, Popup, Picker, Sticky, Stepper, Tag, Swipe, SwipeItem, Dialog, ActionSheet, Loading, Checkbox, Search } from 'vant';
...@@ -14,6 +14,7 @@ import App from './App.vue'; ...@@ -14,6 +14,7 @@ import App from './App.vue';
14 import axios from '@/utils/axios'; 14 import axios from '@/utils/axios';
15 // import 'default-passive-events'; // 解决Chrome控制台non-passive event listener输出问题 15 // import 'default-passive-events'; // 解决Chrome控制台non-passive event listener输出问题
16 import { createPinia } from 'pinia'; 16 import { createPinia } from 'pinia';
17 +import 'vant/lib/index.css';
17 18
18 const pinia = createPinia(); 19 const pinia = createPinia();
19 const app = createApp(App); 20 const app = createApp(App);
......
...@@ -33,7 +33,7 @@ import { ref } from 'vue' ...@@ -33,7 +33,7 @@ import { ref } from 'vue'
33 import { useRoute, useRouter } from 'vue-router' 33 import { useRoute, useRouter } from 'vue-router'
34 import axios from '@/utils/axios'; 34 import axios from '@/utils/axios';
35 import _ from 'lodash' 35 import _ from 'lodash'
36 -import { Toast } from 'vant'; 36 +import { showSuccessToast, showFailToast, showToast } from 'vant';
37 import { styleColor } from '@/constant.js'; 37 import { styleColor } from '@/constant.js';
38 38
39 const titleStyle = { 39 const titleStyle = {
...@@ -114,7 +114,7 @@ const onLoad = () => { ...@@ -114,7 +114,7 @@ const onLoad = () => {
114 } else { 114 } else {
115 console.warn(res); 115 console.warn(res);
116 if (!res.data.show) return false; 116 if (!res.data.show) return false;
117 - Toast({ 117 + showToast({
118 icon: 'close', 118 icon: 'close',
119 message: res.data.msg 119 message: res.data.msg
120 }); 120 });
......
...@@ -20,7 +20,7 @@ import { ref, reactive, onMounted } from 'vue' ...@@ -20,7 +20,7 @@ import { ref, reactive, onMounted } from 'vue'
20 import { useRoute, useRouter } from 'vue-router' 20 import { useRoute, useRouter } from 'vue-router'
21 import axios from '@/utils/axios'; 21 import axios from '@/utils/axios';
22 import _ from 'lodash' 22 import _ from 'lodash'
23 -import { Toast } from 'vant'; 23 +import { showSuccessToast, showFailToast, showToast } from 'vant';
24 const $route = useRoute(); 24 const $route = useRoute();
25 const $router = useRouter(); 25 const $router = useRouter();
26 26
...@@ -43,14 +43,14 @@ axios.get('/srv/?a=kg_prod_list') ...@@ -43,14 +43,14 @@ axios.get('/srv/?a=kg_prod_list')
43 } else { 43 } else {
44 console.warn(res); 44 console.warn(res);
45 if (!res.data.show) return false; 45 if (!res.data.show) return false;
46 - Toast({ 46 + showToast({
47 icon: 'close', 47 icon: 'close',
48 message: res.data.msg 48 message: res.data.msg
49 }); 49 });
50 } 50 }
51 }) 51 })
52 .catch(err => { 52 .catch(err => {
53 - console.error(err); 53 + console.error(err);
54 }); 54 });
55 55
56 </script> 56 </script>
......
...@@ -70,7 +70,7 @@ import { ref, onMounted } from 'vue' ...@@ -70,7 +70,7 @@ import { ref, onMounted } from 'vue'
70 import { useRoute } from 'vue-router' 70 import { useRoute } from 'vue-router'
71 import axios from '@/utils/axios'; 71 import axios from '@/utils/axios';
72 import _ from 'lodash' 72 import _ from 'lodash'
73 -import { Toast } from 'vant'; 73 +import { showSuccessToast, showFailToast, showToast } from 'vant';
74 import { USER_STATUS } from '@/constant' 74 import { USER_STATUS } from '@/constant'
75 import { useGo } from '@/hooks/useGo' 75 import { useGo } from '@/hooks/useGo'
76 76
...@@ -134,14 +134,14 @@ const onLoad = () => { ...@@ -134,14 +134,14 @@ const onLoad = () => {
134 } else { 134 } else {
135 console.warn(res); 135 console.warn(res);
136 if (!res.data.show) return false; 136 if (!res.data.show) return false;
137 - Toast({ 137 + showToast({
138 icon: 'close', 138 icon: 'close',
139 message: res.data.msg 139 message: res.data.msg
140 }); 140 });
141 } 141 }
142 }) 142 })
143 .catch(err => { 143 .catch(err => {
144 - console.error(err); 144 + console.error(err);
145 }) 145 })
146 }; 146 };
147 147
...@@ -162,14 +162,14 @@ const onReload = () => { ...@@ -162,14 +162,14 @@ const onReload = () => {
162 } else { 162 } else {
163 console.warn(res); 163 console.warn(res);
164 if (!res.data.show) return false; 164 if (!res.data.show) return false;
165 - Toast({ 165 + showToast({
166 icon: 'close', 166 icon: 'close',
167 message: res.data.msg 167 message: res.data.msg
168 }); 168 });
169 } 169 }
170 }) 170 })
171 .catch(err => { 171 .catch(err => {
172 - console.error(err); 172 + console.error(err);
173 }) 173 })
174 } 174 }
175 /******** 留言框列表相关操作 END *******/ 175 /******** 留言框列表相关操作 END *******/
...@@ -243,7 +243,7 @@ const submitCommentBox = (note) => { ...@@ -243,7 +243,7 @@ const submitCommentBox = (note) => {
243 .then(res => { 243 .then(res => {
244 showCommentBoxPopup.value = false; 244 showCommentBoxPopup.value = false;
245 if (res.data.code === 1) { 245 if (res.data.code === 1) {
246 - Toast.success('发布成功') 246 + showSuccessToast('发布成功')
247 // 刷新列表 247 // 刷新列表
248 if (commentType.value === 'comment') { 248 if (commentType.value === 'comment') {
249 // 留言可以刷新列表 249 // 留言可以刷新列表
...@@ -265,14 +265,14 @@ const submitCommentBox = (note) => { ...@@ -265,14 +265,14 @@ const submitCommentBox = (note) => {
265 } else { 265 } else {
266 console.warn(res); 266 console.warn(res);
267 if (!res.data.show) return false; 267 if (!res.data.show) return false;
268 - Toast({ 268 + showToast({
269 icon: 'close', 269 icon: 'close',
270 message: res.data.msg 270 message: res.data.msg
271 }); 271 });
272 } 272 }
273 }) 273 })
274 .catch(err => { 274 .catch(err => {
275 - console.error(err); 275 + console.error(err);
276 }) 276 })
277 } 277 }
278 278
......
...@@ -62,7 +62,7 @@ import { no_image, icon_avatar } from '@/utils/generateIcons.js' ...@@ -62,7 +62,7 @@ import { no_image, icon_avatar } from '@/utils/generateIcons.js'
62 import CommentBox from '@/components/CommentBox/index.vue' 62 import CommentBox from '@/components/CommentBox/index.vue'
63 import { ref, onActivated } from 'vue' 63 import { ref, onActivated } from 'vue'
64 import { useRoute, onBeforeRouteLeave } from 'vue-router' 64 import { useRoute, onBeforeRouteLeave } from 'vue-router'
65 -import { Toast } from 'vant'; 65 +import { showSuccessToast, showFailToast } from 'vant';
66 // import { addPages, store } from '@/hooks/useKeepAlive' 66 // import { addPages, store } from '@/hooks/useKeepAlive'
67 import { myAtmeAPI } from '@/api/C/me' 67 import { myAtmeAPI } from '@/api/C/me'
68 import { addCommentAPI, addReplyAPI } from '@/api/C/perf' 68 import { addCommentAPI, addReplyAPI } from '@/api/C/perf'
...@@ -140,7 +140,7 @@ const submitCommentBox = async (note) => { ...@@ -140,7 +140,7 @@ const submitCommentBox = async (note) => {
140 params.prod_id = $route.query.prod_id; 140 params.prod_id = $route.query.prod_id;
141 const { code } = await addCommentAPI(params); 141 const { code } = await addCommentAPI(params);
142 if (code) { 142 if (code) {
143 - Toast.success('发布成功') 143 + showSuccessToast('发布成功')
144 // 刷新列表 144 // 刷新列表
145 location.reload() 145 location.reload()
146 } 146 }
...@@ -149,7 +149,7 @@ const submitCommentBox = async (note) => { ...@@ -149,7 +149,7 @@ const submitCommentBox = async (note) => {
149 params.comment_id = commentId.value; 149 params.comment_id = commentId.value;
150 const { code } = await addReplyAPI(params); 150 const { code } = await addReplyAPI(params);
151 if (code) { 151 if (code) {
152 - Toast.success('发布成功') 152 + showSuccessToast('发布成功')
153 // 刷新列表 153 // 刷新列表
154 location.reload() 154 location.reload()
155 } 155 }
...@@ -157,7 +157,7 @@ const submitCommentBox = async (note) => { ...@@ -157,7 +157,7 @@ const submitCommentBox = async (note) => {
157 } 157 }
158 158
159 /** 159 /**
160 - * @param {*} v 160 + * @param {*} v
161 * @description 关闭留言框回调 161 * @description 关闭留言框回调
162 */ 162 */
163 const closeCommentBox = (v) => { 163 const closeCommentBox = (v) => {
......
...@@ -42,7 +42,7 @@ import { useRoute, useRouter } from 'vue-router' ...@@ -42,7 +42,7 @@ import { useRoute, useRouter } from 'vue-router'
42 import axios from '@/utils/axios'; 42 import axios from '@/utils/axios';
43 import $ from 'jquery' 43 import $ from 'jquery'
44 import _ from 'lodash' 44 import _ from 'lodash'
45 -import { Toast } from 'vant'; 45 +import { showSuccessToast, showFailToast, showToast } from 'vant';
46 const $route = useRoute(); 46 const $route = useRoute();
47 const $router = useRouter(); 47 const $router = useRouter();
48 48
...@@ -57,7 +57,7 @@ axios.post('/srv/?a=my_donate') ...@@ -57,7 +57,7 @@ axios.post('/srv/?a=my_donate')
57 } else { 57 } else {
58 console.warn(res); 58 console.warn(res);
59 if (!res.data.show) return false; 59 if (!res.data.show) return false;
60 - Toast({ 60 + showToast({
61 icon: 'close', 61 icon: 'close',
62 message: res.data.msg 62 message: res.data.msg
63 }); 63 });
...@@ -84,7 +84,7 @@ const showCert = (v) => { ...@@ -84,7 +84,7 @@ const showCert = (v) => {
84 } else { 84 } else {
85 console.warn(res); 85 console.warn(res);
86 if (!res.data.show) return false; 86 if (!res.data.show) return false;
87 - Toast({ 87 + showToast({
88 icon: 'close', 88 icon: 'close',
89 message: res.data.msg 89 message: res.data.msg
90 }); 90 });
......
...@@ -39,7 +39,7 @@ import { useUpload } from '@/composables/useUpload.js' ...@@ -39,7 +39,7 @@ import { useUpload } from '@/composables/useUpload.js'
39 import { ref, reactive } from 'vue' 39 import { ref, reactive } from 'vue'
40 import { useRoute, useRouter } from 'vue-router' 40 import { useRoute, useRouter } from 'vue-router'
41 import axios from '@/utils/axios'; 41 import axios from '@/utils/axios';
42 -import { Toast } from 'vant'; 42 +import { showSuccessToast, showFailToast, showToast } from 'vant';
43 import _ from 'lodash' 43 import _ from 'lodash'
44 import { styleColor } from '@/constant.js'; 44 import { styleColor } from '@/constant.js';
45 45
...@@ -66,11 +66,11 @@ if ($route.query.type === 'EDIT') { ...@@ -66,11 +66,11 @@ if ($route.query.type === 'EDIT') {
66 // 验证输入项 66 // 验证输入项
67 const validForm = () => { 67 const validForm = () => {
68 if (!user_info.name) { 68 if (!user_info.name) {
69 - Toast.fail('儿童姓名不能为空') 69 + showFailToast('儿童姓名不能为空')
70 return false; 70 return false;
71 } 71 }
72 if (!fileList.value.length) { 72 if (!fileList.value.length) {
73 - Toast.fail('儿童头像不能为空') 73 + showFailToast('儿童头像不能为空')
74 return false; 74 return false;
75 } 75 }
76 saveInfo() 76 saveInfo()
...@@ -100,7 +100,7 @@ const selectSchool = () => { ...@@ -100,7 +100,7 @@ const selectSchool = () => {
100 } else { 100 } else {
101 console.warn(res); 101 console.warn(res);
102 if (!res.data.show) return false; 102 if (!res.data.show) return false;
103 - Toast({ 103 + showToast({
104 icon: 'close', 104 icon: 'close',
105 message: res.data.msg 105 message: res.data.msg
106 }); 106 });
...@@ -130,7 +130,7 @@ const saveInfo = () => { ...@@ -130,7 +130,7 @@ const saveInfo = () => {
130 }) 130 })
131 .then(res => { 131 .then(res => {
132 if (res.data.code === 1) { 132 if (res.data.code === 1) {
133 - Toast.success({ 133 + showSuccessToast({
134 message: '保存成功', 134 message: '保存成功',
135 duration: 1000, 135 duration: 1000,
136 onClose: () => { 136 onClose: () => {
...@@ -144,7 +144,7 @@ const saveInfo = () => { ...@@ -144,7 +144,7 @@ const saveInfo = () => {
144 } else { 144 } else {
145 console.warn(res); 145 console.warn(res);
146 if (!res.data.show) return false; 146 if (!res.data.show) return false;
147 - Toast({ 147 + showToast({
148 icon: 'close', 148 icon: 'close',
149 message: res.data.msg 149 message: res.data.msg
150 }); 150 });
...@@ -179,21 +179,21 @@ export default { ...@@ -179,21 +179,21 @@ export default {
179 .add-user-page { 179 .add-user-page {
180 padding: 1rem; 180 padding: 1rem;
181 .title { 181 .title {
182 - color: @base-color; 182 + color: @base-color;
183 - font-size: 1.25rem; 183 + font-size: 1.25rem;
184 - padding: 1rem; 184 + padding: 1rem;
185 - text-align: center; 185 + text-align: center;
186 font-weight: bold; 186 font-weight: bold;
187 } 187 }
188 .upload-text { 188 .upload-text {
189 padding: 2vh 0; 189 padding: 2vh 0;
190 .upload-text-1 { 190 .upload-text-1 {
191 - font-size: 14px; 191 + font-size: 14px;
192 - color: #323233; 192 + color: #323233;
193 margin-left: 2vh; 193 margin-left: 2vh;
194 } 194 }
195 .upload-text-2 { 195 .upload-text-2 {
196 - font-size: 12px; 196 + font-size: 12px;
197 color: #B0B0B0; 197 color: #B0B0B0;
198 } 198 }
199 } 199 }
......
...@@ -48,7 +48,7 @@ import { wxInfo } from '@/utils/tools'; ...@@ -48,7 +48,7 @@ import { wxInfo } from '@/utils/tools';
48 import { ref, onMounted, nextTick } from 'vue' 48 import { ref, onMounted, nextTick } from 'vue'
49 import { useRoute, useRouter } from 'vue-router' 49 import { useRoute, useRouter } from 'vue-router'
50 import axios from '@/utils/axios'; 50 import axios from '@/utils/axios';
51 -import { Toast } from 'vant'; 51 +import { showSuccessToast, showFailToast, showToast } from 'vant';
52 import { styleColor } from '@/constant.js'; 52 import { styleColor } from '@/constant.js';
53 import { smsAPI } from '@/api/common' 53 import { smsAPI } from '@/api/common'
54 import { useCountDown } from '@vant/use'; 54 import { useCountDown } from '@vant/use';
...@@ -119,7 +119,7 @@ const sendCode = async () => { // 发送验证码 ...@@ -119,7 +119,7 @@ const sendCode = async () => { // 发送验证码
119 // 验证码接口 119 // 验证码接口
120 const { code } = await smsAPI({ phone: phone.value }); 120 const { code } = await smsAPI({ phone: phone.value });
121 if (code === 1) { 121 if (code === 1) {
122 - Toast.success('发送成功'); 122 + showSuccessToast('发送成功');
123 } 123 }
124 }; 124 };
125 125
...@@ -141,7 +141,7 @@ let submit = () => { ...@@ -141,7 +141,7 @@ let submit = () => {
141 }) 141 })
142 .catch(error => { 142 .catch(error => {
143 console.error(error); 143 console.error(error);
144 - Toast({ 144 + showToast({
145 message: '请检查后再次提交', 145 message: '请检查后再次提交',
146 icon: 'cross', 146 icon: 'cross',
147 }); 147 });
...@@ -151,7 +151,7 @@ let submit = () => { ...@@ -151,7 +151,7 @@ let submit = () => {
151 /** 151 /**
152 * 手机号码校验 152 * 手机号码校验
153 * 函数返回 true 表示校验通过,false 表示不通过 153 * 函数返回 true 表示校验通过,false 表示不通过
154 - * @param {*} val 154 + * @param {*} val
155 */ 155 */
156 const validator = (val) => { 156 const validator = (val) => {
157 let flag = false; 157 let flag = false;
...@@ -178,7 +178,7 @@ const onSubmit = (values) => { ...@@ -178,7 +178,7 @@ const onSubmit = (values) => {
178 }) 178 })
179 .then(res => { 179 .then(res => {
180 if (res.data.code === 1) { 180 if (res.data.code === 1) {
181 - Toast.success('录入成功') 181 + showSuccessToast('录入成功')
182 if ($route.query.back_url) { 182 if ($route.query.back_url) {
183 $router.push($route.query.back_url) 183 $router.push($route.query.back_url)
184 } else { 184 } else {
...@@ -187,7 +187,7 @@ const onSubmit = (values) => { ...@@ -187,7 +187,7 @@ const onSubmit = (values) => {
187 } else { 187 } else {
188 console.warn(res.data); 188 console.warn(res.data);
189 if (!res.data.show) return false; 189 if (!res.data.show) return false;
190 - Toast({ 190 + showToast({
191 message: res.data.msg, 191 message: res.data.msg,
192 icon: 'close', 192 icon: 'close',
193 }); 193 });
...@@ -224,10 +224,10 @@ export default { ...@@ -224,10 +224,10 @@ export default {
224 .verify-user-page { 224 .verify-user-page {
225 padding: 1rem; 225 padding: 1rem;
226 .title { 226 .title {
227 - color: @base-color; 227 + color: @base-color;
228 - font-size: 1.25rem; 228 + font-size: 1.25rem;
229 - padding: 1rem; 229 + padding: 1rem;
230 - text-align: center; 230 + text-align: center;
231 font-weight: bold; 231 font-weight: bold;
232 } 232 }
233 .input-content { 233 .input-content {
......
...@@ -27,9 +27,9 @@ export default ({ command, mode }) => { ...@@ -27,9 +27,9 @@ export default ({ command, mode }) => {
27 // define: '', // 定义全局常量替换方式。其中每项在开发环境下会被定义在全局,而在构建时被静态替换。 27 // define: '', // 定义全局常量替换方式。其中每项在开发环境下会被定义在全局,而在构建时被静态替换。
28 plugins: [ // 将要用到的插件数组。Falsy 虚值的插件将被忽略,插件数组将被扁平化(flatten)。查看 插件 API 获取 Vite 插件的更多细节。 28 plugins: [ // 将要用到的插件数组。Falsy 虚值的插件将被忽略,插件数组将被扁平化(flatten)。查看 插件 API 获取 Vite 插件的更多细节。
29 vue(), 29 vue(),
30 - Components({ 30 + // Components({
31 - resolvers: [VantResolver()], 31 + // resolvers: [VantResolver()],
32 - }), 32 + // }),
33 // styleImport({ 33 // styleImport({
34 // resolves: [VantResolve()], 34 // resolves: [VantResolve()],
35 // libs: [ 35 // libs: [
......
This diff is collapsed. Click to expand it.