Files
dvcp_v2_wechat_app/src/mods/AppVillager/AppVillager.vue

466 lines
11 KiB
Vue
Raw Normal View History

2022-02-16 20:37:46 +08:00
<template>
<div class="Page">
2022-02-18 09:36:31 +08:00
<u-tabs class="u-tabs1" :list="tabs" :is-scroll="false" :current="tabIndex0" @change="change" bg-color="#197df0" style="width: 50%" active-color="#FFF;" inactive-color="#FFF"></u-tabs>
2022-02-16 20:37:46 +08:00
<div class="top">
2022-02-18 09:36:31 +08:00
<div class="tabIndex012" v-if="tabIndex0 != 3">
2022-02-17 18:17:40 +08:00
<div class="tags" v-for="(items, i) in $dict.getDict('villagerCircleTopic')" :key="i">{{ items.dictName }}</div>
2022-02-16 20:37:46 +08:00
</div>
2022-02-18 09:36:31 +08:00
<u-tabs class="u-tabs2" :list="tabList" :is-scroll="false" :current="tabCurrent1" @change="changetabIndex" bg-color="#fff" active-color="#333;" inactive-color="#999" v-if="tabIndex0 == 3"></u-tabs>
2022-02-16 20:37:46 +08:00
2022-02-18 09:36:31 +08:00
<div class="indexTab22" v-if="tabIndex0 == 3">
<div class="tags" v-for="(e, i) in itemList" :key="i" :class="indexTab2 == i ? 'active' : 'noactive'" @click="hander(i)">{{ e.name }}</div>
2022-02-16 20:37:46 +08:00
</div>
</div>
<div class="middle">
<div class="datas" v-if="data.length">
<div class="card" v-for="(item, index) in 3" :key="index" @click="toDetail(item)">
<div class="cardTop">
2022-02-17 16:07:34 +08:00
<img src="../../static/workOnline/icon3@2x.png" alt="" />
2022-02-16 20:37:46 +08:00
<div class="rightTop">
<div class="leftStaus">
<span class="names">雷洋</span>
<span class="titless">美丽庭院 | 2020-10-28 12</span>
</div>
<!-- :style="{ class: item.auditStatus == 0 ? 'status0' : item.auditStatus == 1 ? 'status1' : 'status2' }" -->
2022-02-17 18:17:40 +08:00
<div class="statusDele">
2022-02-18 09:36:31 +08:00
<div class="status status0" v-if="tabIndex0 == 3">审核中</div>
2022-02-17 18:17:40 +08:00
2022-02-18 09:36:31 +08:00
<div class="dels" @click.stop="toAdd(item)">编辑</div>
<div class="dels" @click.stop=";(delShow = true), (deleId = item.id)">删除</div>
<!-- <img src="../../static/AppVillager/4.png" alt="" @click.stop="delShow = true" class="dels" /> -->
2022-02-17 18:17:40 +08:00
</div>
2022-02-16 20:37:46 +08:00
</div>
</div>
2022-02-18 09:36:31 +08:00
<div class="tabCurrent0" v-if="tabIndex0 != 3 || tabCurrent1 == 0">
2022-02-16 20:37:46 +08:00
<div class="cardConts">秋穿上漫步森林在阳光下呼吸伸展在安逸的天也许是兰天名字的由来吧</div>
<div class="cardImg">
2022-02-17 16:07:34 +08:00
<img src="../../static/workOnline/icon3@2x.png" alt="" v-for="(items, i) in 4" :key="i" />
2022-02-16 20:37:46 +08:00
</div>
<div class="cardBot">
2022-02-17 10:01:37 +08:00
<div class="icons">
2022-02-16 20:37:46 +08:00
<u-icon name="map-fill"></u-icon>
<span>东湖生态旅游风景区听涛景区</span>
</div>
2022-02-18 09:36:31 +08:00
<div class="icones" v-if="tabIndex0 != 3">
2022-02-16 20:37:46 +08:00
<div class="img1">
<img src="../../static/AppVillager/1.png" alt="" class="img11" />
</div>
<div class="rightFlex">
<img src="../../static/AppVillager/2.png" alt="" class="img2" />
<img src="../../static/AppVillager/3.png" alt="" class="img3" />
</div>
</div>
</div>
</div>
2022-02-18 09:36:31 +08:00
<div class="tabCurrent11" v-if="tabIndex0 == 3 && tabCurrent1 == 1">
2022-02-16 20:37:46 +08:00
<div class="cardsConts">针不戳</div>
<div class="reply">
<span class="toReply">回复的话</span>
<span class="contens"></span>
</div>
<div class="nopass">
<span>未通过理由</span>
<span>请勿带情绪进行评论</span>
</div>
</div>
</div>
</div>
<AiEmpty description="暂无数据" class="emptyWrap"></AiEmpty>
</div>
2022-02-18 09:36:31 +08:00
<!-- <AiFixedBtn v-if="tabIndex0 == 3 && tabCurrent1 == 1" @click.native="toAdd()">
2022-02-17 18:17:40 +08:00
<div class="addBtn iconfont iconfont-iconfangda">发起审核</div>
</AiFixedBtn> -->
2022-02-18 09:36:31 +08:00
<div class="addBtn" v-if="tabIndex0 == 3 && tabCurrent1 == 1" @click.native="toAdd()">发起审核</div>
2022-02-17 18:17:40 +08:00
<u-modal v-model="delShow" content="确定删除该数据" :mask-close-able="true" @confirm="confirmDel"></u-modal>
2022-02-16 20:37:46 +08:00
</div>
</template>
<script>
export default {
name: 'AppVillager',
appName: '村民圈',
components: {},
props: {},
data() {
return {
tabs: [
{
name: '本村',
},
{
name: '本镇',
},
{
name: '本县',
},
{
name: '我参与的',
},
],
2022-02-18 09:36:31 +08:00
tabIndex0: 0,
2022-02-16 20:37:46 +08:00
tabList: [
{
name: '我的话题',
},
{
name: '我的评论',
},
],
2022-02-18 09:36:31 +08:00
tabCurrent1: 0,
2022-02-16 20:37:46 +08:00
data: [{ value: 0, title: '弃捐勿复道,努力加餐饭' }],
itemList: [
{
name: '全部',
2022-02-18 09:36:31 +08:00
indexTab2: 0,
2022-02-16 20:37:46 +08:00
},
{
name: '已通过',
2022-02-18 09:36:31 +08:00
indexTab2: 1,
2022-02-16 20:37:46 +08:00
},
{
name: '未通过',
2022-02-18 09:36:31 +08:00
indexTab2: 2,
2022-02-16 20:37:46 +08:00
},
{
name: '审核中',
2022-02-18 09:36:31 +08:00
indexTab2: 3,
2022-02-16 20:37:46 +08:00
},
],
2022-02-18 09:36:31 +08:00
indexTab2: 0,
2022-02-17 18:17:40 +08:00
delShow: false,
2022-02-17 19:03:11 +08:00
current: 1,
2022-02-16 20:37:46 +08:00
}
},
computed: {},
watch: {},
2022-02-17 18:17:40 +08:00
onLoad() {
this.$dict.load('villagerCircleTopic').then(() => {
// this.getList()
})
},
2022-02-16 20:37:46 +08:00
onShow() {
uni.$on('updateList', () => {
this.getList()
})
},
methods: {
2022-02-17 19:03:11 +08:00
getList() {
this.$instance
.post('/app/appvillagerintegraldeclare/list', null, {
params: {
size: 6,
current: this.current,
residentId: this.user.residentId,
},
})
.then((res) => {
if (res.code == 0) {
this.data = this.current > 1 ? [...this.data, ...res.data.records] : res.data.records
}
})
},
2022-02-16 20:37:46 +08:00
change(index) {
// this.data = []
2022-02-18 09:36:31 +08:00
this.tabIndex0 = index
2022-02-16 20:37:46 +08:00
this.current = 1
// this.getList()
},
changetabIndex(e) {
2022-02-18 09:36:31 +08:00
this.tabCurrent1 = e
2022-02-16 20:37:46 +08:00
},
hander(i) {
2022-02-18 09:36:31 +08:00
this.indexTab2 = i
2022-02-16 20:37:46 +08:00
},
toDetail(item) {
this.$linkTo(`./detail?id=${item.id}`)
},
2022-02-18 09:36:31 +08:00
toAdd(item) {
if (item) {
this.$linkTo(`./add?id=${item.id}`)
} else {
this.$linkTo(`./add`)
}
2022-02-16 20:37:46 +08:00
},
2022-02-17 18:17:40 +08:00
confirmDel() {
this.$instance
.post(`/app/appvillagercircleinfo/delete?ids=${this.deleId}`)
.then((res) => {
if (res?.data) {
this.deleShow = false
this.modalShow = false
this.deleId = ''
this.getDetail()
}
})
.catch((e) => {
this.$hideLoading()
this.$u.toast(e)
})
},
2022-02-16 20:37:46 +08:00
},
2022-02-17 19:03:11 +08:00
onReachBottom() {
this.current = this.current + 1
this.getList()
},
2022-02-16 20:37:46 +08:00
}
</script>
<style scoped lang="scss">
.Page {
.active {
color: #4181ff !important;
border: 1px solid #4181ff !important;
}
.noactive {
color: #666;
border: 1px solid #ddd;
}
::v-deep .u-tabs1 {
.u-tabs {
padding-top: 32px;
padding-bottom: 60px;
padding-right: 300px;
width: 100%;
background: #197df0;
}
}
.top {
padding: 0 0 32px 16px;
background: #fff;
border-radius: 32px 32px 0px 0px;
margin-top: -30px;
.tabIndex012 {
padding-top: 32px;
display: flex;
2022-02-17 18:17:40 +08:00
flex-wrap: wrap;
2022-02-16 20:37:46 +08:00
.tags {
padding: 8px 32px;
background: #ffffff;
border-radius: 32px;
margin-left: 16px;
border: 1px solid #4181ff;
}
2022-02-17 18:17:40 +08:00
.tags:nth-child(n + 4) {
margin-top: 10px;
}
2022-02-16 20:37:46 +08:00
}
2022-02-18 09:36:31 +08:00
.indexTab22 {
2022-02-16 20:37:46 +08:00
padding-top: 32px;
display: flex;
.tags {
padding: 8px 32px;
background: #ffffff;
border-radius: 32px;
margin-left: 16px;
border: 1px solid #ddd;
}
}
::v-deep .u-tabs2 {
.u-tabs {
padding: 0 !important;
}
}
}
.middle {
padding: 0 32px;
background: #fff;
.datas {
.card {
padding: 32px 0 48px 0;
2022-02-17 10:01:02 +08:00
box-shadow: inset 0px -1px 0px 0px #dddddd;
2022-02-16 20:37:46 +08:00
.cardTop {
display: flex;
img {
width: 96px;
height: 96px;
border-radius: 50%;
}
.rightTop {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
.leftStaus {
display: flex;
flex-direction: column;
margin-left: 16px;
.names {
font-size: 32px;
font-weight: 500;
}
.titless {
font-size: 26px;
color: #6e727a;
2022-02-17 10:01:02 +08:00
margin-top: 6px;
2022-02-16 20:37:46 +08:00
}
}
2022-02-17 18:17:40 +08:00
.statusDele {
display: flex;
align-items: center;
.status {
font-size: 28px;
}
.status0 {
color: #42d784;
}
.status1 {
color: #ff4466;
}
.status2 {
color: #ff883c;
}
.dels {
margin-left: 20px;
width: 68px;
height: 68px;
}
2022-02-16 20:37:46 +08:00
}
}
}
.tabCurrent0 {
.cardConts {
margin-top: 24px;
font-size: 32px;
}
.cardImg {
margin-top: 24px;
img {
width: 226px;
height: 226px;
margin-right: 4px;
}
img:nth-child(3n + 0) {
margin-right: 0;
}
}
.cardBot {
margin-top: 24px;
2022-02-17 10:01:37 +08:00
.icons {
2022-02-16 20:37:46 +08:00
padding: 8px 32px 8px 16px;
background: #eff1f3;
border-radius: 28px;
}
2022-02-17 10:01:37 +08:00
.icones {
2022-02-16 20:37:46 +08:00
display: flex;
justify-content: space-between;
margin-top: 24px;
.img1 {
width: 60%;
.img11 {
width: 48px;
height: 48px;
}
}
.rightFlex {
display: flex;
justify-content: space-between;
2022-02-17 10:01:02 +08:00
width: 27%;
2022-02-16 20:37:46 +08:00
.img2,
.img3 {
width: 48px;
height: 48px;
}
}
}
}
}
2022-02-18 09:36:31 +08:00
.tabCurrent11 {
2022-02-16 20:37:46 +08:00
.cardsConts {
margin-top: 24px;
font-size: 32px;
}
.reply {
padding: 24px;
background: #f3f6f9;
border-radius: 16px;
margin: 24px;
.toReply {
font-size: 26px;
color: #999999;
}
.contens {
color: #333;
}
}
.nopass {
padding: 24px;
margin-top: 24px;
background: #fff5f7;
border-radius: 16px;
font-size: 26px;
color: #ff4466;
}
}
}
}
}
.AiFixedBtn {
.movableArea {
.addBtn {
display: flex;
justify-content: center;
align-items: center;
width: 96px;
height: 96px;
flex-shrink: 0;
background: #fff;
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
font-size: 28px;
color: #1365dd;
border-radius: 50%;
}
}
}
2022-02-17 18:17:40 +08:00
.addBtn {
position: fixed;
right: 5%;
bottom: 15%;
width: 96px;
height: 96px;
line-height: 96px;
text-align: center;
font-size: 24px;
color: #1365dd;
border-radius: 50%;
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
}
2022-02-16 20:37:46 +08:00
}
</style>