乡村相册 接口对接

This commit is contained in:
yanran200730
2022-05-19 14:43:42 +08:00
parent a718ef4273
commit e2fa55065e
9 changed files with 407 additions and 150 deletions

View File

@@ -80,13 +80,15 @@
return {
countPhotoNo: '',
countPhotographer: '',
list: []
list: [],
msgInfo: {}
}
},
mounted () {
this.getCountPhotoNo()
this.getAlbumList()
this.getMsgList()
},
methods: {
@@ -109,6 +111,14 @@
})
},
getMsgList () {
this.$http.post('/api/sysmessage/latestnews').then(res => {
if (res.code === 0) {
this.msgInfo = res.data
}
})
},
getAlbumList () {
this.$http.post('/api/appalbum/list', null, {
parmas: {

View File

@@ -6,22 +6,30 @@
</div>
<div class="info">
<p>{{ date }} {{ weekCn }}</p>
<p>武汉市·绿地蓝海国际A座</p>
<p> 7</p>
<p>{{ address }}</p>
<p v-if="isShowWeather">{{ weather }}</p>
</div>
<div class="text">#这是一条备注信息</div>
<div class="text" v-if="isShowRemark">{{ remark }}</div>
</div>
</template>
<script>
import {mapActions} from 'vuex'
import { mapActions } from 'vuex'
export default {
props: ['config'],
data () {
return {
date: '',
time: '',
week: '',
timer: null
weather: '晴转多云',
remark: '',
address: '武汉市·绿地蓝海国际A座',
timer: null,
configList: [],
isShowWeather: false,
isShowRemark: false
}
},
@@ -51,7 +59,24 @@
}
},
watch: {
configList: {
handler: function (v) {
if (v.length) {
const weather = v.filter(v => v.type === '2')[0]
const remark = v.filter(v => v.type === '4')[0]
console.log(v)
this.isShowWeather = weather.status === '1'
this.isShowRemark = remark.status === '1'
this.remark = remark.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,17 +86,12 @@
this.week = new Date().getDay()
}, 1000)
this.injectJWeixin(['getLocation']).then(res => {
console.log(res)
wx.getLocation({
type: 'wgs84',
success: function (res) {
var latitude = res.latitude
var longitude = res.longitude
var speed = res.speed
var accuracy = res.accuracy
}
});
this.getLocation()
uni.$on('change', e => {
this.configList = [
...e
]
})
},
@@ -82,21 +102,35 @@
methods: {
...mapActions(['injectJWeixin']),
getLocation () {
uni.getLocation({
type: 'wgs84',
success: res => {
console.log(res)
this.$http.get('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 => {
this.injectJWeixin(['getLocation']).then(res => {
console.log(res)
wx.getLocation({
type: 'wgs84',
success: function (res) {
console.log(res)
})
},
fail: error => {
console.log(error)
}
var latitude = res.latitude
var longitude = res.longitude
var speed = res.speed
var accuracy = res.accuracy
}
})
})
// uni.getLocation({
// type: 'wgs84',
// success: res => {
// console.log(res)
// this.$http.get('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)
// })
// },
// fail: error => {
// console.log(error)
// }
// })
},
linkTo (url) {
uni.setStorageSync('waterConfig', this.configList)
uni.navigateTo({
url
})
@@ -115,6 +149,7 @@
min-width: 274px;
height: 48px;
line-height: 48px;
margin-top: 32px;
padding: 0 16px;
font-size: 28px;
background: linear-gradient(270deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.2) 100%);
@@ -146,7 +181,7 @@
.info {
line-height: 40px;
margin: 32px 0;
margin: 32px 0 0;
padding-left: 22px;
border-left: 6px solid #F8BC58;