Selaa lähdekoodia

fix: 修改监控买点

carver 2 vuotta sitten
vanhempi
commit
fad9044a00

+ 302 - 286
antbuilder/core/utils/index.js

@@ -1,394 +1,410 @@
 import {
-  prefixPagePath,
-  serviceReportUrl,
-  serviceReportCloudMonitorUrl,
-  checkCertifyValidUrl,
-  authAndApplyFaceUrl,
-  authCertTypeUrl,
-  dynamicPageName,
-} from './constants';
-import { getServerTime, getSystemInfo, getAuthUser, startAPVerify, getAppId } from './jsapi';
-import request, { getTicket } from './request';
-import monitor from './alipayLogger';
-import queryString from 'query-string';
-
-export * from './request';
-export * from './jsapi';
-export * from './registerHooks';
-export * from './constants';
-export * from './service';
+	prefixPagePath,
+	serviceReportUrl,
+	serviceReportCloudMonitorUrl,
+	checkCertifyValidUrl,
+	authAndApplyFaceUrl,
+	authCertTypeUrl,
+	dynamicPageName,
+} from "./constants";
+import {
+	getServerTime,
+	getSystemInfo,
+	getAuthUser,
+	startAPVerify,
+	getAppId,
+} from "./jsapi";
+import request, { getTicket } from "./request";
+import monitor from "./alipayLogger";
+import queryString from "query-string";
+
+export * from "./request";
+export * from "./jsapi";
+export * from "./registerHooks";
+export * from "./constants";
+export * from "./service";
 
 export function sleep(timeout = 1000) {
-  return new Promise((resolve) => {
-    setTimeout(resolve, timeout);
-  });
+	return new Promise((resolve) => {
+		setTimeout(resolve, timeout);
+	});
 }
 
 // 验证邮箱是否合法
 export function verifyEmail(email) {
-  const reg = new RegExp('^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$', 'img');
-  return !email || !reg.test(email);
+	const reg = new RegExp(
+		"^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$",
+		"img"
+	);
+	return !email || !reg.test(email);
 }
 
 export function debounce(fn, delay = 0, ctx) {
-  let timer;
-  return function _(...args) {
-    clearTimeout(timer);
-    timer = setTimeout(() => {
-      fn.apply(ctx, args);
-    }, delay);
-  };
+	let timer;
+	return function _(...args) {
+		clearTimeout(timer);
+		timer = setTimeout(() => {
+			fn.apply(ctx, args);
+		}, delay);
+	};
 }
 
 export function throttle(fn, wait = 800) {
-  let start = Date.now();
-  return function () {
-    const ctx = this;
-    // eslint-disable-next-line prefer-rest-params
-    const args = arguments;
-    const now = Date.now();
-    if (now - start >= wait) {
-      fn.apply(ctx, args);
-      start = now;
-    }
-  };
+	let start = Date.now();
+	return function () {
+		const ctx = this;
+		// eslint-disable-next-line prefer-rest-params
+		const args = arguments;
+		const now = Date.now();
+		if (now - start >= wait) {
+			fn.apply(ctx, args);
+			start = now;
+		}
+	};
 }
 
 async function jump(payload) {
-  try {
-    if (payload && payload.type === 'navigateBack') {
-      my.navigateBack({
-        delta: payload.delta || 1,
-      });
-    }
-    if (payload && payload.isToService) {
-      return this.dispatchGlobal('handleJumpService', payload);
-    }
-    if (!payload || !payload.url) return false;
-    if (!payload.isToService) return my.navigateTo({ url: payload.url });
-  } catch (error) {
-    console.error(error);
-  }
+	try {
+		if (payload && payload.type === "navigateBack") {
+			my.navigateBack({
+				delta: payload.delta || 1,
+			});
+		}
+		if (payload && payload.isToService) {
+			return this.dispatchGlobal("handleJumpService", payload);
+		}
+		if (!payload || !payload.url) return false;
+		if (!payload.isToService) return my.navigateTo({ url: payload.url });
+	} catch (error) {
+		console.error(error);
+	}
 }
 
 export const navigateTo = throttle(jump);
 
 export function jumpPageLoginFailure({ accessDenyBack, accessDenyUrl }) {
-  if (accessDenyBack === 'back') {
-    my.navigateBack();
-    return;
-  }
-  if (accessDenyBack === 'page') {
-    let pageUuid = '';
-    let url = '';
-    if (accessDenyUrl.indexOf(':') > -1) {
-      pageUuid = accessDenyUrl.split(':')[1];
-      url = `${prefixPagePath}/${dynamicPageName}/index?pageUuid=${pageUuid}`;
-    } else {
-      url = accessDenyUrl;
-    }
-    my.redirectTo({
-      url,
-    });
-  }
+	if (accessDenyBack === "back") {
+		my.navigateBack();
+		return;
+	}
+	if (accessDenyBack === "page") {
+		let pageUuid = "";
+		let url = "";
+		if (accessDenyUrl.indexOf(":") > -1) {
+			pageUuid = accessDenyUrl.split(":")[1];
+			url = `${prefixPagePath}/${dynamicPageName}/index?pageUuid=${pageUuid}`;
+		} else {
+			url = accessDenyUrl;
+		}
+		my.redirectTo({
+			url,
+		});
+	}
 }
 
 async function checkTimeExpire(time) {
-  if (!time) return false;
-  const [err, res] = await getServerTime();
-  const currentTime = err ? new Date().getTime() : +res.time;
-  return time < currentTime;
+	if (!time) return false;
+	const [err, res] = await getServerTime();
+	const currentTime = err ? new Date().getTime() : +res.time;
+	return time < currentTime;
 }
 
 export function isObj(obj) {
-  return Object.prototype.toString.call(obj) === '[object Object]';
+	return Object.prototype.toString.call(obj) === "[object Object]";
 }
 
 export function toUrl(obj) {
-  if (!obj || !isObj(obj)) {
-    return '';
-  }
-  return Object.keys(obj).reduce((p, v, i) => `${p}${i ? '&' : ''}${v}=${obj[v]}`, '?');
+	if (!obj || !isObj(obj)) {
+		return "";
+	}
+	return Object.keys(obj).reduce(
+		(p, v, i) => `${p}${i ? "&" : ""}${v}=${obj[v]}`,
+		"?"
+	);
 }
 
 export function paramsParse(params) {
-  if (typeof params !== 'string') return {};
-  const search = params.split('?')[1];
-  const replaceHandler = function (key, value) {
-    return key === '' ? value : decodeURIComponent(value);
-  };
-  return search ? JSON.parse(`{"${search.replace(/&/g, '","').replace(/=/g, '":"')}"}`, replaceHandler) : {};
+	if (typeof params !== "string") return {};
+	const search = params.split("?")[1];
+	const replaceHandler = function (key, value) {
+		return key === "" ? value : decodeURIComponent(value);
+	};
+	return search
+		? JSON.parse(
+				`{"${search.replace(/&/g, '","').replace(/=/g, '":"')}"}`,
+				replaceHandler
+		  )
+		: {};
 }
 
-
 export function parseUrlQuery(url, noDecodeURI) {
-  if (!url) return {};
-  const search = url.substring(url.lastIndexOf('?') + 1);
-  const reg = /([^?&=]+)=([^?=&]*)/g;
-  const hash = {};
-  search.replace(reg, (match, $1, $2) => {
-    const key = decodeURIComponent($1);
-    const value = decodeURIComponent($2);
-    if (!noDecodeURI) {
-      hash[key] = value;
-    } else {
-      hash[$1] = $2;
-    }
-    return match;
-  });
-  return hash;
+	if (!url) return {};
+	const search = url.substring(url.lastIndexOf("?") + 1);
+	const reg = /([^?&=]+)=([^?=&]*)/g;
+	const hash = {};
+	search.replace(reg, (match, $1, $2) => {
+		const key = decodeURIComponent($1);
+		const value = decodeURIComponent($2);
+		if (!noDecodeURI) {
+			hash[key] = value;
+		} else {
+			hash[$1] = $2;
+		}
+		return match;
+	});
+	return hash;
 }
 
 export function replaceUrlParam(url, key, value) {
-  const reg = new RegExp(`${key}=([^&]*)`, 'i');
-  const result = url.replace(reg, `${key}=${value}`);
-  return result;
+	const reg = new RegExp(`${key}=([^&]*)`, "i");
+	const result = url.replace(reg, `${key}=${value}`);
+	return result;
 }
 
 export function getUrlProtocal(url) {
-  return url.split(':')[0].toLowerCase();
+	return url.split(":")[0].toLowerCase();
 }
 export async function checkTicketExpire() {
-  // eslint-disable-next-line no-undef
-  const app = getApp();
-  const { expiresTime } = app.globalData.ticketData;
-  const isExpire = await checkTimeExpire(expiresTime);
-  if (!isExpire) {
-    return [undefined, isExpire];
-  }
-  const result = await getTicket();
-  return result;
+	// eslint-disable-next-line no-undef
+	const app = getApp();
+	const { expiresTime } = app.globalData.ticketData;
+	const isExpire = await checkTimeExpire(expiresTime);
+	if (!isExpire) {
+		return [undefined, isExpire];
+	}
+	const result = await getTicket();
+	return result;
 }
 
 export async function serviceReportCM(payload) {
-  try {
-    const sysInfo = await getSystemInfo();
-    // eslint-disable-next-line
-    const page = getCurrentPages().pop().__proto__.route || '';
-    const data = {
-      sysInfo: JSON.stringify(sysInfo),
-      page,
-      ...payload,
-    };
-    const result = await request({
-      url: serviceReportCloudMonitorUrl,
-      data,
-    });
-    return result;
-  } catch (error) {
-    return error;
-  }
+	try {
+		const sysInfo = await getSystemInfo();
+		// eslint-disable-next-line
+		const page = getCurrentPages().pop().__proto__.route || "";
+		const data = {
+			sysInfo: JSON.stringify(sysInfo),
+			page,
+			...payload,
+		};
+		const result = await request({
+			url: serviceReportCloudMonitorUrl,
+			data,
+		});
+		return result;
+	} catch (error) {
+		return error;
+	}
 }
 
 // 新: 上报光华平台
-export async function reportCmPV({ title, query, tag = 'h5SE_YL' } = {}) {
-  if (!title) return; // title是必填项
-  const url = getCurrentPages()[getCurrentPages().length - 1].route;
-  let { appId } = getApp().globalData;
-  if (!appId) {
-    appId = getAppId();
-  }
-  let encodedUrl;
-  if (query && Object.keys(query).length > 0) {
-    encodedUrl = encodeURIComponent(`${url}?${queryString.stringify(query)}`);
-  } else {
-    encodedUrl = encodeURIComponent(`${url}`);
-  }
-  const myUrl = `alipays://platformapi/startapp?appId=${appId}&page=${encodedUrl}`;
-  monitor._lgPV({
-    page: title,
-    url,
-    c1: tag,
-    c2: myUrl,
-  });
+export async function reportCmPV({ title, query, tag = "taSR_YL" } = {}) {
+	if (!title) return; // title是必填项
+	const url = getCurrentPages()[getCurrentPages().length - 1].route;
+	let { appId } = getApp().globalData;
+	if (!appId) {
+		appId = getAppId();
+	}
+	let encodedUrl;
+	if (query && Object.keys(query).length > 0) {
+		encodedUrl = encodeURIComponent(`${url}?${queryString.stringify(query)}`);
+	} else {
+		encodedUrl = encodeURIComponent(`${url}`);
+	}
+	const myUrl = `alipays://platformapi/startapp?appId=${appId}&page=${encodedUrl}`;
+	monitor._lgPV({
+		page: title,
+		url,
+		c1: tag,
+		c2: myUrl,
+	});
 }
 
 export async function serviceReport(payload) {
-  try {
-    const sysInfo = await getSystemInfo();
-    const data = {
-      sysInfo: JSON.stringify(sysInfo),
-      ...payload,
-    };
-    const result = await request({
-      url: serviceReportUrl,
-      data,
-    });
-    return result;
-  } catch (error) {
-    return error;
-  }
+	try {
+		const sysInfo = await getSystemInfo();
+		const data = {
+			sysInfo: JSON.stringify(sysInfo),
+			...payload,
+		};
+		const result = await request({
+			url: serviceReportUrl,
+			data,
+		});
+		return result;
+	} catch (error) {
+		return error;
+	}
 }
 
-
-export const usualErrMsg = '抱歉,系统异常,请稍后再试';
+export const usualErrMsg = "抱歉,系统异常,请稍后再试";
 
 export function getStorage(key) {
-  return new Promise((resolve) => {
-    my.getStorage({
-      key,
-      success(res) {
-        resolve(res.data);
-      },
-      fail() {
-        resolve(null);
-      },
-    });
-  });
+	return new Promise((resolve) => {
+		my.getStorage({
+			key,
+			success(res) {
+				resolve(res.data);
+			},
+			fail() {
+				resolve(null);
+			},
+		});
+	});
 }
 
-
 export function setStorage(key, data) {
-  return new Promise((resolve) => {
-    my.setStorage({
-      key,
-      data,
-      success() {
-        resolve(true);
-      },
-      fail() {
-        resolve(false);
-      },
-    });
-  });
+	return new Promise((resolve) => {
+		my.setStorage({
+			key,
+			data,
+			success() {
+				resolve(true);
+			},
+			fail() {
+				resolve(false);
+			},
+		});
+	});
 }
 
 export function getSharePath(options = {}) {
-  // eslint-disable-next-line no-undef
-  const currentPages = getCurrentPages();
-  // eslint-disable-next-line no-proto
-  let pageName = JSON.stringify(currentPages[currentPages.length - 1].__proto__.route);
-  pageName = pageName.replace(/^"|"$/g, '');
-  let query = '';
-  if (options.pageUuid) {
-    query = `${query}&pageUuid=${options.pageUuid}`;
-  }
-  if (options.pageCode) {
-    query = `${query}&pageCode=${options.pageCode}`;
-  }
-  if (query.length > 0) {
-    query = query.replace(/^&/, '?');
-  }
-  return `${pageName}${query}`;
+	// eslint-disable-next-line no-undef
+	const currentPages = getCurrentPages();
+	// eslint-disable-next-line no-proto
+	let pageName = JSON.stringify(
+		currentPages[currentPages.length - 1].__proto__.route
+	);
+	pageName = pageName.replace(/^"|"$/g, "");
+	let query = "";
+	if (options.pageUuid) {
+		query = `${query}&pageUuid=${options.pageUuid}`;
+	}
+	if (options.pageCode) {
+		query = `${query}&pageCode=${options.pageCode}`;
+	}
+	if (query.length > 0) {
+		query = query.replace(/^&/, "?");
+	}
+	return `${pageName}${query}`;
 }
 
 export async function checkCertifyTimeout(data) {
-  const [err, res] = await request({
-    url: checkCertifyValidUrl,
-    data,
-    isShowLoadig: true,
-  });
-  return [err, res];
+	const [err, res] = await request({
+		url: checkCertifyValidUrl,
+		data,
+		isShowLoadig: true,
+	});
+	return [err, res];
 }
 
 export async function userIdentity(data) {
-  const [err, res] = await getAuthUser();
-  if (err) return [err, null];
-  data.authCode = res.authCode;
-  const [error, response] = await request({
-    url: authAndApplyFaceUrl,
-    data,
-    isShowLoadig: true,
-  });
-  if (error) return [error, null];
-  const result = await startAPVerify(response.certifyId, response.certifyUrl);
-  return result;
+	const [err, res] = await getAuthUser();
+	if (err) return [err, null];
+	data.authCode = res.authCode;
+	const [error, response] = await request({
+		url: authAndApplyFaceUrl,
+		data,
+		isShowLoadig: true,
+	});
+	if (error) return [error, null];
+	const result = await startAPVerify(response.certifyId, response.certifyUrl);
+	return result;
 }
 
 export async function certIdentity(data) {
-  const [error, result] = await request({
-    url: authCertTypeUrl,
-    data,
-    isShowLoadig: true,
-  });
-  if (error) return [error, null];
-  return [null, result];
+	const [error, result] = await request({
+		url: authCertTypeUrl,
+		data,
+		isShowLoadig: true,
+	});
+	if (error) return [error, null];
+	return [null, result];
 }
 
 // 设置全局传的参数, 可以传对象{name1: value, name2: value2}
 export function setPagesQuery(params) {
-  // eslint-disable-next-line no-undef
-  const app = getApp();
-  Object.keys(params).forEach(item => {
-    app.globalData.pagesQuery[item] = params[item];
-  });
+	// eslint-disable-next-line no-undef
+	const app = getApp();
+	Object.keys(params).forEach((item) => {
+		app.globalData.pagesQuery[item] = params[item];
+	});
 }
 
 // 移除全局传的参数, 可以传数组, [name]
 export function removePagesQuery(params) {
-  // eslint-disable-next-line no-undef
-  const app = getApp();
-  Object.keys(params).forEach(() => {
-    delete app.globalData.pagesQuery.item;
-  });
+	// eslint-disable-next-line no-undef
+	const app = getApp();
+	Object.keys(params).forEach(() => {
+		delete app.globalData.pagesQuery.item;
+	});
 }
 
 // 获取全局传的参数
 export function getPagesQuery(name) {
-  // eslint-disable-next-line no-undef
-  const app = getApp();
-  return app.globalData.pagesQuery[name];
+	// eslint-disable-next-line no-undef
+	const app = getApp();
+	return app.globalData.pagesQuery[name];
 }
 
 /*
-* 获取当前页面的store
-* */
+ * 获取当前页面的store
+ * */
 export function getCurrentStore() {
-  const pages = getCurrentPages();
-  const currentRoute = pages[pages.length - 1] || {};
-  return currentRoute.$store.storeInstance || {};
+	const pages = getCurrentPages();
+	const currentRoute = pages[pages.length - 1] || {};
+	return currentRoute.$store.storeInstance || {};
 }
 
 /*
-* 获取全局的state
-* */
+ * 获取全局的state
+ * */
 export function getGlobalState() {
-  const { $store = {} } = getCurrentStore();
-  return $store.$global.globalStoreConfig.state;
+	const { $store = {} } = getCurrentStore();
+	return $store.$global.globalStoreConfig.state;
 }
 
 /*
-* 获取store里面的用户信息
-* */
+ * 获取store里面的用户信息
+ * */
 export function getUserInfoByStore() {
-  const { userInfo } = getGlobalState();
-  return userInfo || {};
+	const { userInfo } = getGlobalState();
+	return userInfo || {};
 }
 
 /*
-* 获取accessMode
-* 兼容以前老的字符串的accessMode
-* */
+ * 获取accessMode
+ * 兼容以前老的字符串的accessMode
+ * */
 export function getAccessMode(accessMode) {
-  if (typeof accessMode !== 'string') return accessMode;
-  const oldMode = {
-    none: { none: true },
-    cert: { cert: true },
-    login: { login: true },
-    identity: { identity: true },
-    realName: { realName: true },
-    customer: { customer: true },
-  };
-  return oldMode[accessMode] || {};
+	if (typeof accessMode !== "string") return accessMode;
+	const oldMode = {
+		none: { none: true },
+		cert: { cert: true },
+		login: { login: true },
+		identity: { identity: true },
+		realName: { realName: true },
+		customer: { customer: true },
+	};
+	return oldMode[accessMode] || {};
 }
 
 // 记录时间节点
 export const seq = (function* () {
-  let timeline = 'startApp';
-  let prev = Date.now();
-  while (true) {
-    const now = Date.now();
-    // eslint-disable-next-line no-console
-    timeline = yield console.log(`${timeline}: ${now - prev}ms`);
-    prev = now;
-  }
+	let timeline = "startApp";
+	let prev = Date.now();
+	while (true) {
+		const now = Date.now();
+		// eslint-disable-next-line no-console
+		timeline = yield console.log(`${timeline}: ${now - prev}ms`);
+		prev = now;
+	}
 })();
 
 export function stringifyQuery(query = {}) {
-  let str = '';
-  Object.keys(query).forEach(key => {
-    str = `${str}&${key}=${encodeURIComponent(query[key])}`;
-  });
-  str = str.replace(/^&/, '?');
-  return str;
+	let str = "";
+	Object.keys(query).forEach((key) => {
+		str = `${str}&${key}=${encodeURIComponent(query[key])}`;
+	});
+	str = str.replace(/^&/, "?");
+	return str;
 }

+ 38 - 42
antbuilder/industry/hospital/components/utils/cloudMonitorHelper.js

@@ -1,50 +1,46 @@
-import monitor from './alipayLogger';
-import queryString from 'query-string';
+import monitor from "./alipayLogger";
+import queryString from "query-string";
 let myAppId = null; // 获取当前小程序appId
 
 export function getMyMiniAppId() {
-  if (myAppId === null) {
-    myAppId = my.getAppIdSync().appId;
-  }
+	if (myAppId === null) {
+		myAppId = my.getAppIdSync().appId;
+	}
 
-  return myAppId;
+	return myAppId;
 }
 export function reportCmPV_YL(params) {
-  return reportCmPV(params, 'h5SE_YL');
+	return reportCmPV(params, "taSR_YL");
 } // 页面pv上报云监控
 
-export function reportCmPV({
-  pageCode,
-  title,
-  query
-}, tag) {
-  // const url = getCurrentPages()[getCurrentPages().length - 1].route;
-  const url = 'pages/web-view/index';
-
-  if (!title) {
-    title = url;
-  }
-
-  const page = pageCode || title;
-  const newMyAppId = getMyMiniAppId();
-  let encodedUrl;
-
-  if (query && Object.keys(query).length > 0) {
-    encodedUrl = encodeURIComponent(`${url}?${queryString.stringify(query)}`);
-  } else {
-    encodedUrl = encodeURIComponent(`${url}`);
-  }
-
-  const myUrl = `alipays://platformapi/startapp?appId=${newMyAppId}&page=${encodedUrl}`; // console.log(`[YWTB] log: page: ${page}, url: ${url}, myUrl: ${myUrl}}`);
-
-  if (tag === null) {
-    tag = 'h5SE';
-  }
-
-  monitor._lgPV({
-    page,
-    url,
-    c1: tag,
-    c2: myUrl
-  });
-}
+export function reportCmPV({ pageCode, title, query }, tag) {
+	// const url = getCurrentPages()[getCurrentPages().length - 1].route;
+	const url = "pages/web-view/index";
+
+	if (!title) {
+		title = url;
+	}
+
+	const page = pageCode || title;
+	const newMyAppId = getMyMiniAppId();
+	let encodedUrl;
+
+	if (query && Object.keys(query).length > 0) {
+		encodedUrl = encodeURIComponent(`${url}?${queryString.stringify(query)}`);
+	} else {
+		encodedUrl = encodeURIComponent(`${url}`);
+	}
+
+	const myUrl = `alipays://platformapi/startapp?appId=${newMyAppId}&page=${encodedUrl}`; // console.log(`[YWTB] log: page: ${page}, url: ${url}, myUrl: ${myUrl}}`);
+
+	if (tag === null) {
+		tag = "h5SE";
+	}
+
+	monitor._lgPV({
+		page,
+		url,
+		c1: tag,
+		c2: myUrl,
+	});
+}

+ 34 - 38
antbuilder/industry/hospital/hooks/index.js

@@ -1,46 +1,42 @@
 import registerHooks from "../../../core/utils/registerHooks";
 import { globalExt } from "../../../core/utils/constants";
-import monitor from '../components/utils/alipayLogger';
+import monitor from "../components/utils/alipayLogger";
 
 function wait(callback, time) {
-  const {
-    globalData
-  } = getApp();
+	const { globalData } = getApp();
 
-  if (time >= 5 || globalData.monitorPid) {
-    callback(globalData);
-  } else {
-    setTimeout(() => {
-      wait(callback, time + 1);
-    }, 1000);
-  }
+	if (time >= 5 || globalData.monitorPid) {
+		callback(globalData);
+	} else {
+		setTimeout(() => {
+			wait(callback, time + 1);
+		}, 1000);
+	}
 }
 
 registerHooks({
-  async onAppLaunch(options) {
-    wait(({
-      monitorPid
-    }) => {
-      try {
-        monitor.init({
-          pid: monitorPid || globalExt.pid,
-          // eslint-disable-next-line no-undef
-          options,
-          sample: 1,
-          autoReportApi: false,
-          autoReportPage: true,
-          // Http请求返回数据中状态码字段名称
-          code: ['code'],
-          // Http返回数据中的error message字段名称
-          msg: ['msg']
-        });
-        monitor.setCommonInfo({
-          tag: this.globalData.appId
-        });
-      } catch (error) {
-        console.error(error);
-      }
-    }, 0);
-  }
-
-});
+	async onAppLaunch(options) {
+		wait(({ monitorPid }) => {
+			try {
+				monitor.init({
+					pid: monitorPid || globalExt.pid,
+					// eslint-disable-next-line no-undef
+					options,
+					sample: 1,
+					autoReportApi: false,
+					autoReportPage: true,
+					// Http请求返回数据中状态码字段名称
+					code: ["code"],
+					// Http返回数据中的error message字段名称
+					msg: ["msg"],
+					miniVersion: "0.0.30",
+				});
+				monitor.setCommonInfo({
+					tag: this.globalData.appId,
+				});
+			} catch (error) {
+				console.error(error);
+			}
+		}, 0);
+	},
+});

+ 1 - 1
antbuilder/industry/hospitalV2/components/deposit/index.js

@@ -33,7 +33,7 @@ Component({
 		/* 服务预警,押金缴纳 */
 
 		reportCmPV_YL({
-			title: "押金缴纳",
+			title: "住院缴费",
 		});
 	},
 

+ 1 - 1
antbuilder/industry/hospitalV2/components/hospital-payment/index.js

@@ -40,7 +40,7 @@ Component({
 	didMount() {
 		/* 服务预警,缴费记录查询 */
 		reportCmPV_YL({
-			title: "缴费记录查询",
+			title: "门诊缴费",
 		});
 	},
 	onInit() {},

+ 1 - 9
antbuilder/industry/hospitalV2/components/report-list/index.js

@@ -1,11 +1,3 @@
-/*
- * @Author: carver 244090602@qq.com
- * @Date: 2022-08-15 17:39:08
- * @LastEditors: carver 244090602@qq.com
- * @LastEditTime: 2022-10-08 14:53:39
- * @FilePath: \antbuilder-mp-auto-4.16.9-202208151733-b080d66f-034f-41c2-b1b8-58799f176f19\antbuilder\industry\hospitalV2\components\report-list\index.js
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- */
 import services from "./service";
 import { reportCmPV_YL } from "../../utils/cloudMonitorHelper";
 Component({
@@ -32,7 +24,7 @@ Component({
 	didMount() {
 		/* 服务预警,检查检验报告查询 */
 		reportCmPV_YL({
-			title: "检查检验报告查询",
+			title: "报告查询",
 		});
 	},
 

+ 115 - 115
antbuilder/industry/hospitalV2/mas.config.json

@@ -1,116 +1,116 @@
 {
-  "@alipay/core-antbuilder": "*",
-  "industry-name": "hospitalV2",
-  "extGlobal": {
-    "pid": "4ymp5rnlc89trk2fjmi0ea==",
-    "url": "https://ab-saas-api.alipay-eco.com/"
-  },
-  "publicComponents": {
-    "hospital-top-brand-component": {
-      "title": "顶部心智组件",
-      "type": "hospitalTopBrandComponent",
-      "path": "/components/index-head/indexHead"
-    },
-    "hospital-main-services-component": {
-      "title": "医院主推服务组件",
-      "type": "hospitalMainServicesComponent",
-      "path": "/components/hospital-services/hospitalServices"
-    },
-    "hospital-commonly-services-component": {
-      "title": "医院一般服务组件",
-      "type": "hospitalcommonlyServicesComponent",
-      "path": "/components/general-services/generalServices"
-    },
-    "hospital-medical-information-component": {
-      "title": "医院就医提醒组件",
-      "type": "hospitalMedicalInformationComponent",
-      "path": "/components/medical-information/medicalInformation"
-    },
-    "hospital-operation-information-component": {
-      "title": "医院运营信息组件",
-      "type": "hospitalOperationInformationComponent",
-      "path": "/components/operation-information/operationInformation"
-    },
-    "hospital-consulting-service-component": {
-      "title": "医院就医咨询组件",
-      "type": "hospitalConsultingServiceComponent",
-      "path": "/components/medical-consultation/medicalConsultation"
-    },
-    "hospital-user-center-component": {
-      "title": "医院个人信息组件",
-      "type": "hospitalUserCenterComponent",
-      "path": "/components/personal-center-head/personalCenterHead"
-    },
-    "hospital-registration-entry-component": {
-      "title": "挂号流程入口组件",
-      "type": "hospitalRegistrationEntryComponent",
-      "path": "/components/registration-entry/index"
-    },
-    "hospital-header": {
-      "title": "医院头部组件",
-      "type": "hospitalHeadertComponent",
-      "path": "/components/hospital-header/index"
-    },
-    "follow-up-notice": {
-      "title": "挂号须知组件",
-      "type": "hospitalFollowUpNoticeComponent",
-      "path": "/components/follow-up-notice/index"
-    },
-    "doctor-page": {
-      "title": "医生主页组件",
-      "type": "hospitalDoctorPage",
-      "path": "/components/doctor-page/index"
-    },
-    "order-pay": {
-      "title": "预约确认",
-      "type": "hospitalOrderPay",
-      "path": "/components/order-pay/index"
-    },
-    "hospital-project": {
-      "title": "核酸预约-选择项目",
-      "type": "nucleicProject",
-      "path": "/components/hospital-project/index"
-    },
-    "hospital-home": {
-      "title": "核酸预约-选择院区",
-      "type": "nucleicMock",
-      "path": "/components/hospital-home/index"
-    },
-    "inpatient-tabs": {
-      "title": "住院服务-tabs",
-      "type": "inpatientIndexTab",
-      "path": "/components/inpatient-tabs/index"
-    },
-    "inpatient-tabs-new": {
-      "title": "住院服务-tabs-去耦合",
-      "type": "hospitalInpatientTabNew",
-      "path": "/components/inpatient-tabs-new/index"
-    }
-  },
-  "publicPages": {
-    "page-pull": {
-      "path": "/pages/page-pull/index"
-    },
-    "page-no-pull": {
-      "path": "/pages/page-no-pull/index"
-    },
-    "page-exp": {
-      "path": "/pages/page-exp/index"
-    }
-  },
-  "appConfig": {
-    "window": {
-      "enableDSL": "YES",
-      "enableJSC": "YES",
-      "enableKeepAlive": "NO",
-      "enableWK": "YES",
-      "nboffline": "sync",
-      "tinyPubRes": "YES",
-      "showDomain": "NO",
-      "defaultTitle": "",
-      "pullRefresh": false,
-      "useDynamicPlugins": true,
-      "enableInPageRenderInput": "YES"
-    }
-  }
-}
+	"@alipay/core-antbuilder": "*",
+	"industry-name": "hospitalV2",
+	"extGlobal": {
+		"pid": "ssbwvrxgc0/l4fxyrdh4kw==",
+		"url": "https://ab-saas-api.alipay-eco.com/"
+	},
+	"publicComponents": {
+		"hospital-top-brand-component": {
+			"title": "顶部心智组件",
+			"type": "hospitalTopBrandComponent",
+			"path": "/components/index-head/indexHead"
+		},
+		"hospital-main-services-component": {
+			"title": "医院主推服务组件",
+			"type": "hospitalMainServicesComponent",
+			"path": "/components/hospital-services/hospitalServices"
+		},
+		"hospital-commonly-services-component": {
+			"title": "医院一般服务组件",
+			"type": "hospitalcommonlyServicesComponent",
+			"path": "/components/general-services/generalServices"
+		},
+		"hospital-medical-information-component": {
+			"title": "医院就医提醒组件",
+			"type": "hospitalMedicalInformationComponent",
+			"path": "/components/medical-information/medicalInformation"
+		},
+		"hospital-operation-information-component": {
+			"title": "医院运营信息组件",
+			"type": "hospitalOperationInformationComponent",
+			"path": "/components/operation-information/operationInformation"
+		},
+		"hospital-consulting-service-component": {
+			"title": "医院就医咨询组件",
+			"type": "hospitalConsultingServiceComponent",
+			"path": "/components/medical-consultation/medicalConsultation"
+		},
+		"hospital-user-center-component": {
+			"title": "医院个人信息组件",
+			"type": "hospitalUserCenterComponent",
+			"path": "/components/personal-center-head/personalCenterHead"
+		},
+		"hospital-registration-entry-component": {
+			"title": "挂号流程入口组件",
+			"type": "hospitalRegistrationEntryComponent",
+			"path": "/components/registration-entry/index"
+		},
+		"hospital-header": {
+			"title": "医院头部组件",
+			"type": "hospitalHeadertComponent",
+			"path": "/components/hospital-header/index"
+		},
+		"follow-up-notice": {
+			"title": "挂号须知组件",
+			"type": "hospitalFollowUpNoticeComponent",
+			"path": "/components/follow-up-notice/index"
+		},
+		"doctor-page": {
+			"title": "医生主页组件",
+			"type": "hospitalDoctorPage",
+			"path": "/components/doctor-page/index"
+		},
+		"order-pay": {
+			"title": "预约确认",
+			"type": "hospitalOrderPay",
+			"path": "/components/order-pay/index"
+		},
+		"hospital-project": {
+			"title": "核酸预约-选择项目",
+			"type": "nucleicProject",
+			"path": "/components/hospital-project/index"
+		},
+		"hospital-home": {
+			"title": "核酸预约-选择院区",
+			"type": "nucleicMock",
+			"path": "/components/hospital-home/index"
+		},
+		"inpatient-tabs": {
+			"title": "住院服务-tabs",
+			"type": "inpatientIndexTab",
+			"path": "/components/inpatient-tabs/index"
+		},
+		"inpatient-tabs-new": {
+			"title": "住院服务-tabs-去耦合",
+			"type": "hospitalInpatientTabNew",
+			"path": "/components/inpatient-tabs-new/index"
+		}
+	},
+	"publicPages": {
+		"page-pull": {
+			"path": "/pages/page-pull/index"
+		},
+		"page-no-pull": {
+			"path": "/pages/page-no-pull/index"
+		},
+		"page-exp": {
+			"path": "/pages/page-exp/index"
+		}
+	},
+	"appConfig": {
+		"window": {
+			"enableDSL": "YES",
+			"enableJSC": "YES",
+			"enableKeepAlive": "NO",
+			"enableWK": "YES",
+			"nboffline": "sync",
+			"tinyPubRes": "YES",
+			"showDomain": "NO",
+			"defaultTitle": "",
+			"pullRefresh": false,
+			"useDynamicPlugins": true,
+			"enableInPageRenderInput": "YES"
+		}
+	}
+}

+ 53 - 57
antbuilder/industry/hospitalV2/utils/cloudMonitorHelper.js

@@ -1,67 +1,63 @@
-import queryString from 'query-string';
+import queryString from "query-string";
 import monitor from "../../../core/utils/alipayLogger";
 let myAppId = null; // 获取当前小程序appId
 
 export function getMyMiniAppId() {
-  if (myAppId === null) {
-    myAppId = my.getAppIdSync().appId;
-  }
+	if (myAppId === null) {
+		myAppId = my.getAppIdSync().appId;
+	}
 
-  return myAppId;
+	return myAppId;
 }
 export function reportCmPV_YL(params) {
-  return reportCmPV(params, 'h5SE_YL');
+	return reportCmPV(params, "taSR_YL");
 } // 页面pv上报云监控
 
-export function reportCmPV({
-  pageCode,
-  title,
-  query
-}, tag) {
-  const url = 'pages/web-view/index';
-
-  if (!title) {
-    // eslint-disable-next-line no-param-reassign
-    title = url;
-  }
-
-  if (!query) {
-    // 如果没有query直接跳SYYJS服务到首页
-    // eslint-disable-next-line no-param-reassign,prefer-destructuring
-    query = {
-      serviceCode: 'SYYJS'
-    };
-  }
-
-  const page = pageCode || title;
-  const newMyAppId = getMyMiniAppId();
-  let encodedUrl;
-
-  if (query && Object.keys(query).length > 0) {
-    encodedUrl = encodeURIComponent(`${url}?${queryString.stringify(query)}`);
-  } else {
-    encodedUrl = encodeURIComponent(`${url}`);
-  }
-
-  const myUrl = `alipays://platformapi/startapp?appId=${newMyAppId}&page=${encodedUrl}`; // console.log(`[YWTB] log: page: ${page}, url: ${url}, myUrl: ${myUrl}}`);
-
-  if (tag === null) {
-    // eslint-disable-next-line no-param-reassign
-    tag = 'h5SE';
-  }
-
-  monitor._lgPV({
-    page,
-    url,
-    c1: tag,
-    c2: myUrl
-  });
+export function reportCmPV({ pageCode, title, query }, tag) {
+	const url = "pages/web-view/index";
+
+	if (!title) {
+		// eslint-disable-next-line no-param-reassign
+		title = url;
+	}
+
+	if (!query) {
+		// 如果没有query直接跳SYYJS服务到首页
+		// eslint-disable-next-line no-param-reassign,prefer-destructuring
+		query = {
+			serviceCode: "SYYJS",
+		};
+	}
+
+	const page = pageCode || title;
+	const newMyAppId = getMyMiniAppId();
+	let encodedUrl;
+
+	if (query && Object.keys(query).length > 0) {
+		encodedUrl = encodeURIComponent(`${url}?${queryString.stringify(query)}`);
+	} else {
+		encodedUrl = encodeURIComponent(`${url}`);
+	}
+
+	const myUrl = `alipays://platformapi/startapp?appId=${newMyAppId}&page=${encodedUrl}`; // console.log(`[YWTB] log: page: ${page}, url: ${url}, myUrl: ${myUrl}}`);
+
+	if (tag === null) {
+		// eslint-disable-next-line no-param-reassign
+		tag = "h5SE";
+	}
+
+	monitor._lgPV({
+		page,
+		url,
+		c1: tag,
+		c2: myUrl,
+	});
 }
-export const reportApi = api => {
-  monitor.api({
-    api,
-    success: true,
-    c1: 'taSR_YL',
-    time: 2000
-  });
-};
+export const reportApi = (api) => {
+	monitor.api({
+		api,
+		success: true,
+		c1: "taSR_YL",
+		time: 2000,
+	});
+};

+ 0 - 1
antbuilder/industry/hospitalV2/utils/page.js

@@ -32,7 +32,6 @@ const getOptions = () => ({
 			backBtnColor,
 			...other
 		} = query;
-		console.log("title ===>", title);
 		title &&
 			my.setNavigationBar({
 				title,

+ 1 - 1
config.by.prod.json

@@ -7,7 +7,7 @@
 			"ywtPrefix": "v2/alipaymp/nfyybyfy",
 			"gwAppId": "nfyybyfy-alipay-mp",
 			"disableActiveAuthUser": true,
-			"pid": "",
+			"pid": "ssbwvrxgc0/l4fxyrdh4kw==",
 			"authCodeKey": "auth_code",
 			"openNewVersion": true,
 			"debugNoCache": true,

+ 1 - 1
config.by.qa.json

@@ -7,7 +7,7 @@
 			"ywtPrefix": "v2/alipaymp/nfyybyfy",
 			"gwAppId": "nfyybyfy-alipay-mp",
 			"disableActiveAuthUser": true,
-			"pid": "",
+			"pid": "ssbwvrxgc0/l4fxyrdh4kw==",
 			"authCodeKey": "auth_code",
 			"openNewVersion": true,
 			"debugNoCache": true,

+ 1 - 1
config.json

@@ -7,7 +7,7 @@
 			"ywtPrefix": "v2/alipaymp/nfyybyfy",
 			"gwAppId": "nfyybyfy-alipay-mp",
 			"disableActiveAuthUser": true,
-			"pid": "",
+			"pid": "ssbwvrxgc0/l4fxyrdh4kw==",
 			"authCodeKey": "auth_code",
 			"openNewVersion": true,
 			"debugNoCache": true,