Compare commits
21 Commits
c402cbc74c
...
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 |
@@ -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: 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%;
|
background-size: 10% 10%;
|
||||||
}
|
}
|
||||||
.preload{
|
|
||||||
|
.preload {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -144,7 +145,7 @@
|
|||||||
var _hmt = _hmt || [];
|
var _hmt = _hmt || [];
|
||||||
(function () {
|
(function () {
|
||||||
var hm = document.createElement("script");
|
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];
|
var s = document.getElementsByTagName("script")[0];
|
||||||
s.parentNode.insertBefore(hm, s);
|
s.parentNode.insertBefore(hm, s);
|
||||||
})();
|
})();
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 55 KiB 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 |
|
Before Width: | Height: | Size: 39 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_LZ_DZ_JBGJ_LZ_ZQ_DZJ.webp
Normal file
|
After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 119 KiB After Width: | Height: | Size: 118 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>
|
<script setup>
|
||||||
import ModalTransition from "./ModalTransition.vue"
|
import ModalTransition from "./ModalTransition.vue"
|
||||||
import { ref } from "vue"
|
import { ref } from "vue"
|
||||||
import { isWeixinPlatform, miniJumpToScene, getMiniPageBtnHack } from "../libs/utils"
|
import { isWeixinPlatform, miniJumpToActive, getMiniPageBtnHack } from "../libs/utils"
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
show: false,
|
show: false,
|
||||||
})
|
})
|
||||||
@@ -21,6 +21,8 @@ adHtml.value = getMiniPageBtnHack("/pages/retail-act/landing-page/ordinary?id=89
|
|||||||
const adGoto = () => {
|
const adGoto = () => {
|
||||||
if (!isWeixinPlatform()) {
|
if (!isWeixinPlatform()) {
|
||||||
weui.alert("请前往「泸州老窖会员中心」小程序进行查询")
|
weui.alert("请前往「泸州老窖会员中心」小程序进行查询")
|
||||||
|
}else{
|
||||||
|
miniJumpToActive()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,7 +56,7 @@ const adGoto = () => {
|
|||||||
display: block !important;
|
display: block !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.close {
|
.ad .close {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 8.148148vw;
|
width: 8.148148vw;
|
||||||
height: 8.148148vw;
|
height: 8.148148vw;
|
||||||
|
|||||||
@@ -157,8 +157,20 @@ const clearUploadFile = (index) => {
|
|||||||
if (uploadRefs.value[index]) {
|
if (uploadRefs.value[index]) {
|
||||||
uploadRefs.value[index].clearFiles();
|
uploadRefs.value[index].clearFiles();
|
||||||
uploadItems.value[index].imageUrl = '';
|
uploadItems.value[index].imageUrl = '';
|
||||||
|
// 获取 templateFaceID
|
||||||
uploadedFiles.splice(index, 1);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ const videoLoaded = ref(false);
|
|||||||
const videoError = ref(false);
|
const videoError = ref(false);
|
||||||
const lotteryShow = ref(false)
|
const lotteryShow = ref(false)
|
||||||
const lotteryType = ref("draw")
|
const lotteryType = ref("draw")
|
||||||
|
const lotteryNoticeData = ref(null)
|
||||||
|
|
||||||
// 初始化全局音频实例
|
// 初始化全局音频实例
|
||||||
const initGlobalAudio = () => {
|
const initGlobalAudio = () => {
|
||||||
@@ -98,6 +99,9 @@ const checkAndPlayAudio = () => {
|
|||||||
|
|
||||||
// 初始化视频
|
// 初始化视频
|
||||||
const initVideo = () => {
|
const initVideo = () => {
|
||||||
|
document.addEventListener('WeixinJSBridgeReady',()=>{
|
||||||
|
videoElement.value && videoElement.value.play()
|
||||||
|
})
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (videoElement.value) {
|
if (videoElement.value) {
|
||||||
const video = videoElement.value;
|
const video = videoElement.value;
|
||||||
@@ -228,13 +232,15 @@ const handleLottery = () => {
|
|||||||
if (globalStore.draw_chances <= 0) {
|
if (globalStore.draw_chances <= 0) {
|
||||||
return weui.alert("还没有抽奖机会,快去参加活动吧")
|
return weui.alert("还没有抽奖机会,快去参加活动吧")
|
||||||
};
|
};
|
||||||
|
lotteryType.value = 'draw'
|
||||||
|
lotteryNoticeData.value = null
|
||||||
globalToastEvent.emit(ToastType.SHOW_LOTTERY)
|
globalToastEvent.emit(ToastType.SHOW_LOTTERY)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const navigateSelectTemplatePage = () => {
|
const navigateSelectTemplatePage = () => {
|
||||||
if (globalStore.game_chances <= 0) return;
|
if (globalStore.game_chances <= 0) return weui.alert('去做任务获得更多参与次数吧');
|
||||||
globalStore.reducerGameChances();
|
globalStore.reducerGameChances();
|
||||||
router.push({
|
router.push({
|
||||||
name: 'selectTemplateV2'
|
name: 'selectTemplateV2'
|
||||||
@@ -307,12 +313,20 @@ const initUserGameInfos = async (refresh_official, refresh_cap_scan) => {
|
|||||||
globalToastEvent.emit(ToastType.MOUNTED)
|
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 () => {
|
const handleLoginSuccess = async () => {
|
||||||
console.log("已登录")
|
console.log("已登录")
|
||||||
loginShow.value = false
|
loginShow.value = false
|
||||||
|
|
||||||
await initUserGameInfos(true, true)
|
await initUserGameInfos(true, true)
|
||||||
|
await getNotice()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isLogin()) {
|
if (isLogin()) {
|
||||||
@@ -334,14 +348,23 @@ watch(() => mergeId, async (newVal) => {
|
|||||||
}
|
}
|
||||||
}, { immediate: true })
|
}, { immediate: true })
|
||||||
|
|
||||||
globalToastEvent.on(ToastType.SHOW_LOTTERY, () => {
|
globalToastEvent.on(ToastType.SHOW_LOTTERY, async () => {
|
||||||
|
// await initUserGameInfos(false, false);
|
||||||
lotteryShow.value = true
|
lotteryShow.value = true
|
||||||
})
|
})
|
||||||
|
globalToastEvent.on(ToastType.INFO_UPDATE, async () => {
|
||||||
|
initUserGameInfos(false, false)
|
||||||
|
})
|
||||||
|
|
||||||
watch(() => lotteryShow.value, async (newVal) => {
|
watch(() => lotteryShow.value, async (newVal) => {
|
||||||
initUserGameInfos(true, true);
|
initUserGameInfos(true, true);
|
||||||
}, { immediate: true })
|
}, { immediate: true })
|
||||||
|
|
||||||
|
import Popup from './Popup.vue'
|
||||||
|
const isPopupVisible = ref(false);
|
||||||
|
const navigatePopupPage = () => {
|
||||||
|
isPopupVisible.value = true;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -375,8 +398,7 @@ watch(() => lotteryShow.value, async (newVal) => {
|
|||||||
<p class="lottery-value">{{ globalStore.draw_chances }}</p>
|
<p class="lottery-value">{{ globalStore.draw_chances }}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="scene-item item-2" @click="navigateSelectTemplatePage"
|
<div class="scene-item item-2" @click="navigatePopupPage">
|
||||||
:class="{ 'disabled': globalStore.game_chances <= 0 }">
|
|
||||||
<img src="../assets/images/join.webp" alt="立即参与">
|
<img src="../assets/images/join.webp" alt="立即参与">
|
||||||
<div class="join-main">
|
<div class="join-main">
|
||||||
<p class="join-value">{{ globalStore.game_chances }}</p>
|
<p class="join-value">{{ globalStore.game_chances }}</p>
|
||||||
@@ -412,7 +434,8 @@ watch(() => lotteryShow.value, async (newVal) => {
|
|||||||
<MyPhoto @go-photo-square="showPhotoSquare" v-model:show="isMyPhotoVisible" />
|
<MyPhoto @go-photo-square="showPhotoSquare" v-model:show="isMyPhotoVisible" />
|
||||||
<PhotoSquare @go-my-photo="showMyPhoto" v-model:show="isPhotoSquareVisible" />
|
<PhotoSquare @go-my-photo="showMyPhoto" v-model:show="isPhotoSquareVisible" />
|
||||||
<Login :show="loginShow" @login-success="handleLoginSuccess" />
|
<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>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
@@ -8,9 +8,12 @@
|
|||||||
<div class="lottery-prize">
|
<div class="lottery-prize">
|
||||||
<div class="lottery-title" :class="props.type === 'notice' && 'notice'" ref="titleRef"
|
<div class="lottery-title" :class="props.type === 'notice' && 'notice'" ref="titleRef"
|
||||||
v-show="activePrizeData.prize_code !== 'NO'"></div>
|
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-image" :class="'USER_' + activePrizeData.prize_code" ref="lotteryImageRef"></div>
|
||||||
<div class="lottery-name" v-show="activePrizeData.prize_code !== 'NO'">{{ activePrizeData.prize_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="lottery-btngroup" v-show="btngroupShow">
|
||||||
<div class="btn-more" @click="handleBtnMore"></div>
|
<div class="btn-more" @click="handleBtnMore"></div>
|
||||||
<div class="btn-kaixin" @click="handleLotteryAction" v-if="activePrizeData.prize_code !== 'NO'"></div>
|
<div class="btn-kaixin" @click="handleLotteryAction" v-if="activePrizeData.prize_code !== 'NO'"></div>
|
||||||
@@ -46,7 +49,8 @@ const btngroupShow = ref(false)
|
|||||||
gsap.registerPlugin()
|
gsap.registerPlugin()
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
show: false,
|
show: false,
|
||||||
type: "draw"
|
type: "draw",
|
||||||
|
data: null
|
||||||
})
|
})
|
||||||
const emit = defineEmits(['close'])
|
const emit = defineEmits(['close'])
|
||||||
|
|
||||||
@@ -63,9 +67,15 @@ const handleBtnMore = () => {
|
|||||||
closeThis()
|
closeThis()
|
||||||
globalToastEvent.emit(ToastType.SHOW_AD)
|
globalToastEvent.emit(ToastType.SHOW_AD)
|
||||||
}
|
}
|
||||||
const handleLotteryAction = () => {
|
const readNotice = async () => {
|
||||||
|
await Request(`notice/read`, { id: activePrizeData.value.noticeId })
|
||||||
|
}
|
||||||
|
const handleLotteryAction = async () => {
|
||||||
//实物
|
//实物
|
||||||
closeThis()
|
closeThis()
|
||||||
|
if (props.type !== 'draw') {
|
||||||
|
await readNotice()
|
||||||
|
}
|
||||||
if (activePrizeData.value.coupon_type === 'scene') {
|
if (activePrizeData.value.coupon_type === 'scene') {
|
||||||
globalToastEvent.emit(ToastType.SHOW_ADDRESS, activePrizeData.value.id)
|
globalToastEvent.emit(ToastType.SHOW_ADDRESS, activePrizeData.value.id)
|
||||||
}
|
}
|
||||||
@@ -108,9 +118,33 @@ watch(() => props.show, async (newVal) => {
|
|||||||
|
|
||||||
const loading = weui.loading()
|
const loading = weui.loading()
|
||||||
let lottteryResult = null
|
let lottteryResult = null
|
||||||
|
|
||||||
if (props.type === 'draw') {
|
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()
|
// const userPicture = await getUserPicture()
|
||||||
|
|
||||||
@@ -128,7 +162,6 @@ watch(() => props.show, async (newVal) => {
|
|||||||
// await Sleep(20000)
|
// await Sleep(20000)
|
||||||
|
|
||||||
|
|
||||||
lottteryResult = await Request("lottery/draw", { pool: 'game', consume_type: 'points' })
|
|
||||||
// TODO: 测试数据
|
// TODO: 测试数据
|
||||||
// lottteryResult = {
|
// lottteryResult = {
|
||||||
// res: { status: 200 },
|
// res: { status: 200 },
|
||||||
@@ -252,6 +285,10 @@ onUnmounted(() => {
|
|||||||
background-image: url("../assets/images/USER_LZ_DZ_JBGJ.webp");
|
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,
|
.guang,
|
||||||
.guangyun {
|
.guangyun {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@@ -318,7 +355,7 @@ onUnmounted(() => {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
width: 80%;
|
width: 80%;
|
||||||
left: 10%;
|
left: 10%;
|
||||||
font-size: 6vw;
|
font-size: 4.3vw;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|||||||
@@ -35,8 +35,8 @@ const fetchImages = async () => {
|
|||||||
})
|
})
|
||||||
const data = await response.json()
|
const data = await response.json()
|
||||||
if (response.status == 200 || response.status == 201) {
|
if (response.status == 200 || response.status == 201) {
|
||||||
// 只保留result_url存在的记录
|
// 只保留 status=processing 或 result_url 不为空的记录
|
||||||
images.value = data.data.filter(item => item.result_url);
|
images.value = data.data.filter(item => item.status === 'processing' || item.result_url);
|
||||||
// 测试数据
|
// 测试数据
|
||||||
// images.value = [
|
// images.value = [
|
||||||
// {
|
// {
|
||||||
@@ -165,7 +165,9 @@ const downloadGenerateImg = (item) => {
|
|||||||
import haibaoCoverBorderNoTitle from "../assets/images/haibao-cover-no-title.webp"
|
import haibaoCoverBorderNoTitle from "../assets/images/haibao-cover-no-title.webp"
|
||||||
import haibaoCoverBorderSuccess from "../assets/images/haibao-cover-sucess.webp";
|
import haibaoCoverBorderSuccess from "../assets/images/haibao-cover-sucess.webp";
|
||||||
import failedImg from '../assets/images/failed.webp';
|
import failedImg from '../assets/images/failed.webp';
|
||||||
|
import processingImg from '../assets/images/processing.webp';
|
||||||
const getGenerateImgStatus = async (item) => {
|
const getGenerateImgStatus = async (item) => {
|
||||||
|
const loading = weui.loading()
|
||||||
fetch(`https://huodong2.lzlj.com/api/faceFamily/face/merge/${item.id}/status`, {
|
fetch(`https://huodong2.lzlj.com/api/faceFamily/face/merge/${item.id}/status`, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
@@ -174,6 +176,7 @@ const getGenerateImgStatus = async (item) => {
|
|||||||
})
|
})
|
||||||
.then(async response => {
|
.then(async response => {
|
||||||
const data = await response.json()
|
const data = await response.json()
|
||||||
|
loading.hide();
|
||||||
if (response.status == 200 || response.status == 201) {
|
if (response.status == 200 || response.status == 201) {
|
||||||
if (data.status = 'failed') {
|
if (data.status = 'failed') {
|
||||||
item.result_url = failedImg;
|
item.result_url = failedImg;
|
||||||
@@ -185,6 +188,7 @@ const getGenerateImgStatus = async (item) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
loading.hide();
|
||||||
ElMessage.error('获取状态失败!');
|
ElMessage.error('获取状态失败!');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -193,7 +197,7 @@ const getBackgroundImage = (item) => {
|
|||||||
if (item.result_url) {
|
if (item.result_url) {
|
||||||
return `${item.result_url}?x-oss-process=image/resize,w_400/format,webp/quality,q_80`;
|
return `${item.result_url}?x-oss-process=image/resize,w_400/format,webp/quality,q_80`;
|
||||||
} else {
|
} else {
|
||||||
return item.result_url = failedImg;
|
return item.result_url = processing;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -373,13 +377,13 @@ const getBorder = (item, index) => {
|
|||||||
<div v-for="(item, index) in images" :key="index" class="image-wrapper">
|
<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 class="image-container mask-background" @click="downloadGenerateImg(item)" :style="{ backgroundImage: `url(${getBackgroundImage(item)})` }">
|
||||||
</div>
|
</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="刷新">
|
src="../assets/images/refresh-btn.webp" class="refresh-btn" alt="刷新">
|
||||||
<img :src="getBorder(item, index)" class="border-image" alt="border"
|
<img :src="getBorder(item, index)" class="border-image" alt="border"
|
||||||
@click.stop="downloadGenerateImg(item)"
|
@click.stop="downloadGenerateImg(item)"
|
||||||
/>
|
/>
|
||||||
<div class="mask-overlay"
|
<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>
|
</div>
|
||||||
<div class="scene-item item-2">
|
<div class="scene-item item-2">
|
||||||
@@ -485,6 +489,7 @@ const getBorder = (item, index) => {
|
|||||||
top: 7vw;
|
top: 7vw;
|
||||||
right: 3vw;
|
right: 3vw;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
z-index: 13;
|
||||||
}
|
}
|
||||||
|
|
||||||
.image-wrapper {
|
.image-wrapper {
|
||||||
@@ -521,7 +526,7 @@ const getBorder = (item, index) => {
|
|||||||
top: 0;
|
top: 0;
|
||||||
margin-bottom: 3vw;
|
margin-bottom: 3vw;
|
||||||
background-image: url('../assets/images/test.webp');
|
background-image: url('../assets/images/test.webp');
|
||||||
background-size: 100%;
|
background-size: cover;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|||||||
@@ -47,13 +47,13 @@ const fetchImages = async () => {
|
|||||||
images.value = data.data
|
images.value = data.data
|
||||||
if (data.my_published_photo) {
|
if (data.my_published_photo) {
|
||||||
displayMyPublishPhoto.value = true;
|
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 {
|
} else {
|
||||||
displayMyPublishPhoto.value = false;
|
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 {
|
} else {
|
||||||
ElMessage.error(data.message);
|
ElMessage.error(data.message);
|
||||||
emit('update:show', false);
|
emit('update:show', false);
|
||||||
@@ -70,8 +70,66 @@ watch(() => props.show, async (newVal) => {
|
|||||||
fetchImages();
|
fetchImages();
|
||||||
}, {immediate: true})
|
}, {immediate: true})
|
||||||
|
|
||||||
// 图片数据
|
// 图片数据与分页
|
||||||
const images = ref([]);
|
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")
|
const userinfos = Storage.get("userinfos")
|
||||||
|
|
||||||
let mergeId = '';
|
let mergeId = '';
|
||||||
@@ -190,53 +248,31 @@ const getBackgroundImage = (item) => {
|
|||||||
}"
|
}"
|
||||||
@click.stop="$emit('go-my-photo')">
|
@click.stop="$emit('go-my-photo')">
|
||||||
</div>
|
</div>
|
||||||
<p class="my-photo-desc">打榜活动截止至9月30日23:59:59结束,中奖信息将于10月1日早10点推送至获奖会员。</p>
|
<p class="my-photo-desc">打榜活动截止至10月3日23:59:59结束,中奖信息将于10月4日早10点推送至获奖会员。</p>
|
||||||
<div v-if="!disableInviteHelp" class="image-gallery ">
|
<div v-if="!disableInviteHelp" class="image-gallery scroller" @scroll="handleScroll">
|
||||||
<RecycleScroller
|
<div
|
||||||
class="scroller"
|
|
||||||
:items="images"
|
|
||||||
:item-size="1"
|
|
||||||
key-field="id"
|
|
||||||
v-slot="{ item, index }"
|
|
||||||
>
|
|
||||||
<div class="image-wrapper">
|
|
||||||
<div class="image-container mask-background"
|
|
||||||
:style="{ backgroundImage: `url(${getBackgroundImage(item)})` }">
|
|
||||||
</div>
|
|
||||||
<img
|
|
||||||
src="../assets/images/zpgc-border.webp"
|
|
||||||
class="border-image"
|
|
||||||
alt="border"
|
|
||||||
/>
|
|
||||||
<div class="list-item">
|
|
||||||
<div class="flex-container-detail">
|
|
||||||
<div class="photo-number">{{ (index + 1).toString().padStart(3, '0') }}</div>
|
|
||||||
<div class="photo-name">{{ item.user_name }}</div>
|
|
||||||
<div class="right-item photo-name">{{ item.likes_count }}赞</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</RecycleScroller>
|
|
||||||
<!-- <div
|
|
||||||
v-for="(item, index) in images"
|
v-for="(item, index) in images"
|
||||||
:key="index"
|
:key="item.id || index"
|
||||||
class="image-wrapper"
|
class="image-wrapper"
|
||||||
>
|
>
|
||||||
<div class="image-container mask-background">
|
<div class="image-container mask-background"
|
||||||
|
:style="{ backgroundImage: `url(${getBackgroundImage(item)})` }">
|
||||||
</div>
|
</div>
|
||||||
<img
|
<img
|
||||||
src="../assets/images/zpgc-border.webp"
|
src="../assets/images/zpgc-border.webp"
|
||||||
class="border-image"
|
class="border-image"
|
||||||
alt="border"
|
alt="border"
|
||||||
/>
|
/>
|
||||||
<div class="flex-container-detail">
|
<div class="list-item">
|
||||||
<div class="left-group">
|
<div class="flex-container-detail">
|
||||||
<p class="photo-number">{{ (index + 1).toString().padStart(3, '0') }}</p>
|
<div class="photo-number">{{ (index + 1).toString().padStart(3, '0') }}</div>
|
||||||
<p class="photo-name">{{ item.user_name }}</p>
|
<div class="photo-name">{{ item.user_name }}</div>
|
||||||
|
<div class="right-item photo-name">{{ item.likes_count }}赞</div>
|
||||||
</div>
|
</div>
|
||||||
<p class="right-item photo-name" style="padding-left: 3vw;">{{ item.likes_count }}赞</p>
|
|
||||||
</div>
|
</div>
|
||||||
</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>
|
||||||
<div v-if="!disableInviteHelp && displayMyPublishPhoto" class="fixed-background-container">
|
<div v-if="!disableInviteHelp && displayMyPublishPhoto" class="fixed-background-container">
|
||||||
<div class="flex-container">
|
<div class="flex-container">
|
||||||
@@ -420,7 +456,7 @@ const getBackgroundImage = (item) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.left-group p, .right-item {
|
.left-group p, .right-item {
|
||||||
padding-left: 2vw;
|
padding-left: 0.3vw;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,12 +52,12 @@ const confirmBtn = () => {
|
|||||||
<div class="home-bg">
|
<div class="home-bg">
|
||||||
<div class="popup-bg">
|
<div class="popup-bg">
|
||||||
<div class="scene-item item-1">
|
<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>
|
</div>
|
||||||
<p class="message">温馨提示:每位用户只能选择一张合影参与打榜,一经确认,在打榜期间将无法更换。</p>
|
<p class="message">活动已结束</p>
|
||||||
<div class="scene-item item-2">
|
<!-- <div class="scene-item item-2">
|
||||||
<img src="../assets/images/cancel.webp" @click="cancelBtn" alt="取消">
|
<img src="../assets/images/cancel.webp" @click="cancelBtn" alt="取消">
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ModalTransition>
|
</ModalTransition>
|
||||||
@@ -74,6 +74,7 @@ const confirmBtn = () => {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
top: 42%;
|
top: 42%;
|
||||||
color: #774107;
|
color: #774107;
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
.popup-bg {
|
.popup-bg {
|
||||||
width: 77vw;
|
width: 77vw;
|
||||||
@@ -112,7 +113,6 @@ const confirmBtn = () => {
|
|||||||
.item-1 {
|
.item-1 {
|
||||||
top: 50vw;
|
top: 50vw;
|
||||||
width: 40vw;
|
width: 40vw;
|
||||||
right: 0;
|
|
||||||
}
|
}
|
||||||
.item-2 {
|
.item-2 {
|
||||||
top: 50vw;
|
top: 50vw;
|
||||||
|
|||||||
@@ -185,6 +185,10 @@ wx-open-launch-weapp,
|
|||||||
background-image: url("../assets/images/USER_LZ_DZ_JBGJ.webp");
|
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 {
|
.prizelist-cover.USER_DZCZ {
|
||||||
background-image: url("../assets/images/USER_DZCZ.webp");
|
background-image: url("../assets/images/USER_DZCZ.webp");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
<ModalTransition class="rule" :show="show">
|
<ModalTransition class="rule" :show="show">
|
||||||
<div class="rule-wrapper">
|
<div class="rule-wrapper">
|
||||||
<div class="rule-content">
|
<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-2.webp" alt="">
|
||||||
<img src="../assets/images/rule-3.webp" alt="">
|
<img src="../assets/images/rule-3.webp" alt="">
|
||||||
<img src="../assets/images/rule-4.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>
|
||||||
<div class="close" @click="emit('close')"></div>
|
<div class="close" @click="emit('close')"></div>
|
||||||
</div>
|
</div>
|
||||||
@@ -26,7 +26,7 @@ const emit = defineEmits(['close'])
|
|||||||
.rule-wrapper {
|
.rule-wrapper {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 175.740741vw;
|
height: 182vw;
|
||||||
background-image: url("../assets/images/rule-bg.webp");
|
background-image: url("../assets/images/rule-bg.webp");
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size: 100%;
|
background-size: 100%;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted } from "vue"
|
import { ref, onMounted, watch } from "vue"
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import imageBackground from '../static/imageBackground.js';
|
import imageBackground from '../static/imageBackground.js';
|
||||||
import { globalStore } from "../globalstore.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 displayedImages = ref([]);
|
||||||
const goToGenerateImgPage = (item) => {
|
const goToGenerateImgPage = (item) => {
|
||||||
globalStore.people_count = item.peopleCount;
|
globalStore.people_count = item.peopleCount;
|
||||||
|
|||||||
@@ -115,6 +115,10 @@ globalToastEvent.on(ToastType.SHOW_LOTTERY, () => {
|
|||||||
lotteryShow.value = true
|
lotteryShow.value = true
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const handleBtnMore = () => {
|
||||||
|
globalToastEvent.emit(ToastType.SHOW_AD)
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -134,10 +138,14 @@ globalToastEvent.on(ToastType.SHOW_LOTTERY, () => {
|
|||||||
</div>
|
</div>
|
||||||
</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="参与打榜">
|
<img src="../assets/images/charts-battle.webp" @click="chartsBattle" alt="参与打榜">
|
||||||
</div>
|
</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">
|
<div class="scene-item item-3" @click="handleLottery">
|
||||||
<img src="../assets/images/instant-win.webp" alt="立即抽奖">
|
<img src="../assets/images/instant-win.webp" alt="立即抽奖">
|
||||||
</div>
|
</div>
|
||||||
@@ -145,7 +153,7 @@ globalToastEvent.on(ToastType.SHOW_LOTTERY, () => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Popup v-model:show="isPopupVisible" />
|
<Popup v-model:show="isPopupVisible" />
|
||||||
<Lottery :show="lotteryShow" @close="lotteryShow = false"></Lottery>
|
<Lottery :show="lotteryShow" @close="lotteryShow = false" data="null" type="draw"></Lottery>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed } from "vue"
|
import { ref, computed } from "vue"
|
||||||
import { globalStore } from "@/globalstore";
|
import { globalStore } from "@/globalstore";
|
||||||
|
import globalToastEvent, { ToastType } from "../globalToastEvent"
|
||||||
import ModalTransition from "./ModalTransition.vue"
|
import ModalTransition from "./ModalTransition.vue"
|
||||||
import { Storage, generateQR, isWeixin, isMiniPage, Request } from "../libs/utils"
|
import { Storage, generateQR, isWeixin, isMiniPage, Request } from "../libs/utils"
|
||||||
import Haibao from "@/libs/haibao"
|
import Haibao from "@/libs/haibao"
|
||||||
@@ -75,10 +76,10 @@ const handleHaibao = async () => {
|
|||||||
haibaoCoverNoTitle.draw('destination-in').then(() => {
|
haibaoCoverNoTitle.draw('destination-in').then(() => {
|
||||||
haibaoCoverNoTitle.generate({ mimeType: 'image/png' }).then(async (url) => {
|
haibaoCoverNoTitle.generate({ mimeType: 'image/png' }).then(async (url) => {
|
||||||
const haibaoSaveNoTitle = new Haibao(1080, 2160)
|
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(bg, 0, 0)
|
||||||
haibaoSaveNoTitle.add(url, 64, 250)
|
haibaoSaveNoTitle.add(url, 64, 250)
|
||||||
haibaoSaveNoTitle.add(qrcode, 115, 1875)
|
haibaoSaveNoTitle.add(qrcode, 118, 1849)
|
||||||
haibaoSaveNoTitle.draw().then(() => {
|
haibaoSaveNoTitle.draw().then(() => {
|
||||||
haibaoSaveNoTitle.text(infos.nickname + '的全家福', haibaoSaveNoTitle.canvas.width / 2, 200, { font: 'bold 50px Arial', color: '#fcf2b3' })
|
haibaoSaveNoTitle.text(infos.nickname + '的全家福', haibaoSaveNoTitle.canvas.width / 2, 200, { font: 'bold 50px Arial', color: '#fcf2b3' })
|
||||||
haibaoSaveNoTitle.generate({ mimeType: 'image/png' }).then(url => {
|
haibaoSaveNoTitle.generate({ mimeType: 'image/png' }).then(url => {
|
||||||
@@ -129,6 +130,7 @@ const openHaibao = async (e) => {
|
|||||||
url.searchParams.append('my_only', '1');
|
url.searchParams.append('my_only', '1');
|
||||||
url.searchParams.append('page', '1');
|
url.searchParams.append('page', '1');
|
||||||
url.searchParams.append('per_page', '100');
|
url.searchParams.append('per_page', '100');
|
||||||
|
const loading = weui.loading()
|
||||||
fetch(url.toString(), {
|
fetch(url.toString(), {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
@@ -138,6 +140,7 @@ const openHaibao = async (e) => {
|
|||||||
.then(async response => {
|
.then(async response => {
|
||||||
const data = await response.json()
|
const data = await response.json()
|
||||||
if (response.status == 200 || response.status == 201) {
|
if (response.status == 200 || response.status == 201) {
|
||||||
|
loading.hide()
|
||||||
const foundItem = data.data.find(item => item.is_public === true);
|
const foundItem = data.data.find(item => item.is_public === true);
|
||||||
if (foundItem) {
|
if (foundItem) {
|
||||||
globalStore.result_url = foundItem.result_url;
|
globalStore.result_url = foundItem.result_url;
|
||||||
@@ -145,19 +148,24 @@ const openHaibao = async (e) => {
|
|||||||
haibaoShow.value = true
|
haibaoShow.value = true
|
||||||
|
|
||||||
if (!globalStore.first_share_today) {
|
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()
|
handleHaibao()
|
||||||
} else {
|
} else {
|
||||||
return weui.alert("请先参与活动合成图片并打榜!")
|
return weui.alert("请先参与活动合成图片并打榜!")
|
||||||
}
|
}
|
||||||
return { success: true, data };
|
return { success: true, data };
|
||||||
} else {
|
} else {
|
||||||
|
loading.hide()
|
||||||
ElMessage.error(data.message);
|
ElMessage.error(data.message);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
loading.hide()
|
||||||
return { success: false, error };
|
return { success: false, error };
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,9 +6,10 @@ export const ToastType = {
|
|||||||
SHOW_RULE: "show_rule",
|
SHOW_RULE: "show_rule",
|
||||||
SHOW_PRIZELIST: "show_prizelist",
|
SHOW_PRIZELIST: "show_prizelist",
|
||||||
SHOW_LOTTERY: "show_lottery",
|
SHOW_LOTTERY: "show_lottery",
|
||||||
SHOW_AD:"show_ad",
|
SHOW_AD: "show_ad",
|
||||||
SHOW_ADDRESS:"show_address",
|
SHOW_ADDRESS: "show_address",
|
||||||
MOUNTED: "mounted"
|
MOUNTED: "mounted",
|
||||||
|
INFO_UPDATE: "info_update"
|
||||||
};
|
};
|
||||||
|
|
||||||
export default globalToastEvent;
|
export default globalToastEvent;
|
||||||
|
|||||||
@@ -99,6 +99,9 @@ export const getMiniPageBtnHack = (url) => {
|
|||||||
export const miniJumpToScene = () => {
|
export const miniJumpToScene = () => {
|
||||||
wx.miniProgram.navigateTo({ url: '/pages/unify/unify?orgId=200282401019674482&targetUrl=%2Fpages%2Fretail%2Forder%2Forder-list%3Ftab%3DAll%26topTab%3D1' })
|
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 = () => {
|
export const miniJumpToCouopon = () => {
|
||||||
wx.miniProgram.navigateTo({
|
wx.miniProgram.navigateTo({
|
||||||
url: '/pages/unify/unify?orgId=200282401019674482&targetUrl=%2Fpages%2Fcoupon%2Fcoupons-list'
|
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 {
|
} else {
|
||||||
Storage.clear()
|
Storage.clear()
|
||||||
weui.alert("登录失效,请重新登录")
|
weui.alert("登录失效,请重新登录")
|
||||||
|
// window.location.reload()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||