index页面的楷模列表
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
<template>
|
||||
<view>
|
||||
<text class="title">楷模列表</text>
|
||||
<view class="page" v-for="i in result">
|
||||
<view class="page" v-for="i in processedResult">
|
||||
<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[0]}}</p>
|
||||
<p>{{i[1]}}</p>
|
||||
</view>
|
||||
@@ -16,25 +15,32 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
end: {
|
||||
type: Number,
|
||||
default: 5
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
result: []
|
||||
}
|
||||
},
|
||||
async onLoad() {
|
||||
for (let i = 1; i < 4; i++) {
|
||||
this.result.push(this.requests("down", `appNotice/app-o/loopMapDetail?id=${i}`))
|
||||
computed: {
|
||||
processedResult(){
|
||||
return this.result.slice(0,this.end)
|
||||
}
|
||||
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))
|
||||
},
|
||||
async mounted() {
|
||||
this.result = (await this.requests("down", `/appModel/app-o/list`)).rows
|
||||
this.result = this.result.map(x => [x.modelName, x.content, x.picPath])
|
||||
console.log(this.result);
|
||||
},
|
||||
methods: {
|
||||
async requests(updown, path) {
|
||||
async requests(updown = "down", path) {
|
||||
let response
|
||||
if (updown == "up") {
|
||||
response = await fetch(`http://124.93.196.45:10091/Neusoft/times-model/${path}`, {
|
||||
response = await fetch(`http://124.93.196.45:10091/Neusoft/times-model${path}`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
@@ -45,7 +51,7 @@
|
||||
})
|
||||
})
|
||||
} else if (updown == "down") {
|
||||
response = await fetch(`http://124.93.196.45:10091/Neusoft/times-model/${path}`, {
|
||||
response = await fetch(`http://124.93.196.45:10091/Neusoft/times-model${path}`, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
@@ -63,14 +69,6 @@
|
||||
</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;
|
||||
@@ -81,8 +79,8 @@
|
||||
}
|
||||
|
||||
.page view:first-of-type {
|
||||
width: 25%;
|
||||
height: 75%;
|
||||
width: 30%;
|
||||
height: 95%;
|
||||
margin: 3%;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user