测试dev

This commit is contained in:
lf 2024-06-28 09:50:51 +08:00
parent 957a2d049f
commit 0008f6d826
5 changed files with 14 additions and 13 deletions

File diff suppressed because one or more lines are too long

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-puNGKWFH.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 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};

View File

@ -1,5 +1,5 @@
<!doctype html>
<html build-date="2024-06-28 09:27:07">
<html build-date="2024-06-28 09:49:53">
<head>
<link rel="stylesheet" href="./assets/uni.ad4bcb33.css">
@ -19,7 +19,7 @@
<title>unibest</title>
<!--preload-links-->
<!--app-context-->
<script type="module" crossorigin src="./assets/index-puNGKWFH.js"></script>
<script type="module" crossorigin src="./assets/index-Avj0HqKM.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-DfE4H0b6.css">
</head>

7
env/.env vendored
View File

@ -6,9 +6,10 @@ VITE_WX_APPID = 'wxa2abb91f64032a2b'
# h5部署网站的base配置到 manifest.config.ts 里的 h5.router.base
VITE_APP_PUBLIC_BASE = './'
# VITE_SERVER_BASEURL = 'https://gateway.dev.cdlsxd.cn'
VITE_SERVER_BASEURL = 'https://scens.h5.86698.cn'
# 测试线上
VITE_SERVER_BASEURL = 'https://gateway.dev.cdlsxd.cn'
# 正式环境
# VITE_SERVER_BASEURL = 'https://scens.h5.86698.cn'
VITE_UPLOAD_BASEURL = 'https://ukw0y1.laf.run/upload'

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'