Commit 5e4b3360 authored by chenqikuai's avatar chenqikuai

refactor: 删除无用代码

parent 109f1693
This diff is collapsed.
<template>
<div
class="item flex items-center justify-center ml-4"
:class="{ 'select-item': selected }"
>{{ value }}</div>
<div
@click="$emit('click')"
class="item flex items-center justify-center ml-4"
:class="{ 'select-item': selected }"
>
{{ value }}
</div>
</template>
<script setup lang="ts">
import { PropType } from "@vue/runtime-core";
const props = defineProps({
selected: {
required: true,
type: Boolean,
},
value: {
required: true,
type: String as PropType<string>,
}
})
defineEmits(["click"]);
const props = defineProps({
selected: {
required: true,
type: Boolean,
},
value: {
required: true,
type: String as PropType<string>,
},
});
</script>
<style>
.item {
width: 100px;
height: 35px;
background: #f5f6f9;
border-radius: 20px;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #1b1f37;
width: 100px;
height: 35px;
background: #f5f6f9;
border-radius: 20px;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #1b1f37;
}
.select-item {
background: #3e4faf;
color: #ffffff;
background: #3e4faf;
color: #ffffff;
}
</style>
\ No newline at end of file
</style>
<template>
<div class="object-cover" @click="clickSelf">
<div v-show="type === 'png'">
<img src="@/assets/icons/shiba.png" class="object-cover object-center" />
</div>
<svg
v-show="type === 'svg'"
aria-hidden="true"
:height="size"
:width="size"
:fill="color"
>
<svg aria-hidden="true" :height="size" :width="size" :fill="color">
<use :xlink:href="'#' + name"></use>
</svg>
</div>
......@@ -21,10 +12,6 @@ import { defineComponent } from "vue";
export default defineComponent({
emits: ["click"],
props: {
type: {
type: String,
default: "svg",
},
size: {
type: String,
default: "14px",
......@@ -45,4 +32,3 @@ export default defineComponent({
},
});
</script>
......@@ -137,9 +137,6 @@ import staffAvatarUrl from "@/assets/icons/staff.png";
// import ChatContentMessageImageVue from "./ChatContentMessageImage.vue";
import { ChatMessageTypes } from "@/types/chatMessageTypes";
// import ChatContentMessageVideoVue from "./ChatContentMessageVideo.vue";
import { target } from "@/store/appCallerStore";
import { copyToClipboard } from "quasar";
import { Toast } from "vant";
import ChatMessageDB from "@/db/ChatMessageDB";
import { useRoute } from "vue-router";
import { clipboardValue } from "@/store/AppStore";
......
<template>
<div>
<nav-bar title="新闻动态" :style="{ 'background-color':'#F7F7FA'}" :showSearchIcon="true" :path="{path: '/Search', query: { type: 'news' }}"/>
<div class=" mx-5 pt-3">
<van-pull-refresh class="divide-y" v-model="refreshing" @refresh="onRefresh">
<nav-bar
title="新闻动态"
:style="{ 'background-color': '#F7F7FA' }"
:showSearchIcon="true"
:path="{ path: '/Search', query: { type: 'news' } }"
/>
<div class="mx-5 pt-3">
<van-pull-refresh
class="divide-y"
v-model="refreshing"
@refresh="onRefresh"
>
<van-list
v-model:loading="loading"
:finished="finished"
finished-text=""
@load="onLoad">
<news-list v-for="(item, n) in lists" :key="n" :info="item"/>
@load="onLoad"
>
<news-list v-for="(item, n) in lists" :key="n" :info="item" />
</van-list>
</van-pull-refresh>
</div>
......@@ -16,41 +26,41 @@
</template>
<script lang="ts">
import { defineComponent, ref, reactive } from 'vue'
import NavBar from "@/components/NavBar/index.vue"
import NewsList from "./NewsList/index.vue"
import { PullRefresh, List } from 'vant'
import { getNewsList } from '@/service/NewsService/index'
import { defineComponent, ref, reactive } from "vue";
import NavBar from "@/components/NavBar/index.vue";
import NewsList from "./NewsList/index.vue";
import { PullRefresh, List } from "vant";
import { getNewsList } from "@/service/NewsService/index";
export default defineComponent({
components:{
NavBar,
components: {
NavBar,
NewsList,
'van-pull-refresh': PullRefresh,
'van-list': List
"van-pull-refresh": PullRefresh,
"van-list": List,
},
setup () {
let lists = ref([] as any)
setup() {
let lists = ref([] as any);
const pagination = reactive({
page: 1,
pageSize: 10,
total: 0
})
const loading = ref(false)
const finished = ref(false)
const refreshing = ref(false)
total: 0,
});
const loading = ref(false);
const finished = ref(false);
const refreshing = ref(false);
const onLoad = () => {
getLists()
}
getLists();
};
const onRefresh = () => {
// 清空列表数据
finished.value = false
pagination.page = 1
finished.value = false;
pagination.page = 1;
lists.value = []
loading.value = true
onLoad()
}
lists.value = [];
loading.value = true;
onLoad();
};
function getLists() {
if (refreshing.value) {
lists.value = [];
......@@ -58,36 +68,34 @@ export default defineComponent({
}
getNewsList({
limit: pagination.pageSize,
offset: (pagination.page - 1) * pagination.pageSize
}).then(res => {
lists.value.push(...res.data.items)
pagination.total = res.data.total
pagination.page++
offset: (pagination.page - 1) * pagination.pageSize,
}).then((res) => {
lists.value.push(...res.data.items);
pagination.total = res.data.total;
pagination.page++;
//
loading.value = false
loading.value = false;
//
if (lists.value.length >= pagination.total) {
finished.value = true
finished.value = true;
}
})
});
}
return {
lists,
pagination,
loading,
finished,
refreshing,
onLoad,
onRefresh
}
}
})
onRefresh,
};
},
});
</script>
<style scoped>
.divide-y {
min-height: calc(100vh - 46px);
}
</style>
\ No newline at end of file
.divide-y {
min-height: calc(100vh - 46px);
}
</style>
......@@ -101,7 +101,7 @@
<div class="mt-2" v-if="skeLoading"></div>
<Skeleton :loading="skeLoading" :row="3">
<img
class="mx-5 w-83 h-22 mt-5 rounded-lg mx-auto"
class="w-83 h-22 mt-5 rounded-lg mx-auto"
:src="src"
v-if="src"
@click="
......@@ -125,7 +125,7 @@
</div>
</template>
<script lang="ts" setup>
import { defineComponent, ref, toRefs } from "vue";
import { ref } from "vue";
import { eLoanMode } from "./types";
import LoanHotCard from "@/components/Loan/LoanHotCard/index.vue";
import LoanHotSwipe from "@/components/Loan/LoanHotSwipe/index.vue";
......@@ -156,7 +156,6 @@ let skeLoading = ref(false);
let state = reactive({ allProductList: [] as Array<simpleItemInfo> });
const src = ref("");
const uuid = ref("");
const activityUuid = ref("");
const hotNews = ref<{ uuid: string }[]>([]);
const limit = reactive({
......
......@@ -24,7 +24,6 @@
</template>
<script lang="ts">
import { eRole } from "@/types/roleType";
import { getUserMsg } from "@/utils/userMsg";
import { isReviewMode } from "@/utils/vueAppEnv";
import { defineComponent } from "vue";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment