乡村相册
This commit is contained in:
@@ -62,6 +62,14 @@
|
||||
configList: {
|
||||
handler: function (v) {
|
||||
if (v.length) {
|
||||
const date = v.filter(v => v.type === '1')[0]
|
||||
const time = v.filter(v => v.type === '0')[0]
|
||||
const title = v.filter(v => v.type === '5')[0]
|
||||
this.title = title.defaultValue || ''
|
||||
this.date = date.defaultValue || this.$dayjs(new Date).format('YYYY-MM-DD')
|
||||
this.time = time.defaultValue || this.$dayjs().format('HH:mm')
|
||||
this.week = date.defaultValue ? this.$dayjs(date.defaultValue).day() : new Date().getDay()
|
||||
this.address = uni.getStorageSync('address').address || ''
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
@@ -70,24 +78,26 @@
|
||||
|
||||
created () {
|
||||
this.configList = JSON.parse(JSON.stringify(this.config)).map(v => {
|
||||
if (v.fieldType === '3') {
|
||||
v.defaultValue = uni.getStorageSync('address').address || ''
|
||||
}
|
||||
|
||||
if (v.fieldType === '7') {
|
||||
v.defaultValue = this.$dayjs().format('YYYY-MM-DD')
|
||||
this.week = new Date().getDay()
|
||||
}
|
||||
|
||||
if (v.fieldType === '6') {
|
||||
v.defaultValue = this.$dayjs().format('HH:mm')
|
||||
}
|
||||
|
||||
return v
|
||||
})
|
||||
|
||||
this.date = this.$dayjs(new Date).format('YYYY-MM-DD')
|
||||
this.time = this.$dayjs().format('HH:mm')
|
||||
this.week = new Date().getDay()
|
||||
|
||||
this.timer = setInterval(() => {
|
||||
this.time = this.$dayjs().format('HH:mm')
|
||||
}, 1000)
|
||||
|
||||
uni.$on('change', e => {
|
||||
this.configList = e
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user