Compare commits

...

3 Commits

Author SHA1 Message Date
王文龙 fe47426b04 update 2023-12-01 10:15:06 +08:00
王文龙 a667af8e7d update 2023-11-27 18:29:05 +08:00
王文龙 627c8ca487 update 2023-11-27 14:19:05 +08:00
9 changed files with 120 additions and 46 deletions

4
.env
View File

@ -3,7 +3,7 @@ VITE_TOKEN_KEY=tokenKey
VITE_URL_PREFIX=/api VITE_URL_PREFIX=/api
# VITE_BASE_APP_ID='wx0fd5e237dba24ff4' # VITE_BASE_APP_ID='wx0fd5e237dba24ff4'
VITE_BASE_APP_ID='wxbad2e8a91c62a734' # VITE_BASE_APP_ID='wxbad2e8a91c62a734'
# VITE_BASE_APP_SECRET='14f1027251416b49734c36bf58d6a741' # VITE_BASE_APP_SECRET='14f1027251416b49734c36bf58d6a741'
VITE_BASE_APP_SECRET='e1b7fc425ca9cca05dd83609a6dc9c00' # VITE_BASE_APP_SECRET='e1b7fc425ca9cca05dd83609a6dc9c00'

View File

@ -7,3 +7,7 @@ VITE_USE_COMPRESS=false
VITE_USE_REPORT=false VITE_USE_REPORT=false
VITE_BASE_API_URL='http://139.224.10.234:8088' VITE_BASE_API_URL='http://139.224.10.234:8088'
VITE_BASE_APP_ID='wxbad2e8a91c62a734'
VITE_BASE_APP_SECRET='e1b7fc425ca9cca05dd83609a6dc9c00'

View File

@ -7,3 +7,7 @@ VITE_USE_COMPRESS=true
VITE_USE_REPORT=false VITE_USE_REPORT=false
VITE_BASE_API_URL='/' VITE_BASE_API_URL='/'
VITE_BASE_APP_ID='wx292995002b9476f3'
VITE_BASE_APP_SECRET='896202811f43b146123f8d3f9ad3c153'

View File

@ -1,7 +1,29 @@
server { server {
listen 4399; listen 80;
listen [::]:80;
server_name admin.swfc.store; server_name admin.swfc.store;
# 配置HTTP到HTTPS的重定向可选
return 301 https://admin.swfc.store$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name admin.swfc.store;
ssl_certificate /etc/nginx/ssl/admin.swfc.store/admin.swfc.store.pem;
ssl_certificate_key /etc/nginx/ssl/admin.swfc.store/admin.swfc.store.key;
# 配置SSL参数
ssl_protocols TLSv1.2 TLSv1.3; # 指定支持的SSL/TLS协议版本
ssl_prefer_server_ciphers on; # 使用服务器端加密套件顺序
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH'; # 指定加密套件
# 配置其他SSL选项
ssl_session_timeout 1d; # SSL会话过期时间
ssl_session_cache shared:SSL:10m; # SSL会话缓存大小
ssl_session_tickets off; # 禁用SSL会话票据
gzip on; gzip on;
# 定义要压缩的文件类型 # 定义要压缩的文件类型
gzip_types text/plain text/css application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; gzip_types text/plain text/css application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
@ -21,13 +43,9 @@ server {
gzip_static on; gzip_static on;
root /usr/share/nginx/html/admin/dist; root /usr/share/nginx/html/admin/dist;
location / {
index index.html index.htm; index index.html index.htm;
# try_files $uri $uri/ @router; location / {
} try_files $uri $uri/ /index.html;
location @router {
rewrite ^.*$ /index.html break;
} }
location /api{ location /api{

51
h5.conf
View File

@ -1,6 +1,37 @@
# server{
# listen 80;
# listen [::]:80;
# server_name www.swfc.store swfc.store;
# # 重定向到 HTTPS
# # return 301 https://swfc.store$request_uri;
# # return 301 https://$host$request_uri;
# # 配置HTTP到HTTPS的重定向可选
# # if ($scheme != "https") {
# # return 301 https://swfc.store;
# # }
# }
server { server {
listen 80; listen 80;
server_name swfc.store; listen [::]:80;
server_name www.swfc.store swfc.store;
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name www.swfc.store swfc.store;
ssl_certificate /etc/nginx/ssl/swfc.store/swfc.store.pem;
ssl_certificate_key /etc/nginx/ssl/swfc.store/swfc.store.key;
# 配置SSL参数
ssl_protocols TLSv1.2 TLSv1.3; # 指定支持的SSL/TLS协议版本
ssl_prefer_server_ciphers on; # 使用服务器端加密套件顺序
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH'; # 指定加密套件
# 配置其他SSL选项
ssl_session_timeout 1d; # SSL会话过期时间
ssl_session_cache shared:SSL:10m; # SSL会话缓存大小
ssl_session_tickets off; # 禁用SSL会话票据
gzip on; gzip on;
# 定义要压缩的文件类型 # 定义要压缩的文件类型
@ -21,13 +52,10 @@ server {
gzip_static on; gzip_static on;
root /usr/share/nginx/html/h5/dist; root /usr/share/nginx/html/h5/dist;
location / {
index index.html index.htm; index index.html index.htm;
try_files $uri $uri/ @router; location / {
} # try_files $uri $uri/ @router;
try_files $uri $uri/ /index.html;
location @router {
rewrite ^.*$ /index.html break;
} }
location /api{ location /api{
@ -41,4 +69,13 @@ server {
rewrite ^/api(.*)$ $1 break; rewrite ^/api(.*)$ $1 break;
proxy_pass http://localhost:8088; proxy_pass http://localhost:8088;
} }
location /mp/ {
alias /usr/share/nginx/html/mp/;
try_files $uri $uri/ =404;
}
location ~* \.txt$ {
allow all;
}
} }

View File

@ -41,7 +41,8 @@ const share = async (title: string, desc: string, link: string, imgUrl: string)
const shareData = { const shareData = {
title, title,
desc, desc,
link: link.replace(/\?time=\d+(#)/gi, '$1'), // link: link.replace(/\?time=\d+(#)/gi, '$1'),
link,
imgUrl, imgUrl,
success: function (res: any) { success: function (res: any) {
console.log('wx success', res); console.log('wx success', res);
@ -82,7 +83,8 @@ const share = async (title: string, desc: string, link: string, imgUrl: string)
const shareData = { const shareData = {
title, title,
desc, desc,
link: link.replace(/\?time=\d+(#)/gi, '$1'), // link: link.replace(/\?time=\d+(#)/gi, '$1'),
link,
imgUrl, imgUrl,
success: function (res: any) { success: function (res: any) {
console.log('wx share success', res); console.log('wx share success', res);

View File

@ -171,7 +171,7 @@
jumpBtn: false, jumpBtn: false,
autoClose: true, autoClose: true,
canvas: false, canvas: false,
isRotate: true, isRotate: false,
onPlay() {}, onPlay() {},
onPause() {}, onPause() {},
onEnd() { onEnd() {

View File

@ -102,7 +102,9 @@
v-for="(l, i) in lang" v-for="(l, i) in lang"
:key="l.key" :key="l.key"
> >
<template v-if="shopDetail[selLang]">
<span <span
v-if="shopDetail[l.key]"
:style="l.key === 'introJap' ? { fontFamily: 'Arial, Helvetica, sans-serif' } : ''" :style="l.key === 'introJap' ? { fontFamily: 'Arial, Helvetica, sans-serif' } : ''"
:class="l.key === 'introJap' ? 'text-36px' : 'text-40px'" :class="l.key === 'introJap' ? 'text-36px' : 'text-40px'"
>{{ l.lang }}</span >{{ l.lang }}</span
@ -118,12 +120,13 @@
src="@/assets/imgs/shop-detail/hyqq@2x.png" src="@/assets/imgs/shop-detail/hyqq@2x.png"
alt="" alt=""
/> />
</template>
</div> </div>
</div> </div>
<div <div
class="box-border mx-auto transition-all px-30px py-70px text-32px content w-690px min-h-300px rounded-3xl" class="box-border mx-auto transition-all px-30px py-70px text-32px content w-690px min-h-300px rounded-3xl"
:class="[selLang === 'introChi' && 'rounded-tl-0px', selLang === 'introJap' && 'rounded-tr-0px']" :class="[selLang === 'introChi' && 'rounded-tl-0px', selLang === 'introJap' && 'rounded-tr-0px']"
:style="selLang === 'introJap' ? { fontFamily: 'Arial, Helvetica, sans-serif' } : ''" :style="selLang !== 'introEng' ? { fontFamily: 'Arial, Helvetica, sans-serif' } : '' "
> >
{{ shopDetail[selLang] }} {{ shopDetail[selLang] }}
</div> </div>
@ -281,6 +284,7 @@
showImgPreview.value = true; showImgPreview.value = true;
}; };
const handleSelLang = (key: string) => { const handleSelLang = (key: string) => {
if(!shopDetail.value[key]) return
selLang.value = key; selLang.value = key;
}; };

View File

@ -31,7 +31,7 @@
</div> </div>
<div <div
class="flex items-center justify-between overflow-hidden rounded-md bg-beijing pr-16px pl-8px h-184px" class="flex items-center justify-between overflow-hidden rounded-md bg-beijing pr-16px pl-8px h-184px"
:class="item.nums <= 0 && 'grayscale'" :class="(item.nums <= 0 || item.verifState) && 'grayscale'"
> >
<img :src="item.giftImage" alt="" class="h-184px mt-[-6px] object-contain" /> <img :src="item.giftImage" alt="" class="h-184px mt-[-6px] object-contain" />
<div class="flex items-center justify-between flex-1 pl-2"> <div class="flex items-center justify-between flex-1 pl-2">
@ -41,16 +41,16 @@
<p class="text-20px leading-36px">剩余{{ item.nums }}</p> <p class="text-20px leading-36px">剩余{{ item.nums }}</p>
</div> </div>
<div <div
v-if="item.nums > 0" v-if="item.nums > 0 && !item.verifState"
@click="handleClick(item)" @click="handleClick(item)"
class="bg-white hover:bg-light-600 overflow-hidden cursor-pointer text-[#090909] text-26px rounded-26px h-52px w-140px leading-46px text-center" class="bg-white hover:bg-light-600 overflow-hidden cursor-pointer text-[#090909] text-26px rounded-26px h-52px w-140px leading-46px text-center"
> >
我要报名 {{ !item.state ? '我要报名' : '去核销' }}
<!-- 去核销 -->
</div> </div>
</div> </div>
<div> <div>
<img v-if="item.nums <= 0" src="@/assets/imgs/sale/lingwan.png" alt="" class="w-166px object-contain mr-[-18px]" /> <img v-if="item.nums <= 0 && !item.verifState" src="@/assets/imgs/sale/lingwan.png" alt="" class="w-166px object-contain mr-[-18px]" />
<img v-if="item.verifState" src="@/assets/imgs/sale/hexiao.png" alt="" class="w-166px object-contain mr-[-18px]" />
</div> </div>
</div> </div>
</div> </div>
@ -105,12 +105,13 @@
> >
<div class="text-36px leading bg-text"> {{ isSuccess ? '核销成功' : '报名成功' }} </div> <div class="text-36px leading bg-text"> {{ isSuccess ? '核销成功' : '报名成功' }} </div>
<div class="text-60px leading mt-[-4px] bg-text"> {{ selItem.giftName }} </div> <div class="text-60px leading mt-[-4px] bg-text"> {{ selItem.giftName }} </div>
<div class="text-30px leading bg-text"> {{ isSuccess ? '' : selItem.activityRules }} </div> <!-- <div class="text-30px leading bg-text"> {{ isSuccess ? '' : selItem.activityRules }} </div> -->
<div class="text-30px leading bg-text"> 礼品发放以线下库存为准 先到先得 </div>
</div> </div>
<div <div
v-if="iptShow" v-if="iptShow"
@click.stop @click.stop
class="absolute box-border right-[84px] top-[380px] h-76px w-415px rounded-10px bg-#FADDC0 overflow-hidden" class="absolute box-border right-[80px] top-[380px] h-76px w-415px rounded-10px bg-#FADDC0 overflow-hidden"
> >
<nut-input <nut-input
ref="iptRef" ref="iptRef"
@ -136,7 +137,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, nextTick, watch, onMounted } from 'vue'; import { ref, nextTick, watch } from 'vue';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { handleWxRedict, getQueryString } from '@/utils/util'; import { handleWxRedict, getQueryString } from '@/utils/util';
import shareWechat from '@/utils/wxH5Share'; import shareWechat from '@/utils/wxH5Share';
@ -195,11 +196,13 @@
const handleClick = async (item: any) => { const handleClick = async (item: any) => {
if (!token.value) return (location.href = handleWxRedict()); if (!token.value) return (location.href = handleWxRedict());
// 001Mol1000Yj4R1raU100kCKRM0Mol1G // state truefalse
if (selId.value) { if (item.state) {
selId.value = item.id;
selItem.value = item; selItem.value = item;
show.value = true; show.value = true;
isSuccess.value = false; isSuccess.value = false;
iptShow.value = true;
return; return;
} }
const { result, code } = await queryCouponLog({ id: item.id, openId: userInfo.value.openid }); const { result, code } = await queryCouponLog({ id: item.id, openId: userInfo.value.openid });
@ -225,7 +228,7 @@
duration: 1000, duration: 1000,
}); });
try { try {
const req = { id: selId.value, checkCode: checkCode.value, openId: userInfo.value.openid }; const req = { id: selItem.value.id, checkCode: checkCode.value, openId: userInfo.value.openid };
const { code } = await queryVerification(req); const { code } = await queryVerification(req);
if (code === 200) { if (code === 200) {
checkCode.value = ''; checkCode.value = '';
@ -247,14 +250,15 @@
}); });
}; };
const handleShareWechat = async () => { const handleShareWechat = () => {
// if (token.value) { // if (token.value) {
shareWechat( return shareWechat(
'tit', 'SWFC寻味环球 共飨美馔',
'content', '',
`${window.location.origin}}`, `${window.location.origin}`,
'https://img10.360buyimg.com/ling/jfs/t1/181258/24/10385/53029/60d04978Ef21f2d42/92baeb21f907cd24.jpg', 'https://huanqiuzhongxin.oss-cn-shanghai.aliyuncs.com/shipin/logo.png',
); );
// window.location.origin
// } else location.href = handleWxRedict(); // } else location.href = handleWxRedict();
}; };
@ -289,21 +293,21 @@
userInfo.value = JSON.parse(user); userInfo.value = JSON.parse(user);
} }
} }
getCoupon();
}; };
getCoupon();
init(); init();
onMounted(async () => {
handleShareWechat(); handleShareWechat();
});
watch(show, (val) => { watch(show, (val) => {
if (val) { if (val) {
checkCode.value = ''; checkCode.value = '';
} else { } else {
getCoupon(); getCoupon()
setTimeout(() => {
selId.value && (iptShow.value = true); selId.value && (iptShow.value = true);
},200)
} }
}); });
</script> </script>
@ -346,6 +350,7 @@
} }
.nut-input-box input { .nut-input-box input {
color: #000; color: #000;
padding-left: 14px;
} }
} }
</style> </style>