@ -0,0 +1,2 @@
|
||||
project.config.json
|
||||
config.js
|
@ -1,5 +0,0 @@
|
||||
#include<stdio.h>
|
||||
|
||||
typedef struct {
|
||||
|
||||
};
|
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2018 莞香广科
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
@ -0,0 +1,25 @@
|
||||
{
|
||||
"pages": [
|
||||
"pages/index",
|
||||
"pages/map/index",
|
||||
"pages/map/details",
|
||||
"pages/map/polyline",
|
||||
"pages/map/search",
|
||||
"pages/web-views/web-views"
|
||||
],
|
||||
"permission": {
|
||||
"scope.userLocation": {
|
||||
"desc": "你的位置信息将用于辅助规划路线"
|
||||
}
|
||||
},
|
||||
"window": {
|
||||
"backgroundTextStyle": "light",
|
||||
"navigationBarBackgroundColor": "#079df2",
|
||||
"navigationBarTitleText": "校园导览",
|
||||
"navigationBarTextStyle": "white"
|
||||
},
|
||||
"sitemapLocation": "sitemap.json",
|
||||
"navigateToMiniProgramAppIdList": [
|
||||
"wx8afedfde046e5916"
|
||||
]
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
/**app.wxss**/
|
||||
page{
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
.container {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 200rpx 0;
|
||||
box-sizing: border-box;
|
||||
}
|
@ -1,78 +0,0 @@
|
||||
// pages/canteen/canteen.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
},
|
||||
goEvaluate:function(options){
|
||||
|
||||
wx.navigateTo({
|
||||
url: '../evaluate/evaluate'
|
||||
})
|
||||
},
|
||||
goCwindow:function(options){
|
||||
|
||||
wx.navigateTo({
|
||||
url: '../cwindow/cwindow'
|
||||
})
|
||||
},
|
||||
})
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
<!--pages/canteen/canteen.wxml-->
|
||||
<view class = "container">
|
||||
<view class = "word">
|
||||
<text>窗口1:\n
|
||||
窗口详情:\n
|
||||
评分:x.x</text>
|
||||
</view>
|
||||
<button size="mini" type="primary"class="tapbtn1" bindtap="goEvaluate">评价菜品</button>
|
||||
<button size="mini" type="default"class="tapbtn2" bindtap="goCwindow">查看评价</button>
|
||||
</view>
|
||||
<view class="divLineX"></view>
|
||||
<!--pages/canteen/canteen.wxml-->
|
||||
<view class = "container">
|
||||
<view class = "word">
|
||||
<text>窗口:2\n
|
||||
窗口详情:\n
|
||||
评分:</text>
|
||||
</view>
|
||||
<button size="mini" type="primary"class="tapbtn1" bindtap="goEvaluate">评价菜品</button>
|
||||
<button size="mini" type="default"class="tapbtn2" bindtap="goCwindow">查看评价</button>
|
||||
</view>
|
||||
<view class="divLineX"></view>
|
||||
|
||||
<!--pages/canteen/canteen.wxml-->
|
||||
<view class = "container">
|
||||
<view class = "word">
|
||||
<text>窗口3:\n
|
||||
窗口详情:\n
|
||||
评分:</text>
|
||||
</view>
|
||||
<button size="mini" type="primary"class="tapbtn1" bindtap="goEvaluate">评价菜品</button>
|
||||
<button size="mini" type="default"class="tapbtn2" bindtap="goCwindow">查看评价</button>
|
||||
</view>
|
||||
<view class="divLineX"></view>
|
||||
|
||||
|
@ -1,37 +0,0 @@
|
||||
/* pages/canteen/canteen.wxss */
|
||||
.tapbtn1{
|
||||
margin-bottom: 20rpx;
|
||||
background-color: #FFFFFF;
|
||||
width:200rpx;
|
||||
height: 60rpx;
|
||||
border-radius: 100rpx;
|
||||
text-align: top;
|
||||
justify-content: center;
|
||||
font-size: 20rpx;
|
||||
|
||||
|
||||
}
|
||||
.tapbtn2{
|
||||
margin-bottom: 20rpx;
|
||||
background-color: #FFFFFF;
|
||||
width:200rpx;
|
||||
height: 60rpx;
|
||||
border-radius: 100rpx;
|
||||
text-align: center;
|
||||
justify-content: center;
|
||||
font-size: 20rpx;
|
||||
|
||||
|
||||
}
|
||||
.container{
|
||||
display:flex;
|
||||
}
|
||||
.word{
|
||||
display:flexbox;
|
||||
margin-right: 13em;
|
||||
}
|
||||
.divLineX{
|
||||
background: #E4E6ED;
|
||||
width: 100%;
|
||||
height: 1rpx;
|
||||
}
|
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 18 KiB |
@ -1 +0,0 @@
|
||||
真他妈牛逼
|
@ -0,0 +1,32 @@
|
||||
//获取应用实例
|
||||
var app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
images: app.globalData.introduce.images,
|
||||
shortName: app.globalData.introduce.shortName,
|
||||
mapCopyright: app.globalData.introduce.mapCopyright,
|
||||
imgCDN: app.imgCDN
|
||||
},
|
||||
onLoad: function (options) {
|
||||
wx.setNavigationBarTitle({
|
||||
title: app.globalData.introduce.name
|
||||
})
|
||||
},
|
||||
onShareAppMessage: function (res) {
|
||||
if (res.from === 'button') {
|
||||
// 来自页面内转发按钮
|
||||
console.log(res.target)
|
||||
}
|
||||
return {
|
||||
title: app.globalData.introduce.name + ' - 校园导览',
|
||||
path: '/pages/index',
|
||||
imageUrl: app.imgCDN + app.globalData.introduce.share,
|
||||
success: function (res) {
|
||||
// 转发成功
|
||||
},
|
||||
fail: function (res) {
|
||||
// 转发失败
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarBackgroundColor": "#0c101b"
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
<view class="page" style="background: url('{{imgCDN}}{{images}}'); background-size: 100% 100%;">
|
||||
<view class="button_container">
|
||||
<navigator class="button" url="map/details">
|
||||
<text>{{shortName}}简介</text>
|
||||
</navigator>
|
||||
<navigator class="button" url="map/index">
|
||||
<text>逛逛{{shortName}}</text>
|
||||
</navigator>
|
||||
</view>
|
||||
<view class="copyright">
|
||||
<navigator target="miniProgram" app-id="wx8afedfde046e5916">
|
||||
<text>© 莞香广科</text>
|
||||
</navigator>
|
||||
<navigator url="web-views/web-views?url={{mapCopyright.url}}">
|
||||
<text>{{mapCopyright?"数据版权:"+mapCopyright.name:""}}</text>
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
@ -0,0 +1,44 @@
|
||||
.page {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.button_container {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: row;
|
||||
margin-top: 120px;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.button {
|
||||
width: 145rpx;
|
||||
height: 145rpx;
|
||||
margin: 20px;
|
||||
background-color: rgba(255, 224, 115, 0.9);
|
||||
border-radius: 80rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.button text {
|
||||
width: 55%;
|
||||
align-self: center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.copyright {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
height: 55vh;
|
||||
font-size: 27rpx;
|
||||
text-align: center;
|
||||
line-height: 150%;
|
||||
text-shadow:#000 1rpx 0 0,#000 0 1rpx 0,#000 -1rpx 0 0,#000 0 -1rpx 0;
|
||||
}
|
@ -0,0 +1,107 @@
|
||||
// pages/map/details.js
|
||||
//获取应用实例
|
||||
var app = getApp();
|
||||
Page({
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
tid: 0,
|
||||
bid: 0,
|
||||
building: {
|
||||
img: []//加载中图片地址
|
||||
},
|
||||
imgCDN: app.imgCDN
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
var bid = parseInt(options.bid);
|
||||
var tid = parseInt(options.tid);
|
||||
if (!options.bid || !options.tid){
|
||||
var data = app.globalData.introduce;
|
||||
} else {
|
||||
var data = app.globalData.map[tid].data[bid];
|
||||
}
|
||||
this.setData({
|
||||
bid: bid,
|
||||
tid: tid,
|
||||
building: data
|
||||
});
|
||||
wx.setNavigationBarTitle({
|
||||
title: data.name
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function (res) {
|
||||
var title, path;
|
||||
if (this.data.introduce){
|
||||
title = app.globalData.introduce.name + '校园导览';
|
||||
path = "/pages/map/details";
|
||||
} else {
|
||||
title = this.data.building.name + ' - ' + app.globalData.introduce.name + '校园导览'
|
||||
path = "/pages/map/details?tid=" + this.data.tid + "&bid=" + this.data.bid
|
||||
}
|
||||
if (res.from === 'button') {
|
||||
// 来自页面内转发按钮
|
||||
console.log(res.target)
|
||||
}
|
||||
return {
|
||||
title: title,
|
||||
path: path,
|
||||
imageUrl: app.imgCDN + this.data.building.img[0],
|
||||
success: function (res) {
|
||||
// 转发成功
|
||||
},
|
||||
fail: function (res) {
|
||||
// 转发失败
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
@ -0,0 +1 @@
|
||||
{}
|
@ -0,0 +1,22 @@
|
||||
<!--pages/map/details.wxml-->
|
||||
<view>
|
||||
<swiper class="swiper" indicator-dots="{{building.img.length == 1 ? false : true}}" indicator-active-color="#fff" autoplay="1" interval="3000" duration="500">
|
||||
<block wx:for="{{building.img}}" wx:key="*this">
|
||||
<swiper-item>
|
||||
<image class="swiper-image" src="{{imgCDN}}{{item + '?imageMogr2/thumbnail/1500x/interlace/1/blur/1x0/quality/100|imageslim'}}"> </image>
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
<view class="building">
|
||||
<view class="buildingName">{{building.name}}</view>
|
||||
<navigator class="nav_map" url='polyline?latitude={{building.latitude}}&longitude={{building.longitude}}'>
|
||||
<image src="/img/location.svg"> </image>
|
||||
</navigator>
|
||||
</view>
|
||||
|
||||
<view class="descript">
|
||||
<view class='description'>
|
||||
<rich-text nodes="{{ building.description }}"></rich-text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
@ -0,0 +1,50 @@
|
||||
/* pages/map/details.wxss */
|
||||
|
||||
.description {
|
||||
padding: 40rpx 40rpx;
|
||||
line-height: 30px;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.swiper {
|
||||
height: 40vh;
|
||||
}
|
||||
|
||||
.swiper-image {
|
||||
width: 100%;
|
||||
height:100%;
|
||||
}
|
||||
|
||||
.building {
|
||||
height: 10vh;
|
||||
display: flex;
|
||||
margin: auto 20rpx;
|
||||
}
|
||||
|
||||
.buildingName {
|
||||
margin: auto 15rpx;
|
||||
width: 80%;
|
||||
color: #079df2;
|
||||
font-size: 50rpx;
|
||||
white-space:nowrap;
|
||||
}
|
||||
|
||||
.nav_map {
|
||||
margin: auto 10rpx;
|
||||
}
|
||||
|
||||
.nav_map image {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
}
|
||||
|
||||
.descript {
|
||||
background: #f8f8f8;
|
||||
width: 100%;
|
||||
min-height: 49vh;
|
||||
}
|
||||
|
||||
.descript rich-text {
|
||||
font-size: 30rpx;
|
||||
color: #000;
|
||||
}
|
@ -0,0 +1 @@
|
||||
{}
|
@ -0,0 +1,43 @@
|
||||
<!--pages/map/map.wxml-->
|
||||
<view style="width: 100%;">
|
||||
<scroll-view scroll-x="true">
|
||||
<view class="top-swich" style="width:{{buildlData.length * 120 < windowWidth ? windowWidth: buildlData.length * 120}}rpx;" wx:if="{{!fullscreen}}">
|
||||
<label wx:for="{{buildlData}}" wx:key="id" id="{{index}}" bindtap="changePage" class="top-swich-btn {{isSelectedBuildType == index ? 'active' : ''}}">{{item.name}}
|
||||
</label>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<map longitude="{{longitude}}" latitude="{{latitude}}" scale="{{buildlData[isSelectedBuildType].scale}}" markers="{{buildlData[isSelectedBuildType].data}}" bindmarkertap="markertap" bindregionchange="regionchange" include-points="{{buildlData[isSelectedBuildType].data}}"
|
||||
show-location="{{islocation? 'true': 'false'}}" enable-overlooking="true" enable-traffic="true" enable-3D="true" style="width: auto; height:{{fullscreen ? 94 : 48}}vh;">
|
||||
<cover-view class="controls {{fullscreen ? 'full' : ''}}">
|
||||
<cover-view bindtap="navigateSearch">
|
||||
<cover-image class="img" src="/img/search.png" />
|
||||
</cover-view>
|
||||
<cover-view bindtap="location">
|
||||
<cover-image class="img" src="/img/location.png" />
|
||||
</cover-view>
|
||||
</cover-view>
|
||||
</map>
|
||||
<button bindtap="clickButton">
|
||||
共有{{buildlData[isSelectedBuildType].data.length}}个景观 ◕‿◕
|
||||
</button>
|
||||
<scroll-view scroll-y="true" style="height:{{fullscreen ? 0 : 40}}vh" scroll-top="{{(isSelectedBuild -1 ) * 70}}">
|
||||
<view wx:for="{{buildlData[isSelectedBuildType].data}}" wx:key="id" class="building-item" style="{{isSelectedBuild -1 == index ? 'background-color: #d5d5d5;' : ''}}">
|
||||
<view class="img-view">
|
||||
<navigator class="img" url='details?tid={{isSelectedBuildType}}&bid={{index}}'>
|
||||
<image src="{{imgCDN}}{{item.img[0] + '?imageView2/1/w/240/h/180/q/100|imageslim'}}" mode="aspectFill"> </image>
|
||||
<view class="item">
|
||||
<view class="itemName">
|
||||
{{item.name}}
|
||||
</view>
|
||||
<view class="itemFloor" wx:if="{{item.floor}}">
|
||||
位置:{{item.floor}}
|
||||
</view>
|
||||
</view>
|
||||
</navigator>
|
||||
<navigator class="text" url='polyline?latitude={{item.latitude}}&longitude={{item.longitude}}'>
|
||||
<image src="/img/location.svg"> </image>
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
@ -0,0 +1,101 @@
|
||||
/* pages/map/map.wxss */
|
||||
|
||||
.building-item {
|
||||
height: 50px;
|
||||
border-bottom: 1px solid #e0e0e0;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.top-swich {
|
||||
background-color: #079df2;
|
||||
height: 6vh;
|
||||
color: white;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 0;
|
||||
height: 0;
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.top-swich-btn {
|
||||
background-color: none;
|
||||
letter-spacing: 3rpx;
|
||||
height: 65rpx;
|
||||
color: #fff;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.active {
|
||||
border-bottom: solid white;
|
||||
height: 50rpx;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
button {
|
||||
font-size: 26rpx;
|
||||
height: 6vh;
|
||||
}
|
||||
|
||||
.img-view {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.img {
|
||||
width: 85%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.img image {
|
||||
width: 60px;
|
||||
height: 90%;
|
||||
margin: auto 7rpx;
|
||||
}
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin: auto 0;
|
||||
}
|
||||
|
||||
.itemName {
|
||||
margin: 0 20rpx;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.itemFloor {
|
||||
margin: 0 20rpx;
|
||||
font-size: 28rpx;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
.text {
|
||||
margin: auto 15px;
|
||||
width: 13%;
|
||||
}
|
||||
|
||||
.text image {
|
||||
width: 70rpx;
|
||||
height: 70rpx;
|
||||
}
|
||||
|
||||
.controls {
|
||||
position: relative;
|
||||
top: 65%;
|
||||
left: 85%;
|
||||
/* display: flex; */
|
||||
}
|
||||
|
||||
.controls .img {
|
||||
margin-top: 5px;
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
}
|
||||
|
||||
.full {
|
||||
top: 82%;
|
||||
}
|
@ -0,0 +1,104 @@
|
||||
var app = getApp();
|
||||
var amapFile = require('../../utils/amap-wx.js');
|
||||
Page({
|
||||
data: {
|
||||
latitude: null,
|
||||
longitude: null,
|
||||
markers: [],
|
||||
distance: '',
|
||||
polyline: []
|
||||
},
|
||||
onLoad: function (options) {
|
||||
var _this = this;
|
||||
_this.setData({
|
||||
longitude: app.globalData.longitude,
|
||||
latitude: app.globalData.latitude
|
||||
})
|
||||
_this.routing(options);
|
||||
wx.getLocation({
|
||||
type: 'gcj02',
|
||||
success: function (res) {
|
||||
app.globalData.latitude = res.latitude;
|
||||
app.globalData.longitude = res.longitude;
|
||||
_this.setData({
|
||||
latitude: res.latitude,
|
||||
longitude: res.longitude
|
||||
});
|
||||
_this.routing(options);
|
||||
},
|
||||
fail: function () {
|
||||
console.log("定位失败")
|
||||
wx.showModal({
|
||||
title: '无法使用该功能',
|
||||
content: '请点击右上角在“关于校园导览”设置中给予定位权限',
|
||||
showCancel: false,
|
||||
success: function (res) {
|
||||
wx.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
return;
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
routing: function (options){
|
||||
var _this = this;
|
||||
let distance = Math.abs(_this.data.longitude - options.longitude) + Math.abs(_this.data.latitude - options.latitude)
|
||||
console.log(distance);
|
||||
var myAmapFun = new amapFile.AMapWX({ key: require('../../config.js').key });
|
||||
let routeData = {
|
||||
origin: options.longitude + ',' + options.latitude,
|
||||
destination: _this.data.longitude + ',' + _this.data.latitude,
|
||||
success: function (data) {
|
||||
var points = [];
|
||||
if (data.paths && data.paths[0] && data.paths[0].steps) {
|
||||
var steps = data.paths[0].steps;
|
||||
for (var i = 0; i < steps.length; i++) {
|
||||
var poLen = steps[i].polyline.split(';');
|
||||
for (var j = 0; j < poLen.length; j++) {
|
||||
points.push({
|
||||
longitude: parseFloat(poLen[j].split(',')[0]),
|
||||
latitude: parseFloat(poLen[j].split(',')[1])
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
_this.setData({
|
||||
markers: [{
|
||||
"width": "25",
|
||||
"height": "35",
|
||||
iconPath: "/img/mapicon_end.png",
|
||||
latitude: options.latitude,
|
||||
longitude: options.longitude
|
||||
}, {
|
||||
"width": "25",
|
||||
"height": "35",
|
||||
iconPath: "/img/mapicon_start.png",
|
||||
latitude: _this.data.latitude,
|
||||
longitude: _this.data.longitude
|
||||
}],
|
||||
polyline: [{
|
||||
points: points,
|
||||
color: "#0091ff",
|
||||
width: 6
|
||||
}]
|
||||
});
|
||||
if (data.paths[0] && data.paths[0].distance) {
|
||||
_this.setData({
|
||||
distance: data.paths[0].distance + '米'
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: function (info) {
|
||||
}
|
||||
}
|
||||
if (distance < 0.85) {
|
||||
// getWalkingRoute 步行
|
||||
myAmapFun.getWalkingRoute(routeData)
|
||||
} else {
|
||||
// getDrivingRoute 驾车
|
||||
myAmapFun.getDrivingRoute(routeData)
|
||||
}
|
||||
}
|
||||
})
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "路径规划"
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
<map id="navi_map" longitude="{{longitude}}" latitude="{{latitude}}"
|
||||
scale="14" markers="{{markers}}" polyline="{{polyline}}" include-points="{{markers}}"
|
||||
class="navi_map" show-location enable-overlooking="true" enable-3D="true" enable-traffic="true">
|
||||
|
||||
<cover-view class="distance">{{distance}}</cover-view>
|
||||
</map>
|
||||
|
@ -0,0 +1,17 @@
|
||||
.navi_map {
|
||||
width: auto;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.distance {
|
||||
position: absolute;
|
||||
bottom: 30px;
|
||||
right: 10px;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
text-align: center;
|
||||
padding: 3px 5px 3px 5px;
|
||||
color: #fff;
|
||||
background: #0091ff;
|
||||
border-radius: 5px;
|
||||
}
|
@ -0,0 +1,133 @@
|
||||
// pages/map/search.js
|
||||
//获取应用实例
|
||||
var app = getApp();
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
keyword: null,
|
||||
buildlData: app.globalData.map,
|
||||
showData: null,
|
||||
cursor: 0,
|
||||
imgCDN: app.imgCDN
|
||||
},
|
||||
|
||||
bindSearchInput: function(e) {
|
||||
let showData = new Array();
|
||||
let searchdata = this.data.buildlData;
|
||||
if (e.detail.cursor >= this.data.cursor) {
|
||||
//输入文字
|
||||
let inputData = e.detail.value.replace(/(^\s*)|(\s*$)/g, "")
|
||||
|
||||
if (inputData) {
|
||||
let z = 0,
|
||||
x = 100;
|
||||
for (var b in searchdata) {
|
||||
for (var i in searchdata[b].data) {
|
||||
if (searchdata[b].data[i].name.indexOf(inputData) != -1 || (searchdata[b].data[i].floor && searchdata[b].data[i].floor.indexOf(inputData) != -1)) {
|
||||
let build = searchdata[b].data[i];
|
||||
build.tid = b;
|
||||
build.bid = i;
|
||||
z = z + 1;
|
||||
build.index = z;
|
||||
showData.push(build);
|
||||
} else if (searchdata[b].data[i].description.indexOf(inputData) != -1) {
|
||||
let build = searchdata[b].data[i];
|
||||
build.tid = b;
|
||||
build.bid = i;
|
||||
x = x + 1;
|
||||
build.index = x;
|
||||
showData.push(build);
|
||||
}
|
||||
}
|
||||
}
|
||||
//冒泡排序
|
||||
for (var i = 0; i < showData.length; i++) {
|
||||
for (var j = 0; j < showData.length - i - 1; j++) {
|
||||
if (showData[j].index > showData[j + 1].index) {
|
||||
var temp = showData[j];
|
||||
showData[j] = showData[j + 1];
|
||||
showData[j + 1] = temp;
|
||||
console.log('交换' + showData[j].index + ':' + showData[j + 1].index)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (inputData == 'gxgk') {
|
||||
showData.push({
|
||||
name: "\u839e\u9999\u5e7f\u79d1"
|
||||
})
|
||||
}
|
||||
this.setData({
|
||||
showData: showData
|
||||
});
|
||||
}
|
||||
} else {
|
||||
//删除文字
|
||||
console.log('删除文字')
|
||||
this.setData({
|
||||
showData: null
|
||||
});
|
||||
}
|
||||
this.data.cursor = e.detail.cursor;
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function(options) {},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function() {
|
||||
|
||||
},
|
||||
reset: function() {
|
||||
this.setData({
|
||||
keyword: null
|
||||
});
|
||||
}
|
||||
})
|
@ -0,0 +1 @@
|
||||
{}
|
@ -0,0 +1,35 @@
|
||||
<!--index.wxml-->
|
||||
|
||||
<view class="search">
|
||||
<view class="search-icon">
|
||||
<icon type="search" size="16" color="blue" />
|
||||
</view>
|
||||
<view class="search-form">
|
||||
<form>
|
||||
<input bindinput="bindSearchInput" type="text" name="search" placeholder="请输入景点名称关键词" value="{{keyword}}" style="font-size: 30rpx;" />
|
||||
</form>
|
||||
</view>
|
||||
<view class="search-icon" bindtap="reset">
|
||||
<icon type="cancel" size="16" color="purple" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view wx:for="{{showData}}" wx:key="name" class="building-item">
|
||||
|
||||
<view style="height:100%; display: flex;">
|
||||
<navigator class="img" url='details?tid={{item.tid}}&bid={{item.bid}}'>
|
||||
<image src="{{imgCDN}}{{item.img[0]}}" mode="aspectFill"> </image>
|
||||
<view class="item">
|
||||
<view class="itemName">
|
||||
{{item.name}}
|
||||
</view>
|
||||
<view class="itemFloor" wx:if="{{item.floor}}">
|
||||
{{item.floor}}
|
||||
</view>
|
||||
</view>
|
||||
</navigator>
|
||||
<navigator class="text" url='polyline?latitude={{item.latitude}}&longitude={{item.longitude}}'>
|
||||
<image src="/img/location.svg"> </image>
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
@ -0,0 +1,16 @@
|
||||
@import 'index.wxss'
|
||||
|
||||
.search {
|
||||
width: 96%;
|
||||
height: 80rpx;
|
||||
background-color: #f5f5f5;
|
||||
border-radius: 15px;
|
||||
margin: 20rpx 2%;
|
||||
display: flex;
|
||||
}
|
||||
.search-icon{
|
||||
margin:auto 20rpx;
|
||||
}
|
||||
.search-form{
|
||||
margin:auto 15rpx; width: 100%;
|
||||
}
|
@ -0,0 +1 @@
|
||||
{}
|
@ -0,0 +1,2 @@
|
||||
<!--pages/web-views/web-views.wxml-->
|
||||
<web-view src="https://{{url}}"></web-view>
|
@ -0,0 +1 @@
|
||||
/* pages/web-views/web-views.wxss */
|
@ -1 +0,0 @@
|
||||
代码
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
|
||||
"rules": [{
|
||||
"action": "allow",
|
||||
"page": "*"
|
||||
}]
|
||||
}
|
@ -1 +0,0 @@
|
||||
hello
|