Compare commits

..

No commits in common. 'main' and 'b07f17892f23305b0f8cfd0793fe520b81950795' have entirely different histories.

14
.gitignore vendored

@ -0,0 +1,14 @@
# Windows
[Dd]esktop.ini
Thumbs.db
$RECYCLE.BIN/
# macOS
.DS_Store
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
# Node.js
node_modules/

@ -0,0 +1,7 @@
App({
onLaunch:function(){
wx.cloud.init({
env:"cloud-travel-7gc7n4zqa50965ff"
})
}
})

@ -0,0 +1,55 @@
{
"pages":[
"pages/home/home",
"pages/my/my",
"pages/navigate/navigate",
"pages/navigate1/navigate1",
"pages/index/index",
"pages/logs/logs",
"pages/message/message",
"pages/schedule/schedule"
],
"window":{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "航大云",
"navigationBarTextStyle":"black",
"enablePullDownRefresh": false
},
"tabBar": {
"borderStyle": "black",
"selectedColor": "#00BCD4",
"backgroundColor": "#ffffff",
"list": [
{
"pagePath": "pages/home/home",
"text": "首页",
"iconPath": "/static/home.png",
"selectedIconPath": "/static/home.png"
},
{
"pagePath": "pages/navigate/navigate",
"text": "导航",
"iconPath": "/static/navigate.png",
"selectedIconPath": "/static/navigate.png"
},
{
"pagePath": "pages/my/my",
"text": "个人中心",
"iconPath": "/static/my.png",
"selectedIconPath": "/static/my.png"
}
]
},
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将被用于小程序位置接口的效果展示"
}
},
"style": "v2",
"sitemapLocation": "sitemap.json"
}

@ -0,0 +1,6 @@
{
"permissions": {
"openapi": [
]
}
}

@ -0,0 +1,11 @@
// 云函数入口文件
const cloud = require('wx-server-sdk')
cloud.init({ env: cloud.DYNAMIC_CURRENT_ENV }) // 使用当前云环境
// 云函数入口函数
exports.main = async (event, context) => {
let a = envent.a;
let b = envent.b;
return a+b;
}

@ -1,16 +1,14 @@
{
"name": "demo3",
"name": "add",
"version": "1.0.0",
"main": ".eslintrc.js",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"keywords": [],
"description": "",
"dependencies": {
"@vant/weapp": "^1.3.3",
"dayjs": "^1.11.10"
"wx-server-sdk": "~2.6.3"
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 248 KiB

@ -1,4 +1,4 @@
// pages/newslist/newslist.js
// pages/book/book.js
Page({
/**

@ -0,0 +1,2 @@
<!--pages/book/book.wxml-->
<text>pages/book/book.wxml</text>

@ -0,0 +1 @@
/* pages/book/book.wxss */

@ -0,0 +1,92 @@
// pages/home/home.js
Page({
/**
* 页面的初始数据
*/
data: {
swiperList:
[
{url:"https://s2.loli.net/2023/09/23/41Yw6HvduCrLnJo.png"},
{url:"https://s2.loli.net/2023/09/23/8cZ3VoNfFiLIQ4q.png"},
{url:"https://img1.imgtp.com/2023/10/09/8w8uWsZa.png"}
],
gridList:
[
{name:"课表",icon:"/static/course.png",url:"/pages/schedule/schedule"},
{name:"校历",icon:"/static/schedule.png",url:""},
{name:"通知",icon:"/static/notice.png",url:""},
],
messageList:
[
{id:1,url:"https://s2.loli.net/2023/09/23/IQoPKBG68JTRHht.png",message:"今天星期一"},
{id:2,url:"",message:"今天星期二"},
{id:3,url:"",message:"今天星期三"}
],
goToPage(e) {
wx.navigateTo({
url: e.currentTarget.dataset.url
})
console.log('1')
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

@ -0,0 +1,32 @@
<!--pages/home/home.wxml-->
<!--轮播图区域-->
<swiper class="home_swiper" indicator-dots="true" circular="true" autoplay="true" interval="3000">
<swiper-item class="swiper_item" wx:for="{{swiperList}}" wx:key="index">
<image class="swiper_img" src="{{item.url}}"></image>
</swiper-item>
</swiper>
<!--九宫格区域-->
<view class='grid-item-container'>
<block wx:for="{{gridList}}" wx:key="index">
<view class='grid-item-child'>
<view>
<image bindtap="goToPage" class='grid-item-img' src="{{item.icon}}" data-url="{{item.url}}"></image>
<text class='grid-item-txt'>{{item.name}}</text>
</view>
</view>
</block>
</view>
<!--资讯区域-->
<view class="block">
<view class="title">校园资讯</view>
</view>
<view class="message" wx:for="{{messageList}}" wx:key="index">
<navigator class="message_item" url="pages/message/message?info_id={{item.url}}">
<image class="message_img" src="{{item.url}}"></image>
</navigator>
<view class="word">
<text class="text">{{item.message}}</text>
</view>
</view>

@ -73,10 +73,7 @@
font-size: 24rpx;
}
.text{
font-size: 30rpx;
font-weight: bold;
display: flex;
justify-content: center;
}
.block {
@ -87,38 +84,6 @@
}
.title {
font-size: 48rpx;
font-weight: bold;
}
.switch-week__popup {
padding: 30rpx;
}
.switch-week__title {
text-align: center;
font-size: 36rpx;
font-weight: 500;
margin-bottom: 30rpx;
}
.switch-week__list {
display: flex;
flex-wrap: wrap;
margin-top: 30rpx;
}
.switch-week__item {
width: 20%;
padding: 10rpx;
}
.switch-week__item-box {
width: 100%;
height: 100rpx;
background-color: #d2e6b3;
display: flex;
align-items: center;
justify-content: center;
border-radius: 12rpx;
font-weight: bold;
}

@ -0,0 +1,48 @@
// index.js
// 获取应用实例
const app = getApp()
Page({
data: {
motto: 'Hello World',
userInfo: {},
hasUserInfo: false,
canIUse: wx.canIUse('button.open-type.getUserInfo'),
canIUseGetUserProfile: false,
canIUseOpenData: wx.canIUse('open-data.type.userAvatarUrl') && wx.canIUse('open-data.type.userNickName') // 如需尝试获取用户信息可改为false
},
// 事件处理函数
bindViewTap() {
wx.navigateTo({
url: '../logs/logs'
})
},
onLoad() {
if (wx.getUserProfile) {
this.setData({
canIUseGetUserProfile: true
})
}
},
getUserProfile(e) {
// 推荐使用wx.getUserProfile获取用户信息开发者每次通过该接口获取用户个人信息均需用户确认开发者妥善保管用户快速填写的头像昵称避免重复弹窗
wx.getUserProfile({
desc: '展示用户信息', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
success: (res) => {
console.log(res)
this.setData({
userInfo: res.userInfo,
hasUserInfo: true
})
}
})
},
getUserInfo(e) {
// 不推荐使用getUserInfo获取用户信息预计自2021年4月13日起getUserInfo将不再弹出弹窗并直接返回匿名的用户个人信息
console.log(e)
this.setData({
userInfo: e.detail.userInfo,
hasUserInfo: true
})
}
})

@ -0,0 +1,23 @@
<!--index.wxml-->
<view class="container">
<view class="userinfo">
<block wx:if="{{canIUseOpenData}}">
<view class="userinfo-avatar" bindtap="bindViewTap">
<open-data type="userAvatarUrl"></open-data>
</view>
<open-data type="userNickName"></open-data>
</block>
<block wx:elif="{{!hasUserInfo}}">
<button wx:if="{{canIUseGetUserProfile}}" bindtap="getUserProfile"> 获取头像昵称 </button>
<button wx:elif="{{canIUse}}" open-type="getUserInfo" bindgetuserinfo="getUserInfo"> 获取头像昵称 </button>
<view wx:else> 请使用1.4.4及以上版本基础库 </view>
</block>
<block wx:else>
<image bindtap="bindViewTap" class="userinfo-avatar" src="{{userInfo.avatarUrl}}" mode="cover"></image>
<text class="userinfo-nickname">{{userInfo.nickName}}</text>
</block>
</view>
<view class="usermotto">
<text class="user-motto">{{motto}}</text>
</view>
</view>

@ -0,0 +1,19 @@
/**index.wxss**/
.userinfo {
display: flex;
flex-direction: column;
align-items: center;
color: #aaa;
}
.userinfo-avatar {
overflow: hidden;
width: 128rpx;
height: 128rpx;
margin: 20rpx;
border-radius: 50%;
}
.usermotto {
margin-top: 200px;
}

@ -1,4 +1,4 @@
// pages/collect/collect.js
// pages/message/message.js
Page({
/**
@ -11,56 +11,56 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
onShareAppMessage() {
}
})

@ -0,0 +1,2 @@
<!--pages/message/message.wxml-->
<text>pages/message/message.wxml</text>

@ -0,0 +1 @@
/* pages/message/message.wxss */

@ -1,41 +1,18 @@
// pages/my/my.js
const db = wx.cloud.database();
Page({
/**
* 页面的初始数据
*/
data: {
messageList:[],
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
const _ = db.command
db.collection('notice')
.where({flag:1})
.get()
.then(res => {//formData是数据库里面集合的名称
console.log(res); //如果更新数据成功则输出成功信息
//var that = this;
this.setData({
messageList: res.data //数据赋值
});
console.log(res.data);
}).catch(err => {
console.log(err); //如果更新数据失败则输出失败信息
})
},
//跳转页面----详情页-------------
tiao_yemian:function(e){
console.log(e.currentTarget)
//跳转页面
wx.navigateTo({
url: '../login/login'
})
},
/**

@ -0,0 +1,65 @@
<!--pages/Personal/Personal.wxml-->
<view class="top_img" >
<view class="my_iocn">
<image src="https://s2.loli.net/2023/09/23/Z47iIRVULOcA15m.jpg"></image>
<view class="myname">马嘉序</view>
<view class="xinzuo_xx">
<view><text class="iconfont icon-sousuo1" style="color: red;font-size: 12px;"></text> 天秤座</view>
<view>工作ing</view>
<view >软件工程</view>
<view class="r_jt"><text class="iconfont icon-icon-arrow-right2"></text></view>
</view>
<view class="btu" bindtap="tiao_yemian" hover-class="butto1"><text class="iconfont icon-bianji"></text> 编辑资料</view>
</view>
</view>
<view class="h_topbianti">
<view class="{{curNav == 1 ? 'active' : ''}}" data-id="1" bindtap="switchRightTab">主页<view></view></view>
<view class="{{curNav == 2 ? 'active' : ''}}" data-id="2" bindtap="switchRightTab">xx<view>
</view>
</view>
</view>
<view class="neir_b" wx:if="{{curNav==2}}">
<view class="shuquan">
<image src="{{user_xinxis.userimg}}"></image>
<view class="name">{{user_xinxis.nname}}</view>
<view class="shuo">{{shuquan[0].shuoshuo}}</view>
<view class="book">
<image src="{{tuijian_books[0].b_imgsrc}}"></image>
<view class="r_txt">
<text>{{tuijian_books[0].b_name}}</text>
<view>{{tuijian_books[0].b_author}}</view>
</view>
</view>
<view class="bup_li">
<view class="times">{{shuquan[0].times}}</view>
<view class="r_icon">
<text class="iconfont icon-tuijian"></text>
<text class="nums"> {{shuquan[0].dianzan}} </text>
<text class="iconfont icon-pinglun"></text>
<text class="nums"> {{shuquan[0].pinglun}} </text>
</view>
</view>
</view>
<view class="shuquan">
<image src="{{user_xinxis.userimg}}"></image>
<view class="name">{{user_xinxis.nname}}</view>
<view class="shuo">{{shuquan[1].shuoshuo}}</view>
<view class="book">
<image src="{{tuijian_books[1].b_imgsrc}}"></image>
<view class="r_txt">
<text>{{tuijian_books[1].b_name}}</text>
<view>{{tuijian_books[1].b_author}}</view>
</view>
</view>
<view class="bup_li">
<view class="times">{{shuquan[1].times}}</view>
<view class="r_icon">
<text class="iconfont icon-tuijian"></text>
<text class="nums"> {{shuquan[1].dianzan}} </text>
<text class="iconfont icon-pinglun"></text>
<text class="nums"> {{shuquan[1].pinglun}} </text>
</view>
</view>
</view>
</view>

@ -15,11 +15,11 @@ page{
}
.top_img .my_iocn{
width: 90%;
height: 135px;
height: 160px;
background-color: rgba(255, 255, 255, 0.5);
position: absolute;
left: 5%;
bottom: -60%;
bottom: -70%;
border-radius: 10px;
z-index: 99;
/* opacity: .5; */
@ -253,23 +253,4 @@ page{
.shuquan .bup_li .r_icon .nums{
font-size: 12px;
margin-right: 10px;
}
.message{
display: flex;
padding: 15rpx;
border: 1rpx #efefef;
border-radius: 8rpx;
margin: 15rpx;
box-shadow: 1rpx 1rpx 15rpx #ddd;
}
.word{
display: flex;
flex-direction: column;
justify-content: space-around;
font-size: 24rpx;
color:#999;
}
.text{
font-size: 35rpx;
font-weight: bold;
}
}

@ -0,0 +1,719 @@
// 引入SDK核心类js文件根据自己业务位置可自行放置
var QQMapWX = require('../../qqmap-wx-jssdk.js');
var qqmapsdk;
var app = getApp();
// pages/home/home.js
Page({
/**
* 页面的初始数据
*/
//设置下拉刷新
onPullDownRefresh: function () {
var that = this;
that.setData({
currentTab: 0 //当前页的一些初始数据,视业务需求而定
})
this.onLoad(); //重新加载onLoad()
},
data: {
buildData:app.globalData.map,
hidden:true,
// 设置markers
markers:[],
// 设置航大数据
tripdata:[],
studydata: [],
eatdata:[],
rundata:[],
trandata:[],
lifedata:[],
admindata:[],
dordata:[],
//输入的查询地址
inputvalue:'',
//起始地址
startPoint:null,
endPoint:null,
//获取当前分类
currentdatabase:null,
modalimg:null,
modalname:null,
modaltitle:null,
modaladdress:null,
},
//点击按钮现实地图上对应的点
tripplace:function(){
var that=this;
var result = that.data.tripdata;
var number = that.data.markers.length;
let markers = that.data.markers
markers.splice(1,number-1)
that.setData({
markers:markers,
currentdatabase:result
})
for(var i=0;i<result.length;i++){
let lat = result[i].latitude;
let lon = result[i].longitude;
let name = result[i].name;
var index="markers["+(i+1)+"]";
that.setData({
[index]:{
id:i+1,
latitude: lat,
longitude: lon,
iconPath: "../../image/旅游icon.png",
width: 30,
height: 30,
label: {
content: name,
color: '#FFFFFF',
bgColor:'#6495ED',
fontSize: 13,
anchorX:10,
anchorY:-23,
borderRadius: 5,
borderWidth: 1,
borderColor: '#6495ED',
padding: 2,
//display: 'ALWAYS'
}
}
})
}
},
studyplace:function(){
var that=this;
var result = that.data.studydata;
var number = that.data.markers.length;
let markers = that.data.markers
markers.splice(1,number-1)
that.setData({
markers:markers,
currentdatabase:result
})
for(var i=0;i<result.length;i++){
let lat = result[i].latitude;
let lon = result[i].longitude;
let name = result[i].name;
var index="markers["+(i+1)+"]";
that.setData({
[index]:{
id:i+1,
latitude: lat,
longitude: lon,
iconPath: "../../image/学习icon.png",
width: 30,
height: 30,
label: {
content: name,
color: '#FFFFFF',
bgColor:'#6495ED',
fontSize: 13,
anchorX:16,
anchorY:-22.5,
borderRadius: 5,
borderWidth: 1,
borderColor: '#6495ED',
padding: 2,
//display: 'ALWAYS'
}
}
})
}
},
eatplace:function(){
var that=this;
var result = that.data.eatdata;
var number = that.data.markers.length;
let markers = that.data.markers
markers.splice(1,number-1)
that.setData({
markers:markers,
currentdatabase:result
})
for(var i=0;i<result.length;i++){
let lat = result[i].latitude;
let lon = result[i].longitude;
let name = result[i].name;
var index="markers["+(i+1)+"]";
that.setData({
[index]:{
id:i+1,
latitude: lat,
longitude: lon,
iconPath: "../../image/吃饭icon.png",
width: 30,
height: 30,
label: {
content: name,
color: '#FFFFFF',
bgColor:'#6495ED',
fontSize: 13,
anchorX:10,
anchorY:-26,
borderRadius: 5,
borderWidth: 1,
borderColor: '#6495ED',
padding: 2,
//display: 'ALWAYS'
}
}
})
}
},
runplace:function(){
var that=this;
var result = that.data.rundata;
var number = that.data.markers.length;
let markers = that.data.markers
markers.splice(1,number-1)
that.setData({
markers:markers,
currentdatabase:result
})
for(var i=0;i<result.length;i++){
let lat = result[i].latitude;
let lon = result[i].longitude;
let name = result[i].name;
var index="markers["+(i+1)+"]";
that.setData({
[index]:{
id:i+1,
latitude: lat,
longitude: lon,
iconPath: "../../image/运动icon.png",
width: 30,
height: 30,
label: {
content: name,
color: '#FFFFFF',
bgColor:'#6495ED',
fontSize: 13,
anchorX:14,
anchorY:-26,
borderRadius: 5,
borderWidth: 1,
borderColor: '#6495ED',
padding: 2,
//display: 'ALWAYS'
}
}
})
}
},
tranplace:function(){
var that=this;
var result = that.data.trandata;
var number = that.data.markers.length;
let markers = that.data.markers
markers.splice(1,number-1)
that.setData({
markers:markers,
currentdatabase:result
})
for(var i=0;i<result.length;i++){
let lat = result[i].latitude;
let lon = result[i].longitude;
let name = result[i].name;
var index="markers["+(i+1)+"]";
that.setData({
[index]:{
id:i+1,
latitude: lat,
longitude: lon,
iconPath: "../../image/交通icon.png",
width: 30,
height: 30,
label: {
content: name,
color: '#FFFFFF',
bgColor:'#6495ED',
fontSize: 13,
anchorX:14,
anchorY:-26,
borderRadius: 5,
borderWidth: 1,
borderColor: '#6495ED',
padding: 2,
//display: 'ALWAYS'
}
}
})
}
},
lifeplace:function(){
var that=this;
var result = that.data.lifedata;
var number = that.data.markers.length;
let markers = that.data.markers
markers.splice(1,number-1)
that.setData({
markers:markers,
currentdatabase:result
})
for(var i=0;i<result.length;i++){
let lat = result[i].latitude;
let lon = result[i].longitude;
let name = result[i].name;
var index="markers["+(i+1)+"]";
that.setData({
[index]:{
id:i+1,
latitude: lat,
longitude: lon,
iconPath: "../../image/生活icon.png",
width: 30,
height: 30,
label: {
content: name,
color: '#FFFFFF',
bgColor:'#6495ED',
fontSize: 13,
anchorX:14,
anchorY:-26,
borderRadius: 5,
borderWidth: 1,
borderColor: '#6495ED',
padding: 2,
//display: 'ALWAYS'
}
}
})
}
},
adminplace:function(){
var that=this;
var result = that.data.admindata;
var number = that.data.markers.length;
let markers = that.data.markers
markers.splice(1,number-1)
that.setData({
markers:markers,
currentdatabase:result
})
for(var i=0;i<result.length;i++){
let lat = result[i].latitude;
let lon = result[i].longitude;
let name = result[i].name;
var index="markers["+(i+1)+"]";
that.setData({
[index]:{
id:i+1,
latitude: lat,
longitude: lon,
iconPath: "../../image/行政icon.png",
width: 30,
height: 30,
label: {
content: name,
color: '#FFFFFF',
bgColor:'#6495ED',
fontSize: 13,
anchorX:14,
anchorY:-26,
borderRadius: 5,
borderWidth: 1,
borderColor: '#6495ED',
padding: 2,
//display: 'ALWAYS'
}
}
})
}
},
dorplace:function(){
var that=this;
var result = that.data.dordata;
var number = that.data.markers.length;
let markers = that.data.markers
markers.splice(1,number-1)
that.setData({
markers:markers,
currentdatabase:result
})
for(var i=0;i<result.length;i++){
let lat = result[i].latitude;
let lon = result[i].longitude;
let name = result[i].name;
var index="markers["+(i+1)+"]";
that.setData({
[index]:{
id:i+1,
latitude: lat,
longitude: lon,
joinCluster:true,
iconPath: "../../image/公寓icon.png",
width: 30,
height: 30,
label: {
content: name,
color: '#FFFFFF',
bgColor:'#6495ED',
fontSize: 13,
anchorX:14,
anchorY:-25,
borderRadius: 5,
borderWidth: 0.8,
borderColor: '#6495ED',
padding: 2,
//display: 'ALWAYS'
}
}
})
}
},
//获取输入的查询地址
inputplace:function(e){
this.setData({
inputvalue:e.detail.value
})
},
// 搜索
nearby_search:function(){
var that = this;
var text = that.data.inputvalue;
// 调用接口
qqmapsdk.search({
keyword: text, //搜索关键词
location: '30.51863,114.401', //设置周边搜索中心点
success: function (res) { //搜索成功后的回调
var texttitle = '共找到'+res.data.length+'个地点'
wx.showToast({
title: texttitle,
icon: 'success',
duration: 2000
})
var number = that.data.markers.length;
let markers = that.data.markers;
markers.splice(1,number-1)
that.setData({
markers:markers
})
for (var i = 0; i < res.data.length; i++) {
let lat = res.data[i].location.lat;
let lon = res.data[i].location.lng;
let name = res.data[i].title;
var index = "markers["+(i+1)+"]";
that.setData({
[index]:{
id:i+1,
latitude: lat,
longitude: lon,
iconPath: "../../image/标记.png",
width: 25,
height: 25,
label: {
content: name,
color: '#FFFFFF',
bgColor:'#6495ED',
fontSize: 13,
anchorX:14,
anchorY:-24,
borderRadius: 5,
borderWidth: 1,
borderColor: '#6495ED',
padding: 2,
//display: 'ALWAYS'
}
},
currentdatabase:res.data
})
}
},
fail: function (res) {
wx.showToast({
title: '抱歉,搜索错误',
icon: 'fail',
duration: 2000
})
},
complete: function (res){
console.log(res);
}
});
},
//点击地点进行路径规划
onPointTap: function(e) {
console.log(e)
var that = this;
var lat = ''; // 获取点击的markers经纬度
var lon = ''; // 获取点击的markers经纬度
var name = ''; // 获取点击的markers名称
var markerId = e.detail.markerId;// 获取点击的markers id
var markersda = this.data.markers;
var currentdatabase = this.data.currentdatabase;
//定位所点击的坐标点
for (var item of markersda){
if (item.id === markerId) {
lat = item.latitude;
lon = item.longitude;
name = item.label.content;
break;
}
}
//初始化起点为西大门门口
var startPoint = JSON.stringify({
'name': markersda[0].callout.content,
'latitude': markersda[0].latitude,
'longitude': markersda[0].longitude
});
var endPoint = JSON.stringify({ //终点
'name': name,
'latitude': lat,
'longitude': lon
});
if(currentdatabase[markerId-1].title != null)
{
that.setData({
hidden:false,
modalname:currentdatabase[markerId-1].title
})
}else{
that.setData({
hidden:false,
modalname:currentdatabase[markerId-1].name
})
}
that.setData({
hidden:false,
modaladdress:currentdatabase[markerId-1].address,
startPoint:startPoint,
endPoint:endPoint
})
},
// 路径规划
test:function(){
let plugin = requirePlugin('routePlan');
let key = 'NS4BZ-A5GK3-MAA3K-OT63P-S3CHS-PSBKH'; //使用在腾讯位置服务申请的key
let referer = 'cugerguider'; //调用插件的app的名称
let endPoint = JSON.stringify({ //终点
'name': '中国民航大学(东丽校区)',
'latitude': 39.11198,
'longitude': 117.35002
});
wx.navigateTo({
url: 'plugin://routePlan/index?key=' + key + '&referer=' + referer + '&endPoint=' + endPoint
});
},
//获取自己当前的位置
getmyPlace:function(){
var that=this;
wx.getLocation({
success: function(res) {
console.log(res);
that.setData({
markers:[
{
latitude:res.latitude,
longitude:res.longitude,
iconPath:"../../image/mapcenter.png",
width:25,
height:25,
callout:{
content:"当前位置",
color:'#0000ff',
fontSize:13,
borderRadius:5,
borderWidth:1,
borderColor:'#0000ff',
padding:2,
display:'ALWAYS'
}
}
]
})
},
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
wx.stopPullDownRefresh() //刷新完成后停止下拉刷新动效
// 实例化API核心类
qqmapsdk = new QQMapWX({
key: 'NS4BZ-A5GK3-MAA3K-OT63P-S3CHS-PSBKH'
});
// wx.showModal({
// title:'提示',
// content:'当前位置不在校区内,是否切换?',
// success(res){
// if(res.confirm)
// {
// console.log('用户点击确定')
// }else if(res.cancel)
// {
// console.log('用户点击取消')
// }
// }
// });
var that = this;
var trip = that.data.buildData[0].data;
var study = that.data.buildData[1].data;
var eat = that.data.buildData[2].data;
var run = that.data.buildData[3].data;
var tran = that.data.buildData[4].data;
var life = that.data.buildData[5].data;
var admi = that.data.buildData[6].data;
var ador = that.data.buildData[7].data;
that.setData({
tripdata:trip,
eatdata:eat,
studydata:study,
rundata:run,
trandata:tran,
lifedata:life,
admindata:admi,
dordata:ador
})
//判断所在位置是否在校区内
wx.getLocation({
type:'gcj02',
success:function(res)
{
// console.log(res)
var nowlatitude = res.latitude
var nowlongitude = res.longitude
if((nowlatitude > 39.11198) && (nowlatitude < 39.11198) && (nowlongitude > 117.35002) && (nowlongitude <117.35002))
{
that.setData({
markers:[
{
id:0,
latitude:nowlatitude,
longitude:nowlongitude,
iconPath:"../../image/mapcenter.png",
width:25,
height:25,
callout:{
content:"当前位置",
color:'#0000ff',
fontSize:13,
borderRadius:5,
borderWidth:1,
borderColor:'#0000ff',
padding:2,
display:'ALWAYS'
}
}
]
})
}else{
wx.showModal({
title:'提示',
content:'当前位置不在校区内,是否切换?',
success(res)
{
if(res.confirm)
{
that.setData({
markers:[
{
id:0,
latitude:30.51863,
longitude:114.401,
iconPath:"../../image/mapcenter.png",
width:25,
height:25,
callout:{
content:"西大门",
color:'#0000ff',
fontSize:13,
borderRadius:5,
borderWidth:1,
borderColor:'#0000ff',
padding:2,
display:'BYCLICK'
}
}
]
})
}else if(res.cancel)
{
that.setData({
markers:[
{
id:0,
latitude:nowlatitude,
longitude:nowlongitude,
iconPath:"../../image/mapcenter.png",
width:25,
height:25,
callout:{
content:"当前位置",
color:'#0000ff',
fontSize:13,
borderRadius:5,
borderWidth:1,
borderColor:'#0000ff',
padding:2,
display:'ALWAYS'
}
}
]
})
}
}
})
}
}
});
// let mapCtx = wx.createMapContext('myMap',that)
// console.log(mapCtx)
// mapCtx.initMarkerCluster({
// enableDefaultStyle:true,
// zoomOnClick:true,
// gridSize:60,
// complete(res){
// console.log('initMarkerCluster',res)
// }
// })
},
onReady: function (e) {
// 使用 wx.createMapContext 获取 map 上下文
this.mapCtx = wx.createMapContext('myMap');
},
// 设置点聚合
initMarkerCluster:function(){
this.mapCtx.initMarkerCluster({
enableDefaultStyle:true,
zoomOnClick:true,
gridSize:20,
complete(res){
console.log('initMarkerCluster',res)
}
})
},
clickButton: function (e) {
//console.log(this.data.fullscreen)
//打印所有关于点击对象的信息
this.setData({ fullscreen: !this.data.fullscreen })
},
modalcancel:function(e)
{
this.setData({
hidden:true,
})
},
modalconfirm:function(e)
{
var that = this;
this.setData({
hidden:true,
})
//路径规划
var plugin = requirePlugin('routePlan');
var key = 'NS4BZ-A5GK3-MAA3K-OT63P-S3CHS-PSBKH '; //使用在腾讯位置服务申请的key
var referer = 'cugerguider'; //调用插件的app的名称
var themeColor = '#7B68EE'; //主题颜色
var endPoint = that.data.endPoint;
var startPoint = that.data.startPoint;
wx.navigateTo({
url: 'plugin://routePlan/index?key=' + key + '&referer=' + referer +'&endPoint=' + endPoint + '&startPoint='+ startPoint + '&themeColor=' + themeColor
});
}
})

@ -0,0 +1,7 @@
{
"usingComponents": {
},
"navigationBarTitleText": "航大云系统",
"enablePullDownRefresh": true ,
"backgroundTextStyle": "dark"
}

@ -0,0 +1,72 @@
<view class='framework'>
<view class='input-position'>
<image src='https://mmbiz.qpic.cn/mmbiz_png/JZxArCU6LRribpVmzlUNGvYVU4jojoICBY1u3ic8lBGbs3sC86DgZy2wwicU5yMtUiagyicNcibu2mP8ibaVyBEysUy5A/0?wx_fmt=png' class='search-image'></image>
<input class="input" placeholder="搜索 周边 地址" placeholder-style="color:#bdbdbd;" bindinput="inputplace" />
<view class='line'></view>
<view class='search-text' bindtap="nearby_search">搜索</view>
</view>
</view>
<view class="index_other">
<view class="other_element" bindtap="tripplace" >
<image class="other_element_icon" src="../../image/trip.png"></image>
<view class="other_element_text">游在地大</view>
</view>
<view class="other_element" bindtap="studyplace">
<image class="other_element_icon" src="../../image/study.png"></image>
<view class="other_element_text">学在地大</view>
</view>
<view class="other_element" bindtap="eatplace">
<image class="other_element_icon" src="../../image/eat.png"></image>
<view class="other_element_text">吃在地大</view>
</view>
<view class="other_element" bindtap="runplace">
<image class="other_element_icon" src="../../image/running.png"></image>
<view class="other_element_text">运动地大</view>
</view>
</view>
<view class="index_other">
<view class="other_element" bindtap="tranplace">
<image class="other_element_icon" src="../../image/transform.png"></image>
<view class="other_element_text">交通服务</view>
</view>
<view class="other_element" bindtap="lifeplace">
<image class="other_element_icon" src="../../image/life.png"></image>
<view class="other_element_text">生活服务</view>
</view>
<view class="other_element" bindtap="adminplace">
<image class="other_element_icon" src="../../image/administrative.png"></image>
<view class="other_element_text">行政大楼</view>
</view>
<view class="other_element" bindtap="dorplace">
<image class="other_element_icon" src="../../image/dormitory.png"></image>
<view class="other_element_text">学生宿舍</view>
</view>
</view>
<map
id="myMap"
style="width:100%;height:1000rpx"
markers="{{markers}}"
data-markers="{{markers}}"
scale="17"
show-compass="true"
enable-rotate="true"
enable-building="true"
bindmarkertap="onPointTap"
bindlabeltap="onPointTap"
subkey="LM6BZ-WVQKQ-BFH5Z-GJLKI-4YHNK-NAFM5"
layer-style="2"
latitude="{{markers[0].latitude}}" longitude="{{markers[0].longitude}}"
></map>
<!--弹出框-->
<modal class="model" hidden="{{hidden}}" confirm-text="确定" cancel-text="取消" bindconfirm="modalconfirm" bindcancel="modalcancel" title="前往此处" style="width:80%">
<view class="model-img">
<image style="width:565rpx;height:300rpx" src="https://mmbiz.qpic.cn/mmbiz_png/JZxArCU6LRqEceyJTIetvRDXXfK5AsGulNDrG2TW1rDybw5ibOOIypHQDgY5vlpSENo9HBpibGWmr6sNEicgtiaXyw/0?wx_fmt=png"></image>
</view>
<view class="model-name">{{modalname}}</view>
<view class="model-name">{{modaladdress}}</view>
</modal>
<!--弹出框结束-->

@ -0,0 +1,182 @@
/* pages/home/home.wxss */
.index_other{
margin-top: 10rpx;
height: 150rpx;
width: 100%;
display: flex;
flex-flow: row;
}
.other_element{
flex-direction: column;
width: 25%;
}
.other_element_icon{
width: 40%;
height: 80rpx;
margin-left: 30%;
}
.other_element_text{
display: flex;
justify-content: center;
font-size: 30rpx;
}
.framework{
border: 1rpx solid #b3b3b3;
width: 700rpx;
height: 80rpx;
margin-left: 20rpx;
margin-top: 50rpx;
border-radius: 10rpx;
margin-bottom: 20rpx;
display: flex;
justify-content: center;
align-items: center;
}
.input-position{
display: flex;
justify-content: center;
align-items: center;
flex-direction: row;
}
.input{
color: #b3b3b3;
border: none;
border-radius: 10rpx;
width: 60vw;
height: 6vh;
text-indent:10rpx;
margin-left: 10rpx;
}
.line{
width: 3rpx;
height: 50rpx;
background-color: #b6b6b6;
}
.search-text{
color: #bdbdbd;
width: 80rpx;
height: 30rpx;
text-align: center;
margin-bottom: 20rpx;
margin-left: 30rpx;
}
.search-image{
width: 40rpx;
height:40rpx;
margin-right: 12rpx;
}
/* 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%;
}
.model{
width: 100%;
}
.model-name{
text-align: center;
margin-top: 10rpx;
}

@ -0,0 +1,66 @@
// pages/navigate1/navigate1.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

@ -0,0 +1,2 @@
<!--pages/navigate1/navigate1.wxml-->
<text>pages/navigate1/navigate1.wxml</text>

@ -0,0 +1 @@
/* pages/navigate1/navigate1.wxss */

@ -0,0 +1,2 @@
<!--pages/person/person.wxml-->
<text>pages/person/person.wxml</text>

@ -0,0 +1 @@
/* pages/person/person.wxss */

@ -0,0 +1,66 @@
// pages/schedule/schedule.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

@ -0,0 +1,2 @@
<!--pages/schedule/schedule.wxml-->
<view>hello</view>

@ -0,0 +1 @@
/* pages/schedule/schedule.wxss */

@ -1,5 +1,6 @@
{
"description": "项目配置文件",
"cloudfunctionRoot": "cloud/",
"packOptions": {
"ignore": [],
"include": []
@ -18,7 +19,7 @@
"minified": true,
"autoAudits": false,
"newFeature": false,
"uglifyFileName": false,
"uglifyFileName": true,
"uploadWithSourceMap": true,
"useIsolateContext": true,
"nodeModules": false,
@ -27,14 +28,9 @@
"useApiHook": true,
"useApiHostProcess": true,
"showShadowRootInWxmlPanel": true,
"packNpmManually": true,
"packNpmManually": false,
"enableEngineNative": false,
"packNpmRelationList": [
{
"packageJsonPath": "./package.json",
"miniprogramNpmDistDir": "./"
}
],
"packNpmRelationList": [],
"minifyWXSS": true,
"showES6CompileOption": false,
"minifyWXML": true,
@ -43,8 +39,7 @@
"disablePlugins": [],
"outputPath": ""
},
"condition": false,
"ignoreUploadUnusedFiles": true
"condition": true
},
"compileType": "miniprogram",
"libVersion": "2.19.4",

@ -1,10 +1,9 @@
{
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"projectname": "Demo3",
"projectname": "miniprogram-3",
"setting": {
"compileHotReLoad": true,
"urlCheck": false,
"bigPackageSizeSupport": true
},
"libVersion": "2.27.3"
}
}

@ -1,21 +0,0 @@
MIT License
Copyright (c) 2020 jwhuang
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.

@ -1,38 +0,0 @@
// app.js
const amapFile = require('utils/amap-wx.js');
App({
onLaunch() {
// 展示本地存储能力
const logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
wx.setStorageSync('logs', logs)
// 登录
wx.login({
success: res => {
// 发送 res.code 到后台换取 openId, sessionKey, unionId
}
})
wx.cloud.init({
env:'cloud-travel-7gc7n4zqa50965ff', //xxx填写云开发环境id
traceUser: true
})
},
globalData: {
mapInfo:"",
mapApi:"https://restapi.amap.com/v3/",
history:[],
historyRoute:[],
homePart: {
homeText: '设置一个地址',
homePoint: ''
},
companyPart: {
companyText: '设置一个地址',
companyPoint: '',
},
}
})

@ -1,74 +0,0 @@
{
"pages":[
"pages/home/home",
"pages/my/my",
"pages/information/information",
"pages/calendar/calendar",
"pages/newslist/newslist",
"pages/details/details",
"pages/course/course",
"pages/login/login",
"pages/index/index",
"pages/logs/logs",
"pages/search/search",
"pages/nearby/nearby",
"pages/site/site",
"pages/route/route",
"pages/detail/detail",
"pages/admin/admin",
"pages/navigation/navigation",
"pages/collect/collect"
],
"requiredPrivateInfos":[
"getLocation",
"chooseAddress",
"onLocationChange",
"startLocationUpdate",
"startLocationUpdateBackground",
"choosePoi",
"chooseLocation"
],
"window":{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "HDY",
"navigationBarTextStyle":"black"
},
"navigateToMiniProgramAppIdList": [
"wxbbec65de8931cc38"
],
"tabBar": {
"borderStyle":"black",
"selectedColor": "#00BCD4",
"backgroundColor": "#ffffff",
"list": [
{
"pagePath": "pages/home/home",
"text": "首页",
"iconPath": "/images/home.png",
"selectedIconPath": "/images/home.png"
},
{
"pagePath": "pages/index/index",
"text": "导航",
"iconPath": "/images/navigate.png",
"selectedIconPath": "/images/navigate.png"
},
{
"pagePath": "pages/my/my",
"text": "个人中心",
"iconPath": "/images/my.png",
"selectedIconPath": "images/my.png"
}
]
},
"style": "v2",
"sitemapLocation": "sitemap.json",
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 410 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 595 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 924 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save