乡村相册

This commit is contained in:
yanran200730
2022-05-24 13:49:03 +08:00
parent d89ee74993
commit e7c61c8293
8 changed files with 111 additions and 60 deletions

View File

@@ -1,7 +1,7 @@
<template>
<div class="Watermark7" @click="linkTo('./WatermarkConfig')">
<image src="../../images/hjws.png" />
<h2>{{ title }}</h2>
<h2 v-if="isShowTitle">{{ title }}</h2>
<div class="middle">
<div class="top">
<h2>{{ time }}</h2>
@@ -9,7 +9,7 @@
</div>
<div class="bottom">{{ date }} {{ weekCn }}</div>
</div>
<div class="bottom" v-if="isShowAddress">{{ address }}</div>
<div class="bottom" v-show="isShowAddress">{{ address }}</div>
</div>
</template>
@@ -24,9 +24,10 @@
time: '',
title: '',
week: '',
weather: '晴转多云',
address: '武汉市·绿地蓝海国际A座',
weather: '',
address: '',
timer: null,
isShowTitle: true,
isShowAddress: true,
configList: []
}
@@ -65,7 +66,10 @@
const address = v.filter(v => v.type === '3')[0]
const title = v.filter(v => v.type === '5')[0]
this.isShowAddress = address.status === '1'
this.isShowTitle = title.status === '1'
this.title = title.defaultValue || ''
this.address = uni.getStorageSync('address').address || ''
this.weather = uni.getStorageSync('address').weather || ''
}
},
deep: true
@@ -74,6 +78,12 @@
created () {
this.configList = JSON.parse(JSON.stringify(this.config)).map(v => {
if (v.fieldType === '3') {
v.defaultValue = uni.getStorageSync('address').address || ''
}
if (v.fieldType === '2') {
v.defaultValue = uni.getStorageSync('address').weather || ''
}
if (v.fieldType === '7') {
v.defaultValue = this.$dayjs().format('YYYY-MM-DD')
this.week = new Date().getDay()
@@ -86,12 +96,7 @@
})
this.date = this.$dayjs(new Date).format('YYYY-MM-DD')
this.time = this.$dayjs().format('HH:mm')
this.timer = setInterval(() => {
this.date = this.$dayjs().format('YYYY-MM-DD')
this.time = this.$dayjs().format('HH:mm')
this.week = new Date().getDay()
}, 1000)
this.week = new Date().getDay()
uni.$on('change', e => {
this.configList = e