121 lines
2.6 KiB
Vue
121 lines
2.6 KiB
Vue
<template>
|
||
<view>
|
||
<text class="title">楷模列表</text>
|
||
<view class="page" v-for="i in result">
|
||
<view>
|
||
<image :src="`http://124.93.196.45:10091/Neusoft/times-model${i[2]}`"></image>
|
||
</view>
|
||
<view>
|
||
<p>中宣部授予{{i[0]}}“时代楷模”楷模楷模楷模楷模楷模楷模楷模楷模楷模楷模楷模楷模楷模楷模</p>
|
||
<p>模特姓名:{{i[0]}}</p>
|
||
<p>{{i[1]}}</p>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</template>
|
||
|
||
<script>
|
||
export default {
|
||
data() {
|
||
return {
|
||
result: []
|
||
}
|
||
},
|
||
async onLoad() {
|
||
for (let i = 1; i < 4; i++) {
|
||
this.result.push(this.requests("down", `appNotice/app-o/loopMapDetail?id=${i}`))
|
||
}
|
||
this.result = await Promise.all(this.result);
|
||
this.result = this.result.map(x => [x.data.modelName, x.data.content, x.data.picPath])
|
||
console.log(this.result.splice(this.result.length))
|
||
console.log(this.result);
|
||
},
|
||
methods: {
|
||
async requests(updown, path) {
|
||
let response
|
||
if (updown == "up") {
|
||
response = await fetch(`http://124.93.196.45:10091/Neusoft/times-model/${path}`, {
|
||
method: "POST",
|
||
headers: {
|
||
"Content-Type": "application/json",
|
||
},
|
||
body: JSON.stringify({
|
||
"password": "0CYdq6Hn",
|
||
"username": "6dOMIgIU"
|
||
})
|
||
})
|
||
} else if (updown == "down") {
|
||
response = await fetch(`http://124.93.196.45:10091/Neusoft/times-model/${path}`, {
|
||
method: "GET",
|
||
headers: {
|
||
"Content-Type": "application/json",
|
||
"Authorization": "eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImJjYtrrMxSx0OvYuqZ_0UL738RhVLuq-IxBIyHH1kt0gXAANbdsg"
|
||
},
|
||
})
|
||
|
||
}
|
||
const data = await response.json()
|
||
console.log(data)
|
||
return data
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style>
|
||
.title {
|
||
display: block;
|
||
border-left: 5px firebrick solid;
|
||
font-weight: bold;
|
||
font-size: 1.3rem;
|
||
margin-bottom: 10px;
|
||
}
|
||
|
||
.page {
|
||
border-radius: 15px;
|
||
background-color: #fff;
|
||
height: 12vh;
|
||
display: flex;
|
||
border-radius: 15px;
|
||
align-items: center;
|
||
}
|
||
|
||
.page view:first-of-type {
|
||
width: 25%;
|
||
height: 75%;
|
||
margin: 3%;
|
||
|
||
}
|
||
|
||
.page view:first-of-type image {
|
||
width: 100%;
|
||
height: 100%;
|
||
}
|
||
|
||
.page view:nth-child(2) {
|
||
width: 65%;
|
||
}
|
||
|
||
.page view:nth-child(2) p:first-of-type {
|
||
font-size: 1.2rem;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
.page view:nth-child(2) p:nth-child(2) {
|
||
font-size: 0.9rem;
|
||
|
||
}
|
||
|
||
.page view:nth-child(2) p:nth-child(3) {
|
||
width: 100%;
|
||
font-size: 0.9rem;
|
||
display: -webkit-box;
|
||
-webkit-box-orient: vertical;
|
||
-webkit-line-clamp: 2;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
}
|
||
</style>
|