Commit 67b3a52e by 梁建民

js

parent a148c5be
......@@ -17,6 +17,7 @@
"devDependencies": {
"@vue/cli-plugin-babel": "^3.3.0",
"@vue/cli-service": "^3.3.0",
"js-md5": "^0.7.3",
"node-sass": "^4.9.0",
"qs": "^6.6.0",
"sass-loader": "^7.0.1",
......
......@@ -9,9 +9,6 @@
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<meta http-equiv="Expires" content="-1">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Pragma" content="no-cache">
<meta name="full-screen" content="yes">
<meta name="browsermode" content="application">
<meta name="x5-fullscreen" content="true">
......@@ -19,11 +16,11 @@
<meta name="description" content="猎芯网,快速成长的专业电子元器件商城,贸泽(MOUSER)全系产品、e络盟(element14)树莓派系列产品授权经销商,已获得多轮风险投资。为客户提供电子元器件现货,IC采购,进口报关,电子元器件寄售,供应链金融等一站式电子元器件采购服务。">
<meta name="keywords" content="猎芯网,电子元器件采购,电子元器件商城,电子元器件现货,IC采购网,电子元器件寄售,电子元件,元器件商城,元器件采购,电子商城,">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<link rel="stylesheet" href="<%= BASE_URL %>static/css/iconfont.css">
<script type="text/javascript" src="get_time.php"></script>
<script>
var fwtimes = window.fwtime - Math.floor((new Date().getTime()) / 1000); //获取服务器时间差
var fwtimes = window.fwtime - (Math.floor((new Date().getTime())/1000)); //获取服务器时间差
</script>
<link rel="stylesheet" href="<%= BASE_URL %>static/css/iconfont.css">
<script src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js" type="text/javascript" charset="utf-8"></script>
<script src="<%= BASE_URL %>static/js/flexible.min.js" type="text/javascript" charset="utf-8"></script>
<script src="<%= BASE_URL %>static/js/shence.min.js" type="text/javascript" charset="utf-8"></script>
......
......@@ -5,6 +5,8 @@ import {router} from './router';
import store from './store/store'
import filters from './filters'
import directive from './directive'
import md5 from 'js-md5';
import Util from './util/index';
//css全局加载
import 'vant/lib/index.css';
......@@ -21,8 +23,16 @@ Vue.prototype.$http = axios;
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
axios.defaults.withCredentials = true;
//本地环境开启提示信息
Vue.config.productionTip = false;
//本地初始化uid
var Yo4teW_gid = Util.getCookie('Yo4teW_gid');
if (Yo4teW_gid == null) {
var mdStr = md5('');
Util.setCookie('Yo4teW_gid', mdStr);
}
new Vue({
router,
store,
......
......@@ -48,7 +48,7 @@ export default {
* 加密token
*/
getParams(params) {
var Yo4teW_gid = getCookie('Yo4teW_gid');
var Yo4teW_gid = this.getCookie('Yo4teW_gid');
var cache_time = this.getCookie('cache_time');
if (cache_time != null) {
......
......@@ -48,14 +48,9 @@
this.$store.dispatch({
type: 'cartCount'
})
this.$store.dispatch({
type: 'loginCheck'
})
this.$store.dispatch({
type: 'getCommonParams'
})
}
}
</script>
\ No newline at end of file
......@@ -72,6 +72,9 @@
},
recordFn() {
this.flag = true;
this.$store.dispatch({
type: 'getCommonParams'
})
try {
sensors.track('RNavClick', {
right_nav_click: "h5-客服"
......
No preview for this file type
No preview for this file type
No preview for this file type
<?php
echo "var fwtime =".time().";";
\ No newline at end of file
This diff could not be displayed because it is too large.
(function(t){function e(e){for(var r,o,i=e[0],u=e[1],s=e[2],f=0,m=[];f<i.length;f++)o=i[f],a[o]&&m.push(a[o][0]),a[o]=0;for(r in u)Object.prototype.hasOwnProperty.call(u,r)&&(t[r]=u[r]);l&&l(e);while(m.length)m.shift()();return c.push.apply(c,s||[]),n()}function n(){for(var t,e=0;e<c.length;e++){for(var n=c[e],r=!0,o=1;o<n.length;o++){var i=n[o];0!==a[i]&&(r=!1)}r&&(c.splice(e--,1),t=u(u.s=n[0]))}return t}var r={},o={app:0},a={app:0},c=[];function i(t){return u.p+"js/"+({}[t]||t)+"."+{"chunk-03f01e17":"fdd6588d"}[t]+".js"}function u(e){if(r[e])return r[e].exports;var n=r[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,u),n.l=!0,n.exports}u.e=function(t){var e=[],n={"chunk-03f01e17":1};o[t]?e.push(o[t]):0!==o[t]&&n[t]&&e.push(o[t]=new Promise(function(e,n){for(var r="css/"+({}[t]||t)+"."+{"chunk-03f01e17":"897a7236"}[t]+".css",a=u.p+r,c=document.getElementsByTagName("link"),i=0;i<c.length;i++){var s=c[i],f=s.getAttribute("data-href")||s.getAttribute("href");if("stylesheet"===s.rel&&(f===r||f===a))return e()}var m=document.getElementsByTagName("style");for(i=0;i<m.length;i++){s=m[i],f=s.getAttribute("data-href");if(f===r||f===a)return e()}var l=document.createElement("link");l.rel="stylesheet",l.type="text/css",l.onload=e,l.onerror=function(e){var r=e&&e.target&&e.target.src||a,c=new Error("Loading CSS chunk "+t+" failed.\n("+r+")");c.request=r,delete o[t],l.parentNode.removeChild(l),n(c)},l.href=a;var p=document.getElementsByTagName("head")[0];p.appendChild(l)}).then(function(){o[t]=0}));var r=a[t];if(0!==r)if(r)e.push(r[2]);else{var c=new Promise(function(e,n){r=a[t]=[e,n]});e.push(r[2]=c);var s,f=document.createElement("script");f.charset="utf-8",f.timeout=120,u.nc&&f.setAttribute("nonce",u.nc),f.src=i(t),s=function(e){f.onerror=f.onload=null,clearTimeout(m);var n=a[t];if(0!==n){if(n){var r=e&&("load"===e.type?"missing":e.type),o=e&&e.target&&e.target.src,c=new Error("Loading chunk "+t+" failed.\n("+r+": "+o+")");c.type=r,c.request=o,n[1](c)}a[t]=void 0}};var m=setTimeout(function(){s({type:"timeout",target:f})},12e4);f.onerror=f.onload=s,document.head.appendChild(f)}return Promise.all(e)},u.m=t,u.c=r,u.d=function(t,e,n){u.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},u.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},u.t=function(t,e){if(1&e&&(t=u(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(u.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)u.d(n,r,function(e){return t[e]}.bind(null,r));return n},u.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return u.d(e,"a",e),e},u.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},u.p="//szh5static.ichunt.com/",u.oe=function(t){throw console.error(t),t};var s=window["webpackJsonp"]=window["webpackJsonp"]||[],f=s.push.bind(s);s.push=e,s=s.slice();for(var m=0;m<s.length;m++)e(s[m]);var l=f;c.push([0,"chunk-vendors"]),n()})({0:function(t,e,n){t.exports=n("56d7")},"56d7":function(t,e,n){"use strict";n.r(e);var r=n("0ec6"),o=n.n(r),a=(n("c764"),n("9f07"),n("0964"),n("1cc5")),c=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{id:"app"}},[n("keep-alive",{attrs:{exclude:""}},[n("router-view",{staticClass:"router-view"})],1)],1)},i=[],u={name:"app"},s=u,f=n("25c1"),m=Object(f["a"])(s,c,i,!1,null,null,null);m.options.__file="App.vue";var l=m.exports,p=n("7f43"),d=n.n(p),h=(n("0a16"),n("081a")),g=function(t){return n.e("chunk-03f01e17").then(function(){var e=[n("9553")];t.apply(null,e)}.bind(this)).catch(n.oe)};a["a"].use(h["a"]);var v=[{path:"/home",component:g,meta:{title:"猎芯网"}},{path:"/",redirect:"/home"},{path:"*",redirect:"/"}];v.forEach(function(t){t.path=t.path||"/"+(t.name||"")});var w=new h["a"]({routes:v});w.beforeEach(function(t,e,n){var r=t.meta&&t.meta.title;r&&(document.title=r),n()});var b,k,C=n("52c1");switch(window.location.hostname){case"www.ichunt.com":b="https://api.ichunt.com/";break;case"m.ichunt.com":k="https://m.ichunt.com/v3",b="https://api.ichunt.com/";break;case"sz.ichunt.com":b="https://szapi.ichunt.com/";break;case"szm.ichunt.com":b="https://szapi.ichunt.com/",k="https://szm.ichunt.com/v3/";break;case"t.ichunt.com":b="https://api.ichunt.com/";break;case"tm.ichunt.com":k="https://tm.ichunt.com/v3",b="https://api.ichunt.com/";break;case"www.liexin.com":b="http://api.liexin.com/";break;case"m.liexin.com":k="http://m.liexin.com/v3/",b="http://api.liexin.com/";break;default:b="/api/"}var y=k,x=b,T={index:y+"index",loginCheck:x+"login/check",cartCount:x+"cart/count",customsrService:x+"public/customsrservice",getCommonParams:y+"getcommonparams"},P={index:function(t){return d.a.post(T.index,t)},loginCheck:function(t){return d.a.get(T.loginCheck,{params:{data:t}})},cartCount:function(t){return d.a.get(T.cartCount,{params:{data:t}})},customsrService:function(t){return d.a.get(T.customsrService,{params:{data:t}})},getCommonParams:function(t){return d.a.post(T.getCommonParams,t)}},j=n("6ef6"),E=(n("ac74"),n("9029"),n("ab01")),S=n.n(E),_=(n("4ddc"),0),O=8;function A(t){return F(M(N(t),t.length*O))}function M(t,e){t[e>>5]|=128<<24-e%32,t[15+(e+64>>9<<4)]=e;for(var n=Array(80),r=1732584193,o=-271733879,a=-1732584194,c=271733878,i=-1009589776,u=0;u<t.length;u+=16){for(var s=r,f=o,m=a,l=c,p=i,d=0;d<80;d++){n[d]=d<16?t[u+d]:B(n[d-3]^n[d-8]^n[d-14]^n[d-16],1);var h=q(q(B(r,5),z(d,o,a,c)),q(q(i,n[d]),D(d)));i=c,c=a,a=B(o,30),o=r,r=h}r=q(r,s),o=q(o,f),a=q(a,m),c=q(c,l),i=q(i,p)}return Array(r,o,a,c,i)}function z(t,e,n,r){return t<20?e&n|~e&r:t<40?e^n^r:t<60?e&n|e&r|n&r:e^n^r}function D(t){return t<20?1518500249:t<40?1859775393:t<60?-1894007588:-899497514}function q(t,e){var n=(65535&t)+(65535&e),r=(t>>16)+(e>>16)+(n>>16);return r<<16|65535&n}function B(t,e){return t<<e|t>>>32-e}function N(t){for(var e=Array(),n=(1<<O)-1,r=0;r<t.length*O;r+=O)e[r>>5]|=(t.charCodeAt(r/O)&n)<<24-r%32;return e}function F(t){for(var e=_?"0123456789ABCDEF":"0123456789abcdef",n="",r=0;r<4*t.length;r++)n+=e.charAt(t[r>>2]>>8*(3-r%4)+4&15)+e.charAt(t[r>>2]>>8*(3-r%4)&15);return n}var L=n("0427"),Y={setCookie:function(t,e,n,r){r=r?";domain="+r:"";var o=n,a=new Date;return a.setTime(a.getTime()+24*o*60*60*1e3),document.cookie=t+"="+encodeURIComponent(e)+";expires="+a.toGMTString()+";path=/"+r,!0},getCookie:function(t){for(var e=document.cookie,n=e.split("; "),r=0;r<n.length;r++){var o=n[r].split("=");if(t==o[0])return o[1]}return null},delCookie:function(t){var e=new Date;e.setTime(e.getTime()-1);var n=this.getCookie(t);null!=n&&(document.cookie=t+"="+n+";expires="+e.toGMTString())},getParams:function(t){var e=getCookie("Yo4teW_gid"),n=this.getCookie("cache_time");if(null!=n)var r=Math.floor((new Date).getTime()/1e3);else{r=Math.floor((new Date).getTime()/1e3)+window.fwtimes;this.setCookie("cache_time",window.fwtimes,1,window.cookieHostname)}var a=[],c={},i="",u="",s="",f={pf:2,qwertyuiop:r,Yo4teW_gid:e},m=S()({},f,t);o()(m).forEach(function(t,e,n){a.push(t)}),a=a.sort(),a.forEach(function(t,e,n){c[a[e]]=m[a[e]]}),o()(c).forEach(function(t,e,n){i+=t+"="+c[t]}),u=i.replace(/[^0-9a-zA-Z]/g,""),u=u.toUpperCase();for(var l=0;l<u.length;l++)"A"!=u[l]&&"B"!=u[l]&&"C"!=u[l]&&(s+=u[l]);i=A(s);var p=S()({},t,{asdfghjkl:i},{qwertyuiop:r},{pf:2});return L.stringify(p)}};a["a"].use(j["g"]);var $={index:{},loading:!0},G={index:function(t,e){t.index=e.data}},H={index:function(t,e){var n=t.commit;$.loading=!0;var r=Y.getParams();P.index(r).then(function(t){var e=t.data;0==e.err_code&&(n({type:"index",data:e.data}),$.loading=!1)}).catch(function(t){$.loading=!1,Object(j["g"])({message:"网络出现问题,请重试",duration:1500})})}},J={},U={state:$,mutations:G,actions:H,getters:J};a["a"].use(j["g"]);var W={cartCount:"",loginCheck:!1,phpParams:{}},I={cartCount:function(t,e){t.cartCount=0==e.data?"":e.data},loginCheck:function(t,e){0==e.data.err_code?t.loginCheck=!0:t.loginCheck=!1},phpParams:function(t,e){t.phpParams=e.data.data}},R={cartCount:function(t,e){var n=t.commit;P.cartCount().then(function(t){var e=t.data;0==e.err_code&&n({type:"cartCount",data:e.data})}).catch(function(t){Object(j["g"])({message:"网络出现问题,请重试",duration:1500})})},loginCheck:function(t,e){var n=t.commit;P.loginCheck().then(function(t){var e=t.data;n({type:"loginCheck",data:e})}).catch(function(t){Object(j["g"])({message:"网络出现问题,请重试",duration:1500})})},customsrService:function(t,e){t.commit;var n={pf:window.lxpf,searchModel:""};P.customsrService(n).then(function(t){}).catch(function(t){Object(j["g"])({message:"网络出现问题,请重试",duration:1500})})},getCommonParams:function(t,e){var n=t.commit,r=Y.getParams();P.getCommonParams(r).then(function(t){var e=t.data;n({type:"phpParams",data:e})}).catch(function(t){Object(j["g"])({message:"网络出现问题,请重试",duration:1500})})}},Z={},K={state:W,mutations:I,actions:R,getters:Z};a["a"].use(C["a"]);var Q=new C["a"].Store({modules:{home:U,common:K}}),V=function(t){var e=new Date;e.setTime(1e3*t);var n=e.getFullYear(),r=e.getMonth()+1;r=r<10?"0"+r:r;var o=e.getDate();o=o<10?"0"+o:o;var a=e.getHours();a=a<10?"0"+a:a;var c=e.getMinutes(),i=e.getSeconds();return c=c<10?"0"+c:c,i=i<10?"0"+i:i,n+"-"+r+"-"+o+" "},X={dateTimeFormate:V},tt={bind:function(t,e){t.addEventListener("click",function(){document.body.scrollTop=0,document.documentElement.scrollTop=0,document.querySelector(".container-wrap").scrollTop=0},!1)}},et={install:function(t){t.directive("backTop",tt)}};n("e1a5"),n("bfd9");o()(X).forEach(function(t){return a["a"].filter(t,X[t])}),a["a"].use(et),a["a"].prototype.$http=d.a,d.a.defaults.headers.post["Content-Type"]="application/x-www-form-urlencoded",d.a.defaults.withCredentials=!0,a["a"].config.productionTip=!1,new a["a"]({router:w,store:Q,render:function(t){return t(l)}}).$mount("#app")},bfd9:function(t,e,n){}});
//# sourceMappingURL=app.9393d0a1.js.map
\ No newline at end of file
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
No preview for this file type
This diff could not be displayed because it is too large.
No preview for this file type
No preview for this file type
!function(a,b){function c(){var b=f.getBoundingClientRect().width;b/i>540&&(b=540*i);var c=b/10;f.style.fontSize=c+"px",k.rem=a.rem=c}var d,e=a.document,f=e.documentElement,g=e.querySelector('meta[name="viewport"]'),h=e.querySelector('meta[name="flexible"]'),i=0,j=0,k=b.flexible||(b.flexible={});if(g){var l=g.getAttribute("content").match(/initial\-scale=([\d\.]+)/);l&&(j=parseFloat(l[1]),i=parseInt(1/j))}else if(h){var m=h.getAttribute("content");if(m){var n=m.match(/initial\-dpr=([\d\.]+)/),o=m.match(/maximum\-dpr=([\d\.]+)/);n&&(i=parseFloat(n[1]),j=parseFloat((1/i).toFixed(2))),o&&(i=parseFloat(o[1]),j=parseFloat((1/i).toFixed(2)))}}if(!i&&!j){var p=(a.navigator.appVersion.match(/android/gi),a.navigator.appVersion.match(/iphone/gi)),q=a.devicePixelRatio;i=p?q>=3&&(!i||i>=3)?3:q>=2&&(!i||i>=2)?2:1:1,j=1/i}if(f.setAttribute("data-dpr",i),!g){if(g=e.createElement("meta"),g.setAttribute("name","viewport"),g.setAttribute("content","initial-scale="+j+", maximum-scale="+j+", minimum-scale="+j+", user-scalable=no"),f.firstElementChild){f.firstElementChild.appendChild(g)}else{var r=e.createElement("div");r.appendChild(g),e.write(r.innerHTML)}}a.addEventListener("resize",function(){clearTimeout(d),d=setTimeout(c,300)},!1),a.addEventListener("pageshow",function(a){a.persisted&&(clearTimeout(d),d=setTimeout(c,300))},!1),"complete"===e.readyState?e.body.style.fontSize=12*i+"px":e.addEventListener("DOMContentLoaded",function(){e.body.style.fontSize=12*i+"px"},!1),c(),k.dpr=a.dpr=i,k.refreshRem=c,k.rem2px=function(a){var b=parseFloat(a)*this.rem;return "string"==typeof a&&a.match(/rem$/)&&(b+="px"),b},k.px2rem=function(a){var b=parseFloat(a)/this.rem;return "string"==typeof a&&a.match(/px$/)&&(b+="rem"),b}}(window,window.lib||(window.lib={}));
\ No newline at end of file
window.onload = function() {
// 在页面加载完毕或者也不用加载完毕,定义一个初始时间
var start = new Date();
// console.log(start);
// 在页面关闭前,调用sa的track方法
window.onbeforeunload = function() {
var end = new Date();
// 如果用户一直不关闭页面,可能出现超大值,可以根据业务需要处理,例如设置一个上限
var duration = (end.getTime() - start.getTime()) / 1000;
// console.log(duration);
// 定义一个记录页面停留时间的事件pageView,并且保存需要的属性(停留时间和当前页面的地址)
sensors.track('pageclose', {
pageStayTime: duration,
pageUrl: window.location.href
});
};
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment