filesbox/web/dist/design/designstatic/common/js/shareproduct.js

2 lines
40 KiB
JavaScript
Raw Permalink Normal View History

2024-07-26 06:10:54 +00:00
(function(i,y){y.imgEditor={getShareImg:function(r,p){i.ajax({type:"post",headers:{token:getCookie("token")},url:"/api/common/getShareImage",contentType:"application/json;charset=utf-8",dataType:"json",data:JSON.stringify(r),success:function(a){p&&p(a)},error:function(a){layer.open({content:"\u751F\u6210\u56FE\u7247\u5931\u8D25\uFF01",btn:"\u786E\u5B9A"})}})},getTypeList:function(r,p,a){i.ajax({type:"get",headers:{token:getCookie("token")},url:"/api/common/getPicClassify?projectid=45",contentType:"application/json",dataType:"json",data:{classifyType:3,isPrivate:r},success:function(e){p&&p(e)},error:function(e){a&&a(res)}})},getPicList:function(r,p,a,e){var v;p?v={isPrivate:p,isBackPic:p}:v={classifyId:r,isBackPic:p},i.ajax({type:"get",headers:{token:getCookie("token")},url:"/api/common/getClassifyPic?projectid=45",contentType:"application/json",dataType:"json",data:v,success:function(u){a&&a(u)},error:function(u){e&&e(res)}})}},y.imgEditor.sharekj=function(r,p,a,e,v){i("html").css("overflow","hidden"),i("body").css({height:"100vh",overflow:"hidden"});var u=this,f="",x=r,g=function(){i("html").css("overflow","auto"),i("body").css({height:"auto",overflow:"auto"}),i("#coverModal").remove(),typeof e.closeCoverModalListener=="function"&&e.closeCoverModalListener()};i("html").on("click","#unShareBtn",function(t){g(),t.stopPropagation()}),i("html").on("click","#coverModal,.share-card-container-wrap",function(t){g(),t.stopPropagation()}),i("html").on("click","#picCloseShare",function(t){g(),t.stopPropagation()}),i("html").on("click","#picWillShare",function(t){t.stopPropagation()}),i("html").one("click","#shareToWeChatBtn",function(t){if(localStorage.appAdapt===!0||localStorage.appAdapt==="true"){/iPhone|iPad|iPod/i.test(navigator.userAgent)?window.webkit&&window.webkit.messageHandlers.shareAction.postMessage(null):window.Android&&window.Android.jsCallAndroid();return}var _=window.navigator.userAgent,b="";i("#shareToWechat").remove(),i("#shareFooterBar").remove(),/MicroMessenger/gi.test(_)?b='<div id="shareToWechat"><div style="text-align:right;margin-top: 20px;margin-right: 20px;"><img width="144" height="222" src = "/design/designstatic/front/images/shareToUp.png"/></div><div style="margin-top: 10px;text-align: center;color: #fff;"><p style="font-size:18px">\u7ACB\u5373\u5206\u4EAB\u7ED9\u597D\u53CB\u5427</p><p style="font-size:14px;margin-top: 7px">\u70B9\u51FB\u5C4F\u5E55\u53F3\u4E0A\u89D2\u5C06\u672C\u9875\u5206\u4EAB\u7ED9\u597D\u53CB</p></div></div>':b='<div id="shareToWechat" style="position: absolute;bottom: 100px;width: 100%;"><div style="text-align: center;color: #fff;"><p style="font-size:18px">\u7ACB\u5373\u5206\u4EAB\u7ED9\u597D\u53CB\u5427</p><p style="font-size:14px;margin-top: 7px">\u70B9\u51FB\u9009\u62E9\u5206\u4EAB\u9014\u5F84</p></div><div style="margin-top: 20px;text-align: center"><img width="119" height="245" src = "/design/designstatic/front/images/shareToDown.png"/></div></div>',i("#coverModal").append(b),window.socialShareaddShareLog("wechat1"),reportVisitLog&&reportVisitLog.callaction("03"),t.stopPropagation()}),i("html").one("click","#shareOnPicBtn",function(t){var _="";i("#shareOnPic").remove(),i("#shareFooterBar").remove(),_='<div id="shareOnPic" style="display: flex;justify-content: center;align-items: center;height: 100%;"><div style="position: relative;"><img id="picCloseShare" style="position: absolute;top:-15px;right: -15px;" src="/design/designstatic/front/images/closeBtn.png" width="30" height="30"/><div><img id="picWillShare" width="267" height="467"/></div><div style="margin-top: 10px;text-align: center;color: #fff;"><p style="font-size:14px;margin-top: 7px">\u957F\u6309\u4FDD\u5B58\u56FE\u7247\u81F3\u76F8\u518C</p></div></div></div>',i("#coverModal").append(_),i("#picWillShare").attr("src",f),/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)||(window.socialShareaddShareLog("picture"),reportVisitLog&&reportVisitLog.callaction("03")),t.stopPropagation()});function l(t,_){if(t||(t=""),t.length<_)return t;var b=t.substring(0,_-2);return b=b+"...",b}function h(t,_){if(t||