Authored by shuaiguo

Merge branch 'feature/share' into develop

... ... @@ -74,6 +74,8 @@ jspm_packages
# IntelliJ
/out/
# vscode
.history
# mpeltonen/sbt-idea plugin
.idea_modules/
... ...
... ... @@ -36,7 +36,7 @@ export default context => {
setTimeout(() => {
try {
report({
tp: 'err',
tp: context.tp || 'err',
msg: err.message,
sc: 'cdn.yoho.cn',
ln: 0,
... ...
/* eslint-disable */
/**
* Xianyu-SDK
*
... ... @@ -17,12 +18,75 @@ const xianyu = {
setXianyuWebview() {
if (this.isAliApp && window.WindVane) {
window.WindVane.call('WVIdleFishApi', 'setNavigationBarVisible', { visible: false }, () => {
console.log('set ok');
console.log('setNavigationBarVisible ok');
}, () => {
});
}
},
/*
* @ description: 导航栏右侧自定义按钮 设为关闭
* @ author: huzhiming
* @ date: 2019-11-14 16:15:07
* @ version: V1.0.5
*/
closeNavRightItem() {
if (this.isAliApp && window.WindVane) {
window.WindVane.call('WVIdleFishApi', 'setHideNavigatorRightItem', {},()=>{},()=>{})
}
},
/*
* @ description: 导航栏右侧自定义按钮 设为可见
* @ author: huzhiming
* @ date: 2019-11-05 11:54:24
* @ version: V1.0.5
*/
setNavRightItem (shareParam = null, handler) {
window._xianyuShare = () => {
this.setXianyuShare(shareParam, handler);
}
// console.log('this.isAliApp && window.WindVane', this.isAliApp , window.WindVane);
if (this.isAliApp && window.WindVane) {
window.WindVane.call('WVIdleFishApi', 'setNavigatorRightItem', {
title: '∙∙∙', // 按钮名称
func: '_xianyuShare' // func: 'test' //点击调用函数 注意调用的函数必须挂载在window上
}, function(data) {
console.log('setNavigatorRightItem success:',data);
}, function(e) {
console.log('setNavigatorRightItem error:',e);
});
}
},
/*
* @ description: 配置分享参数进行分享操作
* @ author: huzhiming
* @ date: 2019-11-05 10:38:24
* @ version: V1.0.5
*/
setXianyuShare (param = {
shareType: 'activity', // 类型,默认activity
image: '//img11.static.yhbimg.com/goodsimg/2018/12/24/17/01070adae9791c70ed02593550437cf30e.jpg?imageMogr2/thumbnail/600x600/background/d2hpdGU=/position/center/quality/80',
url: '//xianyu.yohobuy.com/xianyu/index/channel?wxIsAvailable', // 分享链接
link: '//xianyu.yohobuy.com/xianyu/index/channel?wxIsAvailable', // 和url保持
title: '闲鱼潮品首页', // 分享标题
text: '' // 分享描述
}, { XY_SHARE_PRODUCT, XY_SHARE_TYPE }) {
if (this.isAliApp && window.WindVane) {
XY_SHARE_PRODUCT.call(this);
window.WindVane.call('WVIdleFishApi', 'showShareMenu', param, (data)=>{
console.log('success:', JSON.stringify(data),typeof data.isCancel);
if (data.isCancel==='false') {
XY_SHARE_TYPE.call(this, data);
}
}, function(e) {
console.log('fail:', JSON.stringify(e));
});
}
},
finishXianyuPage() {
if (this.isAliApp && window.WindVane) {
window.WindVane.call('WVIdleFishApi', 'finish', {}, () => {
... ... @@ -95,6 +159,7 @@ const xianyu = {
}
let arr = [];
if (Object.keys(pageParams)[0] === 'openby:yohobuy') {
for (let key in pageParams) {
arr.push(pageParams[key]);
... ... @@ -129,6 +194,7 @@ const xianyu = {
if (pageName) {
let paramsV = {};
if (pageName === 'List') {
paramsV.query = pageParams;
} else {
... ...
... ... @@ -107,6 +107,7 @@ export default {
height: 0,
isA: false,
isHidden: true,
reported: false,
};
},
computed: {
... ... @@ -151,26 +152,41 @@ export default {
// this.getAllInboxCatInfo();
this.PAGE_URL = window.location.href;
if (!this.reported) {
// 首页进入上报
this.$store.dispatch('reportYas', {
params: {
param: { },
appop: 'XY_UFO_MAIN_START'
}
});
}
},
async serverPrefetch() {
return this.fetchChannelList();
},
mounted() {
// 首页进入上报
this.$store.dispatch('reportYas', {
params: {
param: { },
appop: 'XY_UFO_MAIN_START'
}
});
// 初始化 选中类目
const [firstNav] = this.navList;
if(firstNav) {
const {url = ''} = firstNav;
this.selectedCategory = queryString.parse(url);
}
this.refreshProductList(this.active);
// 首页进入上报
this.$store.dispatch('reportYas', {
params: {
param: { },
appop: 'XY_UFO_MAIN_START'
}
});
this.reported = true;
},
methods: {
...mapActions(['fetchChannelList', 'getAllInboxCatInfo']),
... ...
... ... @@ -8,6 +8,7 @@ import Address from './address';
import Notice from './notice';
import Category from './category';
import Activitys from './activitys';
import Zhiming from './zhiming';
export default [
{
... ... @@ -23,5 +24,6 @@ export default [
...Address,
...Notice,
...Category,
...Activitys
...Activitys,
...Zhiming
];
... ...
... ... @@ -16,7 +16,7 @@
</cube-slide-item>
<template slot="dots" slot-scope="props">
<div class="dot-wrap">
<span class="cube-dot" :class="{active: props.current === index}" v-for="(item, index) in props.dots">&bull;</span>
<span class="cube-dot" :class="{active: props.current === index}" v-for="(item, index) in props.dots" :key="item">&bull;</span>
</div>
</template>
</cube-slide>
... ... @@ -298,12 +298,23 @@ export default {
param,
}
});
this.$nextTick(() => {
/*
* @ description: 配置打开闲鱼导航栏右上角分享按钮 && 配置分享信息 && 上报数据埋点
* @ author: huzhiming
* @ date: 2019-11-13 19:58:50
* @ version: V1.0.5
*/
this.settingShareHandler();
});
},
deactivated() {
if (this._resourceImgWatcher) {
this._resourceImgWatcher();
this._resourceImgWatcher = null;
}
this.$xianyu.closeNavRightItem(); // 触发 关闭导航右侧分享按钮
},
beforeRouteUpdate(to, from, next) {
if (this.historyBackGuard() === false) {
... ... @@ -704,6 +715,62 @@ export default {
});
this.$xianyu.goXianyuNewPage({url});
},
/*
* @ description: 配置打开闲鱼导航栏右上角分享按钮 && 配置分享信息 && 上报数据埋点
* @ author: huzhiming
* @ date: 2019-11-13 20:00:55
* @ version: V1.0.5
*/
async settingShareHandler() {
/*
* @ description: [数据上报]@hooks: 分享链接进入pv,查看闲鱼淘口令,地址栏会附带shareUserId参数,目前淘口令查看事件未知,后期若知道淘口令打开事件可调整此数据埋点
* @ author: huzhiming
* @ date: 2019-11-13 20:36:00
* @ version: V1.0.5
*/
if ( get(this.$route,'query.shareUserId','') !='' ) {
this.$store.dispatch('reportYas', {
appop: 'XY_SHARE_SUCCESS_L',
params: {
SHARE_TYPE: '淘口令',
SHARE_URL: location.href
}
});
}
let image = this.sizeImg(get(this.imageList,'[0].image_url',''),200,200),
yasReportHandler = {
// [数据上报]@hooks: 拉起分享弹窗触发
XY_SHARE_PRODUCT: ()=>{
this.$store.dispatch('reportYas', {
appop: 'XY_SHARE_PRODUCT',
params: {
PRD_ID: this.productId,
SHARE_URL: location.href
}
});
},
// [数据上报]@hooks: 点击对应分享平台触发
XY_SHARE_TYPE: (data) =>{
this.$store.dispatch('reportYas', {
appop: 'XY_SHARE_TYPE',
params: {
SHARE_TYPE: data.pluginKey,
SHARE_URL: location.href
}
});
}
}
await this.$xianyu.setNavRightItem({
shareType: 'activity', // 类型,默认activity
image,
url: `${location.href}?isNeedRefresh=false`, // 分享链接
link: `${location.href}?isNeedRefresh=false`, // 和url保持
title: `淘口令#${this.productDetail.product_name}`, // 分享标题
text: '' // 分享描述
}, yasReportHandler);
}
},
};
</script>
... ...
export default [{
name: 'zhiming',
path: '/xianyu/zhiming',
component: () => import(/* webpackChunkName: "zhiming" */ './xianyu-js-sdk.vue')
}];
... ...
<!--
* @description:
* @fileName: xianyu-js-sdk.vue
* @author: huzhiming
* @date: 2019-11-04 18:02:07
* @后台人员:
* @version: V1.0.5
* @path: 页面访问路径及参数说明
!-->
<template>
<div class="xianyu-js-sdk-wrap">
<h2>我是一个测试页面</h2>
<ul>
<li @click="share()">点击拉出分享弹窗</li>
</ul>
{{ searchWord }}
</div>
</template>
<script>
import { createNamespacedHelpers } from 'vuex'
const { mapState, mapActions } = createNamespacedHelpers('list')
export default {
// head() {
// return {
// title: '',
// meta: [{ hid: 'keywords', name: 'keywords', content: '' },{ hid: 'hid', name: 'description', content: '' }],
// // link: [{ rel: 'stylesheet', href: '' }],
// // script: [{ src: '' }]
// }
// },
asyncData({store, router}) {
return store.dispatch('list/fetchSearchWords');
},
props: {},
data() {
return {}
},
created() {},
mounted() {
// this.fetchSearchWords()
this.$nextTick(async ()=>{
await this.$xianyu.setNavigatorRightItem();
})
},
destroyed() {},
methods: {
...mapActions([
'fetchSearchWords'
]),
share() {
this.$xianyu.setXianyuShare({
shareType: 'activity', // 类型,默认activity
image: 'http://gw.alicdn.com/tps/i1/TB1Nep5FVXXXXXDaXXXE799_VXX-800-800.jpg',
url: 'http://h5.xianyu.tb.cn/xianyu/maishen.html?wxIsAvailable', // 分享链接
link: 'http://h5.xianyu.tb.cn/xianyu/maishen.html?wxIsAvailable', // 和url保持
title: '下载闲鱼App', // 分享标题
text: '你可记得家里堆积的闲置物,你可知他们正在黯然神伤。让他们来闲鱼卖身吧,即可' // 分享描述
})
}
},
computed: {
...mapState([
'filterVisible',
'searchWord'
])
},
watch: {},
components: {}
};
</script>
/* 定义局部样式,添加外围容器,scss嵌套尽量不要超过三层,会影响查找器性能 */
<style rel='stylesheet/scss' lang='scss' scoped>
// .xianyu-js-sdk-wrap {}
// @import "./style.scss";
</style>
... ...
... ... @@ -212,7 +212,7 @@ export default function(mergeState = {}) {
// 获取设备信息
if (!retry && !get(window, 'appBaseLogs.device.dm') && this.$xianyu.getClientInfo) {
this.$xianyu.getClientInfo(info => {
info = info || {}
info = info || {};
set(window, 'appBaseLogs.device.dm', info.platformName ? info.platformName : `${info.brand} ${info.model}`);
this.dispatch('reportYas', {
... ... @@ -233,7 +233,7 @@ export default function(mergeState = {}) {
return;
}
if (window._yas && window._yas.sendAppLogs) {
if (window) {
param = param || {};
if (!param.C_ID) {
... ... @@ -251,29 +251,53 @@ export default function(mergeState = {}) {
param.SRC_ID = srcId;
}
window._yas.sendAppLogs(
{
appop,
param: param ? JSON.stringify(param) : '{}',
},
asyncindx,
);
if (window._yas && window._yas.sendAppLogs) {
window._yas.sendAppLogs(
{
appop,
param: param ? JSON.stringify(param) : '{}',
},
asyncindx,
);
if (window._yasEvents) {
window._yasEvents.forEach(e => {
window._yas.sendAppLogs(
{
appop: e.appop,
param: e.param ? JSON.stringify(e.param) : '{}',
},
asyncindx,
);
});
if (window._yasEvents) {
window._yasEvents.forEach(e => {
window._yas.sendAppLogs(
{
appop: e.appop,
param: e.param ? JSON.stringify(e.param) : '{}',
},
asyncindx,
);
});
window._yasEvents = null;
}
} else if (window._yas2) {
window._yas2.sendAppLogs(
{
appop,
param: param ? JSON.stringify(param) : '{}',
},
asyncindx,
);
if (window._yasEvents) {
window._yasEvents.forEach(e => {
window._yas2.sendAppLogs(
{
appop: e.appop,
param: e.param ? JSON.stringify(e.param) : '{}',
},
asyncindx,
);
});
window._yasEvents = null;
window._yasEvents = null;
}
} else {
window._yasEvents = window._yasEvents ? window._yasEvents.push({ appop, param }) : [{ appop, param }];
}
} else {
window._yasEvents = window._yasEvents ? window._yasEvents.push({ appop, param }) : [{ appop, param }];
}
}, 300);
} catch (e) {
... ...
import Vue from 'vue';
import cookie from 'yoho-cookie';
import xianyu from '../common/xianyu';
import './yas/ya';
import reportError from 'report-error';
const setWindowSize = (store) => {
const { clientWidth, clientHeight } = document.body;
... ... @@ -49,6 +51,24 @@ function getUid() {
window.indx = 1;
function initBaseLogs() {
if (!(window._yas && window._yas.sendAppLogs)) {
reportError({ tp: 'yas_err' });
(function(w, d, s, j, f) {
var a = d.createElement(s);
var m = d.getElementsByTagName(s)[0];
w.YohoAcquisitionObject = f;
w[f] = function() {
w[f].p = arguments;
};
a.async = 1;
a.src = j;
m.parentNode.insertBefore(a, m);
}(window, document, 'script', (document.location.protocol === 'https:' ? 'https:' : 'http:') + '//cdn.yoho.cn/yas-jssdk/2.4.18/yas.js', '_yas'));
}
window.appBaseLogs = {
status: [
{
... ...
import goldlog from '@ali/universal-goldlog';
import { isWeex } from '@ali/universal-env';
import { isFM, isWechat, isDD, isUC, isWB, isYK } from '../env';
import { obj2qs } from '../index';
import confirm from '../confirm/index';
import Windvane from '@weex-module/windvane';
import Navigator from '@weex-module/navigator';
import showGuideMaskInWechat from './showGuideMaskInWechat';
// h5 详情页定制逻辑,增加 itemPvid
const searchParams = new URLSearchParams(location.search);
let lxTrackParam;
if (searchParams.get('lxTrackParam')) {
try {
lxTrackParam = JSON.parse(searchParams.get('lxTrackParam'));
} catch(e) {
console.log(e);
}
}
export default function (url, success, error, cancel, noConfirm) {
if (typeof url === 'object') {
let opts = url;
url = opts.url;
success = opts.success;
error = opts.error;
cancel = opts.cancel;
noConfirm = opts.noConfirm;
lxTrackParam = opts.lxTrackParam;
}
if (isWeex) {
if (isFM) {
Windvane.call2(
'Base.openWindow', {
url,
popBeforeOpen: true
},
() => {},
() => {}
);
return false;
}
Windvane.call2(
'Base.isInstall',
{
ios: 'fleamarket://',
android: 'com.taobao.idlefish'
},
() => {
if (noConfirm) {
callappByWindvaneWhenInstalled(url, success, error);
} else {
goldlog.record('/xyzz.5.17', 'CLK', '', 'GET');
confirm({
titles: ['即将离开手机淘宝', '打开“闲鱼App”'],
cancelCallback: () => {
goldlog.record('/xyzz.5.18', 'CLK', '', 'GET');
cancel && cancel();
},
okCallback: () => {
goldlog.record('/xyzz.5.19', 'CLK', '', 'GET');
callappByWindvaneWhenInstalled(url, success, error);
}
});
}
},
() => {
error && error();
}
);
} else {
if (window.AlipayJSBridge) {
AlipayJSBridge.call('openInBrowser', {
url: getCallappUrl(url)
});
let startTime = Date.now();
let timer = setTimeout(() => {
if (Date.now() - startTime < 3000) {
error && error();
}
}, 2000);
document.addEventListener('visibilitychange', function () {
if (timer) {
clearTimeout(timer);
}
success && success();
});
return;
} else if (isWechat) {
showGuideMaskInWechat();
} else if (isDD || isUC || isYK) {
window.location.href = getCallappUrl(url);
error && error();
} else if (isWB) {
url = `fleamarket://home?forward_url=${encodeURIComponent(url)}`;
new lib.idle.callapp({
iosNativeUrl: url,
androidNativeUrl: url,
lauchFailCallback: function() {
error && error();
}
});
} else if (typeof lib !== 'undefined' && lib.idle && lib.idle.callapp) {
new lib.idle.callapp({
iosNativeUrl: url,
androidNativeUrl: url,
lauchFailCallback: function() {
error && error();
}
});
}
}
}
function getCallappUrl(url = '') {
if (/^http/.test(url)) {
return `fleamarket://weex?url=${encodeURIComponent(url)}`
} else {
return url;
}
}
function callappByWindvaneWhenInstalled(url, success, error) {
goldlog.record('/widle.tbMiniApp.h5detailinstall', 'CLK', '', 'GET');
const gokey = obj2qs(lxTrackParam);
if (weex.config.env.appName == 'TM') {
Navigator.open(
{
url: url || 'fleamarket://home'
},
() => {
goldlog.record('/widle.tbMiniApp.h5detailcallappsuccess', 'CLK', gokey, 'GET')
success && success();
},
() => {
goldlog.record('/widle.tbMiniApp.h5detailcallapperror', 'CLK', '', 'GET')
error && error();
}
);
} else {
Windvane.call2(
'WVClient.open',
{
url: getCallappUrl(url) || 'fleamarket://home'
},
() => {
goldlog.record('/widle.tbMiniApp.h5detailcallappsuccess', 'CLK', gokey, 'GET')
success && success();
},
() => {
goldlog.record('/widle.tbMiniApp.h5detailcallapperror', 'CLK', '', 'GET')
error && error();
}
);
}
}
\ No newline at end of file
... ...
function getDomain() {
var domainArr = document.domain.split('.');
var length = domainArr.length;
if (length > 1 && isNaN(domainArr[length - 1])) {
return '.' + domainArr[length - 2] + '.' + domainArr[length - 1];
} else {
return document.domain;
}
}
module.exports = {
version: '1.0',
yasPath: '/web/',
yasDomain: getDomain(),
yasImgDomain: '//analytics.m.yohobuy.com/yas.gif',
yasMobileDomain: '//analytics.m.yohobuy.com/yas_mobile'
};
... ...
/**
* 跨域发送信息工具库
*/
var config = require('./config');
var yasMobileDomain = config.yasMobileDomain;
var createCORSRequest = function(method, url) {
var xhr;
if (window.XMLHttpRequest) {
xhr = new XMLHttpRequest();
} else if (typeof XDomainRequest != 'undefined') {
// IE8 & IE9
xhr = new XDomainRequest();
} else if (window.ActiveXObject) {
xhr = new ActiveXObject('Microsoft.XMLHTTP');
}
return xhr;
};
// app中打开wap页 数据上报
exports.appSend = function(data, callback) {
if (!window.appBaseLogs) {
return;
}
var xhr = createCORSRequest();
if (!xhr) {
return;
}
xhr.ontimeout = function(e) {
console.log('timeout: ', JSON.stringify(e));
};
xhr.onerror = function(e) {
console.log('error: ', JSON.stringify(e));
};
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
if (xhr.status == 200 && callback) {
callback();
}
}
};
xhr.open('post', (document.location.protocol === 'https:' ? 'https:' : 'http:') + yasMobileDomain, true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.send(data);
};
... ...
/**
* 采集系统的工具库
*/
//浅层合并对象
exports.merge = function(obj1, obj2) {
var ret = {};
for (var attr in obj1) {
ret[attr] = obj1[attr];
}
for (var attr2 in obj2) {
ret[attr2] = obj2[attr2];
}
return ret;
};
... ...
/**
* @fileoverview YAS (YOHO! Acquisition System) YOHO!采集系统的前端js的开发包,
* 用于在网页端采集信息(应用信息,用户信息,用户行为信息,浏览器及其系统信息)。
*/
//工具库
var util = require('./util');
//跨域通信
var cross = require('./cross');
var _yas = {};
/**
* 发送用户订制信息, 此方法提供给用户调用, 本方法不对参数合法性进行检查, 调用者自己保证。(app上报数据使用)
* @param json 用户订制信息, 必选参数,采用json格式
* @param asyncindx 是否需要同步indx
* true表示同步,false表示不需要同步, 默认值是false
* 本方法使用场合:
* 1. app中的事件上报
*/
_yas.sendAppLogs = function(json) {
if (!window.appBaseLogs) {
return;
}
// 数据整合
var param = JSON.parse(json.param);
if (param.F_URL) {
param.F_URL = decodeURIComponent(param.F_URL);
}
// abtype
var ev = window.appBaseLogs.events[0];
if (ev.abtype) {
param.AB_TYPE = ev.abtype;
}
var event = util.merge(ev, {
ts: (new Date()).getTime().toString(),
indx: ++window.indx,
op: json.appop,
param: param
});
var logs = util.merge(window.appBaseLogs, {
events: [event]
});
// 上报数据
cross.appSend('_mlogs=' + encodeURIComponent(JSON.stringify(logs)));
window._yasloaded = true;
};
window._yas2 = _yas;
... ...
... ... @@ -62,7 +62,7 @@ const webpackConfig = merge(baseConfig, {
terserOptions: {
safari10: true,
compress: {
drop_console: true,
drop_console: true
}
}
})]
... ...
... ... @@ -27,6 +27,17 @@
<div id="no-download"></div>
</div>
{{{states}}}
{{#if zk.webperf}}
<script type="text/javascript">
window._yohoAppName = 'yoho-xianyu-ufo-web';
window._router = '{{routeHash}}';
setTimeout(function() {
!function(t){function n(r){if(e[r])return e[r].exports;var i=e[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}var e={};n.m=t,n.c=e,n.p="",n(0)}([function(t,n,e){var r=e(3),i=e(2),o="_perfLog",a=e(17),c=e(18);({init:function(t){this.debug=t,this.dataList=[],this.isRunning=!1,a.init(this.debug),c.init(this.debug),this.report();var n=this;window.addEventListener&&window.addEventListener("load",function(){setTimeout(function(){n.collect()},0)})},collect:function(){try{var t=c.collect(),n=a.collect();this.chunkWrite(t);for(var e=0;e<n.length;e++)this.chunkWrite(n[e])}catch(t){this.debug&&console.log(t)}},getMeta:function(){return{pt:encodeURIComponent(window.location.href),u:i.getUid(),ud:i.getUdid(),rid:i.getReqId(),r:i.getRoute()}},jsonConcat:function(t,n){for(var e in n)t[e]=n[e];return t},write:function(t){this.jsonConcat(t,this.getMeta());var n=JSON.parse(r(o)||"[]");n.push(t),r(o,JSON.stringify(n)),n.length>=3&&this.report()},report:function(){var t=this,n=JSON.parse(r(o)||"[]"),e=i.stringify(n);i.report(e,function(){t.clear()})},clear:function(){r(o,"[]")},chunkWrite:function(t){function n(){if(0!==e.dataList.length){var t=e.dataList.shift();e.write(t),setTimeout(n,10)}}var e=this;this.dataList.push(t),this.isRunning||(this.isRunning=!0,n())}}).init()},function(t,n){t.exports=function(t,n,e){if(void 0===n){var r=null;if(document.cookie)for(var i=document.cookie.split(";"),o=0;o<i.length;o++){var a=(i[o]||"").trim();if(a.substring(0,t.length+1)==t+"="){r=decodeURIComponent(a.substring(t.length+1));break}}return r}e=e||{},null===n&&(n="",e.expires=-1);var c="";if(e.expires&&("number"==typeof e.expires||e.expires.toUTCString)){var u;"number"==typeof e.expires?(u=new Date,u.setTime(u.getTime()+24*e.expires*60*60*1e3)):u=e.expires,c="; expires="+u.toUTCString()}var s=e.path?"; path="+e.path:"",f=e.domain?"; domain="+e.domain:"",d=e.secure?"; secure":"";document.cookie=[t,"=",encodeURIComponent(n),c,s,f,d].join("")}},function(t,n,e){var r=e(1),i=window._yohoAppName||"unknown",o={config:{reportUrl:"//badjs.yoho.cn/apm/yas2.gif"},stringify:function(t){for(var n=[],e=0;e<t.length;e++){var r=t[e],i=[];for(var o in r)r.hasOwnProperty(o)&&i.push(o+"::"+r[o]);n.push(i.join("$$"))}return n.join("**")},report:function(t,n){if(t){(new Image).src=this.config.reportUrl+"?s="+i+"&l="+t+"&t="+(new Date).getTime(),n&&n()}},getUdid:function(){return r("udid")||""||0},getUid:function(){return(r("_UID")||"").split("::")[1]||0},getReqId:function(){return r("docreqid")||0},getRoute:function(){return window._router||""}};t.exports=o},function(t,n){t.exports=function(t,n){if(void 0===n){var n=null;return window.localStorage&&(n=window.localStorage.getItem(t)),n}window.localStorage&&window.localStorage.setItem(t,n)}},,,,,,,,,,,,,,function(t,n){var e={init:function(t){if(this.enable=!0,this.debug=t,!("performance"in window&&"getEntriesByType"in window.performance&&window.performance.getEntriesByType("resource")instanceof Array))return void(this.enable=!1);this.whiteList=[/\/\/img\d*.static.yhbimg.com/,/\/\/cdn.yoho.cn/]},print:function(){var t=document.getElementById("debug"),n=this.formatDebugInfo();if(t)t.innerHTML+=n;else{var e=document.createElement("div");e.id="debug",e.innerHTML=n,document.body.appendChild(e)}},formatDebugInfo:function(){for(var t="<p>resource object: <br/>",n=this.getData(),e=0;e<n.length;e++)t+=JSON.stringify(n[e],null,2)+"<br/>";return t+="</p>"},filter:function(t){for(var n=0;n<this.whiteList.length;n++)if(this.whiteList[n].test(t))return!0;return!1},getData:function(){var t=window.performance.getEntriesByType("resource"),n=[],e={};for(var r in t){var i=t[r];if(this.filter(i.name)){var o={tp:"resource",mtp:i.initiatorType||"unknown",id:i.name||"unknown",dt:Math.floor(i.domainLookupEnd-i.domainLookupStart||0),tt:Math.floor(i.connectEnd-i.connectStart||0),rt:Math.floor(i.responseEnd-i.responseStart||0),rrt:Math.floor(i.responseEnd-i.fetchStart||0)};i.initiatorType in e?e[i.initiatorType].push(o):e[i.initiatorType]=[o]}}for(var a in e){for(var c=e[a],u=c.length,s={tp:"rs",mtp:a,dt:0,tt:0,rt:0,rrt:0},f=0;f<c.length;f++){var d=c[f];s.dt+=d.dt,s.tt+=d.tt,s.rt+=d.rt,s.rrt+=d.rrt}s.dt=Math.floor(s.dt/u),s.tt=Math.floor(s.tt/u),s.rt=Math.floor(s.rt/u),s.rrt=Math.floor(s.rrt/u),n.push(s)}return n},collect:function(){return this.enable?(this.debug&&this.print(),this.getData()):[]}};t.exports=e},function(t,n){var e=function(){function t(){return{tp:"tm",mtp:"html",dt:Math.floor(n),tt:Math.floor(e),rt:Math.floor(r),domt:Math.floor(o),et:Math.floor(i),ot:Math.floor(a),rtt:Math.floor(c),sw:screen.width||1,sh:screen.height||1,pf:navigator.platform||"unknown"}}var n=performance.timing.domainLookupEnd-(performance.timing.domainLookupStart||0),e=performance.timing.connectEnd-(performance.timing.connectStart||0),r=performance.timing.responseEnd-(performance.timing.responseStart||0),i=performance.timing.responseStart-(performance.timing.navigationStart||0),o=performance.timing.domContentLoadedEventEnd-(performance.timing.domLoading||0),a=performance.timing.domContentLoadedEventEnd-(performance.timing.navigationStart||0),c=(performance.timing.loadEventEnd||performance.timing.domComplete)-(performance.timing.navigationStart||0);return{collect:function(){return t()},print:function(){var t=document.getElementById("debug"),n=this.formatDebugInfo();if(t)t.innerHTML+=n;else{var e=document.createElement("div");e.id="debug",e.innerHTML=n,document.body.appendChild(e)}},formatDebugInfo:function(){var t="<p>";return t+="timing object : "+JSON.stringify(this.collect(),null,2)+"<br/>",t+="url: "+decodeURIComponent(window.location.href)+"<br/>",t+="</p>"}}},r={init:function(t){if(this.enable=!0,this.debug=t,!("performance"in window))return void(this.enable=!1)},collect:function(){if(this.enable){var t=e(),n=t.collect();return this.debug&&t.print(),n}}};t.exports=r}]);
}, 0);
</script>
{{/if}}
{{#if asyncScripts}}
<script>
document.addEventListener('DOMContentLoaded', function() {
... ... @@ -69,8 +80,6 @@
m.parentNode.insertBefore(a, m);
}(window, document, 'script', (document.location.protocol === 'https:' ? 'https:' : 'http:') + '//cdn.yoho.cn/yas-jssdk/2.4.18/yas.js', '_yas'));
var _hmt = _hmt || [];
(function() {
function getUid() {
var uid,
... ... @@ -114,14 +123,16 @@
window._yas(1 * new Date(), '2.4.16', 'yohoappweb', uid, '', '');
}
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?65dd99e0435a55177ffda862198ce841";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?895d42db02df242cd77a2058961bef33";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
}());
}, 500);
}, 0);
</script>
</body>
... ...