110 lines
2.1 KiB
JavaScript
110 lines
2.1 KiB
JavaScript
const app = getApp();
|
|
Page({
|
|
|
|
/**
|
|
* 页面的初始数据
|
|
*/
|
|
data: {
|
|
isProve: false, //是否已核销成功
|
|
pageMode: null, //页面类型。提交还是核销
|
|
loading: true,
|
|
showCode: false, //核销码弹窗
|
|
finish: false, //倒计时已结束
|
|
status: 0,
|
|
field: {},
|
|
code_url: "", //核销码图片地址
|
|
dataId: "", //提交后的表单数据id
|
|
timer: null,
|
|
|
|
thumb: null,
|
|
description: null
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
onLoad: function (options) {
|
|
this.data.id = this.options.id;
|
|
this.getData();
|
|
},
|
|
getData() {
|
|
// 获取表单数据
|
|
if (!this.options.id) {
|
|
return;
|
|
}
|
|
let urlStr = app.getNetAddresss("plugin.diy-form-prove.frontend.controllers.prove.dataLogDetail");
|
|
app._postNetWork({
|
|
url: urlStr,
|
|
data: {
|
|
id: this.data.id
|
|
},
|
|
success: (resdata) => {
|
|
let res = resdata.data;
|
|
if (res.result == 1) {
|
|
this.setData({
|
|
thumb: res.data.form_data.thumb || null,
|
|
description:res.data.form_data.description || null,
|
|
loading: false,
|
|
field: res.data.form_data.fields,
|
|
status: 1,
|
|
});
|
|
} else {
|
|
wx.showToast({
|
|
icon: "none",
|
|
title: res.msg,
|
|
duration: 1000,
|
|
});
|
|
}
|
|
},
|
|
fail: (res) => {
|
|
console.log(res);
|
|
},
|
|
});
|
|
},
|
|
/**
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
*/
|
|
onReady: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面显示
|
|
*/
|
|
onShow: function () {},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面隐藏
|
|
*/
|
|
onHide: function () {},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面卸载
|
|
*/
|
|
onUnload: function () {
|
|
},
|
|
|
|
/**
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
*/
|
|
onPullDownRefresh: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 页面上拉触底事件的处理函数
|
|
*/
|
|
onReachBottom: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 用户点击右上角分享
|
|
*/
|
|
onShareAppMessage: function () {
|
|
return {
|
|
title: this.data.thumb,
|
|
imageUrl: this.data.description
|
|
};
|
|
}
|
|
}); |