Commit 04a9a692 by 程默

fix

parent a0102052
......@@ -20,154 +20,161 @@ import { serialize, getQueryVariable, DFSImg } from "@/utils/index";
import login from "@/api/login";
import indexApi from "@/api/index";
export default {
data(){
return{
link : '',
shareShopName: '',//分享名称
shareLogoUrl: '',//分享图片url
newWindowHref: '',//分享页面url
data() {
return {
link: "",
shareShopName: "", //分享名称
shareLogoUrl: "", //分享图片url
newWindowHref: "", //分享页面url
};
},
async onLoad(options) {
console.log(options, '第三方页面');
/**
* scene=sso 第三方需要登录的页面
* login=1 jwt需要登录(临时方案)
*/
if (options.scene) {
//扫码
let data = await this.getParams(options.scene);
if (data.sso) {
if (!wx.getStorageSync("sessionid")) {
wx.redirectTo({
url: `../login/main?scene=sso&back=${data.link}`,
});
} else {
this.getSsoBcakUrl(decodeURIComponent(data.link));
}
},
async onLoad(options){
console.log(options,66667777777)
if(options.scene) {
//扫码
let data = await this.getParams(options.scene);
console.log(data,888999,wx.getStorageSync("sessionid"))
// debugger
if (data.sso) {
if (!wx.getStorageSync("sessionid")) {
wx.redirectTo({
url: `../login/main?scene=sso&back=${data.link}`,
});
}else{
this.getSsoBcakUrl(decodeURIComponent(data.link))
// let link = decodeURIComponent(data.link).replace(
// "${token}",
// wx.getStorageSync("sessionid")
// );
// this.link = decodeURIComponent(link);
}
}
}else if(options.link){
if(getUrlKey(decodeURIComponent(options.link),'scene') == 'sso') {
this.getSsoBcakUrl(decodeURIComponent(options.link))
}else if(getUrlKey(decodeURIComponent(options.link),'login') != '1') {
this.link = decodeURIComponent(options.link)
}else {
if(wx.getStorageSync("sessionid")) {
this.link = forUrlAddKey(
decodeURIComponent(options.link),
{
token: wx.getStorageSync("sessionid"),
jwt: 1
}
)
}else {
let url = `/pages/login/main?scene=sso&back=${options.link}`;
wx.navigateTo({
url
})
}
}
}
} else if (options.link) {
if (getUrlKey(decodeURIComponent(options.link), "scene") == "sso") {
if (!wx.getStorageSync("sessionid")) {
wx.redirectTo({
url: `../login/main?scene=sso&back=${options.link}`,
});
} else {
this.getSsoBcakUrl(decodeURIComponent(options.link));
}
},
async onShareAppMessage(res) {
let url = ''
console.log(this.newWindowHref + 'this.newWindowHref')
//分享路径
if(this.newWindowHref){
url = this.newWindowHref;
}else{
url = res.webViewUrl;
} else if (getUrlKey(decodeURIComponent(options.link), "login") != "1") {
this.link = decodeURIComponent(options.link);
} else {
if (wx.getStorageSync("sessionid")) {
this.link = forUrlAddKey(decodeURIComponent(options.link), {
token: wx.getStorageSync("sessionid"),
jwt: 1,
});
} else {
let url = `/pages/login/main?scene=sso&back=${options.link}`;
wx.navigateTo({
url,
});
}
url = removeUrlKey(url,['token'])
//分享页面去掉登录态
if (url.indexOf("sessionid") > -1) {
url = url.split("?")[0] + "?mixid=" + this.shopId;
}
}
},
async onShareAppMessage(res) {
let url = "";
console.log(this.newWindowHref + "this.newWindowHref");
//分享路径
if (this.newWindowHref) {
url = this.newWindowHref;
} else {
url = res.webViewUrl;
}
url = removeUrlKey(url, ["token"]);
//分享页面去掉登录态
if (url.indexOf("sessionid") > -1) {
url = url.split("?")[0] + "?mixid=" + this.shopId;
}
this.shareUrl = url;
console.log(this.shareUrl, "index12");
console.log(
`/pages/index/main?link=${encodeURIComponent(this.shareUrl)}`,
"测试直播分享相关"
);
return {
title: this.shareShopName, // 默认是小程序的名称
path: `/pages/wxArticle/main?link=${encodeURIComponent(this.shareUrl)}`, // 默认是当前页面
imageUrl: this.shareLogoUrl,
success: function (res) {
// 转发成功之后的回调
if (res.errMsg == "shareAppMessage:ok") {
console.log(res, "分享成功");
}
this.shareUrl = url ;
console.log(this.shareUrl, "index12");
console.log(`/pages/index/main?link=${encodeURIComponent(this.shareUrl)}`, '测试直播分享相关')
return {
title: this.shareShopName, // 默认是小程序的名称
path: `/pages/wxArticle/main?link=${encodeURIComponent(this.shareUrl)}`, // 默认是当前页面
imageUrl: this.shareLogoUrl,
success: function(res) {
// 转发成功之后的回调
if (res.errMsg == "shareAppMessage:ok") {
console.log(res, "分享成功");
}
},
fail: function() {
// 转发失败之后的回调
if (res.errMsg == "shareAppMessage:fail cancel") {
// 用户取消转发
console.log(res, "分享失败");
} else if (res.errMsg == "shareAppMessage:fail") {
// 转发失败,其中 detail message 为详细失败信息
}
},
complete: function() {
// 转发结束之后的回调(转发成不成功都会执行)
},
fail: function () {
// 转发失败之后的回调
if (res.errMsg == "shareAppMessage:fail cancel") {
// 用户取消转发
console.log(res, "分享失败");
} else if (res.errMsg == "shareAppMessage:fail") {
// 转发失败,其中 detail message 为详细失败信息
}
},
complete: function () {
// 转发结束之后的回调(转发成不成功都会执行)
},
};
},
methods: {
getSsoBcakUrl(link) {
let op = {
callbackUrl: link,
email: "",
fromAppid: "VsEOuDJqBnGNyXZJWCQS",
// mobilephone: '15821335747',hgFTLLhgnBmeOyCkcbyv
// toAppid: 'hgFTLLhgnBmeOyCkcbyv',
toAppid: getUrlKey(link, "toAppid"), //道可
wxAvatarUrl: this.$store.state.userInfo.avatarUrl,
};
login.getSsoBcakUrl(op).then((res) => {
console.log(res, this.link, 555444);
if (res.data.code == "200") {
this.link = res.data.data;
} else {
wx.showToast({ title: res.data.msg, icon: "none" });
}
};
});
},
methods: {
getSsoBcakUrl(link) {
let op = {
callbackUrl: link,
email: "",
fromAppid: "VsEOuDJqBnGNyXZJWCQS",
// mobilephone: '15821335747',hgFTLLhgnBmeOyCkcbyv
// toAppid: 'hgFTLLhgnBmeOyCkcbyv',
toAppid: getUrlKey(link,'toAppid'),//道可
wxAvatarUrl: this.$store.state.userInfo.avatarUrl,
};
login.getSsoBcakUrl(op).then((res) => {
console.log(res,this.link,555444)
if(res.data.code == '200') {
this.link = res.data.data;
}else {
wx.showToast({ title: res.data.msg, icon: "none" });
}
});
},
getParams(options) {
return new Promise((resolve, reject) => {
indexApi
.getShareSceneRecord(options)
.then((res) => {
if (res.data.code == "200") {
let scene = JSON.parse(res.data.data.scene);
resolve(scene);
}
})
.catch((err) => {});
});
},
//加载成功
handleLoad() {
console.log("网页加载成功");
},
//右上角分享时触发
getMessage(res) {
let len = res.target.data.length - 1;
console.log(res, "h5消息", res.target.data[len]);
this.shareShopName = res.target.data[len].shareShopName || "";
if(res.target.data[len].shareLogoUrl) {
this.shareLogoUrl = DFSImg(res.target.data[len].shareLogoUrl, 500, 400);
getParams(options) {
return new Promise((resolve, reject) => {
indexApi
.getShareSceneRecord(options)
.then((res) => {
if (res.data.code == "200") {
let scene = JSON.parse(res.data.data.scene);
resolve(scene);
}
this.newWindowHref = res.target.data[len].shareImgUrl;// + '&fromVisitorOpenId=' + wx.getStorageSync("openid")
console.log("分享信息:", this.shareLogoUrl, this.shareShopName,1111111,res);
},
handleError(data) {
wx.showLoading({
title: "网页加载失败 请右上角刷新",
});
},
}
})
.catch((err) => {});
});
},
//加载成功
handleLoad() {
console.log("网页加载成功");
},
//右上角分享时触发
getMessage(res) {
let len = res.target.data.length - 1;
console.log(res, "h5消息", res.target.data[len]);
this.shareShopName = res.target.data[len].shareShopName || "";
if (res.target.data[len].shareLogoUrl) {
this.shareLogoUrl = DFSImg(res.target.data[len].shareLogoUrl, 500, 400);
}
this.newWindowHref = res.target.data[len].shareImgUrl; // + '&fromVisitorOpenId=' + wx.getStorageSync("openid")
console.log(
"分享信息:",
this.shareLogoUrl,
this.shareShopName,
1111111,
res
);
},
handleError(data) {
wx.showLoading({
title: "网页加载失败 请右上角刷新",
});
},
},
};
</script>
<style lang="scss" scoped></style>
!function i(o,a,r){function l(t,e){if(!a[t]){if(!o[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(s)return s(t,!0);throw(n=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",n}n=a[t]={exports:{}},o[t][0].call(n.exports,function(e){return l(o[t][1][e]||e)},n,n.exports,i,o,a,r)}return a[t].exports}for(var s="function"==typeof require&&require,e=0;e<r.length;e++)l(r[e]);return l}({1:[function(e,t,n){var i,o,t=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function l(t){if(i===setTimeout)return setTimeout(t,0);if((i===a||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:a}catch(e){i=a}try{o="function"==typeof clearTimeout?clearTimeout:r}catch(e){o=r}}();var s,u=[],p=!1,c=-1;function d(){p&&s&&(p=!1,s.length?u=s.concat(u):c=-1,u.length&&g())}function g(){if(!p){var e=l(d);p=!0;for(var t=u.length;t;){for(s=u,u=[];++c<t;)s&&s[c].run();c=-1,t=u.length}s=null,p=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===r||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function h(){}t.nextTick=function(e){var t=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new m(e,t)),1!==u.length||p||l(g)},m.prototype.run=function(){this.fun.apply(null,this.array)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={},t.on=h,t.addListener=h,t.once=h,t.off=h,t.removeListener=h,t.removeAllListeners=h,t.emit=h,t.prependListener=h,t.prependOnceListener=h,t.listeners=function(e){return[]},t.binding=function(e){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(e){throw new Error("process.chdir is not supported")},t.umask=function(){return 0}},{}],2:[function(e,t,L){!function(D,t){!function(){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.hylBannerLink=i,L.hylToLink=l;var a=void 0,m=void 0,h=void 0,f=void 0,v=void 0,r=void 0,w="",n=null;function i(e){var t,n,i,o,a,r,l,s,u,p,c,d,g;w=$nuxt.$store,console.log("hylBannerLink",e),3!=e.type?1.1==e.type&&(1==w.state.miniProgram||2==w.state.miniProgram?-1<e.link.indexOf("pages/hiberDrawEntity/hiberDrawEntity")?(t=e.link.split("?"))[1]&&t[1].split("=")[1]&&(l=JSON.parse(decodeURIComponent(t[1].split("=")[1])),u=(s=l).id,p=l.type,c=l.isOpenDraw,d=v.formatDate.format(new Date),g=(g=l.validTimeEnd).split(".").join("-"),2==l.validTimeEnd.split(" ").length||(d=d.split(" ")[0]),d=(d=new Date(g.replace(/-/g,"/")).getTime()-new Date(d.replace(/-/g,"/")).getTime())/1e3,2==c?0<=d?(1==p&&$mp.miniProgram.navigateTo({url:"/pages/draw/drawDetails/drawDetails?id="+u}),2==p&&$mp.miniProgram.navigateTo({url:"/pages/draw/drawDetails/drawDetails?id="+u}),3==p&&$mp.miniProgram.navigateTo({url:"/pages/draw/turntable/turntable?id="+u})):2==p&&null!=s.drawRecordEntity?$mp.miniProgram.navigateTo({url:"/pages/draw/drawDetails/drawDetails?perdraw=33&id="+u}):2==p&&null==s.drawRecordEntity?$mp.miniProgram.navigateTo({url:"/pages/draw/drawDetails/drawDetails?id="+u}):m.alert({title:"标题",message:"抽奖已结束"}).then(function(){}):1==p?null==s.drawRecordEntity?$mp.miniProgram.navigateTo({url:"/pages/draw/drawDetails/drawDetails?id="+u}):$mp.miniProgram.navigateTo({url:"/pages/draw/openDraw/openDraw?id="+u}):2==p?null!=s.drawRecordEntity?$mp.miniProgram.navigateTo({url:"/pages/draw/openDraw/openDraw?id="+u}):$mp.miniProgram.navigateTo({url:"/pages/draw/drawDetails/drawDetails?id="+u}):null==s.drawRecordEntity?m.alert({title:"标题",message:"抽奖已结束"}).then(function(){}):$mp.miniProgram.navigateTo({url:"/pages/draw/openDraw/openDraw?id="+u})):-1<e.link.indexOf("type")?(t=e.link.split("?"),"[object Array]"==Object.prototype.toString.call(t)&&t.length&&(r=t[1].split("&"),n={},r.forEach(function(e){e.split("="),n[e.split("=")[0]]=e.split("=")[1]}),console.log(n),i=n.id,o=n.jumpScore,a=n.type,w.state.sessionId?f.getConsumerScoreFlag({outId:w.state.userInfo.mixId,advertisementId:i}).then(function(e){0==e.code&&(1==e.object?(o&&0<o&&f.changeScore({outId:w.state.userInfo.mixId,advertisementId:i}).then(function(e){e.object&&$mp.miniProgram.navigateTo({url:"/pages/advertisement/advertisement?type="+a+"&id="+i})}),o&&o<0&&y.showModal({title:"提示",content:"跳转扣除"+Math.abs(o)+"积分",success:function(e){e.confirm?f.changeScore({outId:w.state.userInfo.mixId,advertisementId:i}).then(function(e){e.object&&$mp.miniProgram.navigateTo({url:"/pages/advertisement/advertisement?type="+a+"&id="+i})}):e.cancel&&console.log("用户点击取消")}}),o||$mp.miniProgram.navigateTo({url:"/pages/advertisement/advertisement?type="+a+"&id="+i})):$mp.miniProgram.navigateTo({url:"/pages/advertisement/advertisement?type="+a+"&id="+i}))}):$mp.miniProgram.navigateTo({url:"/pages/login/login"}))):((e.link.includes("pages/draw/draw/draw")||e.link.includes("pages/question/question")||e.link.includes("pages/live/live"))&&(r=k($nuxt.$route.query.mixid+"_location")&&JSON.parse(k($nuxt.$route.query.mixid+"_location")).outId,console.log(r,"跳转id"),r&&(e.link.includes("?")?e.link=e.link+"&addressId="+r:e.link=e.link+"?addressId="+r)),$mp.miniProgram.navigateTo({url:e.link})):h("暂不支持")):1==w.state.miniProgram||2==w.state.miniProgram?$mp.miniProgram.navigateTo({url:"/pages/toMini/toMini?weappPage="+encodeURIComponent(e.link)+"&weappAppId="+e.name}):h("暂不支持")}function l(e){if(n=e.type,(w=$nuxt.$store).getters["sceneModule/flushbonadingVisible"])if(null!=n&&"undefined"!=n){if(0!=n)if(1==n)"/"==e.link.substring(0,1)?$nuxt.$router.push(e.link):!e.link.startsWith("http")&&!e.link.startsWith("https")||1!=w.state.miniProgram&&2!=w.state.miniProgram?window.location.href=e.link:$mp.miniProgram.navigateTo({url:"/pages/wxArticle/main?link="+encodeURIComponent(e.link)});else if(2==n){var t=e.feature.type;"themeCouponClick"==t||0==t?this.$themeCouponClick(e.feature.value.couponCode,e.feature.value):1==t?(console.log("是分享了。。。。"),2==e.type&&1==e.feature.type&&$nuxt.$SHARE({itemList:e.feature.value})):"themeMemberCardClick"!=t&&2!=t||this.$themeMemberCardClick(e.feature.value)}else if(1.1==n||3==n)i(e);else if(1.2==n){if("outerChain:businessCenter"==e.link)return console.log(r.GUIDE_URL,"-----shopConfig.GUIDE_URL"),t=r.GUIDE_URL+"/login?mixid="+$nuxt.$route.query.mixid+"&back="+encodeURIComponent(window.location.href),void(window.location.href=t);"/"==e.link.substring(0,1)?$nuxt.$router.push(e.link):1==w.state.miniProgram||2==w.state.miniProgram?$mp.miniProgram.navigateTo({url:"/pages/wxArticle/main?link="+encodeURIComponent(e.link)}):window.location.href=e.link}else 0<e.length&&$nuxt.$router.push(e.link)}else 0<e.length&&$nuxt.$router.push(e)}function k(e){if(D.browser&&"undefined"!=typeof document)for(var t=document.cookie.split(";"),n=0;n<t.length;n++){var i=t[n].split("=");if(i[0].trim()==e)return decodeURIComponent(i[1])}}Object.defineProperty(L,"__esModule",{value:!0}),L.themeToLinkInit=e,L.$themeToLink=x;var s=null,u=null,p=null,a=void 0,c=void 0,r=void 0,h=void 0,l=void 0,d=void 0,y=void 0;function g(e,t){t=1<arguments.length&&void 0!==t?t:"";return"../index/main?from=themeLink&backpath="+encodeURIComponent(e)+"&params="+encodeURIComponent(t)}function C(){return 1==s&&this.$store&&this.$store.state.miniProgram}function T(){return 1==s?r.GUIDE_URL:2==s?config.GUIDE_URL:void 0}function P(e){return e.link.split("?")[0]}function $(e){return e.link.split("?")[1]||""}function o(t){var e=getApp();return e.globalData.footerVal?e.globalData.footerVal.componentData.list.findIndex(function(e){return P(e.link)==t.split("?")[0]}):-1}var b=["index","media-video","goods-goodsInfo","goods-commodityMenu","goodsSearch-goodsSearch","chooseStores","activty-receivingGift","activty","login-register","login-phoneLogin","login-authInformation","login-forgetPassWord","login-accountLogin","login-wxRegister","pay-payList","comment-evaluateList","goods-commonProblemList","article-articlePage","article-articleList","goods-posters","liveBroadcast","liveBroadcast-list","personalCenter-coupon-getCoupon","buyerShow-showDetail","goods-addGoodsList","personalCenter-CDkey-exchange","giftCards-linkReceive","giftCoupon-preview","smartForm","shopCart-shareShopCart","groupBuying-beInvite","brandTopics","personalCenter-spokesmanCenter","personalCenter-spokesmanCenter-mine-spokesmanHomePage","liveBroadcast-lived","personalCenter-spokesmanCenter-mine-getBusinessCard","changeAdr"].map(function(e){return"/index"==(e="/"+e.replace(/-/g,"/"))?"/":e});function e(e){var t=e.homeNative,n=e.wx,i=e.getCoupon,o=e.themeMemberCardClick,e=e.requireFun;if(s=t,d=e,console.log(d,"-------------------------115"),c=d.createdUserJWT,d.getBcakUrl,y=n,console.log(s,"-------------themeToLinkInit"),console.log("toPage-------------"),p=1==s?function(e){var t=e.pagePath;1==(e=void 0===(e=e.pageType)?1:e)?this.$router.push(t):2==e?window.location.href=t:3==e&&y.navigateTo({url:t})}:2==s?function(e){var t=e.pagePath;1==(e=void 0===(e=e.pageType)?1:e)?y.navigateTo({url:t}):2==e&&y.reLaunch({url:t})}:void 0,1==s)try{a=d.Vue,r=d.shopConfig,a.prototype.$themeToLink=x,h=d.Toast,l=d.hylToLink}catch(e){}else 2==s&&((u=getApp()).$themeToLink=x,u.getCoupon=i,u.themeMemberCardClick=o)}function I(e){var t=P(e),n=$(e);return(e=b.includes(t)||"/goods/"==t.substr(0,7)||t.includes("/brandTopics"))||function(){return 1==s?this.$store&&this.$store.state.sessionId&&this.$store.state.sessionId:2==s&&(y&&y.getStorageSync("sessionid"))}()?!(0<=(e=o(t)))||(e=0==e?o("/"):e,t="/"==t?"/pages/home/main":"/pages/tabBar"+e+"/main",(e=getCurrentPages())[e.length-1].route!=t&&(p({pagePath:t+(n?"?"+n:""),pageType:2}),0)):(p({pagePath:"/pages/login/main?back="+t}),0)}async function x(t){console.log(t,"$themeToLink"),t.type&&t.link&&t.link.includes("dynamicForm")&&await c().then(function(e){t.link+="&token="+e}),1==s&&l.call(this,{data:t,Vue:d.Vue,Dialog:d.Dialog,Toast:d.Toast,hyl:d.hyl,dateFilter:d.dateFilter,shopConfig:d.shopConfig});var e,n,i,o,a,r=t.type;2!=r&&2==s&&!I(t)||(null!=r&&"undefined"!=r?0==r||(1==r?"/"==t.link.substring(0,1)?1==s?p.call(this,{pagePath:t.link}):2==s&&(e=g(P(t),$(t)),p({pagePath:e})):t.link.startsWith("http")||t.link.startsWith("https")?1==s?p.call(this,{pagePath:t.link,pageType:2}):(e="/pages/wxArticle/main?link="+encodeURIComponent(t.link),p({pagePath:e})):p({pagePath:t.link,pageType:2}):1.1==r?2==s?p({pagePath:t.link}):1==s&&(1==C.call(this)||2==C.call(this)?p.call(this,{pagePath:t.link,pageType:3}):h("暂不支持")):1.2==r?"outerChain:businessCenter"!=t.link?"/"==t.link.substring(0,1)?p.call(this,{pagePath:t.link}):1==s?1==this.$store.state.miniProgram||2==this.$store.state.miniProgram?(n="/pages/wxArticle/main?link="+encodeURIComponent(t.link),p.call(this,{pagePath:n,pageType:3})):p.call(this,{pagePath:t.link,pageType:2}):2==s&&(n="/pages/wxArticle/main?link="+encodeURIComponent(t.link),p.call(this,{pagePath:n,pageType:1})):(console.log(T(),"-----getGUIDE_URL()"),i=T()+"/login?mixid="+this.$nuxt.$route.query.mixid+"&back="+encodeURIComponent(window.location.href),p.call(this,{pagePath:i,pageType:2})):2==r?"themeCouponClick"==(i=t.feature.type)||0==i?1==s?this.$themeCouponClick(t.feature.value.couponCode,t.feature.value):2==s&&u.getCoupon(t.feature.value.couponCode,t.feature.value):1==i?2==t.type&&1==t.feature.type&&function(e){1==s?this.$nuxt.$SHARE({itemList:e.feature.value}):2==s&&u.shareInit({itemList:e.feature.value})}.call(this,t):"themeMemberCardClick"!=i&&2!=i||(1==s?this.$themeMemberCardClick(t.feature.value):2==s&&u.themeMemberCardClick(t.feature.value)):3==r?1==s?1==C.call(this)||2==C.call(this)?this.$store.getters["sceneModule/flushbonadingVisible"]?(o="/pages/toMini/toMini?weappPage="+encodeURIComponent(t.link)+"&weappAppId="+t.name,p.call(this,{pagePath:o,pageType:3})):(o="/pages/toMini/main?weappPage="+encodeURIComponent(t.link)+"&weappAppId="+t.name,p({pagePath:o})):h("暂不支持"):(a="/pages/toMini/main?weappPage="+encodeURIComponent(t.link)+"&weappAppId="+t.name,p({pagePath:a})):0<t.length&&p.call(this,{pagePath:t.link})):0<t.length&&(1==s?p.call(this,{pagePath:t}):2==s&&(a=g(P(t),$(t)),p({pagePath:a}))))}t.themeToLinkInit=e}.call(this)}.call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:1}]},{},[2]);
\ No newline at end of file
!function i(o,a,r){function l(t,e){if(!a[t]){if(!o[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(s)return s(t,!0);throw(n=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",n}n=a[t]={exports:{}},o[t][0].call(n.exports,function(e){return l(o[t][1][e]||e)},n,n.exports,i,o,a,r)}return a[t].exports}for(var s="function"==typeof require&&require,e=0;e<r.length;e++)l(r[e]);return l}({1:[function(e,t,n){var i,o,t=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function l(t){if(i===setTimeout)return setTimeout(t,0);if((i===a||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:a}catch(e){i=a}try{o="function"==typeof clearTimeout?clearTimeout:r}catch(e){o=r}}();var s,u=[],p=!1,c=-1;function d(){p&&s&&(p=!1,s.length?u=s.concat(u):c=-1,u.length&&g())}function g(){if(!p){var e=l(d);p=!0;for(var t=u.length;t;){for(s=u,u=[];++c<t;)s&&s[c].run();c=-1,t=u.length}s=null,p=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===r||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function h(){}t.nextTick=function(e){var t=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new m(e,t)),1!==u.length||p||l(g)},m.prototype.run=function(){this.fun.apply(null,this.array)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={},t.on=h,t.addListener=h,t.once=h,t.off=h,t.removeListener=h,t.removeAllListeners=h,t.emit=h,t.prependListener=h,t.prependOnceListener=h,t.listeners=function(e){return[]},t.binding=function(e){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(e){throw new Error("process.chdir is not supported")},t.umask=function(){return 0}},{}],2:[function(e,t,L){!function(D,t){!function(){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.hylBannerLink=i,L.hylToLink=l;var a=void 0,m=void 0,h=void 0,f=void 0,v=void 0,r=void 0,w="",n=null;function i(e){var t,n,i,o,a,r,l,s,u,p,c,d,g;w=$nuxt.$store,console.log("hylBannerLink",e),3!=e.type?1.1==e.type&&(1==w.state.miniProgram||2==w.state.miniProgram?-1<e.link.indexOf("pages/hiberDrawEntity/hiberDrawEntity")?(t=e.link.split("?"))[1]&&t[1].split("=")[1]&&(l=JSON.parse(decodeURIComponent(t[1].split("=")[1])),u=(s=l).id,p=l.type,c=l.isOpenDraw,d=v.formatDate.format(new Date),g=(g=l.validTimeEnd).split(".").join("-"),2==l.validTimeEnd.split(" ").length||(d=d.split(" ")[0]),d=(d=new Date(g.replace(/-/g,"/")).getTime()-new Date(d.replace(/-/g,"/")).getTime())/1e3,2==c?0<=d?(1==p&&$mp.miniProgram.navigateTo({url:"/pages/draw/drawDetails/drawDetails?id="+u}),2==p&&$mp.miniProgram.navigateTo({url:"/pages/draw/drawDetails/drawDetails?id="+u}),3==p&&$mp.miniProgram.navigateTo({url:"/pages/draw/turntable/turntable?id="+u})):2==p&&null!=s.drawRecordEntity?$mp.miniProgram.navigateTo({url:"/pages/draw/drawDetails/drawDetails?perdraw=33&id="+u}):2==p&&null==s.drawRecordEntity?$mp.miniProgram.navigateTo({url:"/pages/draw/drawDetails/drawDetails?id="+u}):m.alert({title:"标题",message:"抽奖已结束"}).then(function(){}):1==p?null==s.drawRecordEntity?$mp.miniProgram.navigateTo({url:"/pages/draw/drawDetails/drawDetails?id="+u}):$mp.miniProgram.navigateTo({url:"/pages/draw/openDraw/openDraw?id="+u}):2==p?null!=s.drawRecordEntity?$mp.miniProgram.navigateTo({url:"/pages/draw/openDraw/openDraw?id="+u}):$mp.miniProgram.navigateTo({url:"/pages/draw/drawDetails/drawDetails?id="+u}):null==s.drawRecordEntity?m.alert({title:"标题",message:"抽奖已结束"}).then(function(){}):$mp.miniProgram.navigateTo({url:"/pages/draw/openDraw/openDraw?id="+u})):-1<e.link.indexOf("type")?(t=e.link.split("?"),"[object Array]"==Object.prototype.toString.call(t)&&t.length&&(r=t[1].split("&"),n={},r.forEach(function(e){e.split("="),n[e.split("=")[0]]=e.split("=")[1]}),console.log(n),i=n.id,o=n.jumpScore,a=n.type,w.state.sessionId?f.getConsumerScoreFlag({outId:w.state.userInfo.mixId,advertisementId:i}).then(function(e){0==e.code&&(1==e.object?(o&&0<o&&f.changeScore({outId:w.state.userInfo.mixId,advertisementId:i}).then(function(e){e.object&&$mp.miniProgram.navigateTo({url:"/pages/advertisement/advertisement?type="+a+"&id="+i})}),o&&o<0&&y.showModal({title:"提示",content:"跳转扣除"+Math.abs(o)+"积分",success:function(e){e.confirm?f.changeScore({outId:w.state.userInfo.mixId,advertisementId:i}).then(function(e){e.object&&$mp.miniProgram.navigateTo({url:"/pages/advertisement/advertisement?type="+a+"&id="+i})}):e.cancel&&console.log("用户点击取消")}}),o||$mp.miniProgram.navigateTo({url:"/pages/advertisement/advertisement?type="+a+"&id="+i})):$mp.miniProgram.navigateTo({url:"/pages/advertisement/advertisement?type="+a+"&id="+i}))}):$mp.miniProgram.navigateTo({url:"/pages/login/login"}))):((e.link.includes("pages/draw/draw/draw")||e.link.includes("pages/question/question")||e.link.includes("pages/live/live"))&&(r=k($nuxt.$route.query.mixid+"_location")&&JSON.parse(k($nuxt.$route.query.mixid+"_location")).outId,console.log(r,"跳转id"),r&&(e.link.includes("?")?e.link=e.link+"&addressId="+r:e.link=e.link+"?addressId="+r)),$mp.miniProgram.navigateTo({url:e.link})):h("暂不支持")):1==w.state.miniProgram||2==w.state.miniProgram?$mp.miniProgram.navigateTo({url:"/pages/toMini/toMini?weappPage="+encodeURIComponent(e.link)+"&weappAppId="+e.name}):h("暂不支持")}function l(e){if(e=e.data,console.log("----工具中hyl"),n=e.type,(w=$nuxt.$store).getters["sceneModule/flushbonadingVisible"])if(null!=n&&"undefined"!=n){if(0!=n)if(1==n)"/"==e.link.substring(0,1)?$nuxt.$router.push(e.link):!e.link.startsWith("http")&&!e.link.startsWith("https")||1!=w.state.miniProgram&&2!=w.state.miniProgram?window.location.href=e.link:$mp.miniProgram.navigateTo({url:"/pages/wxArticle/main?link="+encodeURIComponent(e.link)});else if(2==n){var t=e.feature.type;"themeCouponClick"==t||0==t?this.$themeCouponClick(e.feature.value.couponCode,e.feature.value):1==t?(console.log("是分享了。。。。"),2==e.type&&1==e.feature.type&&$nuxt.$SHARE({itemList:e.feature.value})):"themeMemberCardClick"!=t&&2!=t||this.$themeMemberCardClick(e.feature.value)}else if(1.1==n||3==n)i(e);else if(1.2==n){if("outerChain:businessCenter"==e.link)return console.log(r.GUIDE_URL,"-----shopConfig.GUIDE_URL"),t=r.GUIDE_URL+"/login?mixid="+$nuxt.$route.query.mixid+"&back="+encodeURIComponent(window.location.href),void(window.location.href=t);"/"==e.link.substring(0,1)?$nuxt.$router.push(e.link):1==w.state.miniProgram||2==w.state.miniProgram?$mp.miniProgram.navigateTo({url:"/pages/wxArticle/main?link="+encodeURIComponent(e.link)}):window.location.href=e.link}else 0<e.length&&$nuxt.$router.push(e.link)}else 0<e.length&&$nuxt.$router.push(e)}function k(e){if(D.browser&&"undefined"!=typeof document)for(var t=document.cookie.split(";"),n=0;n<t.length;n++){var i=t[n].split("=");if(i[0].trim()==e)return decodeURIComponent(i[1])}}Object.defineProperty(L,"__esModule",{value:!0}),L.themeToLinkInit=e,L.$themeToLink=x;var s=null,u=null,p=null,a=void 0,c=void 0,r=void 0,h=void 0,l=void 0,d=void 0,y=void 0;function g(e,t){t=1<arguments.length&&void 0!==t?t:"";return"../index/main?from=themeLink&backpath="+encodeURIComponent(e)+"&params="+encodeURIComponent(t)}function C(){return 1==s&&this.$store&&this.$store.state.miniProgram}function T(){return 1==s?r.GUIDE_URL:2==s?config.GUIDE_URL:void 0}function P(e){return e.link.split("?")[0]}function $(e){return e.link.split("?")[1]||""}function o(t){var e=getApp();return e.globalData.footerVal?e.globalData.footerVal.componentData.list.findIndex(function(e){return P(e.link)==t.split("?")[0]}):-1}var b=["index","media-video","goods-goodsInfo","goods-commodityMenu","goodsSearch-goodsSearch","chooseStores","activty-receivingGift","activty","login-register","login-phoneLogin","login-authInformation","login-forgetPassWord","login-accountLogin","login-wxRegister","pay-payList","comment-evaluateList","goods-commonProblemList","article-articlePage","article-articleList","goods-posters","liveBroadcast","liveBroadcast-list","personalCenter-coupon-getCoupon","buyerShow-showDetail","goods-addGoodsList","personalCenter-CDkey-exchange","giftCards-linkReceive","giftCoupon-preview","smartForm","shopCart-shareShopCart","groupBuying-beInvite","brandTopics","personalCenter-spokesmanCenter","personalCenter-spokesmanCenter-mine-spokesmanHomePage","liveBroadcast-lived","personalCenter-spokesmanCenter-mine-getBusinessCard","changeAdr"].map(function(e){return"/index"==(e="/"+e.replace(/-/g,"/"))?"/":e});function e(e){var t=e.homeNative,n=e.wx,i=e.getCoupon,o=e.themeMemberCardClick,e=e.requireFun;if(s=t,d=e,console.log(d,"-------------------------115"),c=d.createdUserJWT,d.getBcakUrl,y=n,console.log(s,"-------------themeToLinkInit"),console.log("toPage-------------"),p=1==s?function(e){var t=e.pagePath;1==(e=void 0===(e=e.pageType)?1:e)?this.$router.push(t):2==e?window.location.href=t:3==e&&y.navigateTo({url:t})}:2==s?function(e){var t=e.pagePath;1==(e=void 0===(e=e.pageType)?1:e)?y.navigateTo({url:t}):2==e&&y.reLaunch({url:t})}:void 0,1==s)try{a=d.Vue,r=d.shopConfig,a.prototype.$themeToLink=x,h=d.Toast,l=d.hylToLink}catch(e){}else 2==s&&((u=getApp()).$themeToLink=x,u.getCoupon=i,u.themeMemberCardClick=o)}function I(e){var t=P(e),n=$(e);return(e=b.includes(t)||"/goods/"==t.substr(0,7)||t.includes("/brandTopics"))||function(){return 1==s?this.$store&&this.$store.state.sessionId&&this.$store.state.sessionId:2==s&&(y&&y.getStorageSync("sessionid"))}()?!(0<=(e=o(t)))||(e=0==e?o("/"):e,t="/"==t?"/pages/home/main":"/pages/tabBar"+e+"/main",(e=getCurrentPages())[e.length-1].route!=t&&(p({pagePath:t+(n?"?"+n:""),pageType:2}),0)):(p({pagePath:"/pages/login/main?back="+t}),0)}async function x(t){var e,n,i,o,a,r;console.log(t,"$themeToLink"),t.type&&t.link&&t.link.includes("dynamicForm")&&await c().then(function(e){t.link+="&token="+e}),1==s&&this.$store.getters["sceneModule/flushbonadingVisible"]?l.call(this,{data:t,Vue:d.Vue,Dialog:d.Dialog,Toast:d.Toast,hyl:d.hyl,dateFilter:d.dateFilter,shopConfig:d.shopConfig}):2!=(r=t.type)&&1.2!=r&&2==s&&!I(t)||(null!=r&&"undefined"!=r?0==r||(1==r?"/"==t.link.substring(0,1)?1==s?p.call(this,{pagePath:t.link}):2==s&&(e=g(P(t),$(t)),p({pagePath:e})):t.link.startsWith("http")||t.link.startsWith("https")?1==s?p.call(this,{pagePath:t.link,pageType:2}):(e="/pages/wxArticle/main?link="+encodeURIComponent(t.link),p({pagePath:e})):p({pagePath:t.link,pageType:2}):1.1==r?2==s?p({pagePath:t.link}):1==s&&(1==C.call(this)||2==C.call(this)?p.call(this,{pagePath:t.link,pageType:3}):h("暂不支持")):1.2==r?"outerChain:businessCenter"!=t.link?"/"==t.link.substring(0,1)?p.call(this,{pagePath:t.link}):1==s?1==this.$store.state.miniProgram||2==this.$store.state.miniProgram?(n="/pages/wxArticle/main?link="+encodeURIComponent(t.link),p.call(this,{pagePath:n,pageType:3})):p.call(this,{pagePath:t.link,pageType:2}):2==s&&(n="/pages/wxArticle/main?link="+encodeURIComponent(t.link),p.call(this,{pagePath:n,pageType:1})):(console.log(T(),"-----getGUIDE_URL()"),i=T()+"/login?mixid="+this.$nuxt.$route.query.mixid+"&back="+encodeURIComponent(window.location.href),p.call(this,{pagePath:i,pageType:2})):2==r?"themeCouponClick"==(i=t.feature.type)||0==i?1==s?this.$themeCouponClick(t.feature.value.couponCode,t.feature.value):2==s&&u.getCoupon(t.feature.value.couponCode,t.feature.value):1==i?2==t.type&&1==t.feature.type&&function(e){1==s?this.$nuxt.$SHARE({itemList:e.feature.value}):2==s&&u.shareInit({itemList:e.feature.value})}.call(this,t):"themeMemberCardClick"!=i&&2!=i||(1==s?this.$themeMemberCardClick(t.feature.value):2==s&&u.themeMemberCardClick(t.feature.value)):3==r?1==s?1==C.call(this)||2==C.call(this)?this.$store.getters["sceneModule/flushbonadingVisible"]?(o="/pages/toMini/toMini?weappPage="+encodeURIComponent(t.link)+"&weappAppId="+t.name,p.call(this,{pagePath:o,pageType:3})):(o="/pages/toMini/main?weappPage="+encodeURIComponent(t.link)+"&weappAppId="+t.name,p({pagePath:o})):h("暂不支持"):(a="/pages/toMini/main?weappPage="+encodeURIComponent(t.link)+"&weappAppId="+t.name,p({pagePath:a})):0<t.length&&p.call(this,{pagePath:t.link})):0<t.length&&(1==s?p.call(this,{pagePath:t}):2==s&&(a=g(P(t),$(t)),p({pagePath:a}))))}t.themeToLinkInit=e}.call(this)}.call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:1}]},{},[2]);
\ 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 to comment