Browse Source

跳绳比赛bug修改

master
aBin 4 years ago
parent
commit
864c7de423
  1. 2
      App.vue
  2. 5
      api/getUserId.js
  3. 4
      manifest.json
  4. 100
      pages/Athletes/AthAdd.vue
  5. 4
      pages/Athletes/Athletes.vue
  6. 8
      pages/Basics/Basics.vue
  7. 5
      pages/Choice/Choice.vue
  8. 4
      pages/Coach/Coach.vue
  9. 6
      pages/First/Choose.vue
  10. 15
      pages/First/First.vue
  11. 83
      pages/Leader/Leader.vue
  12. 37
      pages/Login/Login.vue
  13. 7
      pages/Login/Register.vue
  14. 24
      pages/Project/MatchDetail/TeamDetail.vue
  15. 3
      pages/Project/NumMatch.vue
  16. 20
      pages/Project/Project.vue
  17. 4
      pages/read/read.vue
  18. BIN
      static/item00.png
  19. BIN
      static/item04.jpg

2
App.vue

@ -17,7 +17,7 @@ export default {
},
created () {
//sessionStorage
if (sessionStorage.getItem("store") ) {
if (sessionStorage.getItem("store")) {
this.$store.replaceState(Object.assign({}, this.$store.state,JSON.parse(sessionStorage.getItem("store"))))
}
//vuexsessionStorage

5
api/getUserId.js

@ -0,0 +1,5 @@
const proxyUrl = '/tall/v1.0';
import { http } from 'plugins/request/index';
// 检查是当前token是否过期
export const getUserId = params => http.get(`${proxyUrl}/users/token`, params);

4
manifest.json

@ -101,9 +101,9 @@
"port" : 30022
},
"router" : {
"base" : ""
"base" : "/compete-province"
},
"domain" : "https://test.tall.wiki",
"domain" : "https://www.tall.wiki",
"async" : {
//js
"loading" : "AsyncLoading", //js使

100
pages/Athletes/AthAdd.vue

@ -9,8 +9,8 @@
</view>
<input v-if="item.type === 3" placeholder="请选择" name="input" disabled @click="showBox" v-model.trim="item.content"/>
<view v-if="item.type === 3" class="group-box" v-show="showview === 1">
<view v-for="(item,index) in groupList" :key="index" @click="choice(index)">
{{ item }}
<view v-for="(item,index) in groupList" :key="index" @click="choice(item.value)">
{{ item.text }}
</view>
</view>
</view>
@ -74,7 +74,7 @@
<view class="grid col-4 grid-square flex-sub">
<view class="solids" @click="jump(item.content)">
<text class='cuIcon-cameraadd'></text>
<image class="img-box" :src="insuranceRecord"></image>
<image class="img-box" :src="responsibilityRiskFile"></image>
</view>
</view>
</view>
@ -128,13 +128,13 @@ import { mapState } from 'vuex'
that.studentRecordId = data.studentRecordId
that.healthRecord = data.healthRecord
that.healthRecordId = data.healthRecordId
that.insuranceRecord = data.insuranceRecord
that.insuranceRecordId = data.insuranceRecordId
that.responsibilityRiskFile = data.responsibilityRiskFile
that.responsibilityRiskFileId = data.responsibilityRiskFileId
// for( var i=0; i<data1.length; i++){
// if(data1[i].groupId - 0 === data.groupId - 0) {
var num = data.groupRemark - 0 - 1
that.list[2].content = that.groupList[`${num}`]
that.list[2].content = that.groupList[`${num}`].text
// console.log(data1[i].groupName)
// }
// }
@ -175,7 +175,8 @@ import { mapState } from 'vuex'
}, {
title:'一寸证件照(图片大小不得大于2M)',
type: 5,
tips: '用于生成参赛证及比赛证书',
tips: '',
// tips: '',
content: 'idPhone'
}, {
title:'学籍证明/俱乐部证明(图片大小不得大于2M)',
@ -188,10 +189,10 @@ import { mapState } from 'vuex'
tips: '',
content: 'healthRecord'
}, {
title:'人身意外保险(图片大小不得大于2M)',
title:'自愿参赛责任及风险告知书',
type: 8,
tips: '',
content: 'insuranceRecord'
content: 'responsibilityRiskFile'
}],
idCardFront: '', //
idCardFrontId: '', //
@ -203,12 +204,45 @@ import { mapState } from 'vuex'
studentRecordId: '', //
healthRecord: '', //
healthRecordId: '', //
insuranceRecord: '', //
insuranceRecordId: '', //
responsibilityRiskFile: '', //
responsibilityRiskFileId: '', //
che: 0,
isId: 0,
playerId: 0,
groupList: ['小学','中学','高职院校','本科院校','俱乐部'],
groupList: [
{
text: '小学乙组',
value: 0
},
{
text: '小学甲组',
value: 1
},
{
text: '初中组',
value: 2
},
{
text: '高中(职中)组',
value: 3
},
{
text: '普通院校组',
value: 4
},
{
text: '专科院校组',
value: 5
},
{
text: '特教学校组',
value: 6
},
{
text: '社会俱乐部组',
value: 7
}
],
groupRemark: 0,
showview: 0
}
@ -303,34 +337,6 @@ import { mapState } from 'vuex'
}
})
},
// urlTobase64(url,type){
// const that = this
// uni.request({
// url: url,
// method: 'GET',
// responseType: 'arraybuffer',
// success: async res => {
// let base64 = wx.arrayBufferToBase64(res.data); //arraybufferbase64
// base64 = 'data:image/jpeg;base64,' + base64; //
// // console.log(base64);
// try{
// const params = {
// fileBase64: base64
// }
// const data = await photoBase64(params)
// // console.log(data)
// // console.log(that[`${type}Id`])
// // console.log(that.idCardFrontId)
// // console.log(`${type}Id`)
// }catch(e){
// //TODO handle the exception
// // console.log(e)
// }
// }
// });
// },
showBox() {
const that = this
if (that.showview === 0) {
@ -341,7 +347,7 @@ import { mapState } from 'vuex'
},
choice(index) {
const that = this
that.list[2].content = that.groupList[`${index}`]
that.list[2].content = that.groupList[`${index}`].text
that.groupRemark = index - 0 + 1
that.showview = 0
},
@ -395,9 +401,9 @@ import { mapState } from 'vuex'
icon: 'none',
duration: 1500
})
} else if (that.insuranceRecordId === '') {
} else if (that.responsibilityRiskFileId === '') {
uni.showToast({
title: '请上传保险证明',
title: '自愿参赛责任及风险告知书',
icon: 'none',
duration: 1500
})
@ -415,7 +421,7 @@ import { mapState } from 'vuex'
idPhone: that.idPhoneId,//
studentRecord: that.studentRecordId,//
healthRecord: that.healthRecordId,//
insuranceRecord: that.insuranceRecordId//
responsibilityRiskFile: that.responsibilityRiskFileId//
}
}
const data = await saveplayer(params)
@ -502,9 +508,9 @@ import { mapState } from 'vuex'
icon: 'none',
duration: 1500
})
} else if (that.insuranceRecordId === '') {
} else if (that.responsibilityRiskFileId === '') {
uni.showToast({
title: '请上传保险证明',
title: '自愿参赛责任及风险告知书',
icon: 'none',
duration: 1500
})
@ -523,7 +529,7 @@ import { mapState } from 'vuex'
idPhone: that.idPhoneId,//
studentRecord: that.studentRecordId,//
healthRecord: that.healthRecordId,//
insuranceRecord: that.insuranceRecordId//
responsibilityRiskFile: that.responsibilityRiskFileId//
}
}
const data = await saveplayer(params)

4
pages/Athletes/Athletes.vue

@ -30,7 +30,7 @@ import { mapState } from 'vuex'
import { groupplayer } from 'api/groupplayer'
import { delplayer } from 'api/delplayer'
export default {
async onLoad () {
onLoad () {
this.add()
},
data() {
@ -70,7 +70,7 @@ import { delplayer } from 'api/delplayer'
url:`./AthAdd`
})
},
async Del(num) {
Del(num) {
const that = this
uni.showModal({
title: '提示',

8
pages/Basics/Basics.vue

@ -21,6 +21,7 @@
</template>
<script>
import { mapState,mapMutations } from 'vuex'
import { getcompany } from 'api/getcompany'
import { savecompany } from 'api/savecompany'
export default {
@ -28,7 +29,7 @@ import { savecompany } from 'api/savecompany'
const that = this
// console.log(options)
that.projectId = options.id - 0
that.companyId = options.companyId - 0
that.setCompanyId(options.companyId - 0)
try{
const params = {
param : {
@ -45,7 +46,7 @@ import { savecompany } from 'api/savecompany'
that.che = true
that.sub = false
that.chan = true
that.companyId = options.companyId
that.setCompanyId(options.companyId)
}
}catch(e){
//TODO handle the exception
@ -79,6 +80,7 @@ import { savecompany } from 'api/savecompany'
},
computed:mapState('project',['companyId']),
methods: {
...mapMutations('project',['setCompanyId']),
radioChange() {
const that = this
if (that.che) {
@ -132,7 +134,7 @@ import { savecompany } from 'api/savecompany'
}
}
const data = await savecompany(params)
that.$store.state.project.companyId = data.companyId
that.setCompanyId(data.companyId)
uni.showToast({
title: '提交成功',
icon: 'success',

5
pages/Choice/Choice.vue

@ -7,7 +7,7 @@
</view>
</scroll-view>
<view class="num-box">
<text v-if="TabCur === 0">已填 {{ competeCompanyCoachList.length }} / 2 </text>
<text v-if="TabCur === 0">已填 {{ competeCompanyCoachList.length }} / 1 </text>
<text v-if="TabCur === 1">已填 {{ competeCompanyLeadersList.length }} / 3 </text>
</view>
<button v-show="TabCur === 0 && cha1 !== 2" class="change" :class="cha === 1 ? 'delsure' : ''" @click="change1">
@ -43,7 +43,7 @@
</view>
</view>
</view>
<view v-show="TabCur === 0 && competeCompanyCoachList.length < 2" class="choice" @tap="jump">
<view v-show="TabCur === 0 && competeCompanyCoachList.length < 1" class="choice" @tap="jump">
+添加领队
</view>
<view v-show="TabCur === 1 && competeCompanyLeadersList.length < 3" class="choice" @tap="jump">
@ -53,6 +53,7 @@
</template>
<script>
import { mapState } from 'vuex'
import { querycoach } from 'api/querycoach'
import { deletecoach } from 'api/deletecoach'
export default {

4
pages/Coach/Coach.vue

@ -27,8 +27,8 @@
</view>
</view>
</view>
<text v-if="item.type === 20" class="tips">用于生成参赛证及比赛证书</text>
<!--
<text v-if="item.type === 20" class="tips">用于生成参赛证及比赛证书</text> -->
</view>
<button v-show="isId-0===0" class="btn cu-btn bg-green margin-tb-sm lg" @tap="submit">提交</button>
<button v-show="isId-0===1" class="btn cu-btn bg-blue margin-tb-sm lg" @click="change">修改</button>

6
pages/First/Choose.vue

@ -4,15 +4,15 @@
<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:#F0AD4E" v-if="item.competeStatus === 0">未开始</text>
<text style="color:#39B54A" v-else-if="item.competeStatus === 1">
正在报名中
</text>
<text style="color:#F0AD4E" v-else>未开始</text>
<text style="color:#C0C0C0" v-else>已结束</text>
</view>
<view class="item-time">
<text :style="{color:item.competeStatus === 1?'#39B54A':'#C0C0C0'}" >
({{$moment(+item.startTime).format('MM-DD HH:mm:ss')}} - {{$moment(+item.endTime).format('MM-DD HH:mm:ss')}})
({{$moment(+item.signUpStartTime).format('MM-DD HH:mm:ss')}} - {{$moment(+item.signUpEndTime).format('MM-DD HH:mm:ss')}})
</text>
</view>
</view>

15
pages/First/First.vue

@ -10,7 +10,7 @@
<view class="item-num">{{ index + 1 }}</view>
<text class="item-content">{{ item.title }}</text>
<view v-show="item.complete + 1" class="item-infor">
<text v-if="datalist.companyId === null">填写</text>
<text v-if="!datalist.companyId">填写</text>
<text v-else>已填写</text>
</view>
<view v-show="item.leader + 1" class="item-infor">
@ -52,12 +52,17 @@ import { overview } from 'api/overview'
}],
projectId: 0,
companyId: 0,
datalist: {},
datalist: {
guideNum:0,
coachNum:0,
projectNum:0,
playerNum:0
},
dotStyle: true,
swiperList: [{
id: 0,
type: 'img',
url: 'static/title.png'
url: 'static/item00.png'
}, {
id: 1,
type: 'img',
@ -66,6 +71,10 @@ import { overview } from 'api/overview'
id: 2,
type: 'img',
url: 'static/item02.png'
}, {
id: 2,
type: 'img',
url: 'static/item04.jpg'
}]
}
},

83
pages/Leader/Leader.vue

@ -9,6 +9,14 @@
<radio value="1" :checked="che===1?true:false" /></radio><text></text>
</label>
</radio-group>
<view v-if="item.type === 20" class="cu-form-group">
<view class="grid col-4 grid-square flex-sub">
<view class="solids" @click="jump(item.content)">
<text class='cuIcon-cameraadd'></text>
<image class="img-box" :src="idPhotoUrl"></image>
</view>
</view>
</view>
</view>
<button v-show="isId-0===0" class="btn cu-btn bg-green margin-tb-sm lg" @click="submit">提交</button>
<button v-show="isId-0===1" class="btn cu-btn bg-blue margin-tb-sm lg" @click="change">修改</button>
@ -37,6 +45,8 @@ import { coachInfo } from 'api/coachInfo'
that.list[3].content = data.idCard
that.isId = 1
that.coachId = data.coachId
that.idPhoto = data.idPhotoId
that.idPhotoUrl = data.idPhoto
}catch(e){
//TODO handle the exception
}
@ -60,10 +70,16 @@ import { coachInfo } from 'api/coachInfo'
title:'身份证号',
type: 0,
content: ''
}, {
title:'一寸证件照(图片大小不得大于2M)',
type: 20,
content: 'idPhoto'
}],
che: 0,
isId: 0,
coachId: 0
coachId: 0,
idPhoto: 0,
idPhotoUrl: '',
// imgList: []
}
},
@ -99,7 +115,13 @@ import { coachInfo } from 'api/coachInfo'
icon: 'none',
duration: 1500
})
} else {
} else if (that.idPhotoUrl === '') {
uni.showToast({
title: '请上传证件照',
icon: 'none',
duration: 1500
})
}else {
try{
const params = {
param: {
@ -108,7 +130,8 @@ import { coachInfo } from 'api/coachInfo'
name: that.list[0].content,
gender: that.che,
phone: that.list[2].content,
idCard: that.list[3].content
idCard: that.list[3].content,
idPhoto: that.idPhoto,
}
}
const data = await savecoach(params)
@ -142,6 +165,7 @@ import { coachInfo } from 'api/coachInfo'
},
async change() {
const that = this
console.log(that.idPhotoUrl)
if (that.list[0].content === '') {
uni.showToast({
title: '姓名不能为空',
@ -154,18 +178,24 @@ import { coachInfo } from 'api/coachInfo'
icon: 'none',
duration: 1500
})
} else if (!/^1([3-9])[0-9]{9}$/.test(that.list[2].content)) {
} else if (!/^1([3-9])[0-9]{9}$/.test(that.list[2].content)) {
uni.showToast({
title: '请输入正确的手机号',
icon: 'none',
duration: 2000
})
}else if (that.list[3].content === '') {
} else if (that.list[3].content === '') {
uni.showToast({
title: '身份证号不能为空',
icon: 'none',
duration: 1500
})
} else if (that.idPhotoUrl === '') {
uni.showToast({
title: '请上传证件照',
icon: 'none',
duration: 1500
})
} else {
try{
const params = {
@ -176,9 +206,11 @@ import { coachInfo } from 'api/coachInfo'
name: that.list[0].content,
gender: that.che,
phone: that.list[2].content,
idCard: that.list[3].content
idCard: that.list[3].content,
idPhoto: that.idPhoto,
}
}
console.log(that.idPhoto, that.idPhotoUrl)
const data = await savecoach(params)
uni.showToast({
title: '修改成功',
@ -206,7 +238,44 @@ import { coachInfo } from 'api/coachInfo'
}
}
}
}
},
jump(type) {
const that = this
uni.chooseImage({
count:1,
sizeType: ['compressed'], //
sourceType: ['album', 'camera'], //
success: function (res) {
if (res.tempFiles[0].size > 2*1024*1024) {
uni.showToast({
title: '图片超过2M,请重新选择',
icon: 'none',
duration: 1500
})
} else {
const tempFilePaths = res.tempFilePaths[0]
that[`${type}`] = tempFilePaths
uni.uploadFile({
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
},
name: 'file',
success: (res) => {
// console.log(JSON.stringify());
const jsondata = JSON.parse(res.data)
// console.log(jsondata)
that[`${type}Url`] = jsondata.data.visitUrl
that[`${type}`] = jsondata.data.id
}
});
}
// that.urlTobase64(res.tempFilePaths[0],type);
}
})
},
}
}
</script>

37
pages/Login/Login.vue

@ -33,13 +33,13 @@
<script>
import { mapState, mapMutations, mapActions } from 'vuex';
import { login } from 'api/login'
import { getUserId } from 'api/getUserId'
export default {
onLoad() {
created() {
const that = this
if (that.$store.state.user.token) {
uni.navigateTo({
url:`../First/Choose`
})
console.log(that.token)
if (that.token) {
that.getUser()
}
},
data() {
@ -50,8 +50,12 @@ import { login } from 'api/login'
swiperList: [{
id: 0,
type: 'img',
url: 'static/title.png'
url: 'static/item00.png'
}, {
// id: 0,
// type: 'img',
// url: 'static/title.png'
// }, {
id: 1,
type: 'img',
url: 'static/item01.png',
@ -59,11 +63,29 @@ import { login } from 'api/login'
id: 2,
type: 'img',
url: 'static/item02.png'
}]
},{
id: 3,
type: 'img',
url: 'static/item04.jpg'
},]
}
},
computed: mapState('user',['token']),
methods: {
...mapMutations('user', ['setToken', 'setUser']),
async getUser() {
const params = {
params:{
token: 'Bearer ' + this.token
}
}
const res = await getUserId(params)
if( typeof res === 'object') {
uni.navigateTo({
url:`../First/Choose`
})
}
},
jump() {
uni.navigateTo({
url:`./Register`,
@ -101,6 +123,7 @@ import { login } from 'api/login'
type: 3
}
const data = await login(params)
console.log(data)
localStorage.setItem("token", data.token);
// console.log(data)
that.cacheData(data)

7
pages/Login/Register.vue

@ -28,7 +28,7 @@
<image :src="imgsrc" mode=""></image>
<input type="text" placeholder="请输入验证码" v-model.trim="codeinput"/>
<view class="btn-box">
<button type="default" @click="imgbox = false">关闭</button>
<button type="default" @click="imgbox = false;codeinput=''">关闭</button>
<button type="default" class="success" @click="submit">确定</button>
</view>
</view>
@ -569,6 +569,7 @@ import { phone } from 'api/phone'
icon: 'success',
duration: 3000
})
that.codeinput = ''
if (that.cooling) {
that.cooling = false
var a = 60
@ -697,7 +698,7 @@ import { phone } from 'api/phone'
color: $white;
}
.img-box {
height: 650rpx;
height: 700rpx;
width: 650rpx;
background: white;
border: 1px solid $gray;
@ -728,7 +729,7 @@ import { phone } from 'api/phone'
.btn-box {
display: flex;
position: absolute;
bottom: 0;
bottom: 30rpx;
left: 0;
width: 100%;
height: 80rpx;

24
pages/Project/MatchDetail/TeamDetail.vue

@ -55,24 +55,36 @@
obj:{},
list: [
{
text: '小学',
text: '小学乙组',
value: 0
},
{
text: '中学',
text: '小学甲组',
value: 1
},
{
text: '高职院校',
text: '初中组',
value: 2
},
{
text: '本科院校',
text: '高中(职中)组',
value: 3
},
{
text: '俱乐部',
text: '普通院校组',
value: 4
},
{
text: '专科院校组',
value: 5
},
{
text: '特教学校组',
value: 6
},
{
text: '社会俱乐部组',
value: 7
}
],
list1: [
@ -120,7 +132,7 @@
})
} else if (that.joinNum > that.obj.memberMax) {
uni.showToast({
title:`大于最多人数${that.obj.memberMin}`,
title:`大于最多人数${that.obj.memberMax}`,
icon: 'none',
duration: 1500
})

3
pages/Project/NumMatch.vue

@ -47,6 +47,9 @@ import { secondproject } from 'api/secondproject'
</script>
<style lang="scss" scoped>
.box {
padding-bottom: 100px;
}
.title {
text-align: center;
font-size: 12px;

20
pages/Project/Project.vue

@ -5,7 +5,7 @@
{{ item }}
</text>
</view>
<view class="item-box" v-for="(item,index) in list" :key="index" @click="jump(index,item.projectId)">
<view class="item-box" v-for="(item,index) in list" :key="index" @click="jump(item.projectId)">
<view class="item-num">{{ index + 1 }}</view>
<text class="item-content">{{ item.projectName }}</text>
</view>
@ -13,6 +13,7 @@
</template>
<script>
import { mapState } from 'vuex'
import { firstproject } from 'api/firstproject'
export default {
async onLoad () {
@ -20,7 +21,7 @@ import { firstproject } from 'api/firstproject'
try{
const params = {
param: {
competeTimeId: that.$store.state.project.data.id
competeTimeId: that.data.id
}
}
const data = await firstproject(params)
@ -42,17 +43,12 @@ import { firstproject } from 'api/firstproject'
}],
}
},
computed:mapState('project',['data']),
methods: {
jump (num,id) {
if (num === 0) {
uni.navigateTo({
url:`./NumMatch?id=${id}`
})
} else if (num === 1) {
uni.navigateTo({
url:`./PatternMatch?id=${id}`
})
}
jump (id) {
uni.navigateTo({
url:`./NumMatch?id=${id}`
})
}
}
}

4
pages/read/read.vue

@ -1,13 +1,13 @@
<template>
<view class="box">
<view class="title">
2020年山西省学生跳绳比赛
2021年山西省学生跳绳比赛
</view>
<view class="title-safe">
安全责任书
</view>
<view class="content">
本人自愿报名参加2020年山西省学生跳绳比赛并签署本责任书
本人自愿报名参加2021年山西省学生跳绳比赛并签署本责任书
</view>
<view class="content">
本人已全面了解并同意遵守大会所制订的各项竞赛规程规则要求及采取的安全措施

BIN
static/item00.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

BIN
static/item04.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

Loading…
Cancel
Save