store修改
This commit is contained in:
parent
f7946fbb28
commit
f6e120ad95
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
|||
var e=Object.defineProperty,t=Object.defineProperties,a=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable,s=(t,a,o)=>a in t?e(t,a,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[a]=o,c=(e,t)=>{for(var a in t||(t={}))l.call(t,a)&&s(e,a,t[a]);if(o)for(var a of o(t))n.call(t,a)&&s(e,a,t[a]);return e},r=(e,o)=>t(e,a(o)),i=(e,t,a)=>new Promise(((o,l)=>{var n=e=>{try{c(a.next(e))}catch(t){l(t)}},s=e=>{try{c(a.throw(e))}catch(t){l(t)}},c=e=>e.done?o(e.value):Promise.resolve(e.value).then(n,s);c((a=a.apply(e,t)).next())}));import{r as u,s as d,d as v,g as p,a as y,b as _,c as m,u as f,n as g,e as b,o as $,f as w,h as O,i as h,j,w as k,k as I,l as P,m as q,p as x,q as D,t as T,_ as S}from"./index-f1kN0yX1.js";const C=e=>new Promise(((t,a)=>{u(r(c({},e),{dataType:"json",header:{"content-type":"application/json"},responseType:"json",success(e){var o,l,n;(null==(o=e.data)?void 0:o.code)>=200&&(null==(l=e.data)?void 0:l.code)<300?t(e.data):401===(null==(n=e.data)?void 0:n.code)?(window.parent.postMessage({data:{type:"logout"}},"*"),a(e)):t(e.data)},fail(e){d({icon:"none",title:"网络错误,换个网络试试"}),a(e)}}))}));C.get=(e,t)=>C({url:e,query:t,method:"GET"}),C.post=(e,t,a,o=!1)=>C({url:e,query:a,data:t,method:"POST",hideErrorToast:o});const E=e=>C.get("/v1/content",e),L=S(v(r(c({},{name:"Home"}),{__name:"index",setup(e){const{safeAreaInsets:t}=p(),a=y({}),o=_(""),l=_("");let n="activity",s=null;const c={Interface:"api_code",lottery:"lottery_code",activity:"activity_code"},r=y({url:"",title:""}),{codeS:u,activity:v}=m();o.value=v,n=u;const S=f(o.value),C=e=>Object.entries(e).reduce(((e,t)=>e+`${t[0]}=${t[1]}`),"");function L(){return i(this,null,(function*(){const e={};e[c[n]]=o.value||"",S.reset();U(yield E(e))}))}function U(e){if(200===e.code){const{login_content_template:t,login_content_templates:n,content_templates:s,token:c}=e.data;o.value=e.data.activity_code,Object.assign(a,e.data),1===t.validate_login?(r.url=J(n.source+`?activity_code=${o.value}`),r.title=n.moduledesc):2===t.validate_login&&(r.url=J(s.source+`?activity_code=${o.value}&token=${c}&lottery_code=${l.value}`),r.title=s.moduledesc),b({title:r.title}),S.setUserInfo({srcList:r,contentData:a,activityCode:o.value,token:c,lottery:l.value})}else d({title:e.message,icon:"none"})}function J(e){const t=(new Date).getTime();return e+(e.includes("?")?"×tamp=":"?timestamp=")+t}window.addEventListener("message",(function(e){switch(e.data.data.type){case"login":case"couponBack":r.url=a.content_templates.source+`?activity_code=${o.value}`,r.title=a.content_templates.moduledesc;break;case"coupon":const t=e.data.data.url?`#${e.data.data.url}`:"",n=e.data.data.query?C(e.data.data.query)+"&":"";r.url=a.user_content_templates.source+`${t}?${n}activity_code=${o.value}&lottery_code=${l.value}`,r.title=a.user_content_templates.moduledesc;break;case"location":window.location.replace(e.data.data.url);break;case"orderDetail":const s=e.data.data.query?C(e.data.data.query)+"&":"";r.url=a.order_detail_templates.source+`?${s}activity_code=${o.value}&lottery_code=${l.value}`,r.title=a.order_detail_templates.moduledesc;break;case"product":const c=`product_id=${e.data.data.product_id}&id=${e.data.data.id}&activity_code=${o.value}`;r.url=a.user_content_templates.source+`#/pages/coupon/product?url=${encodeURIComponent(c)}`,r.title=a.user_content_templates.moduledesc;break;case"logout":return L()}g((()=>{r.url=J(r.url),b({title:r.title}),S.setUserInfo({srcList:r,contentData:a,activityCode:o.value,token:a.token,lottery:l.value})}))}));const N=()=>{s=setInterval((()=>i(this,null,(function*(){const e={};e[c[n]]=l.value||"";const t=yield E(e);JSON.stringify(t.data)!==JSON.stringify(S.userInfo.contentData)&&(d({title:"活动发生变更",icon:"none"}),U(t))}))),6e4)};return $((()=>{const{srcList:e,lottery:t,activityCode:n,contentData:s}=S.userInfo;l.value=o.value,!e.url||t!==l.value&&n!==o.value?L():(o.value=n,r.url=s.content_templates.source+`?activity_code=${o.value}&lottery_code=${l.value}`,r.title=s.content_templates.moduledesc,Object.assign(r,{url:J(r.url)}),Object.assign(a,s),b({title:r.title})),N()})),w((()=>{clearInterval(s),s=null})),(e,a)=>{const o=D,l=T,n=O("layout-default-uni");return h(),j(n,null,{default:k((()=>{var e;return[I(l,{class:"bg-white overflow-hidden pt-2 px-4",style:x({marginTop:(null==(e=P(t))?void 0:e.top)+"px"})},{default:k((()=>[P(r).url?(h(),j(o,{key:0,src:P(r).url},null,8,["src"])):q("",!0)])),_:1},8,["style"])]})),_:1})}}})),[["__scopeId","data-v-b860ed5f"]]);export{L as default};
|
||||
var e=Object.defineProperty,t=Object.defineProperties,a=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable,s=(t,a,o)=>a in t?e(t,a,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[a]=o,c=(e,t)=>{for(var a in t||(t={}))l.call(t,a)&&s(e,a,t[a]);if(o)for(var a of o(t))n.call(t,a)&&s(e,a,t[a]);return e},r=(e,o)=>t(e,a(o)),i=(e,t,a)=>new Promise(((o,l)=>{var n=e=>{try{c(a.next(e))}catch(t){l(t)}},s=e=>{try{c(a.throw(e))}catch(t){l(t)}},c=e=>e.done?o(e.value):Promise.resolve(e.value).then(n,s);c((a=a.apply(e,t)).next())}));import{r as u,s as d,d as v,g as p,a as y,b as _,c as m,u as f,n as g,e as b,o as $,f as w,h as O,i as h,j,w as k,k as I,l as P,m as q,p as x,q as D,t as T,_ as S}from"./index-CwQLwjSL.js";const C=e=>new Promise(((t,a)=>{u(r(c({},e),{dataType:"json",header:{"content-type":"application/json"},responseType:"json",success(e){var o,l,n;(null==(o=e.data)?void 0:o.code)>=200&&(null==(l=e.data)?void 0:l.code)<300?t(e.data):401===(null==(n=e.data)?void 0:n.code)?(window.parent.postMessage({data:{type:"logout"}},"*"),a(e)):t(e.data)},fail(e){d({icon:"none",title:"网络错误,换个网络试试"}),a(e)}}))}));C.get=(e,t)=>C({url:e,query:t,method:"GET"}),C.post=(e,t,a,o=!1)=>C({url:e,query:a,data:t,method:"POST",hideErrorToast:o});const E=e=>C.get("/v1/content",e),L=S(v(r(c({},{name:"Home"}),{__name:"index",setup(e){const{safeAreaInsets:t}=p(),a=y({}),o=_(""),l=_("");let n="activity",s=null;const c={Interface:"api_code",lottery:"lottery_code",activity:"activity_code"},r=y({url:"",title:""}),{codeS:u,activity:v}=m();o.value=v,n=u;const S=f(o.value),C=e=>Object.entries(e).reduce(((e,t)=>e+`${t[0]}=${t[1]}`),"");function L(){return i(this,null,(function*(){const e={};e[c[n]]=o.value||"",S.reset();U(yield E(e))}))}function U(e){if(200===e.code){const{login_content_template:t,login_content_templates:n,content_templates:s,token:c}=e.data;o.value=e.data.activity_code,Object.assign(a,e.data),1===t.validate_login?(r.url=J(n.source+`?activity_code=${o.value}`),r.title=n.moduledesc):2===t.validate_login&&(r.url=J(s.source+`?activity_code=${o.value}&token=${c}&lottery_code=${l.value}`),r.title=s.moduledesc),b({title:r.title}),S.setUserInfo({srcList:r,contentData:a,activityCode:o.value,token:c,lottery:l.value})}else d({title:e.message,icon:"none"})}function J(e){const t=(new Date).getTime();return e+(e.includes("?")?"×tamp=":"?timestamp=")+t}window.addEventListener("message",(function(e){switch(e.data.data.type){case"login":case"couponBack":r.url=a.content_templates.source+`?activity_code=${o.value}`,r.title=a.content_templates.moduledesc;break;case"coupon":const t=e.data.data.url?`#${e.data.data.url}`:"",n=e.data.data.query?C(e.data.data.query)+"&":"";r.url=a.user_content_templates.source+`${t}?${n}activity_code=${o.value}&lottery_code=${l.value}`,r.title=a.user_content_templates.moduledesc;break;case"location":window.location.replace(e.data.data.url);break;case"orderDetail":const s=e.data.data.query?C(e.data.data.query)+"&":"";r.url=a.order_detail_templates.source+`?${s}activity_code=${o.value}&lottery_code=${l.value}`,r.title=a.order_detail_templates.moduledesc;break;case"product":const c=`product_id=${e.data.data.product_id}&id=${e.data.data.id}&activity_code=${o.value}`;r.url=a.user_content_templates.source+`#/pages/coupon/product?url=${encodeURIComponent(c)}`,r.title=a.user_content_templates.moduledesc;break;case"logout":return L()}g((()=>{r.url=J(r.url),b({title:r.title}),S.setUserInfo({srcList:r,contentData:a,activityCode:o.value,token:a.token,lottery:l.value})}))}));const N=()=>{s=setInterval((()=>i(this,null,(function*(){const e={};e[c[n]]=l.value||"";const t=yield E(e);JSON.stringify(t.data)!==JSON.stringify(S.userInfo.contentData)&&(d({title:"活动发生变更",icon:"none"}),U(t))}))),6e4)};return $((()=>{const{srcList:e,lottery:t,activityCode:n,contentData:s}=S.userInfo;l.value=o.value,!e.url||t!==l.value&&n!==o.value?L():(o.value=n,r.url=s.content_templates.source+`?activity_code=${o.value}&lottery_code=${l.value}`,r.title=s.content_templates.moduledesc,Object.assign(r,{url:J(r.url)}),Object.assign(a,s),b({title:r.title})),N()})),w((()=>{clearInterval(s),s=null})),(e,a)=>{const o=D,l=T,n=O("layout-default-uni");return h(),j(n,null,{default:k((()=>{var e;return[I(l,{class:"bg-white overflow-hidden pt-2 px-4",style:x({marginTop:(null==(e=P(t))?void 0:e.top)+"px"})},{default:k((()=>[P(r).url?(h(),j(o,{key:0,src:P(r).url},null,8,["src"])):q("",!0)])),_:1},8,["style"])]})),_:1})}}})),[["__scopeId","data-v-b860ed5f"]]);export{L as default};
|
|
@ -1,5 +1,5 @@
|
|||
<!doctype html>
|
||||
<html build-date="2024-09-13 17:04:27">
|
||||
<html build-date="2024-09-13 18:22:58">
|
||||
<head>
|
||||
<link rel="stylesheet" href="./assets/uni.ad4bcb33.css">
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
|||
<title>场景营销</title>
|
||||
<!--preload-links-->
|
||||
<!--app-context-->
|
||||
<script type="module" crossorigin src="./assets/index-f1kN0yX1.js"></script>
|
||||
<script type="module" crossorigin src="./assets/index-CwQLwjSL.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="./assets/index-DqQ4aJDv.css">
|
||||
</head>
|
||||
|
||||
|
|
Loading…
Reference in New Issue