Commit 5cb3e2a7 authored by 高宇's avatar 高宇

停车服务子页面

parent e3842db1
......@@ -17,7 +17,7 @@
<view style="display: flex;flex-direction: column;">
<span class="twotitle">{{res.name}}</span>
<span class="threetitle" style="white-space: normal;max-width: 60vw;">{{res.address}}</span>
<span class="threetitle">1126.6652km</span>
<span class="threetitle">{{distance}}km</span>
</view>
</view>
</u-radio>
......@@ -40,11 +40,16 @@
city: '北京市',
value: '',
shopMessage: [],
distance: '' // 距离
distance: 0, // 距离
};
},
onShow() {
this.showFirstAddress()
this.getLocation()
this.$nextTick(()=>{
this.showFirstAddress()
},300)
},
methods: {
// 选中某个单选框时,由radio时触发
......@@ -57,18 +62,44 @@
},
//显示默认的商圈
showFirstAddress() {
this.getLocation()
this.$u.get('/city/queryCity').then(res => {
this.city = res[0].name
this.$u.get('/shop/tenant/mobile/list?cityId=' + res[0].id).then(res => {
this.list = res
this.value = this.list[0].name
const longitude = ''
const dimension = ''
console.log("sss", this.list)
this.getLocation()
this.$u.get('/city/queryCity').then(res => {
this.city = res[0].name
this.$u.get('/shop/tenant/mobile/list?cityId=' + res[0].id).then(res => {
this.list = res
this.value = this.list[0].name
console.log('value',this.list[0])
var latitude = this.list[0].latitude.split(',')
console.log('latitude',latitude)
const longitude = Number(latitude[0])
const dimension = Number(latitude[1])
var currentlo = ''
var currentla = ''
var distance = ''
const that = this
uni.getStorage({
key: 'currentlo',
success: function (res) {
console.log('data',res.data);
currentlo = res.data[0]
currentla = res.data[1]
console.log('currentla', currentla)
console.log('currentlo',currentlo)
console.log('distance',that.distance)
that.distance = that.getDistance(currentla,currentlo,dimension,currentlo)
console.log('lastdistance',that.distance)
}
});
// that.distance = that.getDistance(this.currentlo,this.currentla,this.thlongitude,this.dimension)
// console.log('distance',that.distance)
console.log("sss", this.list)
})
// console.log("this.addressList",this.addressList)
})
// console.log("this.addressList",this.addressList)
})
},
// 城市数据
showaddress() {
......@@ -99,11 +130,22 @@
},
//获取当前位置
getLocation() {
const that = this
uni.getLocation({
type: 'wgs84',
success: function(res) {
console.log('当前位置的经度:' + res.longitude);
this.currentlo = res.longitude
console.log("aaa",this.currentlo)
console.log('当前位置的纬度:' + res.latitude);
this.currentla = res.latitude
var list = []
list.push(this.currentlo)
list.push(this.currentla)
uni.setStorage({
key: 'currentlo',
data: list
});
},
fail(err) {
console.log("错误信息", err)
......
......@@ -16,7 +16,7 @@
</view>
<!-- 请选择店铺 -->
<view class="list">
<view class="list-trim">
<view class="list-trim" @click="goshopList">
<view class="left">
<view class="trim-title">请选择店铺</view>
</view>
......@@ -49,6 +49,13 @@
baseURL: 'http://192.144.239.97:20043/file/',
img: 'http://192.144.239.97:20043/file/banner/20230605/6F749760FE1148369C4081EBD3248C6C.jpeg',
}
},
methods: {
goshopList(){
uni.navigateTo({
url:'/homePage/parkingService/plateManagement/index'
})
}
}
}
</script>
......
<template>
<view class="choose">
<u-search placeholder="输入停车场名称" bg-color="#eee" :show-action="false" input-align="center"></u-search>
<!-- <u-search placeholder="输入停车场名称" bg-color="#eee" :show-action="false" input-align="center"></u-search> -->
<view>
<u-radio-group v-model="value" @change="radioGroupChange" iconPlacement="right">
<u-radio @change="radioChange" v-for="(item, index) in list" :key="index" :name="item.name"
......
......@@ -22,7 +22,7 @@
<view>
<image :src="cardImg" class="cardImg" ></image>
</view>
<view class="bottom-button">
<view class="bottom-button" @click="goPlateManagement">
<view class="button">添加车牌</view>
</view>
</view>
......@@ -36,13 +36,13 @@
</view>
</view>
<!-- 车牌管理-->
<view class="itemButton">
<view class="itemButton" @click="goPlateManagement">
<image :src="icon" class="iconImg"></image>
<span class="test">车牌管理</span>
</view>
<!-- 停车记录 -->
<view class="itemButton" @click="goRecord">
<image :src="icon" class="iconImg"></image>
<image :src="icon" class="iconImg" ></image>
<span class="test">停车记录</span>
</view>
</view>
......@@ -94,10 +94,15 @@
url:'/homePage/parkingService/choose/index'
})
},
goRecord(){
goPlateManagement(){
uni.navigateTo({
url:'/homePage/parkingService/plateManagement/index'
})
})
},
goRecord(){
uni.navigateTo({
url:'/homePage/parkingService/ParkingRecord/index'
})
}
}
};
......
......@@ -239,6 +239,18 @@
"navigationBarTitleText": "拍摄小票"
}
},
{
"path": "filmReceipt/pointsApplication/index",
"style": {
"navigationBarTitleText": "商圈积分快速申请"
}
},
{
"path": "filmReceipt/shopList/index",
"style": {
"navigationBarTitleText": "店铺列表"
}
},
{
"path": "shop/index",
"style": {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment