Compare commits
2 Commits
9e55deb527
...
997c2c9680
Author | SHA1 | Date |
---|---|---|
xiaogang | 997c2c9680 | |
xiaogang | 8f015dcd97 |
|
@ -9,7 +9,7 @@ lerna-debug.log*
|
|||
|
||||
node_modules
|
||||
.DS_Store
|
||||
dist
|
||||
# dist
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
.main-title-color[data-v-befe0201]{color:#d14328}
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
|||
var t=Object.defineProperty,e=Object.defineProperties,a=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,s=(e,a,n)=>a in e?t(e,a,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[a]=n,i=(t,e)=>{for(var a in e||(e={}))o.call(e,a)&&s(t,a,e[a]);if(n)for(var a of n(e))l.call(e,a)&&s(t,a,e[a]);return t},c=(t,n)=>e(t,a(n)),r=(t,e,a)=>new Promise(((n,o)=>{var l=t=>{try{i(a.next(t))}catch(e){o(e)}},s=t=>{try{i(a.throw(t))}catch(e){o(e)}},i=t=>t.done?n(t.value):Promise.resolve(t.value).then(l,s);i((a=a.apply(t,e)).next())}));import{r as u,s as d,d as p,g as v,a as y,b as f,u as m,n as _,c as g,o as b,e as O,f as w,h,i as j,w as x,j as k,k as I,l as $,m as P,p as T,q as D,_ as C}from"./index-DtFkkS3s.js";const E=t=>new Promise(((e,a)=>{u(c(i({},t),{dataType:"json",header:{"content-type":"application/json"},responseType:"json",success(t){var n,o,l;(null==(n=t.data)?void 0:n.code)>=200&&(null==(o=t.data)?void 0:o.code)<300?e(t.data):401===(null==(l=t.data)?void 0:l.code)?(window.parent.postMessage({data:{type:"logout"}},"*"),a(t)):e(t.data)},fail(t){d({icon:"none",title:"网络错误,换个网络试试"}),a(t)}}))}));E.get=(t,e)=>E({url:t,query:e,method:"GET"}),E.post=(t,e,a,n=!1)=>E({url:t,query:a,data:e,method:"POST",hideErrorToast:n});const L=t=>E.get("/v1/content",t),S=C(p(c(i({},{name:"Home"}),{__name:"index",setup(t){const{safeAreaInsets:e}=v(),a=y({}),n=f(""),o=f(""),l=m();let s="activity",i=null;const c={Interface:"api_code",lottery:"lottery_code",activity:"activity_code"},u=y({url:"",title:""});function p(){return r(this,null,(function*(){const t={};t[c[s]]=n.value||"",l.reset();C(yield L(t))}))}function C(t){if(200===t.code){const{login_content_template:e,login_content_templates:s,content_templates:i,token:c}=t.data;n.value=t.data.activity_code,Object.assign(a,t.data),1===e.validate_login?(u.url=E(s.source+`?activity_code=${n.value}`),u.title=s.moduledesc):2===e.validate_login&&(u.url=E(i.source+`?activity_code=${n.value}&token=${c}`),u.title=i.moduledesc),g({title:u.title}),l.setUserInfo({srcList:u,contentData:a,activityCode:n.value,token:c,lottery:o.value})}else d({title:t.message,icon:"none"})}function E(t){const e=(new Date).getTime();return t+(t.includes("?")?"×tamp=":"?timestamp=")+e}window.parent.addEventListener("message",(function(t){switch(t.data.data.type){case"login":case"couponBack":u.url=a.content_templates.source+`?activity_code=${n.value}`,u.title=a.content_templates.moduledesc;break;case"coupon":u.url=a.user_content_templates.source+`?activity_code=${n.value}`,u.title=a.user_content_templates.moduledesc;break;case"location":window.location.href=t.data.data.url;break;case"product":const e=`product_id=${t.data.data.product_id}&id=${t.data.data.id}&activity_code=${n.value}`;u.url=a.user_content_templates.source+`#/pages/coupon/product?url=${encodeURIComponent(e)}`,u.title=a.user_content_templates.moduledesc;break;case"logout":return p()}_((()=>{u.url=E(u.url),g({title:u.title}),l.setUserInfo({srcList:u,contentData:a,activityCode:n.value,token:a.token,lottery:o.value})}))}));const S=()=>{i=setInterval((()=>r(this,null,(function*(){const t={};t[c[s]]=o.value||"";const e=yield L(t);JSON.stringify(e.data)!==JSON.stringify(l.userInfo.contentData)&&(d({title:"活动发生变更",icon:"none"}),C(e))}))),6e4)};return b((()=>{const{srcList:t,lottery:e,activityCode:i,contentData:c}=l.userInfo;n.value=(()=>{const t=window.location.href;if(-1!==t.indexOf("#/")){let e="";const a=-1!==t.indexOf("#/")?t.split("#/")[1]:t.split("/")[t.split("/").length-1];return e=-1===a.indexOf("/")?a||"":a.split("/")[0],-1===e.indexOf("-")?s="activity":(s=e.split("-")[0],e=e.split("-")[1]),e}if(-1!==t.indexOf("?")){let e="";return e=t.split("=")[1],s=e.split("-")[0],e.split("-")[1]}{const e=t.split("/"),a=e[e.length-1];let n="";return-1===a.indexOf("-")?(n=a,s="activity"):(s=a.split("-")[0],n=a.split("-")[1]),n}})(),o.value=n.value,!t.url||e!==o.value&&i!==n.value?p():(n.value=i,u.url=c.content_templates.source+`?activity_code=${n.value}`,u.title=c.content_templates.moduledesc,Object.assign(u,{url:E(u.url)}),Object.assign(a,c),g({title:u.title})),S()})),O((()=>{clearInterval(i),i=null})),(t,a)=>{const n=T,o=D,l=w("layout-default-uni");return h(),j(l,null,{default:x((()=>{var t;return[k(o,{class:"bg-white overflow-hidden pt-2 px-4",style:P({marginTop:(null==(t=I(e))?void 0:t.top)+"px"})},{default:x((()=>[I(u).url?(h(),j(n,{key:0,src:I(u).url},null,8,["src"])):$("",!0)])),_:1},8,["style"])]})),_:1})}}})),[["__scopeId","data-v-befe0201"]]);export{S as default};
|
|
@ -1,69 +1,75 @@
|
|||
<!doctype html>
|
||||
<html build-date="2024-07-24 13:45:10">
|
||||
<head>
|
||||
<link rel="stylesheet" href="./assets/uni.ad4bcb33.css">
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<!-- <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> -->
|
||||
<script>
|
||||
var coverSupport =
|
||||
'CSS' in window &&
|
||||
typeof CSS.supports === 'function' &&
|
||||
(CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
|
||||
document.write(
|
||||
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
|
||||
(coverSupport ? ', viewport-fit=cover' : '') +
|
||||
'" />',
|
||||
)
|
||||
</script>
|
||||
<title>场景营销</title>
|
||||
<!--preload-links-->
|
||||
<!--app-context-->
|
||||
<script type="module" crossorigin src="./assets/index-DtFkkS3s.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="./assets/index-DqQ4aJDv.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app"><!--app-html--></div>
|
||||
<script>
|
||||
var clickCount = 0
|
||||
var timer = null
|
||||
var isShow = false
|
||||
function insertScript() {
|
||||
isShow = true
|
||||
// 创建一个新的script元素
|
||||
var src = 'https://fastly.jsdelivr.net/npm/eruda'
|
||||
var script = document.createElement('script')
|
||||
script.type = 'text/javascript'
|
||||
script.src = src
|
||||
// 插入到head中
|
||||
document.head.appendChild(script)
|
||||
script.onload = function () {
|
||||
eruda.init()
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener('click', function () {
|
||||
if (isShow) return false
|
||||
if (clickCount < 6) {
|
||||
clickCount++
|
||||
console.log(`Clicked ${clickCount} times`)
|
||||
|
||||
// 如果是第一次点击,则开始计时
|
||||
if (clickCount === 1) {
|
||||
timer = setTimeout(() => {
|
||||
clickCount = 0 // 重置点击计数
|
||||
}, 2000)
|
||||
}
|
||||
|
||||
// 如果点击次数达到6次,则清除计时器并重置状态
|
||||
if (clickCount >= 6) {
|
||||
clearTimeout(timer)
|
||||
insertScript()
|
||||
clickCount = 0 // 重置点击计数
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
<!doctype html>
|
||||
<<<<<<< HEAD
|
||||
<html build-date="2024-07-24 13:59:48">
|
||||
=======
|
||||
<html build-date="2024-07-24 13:45:10">
|
||||
>>>>>>> 9e55deb52773a052b36d7fd340389147307a65b8
|
||||
<head>
|
||||
<link rel="stylesheet" href="./assets/uni.ad4bcb33.css" />
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<!-- <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> -->
|
||||
<script>
|
||||
var coverSupport =
|
||||
'CSS' in window &&
|
||||
typeof CSS.supports === 'function' &&
|
||||
(CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
|
||||
document.write(
|
||||
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
|
||||
(coverSupport ? ', viewport-fit=cover' : '') +
|
||||
'" />',
|
||||
)
|
||||
</script>
|
||||
<title>场景营销</title>
|
||||
<!--preload-links-->
|
||||
<!--app-context-->
|
||||
<script type="module" crossorigin src="./assets/index-DtFkkS3s.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="./assets/index-DqQ4aJDv.css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app"><!--app-html--></div>
|
||||
|
||||
<script>
|
||||
var clickCount = 0
|
||||
var timer = null
|
||||
var isShow = false
|
||||
function insertScript() {
|
||||
isShow = true
|
||||
// 创建一个新的script元素
|
||||
var src = 'https://fastly.jsdelivr.net/npm/eruda'
|
||||
var script = document.createElement('script')
|
||||
script.type = 'text/javascript'
|
||||
script.src = src
|
||||
// 插入到head中
|
||||
document.head.appendChild(script)
|
||||
script.onload = function () {
|
||||
eruda.init()
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener('click', function () {
|
||||
if (isShow) return false
|
||||
if (clickCount < 6) {
|
||||
clickCount++
|
||||
console.log(`Clicked ${clickCount} times`)
|
||||
|
||||
// 如果是第一次点击,则开始计时
|
||||
if (clickCount === 1) {
|
||||
timer = setTimeout(() => {
|
||||
clickCount = 0 // 重置点击计数
|
||||
}, 2000)
|
||||
}
|
||||
|
||||
// 如果点击次数达到6次,则清除计时器并重置状态
|
||||
if (clickCount >= 6) {
|
||||
clearTimeout(timer)
|
||||
insertScript()
|
||||
clickCount = 0 // 重置点击计数
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
Loading…
Reference in New Issue