125 lines
2.9 KiB
TypeScript
125 lines
2.9 KiB
TypeScript
// pages/backlog/insurance/insurance.ts
|
|
import { getAction } from '../../../api/base';
|
|
|
|
Page({
|
|
/**
|
|
* 页面的初始数据
|
|
*/
|
|
data: {
|
|
tabActive: 0,
|
|
id: '',
|
|
item: {} as any
|
|
},
|
|
|
|
getDetailInf() {
|
|
let parms = {
|
|
id: this.data.id
|
|
};
|
|
getAction('api/vehicles/backlog/getInsuranceRecordById', parms).then(
|
|
(res: any) => {
|
|
if (res.code == 200) {
|
|
console.log(res.result);
|
|
// res.result.forEach((item: any) => {
|
|
res.result.accidentUrlList = res.result.accidentUrl
|
|
? res.result.accidentUrl.split(',')
|
|
: [];
|
|
res.result.compensateAgreementUrlList = res.result
|
|
.compensateAgreementUrl
|
|
? res.result.compensateAgreementUrl.split(',')
|
|
: [];
|
|
res.result.lossAssessmentUrlList = res.result.lossAssessmentUrl
|
|
? res.result.lossAssessmentUrl.split(',')
|
|
: [];
|
|
res.result.compensateUrlList = res.result.compensateUrl
|
|
? res.result.compensateUrl.split(',')
|
|
: [];
|
|
res.result.otherUrlList = res.result.otherUrl
|
|
? res.result.otherUrl.split(',')
|
|
: [];
|
|
// });
|
|
this.setData({
|
|
item: res.result
|
|
});
|
|
} else {
|
|
wx.showToast({
|
|
title: res.message,
|
|
icon: 'none'
|
|
});
|
|
}
|
|
}
|
|
);
|
|
},
|
|
previewImg(e: any) {
|
|
let that = this;
|
|
let { index, key } = e.currentTarget.dataset;
|
|
wx.previewImage({
|
|
current: that.data.item[key][index | 0], // 当前显示图片的http链接 默认urls[0]
|
|
urls: that.data.item[key] // 需要预览的图片http链接列表
|
|
});
|
|
},
|
|
toFeedback() {
|
|
let that = this;
|
|
// 违章信息
|
|
wx.setStorageSync('violation', '');
|
|
// 跳转到违章处理反馈
|
|
wx.navigateTo({
|
|
url: '../insuranceFeedback/insuranceFeedback',
|
|
success: function (res) {
|
|
// 通过eventChannel向被打开页面传送数据
|
|
res.eventChannel.emit('eventName', { ...that.data.item });
|
|
},
|
|
fail: e => {
|
|
console.log(e);
|
|
}
|
|
});
|
|
},
|
|
/**
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
onLoad() {
|
|
const eventChannel = this.getOpenerEventChannel();
|
|
getApp().EventChannel = eventChannel;
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
*/
|
|
onReady() {
|
|
let id = wx.getStorageSync('backlogInf').id;
|
|
this.setData({
|
|
id: id
|
|
});
|
|
this.getDetailInf();
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面显示
|
|
*/
|
|
onShow() {},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面隐藏
|
|
*/
|
|
onHide() {},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面卸载
|
|
*/
|
|
onUnload() {},
|
|
|
|
/**
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
*/
|
|
onPullDownRefresh() {},
|
|
|
|
/**
|
|
* 页面上拉触底事件的处理函数
|
|
*/
|
|
onReachBottom() {},
|
|
|
|
/**
|
|
* 用户点击右上角分享
|
|
*/
|
|
onShareAppMessage() {}
|
|
});
|