修改请求方法, app.json添加获取定位时的默认提示框
This commit is contained in:
parent
5eb282a80f
commit
29c6690080
2
app.js
2
app.js
@ -7,7 +7,7 @@ App({
|
|||||||
newsUrl: 'http://192.168.0.113:8082/news',
|
newsUrl: 'http://192.168.0.113:8082/news',
|
||||||
libraryUrl: 'http://192.168.0.113:8081/library',
|
libraryUrl: 'http://192.168.0.113:8081/library',
|
||||||
activityUrl: '',
|
activityUrl: '',
|
||||||
venueUrl: '',
|
venueUrl: 'http://192.168.0.109:8082/venuebooking',
|
||||||
restAjax: restAjax,
|
restAjax: restAjax,
|
||||||
dialog: dialog,
|
dialog: dialog,
|
||||||
onLaunch: function () {
|
onLaunch: function () {
|
||||||
|
5
app.json
5
app.json
@ -64,6 +64,11 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"permission": {
|
||||||
|
"scope.userLocation": {
|
||||||
|
"desc": "你的位置信息将用于您当前所在位置"
|
||||||
|
}
|
||||||
|
},
|
||||||
"style": "v2",
|
"style": "v2",
|
||||||
"sitemapLocation": "sitemap.json"
|
"sitemapLocation": "sitemap.json"
|
||||||
}
|
}
|
@ -1,3 +1,4 @@
|
|||||||
|
var app = getApp();
|
||||||
// pages/venue/venue.js
|
// pages/venue/venue.js
|
||||||
Page({
|
Page({
|
||||||
|
|
||||||
@ -5,8 +6,8 @@ Page({
|
|||||||
* 页面的初始数据
|
* 页面的初始数据
|
||||||
*/
|
*/
|
||||||
data: {
|
data: {
|
||||||
baseUrl : 'http://192.168.0.109:8082/venuebooking/',
|
venueUrl : app.venueUrl,
|
||||||
imgRoute : 'route/file/downloadfile/true/',
|
imgRoute : '/route/file/downloadfile/true/',
|
||||||
venueTypeParentId : 'df8b758c-f6d8-465a-9aa8-c451fde47076',
|
venueTypeParentId : 'df8b758c-f6d8-465a-9aa8-c451fde47076',
|
||||||
page : '1',
|
page : '1',
|
||||||
rows : '10',
|
rows : '10',
|
||||||
@ -38,23 +39,23 @@ Page({
|
|||||||
//获取场馆分类
|
//获取场馆分类
|
||||||
listVenueType : function(){
|
listVenueType : function(){
|
||||||
var self = this;
|
var self = this;
|
||||||
wx.request({
|
app.restAjax.get(app.restAjax.path('{venueUrl}/app/venuedictionary/listvenuedictionarybyparentidrelease/{venueTypeParentId}',
|
||||||
url: self.data.baseUrl + 'app/venuedictionary/listvenuedictionarybyparentidrelease/' + self.data.venueTypeParentId,
|
[app.venueUrl, self.data.venueTypeParentId]), {}, null,
|
||||||
success : function(res){
|
function(code,data){
|
||||||
var data = res.data;
|
|
||||||
self.setData({
|
self.setData({
|
||||||
venueTypeList : data.data
|
venueTypeList: data.data
|
||||||
})
|
});
|
||||||
|
},function(code, data){
|
||||||
|
app.dialog.msg(data.msg);
|
||||||
}
|
}
|
||||||
})
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
//获取场馆列表
|
//获取场馆列表
|
||||||
listPageVenuesInfo : function(){
|
listPageVenuesInfo : function(){
|
||||||
var self = this;
|
var self = this;
|
||||||
wx.request({
|
app.restAjax.get(app.restAjax.path('{venueUrl}/app/venuesinfo/listpagevenuesinforelease', [app.venueUrl]),
|
||||||
url: self.data.baseUrl + 'app/venuesinfo/listpagevenuesinforelease',
|
{
|
||||||
data : {
|
|
||||||
page : self.data.page,
|
page : self.data.page,
|
||||||
rows : self.data.rows,
|
rows : self.data.rows,
|
||||||
orderKey : self.data.orderKey,
|
orderKey : self.data.orderKey,
|
||||||
@ -62,9 +63,8 @@ Page({
|
|||||||
latitude: self.data.latitude,
|
latitude: self.data.latitude,
|
||||||
longitude: self.data.longitude,
|
longitude: self.data.longitude,
|
||||||
selfLocation: 'TX',
|
selfLocation: 'TX',
|
||||||
},
|
}, null,
|
||||||
success : function(res){
|
function(code, data){
|
||||||
var data = res.data;
|
|
||||||
data.rows.forEach(element => {
|
data.rows.forEach(element => {
|
||||||
element.venuePanorama = element.venuePanorama.split(',')[0];
|
element.venuePanorama = element.venuePanorama.split(',')[0];
|
||||||
if(element.apart >= 1000){
|
if(element.apart >= 1000){
|
||||||
@ -76,10 +76,11 @@ Page({
|
|||||||
self.setData({
|
self.setData({
|
||||||
venuesList : data.rows,
|
venuesList : data.rows,
|
||||||
page : data.page
|
page : data.page
|
||||||
})
|
});
|
||||||
|
}, function(code,data){
|
||||||
|
app.dialog.msg(data.msg);
|
||||||
}
|
}
|
||||||
})
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
//切换场馆类型
|
//切换场馆类型
|
||||||
@ -97,7 +98,6 @@ Page({
|
|||||||
//切换场馆排序
|
//切换场馆排序
|
||||||
changeVenuesOrderBy: function(options){
|
changeVenuesOrderBy: function(options){
|
||||||
var beCheck = options.currentTarget.dataset.becheck;
|
var beCheck = options.currentTarget.dataset.becheck;
|
||||||
console.log(options);
|
|
||||||
this.setData({
|
this.setData({
|
||||||
orderKey : beCheck
|
orderKey : beCheck
|
||||||
})
|
})
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<view class="fixed-top">
|
<view class="fixed-top">
|
||||||
<view class="fixed-tab">
|
<view class="fixed-tab">
|
||||||
<view class="tab-box {{item.dictionaryId == venueType ? 'active' : ''}}" wx:for="{{venueTypeList}}" bindtap="changeVenueType" data-id="{{item.dictionaryId}}">
|
<view class="tab-box {{item.dictionaryId == venueType ? 'active' : ''}}" wx:for="{{venueTypeList}}" wx:key="index" bindtap="changeVenueType" data-id="{{item.dictionaryId}}">
|
||||||
<image src="{{baseUrl}}{{imgRoute}}{{item.dictionaryIcon}}"></image>
|
<image src="{{venueUrl}}{{imgRoute}}{{item.dictionaryIcon}}"></image>
|
||||||
<view class="tab-title">{{item.dictionaryName}}</view>
|
<view class="tab-title">{{item.dictionaryName}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -18,9 +18,9 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="venue">
|
<view class="venue">
|
||||||
<view class="venue-box" wx:for="{{venuesList}}" bindtap="goDetail" data-id="{{item.venuesInfoId}}">
|
<view class="venue-box" wx:for="{{venuesList}}" wx:key="index" bindtap="goDetail" data-id="{{item.venuesInfoId}}">
|
||||||
<view class="venue-img">
|
<view class="venue-img">
|
||||||
<image src="{{baseUrl}}{{imgRoute}}{{item.venuePanorama}}"></image>
|
<image src="{{venueUrl}}{{imgRoute}}{{item.venuePanorama}}"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="venue-info">
|
<view class="venue-info">
|
||||||
<view class="name-distance">
|
<view class="name-distance">
|
||||||
|
@ -1,15 +1,14 @@
|
|||||||
|
var app = getApp();
|
||||||
// pages/venueDetail/venueDetail.js
|
// pages/venueDetail/venueDetail.js
|
||||||
Page({
|
Page({
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页面的初始数据
|
* 页面的初始数据
|
||||||
*/
|
*/
|
||||||
data: {
|
data: {
|
||||||
baseUrl: 'http://192.168.0.109:8082/venuebooking/',
|
venueUrl: app.venueUrl,
|
||||||
imgRoute : 'route/file/downloadfile/true/',
|
imgRoute : '/route/file/downloadfile/true/',
|
||||||
indicatorDots: true,
|
indicatorDots: true,
|
||||||
autoplay: true,
|
autoplay: true,
|
||||||
|
|
||||||
venuesInfoId: '',
|
venuesInfoId: '',
|
||||||
venuesDetail:{},
|
venuesDetail:{},
|
||||||
venuesProjectList: [],
|
venuesProjectList: [],
|
||||||
@ -22,37 +21,35 @@ Page({
|
|||||||
//场馆详情接口
|
//场馆详情接口
|
||||||
getVenuesDetail: function(){
|
getVenuesDetail: function(){
|
||||||
var self = this;
|
var self = this;
|
||||||
wx.request({
|
app.restAjax.get(app.restAjax.path('{venueUrl}/app/venuesinfo/getvenuesinfobyidrelease/{venuesInfoId}',[app.venueUrl, self.data.venuesInfoId]),
|
||||||
url: self.data.baseUrl + 'app/venuesinfo/getvenuesinfobyidrelease/' + self.data.venuesInfoId,
|
{
|
||||||
data: {
|
|
||||||
resultLocation: 'TX'
|
resultLocation: 'TX'
|
||||||
},
|
}, null, function(code, data){
|
||||||
success:(res) => {
|
var swiperImg = data.venuePanorama.split(',');
|
||||||
var swiperImg = res.data.venuePanorama.split(',');
|
|
||||||
if(swiperImg.length <= 1){
|
if(swiperImg.length <= 1){
|
||||||
self.setData({
|
self.setData({
|
||||||
indicatorDots: false,
|
indicatorDots: false,
|
||||||
autoplay: false
|
autoplay: false
|
||||||
})
|
})
|
||||||
}
|
};
|
||||||
self.setData({
|
self.setData({
|
||||||
venuesDetail: res.data,
|
venuesDetail: data,
|
||||||
swiperImg: swiperImg,
|
swiperImg: swiperImg,
|
||||||
venueCharge: res.data.venueCharge
|
venueCharge: data.venueCharge
|
||||||
});
|
});
|
||||||
console.log(self.data.venuesDetail);
|
}, function(code,data){
|
||||||
|
app.dialog.msg(data.msg);
|
||||||
}
|
}
|
||||||
})
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
//获取项目列表
|
//获取项目列表
|
||||||
listVenuesProject: function(){
|
listVenuesProject: function(){
|
||||||
var self = this;
|
var self = this;
|
||||||
wx.request({
|
app.restAjax.get(app.restAjax.path('{venueUrl}/app/venuesproject/listprojectinforelease/{venuesInfoId}', [app.venueUrl, self.data.venuesInfoId]), {}, null ,
|
||||||
url: self.data.baseUrl + 'app/venuesproject/listprojectinforelease/' + self.data.venuesInfoId,
|
function(code,data){
|
||||||
success: (res) => {
|
|
||||||
self.setData({
|
self.setData({
|
||||||
venuesProjectList: res.data
|
venuesProjectList: data
|
||||||
});
|
});
|
||||||
if(self.data.venuesProjectList.length > 0){
|
if(self.data.venuesProjectList.length > 0){
|
||||||
self.setData({
|
self.setData({
|
||||||
@ -60,8 +57,10 @@ Page({
|
|||||||
});
|
});
|
||||||
self.getVenuesProjectDetail();
|
self.getVenuesProjectDetail();
|
||||||
};
|
};
|
||||||
|
}, function(code, data){
|
||||||
|
app.dialog.msg(data.msg);
|
||||||
}
|
}
|
||||||
})
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
//切换当前选择项目
|
//切换当前选择项目
|
||||||
@ -79,21 +78,22 @@ Page({
|
|||||||
//获取项目详情信息
|
//获取项目详情信息
|
||||||
getVenuesProjectDetail: function(){
|
getVenuesProjectDetail: function(){
|
||||||
var self = this;
|
var self = this;
|
||||||
wx.request({
|
app.restAjax.get(app.restAjax.path('{venueUrl}/app/venuesproject/getvenuesprojectdetailrelease/{selectVenuesProject}',
|
||||||
url: self.data.baseUrl + 'app/venuesproject/getvenuesprojectdetailrelease/' + self.data.selectVenuesProject,
|
[app.venueUrl, self.data.selectVenuesProject]), {}, null,
|
||||||
success: function(res){
|
function(code,data){
|
||||||
|
console.log(data);
|
||||||
self.setData({
|
self.setData({
|
||||||
selectVenuesProjectDetail: res.data.data
|
selectVenuesProjectDetail: data.data
|
||||||
});
|
});
|
||||||
|
}, function(code,data){
|
||||||
|
app.dialog.msg(data.msg);
|
||||||
}
|
}
|
||||||
});
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
//场馆地图导航
|
//场馆地图导航
|
||||||
showMap: function(options){
|
showMap: function(options){
|
||||||
console.log(options);
|
|
||||||
var dataObj = options.currentTarget.dataset
|
var dataObj = options.currentTarget.dataset
|
||||||
console.log(dataObj.latitude + 0)
|
|
||||||
wx.openLocation({//使用微信内置地图查看位置。
|
wx.openLocation({//使用微信内置地图查看位置。
|
||||||
latitude: Number(dataObj.latitude),//要去的纬度-地址
|
latitude: Number(dataObj.latitude),//要去的纬度-地址
|
||||||
longitude: Number(dataObj.longitude),//要去的经度-地址
|
longitude: Number(dataObj.longitude),//要去的经度-地址
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<view class="swiper-box">
|
<view class="swiper-box">
|
||||||
<swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" >
|
<swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" >
|
||||||
<swiper-item class="swiper-item" wx:for="{{swiperImg}}">
|
<swiper-item class="swiper-item" wx:for="{{swiperImg}}" wx:key="index">
|
||||||
<image src="{{baseUrl}}{{imgRoute}}{{item}}"></image>
|
<image src="{{venueUrl}}{{imgRoute}}{{item}}"></image>
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
</swiper>
|
</swiper>
|
||||||
</view>
|
</view>
|
||||||
@ -28,7 +28,7 @@
|
|||||||
<view wx:if="{{venuesProjectList.length > 0}}">
|
<view wx:if="{{venuesProjectList.length > 0}}">
|
||||||
<view class="selecet-tab">
|
<view class="selecet-tab">
|
||||||
<view class="tab-btn {{selectVenuesProject == item.venuesProjectId ? 'active' : ''}}"
|
<view class="tab-btn {{selectVenuesProject == item.venuesProjectId ? 'active' : ''}}"
|
||||||
wx:for="{{venuesProjectList}}" bindtap="changeVenuesProject" data-id="{{item.venuesProjectId}}">{{item.projectName}}</view>
|
wx:for="{{venuesProjectList}}" wx:key="index" bindtap="changeVenuesProject" data-id="{{item.venuesProjectId}}">{{item.projectName}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="tab-info">
|
<view class="tab-info">
|
||||||
<view class="tab-content">
|
<view class="tab-content">
|
||||||
|
Loading…
Reference in New Issue
Block a user