调整代码生成和分包列入热更新开发范围

This commit is contained in:
aixianling
2022-05-11 16:52:54 +08:00
parent 526d7b9209
commit fd72e6a23f
19 changed files with 77 additions and 44 deletions

129
src/project/build.js Normal file
View File

@@ -0,0 +1,129 @@
const fsExtra = require('fs-extra')
const path = require('path')
const chalk = require('chalk')
const fs = require('fs')
const {exec} = require("child_process");
/**
* 将函数封装成promise
*/
const promisify = fn => {
return function () {
let args = arguments;
return new Promise(function (resolve, reject) {
[].push.call(args, function (err, result) {
if (err) {
console.log(err)
reject(err);
} else {
resolve(result);
}
});
fn.apply(null, args);
});
}
}
const readdir = promisify(fs.readdir)
const stat = promisify(fs.stat)
/**
* 封装打印工具
*/
const {log} = console
const chalkTag = {
info: msg => log([chalk.bgBlue.black(' INFO '), msg].join(' ')),
done: msg => log([chalk.bgGreen.black(' DONE '), msg].join(' ')),
warn: msg => log([chalk.bgYellow.black(' WARN '), msg].join(' ')),
error: msg => log([chalk.bgRed.black(' ERROR '), msg].join(' ')),
}
/**
* 遍历应用的方法
*/
const findApp = (dir, cb) => {
fsExtra.ensureDirSync(dir)
return readdir(dir).then(apps => {
return Promise.all(apps.map(e => {
let cPath = path.join(dir, e)
return stat(cPath).then(state => {
if (state.isDirectory()) {
return findApp(cPath, cb)
} else if (state.isFile()) {
cb && cb(dir)
}
})
}) || [])
})
}
/**
* 迁移apps文件
*/
const copyFiles = (dir, source = 'src/mods') => {
chalkTag.info(`开始扫描${source}...`)
return new Promise(resolve => {
fsExtra.emptyDir(dir, err => {
if (!err) {
fsExtra.copy(source, dir).then(() => {
chalkTag.done(source + ' 扫描完毕')
resolve()
})
}
})
})
}
/**
* 初始化打包配置文件
*/
const init = () => {
chalkTag.info('开始运行项目打包工具...')
return new Promise(resolve => fs.readdir('./src/project', (err, files) => {
resolve(files.filter(e => e.indexOf('.') < 0))
}))
}
/**
* 拷贝对应文件
*/
const generateMain = project => {
const getApps = new Promise(resolve => {
const appLib = path.join(__dirname, project.toString(), 'apps.import.json')
fsExtra.readJson(appLib, (err, data) => {
fsExtra.emptyDirSync(`src/project/${project}/apps`)
let apps = []
if (data) {
chalkTag.info(project + '加载业务应用配置...')
Promise.all([
findApp(`src/project/${project}`, file => {
let reg = new RegExp(/.+(App[^\\\/]+)$/)
if (reg.test(file)) {
data[file.replace(reg, '$1')] = file.replace(reg, '$1')
}
return apps.push(file)
}),
findApp('src/mods', file => apps.push(file))
]).then(() => Promise.all(Object.keys(data).map(e => {
let app = [...new Set(apps)].find(s => s.indexOf(e) > -1)
if (app) {
return copyFiles(`src/project/${project}/apps/${e}`, app)
}
}))).then(() => {
chalkTag.done(project + '业务应用加载完成')
resolve()
})
} else {
chalkTag.done(project + '业务应用无打包')
resolve()
}
})
})
return Promise.all([getApps])
}
const start = () => {
//询问打包哪个项目
init().then(choices => {
return Promise.all(choices.map(prj => generateMain(prj))).then(() => {
chalkTag.info('开始发布...')
})
})
}
start();

24
src/project/sanjianxi/.gitignore vendored Normal file
View File

@@ -0,0 +1,24 @@
.DS_Store
node_modules/
unpackage/
dist/
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.project
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw*
apps/

View File

@@ -0,0 +1,128 @@
<template>
<div class="AppGreatPowerIntegral">
<div class="myIntegral">
<p>{{ data['integral'] + data['learningIntegral'] }}</p>
<label>我的积分</label>
</div>
<div class="tabs">
<div class="item">
<p>{{ data['integral'] }}</p>
<label>个人积分</label>
</div>
<div class="item">
<p>{{ data['familySurplusIntegral'] }}</p>
<label>家庭积分</label>
</div>
<div class="item">
<p>{{ data['learningIntegral'] }}</p>
<label>学习强国</label>
</div>
</div>
<div class="btn">
<div class="editBtn" @click="$linkTo(`./editIntegral?partyMemberId=${user.partyId}`)">修改学习强国</div>
</div>
</div>
</template>
<script>
import {mapState} from 'vuex'
export default {
name: 'AppGreatPowerIntegral',
appName: '学习强国',
data() {
return {
data: {}
}
},
onShow() {
this.getIntegral()
uni.$on('update', ()=>{
this.getIntegral()
})
},
computed: {
...mapState(['user'])
},
methods: {
getIntegral() {
this.$instance.post('/app/appparty/getPartyIntegralDetail',null,{
params: {
id: this.user.partyId,
}
}).then((res) => {
if(res?.data) {
this.data = res.data
}
})
}
}
}
</script>
<style lang="scss" scoped>
.AppGreatPowerIntegral {
.myIntegral {
position: relative;
padding-top: 30px;
box-sizing: border-box;
height: 344px;
width: 100%;
background: #4181FF;
text-align: center;
p {
font-size: 100px;
font-weight: 600;
color: #FFFFFF;
}
label {
font-size: 32px;
color: #FFFFFF;
}
}
.tabs {
display: flex;
position: absolute;
left: 35px;
top: 250px;
height: 176px;
width: 90%;
background: #FFF;
border-radius: 32px;
.item {
flex: 1;
text-align: center;
padding: 30px 0;
p {
font-size: 50px;
color: #333333;
font-weight: 600;
}
label {
font-size: 28px;
color: #999999;
}
}
}
.btn {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 120px;
padding: 16px 32px;
box-sizing: border-box;
display: flex;
background: #F3F6F9;
.editBtn {
flex: 1;
height: 88px;
line-height: 88px;
text-align: center;
color: #FFF;
background: #4181FF;
border-radius: 16px;
}
}
}
</style>

View File

@@ -0,0 +1,115 @@
<template>
<div class="editIntegral">
<div class="item">
<div class="title"><span>*</span>学习强国</div>
<div class="inp">
<u-input v-model="learningIntegral" placeholder="请输入学习强国积分" :type="number" clearable maxlength="10" />
</div>
</div>
<div class="btn">
<div class="submitBtn" @click="submit">提交</div>
</div>
</div>
</template>
<script>
export default {
name: 'editIntegral',
appName: '修改学习强国',
data() {
return {
learningIntegral: '',
partyMemberId: '',
flag: false,
}
},
onLoad(o) {
this.partyMemberId = o.partyMemberId
this.getIntegral()
},
methods: {
getIntegral() {
this.$instance.post('/app/appparty/getPartyIntegralDetail',null,{
params: {
id: this.partyMemberId,
}
}).then((res) => {
if(res?.data) {
this.learningIntegral = res.data.learningIntegral
}
})
},
submit() {
if(this.flag) return
if(!this.learningIntegral) {
return this.$u.toast('请输入学习强国积分')
}
this.flag = true
this.$instance.post('/app/appparty/editLearningIntegral',null,{
params: {
partyMemberId: this.partyMemberId,
learningIntegral: this.learningIntegral,
}
}).then((res) => {
if (res.code == 0) {
this.$u.toast('修改成功')
setTimeout(() => {
uni.$emit('update')
uni.navigateBack()
},600)
}
})
}
},
}
</script>
<style lang="scss" scoped>
.editIntegral {
background: #F3F4F5;
.item {
box-sizing: border-box;
display: flex;
justify-content: space-between;
padding: 30px 30px;
background: #FFF;
.title {
width: 200px;
height: 76px;
line-height: 76px;
span {
color:#FF4466;
}
}
.inp {
width: calc(100% - 200px);
::v-deep .u-input .u-input__input {
text-align: right;
}
}
}
.btn {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 120px;
padding: 16px 32px;
box-sizing: border-box;
display: flex;
background: #F3F6F9;
.submitBtn {
flex: 1;
height: 88px;
line-height: 88px;
text-align: center;
color: #FFF;
background: #4181FF;
border-radius: 16px;
}
}
}
</style>

View File

@@ -0,0 +1,239 @@
<template>
<div class="AppNeighborLinkage">
<div class="header">
<div class="search">
<u-search placeholder="请输入四邻对象、描述" v-model="residentName" :show-action="false" @search="search" @clear="residentName='',getList()"></u-search>
</div>
<div class="select">
<div class="item" >
<AiSelect v-model="status" :list='array' @data='typeSelect'>
<span v-if="!status">全部状态</span>
<span v-else>{{ $dict.getLabel('partyFourLinkageStatus',status) }}</span>
<u-icon name="arrow-down-fill" color="#666666" size="28"></u-icon>
<!-- <u-icon name="close-circle" color="#666666" size="28" v-else @click="status='',getList()"></u-icon> -->
</AiSelect>
</div>
<div class="item">
<span v-if="!linksageDate">时间选择</span>
<span v-else>{{ linksageDate }}</span>
<u-icon name="close-circle" color="#666666" size="28" v-if="linksageDate" @click="linksageDate='',getList()" style="margin-right: 10px;"></u-icon>
<u-icon name="arrow-down-fill" color="#666666" size="28" @click="isShowDate = true"></u-icon>
</div>
<u-picker mode="time" :params="params" v-model="isShowDate" @confirm="onDateChange"></u-picker>
</div>
</div>
<div class="section" v-if="list.length">
<div class="card" v-for="(item,index) in list" :key="index" @click="$linkTo(`./neighborDetail?id=${item.id}`)">
<div class="info">
<p>{{ item.description }}</p>
<div><span>事件日期</span><span>{{ item.linksageDate }}</span></div>
<div><span>四邻对象</span><span>{{ item.residentName }}</span></div>
</div>
<div class="status">
<span :style="{background: item.status==0? '#FF883C': item.status==1? '#42D784': '#FF4466'}"></span>
<span :style="{color: item.status==0? '#FF883C': item.status==1? '#42D784': '#FF4466'}">
{{ $dict.getLabel('partyFourLinkageStatus',item.status) }}
</span>
</div>
</div>
</div>
<AiEmpty description="暂无数据" class="emptyWrap" v-else />
<div class="btn" v-if="isShowDate == false">
<div class="myInfo" @click="$linkTo('./myNeighborInfo')">我的四邻信息</div>
<div class="addBtn" @click="$linkTo('./addLinkage')">添加联动记录</div>
</div>
</div>
</template>
<script>
export default {
name: "AppNeighborLinkage",
appName: "四邻联动",
data() {
return {
residentName:'',
status: '',
linksageDate: '',
isShowDate: false,
params: {
year: true,
month: true,
day: true,
},
list: [],
current: 1,
array: [],
}
},
onShow() {
this.$dict.load('partyFourLinkageStatus').then(()=>{
this.array = this.$dict.getDict('partyFourLinkageStatus').map(item=>{
return {
label: item.dictName,
value: item.dictValue,
}
})
this.array.unshift({
label: '全部',
value: ''
})
})
uni.$on('update', ()=>{
this.getList()
})
this.getList()
},
methods: {
search(e) {
this.list = []
this.residentName = e
this.current = 1
this.getList()
},
typeSelect(e) {
this.list = []
this.status = e.value
this.current = 1
this.getList()
},
onDateChange(e) {
this.list = []
this.linksageDate = `${e.year}-${e.month}-${e.day}`
this.current = 1
this.getList()
},
getList() {
this.$instance.post('/app/apppartyfourlinkage/listByApplet',null,{
params: {
current: this.current,
status: this.status,
linksageDate: this.linksageDate,
residentName: this.residentName,
}
}).then(res=>{
if (res?.data) {
this.list = this.current==1? res.data.records : [...this.list, ...res.data.records]
}
})
},
},
onReachBottom() {
this.current ++,
this.getList()
}
}
</script>
<style lang="scss" scoped>
.AppNeighborLinkage {
.header {
position: fixed;
top: 0;
left: 0;
width: 100%;
.search {
box-sizing: border-box;
padding: 24px 32px;
background: #4181FF;
height: 112px;
}
.select {
display: flex;
height: 112px;
line-height: 112px;
background: #FFF;
.item {
flex: 1;
text-align: center;
span {
margin-right: 8px;
}
}
}
}
.section {
padding: 244px 32px 140px 32px;
box-sizing: border-box;
.card {
background: #FFF;
box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.04);
border-radius: 16px;
margin-bottom: 24px;
.info {
padding: 20px 30px 30px;
box-sizing: border-box;
border-bottom: 1px solid #DDDDDD;
p {
margin-bottom: 30px;
font-size: 32px;
font-weight: 600;
overflow:hidden;
text-overflow:ellipsis;
display:-webkit-box;
-webkit-box-orient:vertical;
-webkit-line-clamp:2;
}
div {
span:first-child {
color: #999999;
margin-right: 32px;
}
}
div:first-child {
margin-top: 32px;
}
}
.status {
padding: 32px 32px;
span:first-child {
display: inline-block;
width: 8px;
height: 8px;
border-radius: 50%;
background: #FF883C;
margin-right: 10px;
}
}
}
}
.btn {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 120px;
padding: 16px 32px;
box-sizing: border-box;
display: flex;
background: #F3F6F9;
.myInfo,
.addBtn {
flex: 1;
height: 88px;
line-height: 88px;
text-align: center;
color: #FFF;
background: #4181FF;
border-radius: 16px;
}
.myInfo {
margin-right: 20px;
color: #A0C0FF;
background: #FFF;
border: 1px solid #A0C0FF;
}
}
::v-deep .AiSelect {
display: inline-block;
}
::v-deep .emptyWrap .emptyImg {
margin-top: 220px;
}
}
</style>

View File

@@ -0,0 +1,186 @@
<template>
<div class="addLinkage">
<div class="item">
<div><span>*</span>四邻对象</div>
<AiSelect class="right" v-model="form.residentId" :list="userList"/>
</div>
<div class="item">
<div><span>*</span>事件日期</div>
<div @click="isShowDate = true">
<span v-if="form.linksageDate" >{{ form.linksageDate }}</span>
<span v-else style="color: #999;">请选择</span>
<u-icon name="arrow-right" color="#ddd"/>
</div>
</div>
<u-picker mode="time" :params="params" v-model="isShowDate" @confirm="onDateChange"></u-picker>
<div>
<div class="title"><span style="color: #FF4466">*</span>事件描述</div>
<div>
<u-input type="textarea" v-model="form.description" placeholder="请输入事件内容描述" height="200" maxlength="200"/>
</div>
<div class="tips">{{form.description.length}}/200</div>
</div>
<div class="btn">
<div class="addBtn" @click="confirm">提交</div>
</div>
</div>
</template>
<script>
export default {
name: "addLinkage",
appName: "添加联动记录", // :"修改联动记录"
data() {
return {
params: {
year: true,
month: true,
day: true,
},
isShowDate: false,
form: {
residentId: '',
linksageDate: '',
description: '',
},
userList: [],
id: '',
flag: false,
}
},
onShow() {
this.getTitle()
this.$dict.load('agriculturalType')
this.getUserList()
},
onLoad(o) {
if (o?.id) {
this.id = o.id
this.getDetail()
this.form = JSON.parse(JSON.stringify(this.data))
}
},
methods: {
onDateChange(e) {
this.form.linksageDate = `${e.year}-${e.month}-${e.day}`
},
getDetail() {
this.$instance.post('/app/apppartyfourlinkage/queryDetailById',null,{
params: {
id: this.id,
}
}).then(res => {
if(res?.data) {
this.form = {...res.data}
}
})
},
getUserList() {
this.$instance.post('/app/apppartyfourresident/listFourResidentByApplet').then((res) => {
if(res?.data) {
res.data.map((item) => {
this.userList.push({
label: item.name,
value: item.id,
})
})
}
})
},
confirm() {
if(this.flag) reutrn
if(!this.form.residentId) {
return this.$u.toast('请选择四邻对象')
}
if(!this.form.linksageDate) {
return this.$u.toast('请选择事件日期')
}
if(!this.form.description) {
return this.$u.toast('请输入事件描述')
}
this.flag = true
this.$instance.post('/app/apppartyfourlinkage/addByWxApplet',{
...this.form,
id: this.id || '',
}).then(res => {
if(res.code == 0) {
this.$u.toast('提交成功')
uni.$emit('update')
if (!this.id) {
setTimeout(() => {
uni.navigateBack()
},600)
} else {
setTimeout(() => {
uni.navigateBack({
delta: 2
})
},600)
}
}
})
},
getTitle() {
if (this.id) {
uni.setNavigationBarTitle({
title: '修改联动记录'
});
}
}
}
}
</script>
<style lang="scss" scoped>
.addLinkage {
padding: 0 32px;
box-sizing: border-box;
background: #FFF;
.item {
display: flex;
justify-content: space-between;
padding: 32px 0;
border-bottom: 1px solid #DDDDDD;
div:first-child {
span {
color: #FF4466;
}
}
}
.title {
padding: 32px 0
}
.tips {
text-align: right;
color: #999;
padding: 15px 0;
}
.btn {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 120px;
padding: 16px 32px;
box-sizing: border-box;
background: #F3F6F9;
.addBtn {
width: 100%;
height: 88px;
line-height: 88px;
text-align: center;
background: #4181FF;
border-radius: 16px;
color: #FFF;
}
}
}
</style>

View File

@@ -0,0 +1,105 @@
<template>
<div class="familyInfo">
<div class="card-list">
<div class="item" v-for="(item, index) in familyList" :key="index" @click="$linkTo(`./memberInfo?id=${item.id}`)">
<div class="userpic">
<img :src="item.photo" alt="" v-if="item.photo">
<img src="https://cdn.cunwuyun.cn/dvcp/myFamily/tx.png" alt="" v-else>
</div>
<div class="user-info">
<p class="name">{{ item.name }}</p>
<div class="idNumber">{{ item.idNumber.replace(/(.{6}).*(.{4})/, '$1********$2') }}</div>
</div>
<div class="relation" :style="{color:item.householdRelation == 11? '#4181FF' : '#999999' }">
{{ $dict.getLabel('householdRelation',item.householdRelation) }}
</div>
<div class="arrowRoght">
<u-icon name="arrow-right"></u-icon>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'familyInfo',
appName: '家庭详情',
data() {
return {
idNumber: '',
familyList: {},
}
},
onLoad(o) {
this.$dict.load('householdRelation')
this.idNumber = o.idNumber
this.getList()
},
methods: {
getList() {
this.$instance.post('/app/appresident/queryHomeMember',null,{
params: {
idNumber: this.idNumber
}
}).then(res => {
if(res.code == 0) {
this.familyList = res.data.family
}
})
}
}
}
</script>
<style lang="scss" scoped>
.familyInfo {
.card-list {
padding: 32px 32px 32px 20px;
box-sizing: border-box;
.item {
display: flex;
background: #FFF;
padding: 32px;
border-radius: 16px;
box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.04);
margin-bottom: 24px;
.userpic {
width: 96px;
height: 96px;
margin-right: 10px;
img {
border-radius: 50%;
width: 100%;
height: 100%;
}
}
.user-info {
width: calc(100% - 226px);
.name {
font-size: 32px;
font-weight: 600;
}
.idNumber {
margin-top: 8px;
color: #999999;
}
}
.relation {
width: 80px;
align-self: center;
}
.arrowRoght {
width: 40px;
align-self: center;
}
}
}
}
</style>

View File

@@ -0,0 +1,190 @@
<template>
<div class="memberInfo">
<div class="user">
<div class="pic">
<img :src="data.photo" alt="" v-if="data.photo">
<img src="https://cdn.cunwuyun.cn/dvcp/myFamily/tx.png" alt="" v-else>
</div>
<div class="info">
<div class="name">{{ data.name }}</div>
<div class="idNumber">{{ String(data.householdIdNumber).replace(/(.{6}).*(.{4})/, '$1********$2') }}</div>
</div>
<div class="relation" :style="{color:data.householdRelation == 11? '#4181FF' : '#999999' }">
{{ $dict.getLabel('householdRelation',data.householdRelation) }}
</div>
</div>
<div class="basicInfo">
<h2>个人基本信息</h2>
<div class="items">
<p>家庭住址</p>
<div>{{ data.householdAreaName || '' }}</div>
</div>
<div class="item">
<span>性别</span><span>{{ $dict.getLabel('sex',data.sex) || '' }}</span>
</div>
<div class="item">
<span>年龄</span><span>{{ data.age }}</span>
</div>
<div class="item">
<span>民族</span><span>{{ $dict.getLabel('nation',data.nation) || '' }}</span>
</div>
<div class="item">
<span>文化程度</span><span>{{ $dict.getLabel('education',data.education) || '' }}</span>
</div>
<div class="item">
<span>婚姻状况</span><span>{{ $dict.getLabel('maritalStatus',data.maritalStatus) || '' }}</span>
</div>
<div class="item">
<span>政治面貌</span><span>{{ $dict.getLabel('politicsStatus',data.politicsStatus) || '' }}</span>
</div>
<div class="item">
<span>兵役状况</span><span>{{ $dict.getLabel('militaryStatus',data.militaryStatus) || '' }}</span>
</div>
<div class="item">
<span>宗教信仰</span><span>{{ $dict.getLabel('faithType',data.faithType) || '' }}</span>
</div>
<div class="item">
<span>职业</span><span>{{ $dict.getLabel('job',data.job) || '' }}</span>
</div>
</div>
<div class="contactInfo">
<h2>联络信息</h2>
<div class="item">
<span>联系方式</span>
<span style="color: #4181FF" @click="callPhone(data.phone)">
<u-icon name="phone" color="#4181FF" size="28" style="display: inline-block;" v-if="data.phone"></u-icon>
{{ data.phone || '' }}
</span>
</div>
<div class="items">
<p>现住址</p>
<div>{{ data.currentAreaName || '' }}</div>
</div>
<div class="items">
<p>现住详细地址</p>
<div>{{ data.currentAddress || '' }}</div>
</div>
<div class="items">
<p>户籍地址</p>
<div>{{ data.householdAreaName || '' }}</div>
</div>
<div class="items">
<p>户籍详细地址</p>
<div>{{ data.householdAddress || '' }}</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: "memberInfo",
appName: "家庭详情",
data() {
return {
id: '',
data: {},
}
},
onShow() {
this.getUserInfo()
},
onLoad(o) {
this.$dict.load('sex','householdRelation','nation','education','maritalStatus','politicsStatus','faithType','job')
this.id = o.id
},
methods: {
callPhone(phone) {
wx.makePhoneCall({
phoneNumber: phone,
})
},
getUserInfo() {
this.$instance.post('/app/appresident/detailForWx',null,{
params: {
id: this.id
}
}).then(res => {
if(res.code ==0) {
this.data = res.data.resident
}
})
},
},
}
</script>
<style lang="scss" scoped>
.memberInfo {
.user {
display: flex;
background: #FFF;
padding: 32px;
.pic {
width: 96px;
height: 96px;
margin-right: 10px;
img {
border-radius: 50%;
width: 100%;
height: 100%;
}
}
.info {
width: calc(100% - 176px);
.name {
font-size: 32px;
font-weight: 600;
}
.idNumber {
margin-top: 8px;
color: #999999;
}
}
.relation {
width: 80px;
align-self: center;
}
}
.basicInfo,
.contactInfo {
margin-top: 24px;
padding: 0 32px;
box-sizing: border-box;
background: #FFF;
h2 {
padding: 26px 0;
font-style: 32px;
font-weight: 600;
}
.items {
padding: 12px 0;
p {
margin-bottom: 12px;
color: #999999;
font-style: 30px;
}
}
.item {
display: flex;
justify-content: space-between;
padding: 12px 0;
span:first-child {
color: #999999;
font-style: 30px;
}
}
}
.contactInfo {
margin-bottom: 24px;
}
}
</style>

View File

@@ -0,0 +1,93 @@
<template>
<div class="myNeighborInfo" v-if="userList.length">
<div class="card-list">
<div class="item" v-for="(item,index) in userList" :key="index" @click="$linkTo(`./familyInfo?idNumber=${item.idNumber}`)">
<div class="userpic">
<img :src="item.avatarUrl" v-if="item.avatarUrl" alt="">
<img src="https://cdn.cunwuyun.cn/dvcp/myFamily/tx.png" v-else alt="">
</div>
<div class="user-info">
<p class="name">{{ item.name }}</p>
<div class="idNumber">{{ item.idNumber.replace(/(.{6}).*(.{4})/, '$1********$2') }}</div>
</div>
<div class="arrowRoght">
<u-icon name="arrow-right"></u-icon>
</div>
</div>
</div>
</div>
<AiEmpty description="暂无数据" class="emptyWrap" v-else />
</template>
<script>
export default {
name: 'myNeighborInfo',
appName: '我的四邻信息',
data() {
return {
partyId: '',
userList: []
}
},
onLoad() {
this.getUserInfo()
},
methods: {
// 我的四邻党员查询
getUserInfo() {
this.$instance.post('/app/apppartyfourresident/listFourResidentByApplet').then((res) => {
if(res?.data) {
this.userList = res.data
}
})
}
}
}
</script>
<style lang="scss" scoped>
.myNeighborInfo {
.card-list {
padding: 32px 32px 32px 20px;
box-sizing: border-box;
.item {
display: flex;
background: #FFF;
padding: 32px;
border-radius: 16px;
box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.04);
margin-bottom: 24px;
.userpic {
width: 96px;
height: 96px;
margin-right: 10px;
img {
border-radius: 50%;
width: 100%;
height: 100%;
}
}
.user-info {
width: calc(100% - 146px);
.name {
font-size: 32px;
font-weight: 600;
}
.idNumber {
margin-top: 8px;
color: #999999;
}
}
.arrowRoght {
width: 40px;
align-self: center;
}
}
}
}
</style>

View File

@@ -0,0 +1,146 @@
<template>
<div class="neighborDetail">
<div class="type">
<span>审核状态</span>
<span :style="{color: data.status==0? '#FF883C': data.status==1? '#42D784': '#FF4466'}">
{{ $dict.getLabel('partyFourLinkageStatus',data.status) }}
</span>
</div>
<div class="user-info">
<div class="item">
<span>事件日期</span>
<span>{{ data.linksageDate }}</span>
</div>
<div class="item">
<span>四邻对象</span>
<span>{{ data.residentName }}</span>
</div>
<div class="description">
<div>事件描述</div>
<div>
{{ data.description }}
</div>
</div>
<div class="description" v-if="data.status == 2">
<div>审核意见</div>
<div>
{{ data.remark }}
</div>
</div>
</div>
<div class="btn">
<div class="delBtn" @click="delBtn">删除联动记录</div>
<div class="editBtn" @click="$linkTo(`./addLinkage?id=${id}`)" v-if="data.status ==0 || data.status ==2">修改联动记录</div>
</div>
</div>
</template>
<script>
export default {
name: 'neighborDetail',
appName: '四邻联动详情',
data() {
return {
id: '',
data: {}
}
},
onLoad(o) {
this.$dict.load('partyFourLinkageStatus')
this.id = o.id
this.getDetail()
},
methods: {
getDetail() {
this.$instance.post('/app/apppartyfourlinkage/queryDetailById',null,{
params: {
id: this.id,
}
}).then(res => {
if(res.code == 0) {
this.data = res.data
}
})
},
delBtn() {
this.$dialog.confirm({content: '确定要删除该记录吗?'}).then(()=>{
this.$instance.post(`/app/apppartyfourlinkage/delete?ids=${this.id}`).then(res => {
if(res.code == 0) {
this.$u.toast('删除成功')
uni.$emit('update')
setTimeout(() => {
uni.navigateBack()
},600)
}
})
})
}
}
}
</script>
<style lang="scss" scoped>
.neighborDetail {
padding-bottom: 140px;
box-sizing: border-box;
.type {
display: flex;
justify-content: space-between;
box-sizing: border-box;
padding: 32px 32px;
background: #FFF;
span:first-child {
color: #999999;
}
}
.user-info {
margin-top: 24px;
padding: 0 32px;
box-sizing: border-box;
background: #FFF;
.item {
display: flex;
justify-content: space-between;
padding: 32px 0;
border-bottom: 1px solid #DDDDDD;
span:first-child {
color: #999999;
}
}
.description {
padding: 32px 0;
div:first-child {
margin-bottom: 20px;
color: #999999;
}
}
}
.btn {
display: flex;
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 120px;
padding: 16px 32px;
box-sizing: border-box;
background: #F3F6F9;
.delBtn,
.editBtn {
flex: 1;
height: 88px;
line-height: 88px;
text-align: center;
color: #FF4466;
border: 1px solid #FF4466;
border-radius: 16px;
}
.editBtn {
margin-left: 20px;
background: #4181FF !important;
color: #FFF;
border: none;
}
}
}
</style>

View File

@@ -0,0 +1,31 @@
{
"AppAddressBook": "便民通讯录",
"AppContent": "内容发布",
"AppPhotoReport": "随手拍",
"AppServiceOnlineNew": "网上办事",
"AppReturnHomeRegister": "返乡登记",
"AppHealthReport": "健康上报",
"AppProgressNew": "办事指南",
"AppMyPlan": "办事进度",
"AppIntegralApply": "积分申请",
"AppCreditPoints": "信用积分",
"AppSupermarket": "积分超市",
"AppVillageInfo": "一村一群",
"AppVillageActivity": "居民活动",
"AppVideoSurve": "视频监控",
"AppAuth": "实名认证",
"AppOnlineAnswer": "在线答题",
"AppPartyHistoryEducation": "党史教育",
"AppOrderList": "超市订单",
"AppThreeSessions": "三会一课",
"AppServiceOnline": "网上办事",
"AppJob": "招工就业",
"AppPolice": "驻村辅警",
"AppMarFuneral": "婚丧嫁娶",
"AppAgProducts": "晒农产品",
"AppTopic": "热点话题",
"AppVillagerInfo": "本村简介",
"AppVillagerDiscussion": "居民议事",
"AppPhotoAlbum": "乡村相册",
"AppHometown": "我的家乡"
}

View File

@@ -0,0 +1,10 @@
{
"name": "@dvcp-wechat-apps/sanjianxi",
"version": "1.0.0",
"files": [
"apps",
"static"
],
"dependencies": {
}
}

24
src/project/shandong10086/.gitignore vendored Normal file
View File

@@ -0,0 +1,24 @@
.DS_Store
node_modules/
unpackage/
dist/
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.project
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw*
apps/

View File

@@ -0,0 +1,21 @@
{
"AppAddressBook": "便民通讯录",
"AppContent": "内容发布",
"AppPhotoReport": "随手拍",
"AppServiceOnlineNew": "网上办事",
"AppReturnHomeRegister": "返乡登记",
"AppHealthReport": "健康上报",
"AppProgressNew": "办事指南",
"AppMyPlan": "办事进度",
"AppIntegralApply": "积分申请",
"AppCreditPoints": "信用积分",
"AppSupermarket": "积分超市",
"AppVillageInfo": "一村一群",
"AppVillageActivity": "居民活动",
"AppVideoSurve": "视频监控",
"AppAuth": "实名认证",
"AppOnlineAnswer": "在线答题",
"AppPartyHistoryEducation": "党史教育",
"AppOrderList": "超市订单",
"AppThreeSessions": "三会一课"
}

View File

@@ -0,0 +1,9 @@
{
"name": "@dvcp-wechat-apps/shandong10086",
"version": "1.0.0",
"files": [
"apps"
],
"dependencies": {
}
}