This commit is contained in:
liuye
2021-12-24 19:34:42 +08:00
7 changed files with 28 additions and 16 deletions

View File

@@ -80,7 +80,6 @@ export default {
contactPhone: '', contactPhone: '',
}, },
showStartTime: false, showStartTime: false,
showEndTime: false, showEndTime: false,
flag: false, flag: false,

View File

@@ -78,6 +78,7 @@ export default {
this.$dict.load(['villageActivityStatus']).then(() => { this.$dict.load(['villageActivityStatus']).then(() => {
this.getList() this.getList()
}) })
uni.$on('updateList', () => { uni.$on('updateList', () => {
this.current = 1 this.current = 1
this.getList() this.getList()

View File

@@ -15,7 +15,7 @@
<div class="right"> <div class="right">
<img :src="user.avatar" alt="" v-if="user.avatar" /> <img :src="user.avatar" alt="" v-if="user.avatar" />
<span>{{ user.name }}</span> <span>{{ detail.contactPerson }}</span>
</div> </div>
</div> </div>
@@ -28,7 +28,6 @@
<div class="cards-left">活动人数</div> <div class="cards-left">活动人数</div>
<div class="cards-right" @click="toSignUser()"> <div class="cards-right" @click="toSignUser()">
<span style="color: #1c6bdf">{{ detail.realNum }}</span> <span style="color: #1c6bdf">{{ detail.realNum }}</span>
<u-icon name="arrow-right" color="#DDDDDD" size="28" style="margin-left: 8px"></u-icon>
</div> </div>
</div> </div>
@@ -102,7 +101,7 @@
<div class="fixedBtns" v-if="this.current == 0 && detail.status == 0 && this.createUserId == this.user.id" @click="toAdd">编辑活动</div> <div class="fixedBtns" v-if="this.current == 0 && detail.status == 0 && this.createUserId == this.user.id" @click="toAdd">编辑活动</div>
</div> </div>
<AiFixedBtn v-if="this.createUserId == this.user.id"> <AiFixedBtn v-if="this.createUserId == this.user.id && this.timeNow * 1 - this.timeEnd * 1 < 24 * 60 * 60 * 1000">
<div class="addBtn iconfont iconfont-iconfangda" @tap.stop="AddPosts()" /> <div class="addBtn iconfont iconfont-iconfangda" @tap.stop="AddPosts()" />
</AiFixedBtn> </AiFixedBtn>
</div> </div>
@@ -133,6 +132,8 @@ export default {
], ],
current: 0, current: 0,
timeEndTime: '', timeEndTime: '',
timeEnd: '',
timeNow: '',
} }
}, },
onLoad(option) { onLoad(option) {
@@ -154,6 +155,16 @@ export default {
this.$http.post(`/app/appvillageactivityinfo/queryDetailById?id=${this.id}`).then((res) => { this.$http.post(`/app/appvillageactivityinfo/queryDetailById?id=${this.id}`).then((res) => {
if (res?.data) { if (res?.data) {
this.detail = res.data this.detail = res.data
console.log('结束时间', this.detail.endTime)
this.timeEnd = new Date(this.detail.endTime).getTime()
console.log('过去时间戳', this.timeEnd)
this.timeNow = new Date().getTime()
console.log('当前时间戳', this.timeNow)
console.log('过去时间戳加上24小时', this.timeEnd * 1 + 24 * 60 * 60 * 1000)
if (this.timeNow * 1 - this.timeEnd * 1 < 24 * 60 * 60 * 1000) {
console.log('可以添加')
}
if (this.detail) { if (this.detail) {
if (this.detail.url) { if (this.detail.url) {

View File

@@ -7,7 +7,8 @@
<div class="areaHint"> <div class="areaHint">
<u-icon name="map-fill" color="#73ABFF"></u-icon> <u-icon name="map-fill" color="#73ABFF"></u-icon>
<span>{{ currentAddress }}</span> <span>{{ resident.currentAreaName }}</span>
<span v-if="resident.currentAddress">{{ resident.currentAddress }}</span>
</div> </div>
</div> </div>
@@ -59,13 +60,13 @@ export default {
return { return {
id: '', id: '',
data: [], data: [],
currentAddress: '', resident: {},
} }
}, },
computed: {}, computed: {},
watch: {}, watch: {},
onLoad(o) { onLoad(o) {
document.title = '居民档案' document.title = '居民档案'
this.id = o.id this.id = o.id
this.$dict.load('householdRelation', 'fileStatus').then(() => { this.$dict.load('householdRelation', 'fileStatus').then(() => {
this.getDetail() this.getDetail()
@@ -78,7 +79,7 @@ export default {
if (res.code == 0) { if (res.code == 0) {
this.data = res.data this.data = res.data
this.$nextTick(() => { this.$nextTick(() => {
this.currentAddress = res.data.resident.currentAddress this.resident = res.data.resident
}) })
} }
}) })

View File

@@ -129,7 +129,6 @@ export default {
iconPath: 'home', iconPath: 'home',
selectedIconPath: 'home-fill', selectedIconPath: 'home-fill',
text: '统计分析', text: '统计分析',
isDot: true,
customIcon: false, customIcon: false,
}, },
{ {
@@ -182,7 +181,7 @@ export default {
}, },
watch: {}, watch: {},
onLoad() { onLoad() {
document.title = '居民信息管理' document.title = '居民信息管理'
this.getEchart1() this.getEchart1()
this.areaId = this.user.areaId this.areaId = this.user.areaId
}, },

View File

@@ -7,7 +7,7 @@
</u-form-item> </u-form-item>
<u-form-item label="发布组织" prop="publishUnitName" required :border-bottom="false" class="phones"> <u-form-item label="发布组织" prop="publishUnitName" required :border-bottom="false" class="phones">
<u-input v-model="forms.publishUnitName" placeholder="请输入发布单位" maxlength="16" /> <u-input v-model="forms.publishUnitName" placeholder="请输入发布组织" maxlength="16" />
</u-form-item> </u-form-item>
<u-form-item label="正文" prop="content" :border-bottom="false" label-position="top" class="contents"> <u-form-item label="正文" prop="content" :border-bottom="false" label-position="top" class="contents">

View File

@@ -1,5 +1,5 @@
import dict from "./dict"; import dict from "./dict";
import $moment from './monent'; import dayjs from './monent';
const confirm = (content, title, config) => { const confirm = (content, title, config) => {
let ops = {content} let ops = {content}
@@ -26,11 +26,11 @@ const confirm = (content, title, config) => {
const calcAge = (code) => { const calcAge = (code) => {
let birthday let birthday
if (typeof code == 'string' && code.length == 18) { if (typeof code == 'string' && code.length == 18) {
birthday = $moment(code.substring(6, 14), 'YYYYMMDD') birthday = dayjs(code.substring(6, 14), 'YYYYMMDD')
} else if (typeof code == 'object') { } else if (typeof code == 'object') {
birthday = code birthday = code
} }
return Math.ceil($moment().year() - $moment(birthday).year()) return Math.ceil(dayjs().year() - dayjs(birthday).year())
} }
export default { export default {
@@ -38,7 +38,7 @@ export default {
confirm, confirm,
calcAge, calcAge,
dateFormat: (time, format) => { dateFormat: (time, format) => {
return $moment(time).format(format || 'YYYY-MM-DD').replace("Invalid Date", "") return dayjs(time).format(format || 'YYYY-MM-DD').replace("Invalid Date", "")
}, },
formatName: (name) => { formatName: (name) => {
return Array.from(name)?.slice(-2)?.toString() || ""; return Array.from(name)?.slice(-2)?.toString() || "";
@@ -73,5 +73,6 @@ export default {
let hex = r << 16 | g << 8 | b; let hex = r << 16 | g << 8 | b;
return "#" + hex.toString(16); return "#" + hex.toString(16);
} }
} },
dayjs
} }