测试部署

This commit is contained in:
lf 2024-07-18 14:57:02 +08:00
parent f5f0e47bf6
commit 892d4e1608
21 changed files with 123 additions and 14 deletions

View File

@ -4,12 +4,16 @@ import path from 'path'
const config = {
pages: './src/pages',
// pagesInclude: ['jlgh/coupon.vue', 'jlgh/redeem.vue'],
pagesInclude: ['jlgh/index.vue'],
// pagesInclude: ['jlgh/index.vue'],
// pagesInclude: ['jlgh/login.vue'],
// pagesInclude: ['jlgh'],
pagesInclude: ['index'],
}
const { pages, pagesInclude } = config
const {
pages,
pagesInclude
} = config
function getPages() {
const srcPath = path.resolve(__dirname, pages)
@ -71,4 +75,7 @@ function createOutputDir(pageInfo) {
}
}
export { getPages, createOutputDir }
export {
getPages,
createOutputDir
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
.main-title-color[data-v-dd70c43a]{color:#d14328}

31
dist/build/h5/assets/index-cLUVSraE.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -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 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-cLUVSraE.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("?")?"&timestamp=":"?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 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-dd70c43a"]]);export{S as default};

1
dist/build/h5/assets/uni.ad4bcb33.css vendored Normal file

File diff suppressed because one or more lines are too long

34
dist/build/h5/index.html vendored Normal file
View File

@ -0,0 +1,34 @@
<!doctype html>
<html build-date="2024-07-18 14:46:35">
<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-cLUVSraE.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-Bp0FSsh8.css">
</head>
<body>
<div id="app"><!--app-html--></div>
<!-- 调试工具 -->
<!-- <script src="https://fastly.jsdelivr.net/npm/eruda"></script>
<script>
eruda.init()
</script> -->
</body>
</html>

0
dist/build/h5/static/images/.gitkeep vendored Normal file
View File

33
dist/build/h5/static/logo.svg vendored Normal file
View File

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg id="_图层_2" data-name="图层 2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 113.39 113.39">
<defs>
<style>
.cls-1 {
fill: none;
}
.cls-2 {
fill: #d14328;
}
.cls-3 {
fill: #2c8d3a;
}
</style>
</defs>
<g id="_图层_1-2" data-name="图层 1">
<g>
<rect class="cls-1" width="113.39" height="113.39" />
<g>
<path class="cls-3"
d="M86.31,11.34H25.08c-8.14,0-14.74,6.6-14.74,14.74v61.23c0,8.14,6.6,14.74,14.74,14.74h61.23c.12,0,.24-.02,.37-.02-9.76-.2-17.64-8.18-17.64-17.99,0-.56,.03-1.12,.08-1.67H34.1c-1.57,0-2.83-1.27-2.83-2.83V32.43c0-.78,.63-1.42,1.42-1.42h9.17c.78,0,1.42,.63,1.42,1.42v36.52c0,.78,.63,1.42,1.42,1.42h22.02c.78,0,1.42-.63,1.42-1.42V32.43c0-.78,.63-1.42,1.42-1.42h9.17c.78,0,1.42,.63,1.42,1.42v34.99c2.13-.89,4.47-1.39,6.92-1.39,5.66,0,10.7,2.63,14.01,6.72V26.08c0-8.14-6.6-14.74-14.74-14.74Z" />
<g>
<path class="cls-2"
d="M87.04,68.03c-8.83,0-16.01,7.18-16.01,16.01s7.18,16.01,16.01,16.01,16.01-7.18,16.01-16.01-7.18-16.01-16.01-16.01Zm-.27,24.84h-7.2v-3h1.18v-10.48h4.58v2.81h1.42c.84,0,1.46-.16,1.88-.48s.62-.87,.62-1.64c0-.69-.25-1.17-.74-1.45s-1.19-.42-2.09-.42h-6.84v-3h7.2c2.38,0,4.15,.38,5.31,1.15,1.16,.77,1.74,1.93,1.74,3.48,0,1.71-.83,2.93-2.5,3.64,1.07,.4,1.87,.95,2.39,1.65s.79,1.56,.79,2.58c0,3.44-2.58,5.16-7.73,5.16Z" />
<path class="cls-2"
d="M86.49,85.17h-1.16v4.7h1.8c.81,0,1.46-.18,1.94-.55s.72-.95,.72-1.73c0-.86-.25-1.48-.74-1.85s-1.35-.56-2.56-.56Z" />
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
dist/build/h5/static/tabbar/example.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
dist/build/h5/static/tabbar/home.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
dist/build/h5/static/tabbar/homeHL.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
dist/build/h5/static/tabbar/personal.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

8
env/.env.production vendored
View File

@ -7,12 +7,12 @@ VITE_SHOW_SOURCEMAP = false
VITE_APP_PUBLIC_BASE = ./
# 测试线上
# VITE_SERVER_BASEURL = 'https://gateway.dev.cdlsxd.cn'
VITE_SERVER_BASEURL = 'https://gateway.dev.cdlsxd.cn'
# 正式环境
VITE_SERVER_BASEURL = 'https://scens.h5.86698.cn'
# VITE_SERVER_BASEURL = 'https://scens.h5.86698.cn'
# VITE_APP_PROXY = true
# 测试线上
# VITE_APP_PROXY_PREFIX = 'https://gateway.dev.cdlsxd.cn'
VITE_APP_PROXY_PREFIX = 'https://gateway.dev.cdlsxd.cn'
# 正式环境
VITE_APP_PROXY_PREFIX = 'https://scens.h5.86698.cn'
# VITE_APP_PROXY_PREFIX = 'https://scens.h5.86698.cn'

View File

@ -24,7 +24,7 @@ export default defineManifestConfig({
locale: VITE_FALLBACK_LOCALE, // 'zh-Hans'
h5: {
router: {
// mode: 'history',
mode: 'history',
base: VITE_APP_PUBLIC_BASE,
},
},

View File

@ -105,6 +105,7 @@
"vueVersion": "3",
"h5": {
"router": {
"mode": "history",
"base": "./"
}
}

View File

@ -39,12 +39,11 @@
},
"pages": [
{
"path": "pages/jlgh/index",
"type": "page",
"layout": "default",
"path": "pages/index/index",
"type": "home",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "工行长春消费季"
"navigationBarTitleText": "首页"
}
}
],

View File

@ -201,7 +201,7 @@ onLoad(() => {
lottery: lotteryU,
activityCode: activityCodeU,
contentData: contentDataU,
} = useStore.userInfo
} = useStore.userInfo as any
activityCode.value = getUrlPathName()
lottery.value = activityCode.value
if (!srcListU.url || (lotteryU !== lottery.value && activityCodeU !== activityCode.value)) {

View File

@ -4,7 +4,7 @@
// Generated by vite-plugin-uni-pages
interface NavigateToOptions {
url: "/pages/jlgh/index";
url: "/pages/index/index";
}
interface RedirectToOptions extends NavigateToOptions {}