// pages/find/webview.js import { wxRequestPost } from "@utils/promise-wx-api"; const app = getApp(); Component({ /** * 组件的属性列表 */ properties: {}, /** * 组件的初始数据 */ data: { funcSrc: "", functionId: "", }, /** * 组件的方法列表 */ methods: { onLoad(options) { wx.setNavigationBarTitle({ title: options.functionName || "", }); const { customerId, gridId, token } = app.globalData; let src = decodeURIComponent(options.src); let customerParameter = options.customerParameter ? "&" + options.customerParameter : ""; if (src.indexOf("?") != -1) src = src + "&customerId=" + customerId + "&gridId=" + gridId + "&Authorization=" + token + customerParameter; else src = src + "?customerId=" + customerId + "&gridId=" + gridId + "&Authorization=" + token + customerParameter; console.log("urlllll", src); this.setData({ funcSrc: src, functionId: options.functionId, }); }, async handleLoad(type, msgs) { console.log("msgfdsfas", msgs); const { data: { data: { code, data }, }, msg, } = await wxRequestPost( "oper/customize/functioncustomizedvisited/saveresifunctionvisited", { clientType: "resi", customerId: app.globalData.customerId, functionId: this.data.functionId, url: this.data.funcSrc, result: type, msg: msgs, }, { // isMock: true, // isQuiet: true } ); if (msg === "success" && code === 0) { } }, handleError(e) { this.handleLoad("error", e.detail.src); }, handleSuccess(e) { this.handleLoad("success", e.detail.src); }, }, });