Const base64=the require ("../../utils/base64. Js ");
Var app=getApp ();
Page ({
Data: {
Banquan: app. GlobalData. Banquan.
IP: "'
Show_r: "'
Show_img: 'yes',
ImageBase64Str: "'
Location: "'
Height: '100%',
},
Banquan: function () {
},
QueryIp: function (res, options) {
let that=this;
//allow sweep from the camera and photo album code
Wx. ScanCode ({
Success (res) {
console.log(res);
Var location_text="";
If (res) result=="*" | | res. Result=="") {
Location_text="[content] after decoding:" + base64. Decode (res) rawData);
} else {
Location_text="[content] after decoding:" + res. Result;
}
Location_text=location_text + "\ r \ n \ n [decoding type] :" + res. ScanType;
If (res) scanType=="QR_CODE" | | res. ScanType=="DATA_MATRIX" | | res. ScanType=="PDF_417") {
Location_text=location_text + "(qr code)";
} else if (res) scanType=="WX_CODE") {
Location_text=location_text + "(small program code)";
} else {
Location_text=location_text + "(one dimensional code)";
}
Location_text=location_text + "\ r \ n \ n [character] :" + res. CharSet.
If (res) path!="undefined" & amp; & Res. The path!="" & amp; & Res. The path!=null) {
Location_text=location_text + "\ r \ n \ n (Path) :" + res. The Path;
}
Location_text=location_text + "\ r \ n \ n [shelves] :" + getNo;
That the setData ({
Show_r: 'yes',
Show_img: "'
Location: location_text,
})
},
//get the value of the current page
Fail (res) {
console.log(res);
/* that setData ({
Show_r: 'yes',
Show_img: "'
Location: "identification error: \ r \ n" + res., errMsg
}) */
},
Complete (res) {
},
})
},
Consult everybody, how do I take the current page scan code after the results, is to "res. The result" as variables, to last in cloud database query,
CodePudding user response:
Via HTTP or ajax request will you scan results are passed to the backend server, sever again through the background and your cloud database interactive query, query the return the results to the front pageCodePudding user response:
Principle is the way it is, how to fetch the data on the page? Will res. The result of the results generated a new object?