hookehuyr

✨ feat(组件): 捐赠模块捐赠前提示是否有儿童

...@@ -59,7 +59,7 @@ import { ref, reactive, onMounted, watch, nextTick } from 'vue' ...@@ -59,7 +59,7 @@ import { ref, reactive, onMounted, watch, nextTick } from 'vue'
59 import { useRoute, useRouter } from 'vue-router' 59 import { useRoute, useRouter } from 'vue-router'
60 import axios from '@/utils/axios'; 60 import axios from '@/utils/axios';
61 import $ from 'jquery' 61 import $ from 'jquery'
62 -import { Toast } from 'vant'; 62 +import { Toast, Dialog } from 'vant';
63 const $route = useRoute(); 63 const $route = useRoute();
64 const $router = useRouter(); 64 const $router = useRouter();
65 65
...@@ -109,12 +109,27 @@ const show = ref(false); ...@@ -109,12 +109,27 @@ const show = ref(false);
109 let popupHeight = ref('60%'); 109 let popupHeight = ref('60%');
110 110
111 watch(() => props.showPopup, (v) => { 111 watch(() => props.showPopup, (v) => {
112 - show.value = v 112 + // 如果没有默认儿童需要用户确认一次
113 - // DOM调整后,把弹出框高度设定到适合高度,配合不同分辨率效果 113 + if (v && !props.item.perf_id) {
114 - nextTick(() => { 114 + Dialog.confirm({
115 - let height = $('.donate-wrapper').height(); 115 + title: '温馨提示',
116 - popupHeight.value = height + 10 + 'px'; 116 + message: '默认儿童为空, 是否继续捐书!',
117 - }) 117 + confirmButtonColor: '#713610'
118 + })
119 + .then(() => {
120 + show.value = v;
121 + // DOM调整后,把弹出框高度设定到适合高度,配合不同分辨率效果
122 + nextTick(() => {
123 + let height = $('.donate-wrapper').height();
124 + popupHeight.value = height + 10 + 'px';
125 + })
126 + })
127 + .catch(() => {
128 + // 取消按钮回调
129 + closeBtn();
130 + });
131 + return false;
132 + }
118 }) 133 })
119 134
120 const closeBtn = () => { 135 const closeBtn = () => {
......
...@@ -4,7 +4,7 @@ const index = [{ ...@@ -4,7 +4,7 @@ const index = [{
4 component: () => import('@/views/client/index.vue'), 4 component: () => import('@/views/client/index.vue'),
5 meta: { 5 meta: {
6 title: '童声无界', 6 title: '童声无界',
7 - name: 'index' 7 + name: 'indexPage'
8 }, 8 },
9 children: [] 9 children: []
10 }, { 10 }, {
...@@ -13,7 +13,7 @@ const index = [{ ...@@ -13,7 +13,7 @@ const index = [{
13 component: () => import('@/views/client/index.vue'), 13 component: () => import('@/views/client/index.vue'),
14 meta: { 14 meta: {
15 title: '童声无界', 15 title: '童声无界',
16 - name: 'index' 16 + name: 'indexPage'
17 }, 17 },
18 children: [] 18 children: []
19 }, { 19 }, {
......