|
@@ -366,15 +366,15 @@ |
|
@@ -366,15 +366,15 @@ |
366
|
/*!****************************!*\
|
366
|
/*!****************************!*\
|
367
|
!*** ./src/public/base.js ***!
|
367
|
!*** ./src/public/base.js ***!
|
368
|
\****************************/
|
368
|
\****************************/
|
369
|
-/*! no static exports found */function(e,o,r){"use strict";Object.defineProperty(o,"__esModule",{value:!0});var n=l(r(/*! babel-runtime/core-js/json/stringify */"./node_modules/babel-runtime/core-js/json/stringify.js")),t=l(r(/*! ../utils/jsonp */"./src/utils/jsonp.js")),s=l(r(/*! ../utils/cookie */"./src/utils/cookie.js")),i=r(/*! ../utils/common */"./src/utils/common.js"),u=l(r(/*! promise-polyfill */"./node_modules/promise-polyfill/src/index.js"));function l(e){return e&&e.__esModule?e:{default:e}}var c="";o.default={env:function(){var e=window.__wxjs_environment;return c=!e&&navigator.userAgent.match(/yohobuy/i)?(document.addEventListener("deviceready",function(){}),"app"):!e&&navigator.userAgent.match(/miniProgram/i)||"miniprogram"===e?"miniprogram":"https://www.yohobuy.com"===location.origin?"pc":"h5"},loginUrl:function(){var e=void 0,o=location.href;return"app"===c?(e="http://m.yohobuy.com/signin.html?refer="+encodeURIComponent(o),o=function(e){var o={},r=void 0,n=void 0,t=void 0;if((r=((e=(e||"").split("?"))[1]||"").split("&"))&&r.length)for(t=0;t<r.length;t++)o[(n=r[t].split("="))[0]]=n[1];return{path:e[0],query:o}}(o),/Android/i.test(navigator.userAgent||"")?(e.indexOf("?")<0&&(e+="?appLogin=1"),0<=location.href.indexOf("&openby")&&(e=e.substring(0,e.indexOf("&openby"))),e+="&"):(0<=location.href.indexOf("#openby")&&(e=e.substring(0,e.indexOf("#openby"))),e+="#"),e+="openby:yohobuy="+(0,n.default)({action:"go.weblogin",params:{priority:"N",jumpurl:{url:o.path,param:o.query},needlogout:"Y"}})):e="pc"===c?"https://www.yoho/signin.html?refer="+encodeURIComponent(location.href):"miniprogram"===c?"/pages/userCenter/userCenter":(o.indexOf("?")<0?o+="?skcall=1":o+="&skcall=1","http://m.yohobuy.com/signin.html?refer="+encodeURIComponent(o)),e},getUid:function(){return new u.default(function(r){if("h5"===c||"pc"===c)(0,t.default)("https://m.yohobuy.com/passport/login/user").then(function(e){var o=0;200===e.code&&(o=Number(e.data)),r(o)});else{var e=Number(s.default.cookie("app_uid"))||Number((0,i.getQueryObj)().uid)||0;r(e)}})}}},"./src/public/goto.js":
|
369
|
+/*! no static exports found */function(e,o,r){"use strict";Object.defineProperty(o,"__esModule",{value:!0});var n=l(r(/*! babel-runtime/core-js/json/stringify */"./node_modules/babel-runtime/core-js/json/stringify.js")),t=l(r(/*! ../utils/jsonp */"./src/utils/jsonp.js")),s=l(r(/*! ../utils/cookie */"./src/utils/cookie.js")),i=r(/*! ../utils/common */"./src/utils/common.js"),u=l(r(/*! promise-polyfill */"./node_modules/promise-polyfill/src/index.js"));function l(e){return e&&e.__esModule?e:{default:e}}var c="";o.default={env:function(){var e=window.__wxjs_environment;return c=!e&&navigator.userAgent.match(/yohobuy/i)?(document.addEventListener("deviceready",function(){}),"app"):!e&&navigator.userAgent.match(/miniProgram/i)||"miniprogram"===e?"miniprogram":"https://www.yohobuy.com"===location.origin?"pc":"h5"},loginUrl:function(){var e=void 0,o=location.href;return"app"===c?(e="http://m.yohobuy.com/signin.html?refer="+encodeURIComponent(o),o=function(e){var o={},r=void 0,n=void 0,t=void 0;if((r=((e=(e||"").split("?"))[1]||"").split("&"))&&r.length)for(t=0;t<r.length;t++)o[(n=r[t].split("="))[0]]=n[1];return{path:e[0],query:o}}(o),/Android/i.test(navigator.userAgent||"")?(e.indexOf("?")<0&&(e+="?appLogin=1"),0<=location.href.indexOf("&openby")&&(e=e.substring(0,e.indexOf("&openby"))),e+="&"):(0<=location.href.indexOf("#openby")&&(e=e.substring(0,e.indexOf("#openby"))),e+="#"),e+="openby:yohobuy="+(0,n.default)({action:"go.weblogin",params:{priority:"N",jumpurl:{url:o.path,param:o.query},needlogout:"Y"}})):e="pc"===c?"https://www.yoho/signin.html?refer="+encodeURIComponent(location.href):"miniprogram"===c?"/pages/userCenter/userCenter":(o.indexOf("?")<0?o+="?skcall=1":o+="&skcall=1","http://m.yohobuy.com/signin.html?refer="+encodeURIComponent(o)),e},getUid:function(){return new u.default(function(r){if("h5"===c||"pc"===c)(0,t.default)("//m.yohobuy.com/passport/login/user").then(function(e){var o=0;200===e.code&&(o=Number(e.data)),r(o)});else{var e=Number(s.default.cookie("app_uid"))||Number((0,i.getQueryObj)().uid)||0;r(e)}})}}},"./src/public/goto.js":
|
370
|
/*!****************************!*\
|
370
|
/*!****************************!*\
|
371
|
!*** ./src/public/goto.js ***!
|
371
|
!*** ./src/public/goto.js ***!
|
372
|
\****************************/
|
372
|
\****************************/
|
373
|
-/*! no static exports found */function(e,o,r){"use strict";Object.defineProperty(o,"__esModule",{value:!0});var n=i(r(/*! babel-runtime/helpers/classCallCheck */"./node_modules/babel-runtime/helpers/classCallCheck.js")),t=i(r(/*! babel-runtime/helpers/createClass */"./node_modules/babel-runtime/helpers/createClass.js")),s=i(r(/*! weixin-js-sdk */"./node_modules/weixin-js-sdk/index.js")),l=r(/*! ../utils/common */"./src/utils/common.js");function i(e){return e&&e.__esModule?e:{default:e}}var u=function(){function o(e){(0,n.default)(this,o),this.env=e}return(0,t.default)(o,[{key:"link",value:function(e){var o=e.currentTarget,r=o.getAttribute("data-type")||"other",n=o.getAttribute("data-id")||"",t=o.getAttribute("data-url")||"",s=o.getAttribute("data-name")||"",i="";if("miniprogram"===this.env)return i="product"===r?"/pages/goodsDetail/goodsDetail?productSkn="+n+"&page_name=goodsList&page_param=5":"brand"===r?"/pages/goodsList/brandStore?shop_id="+n+"&shop_name="+s:t.split("?")[0],(0,l.linkToMiniApp)(i,r);if(i="pc"===this.env?"product"===r?"https://www.yohobuy.com/product/"+n+".html":"brand"===r?"https://www.yohobuy.com/shop/"+s+"-"+n+".html":t:"product"===r?"https://m.yohobuy.com/product/"+n+'.html?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":'+n+"}}":"brand"===r?"https://m.yohobuy.com/product/index/brand?shop_id="+n+'&openby:yohobuy={"action":"go.shop","params":{"shop_id":"'+n+'","shop_template_type":"1","shop_name":"'+s+'","is_red_shop":"1"}}':t,"app"===this.env){var u=document.getElementById("yosdk-goto");return u?u.setAttribute("href",i):u=(0,l.createLinkButton)(i,"yosdk-goto"),u.click()}window.location.href=i}},{key:"goBack",value:function(){"app"===this.env?(0,l.invokeMethod)({method:"go.back"}):"miniprogram"===this.env?s.default.miniProgram.navigateBack():history.go(-1)}}]),o}();o.default=u},"./src/public/login.js":
|
373
|
+/*! no static exports found */function(e,o,r){"use strict";Object.defineProperty(o,"__esModule",{value:!0});var n=i(r(/*! babel-runtime/helpers/classCallCheck */"./node_modules/babel-runtime/helpers/classCallCheck.js")),t=i(r(/*! babel-runtime/helpers/createClass */"./node_modules/babel-runtime/helpers/createClass.js")),s=i(r(/*! weixin-js-sdk */"./node_modules/weixin-js-sdk/index.js")),l=r(/*! ../utils/common */"./src/utils/common.js");function i(e){return e&&e.__esModule?e:{default:e}}var u=function(){function o(e){(0,n.default)(this,o),this.env=e}return(0,t.default)(o,[{key:"link",value:function(e){var o=e.currentTarget,r=o.getAttribute("data-type")||"other",n=o.getAttribute("data-id")||"",t=o.getAttribute("data-url")||"",s=o.getAttribute("data-name")||"",i="";if("miniprogram"===this.env)return i="product"===r?"/pages/goodsDetail/goodsDetail?productSkn="+n+"&page_name=goodsList&page_param=5":"brand"===r?"/pages/goodsList/brandStore?shop_id="+n+"&shop_name="+s:t,(0,l.linkToMiniApp)(i,r);if(i="pc"===this.env?"product"===r?"https://www.yohobuy.com/product/"+n+".html":"brand"===r?"https://www.yohobuy.com/shop/"+s+"-"+n+".html":t:"product"===r?"//m.yohobuy.com/product/"+n+'.html?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":'+n+"}}":"brand"===r?"//m.yohobuy.com/product/index/brand?shop_id="+n+'&openby:yohobuy={"action":"go.shop","params":{"shop_id":"'+n+'","shop_template_type":"1","shop_name":"'+s+'","is_red_shop":"1"}}':t,"app"===this.env){var u=document.getElementById("yosdk-goto");return u?u.setAttribute("href",i):u=(0,l.createLinkButton)(i,"yosdk-goto"),u.click()}window.location.href=i}},{key:"goBack",value:function(){"app"===this.env?(0,l.invokeMethod)({method:"go.back"}):"miniprogram"===this.env?s.default.miniProgram.navigateBack():history.go(-1)}}]),o}();o.default=u},"./src/public/login.js":
|
374
|
/*!*****************************!*\
|
374
|
/*!*****************************!*\
|
375
|
!*** ./src/public/login.js ***!
|
375
|
!*** ./src/public/login.js ***!
|
376
|
\*****************************/
|
376
|
\*****************************/
|
377
|
-/*! no static exports found */function(e,o,r){"use strict";Object.defineProperty(o,"__esModule",{value:!0});var n=l(r(/*! babel-runtime/helpers/classCallCheck */"./node_modules/babel-runtime/helpers/classCallCheck.js")),t=l(r(/*! babel-runtime/helpers/createClass */"./node_modules/babel-runtime/helpers/createClass.js")),s=l(r(/*! weixin-js-sdk */"./node_modules/weixin-js-sdk/index.js")),i=r(/*! ../utils/common */"./src/utils/common.js"),u=l(r(/*! ./base */"./src/public/base.js"));function l(e){return e&&e.__esModule?e:{default:e}}var c=function(){function o(e){(0,n.default)(this,o),this.env=e.env,this.url=e.loginUrl}return(0,t.default)(o,[{key:"auth",value:function(){var r=this;u.default.getUid().then(function(e){if(!e){var o=document.querySelectorAll(".auth");if(o.length)return o.forEach(function(e){e.onclick=function(e){e.preventDefault(),console.log(r),r.goLogin()}}),!0}})}},{key:"goLogin",value:function(){if("miniprogram"===this.env)s.default.miniProgram.switchTab({url:this.url});else if("app"===this.env){var e=document.getElementById("yosdk-login");e||(e=(0,i.createLinkButton)(this.url,"yosdk-login")),e.click()}else window.location.href=this.url;return!1}}]),o}();o.default=c},"./src/public/share.js":
|
377
|
+/*! no static exports found */function(e,o,r){"use strict";Object.defineProperty(o,"__esModule",{value:!0});var n=l(r(/*! babel-runtime/helpers/classCallCheck */"./node_modules/babel-runtime/helpers/classCallCheck.js")),t=l(r(/*! babel-runtime/helpers/createClass */"./node_modules/babel-runtime/helpers/createClass.js")),s=l(r(/*! weixin-js-sdk */"./node_modules/weixin-js-sdk/index.js")),i=r(/*! ../utils/common */"./src/utils/common.js"),u=l(r(/*! ./base */"./src/public/base.js"));function l(e){return e&&e.__esModule?e:{default:e}}var c=function(){function o(e){(0,n.default)(this,o),this.env=e.env,this.url=e.loginUrl}return(0,t.default)(o,[{key:"auth",value:function(){var r=this;u.default.getUid().then(function(e){if(!e){var o=document.querySelectorAll(".auth");if(o.length)return o.forEach(function(e){e.onclick=function(e){e.preventDefault(),r.goLogin()}}),!0}})}},{key:"goLogin",value:function(){if("miniprogram"===this.env)s.default.miniProgram.switchTab({url:this.url});else if("app"===this.env){var e=document.getElementById("yosdk-login");e||(e=(0,i.createLinkButton)(this.url,"yosdk-login")),e.click()}else window.location.href=this.url;return!1}}]),o}();o.default=c},"./src/public/share.js":
|
378
|
/*!*****************************!*\
|
378
|
/*!*****************************!*\
|
379
|
!*** ./src/public/share.js ***!
|
379
|
!*** ./src/public/share.js ***!
|
380
|
\*****************************/
|
380
|
\*****************************/
|