租房掌柜微信小程序Api以及小程序前端模板
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

70 lines
1.4 KiB

var app = getApp();
var netUtil = require("../../utils/requestUtil.js"); //require引入
Page({
/**
* 页面的初始数据
*/
data: {
id: '',
data: null,
StatusBar: app.globalData.StatusBar,
CustomBar: app.globalData.CustomBar,
index: null,
multiIndex: [0, 0, 0],
time: '12:01',
startTime: '2018-12-25',
endTime: '2019-12-25',
region: ['安徽省', '合肥市', '高新区'],
imgList: [],
modalName: null,
textareaAValue: '',
textareaBValue: '',
roomUrl: '/pages/house/room/view'
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
this.setData({
id: options.id
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
this.getDetail();
},
ViewImage(e) {
wx.previewImage({
urls: this.data.imgList,
current: e.currentTarget.dataset.url
});
},
//获取数据详情
getDetail: function() {
var self = this;
var url = app.globalData.requestUrl + 'index/house/view/' + this.data.id;
netUtil.sendGet(url)
.then((res) => {
this.setData({
data: res.data.data,
imgList: res.data.data.house.imgList
})
})
},
//拨打电话
phoneCall: function(e) {
var phone = e.currentTarget.dataset.phone;
wx.makePhoneCall({
phoneNumber: phone,
})
},
})