添加升级显示
This commit is contained in:
@@ -4,6 +4,7 @@ import IconButton from "@/components/IconButton.vue";
|
||||
import SButton from "@/components/SButton.vue";
|
||||
import ScreenHint from "@/components/ScreenHint.vue";
|
||||
import BowData from "@/components/BowData.vue";
|
||||
import UserUpgrade from "@/components/UserUpgrade.vue";
|
||||
import { wxShare } from "@/util";
|
||||
import { directionAdjusts } from "@/constants";
|
||||
const props = defineProps({
|
||||
@@ -31,6 +32,7 @@ const props = defineProps({
|
||||
const showPanel = ref(true);
|
||||
const showComment = ref(false);
|
||||
const showBowData = ref(false);
|
||||
const showUpgrade = ref(false);
|
||||
const finished = ref(false);
|
||||
const totalRing = ref(0);
|
||||
const closePanel = () => {
|
||||
@@ -40,6 +42,9 @@ const closePanel = () => {
|
||||
}, 300);
|
||||
};
|
||||
onMounted(() => {
|
||||
if (props.result.lvl) {
|
||||
showUpgrade.value = true;
|
||||
}
|
||||
if (props.result.arrows) {
|
||||
totalRing.value = props.result.arrows.reduce(
|
||||
(last, next) => last + next.ring,
|
||||
@@ -55,7 +60,7 @@ onMounted(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view v-if="result.arrows" class="container">
|
||||
<view class="container">
|
||||
<view :class="['container-header', showPanel ? 'scale-in' : 'scale-out']">
|
||||
<image :src="tipSrc" mode="widthFix" />
|
||||
<image src="../static/finish-frame.png" mode="widthFix" />
|
||||
@@ -144,6 +149,11 @@ onMounted(() => {
|
||||
:show="showBowData"
|
||||
:onClose="() => (showBowData = false)"
|
||||
/>
|
||||
<UserUpgrade
|
||||
:show="showUpgrade"
|
||||
:onClose="() => (showUpgrade = false)"
|
||||
:lvl="result.lvl"
|
||||
/>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -227,6 +227,9 @@ onUnmounted(() => {
|
||||
font-size: 18px;
|
||||
transform: translateY(-10px);
|
||||
}
|
||||
.container > view:first-child > button:last-child {
|
||||
overflow: visible;
|
||||
}
|
||||
.container > view:first-child > button:last-child > image {
|
||||
width: 40px;
|
||||
transform: translateX(10px) translateY(-10px);
|
||||
|
||||
80
src/components/UserUpgrade.vue
Normal file
80
src/components/UserUpgrade.vue
Normal file
@@ -0,0 +1,80 @@
|
||||
<script setup>
|
||||
import { onMounted } from "vue";
|
||||
import useStore from "@/store";
|
||||
import { storeToRefs } from "pinia";
|
||||
const store = useStore();
|
||||
const { user } = storeToRefs(store);
|
||||
const { updateUser } = store;
|
||||
const props = defineProps({
|
||||
lvl: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
onClose: {
|
||||
type: Function,
|
||||
default: () => {},
|
||||
},
|
||||
});
|
||||
onMounted(() => {
|
||||
updateUser({ ...user.value, lvl: props.lvl });
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="content" :style="{ display: show ? 'flex' : 'none' }">
|
||||
<image src="../static/user-upgrade.png" mode="widthFix" />
|
||||
<image class="" src="../static/shining-bg.png" mode="widthFix" />
|
||||
<view>
|
||||
<text>恭喜你升级到</text>
|
||||
<text>射灵{{ lvl }}级</text>
|
||||
</view>
|
||||
<button @click="onClose" hover-class="none">关闭</button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.content {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background-color: #232323;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 10;
|
||||
color: red;
|
||||
}
|
||||
.content > image:first-child {
|
||||
width: 50vw;
|
||||
position: absolute;
|
||||
top: calc(50% - 30vw);
|
||||
}
|
||||
.content > image:nth-child(2) {
|
||||
width: 80vw;
|
||||
}
|
||||
.content > view:nth-child(3) {
|
||||
color: #fff;
|
||||
display: flex;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
margin-top: -6vw;
|
||||
}
|
||||
.content > view:nth-child(3) > text:last-child {
|
||||
color: #fed847;
|
||||
}
|
||||
.content > button:last-child {
|
||||
color: #fff9;
|
||||
font-size: 20px;
|
||||
border: 1px solid #fff;
|
||||
padding: 10px;
|
||||
width: 50vw;
|
||||
border-radius: 20px;
|
||||
margin-top: 10vw;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user