乡村乡村
This commit is contained in:
@@ -1,27 +1,34 @@
|
||||
<template>
|
||||
<div class="Watermark7" @click="linkTo('./WatermarkConfig')">
|
||||
<image src="../../images/hjws.png" />
|
||||
<h2>整好环境卫生</h2>
|
||||
<h2>{{ title }}</h2>
|
||||
<div class="middle">
|
||||
<div class="top">
|
||||
<h2>{{ time }}</h2>
|
||||
<span>多云 7℃</span>
|
||||
<span>{{ weather }}</span>
|
||||
</div>
|
||||
<div class="bottom">{{ date }} {{ weekCn }}</div>
|
||||
</div>
|
||||
<div class="bottom">武汉市·绿地蓝海A座</div>
|
||||
<div class="bottom" v-if="isShowAddress">{{ address }}</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapActions} from 'vuex'
|
||||
export default {
|
||||
props: ['config'],
|
||||
|
||||
data () {
|
||||
return {
|
||||
date: '',
|
||||
time: '',
|
||||
title: '',
|
||||
week: '',
|
||||
timer: null
|
||||
weather: '晴转多云',
|
||||
address: '武汉市·绿地蓝海国际A座',
|
||||
timer: null,
|
||||
isShowAddress: true,
|
||||
configList: []
|
||||
}
|
||||
},
|
||||
|
||||
@@ -51,7 +58,23 @@
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
configList: {
|
||||
handler: function (v) {
|
||||
if (v.length) {
|
||||
const address = v.filter(v => v.type === '3')[0]
|
||||
const title = v.filter(v => v.type === '5')[0]
|
||||
console.log(address)
|
||||
this.isShowAddress = address.status === '1'
|
||||
this.title = title.defaultValue || ''
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
},
|
||||
|
||||
created () {
|
||||
this.configList = JSON.parse(JSON.stringify(this.config))
|
||||
this.date = this.$dayjs(new Date).format('YYYY-MM-DD')
|
||||
this.time = this.$dayjs().format('HH:mm')
|
||||
|
||||
@@ -61,6 +84,10 @@
|
||||
this.week = new Date().getDay()
|
||||
}, 1000)
|
||||
|
||||
uni.$on('change', e => {
|
||||
this.configList = e
|
||||
})
|
||||
|
||||
this.injectJWeixin(['getLocation']).then(res => {
|
||||
console.log(res)
|
||||
wx.getLocation({
|
||||
@@ -97,6 +124,7 @@
|
||||
},
|
||||
|
||||
linkTo (url) {
|
||||
uni.setStorageSync('waterConfig', this.configList)
|
||||
uni.navigateTo({
|
||||
url
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user