setCD : function(){
let ruku = this.data.ruku;
let chuku = this.data.chuku;
let os = this.data.os;
let arm = this.data.arm;
let clipboardData = '';
let tempVariableA = new Date().toLocaleString();
let tempVariableB = "";
let tempVariableC = "";
let fault = this.data.choiseId;
if (fault) {
if (chuku.some(item => item.id === fault)) {
tempVariableB = "出库";
} else if (ruku.some(item => item.id === fault)) {
tempVariableB = "入库";
} else if (os.some(item => item.id === fault)) {
tempVariableB = "";
}
};
if (arm) {
tempVariableC = ruku.find(item => item.id === arm)?.name || "";
};
clipboardData = tempVariableA + "\n" + tempVariableB + tempVariableC + "发生故障";
wx.setClipboardData({
data: clipboardData,
success (res) {
wx.getClipboardData({
success (res) {
wx.showToast({
title: '故障信息已经复制到粘贴板',
icon: 'success',
duration: 3000
});
}
})
}
});
},
wx.request({
url: this.data.url,
method: 'POST',
data: jsonData,
success: function(res) {
console.log(res.data);
this.setCD();
wx.showToast({
title: '提交成功',
icon: 'success',
duration: 3000
});
},
fail: function(error) {
console.log(error);
}
});
request调用setcd就报错
setcd 是啥