打包生成主模版index
This commit is contained in:
parent
f61a12323b
commit
9e55deb527
|
@ -4,9 +4,9 @@ import path from 'path'
|
||||||
const config = {
|
const config = {
|
||||||
pages: './src/pages',
|
pages: './src/pages',
|
||||||
// pagesInclude: ['jlgh/coupon.vue', 'jlgh/redeem.vue'],
|
// pagesInclude: ['jlgh/coupon.vue', 'jlgh/redeem.vue'],
|
||||||
pagesInclude: ['jlgh/index.vue'],
|
// pagesInclude: ['jlgh/index.vue'],
|
||||||
// pagesInclude: ['jlgh/login.vue'],
|
// pagesInclude: ['jlgh/login.vue'],
|
||||||
// pagesInclude: ['jlgh'],
|
pagesInclude: ['index'],
|
||||||
}
|
}
|
||||||
|
|
||||||
const { pages, pagesInclude } = config
|
const { pages, pagesInclude } = config
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
.main-title-color[data-v-9a6f29c5]{color:#d14328}
|
|
File diff suppressed because one or more lines are too long
|
@ -1 +0,0 @@
|
||||||
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 O,e as b,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-z6pr05K_.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.replace(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 O((()=>{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()})),b((()=>{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-9a6f29c5"]]);export{S as default};
|
|
|
@ -1,5 +1,5 @@
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html build-date="2024-07-22 11:59:50">
|
<html build-date="2024-07-24 13:45:10">
|
||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" href="./assets/uni.ad4bcb33.css">
|
<link rel="stylesheet" href="./assets/uni.ad4bcb33.css">
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
<title>场景营销</title>
|
<title>场景营销</title>
|
||||||
<!--preload-links-->
|
<!--preload-links-->
|
||||||
<!--app-context-->
|
<!--app-context-->
|
||||||
<script type="module" crossorigin src="./assets/index-z6pr05K_.js"></script>
|
<script type="module" crossorigin src="./assets/index-DtFkkS3s.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="./assets/index-DqQ4aJDv.css">
|
<link rel="stylesheet" crossorigin href="./assets/index-DqQ4aJDv.css">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
@ -65,10 +65,5 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- <script src="https://fastly.jsdelivr.net/npm/eruda"></script>
|
|
||||||
<script>
|
|
||||||
eruda.init()
|
|
||||||
</script> -->
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -15,12 +15,11 @@
|
||||||
},
|
},
|
||||||
"pages": [
|
"pages": [
|
||||||
{
|
{
|
||||||
"path": "pages/jlgh/index",
|
"path": "pages/index/index",
|
||||||
"type": "page",
|
"type": "home",
|
||||||
"layout": "default",
|
|
||||||
"style": {
|
"style": {
|
||||||
"navigationStyle": "custom",
|
"navigationStyle": "custom",
|
||||||
"navigationBarTitleText": "工行长春消费季"
|
"navigationBarTitleText": "首页"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
// Generated by vite-plugin-uni-pages
|
// Generated by vite-plugin-uni-pages
|
||||||
|
|
||||||
interface NavigateToOptions {
|
interface NavigateToOptions {
|
||||||
url: "/pages/jlgh/index";
|
url: "/pages/index/index";
|
||||||
}
|
}
|
||||||
interface RedirectToOptions extends NavigateToOptions {}
|
interface RedirectToOptions extends NavigateToOptions {}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue