133 lines
2.4 KiB
JavaScript
133 lines
2.4 KiB
JavaScript
const { getRoomDeatil, roomPrepare } = require("../../../utils/serve/user")
|
|
|
|
// subpackage/teacher/room-detail/room-datial.js
|
|
Page({
|
|
|
|
/**
|
|
* 页面的初始数据
|
|
*/
|
|
data: {
|
|
id:0,
|
|
detail:{
|
|
|
|
},
|
|
buttons: [
|
|
{
|
|
type: 'default',
|
|
className: '',
|
|
text: '取消',
|
|
value: 0
|
|
},
|
|
{
|
|
type: 'primary',
|
|
className: '',
|
|
text: '确定',
|
|
value: 1
|
|
}
|
|
],
|
|
show:false
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
async onLoad(options) {
|
|
const that = this
|
|
const id = options.id
|
|
const detail = await getRoomDeatil({
|
|
stadiumId:id
|
|
})
|
|
this.setData({
|
|
detail: detail.data
|
|
})
|
|
},
|
|
|
|
async buttontap(e) {
|
|
console.log(e.detail)
|
|
if(e.detail.index == 0){
|
|
this.setData({
|
|
show:false
|
|
})
|
|
}else {
|
|
const res = await roomPrepare(this.data.detail.id)
|
|
|
|
wx.navigateTo({
|
|
url: '/subpackage/teacher/prepare-success/prepare-success',
|
|
})
|
|
this.setData({
|
|
show:false
|
|
})
|
|
}
|
|
},
|
|
|
|
goMap(e){
|
|
console.log(e)
|
|
console.log(e.currentTarget.dataset.latitude)
|
|
wx.openLocation({
|
|
latitude:Number(e.currentTarget.dataset.latitude),
|
|
longitude:Number(e.currentTarget.dataset.longitude),
|
|
// longitude:Number(e.currentTarget.latitude),
|
|
// latitude:Number(e.currentTarget.longitude),
|
|
name:e.currentTarget.dataset.name
|
|
})
|
|
},
|
|
|
|
async goPre(id){
|
|
// wx.
|
|
// const res = await roomPrepare({
|
|
// stadiumCode:e.currentTarget.dataset.id
|
|
// })
|
|
this.setData({
|
|
show:true
|
|
})
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
*/
|
|
onReady() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面显示
|
|
*/
|
|
onShow() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面隐藏
|
|
*/
|
|
onHide() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面卸载
|
|
*/
|
|
onUnload() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
*/
|
|
onPullDownRefresh() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 页面上拉触底事件的处理函数
|
|
*/
|
|
onReachBottom() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 用户点击右上角分享
|
|
*/
|
|
onShareAppMessage() {
|
|
|
|
}
|
|
}) |