Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/Zhou-Yingquan' into Zhou-Xinyi
Browse files Browse the repository at this point in the history
  • Loading branch information
CindyChow123 authored and CindyChow123 committed Dec 24, 2020
2 parents 7cfe0ff + 6123608 commit abff6a1
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 33 deletions.
1 change: 1 addition & 0 deletions src/plugins/ant-design-vue.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Vue.component(Card.Meta.name, Meta)
Vue.component(Modal.name, Modal)
Vue.component(Checkbox.name, Checkbox)
Vue.component(Input.name, Input)
Vue.component(Input.Group.name, Input.Group)
Vue.use(FormModel)
Vue.prototype.$message = message
Vue.component(Avatar.name, Avatar)
Expand Down
2 changes: 2 additions & 0 deletions src/views/Single_game.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
<br/>
<strong style="font-size: 16px; color: darkorange">Discount </strong>
<p>{{ this.game.discount_rate }} from {{ this.game.discount_start }} to {{ this.game.discount_end }}</p>
<strong style="font-size: 16px; color: darkorange">Branch</strong>
<p>{{this.game.branch}}</p>
</a-col>
</a-row>
<a-row type="flex" justify="center">
Expand Down
93 changes: 65 additions & 28 deletions src/views/Store.vue
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
<template>
<div>
<div style="margin: auto; text-align: center;">
<a-carousel style="width: 450px; display: inline-block;" arrows autoplay>
<a-carousel style="width: 450px; display: inline-block;margin-top:20px" arrows autoplay>
<div slot="prevArrow" class="custom-slick-arrow" style="left: 10px; zIndex: 1">
<a-icon type="left-circle" />
</div>
<div slot="nextArrow" class="custom-slick-arrow" style="right: 10px">
<a-icon type="right-circle" />
</div>
<div><img src="header1.png" alt="Game Pic"></div>
<div><img src="header2.jpg" alt="Game Pic"></div>
<div><img src="header1.png" alt="Game Pic"></div>
<div><img src="header2.jpg" alt="Game Pic"></div>
<div><img src="http://47.115.50.249/game/getPhoto/1608809249899mingfeng.jpg" alt="Game Pic" style="width: 450px"></div>
<div><img src="http://47.115.50.249/game/getPhoto/1608788599504QQ图片20201224134309.png" alt="Game Pic" style="width: 450px"></div>
<div><img src="http://47.115.50.249/game/getPhoto/1608812275275M2MMO89.png" alt="Game Pic" style="width: 450px"></div>
<div><img src="http://47.115.50.249/game/getPhoto/1608811579924BingWallpaper-2018-12-10.jpg" alt="Game Pic" style="width: 450px"></div>
</a-carousel>
</div>
<a-input-search placeholder="search the game" style="width: 200px; margin-left: 900px; margin-top: 10px" @search="onSearch" />
<a-input-group :compact="true" style="width:300px; margin-left:850px; margin-top:20px">
<a-select v-model="search_kind" style="width: 30%">
<a-select-option value="game">
Game
</a-select-option>
<a-select-option value="user">
User
</a-select-option>
</a-select>
<a-input-search style="width:70%" placeholder="search the game or user" @search="onSearch" />
</a-input-group>
<br />
<a-button type="primary" size="large" style="margin-bottom: 16px" @click="toggleCollapsed">
<a-icon :type="collapsed ? 'right-circle' : 'left-circle'" />
Expand Down Expand Up @@ -92,9 +102,9 @@
<br />
<a-pagination
:default-current="1"
:total="90"
:total="total_pages"
:defaultPageSize="9"
style="margin-left: 700px; margin-top: 50px"
style="margin-left: 900px"
@change="onChange"
/>
</div>
Expand All @@ -117,7 +127,10 @@ export default {
games: [],
urls: {},
target_game: {},
search_game: ''
search_game: '',
total_pages: 1,
search_kind: 'game',
search_user: {}
}
},
mounted () {
Expand All @@ -138,28 +151,49 @@ export default {
// onChange (a, b, c) {
// console.log(a, b, c)
// },
onSearch (value) {
this.$http.get('/game/list', {
params: {
tag: '',
name: value,
page: this.current - 1
}
})
.then((response) => {
if (response.status === 200 && response.data.code === 0) {
this.games = response.data.data.content
for (let i = 0; i < this.games.length; i++) {
this.urls[i] = 'http://47.115.50.249/game/getPhoto/' + this.games[i].front_image
}
} else {
// this.$message.error('Error!')
this.$message.error(response.data.msg)
async onSearch (value) {
if (this.search_kind === 'game') {
this.$http.get('/game/list', {
params: {
tag: '',
name: value,
page: this.current - 1
}
})
.catch((error) => {
console.log(error)
.then((response) => {
if (response.status === 200 && response.data.code === 0) {
this.games = response.data.data.content
for (let i = 0; i < this.games.length; i++) {
this.urls[i] = 'http://47.115.50.249/game/getPhoto/' + this.games[i].front_image
}
} else {
// this.$message.error('Error!')
this.$message.error(response.data.msg)
}
})
.catch((error) => {
console.log(error)
})
} else if (this.search_kind === 'user') {
await this.$http.get('/api/user/find', {
params: {
name: value
}
})
.then((response) => {
if (response.status === 200 && response.data.code === 0) {
console.log('search_user_id', response.data.data)
this.search_user = response.data.data
} else {
// this.$message.error('Error!')
this.$message.error(response.data.msg)
}
})
.catch((error) => {
console.log(error)
})
this.$router.push({ path: '/user_view', query: { id: this.search_user.id, unfriend: false } })
}
},
handleClick (e) {
this.menu_key[0] = e.key
Expand All @@ -183,7 +217,9 @@ export default {
})
.then((response) => {
if (response.status === 200 && response.data.code === 0) {
console.log('game list', response.data)
this.games = response.data.data.content
this.total_pages = response.data.data.totalPages
console.log('games', this.games)
for (let i = 0; i < this.games.length; i++) {
this.urls[i] = 'http://47.115.50.249/game/getPhoto/' + this.games[i].front_image
Expand All @@ -196,6 +232,7 @@ export default {
.catch((error) => {
console.log(error)
})
console.log('urls', this.urls)
}
}
}
Expand Down
28 changes: 25 additions & 3 deletions src/views/Support.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
<template>
<div class="about">
<span style="color: white">This is an about page</span>
</div>
<a-form-model style="margin-left:300px;margin-top:60px;border-radius: 25px; border-style: groove; border-color: cadetblue; width: 700px">
<a-form-model-item style="margin-top: 50px">
<strong style="font-size: 25px; color:darkorange; margin-left: 100px">Download the manuals you needed here</strong>
</a-form-model-item>
<a-form-model-item>
<strong style="font-size: 16px; color:white;margin-left: 100px">Player Manual:</strong>
<p style="font-size: 16px; color:white;margin-left: 150px">This manual will guide the players how to use the platform</p>
<a-button type="primary" @click="userManual" style="margin-left: 500px">
Download
</a-button>
</a-form-model-item>
<a-form-model-item>
<strong style="font-size: 16px; color: white;margin-left: 100px">Developer Manual:</strong>
<p style="font-size: 16px; color:white;margin-left: 150px">This manual will guide the developers how to use the platform</p>
<a-button type="primary" @click="developerManual" style="margin-left: 500px">
Download
</a-button>
</a-form-model-item>
</a-form-model>
</template>

<script>
Expand All @@ -13,6 +29,12 @@ export default {
}
},
methods: {
userManual () {
window.location.href = 'http://47.115.50.249/api/user/manual?type=user'
},
developerManual () {
window.location.href = 'http://47.115.50.249/api/user/manual?type=developer'
}
}
}
</script>
Expand Down
4 changes: 2 additions & 2 deletions src/views/User_view.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ export default {
friends: [],
recent_games: [],
name: '',
email: '',
unfr: true
email: ''
}
},
created () {
this.getUserInfo()
},
methods: {
async getUserInfo () {
console.log('search_id', this.$route.query.id)
this.unfr = this.$route.query.unfriend !== 'false'
this.id = this.$route.query.id
const result = await this.$http.get('/api/user', { params: { user_id: this.$route.query.id } })
Expand Down

0 comments on commit abff6a1

Please sign in to comment.