Compare commits
26 Commits
3adbe7dfff
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e195570435 | ||
|
|
f9a8716262 | ||
|
|
b86d973303 | ||
|
|
6d631e9883 | ||
|
|
b3b6ca0bfb | ||
|
|
1b30ced5cf | ||
|
|
75d73ad086 | ||
|
|
f540bb6898 | ||
|
|
783c8a0322 | ||
|
|
d24041a04a | ||
|
|
20fc5f5f85 | ||
|
|
7af856992f | ||
|
|
b03849d8a1 | ||
|
|
014196ffa0 | ||
|
|
2ee6172498 | ||
|
|
1a8a9d9fd4 | ||
|
|
795ec1d267 | ||
|
|
5d118abf40 | ||
|
|
493ad9c2df | ||
|
|
0ca1bc5ec7 | ||
|
|
b0d2c9ed1a | ||
|
|
c402cbc74c | ||
|
|
a9f8371d0a | ||
|
|
414d2ae8b0 | ||
|
|
90558bb56b | ||
|
|
5ba3ea7560 |
@@ -71,7 +71,8 @@
|
||||
background: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='80px' height='80px' viewBox='0 0 80 80' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3Eloading%3C/title%3E%3Cdefs%3E%3ClinearGradient x1='94.0869141%25' y1='0%25' x2='94.0869141%25' y2='90.559082%25' id='linearGradient-1'%3E%3Cstop stop-color='%23ededed' stop-opacity='0' offset='0%25'%3E%3C/stop%3E%3Cstop stop-color='%23ededed' stop-opacity='0.3' offset='100%25'%3E%3C/stop%3E%3C/linearGradient%3E%3ClinearGradient x1='100%25' y1='8.67370605%25' x2='100%25' y2='90.6286621%25' id='linearGradient-2'%3E%3Cstop stop-color='%23ededed' offset='0%25'%3E%3C/stop%3E%3Cstop stop-color='%23ededed' stop-opacity='0.3' offset='100%25'%3E%3C/stop%3E%3C/linearGradient%3E%3C/defs%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' opacity='0.9'%3E%3Cg%3E%3Cpath d='M40,0 C62.09139,0 80,17.90861 80,40 C80,62.09139 62.09139,80 40,80 L40,73 C58.2253967,73 73,58.2253967 73,40 C73,21.7746033 58.2253967,7 40,7 L40,0 Z' fill='url(%23linearGradient-1)'%3E%3C/path%3E%3Cpath d='M40,0 L40,7 C21.7746033,7 7,21.7746033 7,40 C7,58.2253967 21.7746033,73 40,73 L40,80 C17.90861,80 0,62.09139 0,40 C0,17.90861 17.90861,0 40,0 Z' fill='url(%23linearGradient-2)'%3E%3C/path%3E%3Ccircle id='Oval' fill='%23ededed' cx='40.5' cy='3.5' r='3.5'%3E%3C/circle%3E%3C/g%3E%3CanimateTransform attributeName='transform' begin='0s' dur='1s' type='rotate' values='0 40 40;360 40 40' repeatCount='indefinite'/%3E%3C/g%3E%3C/svg%3E%0A") no-repeat center center;
|
||||
background-size: 10% 10%;
|
||||
}
|
||||
.preload{
|
||||
|
||||
.preload {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
@@ -144,7 +145,7 @@
|
||||
var _hmt = _hmt || [];
|
||||
(function () {
|
||||
var hm = document.createElement("script");
|
||||
hm.src = "https://hm.baidu.com/hm.js?71eeb5d8fcd3c242670077b6398b3a0d";
|
||||
hm.src = "https://hm.baidu.com/hm.js?eea1d73562644a65f05fa3b1c04c3894";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
})();
|
||||
|
||||
|
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 24 KiB |
BIN
src/assets/images/USER_LZ_DZ_JBGJ.webp
Normal file
|
After Width: | Height: | Size: 45 KiB |
BIN
src/assets/images/USER_LZ_DZ_JBGJ_LZ_ZQ_DZJ.webp
Normal file
|
After Width: | Height: | Size: 45 KiB |
BIN
src/assets/images/USER_LZ_XS_SPZ_30ML.webp
Normal file
|
After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 125 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 102 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 251 KiB After Width: | Height: | Size: 296 KiB |
BIN
src/assets/images/generate/USER_DZSKSJ.webp
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
src/assets/images/generate/USER_LZ_DZ_JBGJ_LZ_ZQ_DZJ.webp
Normal file
|
After Width: | Height: | Size: 46 KiB |
BIN
src/assets/images/generate/USER_LZ_XS_SPZ_30ML.webp
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
src/assets/images/generate/USER_LZ_ZQ_DZJ.webp
Normal file
|
After Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 87 KiB |
|
Before Width: | Height: | Size: 119 KiB After Width: | Height: | Size: 118 KiB |
BIN
src/assets/images/home-title.webp
Normal file
|
After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 13 KiB |
BIN
src/assets/images/processing.webp
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
src/assets/images/rule-1.webp
Normal file
|
After Width: | Height: | Size: 259 KiB |
BIN
src/assets/images/rule-2.webp
Normal file
|
After Width: | Height: | Size: 390 KiB |
BIN
src/assets/images/rule-3.webp
Normal file
|
After Width: | Height: | Size: 398 KiB |
BIN
src/assets/images/rule-4.webp
Normal file
|
After Width: | Height: | Size: 355 KiB |
BIN
src/assets/images/rule-5.webp
Normal file
|
After Width: | Height: | Size: 335 KiB |
@@ -10,7 +10,7 @@
|
||||
<script setup>
|
||||
import ModalTransition from "./ModalTransition.vue"
|
||||
import { ref } from "vue"
|
||||
import { isWeixinPlatform, miniJumpToScene, getMiniPageBtnHack } from "../libs/utils"
|
||||
import { isWeixinPlatform, miniJumpToActive, getMiniPageBtnHack } from "../libs/utils"
|
||||
const props = defineProps({
|
||||
show: false,
|
||||
})
|
||||
@@ -21,12 +21,14 @@ adHtml.value = getMiniPageBtnHack("/pages/retail-act/landing-page/ordinary?id=89
|
||||
const adGoto = () => {
|
||||
if (!isWeixinPlatform()) {
|
||||
weui.alert("请前往「泸州老窖会员中心」小程序进行查询")
|
||||
}else{
|
||||
miniJumpToActive()
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
<style>
|
||||
.ad-wrapper {
|
||||
position: relative;
|
||||
width: 100vw;
|
||||
@@ -48,7 +50,13 @@ const adGoto = () => {
|
||||
background-size: 100%;
|
||||
}
|
||||
|
||||
.close {
|
||||
.btn-ad wx-open-launch-weapp#launch-btn{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
.ad .close {
|
||||
position: absolute;
|
||||
width: 8.148148vw;
|
||||
height: 8.148148vw;
|
||||
|
||||
@@ -157,8 +157,20 @@ const clearUploadFile = (index) => {
|
||||
if (uploadRefs.value[index]) {
|
||||
uploadRefs.value[index].clearFiles();
|
||||
uploadItems.value[index].imageUrl = '';
|
||||
|
||||
uploadedFiles.splice(index, 1);
|
||||
// 获取 templateFaceID
|
||||
const ids = getTemplateIdsFromUrl(
|
||||
uploadedFiles[index]?.templateIds,
|
||||
globalStore.select_template,
|
||||
index
|
||||
);
|
||||
if (!ids || !ids.templateFaceID) return;
|
||||
// 通过 templateFaceID 定位并删除
|
||||
const removeIdx = uploadedFiles.findIndex(
|
||||
file => file.templateIds?.templateFaceID === ids.templateFaceID
|
||||
);
|
||||
if (removeIdx !== -1) {
|
||||
uploadedFiles.splice(removeIdx, 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup>
|
||||
import { ref, computed, watch, onMounted } from "vue"
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
import faceFamily from "../assets/audio/faceFamily.mp3"
|
||||
import bgm from "../assets/audio/bgm.mp3"
|
||||
import backgroundVideo from "../assets/video/1_stab_chf3_rhea1.mp4"
|
||||
import MyPhoto from './MyPhoto.vue'
|
||||
import PhotoSquare from './PhotoSquare.vue'
|
||||
@@ -22,11 +22,12 @@ const videoLoaded = ref(false);
|
||||
const videoError = ref(false);
|
||||
const lotteryShow = ref(false)
|
||||
const lotteryType = ref("draw")
|
||||
const lotteryNoticeData = ref(null)
|
||||
|
||||
// 初始化全局音频实例
|
||||
const initGlobalAudio = () => {
|
||||
if (!globalStore.globalAudio) {
|
||||
globalStore.globalAudio = new Audio(faceFamily);
|
||||
globalStore.globalAudio = new Audio(bgm);
|
||||
globalStore.globalAudio.loop = true; // 设置循环播放
|
||||
globalStore.globalAudio.preload = 'auto';
|
||||
|
||||
@@ -98,6 +99,9 @@ const checkAndPlayAudio = () => {
|
||||
|
||||
// 初始化视频
|
||||
const initVideo = () => {
|
||||
document.addEventListener('WeixinJSBridgeReady',()=>{
|
||||
videoElement.value && videoElement.value.play()
|
||||
})
|
||||
setTimeout(() => {
|
||||
if (videoElement.value) {
|
||||
const video = videoElement.value;
|
||||
@@ -228,13 +232,15 @@ const handleLottery = () => {
|
||||
if (globalStore.draw_chances <= 0) {
|
||||
return weui.alert("还没有抽奖机会,快去参加活动吧")
|
||||
};
|
||||
lotteryType.value = 'draw'
|
||||
lotteryNoticeData.value = null
|
||||
globalToastEvent.emit(ToastType.SHOW_LOTTERY)
|
||||
|
||||
}
|
||||
|
||||
const router = useRouter();
|
||||
const navigateSelectTemplatePage = () => {
|
||||
if (globalStore.game_chances <= 0) return;
|
||||
if (globalStore.game_chances <= 0) return weui.alert('去做任务获得更多参与次数吧');
|
||||
globalStore.reducerGameChances();
|
||||
router.push({
|
||||
name: 'selectTemplateV2'
|
||||
@@ -307,12 +313,20 @@ const initUserGameInfos = async (refresh_official, refresh_cap_scan) => {
|
||||
globalToastEvent.emit(ToastType.MOUNTED)
|
||||
}
|
||||
}
|
||||
|
||||
const getNotice = async () => {
|
||||
const result = await Request('notice/latest', {}, "GET")
|
||||
if (result.json.notification) {
|
||||
lotteryType.value = 'notice'
|
||||
lotteryNoticeData.value = result.json.notification
|
||||
lotteryShow.value = true
|
||||
}
|
||||
}
|
||||
const handleLoginSuccess = async () => {
|
||||
console.log("已登录")
|
||||
loginShow.value = false
|
||||
|
||||
await initUserGameInfos(true, true)
|
||||
await getNotice()
|
||||
}
|
||||
|
||||
if (isLogin()) {
|
||||
@@ -334,14 +348,23 @@ watch(() => mergeId, async (newVal) => {
|
||||
}
|
||||
}, { immediate: true })
|
||||
|
||||
globalToastEvent.on(ToastType.SHOW_LOTTERY, () => {
|
||||
globalToastEvent.on(ToastType.SHOW_LOTTERY, async () => {
|
||||
// await initUserGameInfos(false, false);
|
||||
lotteryShow.value = true
|
||||
})
|
||||
globalToastEvent.on(ToastType.INFO_UPDATE, async () => {
|
||||
initUserGameInfos(false, false)
|
||||
})
|
||||
|
||||
watch(() => lotteryShow.value, async (newVal) => {
|
||||
initUserGameInfos(true, true);
|
||||
}, { immediate: true })
|
||||
|
||||
import Popup from './Popup.vue'
|
||||
const isPopupVisible = ref(false);
|
||||
const navigatePopupPage = () => {
|
||||
isPopupVisible.value = true;
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -362,6 +385,10 @@ watch(() => lotteryShow.value, async (newVal) => {
|
||||
<img src="../assets/images/slogan.webp" alt="slogan">
|
||||
</div>
|
||||
|
||||
<div class="scene-item home-title">
|
||||
<img src="../assets/images/home-title.webp" alt="slogan">
|
||||
</div>
|
||||
|
||||
<!-- fallback 背景图,当视频无法加载时显示 -->
|
||||
<div v-if="videoError || !videoLoaded" class="fallback-background"></div>
|
||||
|
||||
@@ -371,8 +398,7 @@ watch(() => lotteryShow.value, async (newVal) => {
|
||||
<p class="lottery-value">{{ globalStore.draw_chances }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="scene-item item-2" @click="navigateSelectTemplatePage"
|
||||
:class="{ 'disabled': globalStore.game_chances <= 0 }">
|
||||
<div class="scene-item item-2" @click="navigatePopupPage">
|
||||
<img src="../assets/images/join.webp" alt="立即参与">
|
||||
<div class="join-main">
|
||||
<p class="join-value">{{ globalStore.game_chances }}</p>
|
||||
@@ -408,7 +434,8 @@ watch(() => lotteryShow.value, async (newVal) => {
|
||||
<MyPhoto @go-photo-square="showPhotoSquare" v-model:show="isMyPhotoVisible" />
|
||||
<PhotoSquare @go-my-photo="showMyPhoto" v-model:show="isPhotoSquareVisible" />
|
||||
<Login :show="loginShow" @login-success="handleLoginSuccess" />
|
||||
<Lottery :show="lotteryShow" @close="lotteryShow = false" :type="lotteryType"></Lottery>
|
||||
<Lottery :show="lotteryShow" @close="lotteryShow = false" :type="lotteryType" :data="lotteryNoticeData"></Lottery>
|
||||
<Popup v-model:show="isPopupVisible" />
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
@@ -423,6 +450,11 @@ watch(() => lotteryShow.value, async (newVal) => {
|
||||
width: 76vw;
|
||||
}
|
||||
|
||||
.home-title {
|
||||
width: 72vw;
|
||||
top: 144vw;
|
||||
}
|
||||
|
||||
.main {
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
|
||||
@@ -8,12 +8,15 @@
|
||||
<div class="lottery-prize">
|
||||
<div class="lottery-title" :class="props.type === 'notice' && 'notice'" ref="titleRef"
|
||||
v-show="activePrizeData.prize_code !== 'NO'"></div>
|
||||
<div class="lottery-desc" v-show="props.type === 'notice'">在刚刚结束的打榜活动中成功斩获<br /><strong>第[30]名</strong></div>
|
||||
<div class="lottery-desc" v-show="props.type === 'notice'">
|
||||
在刚刚结束的打榜活动中成功斩获<br /><strong>第[{{ activePrizeData.rank }}]名</strong>
|
||||
</div>
|
||||
<div class="lottery-image" :class="'USER_' + activePrizeData.prize_code" ref="lotteryImageRef"></div>
|
||||
<div class="lottery-name" v-show="activePrizeData.prize_code !== 'NO'">{{ activePrizeData.name }}</div>
|
||||
<div class="lottery-name" v-show="activePrizeData.prize_code !== 'NO'">{{ activePrizeData.prize_name }}
|
||||
</div>
|
||||
<div class="lottery-btngroup" v-show="btngroupShow">
|
||||
<div class="btn-more" @click="handleBtnMore"></div>
|
||||
<div class="btn-kaixin" @click="handleLotteryAction"></div>
|
||||
<div class="btn-kaixin" @click="handleLotteryAction" v-if="activePrizeData.prize_code !== 'NO'"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -46,7 +49,8 @@ const btngroupShow = ref(false)
|
||||
gsap.registerPlugin()
|
||||
const props = defineProps({
|
||||
show: false,
|
||||
type: "draw"
|
||||
type: "draw",
|
||||
data: null
|
||||
})
|
||||
const emit = defineEmits(['close'])
|
||||
|
||||
@@ -63,9 +67,15 @@ const handleBtnMore = () => {
|
||||
closeThis()
|
||||
globalToastEvent.emit(ToastType.SHOW_AD)
|
||||
}
|
||||
const handleLotteryAction = () => {
|
||||
const readNotice = async () => {
|
||||
await Request(`notice/read`, { id: activePrizeData.value.noticeId })
|
||||
}
|
||||
const handleLotteryAction = async () => {
|
||||
//实物
|
||||
closeThis()
|
||||
if (props.type !== 'draw') {
|
||||
await readNotice()
|
||||
}
|
||||
if (activePrizeData.value.coupon_type === 'scene') {
|
||||
globalToastEvent.emit(ToastType.SHOW_ADDRESS, activePrizeData.value.id)
|
||||
}
|
||||
@@ -108,9 +118,33 @@ watch(() => props.show, async (newVal) => {
|
||||
|
||||
const loading = weui.loading()
|
||||
let lottteryResult = null
|
||||
|
||||
if (props.type === 'draw') {
|
||||
// lottteryResult = await Request("lottery/draw", { pool: 'game', consume_type: 'points' })
|
||||
lottteryResult = await Request("lottery/draw", { pool: 'game', consume_type: 'points' })
|
||||
// 监听请求失败,关闭组件
|
||||
if (!lottteryResult || !lottteryResult.res || (lottteryResult.res.status !== 200 && lottteryResult.res.status !== 201)) {
|
||||
emit('close')
|
||||
loading.hide()
|
||||
return
|
||||
}
|
||||
} else {
|
||||
if (!props.data) {
|
||||
weui.alert("获取排名奖励出错,请刷新页面重试")
|
||||
emit('close')
|
||||
loading.hide()
|
||||
return
|
||||
}
|
||||
|
||||
lottteryResult = {
|
||||
res: { status: 200 },
|
||||
json: {
|
||||
noticeId: props.data.id,
|
||||
id: props.data.data.prize.id,
|
||||
prize_code: props.data.data.prize.prize_code,
|
||||
prize_name: props.data.data.prize.name,
|
||||
coupon_type: props.data.data.prize.scene,
|
||||
rank: props.data.data.rank
|
||||
}
|
||||
}
|
||||
}
|
||||
// const userPicture = await getUserPicture()
|
||||
|
||||
@@ -128,18 +162,17 @@ watch(() => props.show, async (newVal) => {
|
||||
// await Sleep(20000)
|
||||
|
||||
|
||||
// const lottteryResult = await Request("lottery/draw", { pool: 'game', consume_type: 'points' })
|
||||
// TODO: 测试数据
|
||||
lottteryResult = {
|
||||
res: { status: 200 },
|
||||
json: {
|
||||
id: 0,
|
||||
code: "LZ_ZQ_DZJ",
|
||||
prize_code: 'LZ_ZQ_DZJ',
|
||||
coupon_type: "scene",
|
||||
name: "泸州老窖的一瓶酒"
|
||||
}
|
||||
}
|
||||
// lottteryResult = {
|
||||
// res: { status: 200 },
|
||||
// json: {
|
||||
// id: 0,
|
||||
// code: "xxx",
|
||||
// prize_code: 'xxx',
|
||||
// coupon_type: "scene",
|
||||
// name: "泸州老窖的一瓶酒"
|
||||
// }
|
||||
// }
|
||||
|
||||
loading.hide()
|
||||
|
||||
@@ -239,6 +272,8 @@ onUnmounted(() => {
|
||||
}
|
||||
|
||||
.lottery-image.USER_NO {
|
||||
background-size: 60% auto;
|
||||
background-position: center center;
|
||||
background-image: url("../assets/images/USER_NO.webp");
|
||||
}
|
||||
|
||||
@@ -246,6 +281,14 @@ onUnmounted(() => {
|
||||
background-image: url("../assets/images/USER_LZ_XS_SPZ_30ML.webp");
|
||||
}
|
||||
|
||||
.lottery-image.USER_LZ_DZ_JBGJ {
|
||||
background-image: url("../assets/images/USER_LZ_DZ_JBGJ.webp");
|
||||
}
|
||||
|
||||
.lottery-image.USER_LZ_DZ_JBGJ_LZ_ZQ_DZJ {
|
||||
background-image: url("../assets/images/USER_LZ_DZ_JBGJ_LZ_ZQ_DZJ.webp");
|
||||
}
|
||||
|
||||
.guang,
|
||||
.guangyun {
|
||||
position: absolute;
|
||||
@@ -310,8 +353,12 @@ onUnmounted(() => {
|
||||
position: absolute;
|
||||
bottom: 18vw;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
font-size: 6vw;
|
||||
width: 80%;
|
||||
left: 10%;
|
||||
font-size: 4.3vw;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
font-weight: 700;
|
||||
color: rgb(255, 255, 255);
|
||||
text-shadow:
|
||||
@@ -327,7 +374,7 @@ onUnmounted(() => {
|
||||
bottom: -24vw;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
justify-content: space-evenly;
|
||||
}
|
||||
|
||||
.btn-more {
|
||||
|
||||
@@ -35,8 +35,8 @@ const fetchImages = async () => {
|
||||
})
|
||||
const data = await response.json()
|
||||
if (response.status == 200 || response.status == 201) {
|
||||
// 只保留result_url存在的记录
|
||||
images.value = data.data.filter(item => item.result_url);
|
||||
// 只保留 status=processing 或 result_url 不为空的记录
|
||||
images.value = data.data.filter(item => item.status === 'processing' || item.result_url);
|
||||
// 测试数据
|
||||
// images.value = [
|
||||
// {
|
||||
@@ -165,7 +165,9 @@ const downloadGenerateImg = (item) => {
|
||||
import haibaoCoverBorderNoTitle from "../assets/images/haibao-cover-no-title.webp"
|
||||
import haibaoCoverBorderSuccess from "../assets/images/haibao-cover-sucess.webp";
|
||||
import failedImg from '../assets/images/failed.webp';
|
||||
import processingImg from '../assets/images/processing.webp';
|
||||
const getGenerateImgStatus = async (item) => {
|
||||
const loading = weui.loading()
|
||||
fetch(`https://huodong2.lzlj.com/api/faceFamily/face/merge/${item.id}/status`, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
@@ -174,6 +176,7 @@ const getGenerateImgStatus = async (item) => {
|
||||
})
|
||||
.then(async response => {
|
||||
const data = await response.json()
|
||||
loading.hide();
|
||||
if (response.status == 200 || response.status == 201) {
|
||||
if (data.status = 'failed') {
|
||||
item.result_url = failedImg;
|
||||
@@ -185,6 +188,7 @@ const getGenerateImgStatus = async (item) => {
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
loading.hide();
|
||||
ElMessage.error('获取状态失败!');
|
||||
});
|
||||
}
|
||||
@@ -193,7 +197,7 @@ const getBackgroundImage = (item) => {
|
||||
if (item.result_url) {
|
||||
return `${item.result_url}?x-oss-process=image/resize,w_400/format,webp/quality,q_80`;
|
||||
} else {
|
||||
return item.result_url = failedImg;
|
||||
return item.result_url = processing;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -243,7 +247,7 @@ const handleHaibao = async (item) => {
|
||||
const qrcode = await generateQR(`fromid=${infos.invite_code}&merge_id=${globalStore.mergeId}`, 200, 200)
|
||||
haibaoSave.add(bg, 0, 0)
|
||||
haibaoSave.add(url, 64, 250)
|
||||
haibaoSave.add(qrcode, 115, 1875)
|
||||
haibaoSave.add(qrcode, 127, 1860)
|
||||
haibaoSave.draw().then(() => {
|
||||
haibaoSave.text(infos.nickname + '的全家福', haibaoSave.canvas.width / 2, 200, { font: 'bold 50px Arial', color: '#fcf2b3' })
|
||||
haibaoSave.generate({ mimeType: 'image/png' }).then(url => {
|
||||
@@ -289,7 +293,7 @@ const handleHaibao = async (item) => {
|
||||
const qrcode = await generateQR(`fromid=${infos.invite_code}&merge_id=${globalStore.mergeId}`, 200, 200)
|
||||
haibaoSaveNoTitle.add(bg, 0, 0)
|
||||
haibaoSaveNoTitle.add(url, 64, 250)
|
||||
haibaoSaveNoTitle.add(qrcode, 115, 1875)
|
||||
haibaoSaveNoTitle.add(qrcode, 127, 1860)
|
||||
haibaoSaveNoTitle.draw().then(() => {
|
||||
haibaoSaveNoTitle.text(infos.nickname + '的全家福', haibaoSaveNoTitle.canvas.width / 2, 200, { font: 'bold 50px Arial', color: '#fcf2b3' })
|
||||
haibaoSaveNoTitle.generate({ mimeType: 'image/png' }).then(url => {
|
||||
@@ -373,13 +377,13 @@ const getBorder = (item, index) => {
|
||||
<div v-for="(item, index) in images" :key="index" class="image-wrapper">
|
||||
<div class="image-container mask-background" @click="downloadGenerateImg(item)" :style="{ backgroundImage: `url(${getBackgroundImage(item)})` }">
|
||||
</div>
|
||||
<img v-if="item.status === 'progressing'" @click="getGenerateImgStatus(item)"
|
||||
<img v-if="item.status === 'processing'" @click.stop="getGenerateImgStatus(item)"
|
||||
src="../assets/images/refresh-btn.webp" class="refresh-btn" alt="刷新">
|
||||
<img :src="getBorder(item, index)" class="border-image" alt="border"
|
||||
@click.stop="downloadGenerateImg(item)"
|
||||
/>
|
||||
<div class="mask-overlay"
|
||||
@click="(!globalStore.chartsBattle && item.result_url !== failedImg) && toggleBorder(item, index)"></div>
|
||||
@click="(!globalStore.chartsBattle && item.result_url !== processingImg) && toggleBorder(item, index)"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="scene-item item-2">
|
||||
@@ -485,6 +489,7 @@ const getBorder = (item, index) => {
|
||||
top: 7vw;
|
||||
right: 3vw;
|
||||
cursor: pointer;
|
||||
z-index: 13;
|
||||
}
|
||||
|
||||
.image-wrapper {
|
||||
@@ -521,7 +526,7 @@ const getBorder = (item, index) => {
|
||||
top: 0;
|
||||
margin-bottom: 3vw;
|
||||
background-image: url('../assets/images/test.webp');
|
||||
background-size: 100%;
|
||||
background-size: cover;
|
||||
background-repeat: no-repeat;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
@@ -47,13 +47,13 @@ const fetchImages = async () => {
|
||||
images.value = data.data
|
||||
if (data.my_published_photo) {
|
||||
displayMyPublishPhoto.value = true;
|
||||
} else {
|
||||
displayMyPublishPhoto.value = false;
|
||||
}
|
||||
username.value = data.my_published_photo.user_name;
|
||||
likesCount.value = data.my_published_photo.likes_count;
|
||||
userImg.value = data.my_published_photo.avatar;
|
||||
ranking.value = data.my_published_photo.ranking;
|
||||
} else {
|
||||
displayMyPublishPhoto.value = false;
|
||||
}
|
||||
} else {
|
||||
ElMessage.error(data.message);
|
||||
emit('update:show', false);
|
||||
@@ -70,8 +70,66 @@ watch(() => props.show, async (newVal) => {
|
||||
fetchImages();
|
||||
}, {immediate: true})
|
||||
|
||||
// 图片数据
|
||||
// 图片数据与分页
|
||||
const images = ref([]);
|
||||
const page = ref(1);
|
||||
const perPage = 20;
|
||||
const loading = ref(false);
|
||||
const finished = ref(false);
|
||||
|
||||
const loadMoreImages = async () => {
|
||||
if (loading.value || finished.value) return;
|
||||
loading.value = true;
|
||||
try {
|
||||
const url = new URL('https://huodong2.lzlj.com/api/faceFamily/face/square');
|
||||
url.searchParams.append('my_only', '0');
|
||||
url.searchParams.append('page', page.value);
|
||||
url.searchParams.append('per_page', perPage);
|
||||
const response = await fetch(url.toString(), {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Authorization': `Bearer ${Storage.get("userinfos").api_token}`
|
||||
}
|
||||
});
|
||||
const data = await response.json();
|
||||
if (response.status == 200 || response.status == 201) {
|
||||
if (data.data.length < perPage) finished.value = true;
|
||||
images.value.push(...data.data);
|
||||
page.value++;
|
||||
if (data.my_published_photo) {
|
||||
displayMyPublishPhoto.value = true;
|
||||
username.value = data.my_published_photo.user_name;
|
||||
likesCount.value = data.my_published_photo.likes_count;
|
||||
userImg.value = data.my_published_photo.avatar;
|
||||
ranking.value = data.my_published_photo.ranking;
|
||||
} else {
|
||||
displayMyPublishPhoto.value = false;
|
||||
}
|
||||
} else {
|
||||
ElMessage.error(data.message);
|
||||
emit('update:show', false);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error:', error);
|
||||
}
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
const handleScroll = (e) => {
|
||||
const el = e.target;
|
||||
if (el.scrollHeight - el.scrollTop - el.clientHeight < 100) {
|
||||
loadMoreImages();
|
||||
}
|
||||
};
|
||||
|
||||
watch(() => props.show, async (newVal) => {
|
||||
if (!newVal) return;
|
||||
// 重置分页
|
||||
images.value = [];
|
||||
page.value = 1;
|
||||
finished.value = false;
|
||||
await loadMoreImages();
|
||||
}, {immediate: true});
|
||||
const userinfos = Storage.get("userinfos")
|
||||
|
||||
let mergeId = '';
|
||||
@@ -190,16 +248,13 @@ const getBackgroundImage = (item) => {
|
||||
}"
|
||||
@click.stop="$emit('go-my-photo')">
|
||||
</div>
|
||||
<p class="my-photo-desc">打榜活动截止至9月30日晚24点结束,中奖信息将于10月1日早10点推送至获奖会员。</p>
|
||||
<div v-if="!disableInviteHelp" class="image-gallery ">
|
||||
<RecycleScroller
|
||||
class="scroller"
|
||||
:items="images"
|
||||
:item-size="1"
|
||||
key-field="id"
|
||||
v-slot="{ item, index }"
|
||||
<p class="my-photo-desc">打榜活动截止至10月3日23:59:59结束,中奖信息将于10月4日早10点推送至获奖会员。</p>
|
||||
<div v-if="!disableInviteHelp" class="image-gallery scroller" @scroll="handleScroll">
|
||||
<div
|
||||
v-for="(item, index) in images"
|
||||
:key="item.id || index"
|
||||
class="image-wrapper"
|
||||
>
|
||||
<div class="image-wrapper">
|
||||
<div class="image-container mask-background"
|
||||
:style="{ backgroundImage: `url(${getBackgroundImage(item)})` }">
|
||||
</div>
|
||||
@@ -216,27 +271,8 @@ const getBackgroundImage = (item) => {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</RecycleScroller>
|
||||
<!-- <div
|
||||
v-for="(item, index) in images"
|
||||
:key="index"
|
||||
class="image-wrapper"
|
||||
>
|
||||
<div class="image-container mask-background">
|
||||
</div>
|
||||
<img
|
||||
src="../assets/images/zpgc-border.webp"
|
||||
class="border-image"
|
||||
alt="border"
|
||||
/>
|
||||
<div class="flex-container-detail">
|
||||
<div class="left-group">
|
||||
<p class="photo-number">{{ (index + 1).toString().padStart(3, '0') }}</p>
|
||||
<p class="photo-name">{{ item.user_name }}</p>
|
||||
</div>
|
||||
<p class="right-item photo-name" style="padding-left: 3vw;">{{ item.likes_count }}赞</p>
|
||||
</div>
|
||||
</div> -->
|
||||
<div v-if="loading" style="text-align:center;padding:10px;color:#999;">加载中...</div>
|
||||
<div v-if="finished && images.length === 0" style="text-align:center;padding:10px;color:#999;">暂无数据</div>
|
||||
</div>
|
||||
<div v-if="!disableInviteHelp && displayMyPublishPhoto" class="fixed-background-container">
|
||||
<div class="flex-container">
|
||||
@@ -420,7 +456,7 @@ const getBackgroundImage = (item) => {
|
||||
}
|
||||
|
||||
.left-group p, .right-item {
|
||||
padding-left: 2vw;
|
||||
padding-left: 0.3vw;
|
||||
margin-left: auto;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
@@ -52,12 +52,12 @@ const confirmBtn = () => {
|
||||
<div class="home-bg">
|
||||
<div class="popup-bg">
|
||||
<div class="scene-item item-1">
|
||||
<img src="../assets/images/confirm.webp" @click="confirmBtn" alt="确认">
|
||||
<img src="../assets/images/confirm.webp" @click="cancelBtn" alt="确认">
|
||||
</div>
|
||||
<p class="message">温馨提示:每位用户只能选择一张合影参与打榜,一经确认,在打榜期间将无法更换。</p>
|
||||
<div class="scene-item item-2">
|
||||
<p class="message">活动已结束</p>
|
||||
<!-- <div class="scene-item item-2">
|
||||
<img src="../assets/images/cancel.webp" @click="cancelBtn" alt="取消">
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</ModalTransition>
|
||||
@@ -74,6 +74,7 @@ const confirmBtn = () => {
|
||||
position: absolute;
|
||||
top: 42%;
|
||||
color: #774107;
|
||||
text-align: center;
|
||||
}
|
||||
.popup-bg {
|
||||
width: 77vw;
|
||||
@@ -112,7 +113,6 @@ const confirmBtn = () => {
|
||||
.item-1 {
|
||||
top: 50vw;
|
||||
width: 40vw;
|
||||
right: 0;
|
||||
}
|
||||
.item-2 {
|
||||
top: 50vw;
|
||||
|
||||
@@ -158,7 +158,7 @@ wx-open-launch-weapp,
|
||||
}
|
||||
|
||||
.prizelist-cover.USER_LZ_ZQ_DZJ {
|
||||
background-image: url("../assets/images/USER_LZ_ZQ_DZJ.webp");
|
||||
background-image: url("../assets/images/generate/USER_LZ_ZQ_DZJ.webp");
|
||||
}
|
||||
|
||||
.prizelist-cover.USER_HG_42_GPJ_500ML {
|
||||
@@ -170,7 +170,7 @@ wx-open-launch-weapp,
|
||||
}
|
||||
|
||||
.prizelist-cover.USER_DZSKSJ {
|
||||
background-image: url("../assets/images/USER_DZSKSJ.webp");
|
||||
background-image: url("../assets/images/generate/USER_DZSKSJ.webp");
|
||||
}
|
||||
|
||||
.prizelist-cover.USER_LZ_ZQ_DZJ_LJW {
|
||||
@@ -178,7 +178,15 @@ wx-open-launch-weapp,
|
||||
}
|
||||
|
||||
.prizelist-cover.USER_LZ_XS_SPZ_30ML {
|
||||
background-image: url("../assets/images/USER_LZ_XS_SPZ_30ML.webp");
|
||||
background-image: url("../assets/images/generate/USER_LZ_XS_SPZ_30ML.webp");
|
||||
}
|
||||
|
||||
.prizelist-cover.USER_LZ_DZ_JBGJ {
|
||||
background-image: url("../assets/images/USER_LZ_DZ_JBGJ.webp");
|
||||
}
|
||||
|
||||
.prizelist-cover.USER_LZ_DZ_JBGJ_LZ_ZQ_DZJ {
|
||||
background-image: url("../assets/images/generate/USER_LZ_DZ_JBGJ_LZ_ZQ_DZJ.webp");
|
||||
}
|
||||
|
||||
.prizelist-cover.USER_DZCZ {
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
<ModalTransition class="rule" :show="show">
|
||||
<div class="rule-wrapper">
|
||||
<div class="rule-content">
|
||||
<!-- <img src="../assets/images/rule-1.webp" alt="">
|
||||
<img src="../assets/images/rule-1.webp" alt="">
|
||||
<img src="../assets/images/rule-2.webp" alt="">
|
||||
<img src="../assets/images/rule-3.webp" alt="">
|
||||
<img src="../assets/images/rule-4.webp" alt="">
|
||||
<img src="../assets/images/rule-5.webp" alt=""> -->
|
||||
<img src="../assets/images/rule-5.webp" alt="">
|
||||
</div>
|
||||
<div class="close" @click="emit('close')"></div>
|
||||
</div>
|
||||
@@ -26,7 +26,7 @@ const emit = defineEmits(['close'])
|
||||
.rule-wrapper {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 175.740741vw;
|
||||
height: 182vw;
|
||||
background-image: url("../assets/images/rule-bg.webp");
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100%;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup>
|
||||
import { ref, onMounted } from "vue"
|
||||
import { ref, onMounted, watch } from "vue"
|
||||
import { useRouter } from 'vue-router'
|
||||
import imageBackground from '../static/imageBackground.js';
|
||||
import { globalStore } from "../globalstore.js";
|
||||
@@ -19,6 +19,19 @@ const navigateBack = () => {
|
||||
})
|
||||
}
|
||||
|
||||
const imageUrl = ref(globalStore.select_template);
|
||||
const goToHomePage = (item) => {
|
||||
if (!item) {
|
||||
router.push({
|
||||
name: 'home'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
watch(imageUrl, (item) => {
|
||||
goToHomePage(item)
|
||||
}, { immediate: true })
|
||||
|
||||
const displayedImages = ref([]);
|
||||
const goToGenerateImgPage = (item) => {
|
||||
globalStore.people_count = item.peopleCount;
|
||||
|
||||
@@ -82,7 +82,7 @@ const handleHaibao = async () => {
|
||||
const qrcode = await generateQR(`fromid=${infos.invite_code}&merge_id=${infos.merge_id}`, 200, 200)
|
||||
haibaoSave.add(bg, 0, 0)
|
||||
haibaoSave.add(url, 64, 250)
|
||||
haibaoSave.add(qrcode, 115, 1875)
|
||||
haibaoSave.add(qrcode, 127, 1860)
|
||||
haibaoSave.draw().then(() => {
|
||||
haibaoSave.text(infos.nickname + '的全家福', haibaoSave.canvas.width / 2, 200, { font: 'bold 50px Arial', color: '#fcf2b3' })
|
||||
haibaoSave.generate({ mimeType: 'image/png' }).then(url => {
|
||||
@@ -115,6 +115,10 @@ globalToastEvent.on(ToastType.SHOW_LOTTERY, () => {
|
||||
lotteryShow.value = true
|
||||
})
|
||||
|
||||
const handleBtnMore = () => {
|
||||
globalToastEvent.emit(ToastType.SHOW_AD)
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -134,10 +138,14 @@ globalToastEvent.on(ToastType.SHOW_LOTTERY, () => {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="scene-item item-2">
|
||||
<div v-if="!globalStore.chartsBattle" class="scene-item item-2">
|
||||
<img src="../assets/images/charts-battle.webp" @click="chartsBattle" alt="参与打榜">
|
||||
</div>
|
||||
|
||||
<div v-if="globalStore.chartsBattle" class="scene-item item-2">
|
||||
<img src="../assets/images/btn-more.webp" @click="handleBtnMore" alt="更多金喜">
|
||||
</div>
|
||||
|
||||
<div class="scene-item item-3" @click="handleLottery">
|
||||
<img src="../assets/images/instant-win.webp" alt="立即抽奖">
|
||||
</div>
|
||||
@@ -145,7 +153,7 @@ globalToastEvent.on(ToastType.SHOW_LOTTERY, () => {
|
||||
</div>
|
||||
|
||||
<Popup v-model:show="isPopupVisible" />
|
||||
<Lottery :show="lotteryShow" @close="lotteryShow = false"></Lottery>
|
||||
<Lottery :show="lotteryShow" @close="lotteryShow = false" data="null" type="draw"></Lottery>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
<script setup>
|
||||
import { ref, computed } from "vue"
|
||||
import { globalStore } from "@/globalstore";
|
||||
import globalToastEvent, { ToastType } from "../globalToastEvent"
|
||||
import ModalTransition from "./ModalTransition.vue"
|
||||
import { Storage, generateQR, isWeixin, isMiniPage, Request } from "../libs/utils"
|
||||
import Haibao from "@/libs/haibao"
|
||||
@@ -75,10 +76,10 @@ const handleHaibao = async () => {
|
||||
haibaoCoverNoTitle.draw('destination-in').then(() => {
|
||||
haibaoCoverNoTitle.generate({ mimeType: 'image/png' }).then(async (url) => {
|
||||
const haibaoSaveNoTitle = new Haibao(1080, 2160)
|
||||
const qrcode = await generateQR(`fromid=${infos.invite_code}&merge_id=${mergeId}`, 200, 200)
|
||||
const qrcode = await generateQR(`fromid=${infos.invite_code}&merge_id=${mergeId}`, 220, 220)
|
||||
haibaoSaveNoTitle.add(bg, 0, 0)
|
||||
haibaoSaveNoTitle.add(url, 64, 250)
|
||||
haibaoSaveNoTitle.add(qrcode, 115, 1875)
|
||||
haibaoSaveNoTitle.add(qrcode, 118, 1849)
|
||||
haibaoSaveNoTitle.draw().then(() => {
|
||||
haibaoSaveNoTitle.text(infos.nickname + '的全家福', haibaoSaveNoTitle.canvas.width / 2, 200, { font: 'bold 50px Arial', color: '#fcf2b3' })
|
||||
haibaoSaveNoTitle.generate({ mimeType: 'image/png' }).then(url => {
|
||||
@@ -129,6 +130,7 @@ const openHaibao = async (e) => {
|
||||
url.searchParams.append('my_only', '1');
|
||||
url.searchParams.append('page', '1');
|
||||
url.searchParams.append('per_page', '100');
|
||||
const loading = weui.loading()
|
||||
fetch(url.toString(), {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
@@ -138,6 +140,7 @@ const openHaibao = async (e) => {
|
||||
.then(async response => {
|
||||
const data = await response.json()
|
||||
if (response.status == 200 || response.status == 201) {
|
||||
loading.hide()
|
||||
const foundItem = data.data.find(item => item.is_public === true);
|
||||
if (foundItem) {
|
||||
globalStore.result_url = foundItem.result_url;
|
||||
@@ -145,19 +148,24 @@ const openHaibao = async (e) => {
|
||||
haibaoShow.value = true
|
||||
|
||||
if (!globalStore.first_share_today) {
|
||||
Request(`face/share/${mergeId}`)
|
||||
const shareOk = await Request(`face/share/${mergeId}`)
|
||||
if (shareOk.res.status === 200) {
|
||||
globalStore.first_share_today = true
|
||||
globalToastEvent.emit(ToastType.INFO_UPDATE)
|
||||
}
|
||||
}
|
||||
|
||||
handleHaibao()
|
||||
} else {
|
||||
return weui.alert("请先参与活动合成图片并打榜!")
|
||||
}
|
||||
return { success: true, data };
|
||||
} else {
|
||||
loading.hide()
|
||||
ElMessage.error(data.message);
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
loading.hide()
|
||||
return { success: false, error };
|
||||
});
|
||||
}
|
||||
|
||||
@@ -6,9 +6,10 @@ export const ToastType = {
|
||||
SHOW_RULE: "show_rule",
|
||||
SHOW_PRIZELIST: "show_prizelist",
|
||||
SHOW_LOTTERY: "show_lottery",
|
||||
SHOW_AD:"show_ad",
|
||||
SHOW_ADDRESS:"show_address",
|
||||
MOUNTED: "mounted"
|
||||
SHOW_AD: "show_ad",
|
||||
SHOW_ADDRESS: "show_address",
|
||||
MOUNTED: "mounted",
|
||||
INFO_UPDATE: "info_update"
|
||||
};
|
||||
|
||||
export default globalToastEvent;
|
||||
|
||||
@@ -99,6 +99,9 @@ export const getMiniPageBtnHack = (url) => {
|
||||
export const miniJumpToScene = () => {
|
||||
wx.miniProgram.navigateTo({ url: '/pages/unify/unify?orgId=200282401019674482&targetUrl=%2Fpages%2Fretail%2Forder%2Forder-list%3Ftab%3DAll%26topTab%3D1' })
|
||||
}
|
||||
export const miniJumpToActive = () => {
|
||||
wx.miniProgram.navigateTo({ url: '/pages/retail-act/landing-page/ordinary?id=897432916524553363&orgId=200282401019674482&programId=84796583983972352' })
|
||||
}
|
||||
export const miniJumpToCouopon = () => {
|
||||
wx.miniProgram.navigateTo({
|
||||
url: '/pages/unify/unify?orgId=200282401019674482&targetUrl=%2Fpages%2Fcoupon%2Fcoupons-list'
|
||||
@@ -140,6 +143,7 @@ export const Request = async (url, data, type, noloading, noerror) => {
|
||||
} else {
|
||||
Storage.clear()
|
||||
weui.alert("登录失效,请重新登录")
|
||||
// window.location.reload()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||