Browse Source

新增页面

master
aBin 4 years ago
parent
commit
5d37b65d07
  1. 5
      api/competeTimeList.js
  2. 6
      manifest.json
  3. 10
      pages.json
  4. 3
      pages/Athletes/AthAdd.vue
  5. 3
      pages/Coach/Coach.vue
  6. 97
      pages/First/Choose.vue
  7. 23
      pages/First/First.vue
  8. 4
      pages/Login/Login.vue
  9. 13
      store/modules/project/mutations.js
  10. 1
      store/modules/project/state.js

5
api/competeTimeList.js

@ -0,0 +1,5 @@
const proxyUrl = '/mt';
import { http } from 'plugins/request/index';
// 查看比赛列表
export const competeTimeList = params => http.post(`${proxyUrl}/compete/competeTimeList`, params);

6
manifest.json

@ -101,9 +101,9 @@
"port" : 30022
},
"router" : {
"base" : "/compete-province"
"base" : ""
},
"domain" : "https://www.tall.wiki",
"domain" : "https://test.tall.wiki",
"async" : {
//js
"loading" : "AsyncLoading", //js使
@ -111,7 +111,7 @@
"delay" : 500, // loading js delay loading
"timeout" : 1000 //js error
},
"title" : "2020年山西省学生跳绳比赛报名系统",
"title" : "2021年山西省学生跳绳比赛报名系统",
"optimization" : {
"treeShaking" : {
"enable" : false

10
pages.json

@ -116,10 +116,18 @@
"path" : "pages/Project/MatchDetail/TeamDetail",
"style" : {}
}
,{
"path" : "pages/First/Choose",
"style" : {
"navigationBarTitleText": "选择比赛类型",
"navigationBarTextStyle": "#0a97c6",
"navigationBarBackgroundColor": "#6D99F2"
}
}
],
"globalStyle": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "2020年山西省学生跳绳比赛报名系统",
"navigationBarTitleText": "2021年山西省学生跳绳比赛报名系统",
"navigationBarBackgroundColor": "#6D99F2",
"backgroundColor": "#0a97c6"
},

3
pages/Athletes/AthAdd.vue

@ -269,7 +269,8 @@ import { group } from 'api/group'
// that.urlTobase64(res.tempFilePaths[0],type);
uni.uploadFile({
url: '//www.tall.wiki/gateway/mt/file/upload/photo',
url: '//test.tall.wiki/gateway/mt/file/upload/photo',
// url: '//www.tall.wiki/gateway/mt/file/upload/photo',
filePath: tempFilePaths,
header:{
"Authorization" : "Bearer " + that.$store.state.user.token

3
pages/Coach/Coach.vue

@ -126,7 +126,8 @@
const tempFilePaths = res.tempFilePaths[0]
that[`${type}`] = tempFilePaths
uni.uploadFile({
url: '//www.tall.wiki/gateway/mt/file/upload/photo',
url: '//test.tall.wiki/gateway/mt/file/upload/photo',
// url: '//www.tall.wiki/gateway/mt/file/upload/photo',
filePath: tempFilePaths,
header:{
"Authorization" : "Bearer " + that.$store.state.user.token

97
pages/First/Choose.vue

@ -0,0 +1,97 @@
<template>
<view >
<view class="item-box" v-for="(item,index) in list" :key="index" @click="jump(item)">
<view class="item-num">{{ index + 1 }}</view>
<text class="item-content">{{ item.name }}</text>
<view class="item-infor">
<text style="color:#C0C0C0" v-if="item.competeStatus === 0">已结束</text>
<text style="color:#39B54A" v-else-if="item.competeStatus === 2">
正在报名中
</text>
<text style="color:#F0AD4E" v-else>未开始</text>
</view>
<view class="item-time">
<text :style="{color:item.competeStatus === 2?'#39B54A':'#C0C0C0'}" >
({{$moment(+item.startTime).format('MM-DD HH:mm:ss')}} - {{$moment(+item.endTime).format('MM-DD HH:mm:ss')}})
</text>
</view>
</view>
</view>
</template>
<script>
import { mapMutations } from 'vuex';
import { competeTimeList } from 'api/competeTimeList'
export default {
data() {
return {
list: [],
}
},
created() {
this.getMatchList()
},
methods: {
...mapMutations('project',['setCompanyId','setType']),
async getMatchList() {
const res = await competeTimeList()
this.list = res
},
jump(item) {
console.log(item.competeStatus)
if(item.competeStatus === 2) {
this.setCompanyId(item.id)
this.setType(item.type)
uni.navigateTo({
url:`../First/First`
})
}
}
}
}
</script>
<style lang="scss" scoped>
.item-box {
margin-top: 24px;
height: 80px;
line-height: 80px;
font-size: 18px;
width: 670rpx;
margin-left: 40rpx;
padding-left: 56rpx;
position: relative;
box-shadow: 0px 2px 5px $grey;
border-radius: 10px;
}
.item-num {
position: relative;
width: 40px;
height: 40px;
border-radius: 50%;
top: 20px;
text-align: center;
line-height: 40px;
background-color: #709AFC;
color: #fff;
}
.item-infor {
position: absolute;
left: 180rpx;
font-size: 30rpx;
color: $gray;
top: 6px;
}
.item-content {
position: absolute;
left: 180rpx;
top: -16px;
font-size: 16px;
}
.item-time {
font-size: 24rpx;
position: absolute;
left: 180rpx;
top: 26px;
}
</style>

23
pages/First/First.vue

@ -27,6 +27,7 @@
</template>
<script>
import { mapState } from 'vuex';
import { competeTime } from 'api/competeTime'
import { overview } from 'api/overview'
export default {
@ -37,14 +38,14 @@ import { overview } from 'api/overview'
return {
list: [{
title:'基础信息',
complete: 1
complete: 0
}, {
title:'领队及教练信息',
leader: 2,
leader: 0,
coach: 0
}, {
title:'运动员注册',
athletes: 4
athletes: 0
}, {
title:'参赛项目',
project: 0
@ -68,13 +69,20 @@ import { overview } from 'api/overview'
}]
}
},
watch: {
'$store.state.project.num'(val) {
const that = this
that.query()
}
},
computed: mapState('home',['type']),
methods: {
async query () {
const that = this
try{
const params = {
param: {
type: 0
type: this.type
}
}
const data = await competeTime(params)
@ -156,12 +164,7 @@ import { overview } from 'api/overview'
}
}
},
watch: {
'$store.state.project.num'(val) {
const that = this
that.query()
}
}
}
</script>
<style lang="scss" scoped>

4
pages/Login/Login.vue

@ -38,7 +38,7 @@ import { login } from 'api/login'
const that = this
if (that.$store.state.user.token) {
uni.navigateTo({
url:`../First/First`
url:`../First/Choose`
})
}
},
@ -105,7 +105,7 @@ import { login } from 'api/login'
// console.log(data)
that.cacheData(data)
uni.navigateTo({
url:`../First/First`
url:`../First/Choose`
})
} catch(e){
//TODO handle the exception

13
store/modules/project/mutations.js

@ -1,5 +1,16 @@
const mutations = {
/*
存取比赛的Id
*/
setCompanyId(state,data) {
state.companyId = data
},
/*
存取比赛的Type
*/
setType(state,data) {
state.type = data
}
};
export default mutations;

1
store/modules/project/state.js

@ -1,6 +1,7 @@
const state = {
data: null,
companyId: 0,
type: 0,
num: 0,
Mat: 0
};

Loading…
Cancel
Save