|
|
@@ -7,42 +7,78 @@
|
|
|
<div class="title">王者荣耀</div>
|
|
|
<div class="type-list">
|
|
|
<div class="type prim">QQ区</div>
|
|
|
- <div class="type">微信区</div>
|
|
|
+ <div class="type" @click="wait">微信区</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div class="account-list">
|
|
|
- <div class="account-title">已绑定0个账号</div>
|
|
|
- <div class="account-box">
|
|
|
- <div class="account-info" v-for="i in 3" :key="i">
|
|
|
- <van-image
|
|
|
- width="44"
|
|
|
- height="44"
|
|
|
- fit="cover"
|
|
|
- radius="4"
|
|
|
- src="https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg"
|
|
|
- />
|
|
|
+ <div class="account-title">已绑定{{ accounts.length }}个账号</div>
|
|
|
+ <div class="account-box" v-if="accounts.length !== 0">
|
|
|
+ <div class="account-info" v-for="(item, index) in accounts" :key="index">
|
|
|
+ <div class="account-img">
|
|
|
+ <van-image
|
|
|
+ width="44"
|
|
|
+ height="44"
|
|
|
+ fit="cover"
|
|
|
+ radius="4"
|
|
|
+ :src="userInfo.avatar || require('@assets/img_default_photo.png')"
|
|
|
+ />
|
|
|
+ <div class="account-btn" @click="remove">解绑</div>
|
|
|
+ </div>
|
|
|
<div class="account-right">
|
|
|
- <div class="text1">奶盖</div>
|
|
|
- <div class="text2">营地ID:7873837378</div>
|
|
|
+ <div class="text1">{{ item.nickname }}</div>
|
|
|
+ <div class="text2">游戏ID:{{ item.gameId }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div class="bottom">
|
|
|
- <van-button type="primary" block>绑定账号</van-button>
|
|
|
+ <div class="bottom" v-if="accounts.length === 0">
|
|
|
+ <van-button type="primary" block @click="$refs.bind.init(gameInfo)">绑定账号</van-button>
|
|
|
</div>
|
|
|
|
|
|
- <band-accound></band-accound>
|
|
|
+ <bind-accound ref="bind" @update="getInfo"></bind-accound>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import BandAccound from '../../components/BandAccound.vue';
|
|
|
+import { mapState } from 'vuex';
|
|
|
+import BindAccound from '../../components/BindAccound.vue';
|
|
|
export default {
|
|
|
- components: { BandAccound }
|
|
|
+ components: { BindAccound },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ accounts: [],
|
|
|
+ gameInfo: {}
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapState(['userInfo'])
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.$http.post('/game/all', { size: 1000, query: { del: false } }, { body: 'json' }).then(res => {
|
|
|
+ if (!res.empty) {
|
|
|
+ this.gameInfo = res.content[0];
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.getInfo();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getInfo() {
|
|
|
+ this.$toast.loading({
|
|
|
+ message: '加载中...',
|
|
|
+ forbidClick: true
|
|
|
+ });
|
|
|
+ this.$http.get('/user/bindGame/list').then(res => {
|
|
|
+ this.$toast.clear();
|
|
|
+ this.accounts = res;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ remove() {
|
|
|
+ this.wait();
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
@@ -112,7 +148,11 @@ export default {
|
|
|
font-size: 14px;
|
|
|
color: #ffffff;
|
|
|
position: relative;
|
|
|
- &::after {
|
|
|
+ }
|
|
|
+
|
|
|
+ .account-box {
|
|
|
+ position: relative;
|
|
|
+ &::before {
|
|
|
content: '';
|
|
|
position: absolute;
|
|
|
bottom: 0;
|
|
|
@@ -137,6 +177,21 @@ export default {
|
|
|
.account-info {
|
|
|
.flex();
|
|
|
padding: 10px 16px;
|
|
|
+ .account-img {
|
|
|
+ height: 44px;
|
|
|
+ position: relative;
|
|
|
+ .account-btn {
|
|
|
+ position: absolute;
|
|
|
+ font-size: 10px;
|
|
|
+ color: #ffffff;
|
|
|
+ line-height: 12px;
|
|
|
+ left: 0;
|
|
|
+ right: 0;
|
|
|
+ bottom: 0;
|
|
|
+ background: rgba(0, 0, 0, 0.5);
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
.account-right {
|
|
|
flex-grow: 1;
|
|
|
margin-left: 10px;
|