This commit is contained in:
lf 2024-06-19 13:50:08 +08:00
parent 6e55a0ad56
commit 15baf12899
22 changed files with 48 additions and 53 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

File diff suppressed because one or more lines are too long

View File

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

File diff suppressed because one or more lines are too long

View File

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

File diff suppressed because one or more lines are too long

View File

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

View File

@ -1 +0,0 @@
var e=Object.defineProperty,t=Object.defineProperties,a=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable,l=(t,a,s)=>a in t?e(t,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[a]=s,r=(e,t)=>{for(var a in t||(t={}))o.call(t,a)&&l(e,a,t[a]);if(s)for(var a of s(t))n.call(t,a)&&l(e,a,t[a]);return e},c=(e,s)=>t(e,a(s));import{r as i,s as u,d,g as p,a as m,b as _,u as y,n as v,o as f,c as g,e as b,f as w,h as j,w as O,i as h,j as I,k as P,l as x,m as T,p as $,_ as q}from"./index-th-Hvt3K.js";const D=e=>new Promise(((t,a)=>{i(c(r({},e),{dataType:"json",header:{"content-type":"application/json"},responseType:"json",success(s){s.statusCode>=200&&s.statusCode<300?t(s.data):401===s.statusCode?(window.parent.postMessage({data:{type:"logout"}},"*"),a(s)):(!e.hideErrorToast&&u({icon:"none",title:s.data.msg||"请求错误"}),a(s))},fail(e){u({icon:"none",title:"网络错误,换个网络试试"}),a(e)}}))}));D.get=(e,t)=>D({url:e,query:t,method:"GET"}),D.post=(e,t,a)=>D({url:e,query:a,data:t,method:"POST"});const L=q(d(c(r({},{name:"Home"}),{__name:"index",setup(e){const{safeAreaInsets:t}=p(),a=m({}),s=_(""),o=y(),n=m({url:"",title:""});m({});window.parent.addEventListener("message",(function(e){let t={};const l=(new Date).getTime();if("login"===e.data.data.type)t={url:a.content_templates.source+`?activity_code=${s.value}`,title:a.content_templates.moduledesc};else if("coupon"===e.data.data.type)t={url:a.user_content_templates.source+`?activity_code=${s.value}`,title:a.user_content_templates.moduledesc};else if("product"===e.data.data.type){const o=`product_id=${e.data.data.product_id}&id=${e.data.data.id}&activity_code=${s.value}`,n=encodeURIComponent(o);t={url:a.user_content_templates.source+`#/pages/coupon/product?url=${n}`,title:a.user_content_templates.moduledesc}}else"couponBack"===e.data.data.type?t={url:a.content_templates.source+`?activity_code=${s.value}`,title:a.content_templates.moduledesc}:"logout"===e.data.data.type&&(t={url:a.login_content_templates.source,title:a.login_content_templates.moduledesc});n.url=n.url+(n.url.includes("?")?"&timestamp=":"?timestamp=")+l,v((()=>{Object.assign(n,t),g({title:n.title}),o.setUserInfo({srcList:n,contentData:a,query:s.value})}))}));const l=()=>{return e=this,t=null,l=function*(){const e={activity_code:s.value||""},t=yield(e=>D.get("/v1/content",e))(e);Object.assign(a,t.data),200===(null==t?void 0:t.code)&&1===t.data.login_content_template.validate_login?(Object.assign(n,{url:t.data.login_content_templates.source,title:t.data.login_content_templates.moduledesc}),g({title:n.title})):u({title:t.message,icon:"none"}),o.setUserInfo({srcList:n,contentData:a,query:s.value})},new Promise(((a,s)=>{var o=e=>{try{r(l.next(e))}catch(t){s(t)}},n=e=>{try{r(l.throw(e))}catch(t){s(t)}},r=e=>e.done?a(e.value):Promise.resolve(e.value).then(o,n);r((l=l.apply(e,t)).next())}));var e,t,l};return f((()=>{s.value=(()=>{const e=window.location.href.split("#/")[1];return-1===e.indexOf("/")?e||"":e.split("/")[0]})(),o.userInfo.srcList.url&&o.userInfo.query===s.value?(Object.assign(n,o.userInfo.srcList),Object.assign(a,o.userInfo.contentData),g({title:n.title})):l()})),(e,a)=>{const s=T,o=$,l=b("layout-default-uni");return w(),j(l,null,{default:O((()=>{var e;return[h(o,{class:"bg-white overflow-hidden pt-2 px-4",style:x({marginTop:(null==(e=I(t))?void 0:e.top)+"px"})},{default:O((()=>[I(n).url?(w(),j(s,{key:0,src:I(n).url},null,8,["src"])):P("",!0)])),_:1},8,["style"])]})),_:1})}}})),[["__scopeId","data-v-3e02310b"]]);export{L as default};

View File

@ -1,10 +1,10 @@
<!doctype html>
<html build-date="2024-06-17 17:29:59">
<html build-date="2024-06-19 13:45:48">
<head>
<link rel="stylesheet" href="./assets/uni.ad4bcb33.css">
<meta charset="UTF-8" />
<link rel="shortcut icon" href="./assets/favicon-D4BpDxaG.ico" type="image/x-icon" />
<!-- <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> -->
<script>
var coverSupport =
'CSS' in window &&
@ -16,11 +16,11 @@
'" />',
)
</script>
<title>模板</title>
<title>unibest</title>
<!--preload-links-->
<!--app-context-->
<script type="module" crossorigin src="./assets/index-th-Hvt3K.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-DAhF27Nm.css">
<script type="module" crossorigin src="./assets/index--GEwpD-F.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-balZ1UCs.css">
</head>
<body>

Binary file not shown.

After

Width:  |  Height:  |  Size: 821 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: 1.4 KiB

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: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

View File

@ -2,7 +2,7 @@
<html build-date="%BUILD_DATE%">
<head>
<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" /> -->
<script>
var coverSupport =
'CSS' in window &&

View File

@ -42,7 +42,7 @@ export default defineUniPages({
},
pages: [
{
path: 'pages/turntable/index',
path: 'pages/index/index',
type: 'home',
style: {
navigationStyle: 'custom',
@ -51,7 +51,7 @@ export default defineUniPages({
],
})
// 卡券页
// 工行-卡券页
// {
// path: 'pages/coupon/index',
// type: 'home',
@ -84,3 +84,37 @@ export default defineUniPages({
// navigationBarTitleText: '商品页',
// },
// },
// 天天抽奖-卡券页
// {
// path: 'pages/tt-coupon/index',
// type: 'home',
// style: {
// navigationStyle: 'default',
// navigationBarTitleText: '卡券页',
// titleNView: {
// buttons: [
// {
// type: 'back',
// float: 'left',
// },
// ],
// },
// },
// },
// {
// path: 'pages/tt-coupon/redeem',
// type: 'page',
// style: {
// navigationStyle: 'default',
// navigationBarTitleText: '兑换页',
// },
// },
// {
// path: 'pages/tt-coupon/product',
// type: 'page',
// style: {
// navigationStyle: 'default',
// navigationBarTitleText: '商品页',
// },
// },

View File

@ -12,30 +12,12 @@
class="bg-white overflow-hidden pt-2 px-4"
:style="{ marginTop: safeAreaInsets?.top + 'px' }"
>
<!-- <view class="mt-12">
<image src="/static/logo.svg" alt="" class="w-28 h-28 block mx-auto" />
</view>
<view class="text-center text-4xl main-title-color mt-4">unibest</view>
<view class="text-center text-2xl mt-2 mb-8">最好用的 uniapp 开发模板1</view>
<view class="text-justify max-w-100 m-auto text-4 indent mb-2">{{ description }}</view>
<view class="text-center mt-8">
当前平台是
<text class="text-green-500">{{ PLATFORM.platform }}</text>
</view>
<view class="text-center mt-4">
模板分支是
<text class="text-green-500">base</text>
</view> -->
<web-view v-if="srcList.url" :src="srcList.url"></web-view>
</view>
</template>
<script lang="ts" setup>
import PLATFORM from '@/utils/platform'
import { getContent } from '@/service/index/foo'
import { getUrlObj } from '@/utils/index'
import activity from '@/service/activity'
import { useUserStore } from '@/store'
defineOptions({
@ -57,26 +39,6 @@ const srcList = reactive<SrcListType>({
url: '',
title: '',
})
const dataObj = reactive({})
function handleMessage(event: any) {
// eslint-disable-next-line no-debugger
debugger
}
const getUrlParm = () => {
const url = window.location.href
const theRequest = {}
if (url.indexOf('?') !== -1) {
const index = url.indexOf('?')
const str = url.slice(index + 1)
const strs = str.split('&')
for (let i = 0; i < strs.length; i++) {
theRequest[strs[i].split('=')[0]] = strs[i].split('=')[1]
}
}
return theRequest
}
const getUrlPathName = () => {
const url = window.location.href
@ -159,7 +121,6 @@ onLoad(() => {
if (!useStore.userInfo.srcList.url || useStore.userInfo.query !== query.value) {
initContent()
} else {
// query.value = useStore.userInfo.query
Object.assign(srcList, useStore.userInfo.srcList)
Object.assign(contentData, useStore.userInfo.contentData)
uni.setNavigationBarTitle({

View File

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