2025-04-22 14:39:59 +08:00

114 lines
1.9 KiB
JavaScript

import { postUrl } from '~/utils/util';
import apiArr from '../../../../api/water_filter';
const app = getApp()
// pages/water_filter/MaintenanceInfo/MaintenanceInfo.js
Page({
/**
* 页面的初始数据
*/
data: {
s: app.system.statusBarHeight, // 状态栏高度
n: (app.menu.top - app.system.statusBarHeight) * 2 + app.menu.height, // 导航栏高度
t: app.menu.top, // 胶囊局顶部距离
h: app.menu.height, // 胶囊高度
tabIndex:0,
repairId: '', // 请求id 父页面传递
repairInfo: {},
},
changeTabItem(e){
let that = this;
that.setData({
tabIndex:e.target.dataset.index
})
let text = ''
if(e.target.dataset.index == 1){
text='报修进度'
}else{
text = '报修详情'
}
wx.setNavigationBarTitle({
title: text,
});
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
console.log('1111', options);
this.setData({
repairId: options.repairId
})
postUrl(apiArr.BXOneRepair, {
repair_id: Number(options.repairId),
user_id:Number(wx.getStorageSync('userId'))
}, res => {
console.log('res', res);
this.setData({
repairInfo: res
})
})
},
headerTelClick() {
const { repairInfo } = this.data;
wx.makePhoneCall({
phoneNumber: repairInfo.repairman_phone
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})