This commit is contained in:
yanran200730
2022-05-25 18:14:07 +08:00
parent 8963a7a28d
commit cb5e8ba833
4 changed files with 10 additions and 13 deletions

View File

@@ -55,7 +55,7 @@
},
save () {
uni.$emit('change', this.config)
uni.$emit('filedChange', this.config)
uni.navigateBack({
delta: 1
})

View File

@@ -49,7 +49,7 @@
onLoad () {
this.config = uni.getStorageSync('waterConfig')
uni.$on('change', e => {
uni.$on('filedChange', e => {
this.config.forEach((v, index) => {
if (v.type === e.type) {
this.$set(this.config[index], 'defaultValue', e.defaultValue)

View File

@@ -29,6 +29,7 @@
week: '',
title: '定格在这一刻',
address: '',
configList: []
}
},

View File

@@ -3,8 +3,8 @@
<div class="top">
<h2>{{ title }}</h2>
<div class="right">
<h2 v-if="isShowTime">{{ time }}</h2>
<p v-if="isShowDate">{{ date }}</p>
<h2>{{ time }}</h2>
<p>{{ date }}</p>
</div>
</div>
<div class="info">
@@ -56,6 +56,7 @@
isServiceName: false,
text: '',
isShowText: '',
configList: []
}
},
@@ -90,20 +91,15 @@
handler: function (v) {
if (v.length) {
const address = v.filter(v => v.type === '3')[0]
const date = v.filter(v => v.type === '1')[0]
const time = v.filter(v => v.type === '0')[0]
const gridUserName = v.filter(v => v.type === '9')[0]
const gridName = v.filter(v => v.type === '10')[0]
const title = v.filter(v => v.type === '8')[0]
const serviceName = v.filter(v => v.type === '11')[0]
const text = v.filter(v => v.type === '12')[0]
this.isShowAddress = address.status === '1'
this.isShowDate = date.status === '1'
this.isShowGridName = gridName.status === '1'
this.isServiceName = serviceName.status === '1'
this.isShowText = text.status === '1'
this.isShowDate = date.status === '1'
this.isShowTime = time.status === '1'
this.title = title.defaultValue || ''
this.gridUserName = gridUserName.defaultValue || ''
this.gridName = gridName.defaultValue || ''
@@ -125,6 +121,9 @@
return v
})
uni.$on('change', e => {
this.configList = e
})
this.date = this.$dayjs(new Date).format('YYYY-MM-DD')
this.time = this.$dayjs().format('HH:mm')
@@ -133,14 +132,11 @@
this.time = this.$dayjs().format('HH:mm')
this.week = new Date().getDay()
}, 1000)
uni.$on('change', e => {
this.configList = e
})
},
destroyed () {
clearInterval(this.timer)
uni.$off('change')
},
methods: {