Commit be51df44 authored by 毛线's avatar 毛线

save

parent 5a8b251c
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<Tab @on-change="(index) => { tabIndex = index}"/> <Tab @on-change="(index) => { tabIndex = index}"/>
<Load> <Load>
<!-- 个人资料 --> <!-- 个人资料 -->
<Info v-show="tabIndex === 0" /> <Info v-show="tabIndex === 0" :level-current="levelCurrent" />
<!-- 游戏记录 --> <!-- 游戏记录 -->
<Record v-show="tabIndex === 1" /> <Record v-show="tabIndex === 1" />
<!-- 分数转账表 --> <!-- 分数转账表 -->
...@@ -44,11 +44,25 @@ export default { ...@@ -44,11 +44,25 @@ export default {
return { return {
visible: false, visible: false,
tabIndex: 0, tabIndex: 0,
levelCurrent: {},
} }
}, },
methods: { methods: {
show() { show() {
this.visible = true this.visible = true
this.network().levelCurrent()
},
network() {
return {
levelCurrent: () => {
this.$request({
url: '/api/player/level/current',
method: 'get',
}).then(({ data }) => {
this.levelCurrent = data
})
},
}
}, },
}, },
} }
......
...@@ -21,7 +21,12 @@ ...@@ -21,7 +21,12 @@
</div> </div>
<div class="gold-block"> <div class="gold-block">
<div class="card-box"> <div class="card-box">
card <template v-if="userInfo.id">
<img :src="cardImg[userInfo.playerLevelName]" alt="" class="card-img">
</template>
<div class="level">
{{ levelCurrent.current }} / {{ levelCurrent.needs }}
</div>
</div> </div>
<div class="gold-box"> <div class="gold-box">
<div> <div>
...@@ -41,8 +46,25 @@ ...@@ -41,8 +46,25 @@
<script> <script>
import { mapState } from 'vuex' import { mapState } from 'vuex'
export default { export default {
props: {
levelCurrent: {
type: Object,
default: () => {
return {}
},
},
},
data() { data() {
return {} // 卡片
const cardImg = {
Red: 'https://kuawai.s3.ap-east-1.amazonaws.com/resource/assets/Textures/second/card-Red.png',
Gold: 'https://kuawai.s3.ap-east-1.amazonaws.com/resource/assets/Textures/second/card-Gold.png',
Silver: 'https://kuawai.s3.ap-east-1.amazonaws.com/resource/assets/Textures/second/card-Silver.png',
Diamond: 'https://kuawai.s3.ap-east-1.amazonaws.com/resource/assets/Textures/second/card-Diamond.png',
}
return {
cardImg,
}
}, },
computed: { computed: {
...mapState([ ...mapState([
...@@ -125,6 +147,20 @@ export default { ...@@ -125,6 +147,20 @@ export default {
background-image: url(https://kuawai.s3.ap-east-1.amazonaws.com/resource/assets/Textures/second/Rounded%20Rectangle%204%20copy%202.png); background-image: url(https://kuawai.s3.ap-east-1.amazonaws.com/resource/assets/Textures/second/Rounded%20Rectangle%204%20copy%202.png);
background-size: 100% 100%; background-size: 100% 100%;
width: 150px; width: 150px;
.card-img {
width: 84px;
margin: 4px auto;
display: block;
}
.level {
background: #0000007a;
border-radius: 4px;
text-align: center;
margin: 4px auto;
width: 100px;
padding: 4px 0;
font-size: 14px;
}
} }
.gold-box{ .gold-box{
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment