Commit 966fda91 by 李嘉林

支付成功订阅消息

parent 08e039c9
......@@ -10,6 +10,11 @@ export default {
`${process.env.OLSHOP_URL}/shop/getWxMiniSubscribeMessageConfig`
);
},
addWxMiniSubscribeMessageRecord(data) {
return requestPOST(
`${process.env.OLSHOP_URL}/shop/addWxMiniSubscribeMessageRecord`, data
);
},
// 页面数据
themePagesInfo(params) {
return requestPOST(
......
......@@ -40,6 +40,11 @@
</div>
</template>
</div>
<!-- 订阅消息 -->
<div class="subscribe" v-if="miniIdlist.length>0">
<p class="info">订阅消息及时获得物流信息及状态通知</p>
<van-switch :checked="checkedSubscribe" @change="changeCheckedSubscribe" active-color="var(--minor-color)" size="20" />
</div>
</div>
</div>
<div class="line" v-if="orderDetail.orderType == 5"></div>
......@@ -93,6 +98,7 @@
</template>
<script>
import shop from "@/api/shop";
const app = getApp();
const { log } = app;
export default {
......@@ -128,6 +134,13 @@ export default {
default: 0,
},
},
data() {
return {
checkedSubscribe: false, // 订阅消息开关
miniMsgList: [],
miniIdlist: [],
}
},
computed: {
icon() {
return this.datas.componentData["icon"]||'http://mayi-newshop.oss-cn-shanghai.aliyuncs.com/public/png/83a4a0bc-37fc-411e-bc5c-6dd9c1b4a921.png';
......@@ -170,8 +183,23 @@ export default {
},
onLoad() {
console.log("-----------------------info",this.$store.state.spokemanInfo)
this.checkedSubscribe = false;
this.getWxMiniSubscribeMessageConfig();
},
methods: {
getWxMiniSubscribeMessageConfig() {
shop.getWxMiniSubscribeMessageConfig().then(res => {
if (res.data.code == 200) {
const data = res.data.data;
log.info("wx mini subscribe message data: ", data);
console.log(data.miniMessageConfigResponseDTOList,'-------------data')
if(data.miniMessageConfigResponseDTOList && data.miniMessageConfigResponseDTOList.length>0) {
this.miniMsgList = data.miniMessageConfigResponseDTOList;
this.miniIdlist = this.miniMsgList.map(item=>item.priTmplId);
}
}
});
},
toOrderDetail() {
if (!this.render) return;
console.log("查看详情");
......@@ -180,6 +208,46 @@ export default {
url,
});
},
changeCheckedSubscribe(val) {
console.log(val,'--------------')
this.checkedSubscribe = val.mp.detail;
if(this.checkedSubscribe) {
this.toDingyue();
}
},
toDingyue() {
let _this = this;
if(!(this.miniIdlist && this.miniIdlist.length>0)) {
return;
}
wx.requestSubscribeMessage({
tmplIds: _this.miniIdlist,
success(res) {
log.info("用户点击订阅",res)
let showToast = false;
console.log(res, "-------------res");
_this.miniIdlist.forEach(item=>{
if(res[item] == "accept"){
showToast = true;
}
})
if(showToast) {
wx.showToast({title:"订阅成功",icon:"none"});
}
_this.miniMsgList.forEach(item=>{
let query = {
openId: wx.getStorageSync("openid"),
eventName: item.title,
eventType: item.definitionType,
sendTemplateId: item.priTmplId,
sendTemplateParams: item.content,
extraParams: item.example,
}
shop.addWxMiniSubscribeMessageRecord(query).then()
})
},
});
},
toOrderList() {
let url = `/pages/index/main?from=home&backpath=${encodeURIComponent(`/order/orderList`)}`
wx.redirectTo({
......@@ -272,7 +340,7 @@ export default {
margin-top: 1px;
overflow: hidden;
.paySuccess_detail {
padding: 0 63px;
padding: 0 30px;
.iconPay {
margin: 0 auto;
border-radius: 50%;
......@@ -327,9 +395,9 @@ export default {
}
.bottom {
margin-top: 10px;
justify-content: space-around;
justify-content: space-between;
/deep/.van-button {
width: 118px;
width: 140px;
height: 35px;
color: #929292;
line-height: 35px;
......@@ -342,6 +410,19 @@ export default {
color: #fff;
}
}
.subscribe{
padding: 8px 18px;
display: flex;
justify-content: space-between;
align-items: center;
background: var(--main-color);
margin-top: 20px;
border-radius: 6px;
p.info{
color: #fff;
font-size: 13px;
}
}
}
}
......
......@@ -481,17 +481,6 @@ export default {
return JSON.stringify(pageData);
},
toDingyue() {
wx.requestSubscribeMessage({
tmplIds: [
"cTgB0EMEibieOPU6HWPbmr3YCea7MZYCryxmi2_fS5o",
"pWi2-icKybK1fSSjRf-wrsQE1jmsuEp1QgPTAxn2nB0",
],
success(res) {
console.log(res, "-------------res");
},
});
},
},
};
</script>
......
......@@ -3,6 +3,7 @@
"usingComponents": {
"van-checkbox": "/static/vant/checkbox/index",
"van-popup":"/static/vant/popup/index",
"van-switch":"/static/vant/switch/index",
"van-button":"/static/vant/button/index",
"van-picker": "/static/vant/picker/index",
"van-icon":"/static/vant/icon/index",
......
!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,c=[],p=!1,u=-1;function g(){p&&s&&(p=!1,s.length?c=s.concat(c):u=-1,c.length&&d())}function d(){if(!p){var e=l(g);p=!0;for(var t=c.length;t;){for(s=c,c=[];++u<t;)s&&s[u].run();u=-1,t=c.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];c.push(new m(e,t)),1!==c.length||p||l(d)},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,a){!function(o,t){!function(){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.hylBannerLink=i,a.hylToLink=s;var r=void 0,m=void 0,h=void 0,f=void 0,k=void 0,l=void 0,v="",n=null;function i(e){var t,n,i,o,a,r,l,s,c,p,u,g,d;v=$nuxt.$store,console.log("hylBannerLink",e),3!=e.type?1.1==e.type&&(1==v.state.miniProgram||2==v.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])),c=(s=l).id,p=l.type,u=l.isOpenDraw,g=k.formatDate.format(new Date),d=(d=l.validTimeEnd).split(".").join("-"),2==l.validTimeEnd.split(" ").length||(g=g.split(" ")[0]),g=(g=new Date(d.replace(/-/g,"/")).getTime()-new Date(g.replace(/-/g,"/")).getTime())/1e3,2==u?0<=g?(1==p&&$mp.miniProgram.navigateTo({url:"/pages/draw/drawDetails/drawDetails?id="+c}),2==p&&$mp.miniProgram.navigateTo({url:"/pages/draw/drawDetails/drawDetails?id="+c}),3==p&&$mp.miniProgram.navigateTo({url:"/pages/draw/turntable/turntable?id="+c})):2==p&&null!=s.drawRecordEntity?$mp.miniProgram.navigateTo({url:"/pages/draw/drawDetails/drawDetails?perdraw=33&id="+c}):2==p&&null==s.drawRecordEntity?$mp.miniProgram.navigateTo({url:"/pages/draw/drawDetails/drawDetails?id="+c}):m.alert({title:"标题",message:"抽奖已结束"}).then(function(){}):1==p?null==s.drawRecordEntity?$mp.miniProgram.navigateTo({url:"/pages/draw/drawDetails/drawDetails?id="+c}):$mp.miniProgram.navigateTo({url:"/pages/draw/openDraw/openDraw?id="+c}):2==p?null!=s.drawRecordEntity?$mp.miniProgram.navigateTo({url:"/pages/draw/openDraw/openDraw?id="+c}):$mp.miniProgram.navigateTo({url:"/pages/draw/drawDetails/drawDetails?id="+c}):null==s.drawRecordEntity?m.alert({title:"标题",message:"抽奖已结束"}).then(function(){}):$mp.miniProgram.navigateTo({url:"/pages/draw/openDraw/openDraw?id="+c})):-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,v.state.sessionId?f.getConsumerScoreFlag({outId:v.state.userInfo.mixId,advertisementId:i}).then(function(e){0==e.code&&(1==e.object?(o&&0<o&&f.changeScore({outId:v.state.userInfo.mixId,advertisementId:i}).then(function(e){e.object&&$mp.miniProgram.navigateTo({url:"/pages/advertisement/advertisement?type="+a+"&id="+i})}),o&&o<0&&w.showModal({title:"提示",content:"跳转扣除"+Math.abs(o)+"积分",success:function(e){e.confirm?f.changeScore({outId:v.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=y($nuxt.$route.query.mixid+"_location")&&JSON.parse(y($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==v.state.miniProgram||2==v.state.miniProgram?$mp.miniProgram.navigateTo({url:"/pages/toMini/toMini?weappPage="+encodeURIComponent(e.link)+"&weappAppId="+e.name}):h("暂不支持")}function s(e){if(e=e.data,console.log("----工具中hyl"),n=e.type,(v=$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!=v.state.miniProgram&&2!=v.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(l.GUIDE_URL,"-----shopConfig.GUIDE_URL"),t=l.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==v.state.miniProgram||2==v.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 y(e){if(o.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(a,"__esModule",{value:!0}),a.themeToLinkInit=e,a.$themeToLink=R;var c=null,p=null,u=null,r=void 0,g=void 0,l=void 0,h=void 0,s=void 0,d=void 0,w=void 0,C=void 0;function P(e,t){t=1<arguments.length&&void 0!==t?t:"";return"../index/main?from=themeLink&backpath="+encodeURIComponent(e)+"&params="+encodeURIComponent(t)}function T(){return 1==c?this.$store&&this.$store.state.sessionId&&this.$store.state.sessionId:2==c?w&&w.getStorageSync("sessionid"):void 0}function b(){return 1==c&&this.$store&&this.$store.state.miniProgram}function I(){return 1==c?l.GUIDE_URL:2==c?config.GUIDE_URL:void 0}function $(e){return e.link?e.link.split("?")[0]:""}function x(e){var e=e.link.split("?"),n=[];return e.forEach(function(e,t){1<=t&&n.push(e)}),n.join("?")||""}function D(t){var e=getApp();return e.globalData.footerVal?e.globalData.footerVal.componentData.list.findIndex(function(e){return $(e.link)==t.split("?")[0]}):-1}var L=["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,a=e.requireFun,e=e.extend;if(C=e,c=t,d=a,console.log(d,"-------------------------115"),g=d.createdUserJWT,d.getBcakUrl,w=n,console.log(c,"-------------themeToLinkInit"),console.log("toPage-------------"),u=1==c?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&&w.navigateTo({url:t})}:2==c?function(e){var t=e.pagePath;1==(e=void 0===(e=e.pageType)?1:e)?(console.log("pagePath",t),w.navigateTo({url:t})):2==e&&w.reLaunch({url:t})}:void 0,1==c)try{r=d.Vue,l=d.shopConfig,d.shopMixid,r.prototype.$themeToLink=R,h=d.Toast,s=d.hylToLink}catch(e){}else 2==c&&((p=getApp()).$themeToLink=R,p.getCoupon=i,p.themeMemberCardClick=o)}function U(e){if(!(e=e.split("?")[1]))return{};for(var t=e.split("&"),n={},i=0;i<t.length;i++){var o=t[i].indexOf("="),a=t[i].slice(0,o),o=t[i].slice(o+1);console.log(81,this),n[a]=o}return console.log(n,"-------------obj"),n}async function R(t){if(console.log(t,"$themeToLink"),console.log(C,"extend======="),console.log("data",t),C.loginIntercept&&!T.call(this)){console.log("走进来了");var e="/pages/login/main?back="+$(t)+"&params="+JSON.stringify(U(t.link));return u({pagePath:e}),!1}if(t.type&&t.link&&t.link.includes("dynamicForm")){if(!T.call(this)){console.log("走进来了--dynamicForm");var n="/pages/login/main?back="+$(t)+"&params="+JSON.stringify(U(t.link));return u({pagePath:n}),!1}await g().then(function(e){t.link+="&token="+e}).catch(function(e){})}var i,o,a,r,l;1==c&&this.$store.getters["sceneModule/flushbonadingVisible"]?s.call(this,{data:t,Vue:d.Vue,Dialog:d.Dialog,Toast:d.Toast,hyl:d.hyl,dateFilter:d.dateFilter,shopConfig:d.shopConfig}):(e=t.type,console.log(t.key,"----------------------key"),(2==e||2!=c||t.key&&t.key.startsWith("1.9")||t.link.startsWith("/article/")||function(e){var t=$(e),n=x(e);if(L.includes(t)||"/goods/"==t.substr(0,7)||t.includes("/brandTopics")||t.startsWith("/activty/")||T.call(this))return i=D(t),console.log(e.link,"------------data.link"),!(0<=i||e.link.includes("/activty/")&&e.link.includes("tabClick"))||(console.log("底部栏"),i=0==i?D("/"):i,t="/"==t?"/pages/home/main":"/pages/tabBar"+i+"/main",(i=getCurrentPages())[i.length-1].route!=t&&(n=n?"?"+n:"",console.log(n,"--------------247"),u({pagePath:t+n,pageType:2}),0));var i="",i=-1<n.indexOf("scene=sso")?"/pages/login/main?back="+t+"&ossLink="+encodeURIComponent(n):(console.log(encodeURIComponent(JSON.stringify(U(e.link))),"------------------------JSON.stringify(parseQueryString(data.link))"),"/pages/login/main?back="+t+"&params="+encodeURIComponent(JSON.stringify(U(e.link))));return console.log(i,"------------------------190"),u({pagePath:i}),0}(t))&&(null!=e&&"undefined"!=e?(console.log("---------跳过登录判断"),0==e||(1==e?"/"==t.link.substring(0,1)?t.link&&t.link.startsWith("/personalCenter/userInfo")?(console.log(1==b.call(this),2==c,"------getIsMini.call(this) == 1 || homeNative == 2"),1==b.call(this)||2==c?(n="/pages/userInfo/main",console.log("url",n),u({pagePath:n,pageType:2==c?1:3})):u.call(this,{pagePath:t.link})):t.link&&t.link.startsWith("/personalCenter/vip/vipMobileCard")?(console.log(1==b.call(this),2==c,"------getIsMini.call(this) == 1 || homeNative == 2"),1==b.call(this)||2==c?(i="/pages/memberCode/main",console.log("url",i),u({pagePath:i,pageType:2==c?1:3})):u.call(this,{pagePath:t.link})):t.link&&t.link.startsWith("/article/")&&!t.link.startsWith("/article/articleList")?(console.log(t.link&&t.link.startsWith("/article/")&&!t.link.startsWith("/article/articleList"),t.link,c,"--data.link"),console.log(1==b.call(this),2==c,"------getIsMini.call(this) == 1 || homeNative == 2"),1==b.call(this)||2==c?(i="/pages/pages_subpack/article/main?article_id="+(i=t.link.split("/"))[i.length-1],console.log("url",i),u({pagePath:i,pageType:2==c?1:3})):u.call(this,{pagePath:t.link})):1==c?u.call(this,{pagePath:t.link}):2==c&&(o=P($(t),x(t)),console.log("url",o),u({pagePath:o})):t.link.startsWith("http")||t.link.startsWith("https")?1==c?u.call(this,{pagePath:t.link,pageType:2}):(o="/pages/wxArticle/main?link="+encodeURIComponent(t.link),u({pagePath:o})):u({pagePath:t.link,pageType:2}):1.1==e?2==c?u({pagePath:t.link}):1==c&&(1==b.call(this)||2==b.call(this)?u.call(this,{pagePath:t.link,pageType:3}):h("暂不支持")):1.2==e?"outerChain:businessCenter"!=t.link?"/"==t.link.substring(0,1)?u.call(this,{pagePath:t.link}):1==c?1==this.$store.state.miniProgram||2==this.$store.state.miniProgram?(a="/pages/wxArticle/main?link="+encodeURIComponent(t.link),u.call(this,{pagePath:a,pageType:3})):u.call(this,{pagePath:t.link,pageType:2}):2==c&&(a="/pages/wxArticle/main?link="+encodeURIComponent(t.link),u.call(this,{pagePath:a,pageType:1})):(console.log(I(),"-----getGUIDE_URL()"),r=I()+"/login?mixid="+this.$nuxt.$route.query.mixid+"&back="+encodeURIComponent(window.location.href),u.call(this,{pagePath:r,pageType:2})):2==e?"themeCouponClick"==(r=t.feature.type)||0==r?1==c?this.$themeCouponClick(t.feature.value.couponCode,t.feature.value):2==c&&p.getCoupon(t.feature.value.couponCode,t.feature.value):1==r?2==t.type&&1==t.feature.type&&function(e){1==c?this.$nuxt.$SHARE({itemList:e.feature.value}):2==c&&p.shareInit({itemList:e.feature.value})}.call(this,t):"themeMemberCardClick"!=r&&2!=r||(1==c?this.$themeMemberCardClick(t.feature.value):2==c&&p.themeMemberCardClick(t.feature.value)):3==e?(console.log(c,"-----------------homeNative"),1==c?1==b.call(this)||2==b.call(this)?(e=this.$store.getters["sceneModule/flushbonadingVisible"]?"/pages/toMini/toMini?weappPage="+encodeURIComponent(t.link)+"&weappAppId="+t.name:"/pages/toMini/main?weappPage="+encodeURIComponent(t.link)+"&weappAppId="+t.name,u.call(this,{pagePath:e,pageType:3})):h("暂不支持"):t.key&&t.key.startsWith("1.9")?function(e){if(console.log("sss",e),2==c)switch(e.key){case"1.9.1":console.log("begin"),w.openChannelsActivity?w.openChannelsActivity({finderUserName:e.name,feedId:e.link,success:function(){console.log("success")},fail:function(){console.log("fail"),M.call(this,"提示","打开视频号失败")}}):M.call(this),console.log("end");break;case"1.9.2":console.log("begin"),w.openChannelsEvent?w.openChannelsEvent({finderUserName:e.name,eventId:e.link,fail:function(){M.call(this,"提示","打开视频号活动失败")}}):M.call(this),console.log("end")}}.call(this,t):(l="/pages/toMini/main?weappPage="+encodeURIComponent(t.link)+"&weappAppId="+t.name,u({pagePath:l}))):0<t.length&&u.call(this,{pagePath:t.link}))):0<t.length&&(1==c?u.call(this,{pagePath:t}):2==c&&(l=P($(t),x(t)),u({pagePath:l})))))}function M(){w.showModal({title:0<arguments.length&&void 0!==arguments[0]?arguments[0]:"提示",content:1<arguments.length&&void 0!==arguments[1]?arguments[1]:"当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。"}),console.log("不支持")}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,l){function r(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 r(o[t][1][e]||e)},n,n.exports,i,o,a,l)}return a[t].exports}for(var s="function"==typeof require&&require,e=0;e<l.length;e++)r(l[e]);return r}({1:[function(e,t,n){var i,o,t=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function l(){throw new Error("clearTimeout has not been defined")}function r(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:l}catch(e){o=l}}();var s,c=[],p=!1,u=-1;function g(){p&&s&&(p=!1,s.length?c=s.concat(c):u=-1,c.length&&d())}function d(){if(!p){var e=r(g);p=!0;for(var t=c.length;t;){for(s=c,c=[];++u<t;)s&&s[u].run();u=-1,t=c.length}s=null,p=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===l||!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];c.push(new m(e,t)),1!==c.length||p||r(d)},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,a){!function(o,t){!function(){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.hylBannerLink=i,a.hylToLink=c;var l=void 0,m=void 0,h=void 0,f=void 0,k=void 0,r=void 0,v="",n=null;function i(e){var t,n,i,o,a,l,r,s,c,p,u,g,d;v=$nuxt.$store,console.log("hylBannerLink",e),3!=e.type?1.1==e.type&&(1==v.state.miniProgram||2==v.state.miniProgram?-1<e.link.indexOf("pages/hiberDrawEntity/hiberDrawEntity")?(t=e.link.split("?"))[1]&&t[1].split("=")[1]&&(r=JSON.parse(decodeURIComponent(t[1].split("=")[1])),c=(s=r).id,p=r.type,u=r.isOpenDraw,g=k.formatDate.format(new Date),d=(d=r.validTimeEnd).split(".").join("-"),2==r.validTimeEnd.split(" ").length||(g=g.split(" ")[0]),g=(g=new Date(d.replace(/-/g,"/")).getTime()-new Date(g.replace(/-/g,"/")).getTime())/1e3,2==u?0<=g?(1==p&&$mp.miniProgram.navigateTo({url:"/pages/draw/drawDetails/drawDetails?id="+c}),2==p&&$mp.miniProgram.navigateTo({url:"/pages/draw/drawDetails/drawDetails?id="+c}),3==p&&$mp.miniProgram.navigateTo({url:"/pages/draw/turntable/turntable?id="+c})):2==p&&null!=s.drawRecordEntity?$mp.miniProgram.navigateTo({url:"/pages/draw/drawDetails/drawDetails?perdraw=33&id="+c}):2==p&&null==s.drawRecordEntity?$mp.miniProgram.navigateTo({url:"/pages/draw/drawDetails/drawDetails?id="+c}):m.alert({title:"标题",message:"抽奖已结束"}).then(function(){}):1==p?null==s.drawRecordEntity?$mp.miniProgram.navigateTo({url:"/pages/draw/drawDetails/drawDetails?id="+c}):$mp.miniProgram.navigateTo({url:"/pages/draw/openDraw/openDraw?id="+c}):2==p?null!=s.drawRecordEntity?$mp.miniProgram.navigateTo({url:"/pages/draw/openDraw/openDraw?id="+c}):$mp.miniProgram.navigateTo({url:"/pages/draw/drawDetails/drawDetails?id="+c}):null==s.drawRecordEntity?m.alert({title:"标题",message:"抽奖已结束"}).then(function(){}):$mp.miniProgram.navigateTo({url:"/pages/draw/openDraw/openDraw?id="+c})):-1<e.link.indexOf("type")?(t=e.link.split("?"),"[object Array]"==Object.prototype.toString.call(t)&&t.length&&(l=t[1].split("&"),n={},l.forEach(function(e){e.split("="),n[e.split("=")[0]]=e.split("=")[1]}),console.log(n),i=n.id,o=n.jumpScore,a=n.type,v.state.sessionId?f.getConsumerScoreFlag({outId:v.state.userInfo.mixId,advertisementId:i}).then(function(e){0==e.code&&(1==e.object?(o&&0<o&&f.changeScore({outId:v.state.userInfo.mixId,advertisementId:i}).then(function(e){e.object&&$mp.miniProgram.navigateTo({url:"/pages/advertisement/advertisement?type="+a+"&id="+i})}),o&&o<0&&C.showModal({title:"提示",content:"跳转扣除"+Math.abs(o)+"积分",success:function(e){e.confirm?f.changeScore({outId:v.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"))&&(l=y($nuxt.$route.query.mixid+"_location")&&JSON.parse(y($nuxt.$route.query.mixid+"_location")).outId,console.log(l,"跳转id"),l&&(e.link.includes("?")?e.link=e.link+"&addressId="+l:e.link=e.link+"?addressId="+l)),$mp.miniProgram.navigateTo({url:e.link})):h("暂不支持")):1==v.state.miniProgram||2==v.state.miniProgram?$mp.miniProgram.navigateTo({url:"/pages/toMini/toMini?weappPage="+encodeURIComponent(e.link)+"&weappAppId="+e.name}):h("暂不支持")}function c(e){if(e=e.data,console.log("----工具中hyl"),n=e.type,(v=$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!=v.state.miniProgram&&2!=v.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==v.state.miniProgram||2==v.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 y(e){if(o.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(a,"__esModule",{value:!0}),a.themeToLinkInit=e,a.$themeToLink=s;var p=null,u=null,g=null,l=void 0,d=void 0,r=void 0,h=void 0,c=void 0,w=void 0,C=void 0,P=void 0,T=999999;function I(e,t){t=1<arguments.length&&void 0!==t?t:"";return"../index/main?from=themeLink&backpath="+encodeURIComponent(e)+"&params="+encodeURIComponent(t)}function b(){return 1==p?this.$store&&this.$store.state.sessionId&&this.$store.state.sessionId:2==p?C&&C.getStorageSync("sessionid"):void 0}function $(){return 1==p&&this.$store&&this.$store.state.miniProgram}function x(){return 1==p?r.GUIDE_URL:2==p?config.GUIDE_URL:void 0}function D(e){return e.link?e.link.split("?")[0]:""}function L(e){var e=e.link.split("?"),n=[];return e.forEach(function(e,t){1<=t&&n.push(e)}),n.join("?")||""}function U(t){var e=getApp();return e.globalData.footerVal?e.globalData.footerVal.componentData.list.findIndex(function(e){return D(e.link)==t.split("?")[0]}):-1}var R=["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,a=e.requireFun,e=e.extend;if(P=e,p=t,w=a,console.log(w,"-------------------------115"),d=w.createdUserJWT,w.getBcakUrl,!(C=n)||(n=C.getAccountInfoSync&&C.getAccountInfoSync())&&(T=n.miniProgram.version||999999),console.log(T,"---------------miniVersion"),console.log(p,"-------------themeToLinkInit"),console.log("toPage-------------"),g=1==p?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&&C.navigateTo({url:t})}:2==p?function(e){var t=e.pagePath;1==(e=void 0===(e=e.pageType)?1:e)?(console.log("pagePath",t),C.navigateTo({url:t})):2==e&&C.reLaunch({url:t})}:void 0,1==p)try{l=w.Vue,r=w.shopConfig,w.shopMixid,l.prototype.$themeToLink=s,h=w.Toast,c=w.hylToLink}catch(e){}else 2==p&&((u=getApp()).$themeToLink=s,u.getCoupon=i,u.themeMemberCardClick=o)}function M(e){if(!(e=e.split("?")[1]))return{};for(var t=e.split("&"),n={},i=0;i<t.length;i++){var o=t[i].indexOf("="),a=t[i].slice(0,o),o=t[i].slice(o+1);console.log(81,this),n[a]=o}return console.log(n,"-------------obj"),n}async function s(t){if(console.log(t,"$themeToLink"),console.log(P,"extend======="),console.log("data",t),P.loginIntercept&&!b.call(this)){console.log("走进来了");var e="/pages/login/main?back="+D(t)+"&params="+JSON.stringify(M(t.link));return g({pagePath:e}),!1}if(t.type&&t.link&&t.link.includes("dynamicForm")){if(!b.call(this)){console.log("走进来了--dynamicForm");var n="/pages/login/main?back="+D(t)+"&params="+JSON.stringify(M(t.link));return g({pagePath:n}),!1}await d().then(function(e){t.link+="&token="+e}).catch(function(e){})}var i,o,a,l,r,s;1==p&&this.$store.getters["sceneModule/flushbonadingVisible"]?c.call(this,{data:t,Vue:w.Vue,Dialog:w.Dialog,Toast:w.Toast,hyl:w.hyl,dateFilter:w.dateFilter,shopConfig:w.shopConfig}):(n=t.type,console.log(t.key,"----------------------key"),(2==n||2!=p||t.key&&t.key.startsWith("1.9")||t.link.startsWith("/article/")||function(e){var t=D(e),n=L(e);if(R.includes(t)||"/goods/"==t.substr(0,7)||t.includes("/brandTopics")||t.startsWith("/activty/")||b.call(this))return i=U(t),console.log(e.link,"------------data.link"),!(0<=i||e.link.includes("/activty/")&&e.link.includes("tabClick"))||(console.log("底部栏"),i=0==i?U("/"):i,t="/"==t?"/pages/home/main":"/pages/tabBar"+i+"/main",(i=getCurrentPages())[i.length-1].route!=t&&(n=n?"?"+n:"",console.log(n,"--------------247"),g({pagePath:t+n,pageType:2}),0));var i="",i=-1<n.indexOf("scene=sso")?"/pages/login/main?back="+t+"&ossLink="+encodeURIComponent(n):(console.log(encodeURIComponent(JSON.stringify(M(e.link))),"------------------------JSON.stringify(parseQueryString(data.link))"),"/pages/login/main?back="+t+"&params="+encodeURIComponent(JSON.stringify(M(e.link))));return console.log(i,"------------------------190"),g({pagePath:i}),0}(t))&&(null!=n&&"undefined"!=n?(console.log("---------跳过登录判断"),0==n||(1==n?"/"==t.link.substring(0,1)?t.link&&t.link.startsWith("/personalCenter/userInfo")?(console.log(1==$.call(this),2==p,"------getIsMini.call(this) == 1 || homeNative == 2"),1==$.call(this)||2==p?(i="/pages/userInfo/main",console.log("url",i),g({pagePath:i,pageType:2==p?1:3})):g.call(this,{pagePath:t.link})):t.link&&t.link.startsWith("/pay/paySuccess")?(console.log(1==$.call(this),2==p,"------getIsMini.call(this) == 1 || homeNative == 2"),console.log(T,"--miniVersion"),(1==$.call(this)||2==p)&&284<T?(i="/pages/paySuccess/main?"+t.link.split("?")[1],console.log("url",i),g({pagePath:i,pageType:2==p?2:3})):g.call(this,{pagePath:t.link})):t.link&&t.link.startsWith("/personalCenter/vip/vipMobileCard")?(console.log(1==$.call(this),2==p,"------getIsMini.call(this) == 1 || homeNative == 2"),1==$.call(this)||2==p?(o="/pages/memberCode/main",console.log("url",o),g({pagePath:o,pageType:2==p?1:3})):g.call(this,{pagePath:t.link})):t.link&&t.link.startsWith("/article/")&&!t.link.startsWith("/article/articleList")?(console.log(t.link&&t.link.startsWith("/article/")&&!t.link.startsWith("/article/articleList"),t.link,p,"--data.link"),console.log(1==$.call(this),2==p,"------getIsMini.call(this) == 1 || homeNative == 2"),1==$.call(this)||2==p?(o="/pages/pages_subpack/article/main?article_id="+(o=t.link.split("/"))[o.length-1],console.log("url",o),g({pagePath:o,pageType:2==p?1:3})):g.call(this,{pagePath:t.link})):1==p?g.call(this,{pagePath:t.link}):2==p&&(a=I(D(t),L(t)),console.log("url",a),g({pagePath:a})):t.link.startsWith("http")||t.link.startsWith("https")?1==p?g.call(this,{pagePath:t.link,pageType:2}):(a="/pages/wxArticle/main?link="+encodeURIComponent(t.link),g({pagePath:a})):g({pagePath:t.link,pageType:2}):1.1==n?2==p?g({pagePath:t.link}):1==p&&(1==$.call(this)||2==$.call(this)?g.call(this,{pagePath:t.link,pageType:3}):h("暂不支持")):1.2==n?"outerChain:businessCenter"!=t.link?"/"==t.link.substring(0,1)?g.call(this,{pagePath:t.link}):1==p?1==this.$store.state.miniProgram||2==this.$store.state.miniProgram?(l="/pages/wxArticle/main?link="+encodeURIComponent(t.link),g.call(this,{pagePath:l,pageType:3})):g.call(this,{pagePath:t.link,pageType:2}):2==p&&(l="/pages/wxArticle/main?link="+encodeURIComponent(t.link),g.call(this,{pagePath:l,pageType:1})):(console.log(x(),"-----getGUIDE_URL()"),r=x()+"/login?mixid="+this.$nuxt.$route.query.mixid+"&back="+encodeURIComponent(window.location.href),g.call(this,{pagePath:r,pageType:2})):2==n?"themeCouponClick"==(r=t.feature.type)||0==r?1==p?this.$themeCouponClick(t.feature.value.couponCode,t.feature.value):2==p&&u.getCoupon(t.feature.value.couponCode,t.feature.value):1==r?2==t.type&&1==t.feature.type&&function(e){1==p?this.$nuxt.$SHARE({itemList:e.feature.value}):2==p&&u.shareInit({itemList:e.feature.value})}.call(this,t):"themeMemberCardClick"!=r&&2!=r||(1==p?this.$themeMemberCardClick(t.feature.value):2==p&&u.themeMemberCardClick(t.feature.value)):3==n?(console.log(p,"-----------------homeNative"),1==p?1==$.call(this)||2==$.call(this)?(n=this.$store.getters["sceneModule/flushbonadingVisible"]?"/pages/toMini/toMini?weappPage="+encodeURIComponent(t.link)+"&weappAppId="+t.name:"/pages/toMini/main?weappPage="+encodeURIComponent(t.link)+"&weappAppId="+t.name,g.call(this,{pagePath:n,pageType:3})):h("暂不支持"):t.key&&t.key.startsWith("1.9")?function(e){if(console.log("sss",e),2==p)switch(e.key){case"1.9.1":console.log("begin"),C.openChannelsActivity?C.openChannelsActivity({finderUserName:e.name,feedId:e.link,success:function(){console.log("success")},fail:function(){console.log("fail"),E.call(this,"提示","打开视频号失败")}}):E.call(this),console.log("end");break;case"1.9.2":console.log("begin"),C.openChannelsEvent?C.openChannelsEvent({finderUserName:e.name,eventId:e.link,fail:function(){E.call(this,"提示","打开视频号活动失败")}}):E.call(this),console.log("end")}}.call(this,t):(s="/pages/toMini/main?weappPage="+encodeURIComponent(t.link)+"&weappAppId="+t.name,g({pagePath:s}))):0<t.length&&g.call(this,{pagePath:t.link}))):0<t.length&&(1==p?g.call(this,{pagePath:t}):2==p&&(s=I(D(t),L(t)),g({pagePath:s})))))}function E(){C.showModal({title:0<arguments.length&&void 0!==arguments[0]?arguments[0]:"提示",content:1<arguments.length&&void 0!==arguments[1]?arguments[1]:"当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。"}),console.log("不支持")}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