12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- const _my = require("../../../../__antmove/api/index.js")(my);
- const wx = _my;
- const {
- disinfectSetOpenId
- } = require("../../../../utils/api/xiaosha");
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- userInfo: wx.getStorageSync("userInfo")
- },
- scanCode() {
- let data = {
- userId: this.data.userInfo.userId
- };
- disinfectSetOpenId(data).then(res => {
- // 只允许从相机扫码
- wx.scanCode({
- onlyFromCamera: true,
- scanType: ["qrCode"],
- success(res) {
- console.log(res);
- if (res.result.indexOf("https://tx.hz-hanghui.com:8088/yx-fyzd?disinfectAreaId") != -1) {
- //是否有参数
- let str = res.result.substr(1);
- let strs = str.split("=");
- wx.navigateTo({
- url: "/pages/wx_airport/Xiaosha_registration/index?disinfectAreaId=" + strs[1]
- });
- } else {
- wx.showToast({
- title: "扫码失败,请重试!",
- icon: "none"
- });
- }
- }
- });
- });
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad(options) {},
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady() {},
- /**
- * 生命周期函数--监听页面显示
- */
- onShow() {},
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide() {},
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload() {},
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh() {},
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom() {},
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage() {},
- antmoveAction: function () {
- //执行时动态赋值,请勿删除
- }
- });
|