diff --git a/src/components/public/have-questions.vue b/src/components/public/have-questions.vue index aadd9e1..cada835 100644 --- a/src/components/public/have-questions.vue +++ b/src/components/public/have-questions.vue @@ -25,4 +25,42 @@ const { wechat } = toRefs(store.state); - \ No newline at end of file + \ No newline at end of file diff --git a/src/views/user.vue b/src/views/user.vue index 70387b5..9ab7f70 100644 --- a/src/views/user.vue +++ b/src/views/user.vue @@ -93,6 +93,7 @@ import pageFooter from '@/components/footer/footer.vue' import biserialListItem from '@/components/biserialListItem/biserialListItem.vue' import { ref, reactive, onMounted, getCurrentInstance } from 'vue' const { proxy } = getCurrentInstance() +import { ElLoading } from 'element-plus' onMounted(() => { @@ -131,6 +132,8 @@ async function init() { }); } +let loading = null + let publishData = ref({ page: 1, list: [] @@ -139,6 +142,12 @@ let publishData = ref({ let stat = ref({}) // 我的发布的详细数量 // 获取发布数据 const getPublishData = () => { + if (publishData.value['page'] == 0 || loading) return + loading = ElLoading.service({ + lock: true, + text: 'Loading', + background: 'rgba(0, 0, 0, 0.7)', + }) proxy.$post("/tenement/pc/api/user/publishList", { page: publishData['page'] }).then(res => { @@ -147,6 +156,8 @@ const getPublishData = () => { stat.value = data['stat'] publishData.value['page'] = data['page'] * data['limit'] >= data['count'] ? 0 : data['page'] + 1 publishData.value['list'] = publishData.value['list'].concat(data['data']) + }).finally(() => { + loading.close() }) } @@ -157,6 +168,12 @@ let favData = ref({ // 获取收藏数据 const getFavData = () => { + if (favData.value['page'] == 0 || loading) return + loading = ElLoading.service({ + lock: true, + text: 'Loading', + background: 'rgba(0, 0, 0, 0.7)', + }) proxy.$post("/tenement/pc/api/user/favList", { page: favData['page'] }).then(res => { @@ -164,6 +181,8 @@ const getFavData = () => { let data = res.data favData.value['page'] = data['page'] * data['limit'] >= data['count'] ? 0 : data['page'] + 1 favData.value['list'] = favData.value['list'].concat(data['data']) + }).finally(() => { + loading.close() }) } @@ -391,41 +410,4 @@ const cutTab = (value) => { } -.have-questions { - display: inline-flex; - flex-direction: column; - - .QR-code { - width: 100%; - } - - .have-questions-text { - color: #7F7F7F; - font-size: 14px; - margin-bottom: 14px; - - .smiling { - width: 16px; - height: 16px; - margin: 0 5px; - } - } - - .have-questions-btn { - width: 166px; - height: 40px; - border-radius: 40px; - font-size: 18px; - font-weight: 650; - color: #333; - border: 1px solid #7f7f7f; - cursor: pointer; - - .have-questions-icon { - width: 16px; - height: 16px; - margin-right: 10px; - } - } -}