榆山
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.

114 lines
2.4 KiB

2 years ago
// subpages/houseAudit/page/audit/audit.js
import api from "../../../../api/houseAudit"
Page({
/**
* 页面的初始数据
*/
data: {
houseDetailObj:{},
swiperCurrent:1,
tabFlag:0
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
let decodeObj = decodeURIComponent(options.houseObj)
let obj = JSON.parse(decodeObj)
obj.createdTime = obj.createdTime.substr(0,10)
this.setData({
houseDetailObj:obj,
tabFlag:options.houseFlag
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
},
swiperChange(e){
this.setData({
swiperCurrent:e.detail.current + 1
})
console.log(this.data.swiperCurrent);
},
navigatetoBannerDetail(){
console.log(this.data.swiperCurrent);
wx.previewImage({
current: this.data.swiperCurrent, // 当前显示图片的http链接
urls: this.data.houseDetailObj.photoList // 需要预览的图片http链接列表
})
},
handleilcikAudit(e){
console.log(e);
let num = parseInt(e.currentTarget.dataset.value)
console.log(typeof num);
let par = {
id:this.data.houseDetailObj.id,
auditStatus:num
}
api.housesalerentinfoAudit(par).then(res=>{
if(res.code==0){
wx.showLoading({
title: '操作完成',
mask: true,
})
}else if(res.code == 500){
wx.showLoading({
title: res.msg,
mask: true,
})
}
wx.hideLoading()
wx.navigateBack()
}).catch(err=>{
console.log(err);
})
}
})