更新 新闻列表(未完成)

wenjuan
鹿和sa0ChunLuyu 1 year ago
parent a80048a3f7
commit e192674107

@ -45,6 +45,12 @@
"style": {
"navigationBarTitleText": "个检预约"
}
},
{
"path": "pages/posts/posts/posts",
"style": {
"navigationBarTitleText": ""
}
}
],
"globalStyle": {

@ -0,0 +1,75 @@
<script setup>
/**
* name
* usersa0ChunLuyu
* date2024年9月12日 20:01:39
*/
import {
ref
} from 'vue'
import {
$api,
$response
} from '@/api'
import {
onShow
} from '@dcloudio/uni-app'
import {
useStore
} from '@/store'
import List1 from './src/list1.vue'
import List2 from './src/list2.vue'
const $store = useStore()
const $props = defineProps({
type: {
type: Number,
default: 1
}
});
const posts = ref([])
const getArticleList = async () => {
const response = await $api('ArticleGetList', {
type: Number($props.type)
})
$response(response, () => {
posts.value = response.data.list
})
}
const mountedAction = () => {
getArticleList()
}
const config_ref = ref(null)
const configRef = (e) => {
if (!config_ref.value) {
config_ref.value = e
mountedAction()
}
}
onShow(() => {
if (!!config_ref.value) {
mountedAction()
}
})
</script>
<template>
<view>
<view v-if="!!$store.config">
<view :ref="configRef"></view>
</view>
<view>
<view v-if="[1,2].includes(Number($props.type))">
<List1 :list="posts" :type="Number($props.type)"></List1>
</view>
<view v-if="[3].includes(Number($props.type))">
<List2 :list="posts" :type="Number($props.type)"></List2>
</view>
</view>
</view>
</template>
<style scoped>
</style>

@ -0,0 +1,137 @@
<script setup>
/**
* name
* usersa0ChunLuyu
* date2024年9月11日 19:24:50
*/
import {
ref
} from 'vue'
import {
$api,
$response
} from '@/api'
import {
useStore
} from '@/store'
const $store = useStore()
const header_array = ref([{
title: '常见问题',
desc: 'ABCDFEFASDF'
}, {
title: '常问题见',
desc: 'ABCDFEFASDFAA'
}])
const $props = defineProps({
list: {
type: Array,
default: []
},
type: {
type: Number,
default: 1
}
});
</script>
<template>
<view class="list_wrapper">
<view class="header_wrapper">
<view class="header_icon_wrapper">
<image src="@/static/assets/posts/icon@2x.png"></image>
</view>
<view class="header_info_wrapper">
<view class="header_title_wrapper">
{{ header_array[$props.type - 1].title }}
</view>
<view class="header_subtitle_wrapper">
{{ header_array[$props.type - 1].desc }}
</view>
</view>
</view>
<view class="search_wrapper">
<view class="search_line_wrapper"></view>
<view class="search_input_wrapper"></view>
</view>
<view>
<view v-for="(i,k) in $props.list" :key="k" class="item_wrapper">
</view>
</view>
</view>
</template>
<style>
page {
background: #ffffff;
}
</style>
<style scoped>
.list_wrapper {
width: 750rpx;
margin: 0 auto;
overflow-y: auto;
background: #ffffff;
}
.header_wrapper {
display: flex;
align-items: center;
width: 690rpx;
margin: 42rpx auto 0;
}
.header_icon_wrapper {
width: 100rpx;
height: 100rpx;
margin-left: 33rpx;
}
.header_icon_wrapper image {
width: 100rpx;
height: 100rpx;
display: inline-block;
object-fit: contain;
}
.header_info_wrapper {
margin-left: 26rpx;
}
.header_title_wrapper {
font-weight: 400;
font-size: 34rpx;
color: #0E0E0E;
line-height: 1;
}
.header_subtitle_wrapper {
font-weight: 400;
font-size: 16rpx;
color: #979797;
line-height: 1;
margin-top: 10rpx;
}
.search_wrapper {
display: flex;
align-items: center;
width: 690rpx;
margin: 15rpx auto 0;
justify-content: space-between;
}
.search_line_wrapper {
width: 476rpx;
height: 1rpx;
background: #EBEAEA;
}
.search_input_wrapper {
width: 175rpx;
height: 42rpx;
background: #FFFFFF;
border-radius: 21rpx;
border: 1px solid #A5A6A6;
}
</style>

@ -0,0 +1,26 @@
<script setup>
/**
* name
* usersa0ChunLuyu
* date2024年9月11日 19:24:50
*/
import {
ref
} from 'vue'
import {
$api,
$response
} from '@/api'
import {
useStore
} from '@/store'
const $store = useStore()
</script>
<template>
<view>
list2
</view>
</template>
<style scoped>
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 570 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 609 B

Loading…
Cancel
Save