| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232 |
- <template>
- <van-overlay ref="overLay" :show="show" @click="close" z-index="99">
- <div class="box" ref="box">
- <van-image width="260" height="220" :src="levelInfo.bg" fit="contain" />
- <div class="box-top">
- <div class="box-title" :style="{ color: levelInfo.color, borderColor: levelInfo.color }">
- 恭喜您 获得新勋章
- </div>
- <div class="icon">
- <van-image :src="levelInfo.icon" width="114" height="114" />
- <span class="text2" :style="{ color: levelInfo.color }">{{ levelInfo.level }}</span>
- </div>
- <div class="text3" :style="{ color: levelInfo.color, backgroundColor: levelInfo.color + '23' }">
- {{ levelInfo.realm }}
- </div>
- <div class="text1" :style="{ color: levelInfo.color }">{{ levelInfo.title }}</div>
- </div>
- <div class="box-content">
- <div class="text1">
- 您已升级至<span :style="{ color: levelInfo.color }">V{{ levelInfo.level }}</span
- >,感谢您对RAEX宇宙的信任。愿RAEX宇宙的荣光普照河山!!
- </div>
- <div class="btn">
- <van-button :color="levelInfo.color" block round>领取</van-button>
- </div>
- </div>
- </div>
- </van-overlay>
- <div v-if="isLogin && !show && levelInfo.icon" ref="medal" class="medal-info" @click="$router.push('/mineLevel')">
- <div class="medal-icon">
- <van-image :src="levelInfo.icon" width="28" height="28" />
- <div class="text1" :style="{ color: levelInfo.color1 || levelInfo.color }">{{ levelInfo.level }}</div>
- </div>
- <div class="medal-text">
- <div
- class="text1"
- :style="{
- color: levelInfo.color1 || levelInfo.color,
- backgroundColor: (levelInfo.color1 || levelInfo.color) + '33'
- }"
- >
- {{ levelInfo.title }}
- </div>
- </div>
- </div>
- </template>
- <script>
- import level from '../../mixins/level';
- export default {
- data() {
- return {
- show: false
- };
- },
- mixins: [level],
- mounted() {
- // this.$nextTick(() => {
- // document.getElementById('app').appendChild(this.$refs.overLay);
- // });
- },
- methods: {
- changeLevel(level) {
- if (level >= 10) {
- this.show = true;
- }
- this.$http.post('/user/update', {
- ...this.$store.state.userInfo,
- level: level
- });
- },
- close() {
- this.addClass('box', 'zoomOutUp', false, 200).then(() => {
- this.show = false;
- this.$nextTick(() => {
- this.$refs.medal.className += ' flipInX';
- });
- });
- }
- }
- };
- </script>
- <style lang="less" scoped>
- .box {
- background-color: @bg;
- border-radius: 16px;
- overflow: hidden;
- top: 50%;
- left: 50%;
- width: 260px;
- height: 338px;
- position: absolute;
- margin-top: -169px;
- margin-left: -130px;
- .box-content {
- padding: 16px 23px 20px;
- .text1 {
- font-size: 12px;
- line-height: 17px;
- text-align: center;
- span {
- font-weight: bold;
- }
- }
- }
- .btn {
- padding: 16px 40px 0;
- }
- }
- .box-top {
- position: absolute;
- width: 260px;
- height: 220px;
- top: 0;
- left: 0;
- .flex-col();
- align-items: center;
- justify-content: center;
- .text3 {
- border-radius: 2px;
- padding: 0 9px;
- margin-top: 6px;
- font-size: 12px;
- line-height: 20px;
- }
- .text1 {
- font-size: 12px;
- line-height: 17px;
- margin-top: 2px;
- }
- }
- .box-title {
- font-size: 14px;
- font-weight: bold;
- line-height: 24px;
- vertical-align: middle;
- &::after,
- &::before {
- display: inline-block;
- width: 30px;
- content: '';
- border-top: 1px solid;
- vertical-align: middle;
- margin: 10px;
- }
- }
- .icon {
- position: relative;
- margin-top: 9px;
- .text2 {
- font-size: 34px;
- font-weight: bold;
- font-family: AlibabaPuHuiTi-Bold, AlibabaPuHuiTi;
- line-height: 34px;
- position: absolute;
- left: 52px;
- top: 38px;
- }
- }
- .medal-info {
- .flex();
- .medal-icon {
- flex-shrink: 0;
- position: relative;
- z-index: 1;
- transform: translateY(2px);
- .van-image {
- display: block;
- }
- .text1 {
- position: absolute;
- left: 10px;
- top: 8px;
- font-size: 12px;
- transform: scale(0.8);
- line-height: 12px;
- font-weight: bold;
- text-align: center;
- display: block;
- min-width: 14px;
- // min-height: 12px;
- font-weight: bold;
- letter-spacing: -1px;
- }
- }
- .medal-text {
- .flex-col();
- align-items: center;
- justify-content: center;
- transform: scale(0.8) translateX(-18px);
- z-index: 0;
- .text1 {
- font-size: 12px;
- border-radius: 2px;
- line-height: 16px;
- padding: 0 4px 0 6px;
- border-radius: 2px;
- text-align: center;
- position: relative;
- display: block;
- overflow: hidden;
- &::after {
- content: '';
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- z-index: -1;
- background-color: #fff;
- }
- }
- }
- }
- .van-overlay {
- top: -103px;
- width: 100vw;
- height: 100vh;
- left: -16px;
- width: 100vw;
- height: 100vh;
- }
- </style>
|