首页打包

This commit is contained in:
lf 2024-07-01 18:11:06 +08:00
parent 0008f6d826
commit 6fae9efdd2
11 changed files with 19 additions and 13 deletions

File diff suppressed because one or more lines are too long

View File

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

View File

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

View File

@ -1 +1 @@
var t=Object.defineProperty,e=Object.defineProperties,a=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,l=(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={}))s.call(e,a)&&l(t,a,e[a]);if(n)for(var a of n(e))o.call(e,a)&&l(t,a,e[a]);return t},r=(t,n)=>e(t,a(n)),c=(t,e,a)=>new Promise(((n,s)=>{var o=t=>{try{i(a.next(t))}catch(e){s(e)}},l=t=>{try{i(a.throw(t))}catch(e){s(e)}},i=t=>t.done?n(t.value):Promise.resolve(t.value).then(o,l);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 h,h as w,i as j,w as I,j as x,k,l as P,m as $,p as T,q,_ as D}from"./index-Avj0HqKM.js";const L=t=>new Promise(((e,a)=>{u(r(i({},t),{dataType:"json",header:{"content-type":"application/json"},responseType:"json",success(t){var n,s,o;(null==(n=t.data)?void 0:n.code)>=200&&(null==(s=t.data)?void 0:s.code)<300?e(t.data):401===(null==(o=t.data)?void 0:o.code)?(window.parent.postMessage({data:{type:"logout"}},"*"),a(t)):e(t.data)},fail(t){d({icon:"none",title:"网络错误,换个网络试试"}),a(t)}}))}));L.get=(t,e)=>L({url:t,query:e,method:"GET"}),L.post=(t,e,a,n=!1)=>L({url:t,query:a,data:e,method:"POST",hideErrorToast:n});const E=t=>L.get("/v1/content",t),S=D(p(r(i({},{name:"Home"}),{__name:"index",setup(t){const{safeAreaInsets:e}=v(),a=y({}),n=f(""),s=f(""),o=m();let l="activity",i=null;const r={Interface:"api_code",lottery:"lottery_code",activity:"activity_code"},u=y({url:"",title:""});function p(){return c(this,null,(function*(){const t={};t[r[l]]=n.value||"",o.reset();D(yield E(t))}))}function D(t){if(200===t.code){const{login_content_template:e,login_content_templates:s,content_templates:l,token:i}=t.data;n.value=t.data.activity_code,Object.assign(a,t.data),1===e.validate_login?Object.assign(u,{url:L(s.source+`?activity_code=${n.value}`),title:s.moduledesc}):2===e.validate_login&&Object.assign(u,{url:L(l.source+`?activity_code=${n.value}&token=${i}`),title:l.moduledesc}),g({title:u.title}),o.setUserInfo({srcList:u,contentData:a,query:n.value,token:i})}else d({title:t.message,icon:"none"})}function L(t){const e=(new Date).getTime();return t+(t.includes("?")?"&timestamp=":"?timestamp=")+e}window.parent.addEventListener("message",(function(t){let e={url:"",title:""};switch(t.data.data.type){case"login":case"couponBack":e={url:a.content_templates.source+`?activity_code=${n.value}`,title:a.content_templates.moduledesc};break;case"coupon":e={url:a.user_content_templates.source+`?activity_code=${n.value}`,title:a.user_content_templates.moduledesc};break;case"product":const s=`product_id=${t.data.data.product_id}&id=${t.data.data.id}&activity_code=${n.value}`,o=encodeURIComponent(s);e={url:a.user_content_templates.source+`#/pages/coupon/product?url=${o}`,title:a.user_content_templates.moduledesc};break;case"logout":return p()}_((()=>{Object.assign(u,{url:L(e.url),title:u.title}),g({title:u.title}),o.setUserInfo({srcList:u,contentData:a,query:n.value,token:a.token})}))}));const S=()=>{i=setInterval((()=>c(this,null,(function*(){const t={};t[r[l]]=s.value||"";const e=yield E(t);JSON.stringify(e.data)!==JSON.stringify(o.userInfo.contentData)&&(d({title:"活动发生变更",icon:"none"}),D(e))}))),6e4)};return b((()=>{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("-")?l="activity":(l=e.split("-")[0],e=e.split("-")[1]),e}{const e=t.split("/"),a=e[e.length-1];let n="";return-1===a.indexOf("-")?(n=a,l="activity"):(l=a.split("-")[0],n=a.split("-")[1]),n}})(),s.value=n.value,o.userInfo.srcList.url&&o.userInfo.query===n.value?(Object.assign(u,o.userInfo.srcList,{url:L(o.userInfo.srcList.url)}),Object.assign(a,o.userInfo.contentData),g({title:u.title})):p(),S()})),O((()=>{clearInterval(i),i=null})),(t,a)=>{const n=T,s=q,o=h("layout-default-uni");return w(),j(o,null,{default:I((()=>{var t;return[x(s,{class:"bg-white overflow-hidden pt-2 px-4",style:$({marginTop:(null==(t=k(e))?void 0:t.top)+"px"})},{default:I((()=>[k(u).url?(w(),j(n,{key:0,src:k(u).url},null,8,["src"])):P("",!0)])),_:1},8,["style"])]})),_:1})}}})),[["__scopeId","data-v-ba967817"]]);export{S as default}; var t=Object.defineProperty,e=Object.defineProperties,a=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,l=(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={}))s.call(e,a)&&l(t,a,e[a]);if(n)for(var a of n(e))o.call(e,a)&&l(t,a,e[a]);return t},r=(t,n)=>e(t,a(n)),c=(t,e,a)=>new Promise(((n,s)=>{var o=t=>{try{i(a.next(t))}catch(e){s(e)}},l=t=>{try{i(a.throw(t))}catch(e){s(e)}},i=t=>t.done?n(t.value):Promise.resolve(t.value).then(o,l);i((a=a.apply(t,e)).next())}));import{r as u,s as d,d as p,g as v,a as f,b as y,u as m,n as _,c as g,o as O,e as b,f as h,h as w,i as j,w as I,j as x,k,l as P,m as $,p as T,q,_ as D}from"./index-BZpSO4qc.js";const L=t=>new Promise(((e,a)=>{u(r(i({},t),{dataType:"json",header:{"content-type":"application/json"},responseType:"json",success(t){var n,s,o;(null==(n=t.data)?void 0:n.code)>=200&&(null==(s=t.data)?void 0:s.code)<300?e(t.data):401===(null==(o=t.data)?void 0:o.code)?(window.parent.postMessage({data:{type:"logout"}},"*"),a(t)):e(t.data)},fail(t){d({icon:"none",title:"网络错误,换个网络试试"}),a(t)}}))}));L.get=(t,e)=>L({url:t,query:e,method:"GET"}),L.post=(t,e,a,n=!1)=>L({url:t,query:a,data:e,method:"POST",hideErrorToast:n});const E=t=>L.get("/v1/content",t),S=D(p(r(i({},{name:"Home"}),{__name:"index",setup(t){const{safeAreaInsets:e}=v(),a=f({}),n=y(""),s=y(""),o=m();let l="activity",i=null;const r={Interface:"api_code",lottery:"lottery_code",activity:"activity_code"},u=f({url:"",title:""});function p(){return c(this,null,(function*(){const t={};t[r[l]]=n.value||"",o.reset();D(yield E(t))}))}function D(t){if(200===t.code){const{login_content_template:e,login_content_templates:s,content_templates:l,token:i}=t.data;n.value=t.data.activity_code,Object.assign(a,t.data),1===e.validate_login?Object.assign(u,{url:L(s.source+`?activity_code=${n.value}`),title:s.moduledesc}):2===e.validate_login&&Object.assign(u,{url:L(l.source+`?activity_code=${n.value}&token=${i}`),title:l.moduledesc}),g({title:u.title}),o.setUserInfo({srcList:u,contentData:a,query:n.value,token:i})}else d({title:t.message,icon:"none"})}function L(t){const e=(new Date).getTime();return t+(t.includes("?")?"&timestamp=":"?timestamp=")+e}window.parent.addEventListener("message",(function(t){let e={url:"",title:""};switch(t.data.data.type){case"login":case"couponBack":e={url:a.content_templates.source+`?activity_code=${n.value}`,title:a.content_templates.moduledesc};break;case"coupon":e={url:a.user_content_templates.source+`?activity_code=${n.value}`,title:a.user_content_templates.moduledesc};break;case"product":const s=`product_id=${t.data.data.product_id}&id=${t.data.data.id}&activity_code=${n.value}`,o=encodeURIComponent(s);e={url:a.user_content_templates.source+`#/pages/coupon/product?url=${o}`,title:a.user_content_templates.moduledesc};break;case"logout":return p()}_((()=>{Object.assign(u,{url:L(e.url),title:u.title}),g({title:u.title}),o.setUserInfo({srcList:u,contentData:a,query:n.value,token:a.token})}))}));const S=()=>{i=setInterval((()=>c(this,null,(function*(){const t={};t[r[l]]=s.value||"";const e=yield E(t);JSON.stringify(e.data)!==JSON.stringify(o.userInfo.contentData)&&(d({title:"活动发生变更",icon:"none"}),D(e))}))),6e4)};return O((()=>{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("-")?l="activity":(l=e.split("-")[0],e=e.split("-")[1]),e}if(-1!==t.indexOf("?")){let e="";return e=t.split("=")[1],l=e.split("-")[0],e.split("-")[1]}{const e=t.split("/"),a=e[e.length-1];let n="";return-1===a.indexOf("-")?(n=a,l="activity"):(l=a.split("-")[0],n=a.split("-")[1]),n}})(),s.value=n.value,o.userInfo.srcList.url&&o.userInfo.query===n.value?(Object.assign(u,o.userInfo.srcList,{url:L(o.userInfo.srcList.url)}),Object.assign(a,o.userInfo.contentData),g({title:u.title})):p(),S()})),b((()=>{clearInterval(i),i=null})),(t,a)=>{const n=T,s=q,o=h("layout-default-uni");return w(),j(o,null,{default:I((()=>{var t;return[x(s,{class:"bg-white overflow-hidden pt-2 px-4",style:$({marginTop:(null==(t=k(e))?void 0:t.top)+"px"})},{default:I((()=>[k(u).url?(w(),j(n,{key:0,src:k(u).url},null,8,["src"])):P("",!0)])),_:1},8,["style"])]})),_:1})}}})),[["__scopeId","data-v-03f307b6"]]);export{S as default};

View File

@ -1,5 +1,5 @@
<!doctype html> <!doctype html>
<html build-date="2024-06-28 09:49:53"> <html build-date="2024-07-01 17:51:47">
<head> <head>
<link rel="stylesheet" href="./assets/uni.ad4bcb33.css"> <link rel="stylesheet" href="./assets/uni.ad4bcb33.css">
@ -16,10 +16,10 @@
'" />', '" />',
) )
</script> </script>
<title>unibest</title> <title>加载中...</title>
<!--preload-links--> <!--preload-links-->
<!--app-context--> <!--app-context-->
<script type="module" crossorigin src="./assets/index-Avj0HqKM.js"></script> <script type="module" crossorigin src="./assets/index-BZpSO4qc.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-DfE4H0b6.css"> <link rel="stylesheet" crossorigin href="./assets/index-DfE4H0b6.css">
</head> </head>

4
env/.env vendored
View File

@ -1,4 +1,4 @@
VITE_APP_TITLE = 'unibest' VITE_APP_TITLE = '加载中...'
VITE_APP_PORT = 9000 VITE_APP_PORT = 9000
VITE_UNI_APPID = 'H57F2ACE4' VITE_UNI_APPID = 'H57F2ACE4'
@ -8,6 +8,8 @@ VITE_WX_APPID = 'wxa2abb91f64032a2b'
VITE_APP_PUBLIC_BASE = './' VITE_APP_PUBLIC_BASE = './'
# 测试线上 # 测试线上
VITE_SERVER_BASEURL = 'https://gateway.dev.cdlsxd.cn' VITE_SERVER_BASEURL = 'https://gateway.dev.cdlsxd.cn'
# 曾徐平
# VITE_SERVER_BASEURL = 'http://192.168.110.128:8081'
# 正式环境 # 正式环境
# VITE_SERVER_BASEURL = 'https://scens.h5.86698.cn' # VITE_SERVER_BASEURL = 'https://scens.h5.86698.cn'

View File

@ -14,7 +14,7 @@
'" />', '" />',
) )
</script> </script>
<title>unibest</title> <title>加载中...</title>
<!--preload-links--> <!--preload-links-->
<!--app-context--> <!--app-context-->
</head> </head>

View File

@ -3,7 +3,7 @@ import { defineUniPages } from '@uni-helper/vite-plugin-uni-pages'
export default defineUniPages({ export default defineUniPages({
globalStyle: { globalStyle: {
navigationStyle: 'default', navigationStyle: 'default',
navigationBarTitleText: 'unibest', navigationBarTitleText: '加载中...',
navigationBarBackgroundColor: '#f8f8f8', navigationBarBackgroundColor: '#f8f8f8',
navigationBarTextStyle: 'black', navigationBarTextStyle: 'black',
backgroundColor: '#FFFFFF', backgroundColor: '#FFFFFF',

View File

@ -1,5 +1,5 @@
{ {
"name": "unibest", "name": "加载中...",
"appid": "H57F2ACE4", "appid": "H57F2ACE4",
"description": "", "description": "",
"versionName": "1.0.0", "versionName": "1.0.0",
@ -105,7 +105,6 @@
"vueVersion": "3", "vueVersion": "3",
"h5": { "h5": {
"router": { "router": {
"mode": "history",
"base": "./" "base": "./"
} }
} }

View File

@ -1,7 +1,7 @@
{ {
"globalStyle": { "globalStyle": {
"navigationStyle": "default", "navigationStyle": "default",
"navigationBarTitleText": "unibest", "navigationBarTitleText": "加载中...",
"navigationBarBackgroundColor": "#f8f8f8", "navigationBarBackgroundColor": "#f8f8f8",
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
"backgroundColor": "#FFFFFF" "backgroundColor": "#FFFFFF"

View File

@ -67,6 +67,11 @@ const getUrlPathName = () => {
strR = strR.split('-')[1] strR = strR.split('-')[1]
} }
return strR return strR
} else if (url.indexOf('?') !== -1) {
let strR = ''
strR = url.split('=')[1]
code = strR.split('-')[0]
return strR.split('-')[1]
} else { } else {
const str = url.split('/') const str = url.split('/')
const strP = str[str.length - 1] const strP = str[str.length - 1]