乡村相册
This commit is contained in:
@@ -87,7 +87,8 @@
|
|||||||
albumName: '',
|
albumName: '',
|
||||||
watermarkList: [],
|
watermarkList: [],
|
||||||
isShowAlbum: false,
|
isShowAlbum: false,
|
||||||
albumList: []
|
albumList: [],
|
||||||
|
address: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -116,12 +117,7 @@
|
|||||||
this.height = uni.getSystemInfoSync().windowHeight
|
this.height = uni.getSystemInfoSync().windowHeight
|
||||||
|
|
||||||
this.getWatermarkList()
|
this.getWatermarkList()
|
||||||
|
|
||||||
this.getLocation()
|
this.getLocation()
|
||||||
|
|
||||||
this.$http.post('/api/appdvcpconfig/apiForward', 'https://apis.map.qq.com/ws/geocoder/v1/?location=39.984154,116.307490&key=3RZBZ-LZUCF-CT6J5-NWKZH-FCWOQ-UUFKY&get_poi=1').then(res => {
|
|
||||||
console.log(res)
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
@@ -170,18 +166,46 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getWeather (code) {
|
||||||
|
this.$http.post(`/api/bdweather/wdata?districtId=${code}`).then(res => {
|
||||||
|
console.log(res)
|
||||||
|
if (res.code === 0) {
|
||||||
|
const data = res.data.result.now
|
||||||
|
|
||||||
|
uni.setStorageSync('address', {
|
||||||
|
...uni.getStorageSync('address'),
|
||||||
|
weather: data.text || ''
|
||||||
|
})
|
||||||
|
|
||||||
|
this.address = {
|
||||||
|
...uni.getStorageSync('address'),
|
||||||
|
weather: data.text || ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
getLocation () {
|
getLocation () {
|
||||||
this.injectJWeixin(['getLocation']).then(res => {
|
this.injectJWeixin(['getLocation']).then(res => {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
wx.getLocation({
|
wx.getLocation({
|
||||||
type: 'wgs84',
|
type: 'wgs84',
|
||||||
success: function (res) {
|
success: res => {
|
||||||
var lat = res.latitude
|
var lat = res.latitude
|
||||||
var lng = res.longitude
|
var lng = res.longitude
|
||||||
console.log(lat, lng)
|
|
||||||
this.$http.post('/api/appdvcpconfig/apiForward',
|
this.$http.post('/api/appdvcpconfig/apiForward',
|
||||||
`https://apis.map.qq.com/ws/geocoder/v1/?location=${lat},${lng}&key=3RZBZ-LZUCF-CT6J5-NWKZH-FCWOQ-UUFKY&get_poi=1`).then(res => {
|
`https://apis.map.qq.com/ws/geocoder/v1/?location=${lat},${lng}&key=3RZBZ-LZUCF-CT6J5-NWKZH-FCWOQ-UUFKY&get_poi=1`).then(res => {
|
||||||
console.log(res)
|
if (res.code === 0) {
|
||||||
|
const data = res.data.result
|
||||||
|
uni.setStorageSync('address', {
|
||||||
|
lat,
|
||||||
|
lng,
|
||||||
|
address: data.address,
|
||||||
|
cityCode: `${data.ad_info.adcode}`
|
||||||
|
})
|
||||||
|
|
||||||
|
this.getWeather(`${data.ad_info.adcode}`)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
error: res => {
|
error: res => {
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapActions } from 'vuex'
|
|
||||||
export default {
|
export default {
|
||||||
props: ['config'],
|
props: ['config'],
|
||||||
|
|
||||||
@@ -68,6 +67,8 @@
|
|||||||
this.isShowWeather = weather.status === '1'
|
this.isShowWeather = weather.status === '1'
|
||||||
this.isShowRemark = remark.status === '1'
|
this.isShowRemark = remark.status === '1'
|
||||||
this.remark = remark.defaultValue || ''
|
this.remark = remark.defaultValue || ''
|
||||||
|
this.address = uni.getStorageSync('address').address || ''
|
||||||
|
this.weather = uni.getStorageSync('address').weather || ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
deep: true
|
deep: true
|
||||||
@@ -75,7 +76,23 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
created () {
|
created () {
|
||||||
this.configList = JSON.parse(JSON.stringify(this.config))
|
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()
|
||||||
|
}
|
||||||
|
if (v.fieldType === '6') {
|
||||||
|
v.defaultValue = this.$dayjs().format('HH:mm')
|
||||||
|
}
|
||||||
|
|
||||||
|
return v
|
||||||
|
})
|
||||||
this.date = this.$dayjs(new Date).format('YYYY-MM-DD')
|
this.date = this.$dayjs(new Date).format('YYYY-MM-DD')
|
||||||
this.time = this.$dayjs().format('HH:mm')
|
this.time = this.$dayjs().format('HH:mm')
|
||||||
|
|
||||||
@@ -85,8 +102,6 @@
|
|||||||
this.week = new Date().getDay()
|
this.week = new Date().getDay()
|
||||||
}, 1000)
|
}, 1000)
|
||||||
|
|
||||||
// this.getLocation()
|
|
||||||
|
|
||||||
uni.$on('change', e => {
|
uni.$on('change', e => {
|
||||||
this.configList = e
|
this.configList = e
|
||||||
})
|
})
|
||||||
@@ -97,24 +112,6 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(['injectJWeixin']),
|
|
||||||
|
|
||||||
getLocation () {
|
|
||||||
this.injectJWeixin(['getLocation']).then(res => {
|
|
||||||
wx.getLocation({
|
|
||||||
type: 'wgs84',
|
|
||||||
success: function (res) {
|
|
||||||
var lat = res.latitude
|
|
||||||
var lng = res.longitude
|
|
||||||
console.log(lat, lng)
|
|
||||||
},
|
|
||||||
error: res => {
|
|
||||||
console.log(res)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
linkTo (url) {
|
linkTo (url) {
|
||||||
uni.setStorageSync('waterConfig', this.configList)
|
uni.setStorageSync('waterConfig', this.configList)
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
week: '',
|
week: '',
|
||||||
timer: null,
|
timer: null,
|
||||||
name: '',
|
name: '',
|
||||||
weather: '晴转多云',
|
weather: '',
|
||||||
title: '巡检水印',
|
title: '巡检水印',
|
||||||
configList: [],
|
configList: [],
|
||||||
matters: '',
|
matters: '',
|
||||||
@@ -87,6 +87,7 @@
|
|||||||
this.name = name.defaultValue || ''
|
this.name = name.defaultValue || ''
|
||||||
this.date = date.defaultValue || this.$dayjs(new Date).format('YYYY-MM-DD')
|
this.date = date.defaultValue || this.$dayjs(new Date).format('YYYY-MM-DD')
|
||||||
this.time = time.defaultValue || this.$dayjs().format('HH:mm')
|
this.time = time.defaultValue || this.$dayjs().format('HH:mm')
|
||||||
|
this.weather = uni.getStorageSync('address').weather || ''
|
||||||
this.matters = matters.defaultValue || ''
|
this.matters = matters.defaultValue || ''
|
||||||
this.week = date.defaultValue ? this.$dayjs(date.defaultValue).day() : new Date().getDay()
|
this.week = date.defaultValue ? this.$dayjs(date.defaultValue).day() : new Date().getDay()
|
||||||
}
|
}
|
||||||
@@ -104,16 +105,13 @@
|
|||||||
if (v.fieldType === '6') {
|
if (v.fieldType === '6') {
|
||||||
v.defaultValue = this.$dayjs().format('HH:mm')
|
v.defaultValue = this.$dayjs().format('HH:mm')
|
||||||
}
|
}
|
||||||
|
if (v.fieldType === '2') {
|
||||||
|
v.defaultValue = uni.getStorageSync('address').weather || ''
|
||||||
|
}
|
||||||
|
|
||||||
return v
|
return v
|
||||||
})
|
})
|
||||||
|
|
||||||
// this.timer = setInterval(() => {
|
|
||||||
// this.date = this.$dayjs().format('YYYY-MM-DD')
|
|
||||||
// this.time = this.$dayjs().format('HH:mm')
|
|
||||||
// this.week = new Date().getDay()
|
|
||||||
// }, 1000)
|
|
||||||
|
|
||||||
uni.$on('change', e => {
|
uni.$on('change', e => {
|
||||||
this.configList = e
|
this.configList = e
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -66,6 +66,7 @@
|
|||||||
const remark = v.filter(v => v.type === '4')[0]
|
const remark = v.filter(v => v.type === '4')[0]
|
||||||
this.isShowRemark = remark.status === '1'
|
this.isShowRemark = remark.status === '1'
|
||||||
this.remark = remark.defaultValue || ''
|
this.remark = remark.defaultValue || ''
|
||||||
|
this.address = uni.getStorageSync('address').address || ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
deep: true
|
deep: true
|
||||||
@@ -74,10 +75,15 @@
|
|||||||
|
|
||||||
created () {
|
created () {
|
||||||
this.configList = JSON.parse(JSON.stringify(this.config)).map(v => {
|
this.configList = JSON.parse(JSON.stringify(this.config)).map(v => {
|
||||||
|
if (v.fieldType === '3') {
|
||||||
|
v.defaultValue = uni.getStorageSync('address').address || ''
|
||||||
|
}
|
||||||
|
|
||||||
if (v.fieldType === '7') {
|
if (v.fieldType === '7') {
|
||||||
v.defaultValue = this.$dayjs().format('YYYY-MM-DD')
|
v.defaultValue = this.$dayjs().format('YYYY-MM-DD')
|
||||||
this.week = new Date().getDay()
|
this.week = new Date().getDay()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (v.fieldType === '6') {
|
if (v.fieldType === '6') {
|
||||||
v.defaultValue = this.$dayjs().format('HH:mm')
|
v.defaultValue = this.$dayjs().format('HH:mm')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,6 +62,14 @@
|
|||||||
configList: {
|
configList: {
|
||||||
handler: function (v) {
|
handler: function (v) {
|
||||||
if (v.length) {
|
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
|
deep: true
|
||||||
@@ -70,24 +78,26 @@
|
|||||||
|
|
||||||
created () {
|
created () {
|
||||||
this.configList = JSON.parse(JSON.stringify(this.config)).map(v => {
|
this.configList = JSON.parse(JSON.stringify(this.config)).map(v => {
|
||||||
|
if (v.fieldType === '3') {
|
||||||
|
v.defaultValue = uni.getStorageSync('address').address || ''
|
||||||
|
}
|
||||||
|
|
||||||
if (v.fieldType === '7') {
|
if (v.fieldType === '7') {
|
||||||
v.defaultValue = this.$dayjs().format('YYYY-MM-DD')
|
v.defaultValue = this.$dayjs().format('YYYY-MM-DD')
|
||||||
this.week = new Date().getDay()
|
this.week = new Date().getDay()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (v.fieldType === '6') {
|
if (v.fieldType === '6') {
|
||||||
v.defaultValue = this.$dayjs().format('HH:mm')
|
v.defaultValue = this.$dayjs().format('HH:mm')
|
||||||
}
|
}
|
||||||
|
|
||||||
return v
|
return v
|
||||||
})
|
})
|
||||||
|
|
||||||
this.date = this.$dayjs(new Date).format('YYYY-MM-DD')
|
this.date = this.$dayjs(new Date).format('YYYY-MM-DD')
|
||||||
this.time = this.$dayjs().format('HH:mm')
|
this.time = this.$dayjs().format('HH:mm')
|
||||||
this.week = new Date().getDay()
|
this.week = new Date().getDay()
|
||||||
|
|
||||||
this.timer = setInterval(() => {
|
|
||||||
this.time = this.$dayjs().format('HH:mm')
|
|
||||||
}, 1000)
|
|
||||||
|
|
||||||
uni.$on('change', e => {
|
uni.$on('change', e => {
|
||||||
this.configList = e
|
this.configList = e
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -74,7 +74,11 @@
|
|||||||
this.isShowAddress = address.status === '1'
|
this.isShowAddress = address.status === '1'
|
||||||
this.isShowDate = date.status === '1'
|
this.isShowDate = date.status === '1'
|
||||||
this.isShowTime = time.status === '1'
|
this.isShowTime = time.status === '1'
|
||||||
this.title = title.title || ''
|
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
|
deep: true
|
||||||
@@ -83,6 +87,10 @@
|
|||||||
|
|
||||||
created () {
|
created () {
|
||||||
this.configList = JSON.parse(JSON.stringify(this.config)).map(v => {
|
this.configList = JSON.parse(JSON.stringify(this.config)).map(v => {
|
||||||
|
if (v.fieldType === '3') {
|
||||||
|
v.defaultValue = uni.getStorageSync('address').address || ''
|
||||||
|
}
|
||||||
|
|
||||||
if (v.fieldType === '7') {
|
if (v.fieldType === '7') {
|
||||||
v.defaultValue = this.$dayjs().format('YYYY-MM-DD')
|
v.defaultValue = this.$dayjs().format('YYYY-MM-DD')
|
||||||
this.week = new Date().getDay()
|
this.week = new Date().getDay()
|
||||||
@@ -93,14 +101,10 @@
|
|||||||
|
|
||||||
return v
|
return v
|
||||||
})
|
})
|
||||||
|
|
||||||
this.date = this.$dayjs(new Date).format('YYYY-MM-DD')
|
this.date = this.$dayjs(new Date).format('YYYY-MM-DD')
|
||||||
this.time = this.$dayjs().format('HH:mm')
|
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()
|
this.week = new Date().getDay()
|
||||||
}, 1000)
|
|
||||||
|
|
||||||
uni.$on('change', e => {
|
uni.$on('change', e => {
|
||||||
this.configList = e
|
this.configList = e
|
||||||
|
|||||||
@@ -109,6 +109,7 @@
|
|||||||
this.gridName = gridName.defaultValue || ''
|
this.gridName = gridName.defaultValue || ''
|
||||||
this.serviceName = serviceName.defaultValue || ''
|
this.serviceName = serviceName.defaultValue || ''
|
||||||
this.text = text.defaultValue || ''
|
this.text = text.defaultValue || ''
|
||||||
|
this.address = uni.getStorageSync('address').address || ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
deep: true
|
deep: true
|
||||||
@@ -116,7 +117,13 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
created () {
|
created () {
|
||||||
this.configList = JSON.parse(JSON.stringify(this.config))
|
this.configList = JSON.parse(JSON.stringify(this.config)).map(v => {
|
||||||
|
if (v.fieldType === '3') {
|
||||||
|
v.defaultValue = uni.getStorageSync('address').address || ''
|
||||||
|
}
|
||||||
|
|
||||||
|
return v
|
||||||
|
})
|
||||||
this.date = this.$dayjs(new Date).format('YYYY-MM-DD')
|
this.date = this.$dayjs(new Date).format('YYYY-MM-DD')
|
||||||
this.time = this.$dayjs().format('HH:mm')
|
this.time = this.$dayjs().format('HH:mm')
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="Watermark7" @click="linkTo('./WatermarkConfig')">
|
<div class="Watermark7" @click="linkTo('./WatermarkConfig')">
|
||||||
<image src="../../images/hjws.png" />
|
<image src="../../images/hjws.png" />
|
||||||
<h2>{{ title }}</h2>
|
<h2 v-if="isShowTitle">{{ title }}</h2>
|
||||||
<div class="middle">
|
<div class="middle">
|
||||||
<div class="top">
|
<div class="top">
|
||||||
<h2>{{ time }}</h2>
|
<h2>{{ time }}</h2>
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="bottom">{{ date }} {{ weekCn }}</div>
|
<div class="bottom">{{ date }} {{ weekCn }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="bottom" v-if="isShowAddress">{{ address }}</div>
|
<div class="bottom" v-show="isShowAddress">{{ address }}</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -24,9 +24,10 @@
|
|||||||
time: '',
|
time: '',
|
||||||
title: '',
|
title: '',
|
||||||
week: '',
|
week: '',
|
||||||
weather: '晴转多云',
|
weather: '',
|
||||||
address: '武汉市·绿地蓝海国际A座',
|
address: '',
|
||||||
timer: null,
|
timer: null,
|
||||||
|
isShowTitle: true,
|
||||||
isShowAddress: true,
|
isShowAddress: true,
|
||||||
configList: []
|
configList: []
|
||||||
}
|
}
|
||||||
@@ -65,7 +66,10 @@
|
|||||||
const address = v.filter(v => v.type === '3')[0]
|
const address = v.filter(v => v.type === '3')[0]
|
||||||
const title = v.filter(v => v.type === '5')[0]
|
const title = v.filter(v => v.type === '5')[0]
|
||||||
this.isShowAddress = address.status === '1'
|
this.isShowAddress = address.status === '1'
|
||||||
|
this.isShowTitle = title.status === '1'
|
||||||
this.title = title.defaultValue || ''
|
this.title = title.defaultValue || ''
|
||||||
|
this.address = uni.getStorageSync('address').address || ''
|
||||||
|
this.weather = uni.getStorageSync('address').weather || ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
deep: true
|
deep: true
|
||||||
@@ -74,6 +78,12 @@
|
|||||||
|
|
||||||
created () {
|
created () {
|
||||||
this.configList = JSON.parse(JSON.stringify(this.config)).map(v => {
|
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') {
|
if (v.fieldType === '7') {
|
||||||
v.defaultValue = this.$dayjs().format('YYYY-MM-DD')
|
v.defaultValue = this.$dayjs().format('YYYY-MM-DD')
|
||||||
this.week = new Date().getDay()
|
this.week = new Date().getDay()
|
||||||
@@ -86,12 +96,7 @@
|
|||||||
})
|
})
|
||||||
this.date = this.$dayjs(new Date).format('YYYY-MM-DD')
|
this.date = this.$dayjs(new Date).format('YYYY-MM-DD')
|
||||||
this.time = this.$dayjs().format('HH:mm')
|
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()
|
this.week = new Date().getDay()
|
||||||
}, 1000)
|
|
||||||
|
|
||||||
uni.$on('change', e => {
|
uni.$on('change', e => {
|
||||||
this.configList = e
|
this.configList = e
|
||||||
|
|||||||
Reference in New Issue
Block a user