wxml:
<form bindsubmit='openGroupSubmit' report-submit='true'>
<view class="btn-area">
<button formType="submit">Submit</button>
</view>
</form>
js:
openGroupSubmit: function (e) {
let formId = e.detail.formId;
if ('the formId is a mock one' == formId) {
return;
}
// this.dealFormIds(formId);
var nowDate = new Date();
var month = nowDate.getMonth() + 1;
var date = nowDate.getDate();
if (month < 10) {
month = '0' + month;
}
if (date < 10) {
date = '0' + date;
}
let formIds = app.globalData.formIds;
if (!formIds) formIds = [];
let data = {
formId: nowDate.getFullYear() + '-' + month + '-' + date + '_' + formId,
expire: parseInt(new Date().getTime() / 1000) + 604800
}
formIds.push(data);
app.globalData.formIds = formIds;
console.log(formIds);
let type = e.detail.target.dataset.type;
},