地图页

This commit is contained in:
何嘉峣 2022-10-20 17:51:09 +08:00
parent 6e81762fbb
commit 66d74d87cb
10 changed files with 44 additions and 81 deletions

27
app.js
View File

@ -10,7 +10,6 @@ App({
wx.login({
success: res => {
console.log(res);
<<<<<<< HEAD
// wx.request({
// url: 'https://www.umayle.com/weixin_api/API/Wx/User/GetUserInfo.ashx?appName=Inland&code='+res.code,
// method: 'POST',
@ -33,32 +32,6 @@ App({
// // url:'/pages/register/register'
// })
// }, 2000);
=======
wx.request({
// url: 'https://www.umayle.com/weixin_api/API/Wx/User/GetUserInfo.ashx?appName=Inland&code='+res.code,
url: ''+res.code,
method: 'POST',
success:(_res)=>{
console.log(_res);
let openId = _res.data.openid;
this.globalData.openId = openId
console.log('openid',openId);
wx.request({
// url: 'https://www.umayle.com/inland/Api/GetUserInfo.ashx?openId='+openId,
url: ''+openId,
method: 'POST',
success:(_res_)=>{
console.log(_res_,',,,res');
this.globalData.userInfo = _res_.data.data
if(_res_.data.code == 0 && _res_.data.message == '获取成功'){
//跳转到列表页面
setTimeout(() => {
wx.redirectTo({
url:'/pages/list/list'
// url:'/pages/register/register'
})
}, 2000);
>>>>>>> cdc45140f836a5564ba6d4f94c3e4d7e23d3df72
// }else{
// //跳转到注册页面

View File

@ -1,21 +1,10 @@
{
"pages": [
<<<<<<< HEAD
"pages/map/map",
"pages/start/start",
"pages/index/index",
"pages/list/list"
=======
"pages/list/list",
"pages/item/item",
"pages/start/start",
"pages/index/index"
>>>>>>> cdc45140f836a5564ba6d4f94c3e4d7e23d3df72
],
"plugins": {
"routePlan": {

View File

@ -22,7 +22,6 @@ Page({
},
onLoad(options) {
if (wx.getUserProfile) {
<<<<<<< HEAD
// let url = 'https://www.umayle.com/inland/dist/index.html?openId='+options.openId+'&page='+options.page;
// console.log(url);
// this.setData({
@ -31,19 +30,6 @@ Page({
// url: url,
// canIUseGetUserProfile: true
// })
=======
//https://download-1300932214.cos.ap-nanjing.myqcloud.com/inlandVessel/dist/index.html
//let url = 'https://download-1300932214.cos.ap-nanjing.myqcloud.com/inlandVessel/dist/index.html?openId='+options.openId+'&page='+options.page;
// let url = 'https://www.umayle.com/inland/dist/index.html?openId='+options.openId+'&page='+options.page;
let url = ''+options.openId+'&page='+options.page;
console.log(url);
this.setData({
openId: options.openId,
page: options.page,
url: url,
canIUseGetUserProfile: true
})
>>>>>>> cdc45140f836a5564ba6d4f94c3e4d7e23d3df72
}
},
getUserProfile(e) {

View File

@ -30,13 +30,13 @@ Page({
page: a,
})
},
// changeNext:function () {
// setTimeout(() => {
// wx.redirectTo({
// url:'/pages/item/item'
// })
// }, 2000);
// },
changeNext:function () {
setTimeout(() => {
wx.redirectTo({
url:'/pages/item/item'
})
}, 2000);
},
onLoad: function (options) { // options 为 board页传来的参数
const _this = this;
// 拼接请求url

BIN
pages/map/images/icon1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
pages/map/images/qiao.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -50,7 +50,14 @@ Page({
}
});
},
// 跳转列表
handleRouter(){
console.log('aaaa');
wx.redirectTo({
url:'/pages/list/list'
})
},
/**
* 生命周期函数--监听页面加载
*/
@ -60,7 +67,7 @@ Page({
type: 'wgs84',
altitude: false,
success: (result) => {
// that.getOnlineDistrict(result.latitude, result.longitude)
that.getOnlineDistrict(result.latitude, result.longitude)
var obj = {
latitude:result.latitude,longitude:result.longitude
}
@ -82,9 +89,9 @@ Page({
},
success: function (res) {
that.setData({
district:res.result.address_component.city
// district:res.result.address_component.city
})
console.log(this.district,'asda');
console.log(res,'asda');
}
})
},

View File

@ -3,18 +3,8 @@
<view class="mapTop">
<view class="inputVal">
<input class="weui-input" placeholder-class="phcolor" value="{{inputVal}}" bindinput="handlePos" placeholder="输入关键字查询"/>
<!--关键词输入提示列表渲染-->
<view wx:for="{{suggestion}}" wx:key="index">
<!--绑定回填事件-->
<view>
<!--根据需求渲染相应数据-->
<!--渲染地址title-->
<view style="text-align:center;" bindtap="backfill" id="{{index}}">{{item.title}}</view>
<!--渲染详细地址-->
<view style="font-size:12px;color:#666;text-align:center;">{{item.addr}}</view>
</view>
</view>
<van-icon class="el-icon-microphone"></van-icon>
<image style="width: 20px; height: 20px;margin-left: 10rpx; margin-top: 5rpx;" src="./images/icon1.png"></image>
</view>
<map id="myMap"
latitude="{{district.latitude}}"
@ -24,12 +14,12 @@
<view class="info">
<view class="top">
<view class="image">
<image mode="aspectFill" src=""></image>
<image mode="aspectFill" src="./images/qiao.png"></image>
</view>
<view class="title">
<view class="text">
<span style="font-size:15px;font-weight: 600;">董滨枢纽小桥</span>
<view style="display: flex;align-items: center">
<view style="display: flex;align-items: center" bindtap='handleRouter'>
<span style="font-size:14px;color:rgb(105, 131, 255)">详情</span>
<van-icon name="arrow" style="font-size:14px;color:rgb(105, 131, 255);margin: 8rpx 0 0 5rpx;"/>
</view>
@ -50,4 +40,18 @@
最大预警级别:红色预警。
</view>
</view>
</view>
<!--关键词输入提示列表渲染-->
<view class="listPos">
<view wx:for="{{suggestion}}" wx:key="index" >
<!--绑定回填事件-->
<view>
<!--根据需求渲染相应数据-->
<!--渲染地址title-->
<view style="text-align:center;" bindtap="backfill" id="{{index}}">{{item.title}}</view>
<!--渲染详细地址-->
<view style="font-size:12px;color:#666;text-align:center;">{{item.addr}}</view>
</view>
</view>
</view>

View File

@ -89,3 +89,11 @@
line-height: 40rpx;
/* width: calc(fit-content + 10rpx) ; */
}
.listPos{
width: 100%;
height: auto;
position: fixed;
top: 100rpx;
left: 0;
background-color: #ffffff;
}

View File

@ -56,11 +56,7 @@
"compileType": "miniprogram",
"libVersion": "2.19.4",
"appid": "wxa9783cf92ee95a72",
<<<<<<< HEAD
"projectname": "bridgespace-app",
=======
"projectname": "inlandVessel-app",
>>>>>>> cdc45140f836a5564ba6d4f94c3e4d7e23d3df72
"condition": {},
"editorSetting": {
"tabIndent": "insertSpaces",