xi_sangzhuzi/pages/venueDetail/venueDetail.js
2022-11-10 10:22:40 +08:00

125 lines
2.6 KiB
JavaScript

var app = getApp();
// pages/venueDetail/venueDetail.js
Page({
/**
* 页面的初始数据
*/
data: {
venueUrl: app.venueUrl,
imgRoute : '/route/file/download/true/',
indicatorDots: true,
autoplay: true,
venuesInfoId: '',
venuesDetail:{},
venuesProjectList: [],
swiperImg:[],
venueCharge: '',
hasProject:''
},
//场馆详情接口
getVenuesDetail: function(){
var self = this;
app.restAjax.get(app.restAjax.path('{venueUrl}/app/venuesinfo/getvenuesinfobyidrelease/{venuesInfoId}',[app.venueUrl, self.data.venuesInfoId]),
{
resultLocation: 'TX'
}, null, function(code, data){
var src = 'img src="' + app.venueUrl + '/'
if(data.venueDescription.indexOf('src="') != -1){
data.venueDescription = data.venueDescription.replace(/src="/g, src)
}
var swiperImg = data.venuePanorama.split(',');
if(swiperImg.length <= 1){
self.setData({
indicatorDots: false,
autoplay: false
})
};
self.setData({
venuesDetail: data,
swiperImg: swiperImg,
venueCharge: data.venueCharge,
hasProject : data.hasProject
});
}, function(code,data){
app.dialog.msg(data.msg);
}
);
},
//场馆地图导航
showMap: function(options){
var dataObj = options.currentTarget.dataset
wx.openLocation({//​使用微信内置地图查看位置。
latitude: Number(dataObj.latitude),//要去的纬度-地址
longitude: Number(dataObj.longitude),//要去的经度-地址
name: dataObj.venuename,
address: dataObj.venueposition
});
},
goBooking: function(){
wx.navigateTo({
url: '../book/book?venuesInfoId=' + this.data.venuesInfoId,
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
venuesInfoId: options.venuesInfoId
});
this.getVenuesDetail();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})