日照项目的居民端小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

89 lines
2.1 KiB

// 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);
},
},
});