all completed,components/side is none commentpart

This commit is contained in:
winter_born
2026-04-17 16:12:45 +08:00
parent 26a49afb56
commit 74dda19fd1
9 changed files with 352 additions and 26 deletions

View File

@@ -1,6 +1,6 @@
<template>
<view class="bannerlist">
<view class="li" v-for="value in valuearray">
<view class="li" v-for="(value,index) in valuearray" @click="gowhere(index)">
<image :src="value[1]"></image>
<text>{{value[0]}}</text>
</view>
@@ -9,18 +9,22 @@
<script>
export default {
data() {
let valuearray = ["开门", "我的房屋", "我的车位", "物业缴费", "扫码取件", "社区公告", "社区电话", "投诉建议"]
.map((value, index) => [value,
`../../static/${["open-door.png","house.png","feedback-1.png","property-bill.png","qr-pick.png","note.png","property-tel.png","feedback.png"][index]}`
`/static/${["open-door.png","house.png","feedback-1.png","property-bill.png","qr-pick.png","note.png","property-tel.png","feedback.png"][index]}`
])
return {
valuearray
}
},
methods: {
gowhere(index) {
uni.navigateTo({
url:"/pages/index/addr"
})
}
},
mounted() {
console.log(this.valuearray)

View File

@@ -1,22 +1,49 @@
<template>
<view>
<view class="begin">
<view class="title">
<view>{{this.value[3]}}</view>
<view>{{this.value[4]}}</view>
</view>
<view class="content" v-html="this.value[5]">
</view>
<view class="who">
</view>
</view>
</template>
<script>
export default {
data() {
return {
value: null
}
},
methods: {
methods: {},
onLoad(option) {
const id = option.id
this.value = JSON.parse(decodeURIComponent(option.data))
console.log('id:', id)
console.log('完整数据:', this.value)
}
}
</script>
<style>
.begin {
margin: 10px;
}
</style>
.title {
display: flex;
justify-content: space-between;
margin-bottom: 10px;
}
.content {
font-size: 0.8rem;
text-indent: 2em;
}
</style>

View File

@@ -30,9 +30,18 @@
{
"path": "pages/index/addr",
"style": {
"navigationBarTitleText": ""
"navigationBarTitleText": "社区公告"
}
}
,{
"path" : "pages/index/addr_more",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",

View File

@@ -1,13 +1,184 @@
<template>
<view>
<view class="page">
<uni-segmented-control :current="current" styleType="text" activeColor="dodgerblue" :values="value"
@clickItem="toggole()"></uni-segmented-control>
<view class="content">
<view v-show="current === 0">
<view v-for="unit in array">
<view class="header">
<text>{{unit[0]}}</text>
<text>未读</text>
</view>
<view class="content_text" v-html="unit[1]"></view>
<view class="bottom_content">
<view>
<image src="../../static/组 155.png"></image>
<text>{{unit[2]}}</text>
</view>
<view @click="goto(unit)">查看详情</view>
</view>
</view>
</view>
<view v-show="current === 1">
选项卡2的内容
</view>
<view v-show="current === 2">
选项卡3的内容
</view>
</view>
</view>
</template>
<script setup>
<script>
export default {
data() {
return {
current: 0,
value: ["全部", "未读", "已读"],
array: null,
}
},
methods: {
async request(gest, path) {
let text
if (gest == "get") {
text = await fetch(`http://124.93.196.45:10091/Neusoft/community${path}`, {
method: "GET",
headers: {
"Content-Type": "application/json",
"Authorization": (await this.request("post", "/api/login")).token
},
})
} else if (gest == "post") {
text = await fetch(`http://124.93.196.45:10091/Neusoft/community${path}`, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
"password": "0CYdq6Hn",
"username": "6dOMIgIU",
})
})
}
const data = await text.json()
console.log(data)
return data
},
goto(value){
const itemStr = encodeURIComponent(JSON.stringify(value))
uni.navigateTo({
url:`/pages/index/addr_more?id=${value[3]}&data=${itemStr}`
})
}
},
async mounted() {
this.array = (await this.request("get", "/api/notice/list")).rows.map(x => [
x.noticeTitle,
x.noticeContent,
x.createTime,
x.noticeId
])
console.log(this.array)
}
}
</script>
<style>
* {
padding: 0;
margin: 0;
}
.page {
background-color: #ECF4FD;
height: 95.3vh;
}
.content {
margin: 10px;
}
.content view view {
background-color: white;
padding: 5px;
}
.content>view>view {
margin: 10px;
border-radius: 10px;
box-shadow: 10px 10px 20px #f7f7f7;
}
.header {
display: flex;
justify-content: space-between;
}
.header text:nth-child(2){
color:#55ff7f;
}
.content_text {
height: 13vh;
overflow: hidden;
text-overflow: ellipsis;
padding: 8px 0px !important;
border-bottom: 1px solid black;
border-top: 1px solid black;
}
.bottom_content {
display: flex;
justify-content: space-between;
}
.bottom_content image {
height: 20px;
width: 20px;
}
.bottom_content>view:first-child {
color: #d0d0d0;
}
.bottom_content>view {
display: flex;
align-items: center;
}
.bottom_content>view:nth-child(2){
color: blue;
}
.bottom {
display: flex;
position: fixed;
border: 1px solid black;
bottom: 0;
width: 100%;
height: 5vh;
}
.list-li {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
}
.list-li image {
height: 20px;
width: 20px;
}
.list-li:nth-child(1) {
color: dodgerblue;
}
.list-li:nth-child(3) image {
width: 40px;
height: 40px;
border-radius: 50%;
border: 2px solid black;
}
</style>

48
pages/index/addr_more.vue Normal file
View File

@@ -0,0 +1,48 @@
<template>
<view class="begin">
<view class="title">
<view>{{this.item[0]}}</view>
<view>{{this.item[2]}}</view>
</view>
<view class="content" v-html="item[1]">
</view>
</view>
</template>
<script>
export default {
data() {
return {
item: null
}
},
methods: {
},
onLoad(options) {
const id = options.id
this.item = JSON.parse(decodeURIComponent(options.data))
console.log('id:', id)
console.log('完整数据:', this.item)
console.log('标题:', this.item[0])
console.log('内容:', this.item[1])
console.log('时间:', this.item[2])
}
}
</script>
<style>
.begin {
margin: 10px;
}
.title {
display: flex;
justify-content: space-between;
}
.content{
font-size: 0.8rem;
}
</style>

View File

@@ -5,7 +5,7 @@
<text>友邻社区</text>
</view>
<view class="countryside_content">
<view v-for="value in valuearray">
<view v-for="(value,index) in valuearray" @click="goto(value)">
<image :src="value[0]"></image>
<view>
<view>
@@ -20,7 +20,7 @@
</view>
</view>
<view class="bottom">
<view class="list-li" v-for="part in list">
<view class="list-li" v-for="(part,index) in list" @click="gowhere(index)">
<image :src="part[1]"></image>
<text>{{part[0]}}</text>
</view>
@@ -65,6 +65,25 @@
const data = await text.json()
console.log(data)
return data
},
gowhere(index){
switch(index){
case 0:
uni.navigateTo({
url:"/pages/index/index"
})
break
case 3:
uni.navigateTo({
url:"/pages/index/data"
})
}
},
goto(value){
const data =encodeURIComponent(JSON.stringify(value))
uni.navigateTo({
url:`/components/side?id=${value[1]}&data=${data}`
})
}
},
async mounted() {
@@ -164,7 +183,7 @@
width: 20px;
}
.list-li:nth-child(1) {
.list-li:nth-child(2) {
color: dodgerblue;
}

24
pages/index/data.vue Normal file
View File

@@ -0,0 +1,24 @@
<template>
<view>
<view id="chart" style="width: 100%; height: 400px;"></view>
<view id="pie" style="width: 100%; height: 400px;"></view>
<view id="line" style="width: 100%; height: 400px;"></view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>
<style>
</style>

View File

@@ -1,7 +1,7 @@
<template>
<view class="begin">
<view class="title" v-if="notices">
{{notices[0][2]}}
{{notices[0][4]}}
</view>
<swiper class="first" :indicator-dots="false" :autoplay="true" :interval="3000" :duration="1000">
<swiper-item v-for="path in imagePath">
@@ -10,8 +10,9 @@
</view>
</swiper-item>
</swiper>
<swiper class="notice" :indicator-dots="false" :autoplay="false" :interval="3000" :duration="1000">
<swiper-item v-for="notice in notices">
<swiper class="notice" vertical="true" :indicator-dots="false" :autoplay="true" :interval="3000"
:duration="1000">
<swiper-item v-for="(notice,index) in notices" @click="goto(notice)">
<view class="swiper-item">
{{notice[0]}}
<image src="../../static/联合 10.png"></image>
@@ -46,11 +47,11 @@
<view>{{active_content[2][1]}}</view>
<view>{{active_content[2][3]}}评论 {{active_content[2][4]}}</view>
</view>
<image :src="active_content[2][0]" mode=""></image>
<image :src="active_content[2][0]"></image>
</view>
</view>
<view class="bottom">
<view class="list-li" v-for="part in list">
<view class="list-li" v-for="(part,index) in list" @click="gowhere(index)">
<image :src="part[1]"></image>
<text>{{part[0]}}</text>
</view>
@@ -102,13 +103,36 @@
const data = await text.json()
console.log(data)
return data
},
gowhere(index) {
switch (index) {
case 1:
uni.navigateTo({
url: "/pages/index/countryside"
})
break
case 3:
uni.navigateTo({
url: "/pages/index/data"
})
}
},
goto(value) {
const itemStr = encodeURIComponent(JSON.stringify(value))
uni.navigateTo({
url: `/pages/index/addr_more?id=${value[3]}&data=${itemStr}`
})
}
},
async mounted() {
this.imagePath = (await this.request("get", "/api/adv/list")).data.map(x =>
`http://124.93.196.45:10091/Neusoft/community${x.image}`)
this.notices = (await this.request("get", "/api/notice/list")).rows.map(x => [x.noticeTitle, x
.noticeContent,
this.notices = (await this.request("get", "/api/notice/list")).rows.map(x => [
x.noticeTitle,
x.noticeContent,
x.createTime,
x.noticeId,
x.unit
])
this.active_content = (await this.request("get", "/api/cms/article/list")).rows.map(x => [
@@ -312,4 +336,4 @@
border-radius: 50%;
border: 2px solid black;
}
</style>
</style>

BIN
static/组 155.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB