提交最新代码

This commit is contained in:
xiaogang 2024-07-16 11:24:31 +08:00
parent 9e7b8dc84d
commit e1b1a3347c
37 changed files with 63 additions and 19 deletions

2
.gitignore vendored
View File

@ -9,7 +9,7 @@ lerna-debug.log*
node_modules node_modules
.DS_Store .DS_Store
dist # dist
*.local *.local
# Editor directories and files # Editor directories and files

View File

@ -1,6 +1,6 @@
const config = { const config = {
pages: './src/pages', pages: './src/pages',
pagesInclude: ['jlgh/login.vue'], pagesInclude: ['index'],
} }
export default config export default config

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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

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

View File

@ -0,0 +1 @@
var t=Object.defineProperty,e=Object.defineProperties,a=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,s=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={}))o.call(e,a)&&l(t,a,e[a]);if(n)for(var a of n(e))s.call(e,a)&&l(t,a,e[a]);return t},c=(t,n)=>e(t,a(n)),r=(t,e,a)=>new Promise(((n,o)=>{var s=t=>{try{i(a.next(t))}catch(e){o(e)}},l=t=>{try{i(a.throw(t))}catch(e){o(e)}},i=t=>t.done?n(t.value):Promise.resolve(t.value).then(s,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 m,u as f,n as _,c as g,o as O,e as b,f as h,h as w,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-BOEmy01U.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,s;(null==(n=t.data)?void 0:n.code)>=200&&(null==(o=t.data)?void 0:o.code)<300?e(t.data):401===(null==(s=t.data)?void 0:s.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=m(""),o=m(""),s=f();let l="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[l]]=n.value||"",s.reset();C(yield L(t))}))}function C(t){if(200===t.code){const{login_content_template:e,login_content_templates:l,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(l.source+`?activity_code=${n.value}`),u.title=l.moduledesc):2===e.validate_login&&(u.url=E(i.source+`?activity_code=${n.value}&token=${c}`),u.title=i.moduledesc),g({title:u.title}),s.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"detail":const e=`${t.data.data.item}`;u.url=a.user_content_templates.source+`#/pages/jlgh/redeem?item=${encodeURIComponent(e)}`,u.title=a.user_content_templates.moduledesc;break;case"product":const o=`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(o)}`,u.title=a.user_content_templates.moduledesc;break;case"logout":return p()}_((()=>{u.url=E(u.url),g({title:u.title}),s.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[l]]=o.value||"";const e=yield L(t);JSON.stringify(e.data)!==JSON.stringify(s.userInfo.contentData)&&(d({title:"活动发生变更",icon:"none"}),C(e))}))),6e4)};return O((()=>{const{srcList:t,lottery:e,activityCode:i,contentData:c}=s.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("-")?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}})(),o.value=n.value,!t.url||e!==o.value&&i!==n.value?p():(n.value=i,Object.assign(u,t,{url:E(t.url)}),Object.assign(a,c),g({title:u.title})),S()})),b((()=>{clearInterval(i),i=null})),(t,a)=>{const n=T,o=D,s=h("layout-default-uni");return w(),j(s,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?(w(),j(n,{key:0,src:I(u).url},null,8,["src"])):$("",!0)])),_:1},8,["style"])]})),_:1})}}})),[["__scopeId","data-v-97a98c69"]]);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

View File

@ -1,7 +1,7 @@
<!doctype html> <!doctype html>
<html build-date="%BUILD_DATE%"> <html build-date="%BUILD_DATE%">
<head> <head>
<link rel="stylesheet" href="./assets/uni.41f11072.css"> <link rel="stylesheet" href="./assets/uni.ad4bcb33.css">
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<!-- <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> --> <!-- <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> -->
@ -19,8 +19,8 @@
<title>场景营销</title> <title>场景营销</title>
<!--preload-links--> <!--preload-links-->
<!--app-context--> <!--app-context-->
<script type="module" crossorigin src="./assets/index-DXolsVZx.js"></script> <script type="module" crossorigin src="./assets/index-BOEmy01U.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-D2mkeqV6.css"> <link rel="stylesheet" crossorigin href="./assets/index-D4NJJdh9.css">
</head> </head>
<body> <body>

Binary file not shown.

After

Width:  |  Height:  |  Size: 736 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1013 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
dist/build/h5/static/images/jlgh/mk.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

BIN
dist/build/h5/static/images/jlgh/zj.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -48,11 +48,11 @@ export default defineUniPages({
// navigationStyle: 'custom', // navigationStyle: 'custom',
// }, // },
// }, // },
{ // {
path: 'pages/jlgh/login', // path: 'pages/jlgh/login',
type: 'home', // type: 'home',
style: { navigationStyle: 'custom' }, // style: { navigationStyle: 'custom' },
}, // },
// { // {
// path: 'pages/jlgh/index', // path: 'pages/jlgh/index',
// type: 'home', // type: 'home',

View File

@ -39,10 +39,11 @@
}, },
"pages": [ "pages": [
{ {
"path": "pages/jlgh/login", "path": "pages/index/index",
"type": "home", "type": "home",
"style": { "style": {
"navigationStyle": "custom" "navigationStyle": "custom",
"navigationBarTitleText": "首页"
} }
} }
], ],

View File

@ -99,6 +99,14 @@ window.parent.addEventListener('message', function (event) {
contentData.user_content_templates.source + `?activity_code=${activityCode.value}` contentData.user_content_templates.source + `?activity_code=${activityCode.value}`
srcList.title = contentData.user_content_templates.moduledesc srcList.title = contentData.user_content_templates.moduledesc
break break
case 'detail':
// eslint-disable-next-line no-case-declarations
const linkUrl = `${event.data.data.item}`
srcList.url =
contentData.user_content_templates.source +
`#/pages/jlgh/redeem?item=${encodeURIComponent(linkUrl)}`
srcList.title = contentData.user_content_templates.moduledesc
break
case 'product': case 'product':
// eslint-disable-next-line no-case-declarations // eslint-disable-next-line no-case-declarations
const url = `product_id=${event.data.data.product_id}&id=${event.data.data.id}&activity_code=${activityCode.value}` const url = `product_id=${event.data.data.product_id}&id=${event.data.data.id}&activity_code=${activityCode.value}`

View File

@ -1,6 +1,7 @@
<route lang="json5" type="page"> <route lang="json5" type="page">
{ {
style: { style: {
navigationStyle: 'custom',
navigationBarTitleText: '奖品兑换', navigationBarTitleText: '奖品兑换',
}, },
} }
@ -117,7 +118,8 @@ const phone = ref<string>('')
onLoad((options) => { onLoad((options) => {
console.log(options) console.log(options)
Object.assign(info, JSON.parse(options.item)) const item = decodeURIComponent(options.item)
Object.assign(info, JSON.parse(item))
}) })
function gomy() { function gomy() {

View File

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

View File

@ -20,9 +20,6 @@ import zipPack from 'vite-plugin-zip-pack'
import getPages from './build' import getPages from './build'
const { exclude, targetModule } = getPages() const { exclude, targetModule } = getPages()
const [moduleInfo] = Object.entries(targetModule)
const moduleKey = moduleInfo[0]
const moduleValue = moduleInfo[1][0].replace('.vue', '')
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default ({ command, mode }) => { export default ({ command, mode }) => {
@ -81,10 +78,11 @@ export default ({ command, mode }) => {
restart: ['vite.config.js'], restart: ['vite.config.js'],
}), }),
// zipPack({ // zipPack({
// inDir: `dist/build/${UNI_PLATFORM}`, // 输入的文件夹,就是要打包的文件夹 // // inDir: `dist/build/${UNI_PLATFORM}`, // 输入的文件夹,就是要打包的文件夹
// inDir: `dist/build`, // 输入的文件夹,就是要打包的文件夹
// outDir: `dist/build`, // 打包好的 zip 文件放到哪个文件夹下 // outDir: `dist/build`, // 打包好的 zip 文件放到哪个文件夹下
// // outFileName: `${targetModule.join('-')}-${dayjs().format('MM-DD--HH-mm-ss')}.zip`, // 文件名不能包含\/:*?"<>| // // outFileName: `${targetModule.join('-')}-${dayjs().format('MM-DD--HH-mm-ss')}.zip`, // 文件名不能包含\/:*?"<>|
// outFileName: `${moduleKey}_${moduleValue}-${dayjs().format('MM-DD--HH-mm-ss')}.zip`, // 文件名不能包含\/:*?"<>| // outFileName: `${UNI_PLATFORM}.zip`, // 文件名不能包含\/:*?"<>|
// pathPrefix: '', // pathPrefix: '',
// }), // }),
// // h5环境增加编译时间 // // h5环境增加编译时间