hookehuyr

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

......@@ -59,7 +59,7 @@ import { ref, reactive, onMounted, watch, nextTick } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import axios from '@/utils/axios';
import $ from 'jquery'
import { Toast } from 'vant';
import { Toast, Dialog } from 'vant';
const $route = useRoute();
const $router = useRouter();
......@@ -109,12 +109,27 @@ const show = ref(false);
let popupHeight = ref('60%');
watch(() => props.showPopup, (v) => {
show.value = v
// DOM调整后,把弹出框高度设定到适合高度,配合不同分辨率效果
nextTick(() => {
let height = $('.donate-wrapper').height();
popupHeight.value = height + 10 + 'px';
})
// 如果没有默认儿童需要用户确认一次
if (v && !props.item.perf_id) {
Dialog.confirm({
title: '温馨提示',
message: '默认儿童为空, 是否继续捐书!',
confirmButtonColor: '#713610'
})
.then(() => {
show.value = v;
// DOM调整后,把弹出框高度设定到适合高度,配合不同分辨率效果
nextTick(() => {
let height = $('.donate-wrapper').height();
popupHeight.value = height + 10 + 'px';
})
})
.catch(() => {
// 取消按钮回调
closeBtn();
});
return false;
}
})
const closeBtn = () => {
......
......@@ -4,7 +4,7 @@ const index = [{
component: () => import('@/views/client/index.vue'),
meta: {
title: '童声无界',
name: 'index'
name: 'indexPage'
},
children: []
}, {
......@@ -13,7 +13,7 @@ const index = [{
component: () => import('@/views/client/index.vue'),
meta: {
title: '童声无界',
name: 'index'
name: 'indexPage'
},
children: []
}, {
......