This commit is contained in:
liuye
2024-07-08 14:10:18 +08:00
parent db5233f3ff
commit 2a88b48ce5
56 changed files with 8080 additions and 1 deletions

View File

@@ -5,7 +5,7 @@
"versionCode": "100",
"transformPx": true,
"mp-weixin": {
"appid": "wx8d6346f632980668",
"appid": "wx576d5e829b9e7d49",
"setting": {
"urlCheck": false
},

View File

@@ -0,0 +1,661 @@
<template>
<div class="page">
<div class="header-content">
<u-navbar :is-back="false" title="数智巫溪" title-color="#000" title-width="300" title-size="32" :title-bold="true" :background="backgroundNavbar"></u-navbar>
<div class="header-bg">
<div class="weather-info" v-if="weatherInfo.wea">
<img :src="weatherInfo.icon" alt="" />
<p>今天{{weatherInfo.wea}}{{weatherInfo.tem2}}~{{weatherInfo.tem1}},{{weatherInfo.air_tips}}</p>
</div>
<div class="swiper-content">
<u-swiper :list="swiperList" mode="none" height="364" bg-color="none" @click="handleBannerClick"/>
</div>
<div class="notice">
<img :src="`${cdn}/notice-new.png`" alt="">
<u-notice-bar mode="vertical" color="#4181FF" style="flex: 1;" :volume-icon="false" :is-circular="false"
duration="5000" speed="5000" :list="noticeList" @click="clickNotice"/>
</div>
</div>
</div>
<div class="app-list" v-for="(item, index) in appList" :key="index">
<div class="title-content">
<h2>{{item.name}}</h2>
<div @click="toService()">更多<img src="https://cdn.cunwuyun.cn/wechat/wuxi/right-icon-blue.png" alt=""></div>
</div>
<div class="banner-flex" v-if="item.bannerApp && item.bannerApp.length">
<div class="item-banner" v-for="(banner, bannerIndex) in item.bannerApp" :key="bannerIndex" @click="openApp(banner)">
<img :src="banner.pictureUrl" alt="">
</div>
</div>
<div class="app-content" v-if="item.apps && item.apps.length">
<div class="item-app" v-for="(app, appIndex) in item.apps" :key="appIndex" @click="openApp(app)">
<img :src="app.pictureUrl">
<p>{{app.name}}</p>
</div>
</div>
</div>
<template v-if="categorys&&categorys.length>0">
<u-tabs :list="categorys.map(e=>({name:e.categoryName}))" font-size="40" bg-color="transparent"
inactive-color="#999999" :active-item-style="active"
:is-scroll="true" :current="index" @change="tabChange"/>
<div class="list-wrap" v-if="categoryList && categoryList.length>0">
<div class="list-card" v-for="(category,index) in categoryList" :key="index"
@click="$linkTo('/mods/AppContent/contentDetail?id='+category.id)">
<div class="header">{{ category.title }}</div>
<div class="content-wrap"
v-if="category.contentType==0 && category.files && category.files.length<3&&category.files.length>0">
<img class="img" :src="item.url" v-for="(item,index) in category.files.slice(0,1)" :key="index.id">
</div>
<div class="content-wrap" v-if="category.contentType==0 && category.files && category.files.length >= 3">
<img class="min-img" :src="item.url" v-for="(item,index) in category.files.slice(0,3)" :key="index.id">
</div>
<div class="content-wrap" v-if="category.contentType == 1">
<img class="img" :src="category.pictureUrl" alt=""/>
<img class="play-icon" :src="`${cdn}/play.png`" alt=""/>
</div>
<div class="bottom">
<div class="left">
<div class="tag">{{ category.categoryName }}</div>
{{ category.createTime }}
</div>
<div class="right">
<em>{{ category.viewCount }}</em>
人看过
</div>
</div>
</div>
</div>
<AiEmpty v-else/>
</template>
<AiLogin ref="login"/>
</div>
</template>
<script>
import {mapActions, mapState} from 'vuex'
export default {
customNavigation: true,
name: 'AppHome',
appName: "首页",
data() {
return {
cdn: "https://cdn.cunwuyun.cn/wxmp",
swiperList: ['https://cdn.cunwuyun.cn/wechat/wuxi/home-swiper1.png'],
index: 0,
grids: [],
activeList: [],
notices: [],
categorys: [],
categoryList: [],
search: {areaId: ''},
backgroundNavbar: {
background: 'url(https://cdn.cunwuyun.cn/wechat/wuxi/wuxi-nav-bg.png) no-repeat',
backgroundSize: 'cover',
},
appList: [], //应用列表
weatherInfo: {}
}
},
computed: {
...mapState(['user', 'token']),
active() {
return {
fontSize: '22px',
color: '#333333',
}
},
noticeList() {
let {notices} = this
return notices?.length > 0 ? notices?.map(e => e.title) || ['暂无公告'] : ['暂无公告']
}
},
onReady() {
// uni.setNavigationBarTitle({title: "数智巫溪"})
},
onLoad() {
this.autoLogin().then(() => {
this.getSwiperList();
this.getName();
// this.getGrids();
this.getActive();
this.getNotice();
this.getAppList()
this.getWeather()
})
},
methods: {
...mapActions(['autoLogin', 'authCheck']),
getName() {
this.$instance.post("/app/appcontentmoduleinfo/listByName", null, {
params: {names: "新闻发布"},
withoutToken: true
}).then(res => {
if (res?.data[0]?.categoryList?.length) {
this.categorys = res.data[0]["categoryList"];
this.search.moduleId = res.data[0]['id']
this.search.categoryId = res.data[0]['categoryList'][0]['id']
this.getCategoryList()
}
})
},
tabChange(idx) {
this.index = idx
this.search.categoryId = this.categorys[idx]['id']
this.getCategoryList()
},
getCategoryList() {
this.$instance.post("/app/appcontentinfo/list", null, {
params: {...this.search, size: 100}
}).then(res => {
if (res?.data) {
this.categoryList = res.data.records;
}
})
},
clickNotice(val) {
const id = this.notices[val]["id"];
if (id) {
uni.navigateTo({
url: "/mods/AppNotice/AppNotice?id=" + id
})
}
},
handleActive({type, appId, url}) {
if (type == 0) {
uni.navigateToMiniProgram({appId})
} else if (type == 1) {
this.$linkTo("/subPages/h5/webview?link=" + url);
}
},
getNotice() {
this.$instance.post("/app/appmininotice/list", null, {
params: {size: 999},
withoutToken: true
}).then(res => {
if (res?.data) {
this.notices = res.data.records;
}
})
},
getActive() {
this.$instance.post("/app/appminitopicconfig/list", null, {
params: {size: 999},
withoutToken: true
}).then(res => {
if (res?.data) {
this.activeList = res.data.records;
}
})
},
/**
* 获取顶部九宫格
*/
getGrids() {
this.$instance.post("/app/appminihomeconfig/list", null, {
params: {picked: 1},
withoutToken: true
}).then(res => {
if (res?.data) {
this.grids = res.data.records;
}
})
},
getSwiperList() {
this.$instance.post('/app/appbanner/listForWx', null, {
withoutToken: true
}).then((res) => {
if (res?.data) {
this.swiperList = res.data?.map((e) => ({...e, image: e.imgUrl})) || []
}
})
},
handleClick({type, appId, modulePath, url, checkType, corpId}) {
//先判读是不是系统应用
if (type != "0") {
if (type == "1") {
uni.navigateToMiniProgram({appId});
} else if (type == "2") {
uni.navigateTo({url: "/subPages/h5/webview?link=" + url});
} else if (type == "3") {
this.$linkTo(url);
} else if (type == "4") {
uni.openCustomerServiceChat({
extInfo: {url: url},
corpId: corpId,
fail: () => {
this.$u.toast('请使用普通微信打开小程序进行咨询');
}
});
}
} else if (type && type == "0") {
uni.showLoading({title: '正在进入应用...'})
this.authCheck({checkType, modulePath}).finally(() => uni.hideLoading())
}
},
handleBannerClick(index) {
if (!this.swiperList[index].linkUrl) return
if (this.swiperList[index].type == '0') { //0 h5链接 1 小程序链接; 2外部小程序
this.$linkTo(`/subPages/h5/webview?link=${this.swiperList?.[index]?.linkUrl}&title=${this.swiperList?.[index]?.title}`)
} else if (this.swiperList[index].type == '1') {
this.$linkTo(`${this.swiperList?.[index]?.linkUrl}`)
} else {
wx.navigateToMiniProgram({
appId: this.swiperList[index].linkUrl
})
}
},
getAppList() {
this.$instance.get("/wuxi_home.json", null, { withoutToken: true }).then(res => {
if (res.length) {
this.appList = res
}
})
},
toService() {
uni.switchTab({
url: '/pages/AppModules/AppModules'
})
},
openApp(row) {
if(row.type == 1) { //type 0:内置应用, 1:外链, 2tabbar页面
uni.navigateToMiniProgram({appId: row.appId});
}else if(row.type == 2) {
uni.switchTab({url: row.modulePath})
}else {
uni.navigateTo({url: row.modulePath})
}
},
getWeather() {
this.$instance.post("/app/weather/queryWeather", {cityId: 101041800}, { withoutToken: true }).then(res => {
if (res.data) {
this.weatherInfo = res.data
this.weatherInfo.icon = 'https://cdn.cunwuyun.cn/wuxi/home/weather-'+this.weatherInfo.wea_img+'.png'
}
})
},
},
onShareAppMessage() {
return {
title: '欢迎使用数智巫溪~',
path: `/pages/AppHome/AppHome`
}
},
}
</script>
<style scoped lang="scss">
@import "~dvcp-wui/common";
.page {
width: 100%;
min-height: 100%;
background-color: #fff;
position: relative;
.header-content {
.header-bg {
background: url('https://cdn.cunwuyun.cn/wechat/wuxi/wuxi-header-bg.png') center;
background-size: 100% 100%;
}
.weather-info {
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 28px;
color: #222;
padding: 12px 34px;
display: flex;
img {
width: 56px;
height: 52px;
margin-right: 12px;
vertical-align: middle;
}
p {
width: calc(100% - 68px);
}
}
.swiper-content {
width: 686px;
height: 364px;
margin: 20px auto 24px;
}
::v-deep .notice {
width: 686px;
height: 88px;
box-sizing: border-box;
padding: 0 24px;
margin: 0 auto;
background: #FFFFFF;
box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.02);
border-radius: 16px;
display: flex;
align-items: center;
justify-content: center;
& > img {
width: 128px;
height: 52px;
}
.u-news-item {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
}
}
// .app-list {
// margin-bottom: 24px;
// }
.title-content {
display: flex;
justify-content: space-between;
padding: 32px;
line-height: 40px;
h2 {
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 34px;
color: #222;
}
div {
font-family: PingFangSC-Regular;
font-size: 28px;
color: #687DA6;
img {
width: 32px;
height: 32px;
margin-left: 6px;
vertical-align: middle;
}
}
}
.banner-flex {
display: flex;
justify-content: space-between;
padding: 0 32px;
.item-banner {
width: calc(50% - 16px);
height: 160px;
position: relative;
img {
width: 100%;
height: 100%;
}
.banner-text {
position: absolute;
top: 26px;
left: 28px;
}
h2 {
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 30px;
line-height: 48px;
}
p {
font-family: PingFangSC-Regular;
font-size: 22px;
line-height: 32px;
}
}
.color-3872BC {
color: #3872BC;
}
.color-CE5A5A {
color: #CE5A5A;
}
.color-409681 {
color: #409681;
}
}
.app-content {
padding: 48px 16px 8px;
// display: flex;
.item-app {
display: inline-block;
width: 25%;
text-align: center;
margin-bottom: 20px;
img {
width: 96px;
height: 96px;
}
p {
font-family: PingFangSC-Regular;
font-size: 26px;
color: #222;
text-align: center;
line-height: 36px;
margin-top: 16px;
}
}
.item-app:nth-of-type(4n) {
margin-right: 0;
}
}
.banner-content {
display: flex;
padding: 0 32px;
.banner-left {
width: 322px;
height: 462px;
margin-right: 30px;
position: relative;
h2 {
font-family: PingFangSC-SNaNpxibold;
font-weight: 600;
font-size: 36px;
line-height: 48px;
margin-bottom: 4px;
}
p {
font-family: PingFangSC-Regular;
font-size: 22px;
line-height: 40px;
img {
width: 20px;
height: 20px;
margin-right: 8px;
}
}
}
.color-4C3FCD {
color: #4C3FCD;
}
.banner-right {
.item {
width: 334px;
height: 216px;
position: relative;
h2 {
font-family: PingFangSC-SNaNpxibold;
font-weight: 500;
font-size: 30px;
line-height: 48px;
margin-bottom: 4px;
}
p {
font-family: PingFangSC-Regular;
font-size: 22px;
line-height: 32px;
}
}
.item:nth-of-type(1) {
margin-bottom: 30px;
}
.color-DF863E {
color: #DF863E;
}
.color-D9606E {
color: #D9606E;
}
}
.banner-img {
width: 100%;
height: 100%;
}
.banner-text {
position: absolute;
top: 26px;
left: 28px;
}
}
.grid-content {
box-sizing: border-box;
.grid-item {
img {
width: 108px;
height: 108px;
object-fit: fill;
}
.grid-text {
font-size: 26px;
font-weight: 400;
color: #333333;
line-height: 36px;
}
}
}
.list-wrap {
box-sizing: border-box;
padding: 32px;
.list-card {
width: 100%;
min-height: 100px;
background: #FFFFFF;
box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.02);
border-radius: 16px;
box-sizing: border-box;
padding: 32px;
margin-bottom: 24px;
.header {
font-size: 36px;
font-weight: 600;
color: #333333;
line-height: 50px;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.content-wrap {
display: flex;
gap: 4px;
flex-wrap: wrap;
margin-top: 24px;
position: relative;
.img {
width: 100%;
height: 350px;
}
.min-img {
width: 204px;
height: 204px;
}
.play-icon {
width: 80px;
height: 80px;
border-radius: 50%;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
}
.bottom {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 24px;
.left {
display: flex;
align-items: center;
font-size: 28px;
font-weight: 400;
color: #999999;
.tag {
width: 144px;
height: 48px;
background: #EEEEEE;
border-radius: 24px;
display: flex;
align-items: center;
justify-content: center;
font-size: 28px;
font-weight: 400;
color: #999999;
margin-right: 16px;
}
}
.right {
font-size: 28px;
font-weight: 400;
color: #999999;
display: flex;
align-items: center;
em {
font-style: normal;
color: #4181FF;
}
}
}
}
}
header {
font-size: 44px;
font-weight: 600;
color: #333333;
padding: 0 32px;
margin-bottom: 32px;
}
.scroll-wrap {
box-sizing: border-box;
padding: 0 32px;
width: 100%;
white-space: nowrap;
margin-bottom: 24px;
.scroll-card {
display: inline-block;
width: 440px;
height: 240px;
box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.02);
border-radius: 16px;
margin-right: 32px;
&:last-child {
margin-right: 0;
}
}
}
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 965 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1000 B

View File

@@ -0,0 +1,122 @@
<template>
<div class="openPage">
<!-- <img class="images" :src="picUrl" alt=""> -->
<div class="uni-swiper-dot-box">
<swiper class="swiper-box" @change="change" :current="current">
<swiper-item v-for="(item, index) in imgList" :key="index">
<img :src="item" alt="" class="banner-img">
</swiper-item>
</swiper>
<div class="dot-list">
<span v-for="(item, index) in dotList" :key="index" :class="current == index ? 'active' : ''"></span>
</div>
</div>
</div>
</template>
<script>
export default {
name: "openPage",
customNavigation: true,
data() {
return {
picUrl: '',
status: '',
imgList: [
'https://cdn.cunwuyun.cn/wechat/wuxi/wuxi-page1.png',
'https://cdn.cunwuyun.cn/wechat/wuxi/wuxi-page2.png',
'https://cdn.cunwuyun.cn/wechat/wuxi/wuxi-page3.png',
],
current: 0,
dotList: [0, 1, 2]
}
},
methods: {
change(e) {
this.current = e.detail.current;
if(this.current == 2) {
setTimeout(() => {
uni.switchTab({
url: '/pages/AppHome/AppHome'
})
}, 2000)
}
},
getStatus() {
this.$instance.post('/app/appwechatguidepage/enableStatus',null, { withoutToken: true }).then(res=> {
if(res?.data) {
this.status = res.data
if(this.status==0) {
uni.switchTab({
url: '/pages/AppHome/AppHome'
})
} else {
// this.getList()
// setTimeout(() => {
// uni.switchTab({
// url: '/pages/AppHome/AppHome'
// })
// }, 3000)
}
}
})
},
getList() {
this.$instance.post('/app/appwechatguidepage/listForXCX',null, {
withoutToken: true,
params: {
current: 1,
size: 100,
}
}).then(res=> {
if(res?.data) {
let nums = res.data.records
let index = Math.floor(Math.random() * nums.length)
this.picUrl = nums[index].picUrl
}
})
}
},
onShow() {
this.getStatus()
},
}
</script>
<style scoped lang="scss">
.openPage {
width: 100%;
height: 100vh;
box-sizing: border-box;
::v-deep .uni-swiper-dot-box {
width: 100%!important;
height: 100%!important;
}
::v-deep .swiper-box {
height: 100%!important;
}
.banner-img {
width: 100%;
height: 100%;
}
.dot-list {
position: fixed;
bottom: 118px;
width: 100%;
text-align: center;
span {
display: inline-block;
width: 12px;
height: 12px;
opacity: 0.3;
background: #026AF2;
border-radius: 6px;
margin-right: 8px;
}
.active {
width: 22px;
opacity: 1;
}
}
}
</style>

View File

@@ -0,0 +1,441 @@
<template>
<div class="page">
<div class="header-bg">
<div class="header-info">
<div class="wrap" @click="handleLogin()">
<div class="user-img-div">
<img :src="user.avatarUrl" alt="" class="user-img" v-if="user.id && user.avatarUrl"/>
<img class="user-img" src="https://cdn.cunwuyun.cn/dvcp/myFamily/tx.png" v-else alt="">
</div>
<div class="user-info">
<div class="option">
<template v-if="!user.id">
<p>登录</p>
<p>点击进行登录</p>
</template>
<template v-else>
<p v-if="isApprove">{{ user.realName }}</p>
<p v-else>{{ user.nickName }}</p>
<p>{{ user.areaName || "" }}</p>
</template>
</div>
<p class="info" v-if="user.id" @click.stop="$linkTo('./userInfo')">个人信息</p>
</div>
</div>
</div>
</div>
<div class="approve" @click="$linkTo('./userInfo')">
<img class="icon" src="https://cdn.cunwuyun.cn/wxmp/mine/approve.png" alt="">
<div class="flex">
<span class="cert" v-if="isApprove" v-text="approveLabel"></span>
<u-icon v-else name="arrow-right" color="#E7F2FF" size="28"
:label="approveLabel" label-color="#E7F2FF" label-pos="left" @click="approve"/>
</div>
</div>
<div class="list-wrap">
<div class="card" v-for="(group,index) in listGroup" :key="index">
<div class="item" v-for="(item) in group" hover-class="bg-hover" :key="item.label"
@click="linkTo(item.path, item.type)">
<div class="block">
<img class="icon" :src="item.icon" alt="">
</div>
<span class="desc solid" v-if="!item.share">{{ item.label }}</span>
<button open-type="share" v-else>
<span>{{ item.label }}</span>
</button>
</div>
<!-- <div class="item" hover-class="bg-hover" @click="scan">
<div class="block">
<img class="icon" src="https://cdn.cunwuyun.cn/wxmp/mine/saoyisao.png" alt="">
</div>
<span class="desc">扫一扫</span>
</div> -->
</div>
</div>
<div class="logout" v-if="token">
<b class="login-out" @click="onLogout">退出登录</b>
</div>
<AiLogin ref="login" @success="getAuth()"/>
</div>
</template>
<script>
import {mapActions, mapState} from "vuex";
export default {
name: "AppMine",
appName: "我的",
customNavigation: true,
navigationBarBackgroundColor: '#ffffff',
navigationBarTextStyle: 'black',
computed: {
...mapState(['user', 'token']),
isApprove() {
return this.user?.status == 2;
},
approveLabel() {
return this.user?.areaId? "已认证" : "前往认证"
},
listGroup() {
return [
[
// {
// icon: "https://cdn.cunwuyun.cn/wxmp/mine/wodejiaxiang.png",
// label: "我的家乡",
// path: "/mods/AppHometown/AppHometown",
// type: 'token'
// },
// {
// icon: "https://cdn.cunwuyun.cn/wechat/biaopin/mine/mine-icon-wdjt.png",
// label: "我的家庭",
// path: "./myFamily",
// type: 'token'
// },
{
icon: "https://cdn.cunwuyun.cn/wechat/biaopin/mine/mine-icon-wdjf.png",
label: "我的积分",
path: "./myIntegral",
type: 'token'
},
// {
// icon: "https://cdn.cunwuyun.cn/wechat/biaopin/mine/mine-icon-wdewm.png",
// label: "我的二维码",
// path: "./myHarvestQR",
// type: 'token'
// },
// {
// icon: "https://cdn.cunwuyun.cn/wechat/biaopin/mine/mine-icon-sys.png",
// label: "扫一扫",
// path: "./myHarvestQR",
// type: 'scan'
// },
{
icon: "https://cdn.cunwuyun.cn/wechat/biaopin/mine/mine-icon-fxxcx.png",
label: "分享小程序",
path: "./myHarvestQR",
type: 'share',
share: true
},
],
// [
// {
// icon: "https://cdn.cunwuyun.cn/wxmp/mine/wodejifen.png",
// label: "我的积分",
// path: "/mods/AppCreditPoints/AppCreditPoints?type=detail",
// type: 'idNumber'
// },
// {
// icon: "https://cdn.cunwuyun.cn/wxmp/mine/chaoshidingdan.png",
// label: "超市订单",
// path: "/mods/AppOrderList/AppOrderList",
// type: 'idNumber'
// },
// {
// icon: "https://cdn.cunwuyun.cn/wxmp/mine/banshijindu.png",
// label: "办事进度",
// path: "/mods/AppProgress/AppProgress",
// type: 'idNumber'
// }
// ],
]
}
},
methods: {
...mapActions(['getUserInfo']),
approve() {
if (!this.token) {
this.$refs.login.show();
} else if (!this.isApprove) {
if (this.user.status == 0) {
this.$linkTo('/mods/AppAuth/AppAuth');
} else {
this.$linkTo('/mods/AppAuth/authSuccess')
}
}
},
linkTo(url, type) {
if (type) {
if (this.token) {
if (type == 'token') {
this.$linkTo(url)
}
if (type == 'idNumber') {
if (this.user.status == 0) {
if (!this.user.phone) {
this.$linkTo('/pages/phone/bingPhoneNumber?from=auth')
} else {
this.$linkTo('/mods/AppAuth/AppAuth')
}
} else {
this.$linkTo(url)
}
}
if (type == 'scan') {
this.scan()
}
if (type == 'share') {
}
if (type == 'null') {
this.$u.toast('内容建设中...')
}
} else {
this.$refs.login.show()
}
} else {
this.$linkTo(url)
}
},
handleLogin() {
if (!this.token) {
this.$refs.login.show();
}
},
getAuth() {
this.$nextTick(() => {
this.token && this.getUserInfo('qujing')
})
},
onLogout() {
uni.showModal({
title: '提示',
content: "是否要退出登录",
success: res => {
if (res.confirm) {
this.$store.commit('logout')
this.$toast('退出成功');
setTimeout(() => {
this.getAuth();
}, 500)
}
}
})
},
scan() {
uni.scanCode({
success: (res) => {
var info = JSON.parse(res.result)
uni.navigateTo({url: `./addFamily?avatarUrl=${info.avatarUrl || ''}&nickName=${info.nickName}&openId=${info.openId}`})
}
});
}
},
onLoad() {
this.getAuth();
uni.$on('auth',()=> {
this.getAuth();
})
},
onShareAppMessage() {
return {
title: '欢迎使用数字乡村治理服务一体化平台~',
path: `/pages/AppModules/AppModules`
}
},
}
</script>
<style scoped lang="scss">
@import "~dvcp-wui/common";
.page {
width: 100%;
min-height: 100%;
background-color: #F3F6F9;
position: relative;
.header-bg {
width: 100%;
height: 512px;
position: relative;
.header-info {
width: 100%;
height: 100%;
background: url('https://cdn.cunwuyun.cn/wechat/biaopin/mine/mine-top-bg.png') no-repeat;
background: 100% auto;
box-sizing: border-box;
padding: 240px 0 0 48px;
.wrap {
width: 100%;
height: 96px;
display: flex;
align-items: center;
.user-img-div {
display: inline-block;
width: 96px;
height: 96px;
border-radius: 50%;
overflow: hidden;
border: 4px solid #FFFFFF;
flex-shrink: 0;
.user-img {
display: inline-block;
width: 96px;
height: 96px;
border-radius: 58px;
}
}
.user-info {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
margin-left: 26px;
box-sizing: border-box;
padding-right: 32px;
.option {
& > p:first-child {
font-size: 34px;
font-weight: 600;
color: #333333;
line-height: 54px;
}
& > p:last-child {
font-size: 26px;
font-weight: 400;
color: #7088A0;
line-height: 36px;
}
}
.info {
width: 136px;
height: 48px;
border-radius: 8px;
border: 2px solid #7088A0;
font-size: 26px;
font-weight: 400;
color: #7088A0;
display: flex;
align-items: center;
justify-content: center;
}
}
}
}
}
.approve {
position: absolute;
left: 50%;
top: 400px;
transform: translateX(-50%);
width: 686px;
height: 112px;
background: linear-gradient(90deg, #8FB4FF 0%, #4181FF 100%);
border-radius: 16px;
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 0 20px;
.icon {
width: 296px;
height: 52px;
}
.cert {
font-family: PingFangSC-Regular, PingFang SC;
font-size: 28px;
color: #E7F2FF;
margin-right: 4px;
}
}
.list-wrap {
box-sizing: border-box;
padding: 32px;
.card {
width: 100%;
min-height: 100px;
border-radius: 16px;
background-color: #fff;
margin-bottom: 32px;
.item {
height: 100px;
display: flex;
align-items: center;
&:last-child {
.desc {
// border-bottom: none !important;
}
}
.block {
width: 80px;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
.icon {
width: 44px;
height: 44px;
}
}
.desc, & > button {
height: 100%;
flex: 1;
font-size: 30px;
font-weight: 400;
color: #666666;
display: flex;
align-items: center;
box-sizing: border-box;
& > span {
width: 100%;
height: 100%;
text-align: left;
display: flex;
align-items: center;
}
&::after {
border: none;
}
}
.solid {
border-bottom: 1px solid #EEE;
}
.no-border {
border-bottom: none;
}
}
&:first-of-type {
margin-bottom: 32px;
}
}
}
.logout {
width: 100%;
height: 96px;
padding: 0 32px;
box-sizing: border-box;
line-height: 96px;
text-align: center;
.login-out {
background: #FFF;
border-radius: 16px;
font-size: 34px;
font-weight: 500;
color: #4181FF;
}
}
}
</style>

View File

@@ -0,0 +1,85 @@
<template>
<div class="page">
<div class="content">
<img :src="familyInfo.avatarUrl" alt="" v-if="familyInfo.avatarUrl">
<img src="https://cdn.cunwuyun.cn/dvcp/myFamily/tx.png" alt="" v-else>
<p class="user-name">{{familyInfo.nickName}}</p>
<div class="btn" @click="add">加为家人</div>
</div>
</div>
</template>
<script>
import {mapState} from 'vuex'
export default {
appName: "加家人",
computed: {
...mapState(['user', 'token'])
},
data() {
return {
familyInfo: {}
}
},
onLoad(options) {
this.familyInfo = {...options}
},
methods: {
add() {
this.$instance.post(`/app/appwechatuserrelation/addRelation?openId=${this.familyInfo.openId}`).then(res=> {
if(res.code == 0) {
this.$u.toast('添加成功')
setTimeout(() => uni.navigateBack({}), 1500)
}
}).catch(err => {
this.$u.toast(err)
})
}
}
}
</script>
<style scoped lang="scss">
@import "~dvcp-wui/common";
.page {
width: 100%;
height: 100%;
height: 100vh;
padding: 32px 32px 96px 32px;
box-sizing: border-box;
background-color: #f3f6f9;
.content {
width: 100%;
height: 100%;
background-color: #fff;
border-radius: 8px;
text-align: center;
img {
width: 176px;
height: 176px;
border-radius: 88px;
margin: 160px auto 24px auto;
}
.user-name {
margin-bottom: 100px;
line-height: 42px;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 36px;
color: #333;
}
.btn {
width: 400px;
height: 80px;
text-align: center;
line-height: 80px;
background: #4181FF;
border-radius: 44px;
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 34px;
color: #FFF;
margin: 0 auto;
}
}
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -0,0 +1,133 @@
<template>
<div class="page">
<div class="user-list" v-if="list.length">
<div class="item">
<div class="item-left">
<img :src="user.avatarUrl" alt="">
<div class="user-info">
<h3>{{user.nickName}}</h3>
<p>{{user.girdName || ''}}</p>
</div>
</div>
</div>
<div class="item" v-for="(item, index) in list" :key="index" v-if="user.openId != item.openId">
<div class="item-left">
<img :src="item.avatarUrl" alt="" v-if="item.avatarUrl">
<img src="https://cdn.cunwuyun.cn/dvcp/myFamily/tx.png" alt="" v-else>
<div class="user-info">
<h3>{{item.nickName}}</h3>
<p>{{item.girdName || ''}}</p>
</div>
</div>
<div class="item-right">
<div @click="toTransfer(item)">转积分</div>
</div>
</div>
</div>
<AiEmpty v-else/>
<p class="bottom-text">如果绑定错误请联系网格员解绑</p>
</div>
</template>
<script>
import {mapState} from 'vuex'
export default {
appName: "我的家庭",
computed: {
...mapState(['user', 'token'])
},
data() {
return {
list: [],
userInfo: {}
}
},
onLoad() {
this.getList()
},
methods: {
getList() {
this.$instance.post(`/app/appwechatuserrelation/list`).then(res => {
if (res.code === 0 && res.data) {
this.list = res.data
}
})
},
toTransfer(row) {
uni.navigateTo({url: `./transferIntrgral?openId=${row.openId}&nickName=${row.nickName}&avatarUrl=${row.avatarUrl || ''}`})
}
},
}
</script>
<style scoped lang="scss">
@import "~dvcp-wui/common";
.page {
width: 100%;
height: 100vh;
background-color: #f3f6f9;
.user-list {
padding: 32px 32px 0;
height: calc(100% - 180px);
overflow-y: scroll;
.item {
padding: 26px;
background-color: #fff;
display: flex;
margin-bottom: 24px;
.item-left {
width: calc(100% - 150px);
display: flex;
img {
width: 108px;
height: 108px;
border-radius: 54px;
}
.user-info {
margin-left: 20px;
h3 {
line-height: 42px;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 32px;
color: #333;
margin-bottom: 10px;
}
p {
font-family: PingFangSC-Regular;
font-size: 24px;
color: #999;
line-height: 40px;
}
}
}
.item-right {
width: 150px;
div {
width: 126px;
height: 56px;
line-height: 56px;
text-align: center;
background: #2D7DFF;
border-radius: 30px;
font-family: PingFangSC-Regular;
font-size: 26px;
color: #FFF;
margin-top: 26px;
}
}
}
}
.bottom-text {
line-height: 34px;
font-family: PingFangSC-Regular;
font-size: 24px;
color: #999;
position: fixed;
bottom: 92px;
left: 180px;
}
}
</style>

View File

@@ -0,0 +1,125 @@
<template>
<div class="AppHarvestQR">
<div class="card">
<div class="myself">
<img class="avatar" :src="user.avatarUrl" alt="" v-if="user.avatarUrl">
<img class="avatar" src="https://cdn.cunwuyun.cn/dvcp/myFamily/tx.png" alt="" v-else>
<div class="info">
<div class="name">{{ user.nickName }}</div>
<div class="area">{{ user.areaName }}</div>
</div>
</div>
<div class="qr">
<img :src="user.qrCode" alt="">
</div>
<div class="my-qr">我的丰收码</div>
<div class="pic">
<img src="https://cdn.cunwuyun.cn/fengdu/img-zhuangshi.png" alt="">
</div>
</div>
</div>
</template>
<script>
import { mapState } from 'vuex'
export default {
name: "AppHarvestQR",
data() {
return {
qrCode: '',
}
},
methods: {
getQrCode() {
this.$instance.post('/app/appwechatuserqujing/queryMyQrCode').then(res=> {
if(res?.data) {
this.qrCode = res.data
}
})
}
},
computed: {
...mapState(['user'])
},
onLoad() {
// this.getQrCode()
uni.setNavigationBarTitle({
title: '我的丰收码'
})
}
}
</script>
<style lang="scss" scoped>
.AppHarvestQR {
padding: 32px;
box-sizing: border-box;
.card {
width: 100%;
height: 100%;
box-sizing: border-box;
border-radius: 16px;
background: #FFF;
.myself {
padding: 72px;
box-sizing: border-box;
display: flex;
justify-content: space-between;
.avatar {
width: 108px;
height: 108px;
border-radius: 16px;
}
.info {
width: calc(100% - 128px);
height: 100%;
.name {
color: #333333;
font-size: 34px;
font-weight: 500;
margin-top: 10px;
}
.area {
color: #999999;
font-size: 28px;
font-weight: 400;
margin-top: 10px;
}
}
}
.qr {
margin: 10% auto 24px;
width: 542px;
height: 542px;
border-radius: 32px;
border: 8px solid #f6f5f8;
padding: 36px;
box-sizing: border-box;
img {
width: 100%;
height: 100%;
}
}
.my-qr {
color: #999999;
font-size: 32px;
font-weight: 400;
text-align: center;
}
.pic {
margin-top: 10%;
width: 100%;
height: 234px;
img {
width: 100%;
height: 234px;
}
}
}
}
</style>

View File

@@ -0,0 +1,224 @@
<template>
<div class="myIntegral">
<div class="header-content">
<div class="top">
<div class="total">
<h1>{{info.integral || '0'}}</h1>
<p>积分余额</p>
</div>
<div class="total right-total">
<h1>{{info.houseIntegral || '0'}}</h1>
<p>家庭积分</p>
</div>
</div>
<div class="bottom">
<div class="item">
<div class="num">{{ info.serialNo || '0'}}</div>
<div class="label">积分排行</div>
</div>
<div class="item">
<div class="num">{{ info.totalIntegral|| '0'}}</div>
<div class="label">历史累计获取</div>
</div>
</div>
<img src="https://cdn.cunwuyun.cn/dvcp/credit/head.png" alt="">
</div>
<div class="detail-content" v-if="list && list.length">
<div class="item" v-for="(item, index) in list" :key="index">
<div class="item-info">
<p>{{ item.integralRuleName || ''}}
<span v-if="item.integralRuleName && item.eventDesc">:</span>
{{ item.eventDesc || '' }}</p>
<span>&nbsp;&nbsp;&nbsp;{{ item.doTime }}</span>
</div>
<div class="item-num" :class="'color-'+ item.integralCalcType">
{{ (item.integralCalcType == 1 ? '+' : '-') + item.changeIntegral }}
</div>
</div>
</div>
<AiEmpty v-else/>
</div>
</template>
<script>
import { mapState } from 'vuex'
export default {
name: "myIntegral",
appName: "我的积分",
computed: {
...mapState(['user', 'token'])
},
data() {
return {
info: {},
current: 1,
list: [],
}
},
mounted() {
this.getToatl()
},
methods: {
getToatl() {
this.$instance.post(`/app/appintegraluser/integralUserInfoFD`).then(res => {
if (res?.data) {
this.info = res.data
this.getList()
}
})
},
getList() {
this.$instance.post(`/app/appintegraldetail/list?integralUserId=${this.info.id}&current=${this.current}&size=10`).then(res => {
if (res?.data) {
if (this.current > res.data.pages) {
return
}
this.list = this.current > 1 ? [...this.list, ...res.data.records] : res.data.records
}
})
},
},
onReachBottom() {
this.current++
this.getList()
}
}
</script>
<style scoped lang="scss">
.myIntegral {
width: 100vw;
overflow-x: hidden;
height: calc(100% - 136px);
background-color: #f3f6f9;
padding-bottom: 30px;
.header-content {
width: 690px;
height: 358px;
background: #FFF;
border-radius: 16px;
margin: 70px 0 40px 30px;
position: relative;
.top {
width: 100%;
height: 213px;
z-index: 99;
position: relative;
.total {
width: 50%;
padding-top: 48px;
box-sizing: border-box;
text-align: center;
h1 {
font-size: 68px;
color: #5AAD6A;
}
p {
font-size: 28px;
font-weight: 400;
color: #999999;
}
}
.right-total {
position: absolute;
top: 0;
right: 0;
h1 {
color: #4083E9;
}
}
}
.bottom {
display: flex;
justify-content: space-around;
width: 100%;
height: 145px;
padding: 16px 0;
box-sizing: border-box;
border-top: 2px solid #EEEEEE;
.item {
text-align: center;
z-index: 99;
.num {
font-family: DIN;
font-size: 48px;
font-weight: bold;
color: #333333;
}
.label {
font-size: 24px;
color: #999;
margin-top: 10px;
}
}
}
img {
position: absolute;
width: 360px;
height: 250px;
top: -40px;
right: 0;
}
}
.detail-content {
width: 690px;
background: #FFF;
border-radius: 16px;
margin: 0 0 0 32px;
padding: 16px 30px;
box-sizing: border-box;
.item {
padding: 34px 0 32px 0;
border-bottom: 2px solid #ddd;
display: flex;
.item-info {
width: 500px;
p {
word-break: break-all;
font-size: 32px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333;
line-height: 44px;
}
span {
display: inline-block;
margin-top: 8px;
font-size: 24px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #999;
line-height: 34px;
}
}
.item-num {
width: calc(100% - 500px);
text-align: right;
font-size: 36px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
line-height: 50px;
}
}
.item:last-child {
border-bottom: none;
}
}
.color-1 {
color: #2C51CE !important;
}
.color-0 {
color: #E6736E !important;
}
}
</style>

View File

@@ -0,0 +1,131 @@
<template>
<div class="page">
<div class="content">
<p class="text">积分收入方</p>
<img :src="userInfo.avatarUrl" alt="" v-if="userInfo.avatarUrl">
<img src="https://cdn.cunwuyun.cn/dvcp/myFamily/tx.png" alt="" v-else>
<p class="user-name">{{userInfo.nickName}}</p>
<u-input v-model="num" type="number" placeholder="请输入积分数量" :maxlength="11" :border="true" input-align="center" border-color="#ddd" height="76" class="input-num" />
<p class="num-text">剩余积分余额{{total}}</p>
<div class="btn" @click="confirm">确认转出</div>
</div>
</div>
</template>
<script>
import {mapState} from 'vuex'
export default {
appName: "我的家庭",
computed: {
...mapState(['user', 'token'])
},
data() {
return {
num: '',
total: '',
userInfo: {}
}
},
onLoad(options) {
this.userInfo = {...options}
this.getIntegral()
},
methods: {
getIntegral() {
this.$instance.post(`/app/appintegraluser/girdDetail?id=${this.user.openId}`).then(res => {
if (res.code === 0) {
this.total = res.data.integral || 0
}
})
},
confirm() {
if (!/^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/g.test(this.num)) {
this.num = ''
return this.$message.error('积分数量最多只保留两位小数点')
}
if (this.num > this.total) {
return this.$u.toast('转出积分不能大于剩余积分')
}
this.$instance.post(`/app/appintegraluser/transferIntegral`,{
fromId: this.user.openId,
ids: [this.userInfo.openId],
integral: this.num,
integralUserType: '3',
integralCalcType: '1'
}).then(res => {
if (res.code === 0) {
this.$u.toast('积分转出成功!')
setTimeout(() => {
uni.navigateBack()
}, 600)
}
})
}
}
}
</script>
<style scoped lang="scss">
@import "~dvcp-wui/common";
.page {
width: 100%;
height: 100%;
height: 100vh;
padding: 32px 32px 96px 32px;
box-sizing: border-box;
background-color: #f3f6f9;
.content {
width: 100%;
height: 100%;
background-color: #fff;
border-radius: 8px;
text-align: center;
.text {
padding-top: 96px;
line-height: 40px;
font-family: PingFangSC-Regular;
font-size: 28px;
color: #999;
margin-bottom: 26px;
}
img {
width: 176px;
height: 176px;
border-radius: 88px;
margin: 0 auto 24px auto;
}
.user-name {
margin-bottom: 100px;
line-height: 42px;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 36px;
color: #333;
}
.input-num {
width: calc(100% - 144px);
margin: 0 0 16px 72px;
}
.num-text {
color: #222;
font-size: 28px;
font-family: PingFangSC;
font-weight: 400;
line-height: 40px;
margin-bottom: 82px;
}
.btn {
width: 400px;
height: 80px;
text-align: center;
line-height: 80px;
background: #4181FF;
border-radius: 44px;
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 34px;
color: #FFF;
margin: 0 auto;
}
}
}
</style>

View File

@@ -0,0 +1,451 @@
<template>
<div class="page">
<div class="info-list">
<div class="item-content mar-b8">
<div class="item solid">
<p class="mar-t22">头像</p>
<!-- <button class="user-img-div" v-if="editAvatarUrl" open-type="chooseAvatar" @chooseavatar="handleWeixinSync">
<img v-if="user.avatarUrl && !avatar" :src="user.avatarUrl" class="user-img">
<img v-if="avatar" :src="avatar" alt="" class="user-img">
<img v-if="!user.avatarUrl && !avatar" src="https://cdn.cunwuyun.cn/dvcp/myFamily/tx.png" alt="" class="user-img">
</button> -->
<div class="user-img-div" v-if="editAvatarUrl">
<AiUploader v-model="avatarUrlList" multiple placeholder="上传头像" :limit="1"></AiUploader>
</div>
<div class="user-img-div" v-else>
<img v-if="user.avatarUrl && !avatar" :src="user.avatarUrl" class="user-img">
<img v-else src="https://cdn.cunwuyun.cn/dvcp/myFamily/tx.png" alt="" class="user-img">
</div>
</div>
<div class="item">
<p>用户昵称</p>
<div class="item-right" v-if="!editNickName">
<p class="name">{{ user.nickName }}</p>
</div>
<input class="item-right" v-else type="text" v-model="userName">
</div>
</div>
<div class="item-content mar-b8">
<div class="item" :class="editPhone ? 'item solid' : 'item'">
<p>手机号</p>
<div class="item-right" v-if="!!!editPhone">
<p class="name">{{ user.phone || ''}}</p>
</div>
<input class="item-right" v-else type="number" v-model="userPhone" maxlength="11">
</div>
<div class="item" v-if="editPhone">
<p>验证码</p>
<input class="item-right code-right" type="number" v-model="vcode" maxlength="6">
<div class="code-btn" @click="getCode">
<span>{{codeText}}</span>
</div>
</div>
</div>
<div class="item-content mar-b8">
<!-- <div class="item solid">
<p>真实姓名</p>
<div class="item-right" v-if="!editRealName">
<p class="name">{{ user.realName || '' }}</p>
</div>
<input class="item-right" v-else type="text" v-model="userRealName" @input="idNumberInput">
</div>
<div class="item solid">
<p>身份证号</p>
<div class="item-right" v-if="!editIdNumber">
<p class="name">{{ user.idNumber || '' }}</p>
</div>
<input class="item-right" v-else type="idNumber" v-model="userIdNumber" maxlength="18" @input="idNumberInput">
</div> -->
<div class="item">
<p>所属网格</p>
<div class="item-right" v-if="!editGird">
<p class="name">{{ user.girdName || '' }}</p>
</div>
<AiPagePicker type="gird" class="item-right" v-model="userGirdId" :params="{formType:2}" @select="handleSelectGrid" nodeKey="id" v-else>
<AiMore v-model="userGirdName" />
</AiPagePicker>
</div>
</div>
<div class="btn-wrapper btn-edit">
<b class="btn" @click="btnText? submit(): editBtn()">{{ btnText? '提交': '修改' }}</b>
</div>
</div>
</div>
</template>
<script>
import {mapActions, mapState} from 'vuex'
export default {
name: "userInfo",
computed: {
...mapState(['user', 'token']),
},
onLoad(o) {
this.isFromTabbar = o.isFromTabbar
this.path = o.path
this.getUserInfo('qujing')
uni.setNavigationBarTitle({
title: '个人中心'
})
},
data() {
return {
editAvatarUrl: false,
editNickName: false,
editPhone: false,
editRealName: false,
editIdNumber: false,
editGird: false,
avatar: '',
userName: '',
userPhone: '',
userRealName: '',
userIdNumber: '',
userGirdId: '',
userGirdName: '',
btnText: false,
isFromTabbar: '',
path: '',
avatarUrlList: [],
codeText: '获取验证码',
vcode: ''
}
},
methods: {
...mapActions(['getUserInfo', 'autoLogin']),
editBtn() {
this.btnText = true
this.editAvatarUrl = true;
this.avatar = this.user.avatarUrl
this.editNickName = true;
this.userName = this.user.nickName
this.editPhone = true;
this.userPhone = this.user.phone
this.editRealName = true;
this.userRealName = this.user.realName
this.editIdNumber = true;
this.userIdNumber = this.user.idNumber
this.editGird = true
this.userGirdId = this.user.girdId
this.userGirdName = this.user.girdName
this.avatarUrlList = [{'url': this.user.avatarUrl}]
},
submit() {
if(this.flag) return
if(!this.avatarUrlList.length) {
return this.$u.toast('请上传头像')
}
if (!this.userName) {
return this.$u.toast('请输入用户昵称')
}
if (this.userName == '微信用户') {
return this.$u.toast('请修改用户昵称')
}
if (!this.userPhone) {
return this.$u.toast('请输入手机号')
}
// if (!this.userRealName) {
// return this.$u.toast('请输入真实姓名')
// }
// if (!this.userIdNumber) {
// return this.$u.toast('请输入身份证号')
// }
// if (!this.$idCardNoUtil.checkIdCardNo(this.userIdNumber)) {
// return this.$u.toast('请输入正确的身份证号码')
// }
if (!this.userGirdId) {
return this.$u.toast('请选择所属网格')
}
// if (!this.userAreaId) {
// return this.$u.toast('请选择所属地区')
// }
// if (!/[^0]0{0,2}$/.test(this.userAreaId)) {
// return this.$u.toast('所属地区必须选到村级')
// }
this.flag = true
this.$instance.post(`/app/appwechatuserqujing/idNumberAttestation`, {
// avatarUrl: this.avatar,
avatarUrl: this.avatarUrlList[0].url,
nickName: this.userName,
phone: this.userPhone,
name: this.userName,
idNumber: this.userIdNumber,
girdId: this.userGirdId,
girdName: this.userGirdName,
vcode: this.vcode
}).then(res=> {
if(res?.code==0) {
this.$u.toast('提交成功')
this.autoLogin({ loginWay:'qujing'})
uni.$emit('auth')
setTimeout(() => {
if (this.isFromTabbar == 1) {
uni.switchTab({ url: this.path })
} else {
uni.navigateBack()
}
}, 600);
}
}).catch(err=> {
this.$u.toast(err.msg)
})
},
upLoad(img) {
return new Promise((resolve, reject) => {
uni.uploadFile({
url: `${this.$instance.defaults.baseURL}/admin/file/add`,
filePath: img,
name: 'file',
header: {
'Content-Type': 'multipart/form-data',
Authorization: uni.getStorageSync('token')
},
success: uploadFileRes => {
this.avatar = JSON.parse(uploadFileRes.data).data[0].split(';')[0]
resolve(uploadFileRes)
},
fail: err => {
reject(err)
}
})
})
},
handleWeixinSync({detail}) {
const { avatarUrl } = detail
if(avatarUrl?.length) {
this.upLoad(avatarUrl)
}
},
handleSelectGrid(v) {
this.userGirdName = v.girdName
this.userGirdId = v.id
},
idNumberInput() {
if(this.userIdNumber.length == 18 && this.userRealName) {
if(!this.userGirdId) {
this.$instance.post(`/app/appresidentapplet/queryDetailByIdNumberAndName`,{
name: this.userRealName,
idNumber: this.userIdNumber
}).then(res=> {
if(res.data && res.data.id) {
this.userGirdId = res.data.id
this.userGirdName = res.data.girdName
}
})
}
}
},
getCode() {
if (!this.userPhone) {
return this.$u.toast('请输入手机号')
}
if (this.codeText != '获取验证码') {
return this.$u.toast('请'+ this.codeText)
}
if(this.codeText == '获取验证码') {
this.$instance.post(`/admin/user/sendCode?phone=${this.userPhone}`).then(res=> {
if(res.code == 0) {
this.$u.toast('验证码已发送')
var time = 181
var timer = setInterval(()=> {
if(time == 0) {
this.codeText = '获取验证码'
clearInterval(timer)
}else {
time --
this.codeText = time + `秒重新获取`
}
}, 1000)
}
})
}
}
}
}
</script>
<style scoped lang="scss">
@import "~dvcp-wui/common";
.page {
width: 100%;
background-color: #F5F5F5;
.info-list {
padding: 50px 32px 0 32px;
box-sizing: border-box;
.item-content {
padding: 0 32px;
box-sizing: border-box;
background-color: #fff;
border-radius: 32px;
}
.item {
padding: 36px 0;
line-height: 40px;
width: 100%;
box-sizing: content-box;
display: flex;
p {
color: #333;
font-weight: 400;
width: 200px;
}
div {
color: #666;
font-size: 28px;
}
.item-right {
width: calc(100% - 200px);
text-align: right;
font-size: 28px;
p {
width: 100%;
}
.ai-area__wrapper {
display: flex;
align-items: center;
padding-left: 100px;
span {
color: #333;
font-size: 30px;
}
i {
color: #999;
font-size: 30px;
}
image {
width: 16px;
height: 8px;
}
}
}
.code-right {
width: calc(100% - 400px);
}
.code-btn {
width: 200px;
box-sizing: border-box;
text-align: right;
span {
display: inline-block;
padding: 0 8px;
line-height: 44px;
background-color: #19be6b;
color: #fff;
font-size: 24px;
border-radius: 8px;
margin-left: 16px;
}
}
::v-deep .AiAreaPicker {
float: right;
}
.user-img-div {
width: calc(100% - 200px);
text-align: right;
display: inline-block;
}
.user-img {
width: 104px;
height: 104px;
vertical-align: middle;
border-radius: 50%;
}
.right-icon {
width: 40px;
height: 40px;
vertical-align: middle;
}
.mar-t22 {
margin-top: 44px;
}
}
.login-out {
width: 100%;
font-size: 30px;
text-align: center;
color: #4181FF;
}
}
.self-knowledge-show {
position: fixed;
left: 0;
top: 0;
z-index: 100;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.3);
}
.toast-bg {
position: fixed;
z-index: 101;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.toast {
background-color: #fff;
width: 686px;
height: 316px;
font-size: 36px;
}
.toast-msg {
text-align: center;
line-height: 50px;
color: #333;
font-weight: 500;
padding: 84px 0 80px 0;
}
.toast-btn {
display: inline-block;
width: 120px;
text-align: center;
line-height: 50px;
}
.cancel {
margin-left: 394px;
margin-right: 40px;
}
.confirm {
color: #197DF0;
}
.btn-edit {
background: #FFF;
}
::v-deep.ai-uploader {
text-align: right;
display: inline-block;
.imgList {
width: 228px;
height: 200px;
display: inline-block!important;
}
}
}
</style>

View File

@@ -0,0 +1,48 @@
<template>
<div class="AppPageInteraction">
<AiListPage :label="label" :appList="appList" :headerBg="headerBg"/>
</div>
</template>
<script>
export default {
name: 'AppPageInteraction',
appName: '工作台(居民管理)',
data() {
return {
label: '居民管理',
appList: [
{
name: '居民信息管理',
icon: require('./img/jmhd.png'),
url: '../AppResidentFile/AppResidentFile'
},
{
name: '居民档案',
icon: require('./img/jmda.png'),
url: '../AppPeopleList/AppPeopleList'
},
// {
// name: '小程序公告',
// icon: require('./img/xcxgg.png'),
// url: '../AppUniMsg/AppUniMsg'
// }
],
headerBg: require('./img/header-bg.png'),
}
},
onShow() {
document.title = "居民管理"
}
}
</script>
<style lang="scss" scoped>
uni-page-body {
height: 100%;
}
.AppPageInteraction {
height: 100%;
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 684 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View File

@@ -0,0 +1,379 @@
<template>
<div class="add">
<div class="item">
<span class="tips">*</span>
<div class="border">
<span class="label">居民类型</span>
<span class="value" @click="clickSelect('residentType', 'residentType')">
<span v-if="form.residentType === ''" class="color-999">请选择</span>
<span v-else>{{$dict.getLabel('residentType', form.residentType)}}</span>
<img src="./components/img/right-icon.png" alt="">
</span>
</div>
</div>
<div class="item">
<span class="tips">*</span>
<div class="border">
<span class="label">是否户主</span>
<span class="value" @click="clickSelect('yesOrNo', 'householdName')">
<span v-if="form.householdName === ''" class="color-999">请选择</span>
<span v-else>{{$dict.getLabel('yesOrNo', form.householdName)}}</span>
<img src="./components/img/right-icon.png" alt="">
</span>
</div>
</div>
<div class="item" v-if="form.householdName != 1">
<span class="tips">*</span>
<div class="border">
<span class="label">户主身份证</span>
<span class="value">
<input type="idcard" placeholder="请输入" v-model="form.householdIdNumber" maxlength="18">
</span>
</div>
</div>
<div class="item" v-if="form.householdName != 1">
<span class="tips">*</span>
<div class="border">
<span class="label">与户主关系</span>
<span class="value" @click="clickSelect('householdRelation', 'householdRelation')">
<span v-if="form.householdRelation === ''" class="color-999">请选择</span>
<span v-else>{{$dict.getLabel('householdRelation', form.householdRelation)}}</span>
<img src="./components/img/right-icon.png" alt="">
</span>
</div>
</div>
<div class="item">
<span class="tips">*</span>
<div class="border">
<span class="label">姓名</span>
<span class="value">
<input type="text" placeholder="请输入" v-model="form.name" maxlength="10" :disabled="this.form.id ? true : false">
</span>
</div>
</div>
<div class="item">
<span class="tips">*</span>
<div class="border">
<span class="label">身份证号</span>
<span class="value">
<input type="idcard" placeholder="请输入" v-model="form.idNumber" maxlength="18" @input="changeIdNumber" :disabled="this.form.id ? true : false">
</span>
</div>
</div>
<div class="item">
<span class="tips">*</span>
<div class="border">
<span class="label">性别</span>
<span class="value">
<span v-if="form.sex === ''" class="color-999">请选择</span>
<span v-else>{{$dict.getLabel('sex', form.sex)}}</span>
<img src="./components/img/right-icon.png" alt="">
</span>
</div>
</div>
<div class="item">
<span class="tips">*</span>
<div class="border">
<span class="label">出生日期</span>
<span class="value">
<span :class="form.birthDate == '' ? 'color-999' : ''">{{form.birthDate || '请选择'}}</span>
<img src="./components/img/right-icon.png" alt="">
</span>
</div>
</div>
<div class="item">
<span class="tips"></span>
<div class="border">
<span class="label">联系电话</span>
<span class="value">
<input type="text" placeholder="请输入" @input="changePhone" v-model="form.phone" maxlength="11">
</span>
</div>
</div>
<div class="item">
<span class="tips">*</span>
<div class="border">
<span class="label">现住址</span>
<span class="value">
<AiAreaPicker ref="address" class="aiArea" :areaId="user.areaId" :fullName.sync="form.currentAreaName" :value="form.currentAreaId" mode="custom" @select="onCurrentAreaChange">
<div class="aiArea">
<span class="label" v-if="form.currentAreaName">{{ form.currentAreaName }}</span>
<span v-else class="color-999">请选择</span>
<img src="./components/img/right-icon.png" alt="">
</div>
</AiAreaPicker>
</span>
</div>
</div>
<div class="item mar-b0">
<span class="tips"></span>
<div class="border not-border">
<span class="label">详细地址</span>
</div>
</div>
<div class="text-area">
<textarea placeholder="请输入" maxlength="30" v-model="form.currentAddress"></textarea>
</div>
<div class="item">
<span class="tips"></span>
<div class="border">
<span class="label">户籍地址</span>
<span class="value">
<AiAreaPicker ref="address" class="aiArea" :areaId="user.areaId" :fullName.sync="form.householdAreaName" all :value="form.householdAreaId" mode="custom" @select="onHouseAreaChange">
<div class="aiArea">
<span class="label" v-if="form.householdAreaName">{{ form.householdAreaName }}</span>
<span v-else class="color-999">请选择</span>
<img src="./components/img/right-icon.png" alt="">
</div>
</AiAreaPicker>
</span>
</div>
</div>
<div class="item mar-b0">
<span class="tips"></span>
<div class="border not-border">
<span class="label">详细地址</span>
</div>
</div>
<div class="text-area">
<textarea placeholder="请输入" maxlength="30" v-model="form.householdAddress"></textarea>
</div>
<div class="pad-b152"></div>
<div class="add-btn" @click="submit">
<div>保存</div>
</div>
<u-select v-model="showSelect" :list="selectList" label-name="dictName" value-name="dictValue" @confirm="confirmSelect"/>
</div>
</template>
<script>
import { mapState } from 'vuex'
export default {
name: 'add',
data() {
return {
form: {
id: '',
householdName: '',
householdIdNumber: '',
householdRelation: '',
name: '',
idNumber: '',
sex: '',
birthDate: '',
phone: '',
currentAreaId: '',
currentAreaName: '',
currentAddress: '',
householdAreaId: '',
householdAreaName: '',
householdAddress: '',
residentType: '',
age: ''
},
showSelect: false,
formName: '',
selectList: []
}
},
onLoad(options) {
this.$dict.load('yesOrNo', 'sex', 'householdRelation', 'nation', 'education', 'maritalStatus', 'politicsStatus', 'militaryStatus', 'faithType', 'residentType').then(() => {
if(options.id) {
document.title = '编辑居民'
this.form.id = options.id
this.getDetail()
}else {
document.title = '新增居民'
this.form.residentType = options.type || ''
}
})
},
computed: {
...mapState(['user']),
},
methods: {
submit() {
if(this.form.residentType === '') {
return this.$u.toast('请选择居民类型')
}
if(this.form.householdName === '') {
return this.$u.toast('请选择是否户主')
}
if(this.form.householdName != 1 && !this.form.householdIdNumber) {
return this.$u.toast('请输入户主身份证')
}
if(this.form.householdName != 1 && this.form.householdRelation === '') {
return this.$u.toast('请选择与户主关系')
}
if(!this.form.name) {
return this.$u.toast('请输入姓名')
}
if(!this.form.idNumber) {
return this.$u.toast('请输入身份证号')
}
if(!this.form.sex) {
return this.$u.toast('请选择性别')
}
if(!this.form.birthDate) {
return this.$u.toast('请选择出生日期')
}
if(!this.form.currentAreaId) {
return this.$u.toast('请选择现住址')
}
if(!/[^0]0{0,2}$/.test(this.form.currentAreaId)) {
return this.$u.toast('现住址必须选到村级')
}
if(this.form.householdAreaId && !/[^0]0{0,2}$/.test(this.form.householdAreaId)) {
return this.$u.toast('户籍地必须选到村级')
}
this.form.age = this.$calcAge(this.form.idNumber)
this.$instance.post('/app/appresident/addOrUpdate', this.form).then(res => {
if (res.code === 0) {
this.$u.toast('新增成功')
uni.$emit('reload')
uni.navigateBack({
delta: 1
})
}
}).catch((err) => {
this.$u.toast(err)
})
},
confirmSelect(e) {
this.form[this.formName] = e[0].value
},
clickSelect(dictName, formName) {
this.selectList = this.$dict.getDict(dictName)
this.formName = formName
this.showSelect = true
},
changeIdNumber() {
let reg = /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
if (this.form.idNumber.length == 18 && !reg.test(this.form.idNumber)) {
return this.$u.toast('请输入正确的身份证号码')
}
var info = this.$idCardNoUtil.getIdCardInfo(this.form.idNumber)
this.form.birthDate = info.birthday
this.form.sex = info.gender
console.log(this.form)
this.$forceUpdate()
},
changePhone() {
let regTel = /^1(3\d|4[5-9]|5[0-35-9]|6[567]|7[0-8]|8\d|9[0-35-9])\d{8}$/
if (this.form.phone.length == 11 && !regTel.test(this.form.phone)) {
return this.$u.toast('请输入正确的手机号')
}
},
onCurrentAreaChange(e) {
this.form.currentAreaId = e
},
onHouseAreaChange(e) {
this.form.householdAreaId = e
},
getDetail() {
this.$instance.post(`/app/appresident/detail?id=${this.form.id}`).then(res => {
if (res.code === 0) {
this.form = {...res.data.resident}
var info = this.$idCardNoUtil.getIdCardInfo(this.form.idNumber)
this.form.birthDate = info.birthday
this.form.sex = info.gender
}
})
}
},
}
</script>
<style scoped lang="scss">
.add {
.item{
width: 100%;
padding-left: 14px;
background: #FFF;
box-sizing: border-box;
display: flex;
margin-bottom: 16px;
.tips{
width: 18px;
font-size: 32px;
font-family: PingFangSC-Regular, PingFang SC;
color: #FF4466;
line-height: 44px;
padding: 34px 0 34px 0;
}
.border{
width: calc(100% - 18px);
padding: 34px 32px 34px 0;
line-height: 44px;
border-bottom: 1px solid #D8DDE6;
line-height: 44px;
font-size: 32px;
font-family: PingFangSC-Regular, PingFang SC;
color: #333;
display: flex;
box-sizing: border-box;
.label{
width: 170px;
}
.value{
width: calc(100% - 170px);
text-align: right;
img{
width: 32px;
height: 32px;
margin-left: 8px;
vertical-align: middle;
}
}
.color-999{
color: #999;
}
}
.not-border{
border-bottom: 0;
}
}
.mar-b0{
margin-bottom: 0;
}
.text-area{
width: 100%;
background-color: #fff;
padding: 0 32px;
margin-bottom: 16px;
box-sizing: border-box;
textarea{
width: 100%;
height: 88px;
padding-bottom: 32px;
}
}
.pad-b152{
width: 100%;
padding-bottom: 152px;
background-color: #f5f5f5;
}
.add-btn{
position: fixed;
bottom: 0;
left: 0;
z-index: 999;
width: 100%;
height: 112px;
line-height: 112px;
background: #3975C6;
font-size: 32px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #FFF;
div{
text-align: center;
}
}
}
</style>

View File

@@ -0,0 +1,64 @@
<template>
<div class="AppPeopleList">
<div class="banner" v-for="(item, index) in bannerList" :key="index" @click="linkTo(item.linkUrl)">
<img :src="item.img" alt="">
<p>{{item.title}}</p>
</div>
</div>
</template>
<script>
export default {
name: 'AppPeopleList',
appName: '居民档案',
data() {
return {
bannerList: [
{
img: require('./components/img/blue-bg.png'),
title: '查看居民档案',
linkUrl: './PeopleList'
},
{
img: require('./components/img/green-bg.png'),
title: '居民档案审核',
linkUrl: './ExamineList'
}
]
}
},
onShow() {
document.title = '居民档案'
},
methods: {
linkTo(url) {
uni.navigateTo({url})
}
},
}
</script>
<style lang="scss" scoped>
.AppPeopleList{
height: 100%;
padding-top: 16px;
.banner{
padding: 32px 40px 0;
position: relative;
img{
width: 100%;
height: 228px;
}
p{
position: absolute;
top: 120px;
left: 88px;
font-size: 44px;
font-family: PingFang-SC-Heavy, PingFang-SC;
font-weight: 800;
color: #FFF;
line-height: 60px;
}
}
}
</style>

View File

@@ -0,0 +1,99 @@
<template>
<div class="Content">
<div class="text-area">
<div class="title"><span class="tips">*</span>不通过理由</div>
<textarea placeholder="请输入" maxlength="200" v-model="opinion"></textarea>
<div class="num">{{opinion.length}}/200</div>
<!-- <u-input v-model="opinion" type="textarea" placeholder="请输入" maxlength="500" /> -->
</div>
<div class="footer" @click="examine(0)">
<div class="btn">保存</div>
</div>
</div>
</template>
<script>
export default {
name: "Content",
data() {
return {
opinion: '',
id: '',
};
},
onShow() {
document.title = '居民档案审核'
},
onLoad(option) {
this.id = option.id
},
methods: {
examine(pass) {
if(!this.opinion) {
return this.$u.toast('请输入不通过理由')
}
this.$instance.post(`/app/appresident/examine?id=${this.id}&pass=${pass}&opinion=${this.opinion}`).then((res) => {
if (res.code == 0) {
this.$u.toast('审核成功')
uni.$emit('updatePeople')
setTimeout(() => {
uni.navigateBack({delta: 2})
}, 600)
}
})
}
},
};
</script>
<style scoped lang="scss">
.Content {
.text-area{
padding: 34px 32px;
background-color: #fff;
.title{
font-size: 32px;
font-family: PingFangSC-Regular, PingFang SC;
color: #333;
line-height: 44px;
margin-bottom: 32px;
.tips{
font-size: 32px;
margin-right: 8px;
color: #f46;
}
}
textarea{
width: 100%;
height: 500px;
word-break: break-all;
}
}
.num{
text-align: right;
color: #999;
}
.footer {
width: 100%;
position: fixed;
bottom: 0;
left: 0;
}
.btn {
width: 100%;
height: 112px;
line-height: 112px;
text-align: center;
background: #3975C6;
font-size: 32px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #FFF;
}
.line-bg {
width: 100%;
height: 16px;
background: #F5F5F5;
}
}
</style>

View File

@@ -0,0 +1,222 @@
<template>
<div class="DetailCard">
<div class="top"></div>
<div class="middle">
<div class="hint">家庭地址</div>
<div class="areaHint">
<u-icon name="map-fill" color="#73ABFF"></u-icon>
<span>{{resident.currentAreaName}}{{resident.currentAddress || ''}}</span>
</div>
</div>
<div class="bottom">
<div class="hints">家庭成员 {{ data.family && data.family.length }}</div>
<div v-if="data.family && data.family.length > 0">
<div class="card" v-for="(item, i) in data.family" :key="i" @click="toDetailPeople(item)">
<div class="photos">
<img :src="item.photo" alt="" v-if="item.photo" />
<img src="./components/img/44.png" alt="" v-else />
</div>
<div class="right">
<div class="rightTop">
<div class="rightTop-lefts">
<span class="names">{{ item.name }}</span>
<span class="fileStatuss" v-if="item.fileStatus == 1"> 已注销</span>
<span class="householdNames" v-if="item.householdName == 1">户主</span>
<span class="householdNames" v-else>
{{ $dict.getLabel('householdRelation', item.householdRelation) }}
</span>
</div>
<div class="rightTop-rights">
<u-section :show-line="false" sub-title="详情"></u-section>
</div>
</div>
<div class="rightBottom">
<span>身份证号</span>
<span>{{ item.idNumber.replace(/^(\w{6})\w{8}(.*)$/, '$1********$2') }}</span>
</div>
<!-- <div class="spacial" v-if="item.idNumber == data.resident.idNumber">
<span v-for="(e,index) in spacialList" :key="index">{{e.applicationName}}</span>
</div> -->
</div>
</div>
</div>
<AiEmpty v-else></AiEmpty>
</div>
</div>
</template>
<script>
export default {
name: 'DetailCard',
components: {},
props: {},
data() {
return {
id: '',
data: [],
resident: {},
// spacialList: [],
}
},
computed: {},
watch: {},
onLoad(o) {
this.id = o.id
this.$dict.load('householdRelation', 'fileStatus').then(() => {
this.getDetail()
})
},
onShow() {
document.title = '居民档案'
},
methods: {
getDetail() {
this.$instance.post(`/app/appresident/detail?id=${this.id}`).then((res) => {
if (res.code == 0) {
this.data = res.data
this.$forceUpdate()
this.$nextTick(() => {
this.resident = res.data.resident
// this.spacialList = res.data.resident.tsrqInfos
this.$forceUpdate()
})
}
})
},
toDetailPeople(item) {
uni.navigateTo({ url: `./DetailPeople?id=${item.id}&type=0` })
},
},
}
</script>
<style scoped lang="scss">
.DetailCard {
height: 100%;
.top {
height: 112px;
background: #3975c6;
}
.middle {
margin: -80px 32px 0 32px;
padding: 38px 30px 78px 28px;
background: #ffffff;
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.02);
border-radius: 16px;
z-index: 999;
.hint {
font-size: 32px;
font-weight: 500;
color: #333333;
}
.areaHint {
margin-top: 38px;
span {
margin-left: 14px;
}
}
}
.bottom {
margin: 32px 30px 48px 30px;
background: #fff;
padding: 38px 30px 30px 30px;
.hints {
margin-bottom: 38px;
}
.card {
display: flex;
box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.08);
border-radius: 16px;
padding: 48px 32px;
margin-bottom: 32px;
.photos {
img {
width: 96px;
height: 96px;
border-radius: 50%;
}
}
.right {
display: flex;
flex-direction: column;
margin-left: 40px;
width: 100%;
.rightTop {
display: flex;
justify-content: space-between;
.rightTop-lefts {
.names {
font-size: 32px;
font-weight: 600;
}
.householdNames {
margin-left: 30px;
font-size: 26px;
font-weight: 500;
color: #5aad6a;
}
.fileStatuss {
display: inline-block;
margin-left: 30px;
color: #ff4466;
background: #ffecef;
border-radius: 8px;
width: 88px;
height: 40px;
line-height: 40px;
text-align: center;
}
}
.rightTop-rights {
::v-deep .u-section {
.u-section__right-info {
color: #3975c6 !important;
.u-section__right-info__icon-arrow {
.u-icon {
.u-icon__icon {
color: #3975c6 !important;
}
}
}
}
}
}
}
.rightBottom {
margin-top: 20px;
}
// .spacial {
// margin-top: 10px;
// white-space: wrap;
// span {
// margin-right: 10px;
// color: #ff4466;
// }
// }
}
}
.card:nth-child(2n-1) {
// background: royalblue;
background: url(http://respub.sinoecare.net/20211222/装饰-20211222162743.png) no-repeat;
background-size: 100% 100%;
}
.card:nth-child(2n) {
// background: pink;
background: url(http://respub.sinoecare.net/20211222/装饰2-20211222162934.png) no-repeat;
background-size: 100% 100%;
}
}
}
</style>

View File

@@ -0,0 +1,404 @@
<template>
<div class="DetailPeople" v-if="data.resident">
<div class="top">
<div class="photos">
<img :src="data.resident.photo" alt="" v-if="data.resident && data.resident.photo" />
<img src="./components/img/44.png" alt="" v-else />
</div>
<div class="right">
<div class="rightTop">
<span class="names">{{ data.resident && data.resident.name }}<span v-if="data.resident.fileStatus == 1" class="fileStatuss"> 已注销 </span></span>
<span class="householdNames" v-if="data.resident && data.resident.householdName == 1">户主</span>
<span class="householdNames" v-else>
{{ $dict.getLabel('householdRelation', data.resident && data.resident.householdRelation) }}
</span>
</div>
<div class="rightBottom" v-if="data.resident && data.resident.phone">{{ data.resident.phone }}</div>
</div>
</div>
<div class="line"></div>
<div class="tab-list">
<div v-for="(item, index) in tabList" :key="index" :class="tabIndex == index ? 'tab-item active' : 'tab-item' " @click="tabIndex=index">
<div v-if="index == 0">
<img :src="item.activeIcon" alt="" v-if="tabIndex==0">
<img :src=" item.icon" alt="" v-if="tabIndex!=0">
</div>
<div v-if="index != 0">
<img src="./components/img/tsrq备份@2x.png" alt="" v-if="tabIndex==index && index != 0">
<img src="./components/img/tsrq@2x.png" alt="" v-if="tabIndex!=index && index != 0">
</div>
<p v-if="index==0">{{item.name}}</p>
<p v-else class="type">{{item.applicationName}}</p>
</div>
</div>
<!-- 基本信息 -->
<div v-if="tabIndex == 0">
<div class="middle">
<div class="hint">个人基本信息</div>
<div class="contents">
<div class="item">
<span>籍贯</span>
<span>{{ data.resident && data.resident.birthplaceAreaName }}</span>
</div>
<div class="item">
<span>身份证号</span>
<span>{{ data.resident && data.resident.idNumber.replace(/^(\w{6})\w{8}(.*)$/, '$1********$2') }}</span>
</div>
<div class="item">
<span>民族</span>
<span v-if="data.resident && data.resident.nation"> {{ $dict.getLabel('nation', data.resident.nation) }}</span>
</div>
<div class="item">
<span>文化程度</span>
<span v-if="data.resident && data.resident.education">{{ $dict.getLabel('education', data.resident.education) }}</span>
</div>
<div class="item">
<span>婚姻状况</span>
<span v-if="data.resident && data.resident.maritalStatus">{{ $dict.getLabel('maritalStatus', data.resident.maritalStatus) }}</span>
</div>
<div class="item">
<span>政治面貌</span>
<span v-if="data.resident && data.resident.politicsStatus">{{ $dict.getLabel('politicsStatus', data.resident.politicsStatus) }}</span>
</div>
<div class="item">
<span>兵役状况</span>
<span v-if="data.resident && data.resident.militaryStatus">{{ $dict.getLabel('militaryStatus', data.resident.militaryStatus) }}</span>
</div>
<div class="item">
<span>宗教信仰</span>
<span v-if="data.resident && data.resident.faithType">{{ $dict.getLabel('faithType', data.resident.faithType) }}</span>
</div>
<div class="item">
<span>职业</span>
<span v-if="data.resident && data.resident.job">{{ $dict.getLabel('job', data.resident.job) }}</span>
</div>
</div>
</div>
<div class="lines"></div>
<div class="bottom">
<div class="hint">联络信息</div>
<div class="contents">
<div class="item">
<span>联系方式</span>
<span class="phones" v-if="data.resident && data.resident.phone" @click="callPhone(data.resident.phone)">{{ data.resident.phone }}</span>
</div>
<div class="item">
<span class="label">现住址</span>
<span class="value" v-if="data.resident && data.resident.currentAreaName">{{ data.resident.currentAreaName }}</span>
</div>
<div class="item">
<span class="label">现住详细地址</span>
<span class="value" v-if="data.resident && data.resident.currentAddress">{{ data.resident.currentAddress }}</span>
</div>
<div class="item">
<span class="label">户籍地址</span>
<span class="value" v-if="data.resident && data.resident.householdAreaName">{{ data.resident.householdAreaName }}</span>
</div>
<div class="item">
<span class="label">户籍详细地址</span>
<span class="value" v-if="data.resident && data.resident.householdAddress">{{ data.resident.householdAddress }}</span>
</div>
<div class="item" v-if="type == 1 && data.resident.auditStatus != 0">
<span class="label">处理结果</span>
<span class="value">{{ data.resident.auditStatus == 1 ? '通过' : '不通过' }}</span>
</div>
<div class="item" v-if="type == 1 && data.resident.auditStatus != 0">
<span class="label">原因</span>
</div>
<div class="item">{{data.resident.auditOpinion || ''}}</div>
</div>
</div>
</div>
<!-- 特殊人群 -->
<div v-if="tabIndex != 0 && tabList && tabList.length">
<div class="spacial" v-for="(item,index) in tabList" :key="index" v-if="tabIndex == index">
<div class="specialList" v-for="(t,indexs) in item.tableInfos" :key="indexs" v-if="item.tableInfos && item.tableInfos.length">
<div class="spacial-row">
<div>{{ t.fieldName }}</div>
<div>{{ t.fieldValue }}</div>
</div>
</div>
</div>
</div>
<div class="pad-b112" v-if="data.resident.auditStatus == 0 && type == 1"></div>
<div class="footer" v-if="data.resident.auditStatus == 0 && type == 1">
<div @click="toContent">不通过</div>
<div class="pass" @click="examine(1)">通过</div>
</div>
</div>
</template>
<script>
export default {
name: 'DetailPeople',
components: {},
props: {},
data() {
return {
id: '',
data: [],
type: 0, //0查看详情 1审核详情
tabList:[],
tabIndex: 0,
}
},
computed: {},
watch: {},
onLoad(o) {
this.id = o.id
this.type = o.type
this.$dict.load('householdRelation', 'nation', 'education', 'maritalStatus', 'politicsStatus', 'militaryStatus', 'faithType', 'job', 'fileStatus').then(() => {
this.getDetail()
})
uni.$on('updatePeople', res => {
this.getDetail()
})
},
onShow() {
document.title = '家庭成员信息'
},
methods: {
getDetail() {
this.$instance.post(`/app/appresident/detail?id=${this.id}`).then((res) => {
if (res.code == 0) {
this.data = res.data
if (res.data.resident.tsrqInfos) {
this.tabList = res.data.resident.tsrqInfos
let info = {
icon: require('./components/img/icon1n@2x.png'),
activeIcon: require('./components/img/icon1h@2x.png'),
name: '基本信息',
}
this.tabList.unshift(info)
} else {
this.tabList =[{
icon: require('./components/img/icon1n@2x.png'),
activeIcon: require('./components/img/icon1h@2x.png'),
name: '基本信息',
}]
}
}
})
},
callPhone(phone) {
uni.makePhoneCall({ phoneNumber: phone })
},
examine(pass) {
this.$confirm('确认通过该审核?').then(() => {
this.$instance.post(`/app/appresident/examine?id=${this.id}&pass=${pass}`).then((res) => {
if (res.code == 0) {
uni.$emit('updatePeople')
this.$u.toast('审核成功')
setTimeout(() => {
uni.navigateBack()
}, 600)
}
})
})
},
toContent() {
uni.navigateTo({url: `./Content?id=${this.id}`})
}
},
}
</script>
<style scoped lang="scss">
.DetailPeople {
height: 100%;
background: #fff;
.top {
display: flex;
padding: 48px 32px 32px 32px;
.photos {
img {
width: 112px;
height: 112px;
border-radius: 50%;
}
}
.right {
display: flex;
flex-direction: column;
width: 100%;
margin-left: 24px;
.rightTop {
display: flex;
justify-content: space-between;
.fileStatuss {
display: inline-block;
margin-left: 30px;
color: #ff4466;
background: #ffecef;
border-radius: 8px;
width: 120px;
height: 40px;
line-height: 40px;
text-align: center;
font-weight: 400;
font-size: 28px;
}
.names {
font-size: 32px;
font-weight: 600;
}
.householdNames {
margin-left: 30px;
font-size: 26px;
font-weight: 500;
color: #5aad6a;
}
}
.rightBottom {
margin-top: 16px;
}
}
}
.tab-list{
padding-top: 32px;
display: flex;
word-wrap: nowrap;
overflow-x: scroll;
-webkit-overflow-scrolling: touch;
.tab-item{
display: inline-block;
width: 148px;
height: 136px;
background-color: #F8F9FB;
border-radius: 8px;
text-align: center;
margin-left: 32px;
img{
width: 40px;
height: 40px;
margin-top: 30px;
}
p{
font-size: 22px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #C5C9CD;
line-height: 32px;
margin-top: 8px;
}
}
.type {
padding: 0 10px;
overflow: hidden;
text-overflow: ellipsis;
white-space:nowrap;
}
.active{
background-color: #357CE3;
p{
color: #fff;
}
}
}
.line {
height: 8px;
background: #f5f5f5;
}
.middle,
.bottom {
padding: 0 32px;
.hint {
font-weight: 600;
padding: 32px 0;
}
.contents {
.item {
display: flex;
justify-content: space-between;
padding: 14px 0;
.phones {
color: #3d94fb;
}
.label{
width: 200px;
}
.value{
width: calc(100% - 200px);
text-align: right;
word-break: break-all;
}
}
}
}
.lines {
height: 4px;
background: #f5f5f5;
}
.spacial {
margin-top: 30px;
.specialList {
padding: 14px 32px;
.spacial-row {
display: flex;
justify-content: space-between;
}
}
}
.pad-b112{
padding-bottom: 112px;
background-color: #f5f5f5;
}
.footer {
width: 100%;
position: fixed;
bottom: 0;
left: 0;
z-index: 99999;
display: flex;
font-size: 32px;
font-family: PingFangSC-Regular, PingFang SC;
height: 112px;
line-height: 112px;
text-align: center;
div{
flex: 1;
background: #fff;
color: #FF4466;
}
.pass {
background: #1365DD;
color: #FFF;
}
}
}
</style>

View File

@@ -0,0 +1,276 @@
<template>
<div class="ExamineList">
<AiTopFixed>
<u-tabs :list="tabList" :is-scroll="false" :current="currentTabs" height="96" bg-color="#3975C6" inactive-color="#CDDCF0" bar-width="48" active-color="#fff " @change="change"></u-tabs>
<div class="middle">
<div class="left">
<AiAreaPicker v-model="areaId" :areaId="user.areaId" @select="areaSelect" :name.sync="areaName" style="color: #666">
<u-icon name="map-fill" color="#3192F4" size="20px" style="vertical-align: text-bottom"></u-icon>
<span style="margin-left: 4px" v-if="areaName">{{ areaName }}</span>
<span v-else>请选择</span>
<u-icon name="arrow-down" color="#666" size="28" style="margin-left: 4px" />
</AiAreaPicker>
</div>
<u-search v-model="keyword" :clearabled="true" placeholder="姓名/联系方式/身份证后6位" :show-action="false" bg-color="#F5F5F5" search-icon-color="#999" color="#999" height="58" @search="handerSearch" @clear="handerClear"></u-search>
</div>
</AiTopFixed>
<div v-if="datas && datas.length > 0" class="list-content">
<div class="card" v-for="(item, i) in datas" :key="i" @click="toDetailPeople(item)">
<div class="photos">
<img :src="item.photo" alt="" v-if="item.photo" />
<img src="./components/img/44.png" alt="" v-else />
</div>
<div class="right">
<div class="rightTop">
<div class="rightTop-lefts">
<span class="names">{{ item.name }}</span>
<span class="fileStatuss" v-if="item.fileStatus == 1"> {{ $dict.getLabel('fileStatus', item.fileStatus) }}</span>
<span class="householdNames" v-if="item.householdName == 1">户主</span>
<span class="householdNames" v-else>非户主</span>
<span class="audit-status" :class="'status'+item.auditStatus">{{ $dict.getLabel('auditStatus', item.auditStatus) }}</span>
</div>
<div class="rightTop-rights">
<u-section :show-line="false" sub-title="详情"></u-section>
</div>
</div>
<div class="rightBottom">
<span>身份证号</span>
<span>{{ item.idNumber.replace(/^(\w{6})\w{8}(.*)$/, '$1********$2') }}</span>
</div>
</div>
</div>
</div>
<AiEmpty v-else></AiEmpty>
</div>
</template>
<script>
import { mapState } from 'vuex'
export default {
name: 'ExamineList',
components: {},
props: {},
data() {
return {
id: '',
datas: [],
resident: {},
areaId: '',
areaName: '',
tabList: [
{
name: '待处理',
},
{
name: '已处理',
},
],
currentTabs: 0,
keyword: ''
}
},
computed: {
...mapState(['user']),
},
onLoad() {
this.areaId = this.user.areaId
this.areaName = this.user.areaName
this.$dict.load('householdRelation', 'auditStatus').then(() => {
this.getList()
})
uni.$on('updatePeople', () => {
this.getListInit()
})
},
onShow() {
document.title = '居民档案审核'
},
methods: {
getListInit() {
this.current = 1
this.datas = []
this.getList()
},
getList() {
var auditType = 0 // 0待处理; 2已处理
if(this.currentTabs == 1) {
auditType = 2
}
this.$instance.post('/app/appresident/list', null, {
params: {
size: 10,
current: this.current,
con: this.keyword,
areaId: this.areaId,
auditType,
source: 1
},
})
.then((res) => {
if (res.code == 0) {
this.datas = this.current > 1 ? [...this.datas, ...res.data.records] : res.data.records
this.pages = res.data.pages
}
})
},
change(index) {
this.currentTabs = index
this.getListInit()
},
toDetailPeople(item) {
uni.navigateTo({ url: `./DetailPeople?id=${item.id}&type=1` })
},
areaSelect(e) {
this.areaId = e
this.getListInit()
},
handerSearch(e) {
this.keyword = e
this.getListInit()
},
handerClear() {
this.keyword = ''
this.getListInit()
},
},
onReachBottom() {
this.current = this.current + 1
this.getList()
},
}
</script>
<style scoped lang="scss">
.ExamineList {
height: 100%;
.list-content{
padding: 0 60px;
background-color: #fff;
}
.card {
display: flex;
box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.08);
border-radius: 16px;
padding: 48px 32px;
margin-bottom: 32px;
background: url(http://respub.sinoecare.net/20211222/装饰2-20211222162934.png) no-repeat;
background-size: 100% 100%;
.photos {
img {
width: 96px;
height: 96px;
border-radius: 50%;
}
}
.right {
display: flex;
flex-direction: column;
margin-left: 40px;
width: 100%;
.rightTop {
display: flex;
justify-content: space-between;
.rightTop-lefts {
width: calc(100% - 100px);
.names {
font-size: 32px;
font-weight: 600;
word-break: break-all;
}
.householdNames {
margin-left: 30px;
font-size: 26px;
font-weight: 500;
color: #5aad6a;
display: inline-block;
width: 100px;
}
.fileStatuss {
display: inline-block;
margin-left: 30px;
color: #ff4466;
background: #ffecef;
border-radius: 8px;
width: 88px;
height: 40px;
line-height: 40px;
text-align: center;
}
}
.rightTop-rights {
width: 100px;
::v-deep .u-section {
.u-section__right-info {
color: #3975c6 !important;
.u-section__right-info__icon-arrow {
.u-icon {
.u-icon__icon {
color: #3975c6 !important;
}
}
}
}
}
}
}
.rightBottom {
margin-top: 20px;
}
}
}
.middle {
display: flex;
padding: 24px 32px;
.left {
width: 220px;
display: flex;
align-items: center;
img {
width: 48px;
height: 48px;
}
}
.u-search {
margin-bottom: 0 !important;
}
}
::v-deep .content{
padding: 0;
}
.audit-status{
display: inline-block;
padding: 0 8px;
line-height: 40px;
background: #EAF0FE;
border-radius: 8px;
font-size: 24px;
font-family: PingFangSC-Regular, PingFang SC;
}
.status1{
color: #3E95FF;
background-color: #EAF0FE;
}
.status0{
color: #5AAD6A;
background-color: #E9FFED;
}
.status2{
color: #f46;
background-color: #FFECEF;
}
}
</style>

View File

@@ -0,0 +1,320 @@
<template>
<div class="PeopleList">
<AiTopFixed>
<div class="areatop">
<!-- <div>区域选择</div>
<AiAreaPicker v-model="areaId" :areaId="user.areaId" @select="seachObj"></AiAreaPicker>
<u-icon name="photo"></u-icon> -->
<!-- @select="areaSelect" -->
<u-form label-width="auto">
<u-form-item label="区域选择" right-icon="arrow-right" class="areaIds">
<AiAreaPicker v-model="areaId" :areaId="user.areaId" @input="seachObj" :name.sync="areaName" selectRoot/>
</u-form-item>
</u-form>
</div>
<div class="line"></div>
<u-tabs :list="tabList" :is-scroll="false" :current="currentTabs" height="96" @change="change"></u-tabs>
<div class="seachObjs">
<u-search v-model="keyword" :clearabled="true" placeholder="姓名/联系方式/身份证后6位" :show-action="false"
bg-color="#F5F5F5" search-icon-color="#E2E8F1" color="#666" height="58" @search="handerSearch"
@clear="handerClear"></u-search>
</div>
</AiTopFixed>
<div class="dataes" v-if="datas.length > 0">
<div class="datass" v-for="(item, iindex) in datas" :key="iindex" @click="toDetailCard(item)">
<div class="left">
<img :src="item.photo" alt="" v-if="item.photo"/>
<img src="./components/img/4.png" alt="" v-else/>
</div>
<div class="right">
<div class="rightTop">
<span class="name">{{ item.name }}</span>
<span class="btn" v-if="user.id == item.createUserId">
<img src="./components/img/edit-icon.png" alt="" @click.stop="edit(item.id)">
<img src="./components/img/del-icon.png" alt="" @click.stop="del(item.id)">
</span>
</div>
<div class="rightBottom">
<span>{{ item.idNumber.replace(/^(\w{6})\w{8}(.*)$/, '$1********$2') }}</span>
<span>{{ item.phone }}</span>
</div>
</div>
</div>
</div>
<div class="empty" v-else>
<img src="https://cdn.cunwuyun.cn/dvcp/h5/no-data.png" alt="">
<p>暂无居民信息<br/>点击<span @click="edit('')">新增按钮</span>新增居民信息,也可在管理系统批量导入</p>
</div>
<!-- <AiEmpty class="emptyWrap" v-else></AiEmpty> -->
<div style="height: 60px"></div>
<div class="addBtn" @click="edit('')">新增居民</div>
</div>
</template>
<script>
import {mapState} from 'vuex'
export default {
name: 'PeopleList',
props: {},
data() {
return {
keyword: '',
datas: [],
current: 1,
size: 10,
tabList: [
{
name: '全部居民',
},
{
name: '本地居民',
},
{
name: '流动人员',
},
],
currentTabs: 0,
areaId: '',
areaName: '',
}
},
computed: {
...mapState(['user']),
},
watch: {},
onLoad() {
this.areaId = this.user.areaId
this.areaName = this.user.areaName
uni.$on('reload', () => {
this.current = 1
this.getList()
})
this.getList()
},
onShow() {
document.title = '查看居民档案'
},
methods: {
getList() {
var residentType = ['', 0, 1][this.currentTabs]
this.$instance
.post('/app/appresident/list', null, {
params: {
size: 20,
current: this.current,
con: this.keyword,
areaId: this.areaId,
residentType: residentType,
auditStatus: 1
},
})
.then((res) => {
if (res.code == 0) {
this.datas = this.current > 1 ? [...this.datas, ...res.data.records] : res.data.records
this.pages = res.data.pages
}
})
},
change(index) {
this.currentTabs = index
this.current = 1
this.datas = []
this.getList()
},
toDetailCard(item) {
uni.navigateTo({url: `./DetailCard?id=${item.id}`})
},
seachObj(e) {
this.areaId = e
this.current = 1
this.getList()
},
handerSearch(e) {
this.keyword = e
this.current = 1
this.getList()
},
handerClear() {
this.keyword = ''
this.current = 1
this.getList()
},
edit(id) {
var residentType = ['', 0, 1][this.currentTabs]
uni.navigateTo({url: `./Add?id=${id}&type=${residentType}`})
},
del(id) {
this.$confirm('确定删除该数据?').then(() => {
uni.showLoading()
this.$instance.post(`/app/appresident/delete?ids=${id}`).then((res) => {
if (res.code == 0) {
this.$u.toast('删除成功!')
this.current = 1
this.getList()
}
uni.hideLoading()
})
}).catch(() => {
})
}
},
onReachBottom() {
this.current = this.current + 1
this.getList()
},
}
</script>
<style scoped lang="scss">
.PeopleList {
height: 100%;
.areatop {
display: flex;
justify-content: space-between;
align-items: center;
}
.line {
height: 16px;
background: #f5f5f5;
}
.seachObjs {
border-bottom: 2px solid #f5f5f5;
border-top: 2px solid #f5f5f5;
padding: 20px 32px;
background: #fff;
}
::v-deep .u-form {
width: 100%;
.areaIds {
.u-form-item__body {
.u-form-item--right {
.u-form-item--right__content {
display: flex;
align-items: center;
.u-form-item--right__content__slot {
.AiAreaPicker {
width: 100%;
display: flex;
justify-content: flex-end;
.areaSelector {
.location {
opacity: 0;
}
}
}
}
.u-form-item--right__content__icon {
margin-bottom: 8px;
}
}
}
}
}
}
.dataes {
background: #fff;
.datass {
display: flex;
padding: 24px 32px;
.left {
img {
width: 80px;
height: 80px;
border-radius: 50%;
}
}
.right {
display: flex;
flex-direction: column;
margin-left: 32px;
width: 100%;
.rightTop {
font-size: 32px;
font-weight: 500;
color: #333333;
display: flex;
justify-content: space-between;
.btn {
img {
width: 48px;
height: 48px;
margin-left: 40px;
}
}
}
.rightBottom {
display: flex;
justify-content: space-between;
margin-top: 8px;
}
}
}
}
.emptyWrap {
background: #f5f5f5;
margin: 0;
}
.addBtn {
width: 100%;
height: 112px;
line-height: 112px;
background: #1365DD;
text-align: center;
color: #FFF;
font-size: 32px;
position: fixed;
bottom: 0;
}
.empty {
height: 100%;
img {
width: 282px;
height: 306px;
margin: 168px 0 0 234px;
}
p {
text-align: center;
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
color: #999;
line-height: 44px;
span {
color: #467DFE;
}
}
}
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 491 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 590 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -0,0 +1,218 @@
<template>
<div class="photo-list">
<div class="photo-list__wrapper">
<div class="photo-item" v-for="(item, index) in list" :key="index">
<u-swipe-action @content-click="$linkTo('./PhotoDetail?id=' + item.id)" :index="item.id"
:options="itemOptions" @click="handleDelete">
<div class="photo-item__top">
<h2>{{ item.content }}</h2>
<div class="photo-item__top--info">
<div class="photo-item__top--info-item">
<label>事件类型</label>
<span>{{ item.groupName }}</span>
</div>
<div class="photo-item__top--info-item">
<label>所属网格</label>
<span>{{ item.girdName }}</span>
</div>
</div>
</div>
<div class="photo-item__bottom flex">
<div class="flex fill">
<i :class="'status-' + item.eventStatus"></i>
<span :class="'status-' + item.eventStatus">{{ item.statusName }}</span>
</div>
<AiEvaluation :bid="item.id" v-if="item.eventStatus>1">
<div class="itemBtn">去评价</div>
<div slot="finish" class="finish">已评价</div>
</AiEvaluation>
</div>
</u-swipe-action>
</div>
<AiEmpty v-if="!list.length"/>
</div>
<div class="btn-wrapper">
<div class="btn" @click="toReport" hover-class="text-hover">我要上报</div>
</div>
</div>
</template>
<script>
import {mapState} from 'vuex'
export default {
name: "AppPhotoReport",
appName: "居民上报",
data() {
return {
list: [],
current: 1,
total: 0,
itemOptions: [
{text: '删除', style: {backgroundColor: '#f46'}}
]
}
},
computed: {
...mapState(['user'])
},
onShow() {
this.current = 1
this.getList()
},
onLoad() {
this.$dict.load(['clapEventStatus'])
},
methods: {
toReport() {
this.$linkTo('./PhotoForm')
},
getList() {
if (this.current == 1) {
//当current=1时,意味着重新刷新数据
this.list = []
} else if (this.list.length >= this.total && this.total > 0) {
return //当数据总量和列表总量一样时,不用再加载数据
}
this.$loading()
this.$instance.post(`/app/appresidentreportinfo/listByApplet`, null, {
params: {
current: this.current, size: 15
}
}).then(res => {
if (res?.data) {
const list = res.data.records.map(v => ({...v, statusName: this.$dict.getLabel('clapEventStatus', v.eventStatus)}))
this.list = this.current == 1 ? list : [this.list, list].flat()
this.total = res.data.total
this.current++
}
}).finally(() => uni.hideLoading())
},
handleDelete(ids) {
this.$dialog.confirm({content: "是否要进行删除?"}).then(() => {
this.$instance.post("/app/appresidentreportinfo/delete", null, {
params: {ids}
}).then(res => {
if (res?.code == 0) {
this.$u.toast("删除成功!")
this.current = 1
this.getList()
}
})
}).catch(() => 0)
}
},
onReachBottom() {
this.getList()
}
}
</script>
<style lang="scss">
.photo-list {
padding: 24px 0 150px 0;
.photo-item {
width: 686px;
margin: 0 32px 24px;
background: #FFFFFF;
box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.02);
border-radius: 16px;
overflow: hidden;
.photo-item__top {
padding: 32px;
text-align: justify;
h2 {
margin-bottom: 32px;
line-height: 1.4;
color: #333333;
font-size: 32px;
font-weight: 600;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.photo-item__top--info-item {
// display: flex;
// align-items: center;
&:last-child {
margin-bottom: 8px;
}
label {
display: inline-block;
margin-right: 32px;
color: #999999;
font-size: 26px;
}
span {
display: inline-block;
color: #333333;
font-size: 26px;
}
}
}
.photo-item__bottom {
display: flex;
align-items: center;
height: 104px;
padding: 0 32px;
border-top: 1px solid #DDDDDD;
i {
width: 8px;
height: 8px;
margin-right: 8px;
border-radius: 50%;
background: #FF883C;
}
.itemBtn {
border: 1px solid #4181FF;
border-radius: 8px;
color: #4181FF;
padding: 8px 22px;
}
.finish {
color: #42D784;
font-size: 28px;
}
span {
color: #FF883C;
font-size: 28px;
background: transparent !important;
}
.status-1 {
color: #1AAAFF;
background: #1AAAFF;
}
.status-2 {
color: #42D784;
background: #42D784;
}
.status-3 {
color: #FF4466;
background: #FF4466;
}
}
}
}
</style>

View File

@@ -0,0 +1,251 @@
<template>
<div class="photo-detail">
<AiGroup noBorder>
<h2>{{ info.content }}</h2>
<div class="status-name" :class="detailStatus.cls" v-text="detailStatus.label"/>
</AiGroup>
<AiGroup description noBorder labelColor="#999">
<AiItem label="事件来源" :value="$dict.getLabel('residentEventSource', info.eventSource)"/>
<AiItem label="事件类型" :value="info.groupName"/>
<AiItem label="所属网格" :value="info.girdName"/>
<AiItem label="上报时间" :value="info.createTime"/>
<AiItem label="照片" top-label>
<div class="flex wrap">
<image class="imageItem" v-for="(item, index) in info.files" @click="preview(item.url)" :key="index" :src="item.url"/>
</div>
<span v-if="!info.files.length">暂无照片</span>
</AiItem>
</AiGroup>
<!-- <u-gap height="24"/>
<AiGroup title="处理详情" v-if="info.eventStatus > 1" description noBorder labelColor="#999">
<AiItem label="处理结果" top-label :value="result.doExplain"/>
<AiItem label="照片" top-label>
<div class="flex wrap">
<image class="fill imageItem" v-for="(item, index) in result.files" @click="preview(item.url)" :key="index" :src="item.url"/>
</div>
<span v-if="!result.files.length">暂无照片</span>
</AiItem>
</AiGroup> -->
<!-- <u-gap height="24"/> -->
<!-- <u-tabs :list="[{name:'办理进度'},{name:'我的评价'}]" :current="currentTab" @change="v=>currentTab=v"/> -->
<div class="tab-content">
<div class="tab-item" v-for="(item, index) in tabList" :key="index" @click="tabClick(index)" :class="currentTab == index ? 'active' : ''">{{ item.name }}
<span class="active-line" v-if="currentTab == index"/>
</div>
</div>
<u-gap height="24"/>
<AiGroup noBorder v-if="currentTab=='0'">
<AiStep v-for="(item,i) in process" :key="item.id" :index="i">
<div class="flex start">
<div class="fill stepTitle" v-text="item.systemExplain"/>
<div class="color-999 mar-r32 stepTime" v-text="item.doTime"/>
</div>
<div v-if="item.doExplain" class="stepContent mar-t8" v-text="item.doExplain"/>
<div class="imgs">
<img :src="e.url" alt="" v-for="(e, index) in item.files" :key="index" @click="previewImage(item.files, e.url)"/>
</div>
<u-gap height="48"/>
</AiStep>
</AiGroup>
<AiEvaluation v-if="currentTab=='1' && showEvaluation" :bid="info.id" type="show"/>
<AiEvaluation v-if="info.eventStatus > 1 && showEvaluation" v-model="evaluation" class="fixed-bottom bg-fff" :bid="info.id">
<div class="bottomBtn">去评价</div>
</AiEvaluation>
</div>
</template>
<script>
export default {
appName: "居民上报详情",
data() {
return {
info: {},
result: {},
currentTab: 0,
evaluation: {},
id: '',
showEvaluation: false
// tabList: [{name:'办理进度'},{name:'我的评价'}]
}
},
computed: {
detailStatus: v => {
const status = !v.evaluation.id ? v.info.eventStatus : 'evaluation'
return {
cls: 'status-' + status,
label: !v.evaluation.id ? v.$dict.getLabel('clapEventStatus', v.info.eventStatus) : "已评价"
}
},
process() {
const list = this.info.processList
if (this.evaluation.id) {
const {id, createUserName, score, createTime: doTime, rateText: doExplain} = this.evaluation
list.splice(0, 0, {
id, doTime, doExplain,
systemExplain: `${createUserName}完成评价 (${score}星评价)`
})
}
return list
},
tabList() {
var list = !this.evaluation.id ? [{name:'办理进度'}] : [{name:'办理进度'},{name:'我的评价'}]
return list
}
},
onShow() {
this.showEvaluation = false
this.getInfo()
},
onLoad(query) {
this.id = query.id
this.$dict.load(['clapEventStatus', 'residentEventSource'])
},
methods: {
tabClick(index) {
this.currentTab = index
if(!this.currentTab) {
this.getInfo()
}
},
getInfo() {
this.$loading()
this.$instance.post(`/app/appresidentreportinfo/queryDetailById?id=${this.id}`).then(res => {
if (res?.data) {
this.info = res.data
if (res.data.eventStatus > 1) {
this.result = res.data.processList[0]
}
this.showEvaluation = true
}
}).finally(() => this.$hideLoading())
},
previewResult(url) {
uni.previewImage({
urls: this.result.files.map(v => v.url),
current: url
})
},
preview(url) {
uni.previewImage({
urls: this.info.files.map(v => v.url),
current: url
})
},
previewImage(images, img) {
uni.previewImage({
urls: images.map(v => v.url),
current: img
})
},
}
}
</script>
<style lang="scss">
.photo-detail {
padding: 32px 0 160px;
margin-bottom: 60px;
background: #fff;
h2 {
width: calc(100% - 32px);
line-height: 1.3;
margin-bottom: 26px;
color: #333333;
text-align: justify;
font-size: 40px;
}
::v-deep.stepTitle {
min-height: 44px;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 32px;
}
.stepTime {
line-height: 44px;
}
.stepContent {
color: #343D65;
}
.status-name {
width: 96px;
height: 44px;
line-height: 44px;
margin-bottom: 20px;
text-align: center;
background: #FF883C;
color: #fff;
font-size: 26px;
border-radius: 8px;
&.status-1, &.status-evaluation {
background: #1AAAFF;
}
&.status-2 {
background: #42D784;
}
&.status-3 {
background: #FF4466;
}
}
.imageItem {
width: calc(33% - 16px);
height: 226px;
flex-shrink: 0;
margin-right: 16px;
margin-bottom: 16px;
&:nth-of-type(3n) {
margin-right: 0;
}
}
.imgs {
margin-top: 10px;
img {
width: 136px;
height: 136px;
border-radius: 4px;
margin-right: 12px;
}
img:nth-of-type(3n) {
margin-right: 0;
}
}
.tab-content {
.tab-item {
display: inline-block;
width: 50%;
position: relative;
height: 88px;
line-height: 88px;
font-size: 32px;
color: #666;
text-align: center;
.active-line {
position: absolute;
top: 80px;
left: 50%;
margin-left: -40px;
width: 80px;
height: 4px;
border-radius: 2px;
background-color: #197DF0;
}
}
.active {
font-weight: 500;
color: #333;
}
}
}
</style>

View File

@@ -0,0 +1,353 @@
<template>
<div class="album">
<div class="form-item__group">
<div class="form-item">
<div class="form-item__wrapper">
<div class="form-item__title">
<i>*</i>
<h2>事件类型</h2>
</div>
<div class="form-item__right">
<AiSelect :list="dictList" v-model="form.groupId" placeholder="请选择"></AiSelect>
</div>
</div>
</div>
<div class="form-item form-item__textarea">
<div class="form-item__wrapper">
<div class="form-item__title">
<i>*</i>
<h2>事件描述</h2>
</div>
<div class="form-item__right">
<textarea v-model="form.content" :maxlength="500" placeholder="请简要描述事件…"></textarea>
<!-- <u-input style="width: 100%;" :height="200" v-model="value" type="textarea" :maxlength="500" :border="border" placeholder="请简要描述事件…" /> -->
</div>
</div>
</div>
</div>
<div class="form-item__group">
<div class="form-item">
<div class="form-item__wrapper">
<div class="form-item__title">
<i>*</i>
<h2>上报位置</h2>
</div>
<div class="form-item__right" @click="chooseAddress">
<span v-if="form.address">{{ form.address }}</span>
<i v-else>请选择</i>
<u-icon name="arrow-right" color="#ddd"/>
</div>
</div>
</div>
<div class="form-item">
<div class="form-item__wrapper">
<div class="form-item__title">
<i>*</i>
<h2>所属网格</h2>
</div>
<div class="form-item__right">
<AiPagePicker type="gird" v-model="form.girdId" :params="{formType:2, axiosUrl:'/app/appgirdinfo/listAllByWuxi'}" @select="handleSelectGrid" nodeKey="id">
<AiMore v-model="form.girdName"/>
</AiPagePicker>
</div>
<p class="tips">所属网格请详细选择到您具体所在的网格</p>
</div>
</div>
</div>
<div class="form-item__group">
<div class="form-item form-item__imgs">
<div class="form-item__wrapper">
<div class="form-item__title">
<i style="opacity: 0;">*</i>
<h2>图片上传</h2>
<span>(最多9张)</span>
</div>
<AiUploader v-model="form.files" :limit="9"></AiUploader>
</div>
</div>
</div>
<div class="form-item__group">
<div class="form-item">
<div class="form-item__wrapper">
<div class="form-item__title">
<i>*</i>
<h2>姓名</h2>
</div>
<div class="form-item__right">
<input placeholder="请输入" v-model="form.name" :maxlength="20"/>
</div>
</div>
</div>
<div class="form-item">
<div class="form-item__wrapper">
<div class="form-item__title">
<i>*</i>
<h2>联系方式</h2>
</div>
<div class="form-item__right">
<input placeholder="请输入" v-model="form.phone" :maxlength="11"/>
</div>
</div>
</div>
</div>
<div class="btn-wrapper">
<div class="btn" hover-class="text-hover" @click="submit">提交</div>
</div>
<AiLogin ref="login"/>
</div>
</template>
<script>
import {mapActions, mapState} from 'vuex'
export default {
appName: "上报事件",
data() {
return {
form: {
content: '',
lat: '',
lng: '',
address: '',
name: '',
phone: '',
groupId: '',
groupName: '',
girdName: '',
girdId: '',
files: []
},
dictList: [],
flag: false
}
},
computed: {
...mapState(['user', 'token'])
},
onLoad() {
if (!this.token) {
this.autoLogin().then(() => {
this.getUser()
})
} else {
this.getUser()
}
},
methods: {
...mapActions(['autoLogin', 'getUserInfo']),
chooseAddress() {
uni.authorize({
scope: 'scope.userLocation',
success: () => {
uni.chooseLocation({
success: res => {
this.form.address = res.address
this.form.lat = res.latitude
this.form.lng = res.longitude
}
})
},
fail: () => {
this.$dialog.confirm({
content: '您未授权定位权限,无法选择位置'
}).then(() => {
wx.openSetting({
success: res => {
if (!res.authSetting['scope.userLocation']) {
this.$dialog.alert({
content: '您未授权定位权限,无法选择位置'
}).then(() => {
})
} else {
console.log('设置定位权限')
}
}
})
})
}
})
},
getDict() {
this.$instance.post(`/app/appresidentreportgroup/list?current=1&size=100000`).then(res => {
if (res.code == 0) {
this.dictList = res.data.records.map(v => {
return {
value: v.id,
label: v.groupName
}
})
}
})
},
submit() {
if (!this.form.groupId) {
return this.$toast('请选择事件类型')
}
if (!this.form.content) {
return this.$toast('请输入事件描述')
}
if (!this.form.address) {
return this.$toast('请选择上报位置')
}
if (!this.form.name) {
return this.$toast('请输入上报人姓名')
}
if (!this.form.phone) {
return this.$toast('请输入上报人联系方式')
}
if (!this.form.girdId) {
return this.$toast('请选择所属网格')
}
if (this.flag) return
this.$loading()
this.$instance.post(`/app/appresidentreportinfo/addByApplet`, {
...this.form,
openid: this.user.openid,
portrait: this.user.avatarUrl,
files: this.form.files,
groupName: this.dictList.filter(v => v.value === this.form.groupId)[0].label
}).then(res => {
if (res.code == 0) {
this.flag = true
uni.$emit('update')
setTimeout(() => {
uni.redirectTo({
url: './PhotoResult?id=' + res.data.id
})
}, 400)
}
this.$hideLoading()
})
},
handleSelectGrid(v) {
this.form.girdName = v.girdName
},
getUser() {
this.getUserInfo().then(() => {
this.getDict()
this.form.phone = this.user.phone
this.form.name = this.user.realName || ''
}).catch(() => {
this.$refs.login.show()
})
}
}
}
</script>
<style lang="scss">
.album {
padding-bottom: 140px;
.form-item__group {
margin-bottom: 24px;
background: #fff;
}
.form-item {
padding-left: 32px;
.form-item__wrapper {
display: flex;
align-items: center;
justify-content: space-between;
height: 128px;
padding-right: 28px;
border-bottom: 1px solid #DDDDDD;
position: relative;
input {
flex: 1;
height: 100%;
text-align: right;
padding-right: 10px;
}
.form-item__right {
display: flex;
align-items: center;
font-size: 32px;
span {
max-width: 400px;
margin-right: 8px;
color: #333333;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
i {
margin-right: 8px;
color: #999999;
}
}
}
&:last-child {
.form-item__wrapper {
border-bottom: none;
}
}
.form-item__title {
display: flex;
align-items: center;
i {
font-size: 32px;
color: #FF4466;
}
span {
font-size: 28px;
color: #999999;
}
h2 {
padding: 0 4px;
font-weight: 600;
font-size: 32px;
color: #333333;
}
}
&.form-item__imgs, &.form-item__textarea {
.form-item__wrapper {
display: block;
height: auto;
padding-bottom: 32px;
}
textarea {
width: 100%;
height: 160px;
}
.form-item__title {
padding: 32px 0;
}
.form-item__right {
padding-left: 18px;
}
}
}
.tips {
font-size: 24px;
color: #f46;
line-height: 36px;
position: absolute;
bottom: 8px;
left: 22px;
}
}
</style>

View File

@@ -0,0 +1,64 @@
<template>
<div class="result">
<image src="/static/img/result.png" />
<h2>上报成功</h2>
<div class="result-btn" hover-class="text-hover" @click="back">前往查看</div>
</div>
</template>
<script>
export default {
appName:"上报事件",
data () {
return {
id: ''
}
},
onLoad (query) {
this.id = query.id
},
methods: {
back () {
uni.redirectTo({
url: './PhotoDetail?id=' + this.id
})
}
}
}
</script>
<style lang="scss">
.result {
min-height: 100vh;
padding-top: 160px;
box-sizing: border-box;
text-align: center;
background: #fff;
image {
width: 220px;
height: 220px;
}
h2 {
margin: 32px 0 80px;
font-weight: 600;
font-size: 40px;
color: #333;
}
.result-btn {
width: 320px;
height: 88px;
line-height: 88px;
margin: 0 auto;
text-align: center;
background: #4181FF;
color: #fff;
font-size: 34px;
border-radius: 16px;
}
}
</style>

View File

@@ -0,0 +1,825 @@
<template>
<div class="AppResidentFile">
<div class="currentTabBar0" v-if="currentTabBar == 0">
<u-tabs :list="tabList" :is-scroll="false" :current="currentTabs" height="96" bg-color="#3975C6" inactive-color="#fff" active-color="#fff" @change="change"></u-tabs>
<div class="peopleGroup" v-if="currentTabs == 0">
<div class="topcard">
<div class="cards">
<div class="items">
<span class="items1">{{ groupSum }}</span>
<span>群聊总数</span>
</div>
<div class="items">
<span class="items2">{{ todayList1.total }}</span>
<span>群成员总数</span>
</div>
<div class="items">
<span class="items3">{{ todayList1.increase }}</span>
<span>今日入群</span>
</div>
<div class="items">
<span class="items4">{{ todayList1.decrease }}</span>
<span>今日退群</span>
</div>
</div>
</div>
<div class="echartes" id="echarts1">
<div class="echartss"></div>
</div>
</div>
<div class="people" v-if="currentTabs == 1">
<div class="topcard">
<div class="cards">
<div class="items">
<span class="items1">{{ todayList2.total }}</span>
<span>居民总数</span>
</div>
<div class="items">
<span class="items3">{{ todayList2.increase }}</span>
<span>今日新增</span>
</div>
<div class="items">
<span class="items4">{{ todayList2.decrease }}</span>
<span>今日流失</span>
</div>
</div>
</div>
<div class="echartes" id="echarts2">
<div class="echartss"></div>
</div>
</div>
</div>
<div class="currentTabBar1" v-if="currentTabBar == 1">
<AiTopFixed>
<u-search placeholder="请输入昵称、姓名" :show-action="false" search-icon-color="#ccc" v-model="search.name" @search=";(page1.current = 1), getList()" />
<AiCell>
<b slot="label" class="title"><i v-html="page1.total || 0" />个居民</b>
</AiCell>
</AiTopFixed>
<div class="mainPane">
<AiCell v-for="item in data" :key="item.id" @click.native="showResident(item)">
<template #label>
<AiImage :src="item.avatar" preview />
</template>
<div class="card wrap start" flex>
<b>{{ item.name }}</b>
<div flex class="tag" v-for="(tag, j) in item.tags" :key="j">{{ tag.tagName }}</div>
<div class="realName" shrink v-html="`真实姓名:${item.realName || '-'}`" />
</div>
</AiCell>
</div>
</div>
<div class="currentTabBar2" v-if="currentTabBar == 2">
<AiTopFixed>
<u-search placeholder="请输入群名、群主名" :show-action="false" search-icon-color="#ccc" v-model="search.name" @search=";(page2.current = 1), getList()" />
<AiCell>
<b slot="label" class="title"><i v-html="page2.total || 0" />个居民群</b>
</AiCell>
</AiTopFixed>
<div class="mainPane">
<AiCell v-for="(item, i) in list" :key="i" @click.native="toGroupList(item)">
<template #label>
<AiImage :src="item.avatar" preview />
</template>
<div class="card column start" flex>
<div flex class="groupName">
<b>{{ item.name || '群聊' }}</b>
<div class="personCount" v-if="item.personCount">({{ item.personCount }})</div>
</div>
<div class="owner" v-html="`群主:${item.ownerName}`" />
<div flex class="trends">
<div flex v-html="`今日入群:<em>${item.increase || 0}</em>`" />
<div flex v-html="`今日退群:<p>${item.decrease || 0}</p>`" />
</div>
</div>
</AiCell>
</div>
</div>
<!-- <u-tabbar v-model="currentTabBar" :list="lists" @change="changeTab" active-color="#3267F0" inactive-color="#C4CAD4" class="u-tabbar"></u-tabbar> -->
<div class="tabs">
<div class="item" @click="changeTab(index)" v-for="(item, index) in lists" :key="index">
<img :src="currentTabBar == index ? item.selectedIconPath : item.iconPath" alt="" />
<p :class="currentTabBar == index ? 'color-3267F0' : ''">{{ item.text }}</p>
</div>
</div>
</div>
</template>
<script>
// import echarts from 'echarts'
import { mapState } from 'vuex'
export default {
name: 'AppResidentFile',
appName: '居民信息管理',
components: {},
props: {},
data() {
return {
lists: [
{
iconPath: 'http://respub.sinoecare.net/20211227/1n-20211227162529.png',
selectedIconPath: 'http://respub.sinoecare.net/20211227/1h-20211227164832.png',
text: '统计分析',
customIcon: false,
},
{
iconPath: 'http://respub.sinoecare.net/20211227/2n-20211227164853.png',
selectedIconPath: 'http://respub.sinoecare.net/20211227/2h-20211227164906.png',
text: '居民列表',
customIcon: false,
},
{
iconPath: 'http://respub.sinoecare.net/20211227/3n-20211227164927.png',
selectedIconPath: 'http://respub.sinoecare.net/20211227/3h-20211227165003.png',
text: '居民群列表',
customIcon: false,
},
],
currentTabBar: 0,
currentTabs: 0,
tabList: [
{
name: '居民群统计',
},
{
name: '居民统计',
},
],
Echarts1: null,
Echarts2: null,
areaId: '',
current: 1,
keyword: '',
data: [],
search: { name: '' },
list: [],
weekList: [],
groupSum: '',
todayList1: [],
todayList2: [],
counts1: '',
counts2: '',
page2: { current: 1, size: 10, total: 0 },
search2: { name: '' },
page1: { current: 1, size: 10, total: 0 },
search1: { name: '' },
}
},
computed: {
...mapState(['user', 'global']),
},
watch: {},
onLoad() {
// document.title = '居民信息管理'
// this.getEchart1()
// this.areaId = this.user.areaId
},
mounted() {
// this.Echarts1 = echarts.init(document.getElementById('echarts1'))
},
methods: {
// 居民列表
getList() {
this.$instance
.post('/app/wxcp/wxcustomer/list', null, {
params: { ...this.page1, ...this.search, type: 1 },
})
.then((res) => {
if (res?.data) {
if (this.page1.current > 1) {
this.data = [...this.data, ...res.data.records]
} else this.data = res.data.records
this.page1.total = res.data.total
}
})
},
// reachBottom() {
// if (this.page1.total > this.list.length) {
// this.page1.current++
// this.getList()
// }
// },
showResident({ id }) {
id &&
uni.navigateTo({
url: './resident?id=' + id,
})
},
// 居民群列表
getList2() {
this.$instance
.post('/app/wxcp/wxgroup/list', null, {
params: { ...this.page2, ...this.search },
})
.then((res) => {
if (res?.data) {
let meta = res.data.records?.map((e) => ({
...e,
avatar: e?.avatar || this.$cdn + 'groupAvatar.png',
}))
if (this.page2.current > 1) {
this.list = [...this.list, ...meta]
} else this.list = meta
this.page2.total = res.data.total
}
})
},
// reachBottom() {
// if (this.page2.total > this.list.length) {
// this.page2.current = this.page2.current + 1
// this.getList2()
// }
// },
toGroupList(item) {
uni.navigateTo({
url: `./GroupList?id=${item.id}`,
})
},
// 居民群统计
getEchart1() {
this.$instance.post(`/app/wxcp/wxgroup/groupStatistic`).then((res) => {
if (res.code === 0) {
this.weekList = res.data.list
this.initEcharts1(this.weekList)
this.groupSum = res.data.groupSum
this.todayList1 = res.data.today
}
})
},
// 居民统计
getEchart2() {
this.$instance.post(`/app/wxcp/wxcustomerlog/customerStatistic?areaId=${this.user.areaId}`).then((res) => {
if (res.code === 0) {
this.initEcharts2(res.data.list)
this.todayList2 = res.data.today
}
})
},
initEcharts1(data) {
var option = {
legend: {
data: ['群成员总数', '入群人数', '退群人数'],
y: 'bottom',
},
color: ['#4A86FD', '#32C5FF', '#FFAA44'],
tooltip: {
trigger: 'axis',
},
grid: {
top: '9%',
left: '6%',
right: '8%',
bottom: '9%',
containLabel: true,
},
xAxis: {
type: 'category',
data: Object.keys(data).map((e) => e.substring(e.length - 5, e.length)),
axisLine: {
show: true,
lineStyle: { color: '#666' },
},
axisLabel: {
show: true,
interval: 0,
},
axisTick: {
show: false,
},
},
yAxis: {
type: 'value',
axisLine: {
show: false,
},
splitLine: {
show: true,
lineStyle: {
color: '#D8DDE6',
},
},
axisLabel: {
show: true,
interval: 0,
},
axisTick: {
show: false,
},
},
series: [
{
lineStyle: {
normal: {
lineStyle: {
color: '#4A86FD',
},
},
},
color: '#4A86FD',
name: '群成员总数',
type: 'line',
stack: 'Total',
data: Object.values(data).map((e) => e.total),
},
{
lineStyle: {
normal: {
lineStyle: {
color: '#32C5FF',
},
},
},
color: '#32C5FF',
name: '入群人数',
type: 'line',
stack: 'Total',
data: Object.values(data).map((e) => e.increase),
},
{
lineStyle: {
normal: {
lineStyle: {
color: '#FFAA44',
},
},
},
color: '#FFAA44',
name: '退群人数',
type: 'line',
stack: 'Total',
data: Object.values(data).map((e) => e.decrease),
},
],
}
option && this.Echarts1.setOption(option)
},
initEcharts2(data) {
var options = {
legend: {
data: ['居民总数', '新增居民数', '流失居民数'],
y: 'bottom',
},
color: ['#4A86FD', '#32C5FF', '#FFAA44'],
tooltip: {
trigger: 'axis',
},
grid: {
top: '9%',
left: '6%',
right: '8%',
bottom: '9%',
containLabel: true,
},
xAxis: {
type: 'category',
data: Object.keys(data).map((e) => e.substring(e.length - 5, e.length)),
axisLine: {
show: true,
lineStyle: { color: '#666' },
},
axisLabel: {
show: true,
interval: 0,
},
axisTick: {
show: false,
},
},
yAxis: {
type: 'value',
axisLine: {
show: false,
},
splitLine: {
show: true,
lineStyle: {
color: '#D8DDE6',
},
},
axisLabel: {
show: true,
interval: 0,
},
axisTick: {
show: false,
},
},
series: [
{
lineStyle: {
normal: {
lineStyle: {
color: '#4A86FD',
},
},
},
color: '#4A86FD',
name: '居民总数',
type: 'line',
stack: 'Total',
data: Object.values(data).map((e) => e.total),
},
{
lineStyle: {
normal: {
lineStyle: {
color: '#32C5FF',
},
},
},
color: '#32C5FF',
name: '新增居民数',
type: 'line',
stack: 'Total',
data: Object.values(data).map((e) => e.increase),
},
{
lineStyle: {
normal: {
lineStyle: {
color: '#FFAA44',
},
},
},
color: '#FFAA44',
name: '流失居民数',
type: 'line',
stack: 'Total',
data: Object.values(data).map((e) => e.decrease),
},
],
}
if (this.Echarts2) {
options && this.Echarts2.setOption(options)
}
},
changeTab(e) {
this.currentTabBar = e
if (this.currentTabBar == 0) {
this.getList()
this.$nextTick(() => {
if (this.currentTabs == 0) {
this.Echarts1 = echarts.init(document.getElementById('echarts1'))
this.getEchart1()
}
if (this.currentTabs == 1) {
this.Echarts2 = echarts.init(document.getElementById('echarts2'))
this.getEchart2()
}
})
}
if (this.currentTabBar == 1) {
this.page1.current == 1
this.getList()
}
if (this.currentTabBar == 2) {
this.page2.current == 1
this.getList2()
}
},
change(index) {
this.currentTabs = index
this.$nextTick(() => {
if (index == 0) {
this.Echarts1 = echarts.init(document.getElementById('echarts1'))
this.getEchart1()
} else {
this.Echarts2 = echarts.init(document.getElementById('echarts2'))
this.getEchart2()
}
})
},
},
onReachBottom() {
if (this.currentTabBar == 1) {
this.page1.current++
this.getList()
}
if (this.currentTabBar == 2) {
this.page2.current++
this.getList2()
}
},
}
</script>
<style scoped lang="scss">
uni-page-body {
height: 100%;
}
.AppResidentFile {
height: 100%;
.currentTabBar0 {
padding-bottom: 98px;
.peopleGroup,
.people {
.topcard {
position: relative;
background: url(http://respub.sinoecare.net/20211221/4-20211221095551.png) no-repeat;
background-size: 100% 100%;
height: 320px;
.cards {
box-sizing: border-box;
position: absolute;
bottom: -35px;
width: 92%;
box-sizing: border-box;
margin: 0 32px;
height: 232px;
background: #ffffff;
border-radius: 8px;
z-index: 999;
display: flex;
justify-content: space-around;
align-items: center;
.items {
display: flex;
flex-direction: column;
align-items: center;
span {
font-size: 30px;
font-weight: 500;
color: #999999;
}
.items1 {
font-size: 40px;
font-weight: bold;
color: #354fc7;
}
.items2 {
font-size: 40px;
font-weight: bold;
color: #868686;
}
.items3 {
font-size: 40px;
font-weight: bold;
color: #5fba95;
}
.items4 {
font-size: 40px;
font-weight: bold;
color: #f09535;
}
}
}
}
.echartes {
margin-top: 64px;
padding-bottom: 20px;
height: 616px;
background: #fff;
box-sizing: border-box;
.echartss {
margin: 0 32px;
height: 100%;
padding-top: 16px;
box-sizing: border-box;
}
}
}
}
.currentTabBar1 {
height: 100%;
padding-bottom: 98px;
background: #fff;
::v-deep .AiTopFixed {
b.title {
color: #333;
font-size: 32px;
& > i {
color: #267fce;
font-style: normal;
margin: 0 4px;
}
}
}
::v-deep .mainPane {
background: #fff;
padding: 0 32px 88px;
.AiCell {
flex-shrink: 0;
justify-content: flex-start;
.content {
flex: 1;
min-width: 0;
max-width: unset;
border-bottom: 1px solid rgba(221, 221, 221, 1);
min-height: 160px;
}
}
.card {
text-align: left;
b {
max-width: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: 36px;
}
.tag {
justify-content: center;
background: #f3f4f7;
border-radius: 4px;
padding: 0 16px;
font-size: 28px;
font-weight: 400;
color: #333;
margin-left: 16px;
margin-bottom: 16px;
height: 56px;
}
.realName {
width: 100%;
margin-top: 8px;
font-size: 28px;
font-weight: 400;
color: #999;
}
}
.AiImage {
margin-right: 24px;
image {
width: 112px;
height: 112px;
}
}
}
}
.currentTabBar2 {
padding-bottom: 98px;
::v-deep .AiTopFixed {
b.title {
color: #333;
font-size: 32px;
& > i {
color: #267fce;
font-style: normal;
margin: 0 4px;
}
}
}
::v-deep .mainPane {
background: #fff;
padding: 0 32px;
.AiCell {
align-items: center;
height: 230px;
justify-content: flex-start;
.content {
flex: 1;
min-width: 0;
height: 100%;
max-width: unset;
border-bottom: 1px solid rgba(221, 221, 221, 1);
}
}
.card {
height: 100%;
justify-content: center;
b {
font-size: 36px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.tag {
justify-content: center;
background: #f3f4f7;
border-radius: 4px;
padding: 0 16px;
font-size: 28px;
font-weight: 400;
color: #333;
margin-left: 16px;
height: 56px;
}
.groupName {
width: 100%;
text-align: left;
}
.owner,
.trends {
margin-top: 8px;
font-size: 28px;
font-weight: 400;
color: #999;
}
.personCount {
flex-shrink: 0;
font-size: 30px;
font-weight: 400;
color: #666;
}
.trends {
* + * {
margin-left: 24px;
}
em {
font-style: normal;
color: #5fba95;
}
p {
color: #f09535;
}
}
}
.AiImage {
margin-right: 24px;
image {
width: 112px;
height: 112px;
}
}
}
}
.tabs {
width: 100%;
height: 98px;
background: #fff;
border-top: 1px solid #ddd;
position: fixed;
bottom: 0;
left: 0;
display: flex;
.item {
flex: 1;
text-align: center;
img {
width: 56px;
height: 56px;
margin-top: 8px;
}
p {
font-size: 22px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #c4cad4;
line-height: 8px;
}
.color-3267F0 {
color: #3267f0;
}
}
}
}
</style>

View File

@@ -0,0 +1,325 @@
<template>
<div class="group-resident">
<template v-if="!showTagManage">
<AiTopFixed>
<div class="card">
<header>
<u-avatar mode="square" :src="$cdn + 'groupAvatar.png'" :size="112"></u-avatar>
{{ detail.name }}
</header>
<u-grid :col="2" :border="false">
<u-grid-item>
<label>建群日期</label>
<label v-if="detail.createTime">{{ detail.createTime.split(' ')[0] }}</label>
</u-grid-item>
<u-grid-item>
<label>成员总数</label>
<label v-if="isToday">{{ detail.statistic.today.total }}</label>
</u-grid-item>
<u-grid-item>
<label>今日入群</label>
<label v-if="isToday">{{ detail.statistic.today.increase }}</label>
</u-grid-item>
<u-grid-item>
<label>今日退群</label>
<label v-if="isToday">{{ detail.statistic.today.decrease }}</label>
</u-grid-item>
<!-- <u-grid-item>-->
<!-- <label>今日活跃人数</label>-->
<!-- <label>{{item.value}}</label>-->
<!-- </u-grid-item>-->
</u-grid>
<p class="statistics">
<span>成员性别</span>
<label>男性</label>
<b>{{ detail.man }}</b>
<label>女性</label>
<b>{{ detail.woman }}</b>
<label>未知</label>
<b>{{ detail.unknown }}</b>
</p>
</div>
</AiTopFixed>
<div class="card">
<AiCell title label="群标签">
<u-icon label="添加" size="38" name="iconAdd" custom-prefix="iconfont" color="#1365DD" label-color="#1365DD" @tap="showTagManage = true" />
</AiCell>
<AiCell top-label v-for="(op, name) in tagsList" :label="name" :key="name">
<u-row>
<div class="tag" v-for="(tag, j) in op" :key="j">{{ tag }}</div>
</u-row>
</AiCell>
</div>
<div class="card">
<AiCell title label="群成员"></AiCell>
<div class="wrap">
<div class="item" v-for="(item, index) in detail.groupUserList" :key="index" @click="handleWechat(item)">
<u-avatar mode="square" :src="item.avatar"></u-avatar>
<div class="info">
<div class="left">
<p>
{{ item.memberName }}
<b v-if="item.customerType == 2" style="color: #3c7fc8">@{{ item.corpName }}</b>
<b v-if="item.customerType == 1" style="color: #2ea222">@微信</b>
</p>
<p>真实姓名{{ item.realName }}</p>
</div>
<span v-if="item.userId == detail.owner">群主</span>
</div>
</div>
</div>
</div>
</template>
<TagManage v-if="showTagManage" />
</div>
</template>
<script>
import { mapActions } from 'vuex'
import TagManage from './tagManage'
export default {
name: 'GroupList',
components: {
TagManage,
},
props: {},
provide() {
return {
top: this,
}
},
data() {
return {
id: '',
detail: {},
groupId: null,
showTagManage: false,
}
},
onShow() {
document.title = '添加标签'
},
computed: {
tagsList() {
let obj = {}
this.detail?.tagList?.map((e) => {
if (e?.groupName) {
if (obj?.[e.groupName]) {
obj[e.groupName].push(e.tagName)
} else {
obj[e.groupName] = [e.tagName]
}
}
})
return obj
},
isToday() {
return !!this.detail?.statistic?.today
},
isNormal() {
return !!this.id
},
},
watch: {},
onLoad(o) {
this.id = o.id
this.getContact()
},
onShow() {},
methods: {
...mapActions(['injectJWeixin', 'wxInvoke']),
getContact() {
if (this.isNormal) {
this.groupId = this.id
this.getGroup(this.id)
} else
this.injectJWeixin('getCurExternalChat').then(() => {
this.wxInvoke([
'getCurExternalChat',
{},
(res) => {
if (res?.err_msg == 'getCurExternalChat:ok') {
this.groupId = res.chatId
this.getGroup(res.chatId)
}
},
])
})
},
getGroup(id) {
this.$instance
.post('/app/wxcp/wxgroup/getDetail', null, {
params: { id },
})
.then((res) => {
if (res?.data) {
this.detail = res.data
}
})
},
handleWechat({ userId, type }) {
this.injectJWeixin('openUserProfile').then(() => {
this.wxInvoke([
'openUserProfile',
{
type,
userid: userId,
},
() => 0,
])
})
},
},
}
</script>
<style scoped lang="scss">
.group-resident {
width: 100%;
min-height: 100%;
background-color: #f5f5f5;
display: flex;
flex-direction: column;
::v-deep .AiTopFixed {
& > .card {
margin-top: 0;
}
}
::v-deep .card {
background-color: #ffffff;
padding: 16px 32px;
box-sizing: border-box;
margin-top: 16px;
header {
height: 192px;
display: flex;
align-items: center;
font-size: 36px;
font-weight: 600;
color: #333333;
.u-avatar {
margin-right: 24px;
}
}
::v-deep .u-grid-item-box {
box-sizing: border-box;
padding: 16px !important;
.uni-label-pointer {
width: 100%;
line-height: 40px;
color: #999999;
}
uni-label:last-child {
margin-top: 16px;
font-weight: 600;
color: #333333;
}
}
.statistics {
height: 96px;
display: flex;
align-items: center;
border-top: 1px solid #eee;
margin-top: 16px;
span {
font-size: 28px;
color: #999999;
}
label + b {
font-size: 28px;
color: #333333;
}
b {
color: #1365dd !important;
margin: 0 32px 0 16px;
}
}
& > section:first-child {
height: 90px !important;
display: flex;
align-items: center;
}
.wrap {
margin-bottom: 20px;
.item {
height: 176px;
display: flex;
align-items: center;
.info {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: space-between;
margin-left: 24px;
border-bottom: 1px solid #eee;
.left {
font-size: 36px;
font-weight: 600;
color: #333333;
b {
font-size: 28px;
font-weight: 400;
color: #3c7fc8;
margin-left: 16px;
}
p:last-child {
font-size: 28px;
font-weight: 400;
color: #999999;
margin-top: 8px;
}
}
span {
width: 88px;
height: 56px;
text-align: center;
background: rgba(19, 101, 221, 0.1);
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.02);
border-radius: 4px;
font-size: 28px;
font-weight: 400;
color: #1365dd;
line-height: 56px;
}
}
}
}
}
::v-deep .tag {
height: 56px;
line-height: 56px;
background: #f3f4f7;
border-radius: 6px;
padding: 8px 16px;
margin-right: 16px;
margin-bottom: 16px;
overflow: hidden;
cursor: default;
}
}
</style>

View File

@@ -0,0 +1,139 @@
<template>
<div class="document" v-if="isShow">
<div class="card">
<div class="info">
<u-image border-radius="4" :src="top.detail.avatar" width="118" height="118" />
<div class="fill">
<b>{{ top.detail.realName || top.detail.name }}</b>
<u-row>
<span class="idNumber" v-html="IDObj.id" />
<a @tap="showID = !showID">{{ IDObj.btn }}</a>
</u-row>
</div>
</div>
<AiCell label="性别">{{ $dict.getLabel('sex', resident.sex) || '-' }}</AiCell>
<AiCell label="出生日期">{{ resident.birthDate }}</AiCell>
<AiCell label="年龄">{{ resident.age }}</AiCell>
<AiCell label="籍贯">{{ resident.birthplaceAreaName }}</AiCell>
<AiCell label="民族">{{ $dict.getLabel('nation', resident.nation) || '-' }}</AiCell>
<AiCell label="文化程度">{{ $dict.getLabel('education', resident.education) || '-' }}</AiCell>
<AiCell label="兵役状况">{{ $dict.getLabel('militaryStatus', resident.militaryStatus) || '-' }}</AiCell>
<AiCell label="政治面貌">{{ $dict.getLabel('politicsStatus', resident.politicsStatus) || '-' }}</AiCell>
<AiCell label="职业">{{ $dict.getLabel('job', resident.job) || '-' }}</AiCell>
<AiCell label="宗教信仰">{{ $dict.getLabel('faithType', resident.faithType) || '-' }}</AiCell>
</div>
<div class="card">
<AiCell title label="联络信息" />
<AiCell label="联系方式">{{ resident.phone }}</AiCell>
<AiCell label="现住址">{{ resident.currentAreaName + resident.currentAddress }}</AiCell>
</div>
<div class="card">
<AiCell title label="家庭信息" />
<AiCell label="是否户主">{{ $dict.getLabel('householdName', resident.householdName) || '-' }}</AiCell>
<AiCell label="与户主关系">{{ $dict.getLabel('householdRelation', resident.householdRelation) || '-' }}</AiCell>
<AiCell label="现住址">{{ resident.householdAreaName + resident.householdAddress }}</AiCell>
</div>
<div class="card">
<AiCell title label="家庭成员" />
<!-- <AiTable :data="family" :colConfigs="colConfigs" /> -->
</div>
</div>
</template>
<script>
export default {
name: 'document',
// inject: ['top'],
computed: {
IDObj() {
return this.showID
? {
id: this.resident?.idNumber,
btn: '隐藏',
}
: {
id: this.resident?.idNumber?.replace(/(\d{10}).+/g, '$1******'),
btn: '显示',
}
},
colConfigs() {
return [
{ label: '与户主关系', prop: 'householdRelation', width: '160rpx', dict: 'householdRelation' },
{ label: '姓名', prop: 'name', width: '120rpx' },
{ label: '性别', prop: 'sex', dict: 'sex' },
{ label: '年龄', prop: 'age' },
{ label: '身份证号', prop: 'idNumber', width: '320rpx' },
]
},
resident() {
let obj = {}
Object.keys(this.top.detail?.residentInfo?.resident || {}).map((e) => {
obj[e] = this.top.detail?.residentInfo?.resident[e] || ''
})
return obj
},
family() {
return this.top.detail?.residentInfo?.family?.map((e) => ({ ...e, householdRelation: e.householdRelation || '户主' }))
},
},
data() {
return {
showID: false,
isShow: false,
familyList: [],
top: {}
}
},
created() {
this.$dict.load('sex', 'nation', 'education', 'job', 'faithType', 'politicsStatus', 'militaryStatus', 'householdRelation', 'householdName').then(() => {
this.isShow = true
})
// console.log('居民档案性别(无字典)', this.resident.sex)
// console.log('居民档案性别(有字典)', this.$dict.getLabel('sex', this.resident.sex))
// console.log('居民档案字典值', this.$dict.getDict('sex'))
},
onShow() {
// this.$dict.load('sex', 'nation', 'education', 'job', 'faithType', 'politicsStatus', 'militaryStatus', 'householdRelation', 'householdName')
// document.title = '居民详情'
},
}
</script>
<style lang="scss" scoped>
.document {
overflow-y: auto;
background: #f5f5f5;
.info {
height: 186px;
width: 100%;
display: flex;
align-items: center;
.fill {
color: #3c7fc8;
margin-left: 24px;
font-size: 28px;
line-height: 40px;
display: flex;
flex-direction: column;
b {
font-size: 36px;
color: #333;
margin-bottom: 8px;
line-height: 50px;
}
a {
cursor: pointer;
}
.idNumber {
margin-right: 16px;
color: #999;
}
}
}
}
</style>

View File

@@ -0,0 +1,370 @@
<template>
<div class="info">
<div class="card">
<div class="baseInfo">
<u-image border-radius="4" :src="top.detail.avatar" width="118" height="118" />
<div class="fill">
<b>{{ top.detail.name }}</b>
<div v-if="top.detail.type == 1" class="wx">@微信</div>
<div v-if="top.detail.type == 2">@企业微信</div>
</div>
<div class="certBtn" @tap="handleCert">{{ !isCert ? '实名认证' : '解绑' }}</div>
</div>
<u-row>
<AiCell class="half" top-label label="来源">{{ $dict.getLabel('wxCustomerAddWay', top.detail.addWay) }}</AiCell>
<AiCell class="half" top-label label="添加时间">{{ top.detail.createTime }}</AiCell>
<AiCell class="half" top-label label="真实姓名">{{ top.detail.realName }}</AiCell>
<AiCell class="half" top-label label="手机号码">{{ resident.phone || '-' }}</AiCell>
<AiCell class="half" top-label label="家庭积分">{{ resident.familyIntegral }}</AiCell>
<AiCell class="half" top-label label="个人积分">{{ resident.personalIntegral }}</AiCell>
</u-row>
</div>
<div class="card">
<AiCell title label="公共标签">
<u-icon label="添加" size="38" name="iconAdd" custom-prefix="iconfont" color="#1365DD" label-color="#1365DD" @tap="top.showTagManage = true" />
</AiCell>
<AiCell top-label v-for="(op, name) in tagsList" :label="name" :key="name">
<u-row>
<div class="tag" v-for="(tag, j) in op" :key="j">{{ tag }}</div>
</u-row>
</AiCell>
</div>
<div class="card">
<AiCell title label="动态" />
<AiCell top-label>
<div class="logItem" v-for="item in customLogs" :key="item.id">
<div flex class="column" shrink>
<div class="dot" />
<div class="line fill" />
</div>
<div flex class="start column">
<b>{{ $dict.getLabel('wxCustomerLogType', item.type) }}</b>
<span>{{ item.createTime }}</span>
<div v-html="item.content" />
</div>
</div>
</AiCell>
</div>
<u-mask :show="dialog" @tap="dialog = false">
<div class="bindCert" @tap.stop>
<b class="title">实名认证</b>
<u-input class="searchInput" v-model="search" clearable placeholder="请输入姓名或身份证号" @input="handleSearch" />
<div class="residents">
<div flex class="spb" v-for="(op, i) in result" :key="i" @tap="bindCert(op.id)">
<div v-html="op.name" />
<div v-html="op.idNumber" />
</div>
</div>
</div>
</u-mask>
<div bottom>
<u-button type="primary" @tap="handleWechat">微信联系</u-button>
<u-button v-if="isMobile" :disabled="!resident.phone" @tap="handleTel">电话联系</u-button>
</div>
</div>
</template>
<script>
import { mapActions } from 'vuex'
export default {
// name: 'info',
// inject: ['top'],
computed: {
resident() {
return this.top.detail?.residentInfo?.resident || {}
},
tagsList() {
let obj = {}
this.top.detail?.tags?.map((e) => {
if (e.type == 1 && e?.groupName) {
if (obj?.[e.groupName]) {
obj[e.groupName].push(e.tagName)
} else {
obj[e.groupName] = [e.tagName]
}
}
})
return obj
},
isCert() {
return !!this.top?.detail?.residentInfo
},
isMobile() {
return ['Android', 'iPhone', 'SymbianOS', 'Windows Phone', 'iPad', 'iPod'].some((e) => navigator.userAgent.indexOf(e) > -1)
},
},
data() {
return {
dialog: false,
search: '',
result: [],
customLogs: [],
top: {}
}
},
methods: {
// ...mapActions(['injectJWeixin', 'wxInvoke']),
searchResident() {
this.$http
.post('/app/appresident/check-name', null, {
params: { name: this.search },
})
.then((res) => {
if (res?.data) {
let reg = new RegExp(this.search, 'g')
this.result = res.data?.map((e) => ({
...e,
name: e.name.replace(reg, `<b>${this.search}</b>`),
idNumber: e.idNumber.replace(reg, `<b>${this.search}</b>`),
}))
}
})
},
handleSearch() {
if (this.search?.length >= 2) {
this.searchResident()
} else {
this.result = []
}
},
handleCert() {
if (this.isCert) {
this.$confirm('是否要解绑当前实名认证?').then(() => {
this.$http
.post('/app/wxcp/wxcustomer/unBindCustomer2Resident', null, {
params: { residentId: this.resident.id, customerId: this.top.custom },
})
.then((res) => {
if (res?.code == 0) {
this.$u.toast('解除绑定成功!')
this.top.getContact()
}
})
})
} else this.dialog = true
},
bindCert(residentId) {
this.dialog = false
this.$confirm('是否要绑定该居民?')
.then(() => {
this.$http
.post('/app/wxcp/wxcustomer/bindCustomer2Resident', null, {
params: { residentId, customerId: this.top.custom },
})
.then((res) => {
if (res?.code == 0) {
this.$u.toast('绑定成功!')
this.top.getContact()
}
})
.catch((err) => {
this.$u.toast(err)
setTimeout(() => (this.dialog = true), 1000)
})
})
.catch(() => (this.dialog = true))
},
getCustomLog(customerId) {
customerId &&
this.$http
.post('/app/wxcp/wxcustomerlog/listAll', null, {
params: { customerId },
})
.then((res) => {
if (res?.data) {
this.customLogs = res.data
}
})
},
handleTel() {
location.href = 'tel:' + this.resident.phone
},
handleWechat() {
this.wxInvoke([
'openUserProfile',
{
type: 2,
userid: this.top.custom,
},
() => 0,
])
},
},
created() {
this.$dict.load('wxCustomerAddWay', 'wxCustomerLogType')
this.getCustomLog(this.top.custom)
// this.injectJWeixin('openUserProfile')
},
onShow() {
// document.title = '居民详情'
}
}
</script>
<style lang="scss" scoped>
.info {
padding-bottom: 130px;
.certBtn {
cursor: pointer;
background: $uni-color-primary;
color: #fff;
padding: 8px 16px;
border-radius: 4px;
}
.baseInfo {
height: 186px;
width: 100%;
display: flex;
align-items: center;
.fill {
color: #3c7fc8;
margin-left: 24px;
font-size: 28px;
line-height: 40px;
b {
font-size: 36px;
color: #333;
margin-bottom: 8px;
line-height: 50px;
}
.wx {
color: #2ea222;
}
}
}
::v-deep .AiCell {
&.half {
width: 50%;
}
}
::v-deep .u-form-item {
width: 50%;
min-height: 124px;
.u-form-item--left {
color: #999;
min-height: 40px;
}
.u-form-item--right {
min-height: 0;
margin-top: 16px;
}
}
::v-deep .u-mask {
display: flex;
align-items: center;
justify-content: center;
.bindCert {
width: 600px;
padding: 32px;
min-height: 400px;
background-color: #fff;
display: flex;
flex-direction: column;
color: #333;
}
.residents {
max-height: 780px;
overflow-y: auto;
}
.title {
text-align: center;
font-size: 36px;
}
.searchInput {
margin: 16px 0;
border: 1px solid #d0d4dc;
border-radius: 8px;
padding: 0 16px !important;
flex: 0;
}
.spb {
height: 60px;
cursor: pointer;
padding: 0 16px;
b {
font-size: 32px;
}
&:nth-of-type(2n) {
background: #eee;
}
}
}
::v-deep .logItem {
display: flex;
min-height: 220px;
&:last-of-type {
.line {
display: none;
}
}
& > .column + .column {
margin-left: 16px;
}
.dot {
flex-shrink: 0;
width: 16px;
height: 16px;
background: $uni-color-primary;
border: 8px solid #ffffff;
border-radius: 50%;
margin: 8px 0;
}
.line {
width: 4px;
background: #eee;
}
.start {
font-size: 26px;
font-weight: 400;
color: #666;
b {
color: #333;
}
i {
color: $uni-color-primary;
font-style: normal;
}
& > b {
font-size: 32px;
font-weight: bold;
margin-bottom: 8px;
}
& > span {
color: #999;
}
& > div {
margin-top: 16px;
}
}
}
}
</style>

View File

@@ -0,0 +1,153 @@
<template>
<div class="resident">
<AiLoading v-if="!custom && !error" tips="获取居民信息中..." />
<!-- <template v-else>
<tag-manage v-if="showTagManage" />
<template v-else>
<AiTopFixed>
<u-tabs :list="tabs" :is-scroll="false" :current="currentType" font-size="32" bar-width="192" height="96" @change="handleTabClick" />
</AiTopFixed>
<component :is="currentTab.comp" />
</template>
</template> -->
</div>
</template>
<script>
import { mapActions } from 'vuex'
import Info from './components/info'
import Document from './components/document'
import TagManage from './tagManage'
export default {
components: { TagManage, Document, Info },
// provide() {
// return {
// top: this,
// id: '',
// }
// },
onShow() {
// document.title = '居民详情'
},
computed: {
tabs() {
return [
{ name: '居民信息', value: 0, comp: Info },
{ name: '居民档案', value: 1, comp: Document, hide: !this.detail.residentInfo },
].filter((e) => !e.hide)
},
currentTab() {
return this.tabs.find((e) => e.value == this.currentType)
},
isNormal() {
return !!this.id
},
},
data() {
return {
currentType: 0,
detail: {},
showTagManage: false,
custom: '',
error: '',
}
},
methods: {
// ...mapActions(['injectJWeixin', 'wxInvoke']),
handleTabClick(i) {
this.currentType = i
},
getContact() {
if (this.isNormal) {
this.getCustom(this.id)
} else {
// this.injectJWeixin('getCurExternalContact')
// .then(() => {
// this.wxInvoke([
// 'getCurExternalContact',
// {},
// (res) => {
// if (res?.err_msg == 'getCurExternalContact:ok') {
// this.getCustom(res.userId)
// }
// },
// ])
// })
// .catch(({ errMsg }) => {
// this.error = errMsg
// })
}
},
getCustom(id) {
this.$instance
.post('/app/wxcp/wxcustomer/queryCustomerById', null, {
params: { id },
})
.then((ret) => {
if (ret?.data) {
this.custom = id
this.detail = ret.data
if (this.detail.type == 2) {
this.error = '只能查看个人微信绑定的居民信息'
}
}
})
},
},
onLoad(o) {
this.id = o.id
this.getContact()
},
}
</script>
<style lang="scss" scoped>
.resident {
display: flex;
flex-direction: column;
height: 100%;
background: #f5f5f5;
.error {
font-size: 32px;
color: #666;
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
::v-deep .u-scroll-box {
border-bottom: 1px solid #d4d4d4;
.u-tab-bar {
position: absolute;
bottom: -6px;
}
}
::v-deep .card {
background: #fff;
margin-bottom: 16px;
padding: 16px 32px;
}
.half {
width: 50%;
}
::v-deep .tag {
height: 56px;
line-height: 56px;
background: #f3f4f7;
border-radius: 6px;
padding: 8px 16px;
margin-right: 16px;
margin-bottom: 16px;
overflow: hidden;
cursor: default;
}
}
</style>

View File

@@ -0,0 +1,93 @@
<template>
<div class="tagManage">
<!-- <div class="card" v-for="(group, i) in tags" :key="i">
<AiCell title :label="group.name" />
<u-row>
<div class="tag" v-for="(op, j) in group.tagList" :key="j" :class="{ selected: selected.includes(op.id) }" @tap="$u.debounce(handleToggle(op.id))">
{{ op.name }}
</div>
</u-row>
</div> -->
</div>
</template>
<script>
export default {
// name: 'tagManage',
// inject: ['top'],
data() {
return {
tags: [],
top: {}
}
},
computed: {
selected() {
return this.top.groupId ? this.top.detail?.tagList.map((e) => e.tagId) : this.top.detail?.tags.map((e) => e.tagId)
},
},
methods: {
getTags() {
this.$instance
.post(this.top.groupId ? '/app/wxcp/wxgroupchattag/listAll' : '/app/wxcp/wxcorptag/listAll', null, {
params: { size: 9999 },
})
.then((res) => {
if (res?.data) {
this.tags = res.data.records
}
})
},
handleToggle(tagId) {
uni.showLoading({
title: '提交中',
})
this.$instance
.post(this.top.groupId ? '/app/wxcp/wxgroupchattag/markTagForCP' : '/app/wxcp/wxcorptag/markTagForCP', null, {
params: this.top.groupId ? { tagId, groupId: this.top.groupId } : { tagId, customerId: this.top.custom },
})
.then((res) => {
uni.hideLoading()
if (res?.code == 0) {
this.$u.toast('操作成功!')
this.getTags()
this.top.getContact()
}
})
.catch((err) => {
uni.hideLoading()
this.$u.toast(err)
})
},
},
created() {
this.getTags()
},
}
</script>
<style lang="scss" scoped>
.tagManage {
padding-top: 16px;
.tag {
cursor: pointer !important;
&.selected {
background-color: $uni-color-primary !important;
color: #fff;
}
&.disabled {
color: #999;
cursor: not-allowed;
}
& + .tag {
margin-left: 16px;
}
}
}
</style>

View File

@@ -0,0 +1,483 @@
<template>
<div class="AppSpecialPeople">
<template v-if="hasGridPermit">
<div class="tab-select">
<div class="item" :class="tabIndex == index ? 'active' : ''" v-for="(item, index) in tabs" :key="index"
@click="tabClick(index)">{{ item }}<span></span></div>
</div>
<div class="area-select">
<div class="select-content">
<div class="area-content fill">
<AiPagePicker type="gird" @select="handleGridSelect">
<AiMore v-model="gridName" placeholder="选择网格"/>
</AiPagePicker>
</div>
<div class="search-input" v-if="tabIndex">
<img src="./img/search-icon.png" alt=""/>
<u-input type="text" placeholder="请输入姓名" placeholder-style="color:#999;font-size:13px;" height="18"
v-model="search.name" @confirm="getUserList" :clearable="false" maxlength="6"/>
</div>
</div>
</div>
<div v-if="!tabIndex">
<div class="info-content">
<div class="title">特殊人群</div>
<div class="num-content">
<div class="num-item" v-for="(item, index) in statisticsList" :key="index">
<h3 v-text="item.value"/>
<p v-text="item.label"/>
</div>
<AiEmpty v-if="!statisticsList.length"/>
</div>
</div>
<div class="info-content">
<div class="title">本月新增</div>
<div class="num-content color-org">
<div class="num-item" v-for="(item, index) in statisticsListMon" :key="index">
<h3>{{ item.value }}</h3>
<p>{{ item.label }}</p>
</div>
<AiEmpty v-if="!statisticsListMon.length"/>
</div>
</div>
</div>
<div v-else>
<div class="item-content" v-for="(item, index) in userList" :key="index">
<div class="title" @click="showUserType(index)">
<h2>{{ item.label }}</h2>
<img src="./img/down-icon.png" alt="" :class="item.check ? 'img-active' : ''"/>
</div>
<div class="user-list" v-if="item.check">
<div class="user-item" v-for="(e, indexs) in item.value" :key="indexs" @click="showDetail(e)">
<div class="user-img">
<img src="./img/user-img.png" alt=""/>
</div>
<div class="user-info">
<p class="name">{{ e.name }}
<span class="btn-icon" v-if="isAdmin || user.id == e.create_user_id">
<img src="./img/edit-icon.png" alt="" @click.stop="toEdit(e,item.dictValue)">
<img src="./img/del-icon.png" alt="" @click.stop="del(e,item.dictValue)">
</span>
</p>
<div class="phone">
<span>{{ idNumberInit(e.idNumber) }}</span>
<span>{{ e.phone }}</span>
</div>
</div>
</div>
<p class="text" v-if="!item.value.length">{{ '暂无' + item.label + '信息' }}</p>
</div>
</div>
<div class="footer" @click="toAdd">
<div class="btn">新增特殊人群信息</div>
</div>
</div>
</template>
<AiEmpty description="没有网格员权限<br>无法查看特殊人员信息~" v-else style="text-align:center;"/>
</div>
</template>
<script>
import {mapState} from "vuex";
export default {
name: 'AppSpecialPeople',
appName: '特殊人群',
data() {
return {
areaName: '',
tabs: ['统计信息', '人员信息'],
tabIndex: 0,
addressArea: '',
statisticsList: [],
statisticsListMon: [],
userList: [],
gridName: "",
search: {name: ''}
}
},
computed: {
...mapState(['user']),
hasGridPermit() {
return this.user.girdCheckType != 0
},
isAdmin() {
return this.user.girdCheckType == 2
},
},
created() {
this.$dict.load('appSpecialTypeFive')
},
onShow() {
document.title = '特殊人群管理'
if (this.hasGridPermit) {
if (!this.search.girdId) {
this.search.girdId = this.user.girdId
this.gridName = this.user.girdName
}
this.getDatas()
}
},
methods: {
getDatas() {
this.getStatistic()
this.getStatisticMon()
this.getUserList()
this.$forceUpdate()
},
handleGridSelect(e) {
this.gridName = e?.girdName
this.search.girdId = e?.id
this.getDatas()
},
areaSelect(e) {
this.search.areaId = e
this.getDatas()
},
tabClick(index) {
this.tabIndex = index
},
getStatistic() {
this.statisticsList = []
this.$instance.post(`/app/appapplicationinfo/specialStatistic`, null, {
params: {...this.search, type: 0, range: 0}
}).then((res) => {
if (res?.data) {
this.statisticsList = Object.keys(res.data).map((label, i, arr) => ({label, value: res.data[label]}))
}
})
},
getStatisticMon() {
this.statisticsListMon = []
this.$instance.post(`/app/appapplicationinfo/specialStatistic`, null, {
params: {...this.search, type: 0, range: 1}
}).then((res) => {
if (res?.data) {
this.statisticsListMon = Object.keys(res.data).map((label, i, arr) => ({label, value: res.data[label]}))
}
})
},
getUserList() {
this.userList = []
this.$instance.post(`/app/appapplicationinfo/queryPeople`, null, {
params: {...this.search, type: 0, status: 1}
}).then((res) => {
if (res?.data) {
this.userList = Object.keys(res.data).map(e => ({
label: e,
value: res.data[e],
check: false,
}))
}
})
},
toAdd() {
uni.navigateTo({url: './add'})
},
idNumberInit(idNumber) {
if (!idNumber) {
idNumber = ''
} else {
idNumber = idNumber.substring(0, 5) + '******' + idNumber.substring(12, 15)
}
return idNumber
},
showUserType(index) {
if (this.userList[index].check) {
this.userList[index].check = false
} else {
this.userList.map((item) => {
item.check = false
})
this.userList[index].check = true
}
},
toEdit(row) {
uni.navigateTo({
url: `./add?id=${row.id}&appId=${row.appId}`
})
},
del(row) {
this.$confirm('确定删除该数据?').then(() => {
uni.showLoading({})
let {id: ids, appId} = row
this.$instance.post("/app/appapplicationinfo/delete", null, {
params: {ids, appId}
}).then((res) => {
if (res?.code == 0) {
this.$u.toast('删除成功!')
this.getUserList()
}
uni.hideLoading()
})
}).catch(() => {
})
},
showDetail(e) {
uni.navigateTo({url: `/apps/AppPeopleList/DetailCard?id=${e.resident_id}`})
}
},
}
</script>
<style lang="scss" scoped>
.AppSpecialPeople {
min-height: 100%;
.tab-select {
width: 100%;
height: 96px;
line-height: 96px;
background: #3975c6;
display: flex;
.item {
flex: 1;
text-align: center;
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
color: #cddcf0;
}
.active {
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
position: relative;
color: #fff;
span {
width: 48px;
height: 4px;
background: #fff;
position: absolute;
bottom: 14px;
left: 50%;
margin-left: -24px;
}
}
}
.area-select {
width: 100%;
background: #fff;
padding-left: 32px;
box-sizing: border-box;
.select-content {
width: 100%;
padding: 24px 32px 24px 0;
border-bottom: 1px solid #d8dde6;
display: flex;
justify-content: space-between;
font-family: PingFangSC-Regular, PingFang SC;
color: #333;
line-height: 44px;
box-sizing: border-box;
.area-content {
line-height: 64px;
img {
width: 42px;
vertical-align: middle;
margin-right: 16px;
}
.u-icon {
margin-left: 6px;
}
}
.search-input {
width: 402px;
height: 64px;
background: #f5f5f5;
border-radius: 32px;
padding: 14px 32px 14px 64px;
box-sizing: border-box;
position: relative;
img {
width: 32px;
height: 32px;
margin-right: 12px;
position: absolute;
top: 18px;
left: 24px;
}
::v-deep .u-input {
display: inline-block;
width: 240px;
font-size: 26px;
}
}
}
}
.info-content {
width: calc(100% - 64px);
background: #fff;
border-radius: 8px;
margin: 24px 32px 0;
.title {
padding-left: 32px;
line-height: 94px;
border-bottom: 1px solid #ddd;
font-size: 32px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #333;
}
.num-content {
overflow: hidden;
.num-item {
float: left;
width: 33%;
padding: 40px 0;
text-align: center;
h3 {
font-size: 64px;
font-family: DINAlternate-Bold, DINAlternate;
font-weight: bold;
color: #3192f4;
line-height: 74px;
margin-bottom: 10px;
}
p {
font-size: 28px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #999;
line-height: 40px;
}
}
}
.color-org {
.num-item {
h3 {
color: #ff8700;
}
}
}
}
.item-content {
margin-bottom: 4px;
.title {
width: 100%;
height: 108px;
line-height: 108px;
background: #fff;
padding: 0 32px;
box-sizing: border-box;
display: flex;
justify-content: space-between;
h2 {
font-size: 32px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #333;
}
img {
width: 34px;
height: 34px;
margin-top: 38px;
transition: all 0.3s ease-in-out;
}
.img-active {
transform: rotate(180deg);
}
}
.user-list {
background-color: #fff;
.user-item {
padding: 24px 32px;
display: flex;
.user-img {
width: 112px;
img {
width: 80px;
height: 80px;
}
}
.user-info {
width: 100%;
.name {
font-size: 32px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #333;
line-height: 44px;
margin-bottom: 8px;
.btn-icon {
float: right;
img {
width: 48px;
height: 48px;
margin-left: 20px;
vertical-align: baseline;
}
}
}
.phone {
width: 100%;
font-size: 26px;
font-family: PingFangSC-Regular, PingFang SC;
color: #999;
line-height: 36px;
display: flex;
justify-content: space-between;
}
}
}
}
}
.text {
height: 96px;
line-height: 96px;
color: #999;
font-size: 28px;
text-align: center;
}
.footer {
width: 100%;
position: fixed;
bottom: 0;
left: 0;
}
.btn {
width: 100%;
height: 112px;
line-height: 112px;
text-align: center;
background: #1365dd;
font-size: 32px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #fff;
}
}
</style>

View File

@@ -0,0 +1,620 @@
<template>
<div class="add">
<div class="pad-l32">
<div class="item" v-if="!isEdit">
<span class="label"><span class="tips">*</span>类型</span>
<div class="value" @click="showType=true">
<AiMore v-model="appName"/>
</div>
</div>
<div class="info-content" v-for="(items, indexs) in formDataList" :key="indexs">
<div v-for="(item, index) in items" :key="index">
<!-- 初始化字段锁定 -->
<div class="item" v-if="!!formData[item.isInit]&&item.isInit!=item.fieldDbName">
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
<div class="value" v-if="item.dict"
v-text="toString($dict.getLabel(item.dict, formData[item.fieldDbName]))"/>
<div class="value" v-if="item.type=='area'">
<AiAreaPicker :value="formData[item.fieldDbName]" isForm disabled/>
</div>
<div class="value" v-if="item.type=='upload'">
<template v-if="formData[item.fieldDbName]">
<ai-image v-for="(op,i) in [formData[item.fieldDbName]].flat()" :key="i" :src="op" preview/>
</template>
<span v-else>-</span>
</div>
<div class="value" v-else v-text="toString(formData[item.fieldDbName])"/>
</div>
<!-- input输入框 -->
<div class="item" v-if="item.type == 'input' || item.type == 'name' || item.type == 'phone'">
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
<div class="value">
<u-input type="text" placeholder="请输入" input-align="right" placeholder-style="color:#999;font-size:16px;"
height="48" v-model="formData[item.fieldDbName]" :maxlength="item.maxLength"/>
</div>
</div>
<!-- number 输入框 -->
<div class="item" v-if="item.type == 'number'">
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
<div class="value">
<u-input type="number" placeholder="请输入" input-align="right"
placeholder-style="color:#999;font-size:16px;" height="48" v-model="formData[item.fieldDbName]"
:maxlength="item.maxLength"/>
</div>
</div>
<!-- 身份证输入框 -->
<div class="item" v-if="item.type == 'idNumber'">
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
<div class="value">
<u-input type="idcard" placeholder="请输入" input-align="right"
placeholder-style="color:#999;font-size:16px;" height="48" v-model="formData[item.fieldDbName]"
:maxlength="item.maxLength"/>
</div>
</div>
<!-- textarea输入框 富文本-->
<div class="textarea" v-if="item.type == 'textarea' || item.type == 'text' || item.type == 'rtf'">
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
<div class="value">
<u-input type="textarea" placeholder="请输入请输入" placeholder-style="color:#999;font-size:16px;" height="200"
v-model="formData[item.fieldDbName]" :maxlength="item.maxLength"/>
</div>
</div>
<!-- 字典下拉选择 -->
<div class="item" v-if="item.type == 'dict'">
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
<div class="value" @click="selectClick(item.fieldDbName, item.dict)">
<AiMore :value="$dict.getLabel(item.dict, formData[item.fieldDbName])"/>
</div>
</div>
<!-- 单选radio -->
<div class="item" v-if="item.type == 'radio'">
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
<div class="value">
<u-radio-group v-model="formData[item.fieldDbName]">
<!-- <u-radio :name="item.dictValue" v-for="(item, index) in $dict.getDict(item.dict)" :key="index">
{{ item.dictName }}
</u-radio> -->
</u-radio-group>
</div>
</div>
<!-- 开关onOff -->
<div class="item" v-if="item.type == 'onOff'">
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
<div class="value">
<u-switch v-model="formData[item.fieldDbName]" :active-value="1" :inactive-value="0"></u-switch>
</div>
</div>
<!-- 多选checkbox -->
<div class="textarea" v-if="item.type == 'checkbox'">
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
<div class="value">
<u-checkbox-group>
<u-checkbox
v-model="e.checked"
v-for="(e, i) in item.checkList" :key="i"
:name="item.dictValue"
@change="checkboxChange(indexs, index, i)"
>{{ e.dictName }}
</u-checkbox>
</u-checkbox-group>
</div>
</div>
<!-- 附件 -->
<div class="textarea" v-if="item.type == 'upload'">
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
<div class="value">
<!-- <AiUploader :multiple="true" type="image" :limit="9" placeholder="上传图片"
:def.sync="formData[item.fieldDbName]"
action="/admin/file/add2"/> -->
</div>
</div>
<!-- 地区选择 -->
<div class="item" v-if="item.type == 'area'">
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
<div class="value" flex>
<!-- <AiAreaPicker @select="v=>formData[item.fieldDbName]=v" :name.sync="formData[item.fieldDbName+'_name']"
all :value="formData[item.fieldDbName]" :valueLevel="item.areaPattern" isForm/> -->
</div>
</div>
<!-- 人员选择 -->
<div class="item" v-if="item.type == 'user'">
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
<div class="value" @click="handleSelectUser(item.fieldDbName)">
<template v-if="!formData[item.fieldDbName].length">
<span>请选择</span>
</template>
<template v-else>
已选择<em>{{ formData[item.fieldDbName].map(e => e.name).slice(0, 2).join("、") }}</em><em>{{
formData[item.fieldDbName].length
}}</em>
</template>
<u-icon name="arrow-right" color="#ddd"></u-icon>
</div>
</div>
<!-- 日期选择 / 日期带时分秒选择 / 时间-时分秒选择 -->
<div class="item" v-if="item.type == 'date' || item.type == 'datetime' || item.type == 'time'">
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
<div class="value" @click="dateClick(indexs, index)" flex>
<AiMore v-model="formData[item.fieldDbName]"/>
</div>
</div>
<!-- 居民档案选择 -->
<div class="item" v-if="item.type == 'resident'">
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
<div class="value" flex>
<AiPagePicker @select="v=>handleSelectResident(v,item)" single>
<AiMore v-model="formData[item.fieldDbName + '_name']" :placeholder="item.fieldTips"/>
</AiPagePicker>
</div>
</div>
<!-- 网格选择 -->
<div class="item" v-if="item.type == 'gird'">
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
<div class="value" flex>
<AiPagePicker type="gird" @select="v=>handleSelectGird(v,item)">
<AiMore v-model="formData[item.fieldDbName + '_name']" :placeholder="item.fieldTips"/>
</AiPagePicker>
</div>
</div>
</div>
</div>
</div>
<u-picker mode="time" v-model="dateShow" :params="deteParams" @confirm="dateConfirm">请选择</u-picker>
<u-select v-model="selectShow" mode="single-column" :list="selectList" label-name="dictName" value-name="dictValue"
@confirm="selectConfirm"></u-select>
<u-select v-model="showType" :list="typeList" label-name="applicationName" value-name="id"
@confirm="typeConfirm"></u-select>
<div class="footer" @click="submit" v-if="appId">
<div class="btn">保存</div>
</div>
</div>
</template>
<script>
import {mapActions, mapState} from 'vuex'
export default {
data() {
return {
appId: '',
appName: '',
showType: false,
typeList: [],
formDataList: [],
formData: {},
pageShow: false,
dateShow: false,
deteParams: {},
datePropIndex: '', //时间选择 formDataList索引
dateIndex: '', //时间选择 formDataList 数组里面的索引
selectName: '',
selectList: [],
selectShow: false,
}
},
computed: {
...mapState(['user']),
isEdit() {
return !!this.$route.query.id
}
},
created() {
// this.getType()
},
onShow() {
// if (this.isEdit) {
// document.title = "编辑人员"
// if (!this.appId) {
// let {appId: value} = this.$route.query
// this.typeConfirm([{value}]).then(() => this.getDetail())
// }
// } else {
// document.title = '新增人员'
// if (this.$route.query.appId && !this.appId) {
// let {appId: value, appName} = this.$route.query
// this.typeConfirm([{value, label: decodeURIComponent(appName)}])
// }
// }
},
methods: {
// ...mapActions(['selectEnterpriseContact']),
handleSelectUser(fieldDbName) {
// this.selectEnterpriseContact({
// fromDepartmentId: 0,
// type: ["user"],
// selectedUserIds: this.form[fieldDbName]?.map(e => e.id)
// }).then(res => {
// this.form[fieldDbName] = res?.userList || []
// })
},
getType() {
this.$instance.post(`/app/appapplicationinfo/queryApplicationListByType`, null, {
params: {type: 0, status: 1}
}).then((res) => {
if (res?.data) {
this.typeList = res.data
}
})
},
typeConfirm(e) {
this.appId = e[0].value
this.appName = e[0].label
return this.$instance.post(`/app/appapplicationinfo/queryApplicationInfo?appId=${this.appId}`).then((res) => {
if (res?.data) {
this.formData = {}
let data = res.data
let dictList = []
let formList = {}
data.tableInfos.map((item) => {
let colItem
if (item.dictionaryCode) {
dictList.push(item.dictionaryCode)
}
if (item.dictionaryCode && item.type != 'radio' && item.type != 'checkbox' && item.type != 'onOff') {
colItem = {
...item,
type: 'dict',
dict: item.dictionaryCode,
fieldValue: item.defaultValue || ''
}
} else if (item.type == 'radio') {
colItem = {
...item,
dict: item.dictionaryCode,
fieldValue: item.defaultValue || ''
}
} else if (item.type == 'checkbox') {
colItem = {
...item,
dict: item.dictionaryCode,
fieldValue: ''
}
if (item.defaultValue) {
colItem.fieldValue = item.defaultValue?.split('`')
}
} else if (item.type == 'onOff') {
colItem = {
...item,
fieldValue: 0
}
} else if (item.type == 'number') {
colItem = {
...item,
type: item.type,
min: item.minValue || '',
max: item.maxValue || '',
fieldValue: Number(item.defaultValue) || 0
}
} else if (item.type == 'upload' || item.type == 'user') {
colItem = {
...item,
type: item.type,
fieldValue: []
}
} else if (item.type == 'area') {
colItem = {
...item,
type: item.type,
fieldValue: "",
}
} else {
if (item.type == 'date') {
item.params = {year: true, month: true, day: true, hour: false, minute: false, second: false}
}
if (item.type == 'datetime') {
item.params = {year: true, month: true, day: true, hour: true, minute: true, second: true}
}
if (item.type == 'time') {
item.params = {year: false, month: false, day: false, hour: true, minute: true, second: true}
}
colItem = {
...item,
type: item.type,
}
colItem.fieldValue = item.defaultValue || ''
}
formList[item.groupIndex]?.push(colItem) || (formList[item.groupIndex] = [colItem])
this.$set(this.formData, colItem.fieldDbName, colItem.fieldValue || "")
})
this.formDataList = Object.values(formList)
if (dictList.length) {
this.getDictList(dictList)
} else {
this.formDataList.map((item) => {
item.map((e) => {
if (e.type == 'onOff') { //开关
this.formData[e.fieldDbName] = 0
}
if (e.type == 'area') { //地区
this.formData[e.fieldDbName + '_name'] = this.user.areaName
}
})
})
this.$forceUpdate()
this.pageShow = true
}
}
})
},
getDictList(listName) {
this.$dict.load(listName.join(',')).then(() => {
this.formDataList.map((item) => {
item.map((e) => {
if (e.type == 'checkbox') { //多选
var list = this.$dict.getDict(e.dict)
list.map((items) => {
items.checked = false
})
e.checkList = list
}
if (e.type == 'onOff') { //开关
this.formData[e.fieldDbName] = 0
}
if (e.type == 'area') { //地区
this.formData[e.fieldDbName + '_name'] = this.user.areaName
}
})
})
this.$forceUpdate()
this.pageShow = true
})
},
selectClick(name, dictName) {
this.selectName = name
this.selectList = this.$dict.getDict(dictName)
this.selectShow = true
},
selectConfirm(e) {
this.formData[this.selectName] = e[0].value
},
checkboxChange(indexs, index, i) {
this.formDataList[indexs][index].checkList[i].checked = !this.formDataList[indexs][index].checkList[i].checked
this.$forceUpdate()
},
dateClick(indexs, index) {
this.deteParams = this.formDataList[indexs][index].params
this.datePropIndex = indexs
this.dateIndex = index
this.$nextTick(() => {
this.dateShow = true
})
},
dateConfirm(e) {
var fieldDbName = this.formDataList[this.datePropIndex][this.dateIndex].fieldDbName
if (this.formDataList[this.datePropIndex][this.dateIndex].type == 'date') { //年月日
this.formData[fieldDbName] = `${e.year}-${e.month}-${e.day}`
}
if (this.formDataList[this.datePropIndex][this.dateIndex].type == 'datetime') { //年月日时分秒
this.formData[fieldDbName] = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}:${e.second}`
}
if (this.formDataList[this.datePropIndex][this.dateIndex].type == 'time') { //时分秒
this.formData[fieldDbName] = `${e.hour}:${e.minute}:${e.second}`
}
},
submit() {
let isValid = true, form = JSON.parse(JSON.stringify(this.formData))
this.formDataList.map((item) => {
item?.map((items) => {
if (items.type == 'checkbox') { //多选
form[items.fieldDbName] = ''
let list = []
items.checkList.map((e) => {
if (e.checked) {
list.push(e.dictValue)
}
})
form[items.fieldDbName] = list?.toString()
}
if (items.type == 'upload') { //附件 只传id
let files = [];
[form[items.fieldDbName]]?.flat()?.map(item => item?.url && files.push(item.url))
form[items.fieldDbName] = files?.toString()
}
// if (items.type == 'onOff') { //开关
// form[items.fieldDbName] = form[items.fieldDbName] ? '1' : '0'
// }
if (items.type == 'area' && form[items.fieldDbName]) {
let area = []
area.push(form[items.fieldDbName])
area.push(form[items.fieldDbName + '_name'])
form[items.fieldDbName] = area.join('_')
}
})
})
this.formDataList.some((item) => {
return item.some((items) => {
if (items.mustFill == 1 && !form[items.fieldDbName]) {
isValid = false
return this.$u.toast(`${items.fieldName}为必填项`)
}
})
})
if (!isValid) return
this.$instance.post(`/app/appapplicationinfo/addOrUpdate?appId=${this.appId}`, {
...form
}).then(res => {
if (res?.code == 0) {
this.$u.toast('提交成功')
setTimeout(() => uni.navigateBack({
success: () => {
uni.$emit("selectType")
}
}), 1500)
} else this.$u.toast(res?.msg || "提交失败,请联系管理员")
}).catch(err => {
this.$u.toast(err || "提交失败,请联系管理员")
})
},
handleSelectResident(resident, item) {
let info = resident?.[0] || {}
this.formData = {...this.formData, ...info}
this.formData[item.fieldDbName] = info.id
this.formData[item.fieldDbName + "_name"] = info.name
this.$forceUpdate()
},
toString(obj) {
return obj?.toString() || "-"
},
handleSelectGird(gird, item) {
let info = gird || {}
this.formData[item.fieldDbName] = [info.id, info.girdName].join("_")
this.formData[item.fieldDbName + "_name"] = info.girdName
this.$forceUpdate()
},
getDetail() {
let {id, appId} = this.$route.query
return id ? this.$instance.post("/app/appapplicationinfo/queryDetailById", null, {
params: {id, appId}
}).then(res => {
if (res?.data) {
this.formData = res.data
this.$forceUpdate()
}
}) : Promise.resolve()
}
}
}
</script>
<style lang="scss" scoped>
.add {
padding-bottom: 112px;
.title {
width: 100%;
height: 96px;
line-height: 96px;
background: #FFF;
font-size: 32px;
font-weight: 500;
color: #262B36;
padding-right: 32px;
box-sizing: border-box;
overflow: hidden;
.tips {
display: inline-block;
width: 8px;
height: 32px;
background: #4E75FE;
box-shadow: 0 8px 24px 2px #C9D8FA;
border-radius: 4px;
vertical-align: middle;
margin-right: 22px;
}
.select {
float: right;
font-size: 30px;
color: #1365DD;
}
}
.item {
width: 100%;
padding: 34px 32px 34px 0;
background: #FFFFFF;
border-bottom: 1px solid #D8DDE6;
display: flex;
justify-content: space-between;
font-size: 32px;
font-family: PingFangSC-Regular, PingFang SC;
color: #333;
line-height: 44px;
box-sizing: border-box;
position: relative;
.value {
.u-icon {
margin-left: 16px;
}
::v-deep .u-input {
font-size: 32px;
}
}
}
.color-999 {
color: #999;
}
.tips {
display: inline-block;
width: 16px;
height: 44px;
font-size: 32px;
font-family: PingFangSC-Regular, PingFang SC;
color: #F46;
line-height: 44px;
}
.textarea {
width: 100%;
padding: 34px 32px 34px 0;
background: #FFFFFF;
border-bottom: 1px solid #D8DDE6;
.label {
display: inline-block;
font-size: 32px;
font-family: PingFangSC-Regular, PingFang SC;
color: #333;
line-height: 44px;
margin-bottom: 8px;
}
.value {
padding: 0 16px;
}
}
::v-deep .default {
width: 160px !important;
height: 160px !important;
}
.area-icon {
vertical-align: super;
position: absolute;
top: 10px;
right: 0;
}
.footer {
width: 100%;
position: fixed;
bottom: 0;
left: 0;
}
.btn {
width: 100%;
height: 112px;
line-height: 112px;
text-align: center;
background: #1365DD;
font-size: 32px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #FFF;
}
.line-bg {
width: 100%;
height: 16px;
background: #F5F5F5;
}
.pad-l32 {
padding-left: 32px;
background-color: #fff;
}
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB