From 0f354da0a6957594f937736e38bf907f10a474a7 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 12 Nov 2020 09:16:53 +0800 Subject: [PATCH] =?UTF-8?q?=E2=80=9C=E5=A4=9A=E5=8A=9F=E8=83=BD=E6=8A=A5?= =?UTF-8?q?=E5=90=8Dbug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 1 + manifest.json | 11 +++- pages.json | 6 +- pages/Athletes/AthAdd.vue | 74 ++++++++++++++--------- pages/Basics/Basics.vue | 20 ++++-- pages/Choice/Choice.vue | 4 +- pages/Coach/Coach.vue | 46 +++++++++----- pages/First/First.vue | 23 ++++--- pages/Leader/Leader.vue | 42 +++++++++---- pages/Login/Login.vue | 4 +- pages/Login/Register.vue | 40 ++++++++---- pages/Login/Retrieve.vue | 24 +++++--- pages/Project/MatchDetail/MatchDetail.vue | 55 +++++++++++++---- pages/Project/MatchDetail/TeamDetail.vue | 59 +++++++++++++----- pages/Project/MatchDetail/TeamMatch.vue | 8 +-- pages/Project/NumMatch.vue | 2 +- pages/Project/PatternMatch.vue | 2 +- pages/Project/Project.vue | 2 +- pages/read/Privacy.vue | 2 +- store/modules/user/state.js | 4 +- 20 files changed, 297 insertions(+), 132 deletions(-) diff --git a/App.vue b/App.vue index d2b8335..51c760c 100644 --- a/App.vue +++ b/App.vue @@ -12,6 +12,7 @@ export default { var obj = localStorage.getItem('token') // console.log(JSON.parse(obj)) this.$store.state.user.token = obj + this.$store.state.user.user.token = obj } }, created () { diff --git a/manifest.json b/manifest.json index d9c580e..2277717 100644 --- a/manifest.json +++ b/manifest.json @@ -101,9 +101,9 @@ "port" : 30022 }, "router" : { - "base" : "/compete" + "base" : "/compete-province" }, - "domain" : "https://test.tall.wiki", + "domain" : "https://www.tall.wiki", "async" : { //页面js异步加载配置 "loading" : "AsyncLoading", //页面js加载时使用的组件(需注册为全局组件) @@ -111,6 +111,11 @@ "delay" : 500, //展示 loading 加载组件的延时时间(页面 js 若在 delay 时间内加载完成,则不会显示 loading 组件) "timeout" : 1000 //页面js加载超时时间(超时后展示 error 对应的组件) }, - "title" : "2020年山西省学生跳绳比赛报名系统" + "title" : "2020年山西省学生跳绳比赛报名系统", + "optimization" : { + "treeShaking" : { + "enable" : false + } + } } } diff --git a/pages.json b/pages.json index 07c76cf..3fb95dc 100644 --- a/pages.json +++ b/pages.json @@ -98,7 +98,11 @@ } ,{ "path" : "pages/Project/PatternMatch", - "style" : {} + "style" : { + "navigationBarTitleText": "花样赛项目", + "navigationBarTextStyle": "black", + "navigationBarBackgroundColor": "#f8f8f8" + } } ,{ "path" : "pages/Login/Retrieve", diff --git a/pages/Athletes/AthAdd.vue b/pages/Athletes/AthAdd.vue index 5b27585..4c629e9 100644 --- a/pages/Athletes/AthAdd.vue +++ b/pages/Athletes/AthAdd.vue @@ -38,7 +38,7 @@ - + @@ -193,17 +193,17 @@ import { group } from 'api/group' content: 'insuranceRecord' }], idCardFront: '', //身份证正面照片 或户口本照片 (文件类型) - idCardFrontId: '1326409300276547584', //身份证正面照片 或户口本照片 (文件类型) - idCardBack: '', //身份证反面照片(文件类型) - idCardBackId: '1326409300276547584', //身份证反面照片(文件类型) + idCardFrontId: '', //身份证正面照片 或户口本照片 (文件类型) + idCardBack: null, //身份证反面照片(文件类型) + idCardBackId: '', //身份证反面照片(文件类型) idPhone: '', //一寸证件照(文件类型) - idPhoneId: '1326409300276547584', //一寸证件照(文件类型) + idPhoneId: '', //一寸证件照(文件类型) studentRecord: '', //学籍证明(文件类型) - studentRecordId: '1326409300276547584', //学籍证明(文件类型) + studentRecordId: '', //学籍证明(文件类型) healthRecord: '', //体检证明(文件类型) - healthRecordId: '1326409300276547584', //体检证明(文件类型) + healthRecordId: '', //体检证明(文件类型) insuranceRecord: '', //保险证明(文件类型) - insuranceRecordId: '1326409300276547584', //保险证明(文件类型) + insuranceRecordId: '', //保险证明(文件类型) che: 0, isId: 0, playerId: 0, @@ -232,7 +232,7 @@ import { group } from 'api/group' content: '确定要删除这张图片么?', success: (res) => { if (res.confirm) { - that.idCardBack = '' + that.idCardBack = null that.idCardBackId = '' } }, @@ -269,10 +269,10 @@ import { group } from 'api/group' // that.urlTobase64(res.tempFilePaths[0],type); uni.uploadFile({ - url: '//www.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.user.token + "Authorization" : "Bearer " + that.$store.state.user.token }, name: 'file', success: (res) => { @@ -428,11 +428,19 @@ import { group } from 'api/group' // console.log(that.$store.state.project.num) }catch(e){ //TODO handle the exception - uni.showToast({ - title: e, - icon: 'none', - duration: 1500 - }) + if (e === 'error') { + uni.showToast({ + title: '提交失败', + icon: 'none', + duration: 1500 + }) + } else { + uni.showToast({ + title: e, + icon: 'none', + duration: 1500 + }) + } } } }, @@ -463,17 +471,16 @@ import { group } from 'api/group' duration: 1500 }) } else if (that.idCardFrontId === '') { - uni.showToast({ - title: '请上传身份证正面照', - icon: 'none', - duration: 1500 - }) - } else if (that.idCardBackId === '') { - uni.showToast({ - title: '请上传身份证反面照', - icon: 'none', - duration: 1500 - }) + if (that.idCardBackId === '') { + uni.showToast({ + title: '请上传身份证正面照', + icon: 'none', + duration: 1500 + }) + } else { + that.idCardFrontId = that.idCardBackId + that.idCardBackId = '' + } } else if (that.idPhoneId === '') { uni.showToast({ title: '请上传一寸证件照', @@ -529,6 +536,19 @@ import { group } from 'api/group' // console.log(that.$store.state.project.num) }catch(e){ //TODO handle the exception + if (e === 'error') { + uni.showToast({ + title: '提交失败', + icon: 'none', + duration: 1500 + }) + } else { + uni.showToast({ + title: e, + icon: 'none', + duration: 1500 + }) + } } } } diff --git a/pages/Basics/Basics.vue b/pages/Basics/Basics.vue index 804f6ea..81e507a 100644 --- a/pages/Basics/Basics.vue +++ b/pages/Basics/Basics.vue @@ -26,7 +26,7 @@ import { savecompany } from 'api/savecompany' export default { async onLoad (options) { const that = this - console.log(options) + // console.log(options) that.projectId = options.id - 0 that.companyId = options.companyId - 0 try{ @@ -148,11 +148,19 @@ import { savecompany } from 'api/savecompany' that.$store.state.project.num++ }catch(e){ //TODO handle the exception - uni.showToast({ - title: e, - icon: 'none', - duration: 1500 - }) + if (e === 'error') { + uni.showToast({ + title: '提交失败', + icon: 'none', + duration: 1500 + }) + } else { + uni.showToast({ + title: e, + icon: 'none', + duration: 1500 + }) + } } } }, diff --git a/pages/Choice/Choice.vue b/pages/Choice/Choice.vue index 7556953..dc5515a 100644 --- a/pages/Choice/Choice.vue +++ b/pages/Choice/Choice.vue @@ -73,10 +73,10 @@ tabSelect(e) { this.TabCur = e.currentTarget.dataset.id - 0; this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60 - console.log(this.TabCur,this.cha,this.cha1) + // console.log(this.TabCur,this.cha,this.cha1) }, async del(num) { - console.log(num) + // console.log(num) const that = this uni.showModal({ title: '提示', diff --git a/pages/Coach/Coach.vue b/pages/Coach/Coach.vue index 5d7022d..612be35 100644 --- a/pages/Coach/Coach.vue +++ b/pages/Coach/Coach.vue @@ -43,7 +43,7 @@ async onLoad(option) { const that = this if(option.id) { - console.log(option) + // console.log(option) try{ const params = { param: { @@ -51,7 +51,7 @@ } } const data = await coachInfo(params) - console.log(data) + // console.log(data) that.list[0].content = data.name that.che = data.gender that.list[2].content = data.phone @@ -107,7 +107,7 @@ radioChange(e) { const that = this that.che = e.detail.value - 0 - console.log(that.che) + // console.log(that.che) }, jump(type) { const that = this @@ -129,13 +129,13 @@ url: '//www.tall.wiki/gateway/mt/file/upload/photo', filePath: tempFilePaths, header:{ - "Authorization" : "Bearer " + that.$store.state.user.user.token + "Authorization" : "Bearer " + that.$store.state.user.token }, name: 'file', success: (res) => { // console.log(JSON.stringify()); const jsondata = JSON.parse(res.data) - console.log(jsondata) + // console.log(jsondata) that[`${type}Url`] = jsondata.data.visitUrl that[`${type}`] = jsondata.data.id } @@ -227,11 +227,19 @@ },1000) }catch(e){ //TODO handle the exception - uni.showToast({ - title: e, - icon: 'none', - duration: 1500 - }) + if (e === 'error') { + uni.showToast({ + title: '提交失败', + icon: 'none', + duration: 1500 + }) + } else { + uni.showToast({ + title: e, + icon: 'none', + duration: 1500 + }) + } } } }, @@ -294,11 +302,19 @@ },1000) }catch(e){ //TODO handle the exception - uni.showToast({ - title: e, - icon: 'none', - duration: 1500 - }) + if (e === 'error') { + uni.showToast({ + title: '提交失败', + icon: 'none', + duration: 1500 + }) + } else { + uni.showToast({ + title: e, + icon: 'none', + duration: 1500 + }) + } } } } diff --git a/pages/First/First.vue b/pages/First/First.vue index 3762a5c..b9f8326 100644 --- a/pages/First/First.vue +++ b/pages/First/First.vue @@ -80,7 +80,7 @@ import { overview } from 'api/overview' const data = await competeTime(params) that.projectId = data.id that.$store.state.project.data = data - console.log(that.$store.state.project.data) + // console.log(that.$store.state.project.data) if (data.id) { const params = { param : { @@ -91,17 +91,26 @@ import { overview } from 'api/overview' if (datalist.companyId) { that.companyId = datalist.companyId } - console.log(datalist.companyId) + // console.log(datalist.companyId) that.datalist = datalist that.$store.state.project.companyId = datalist.companyId - console.log(that.$store.state.project.companyId) + // console.log(that.$store.state.project.companyId) } }catch(e){ //TODO handle the exception - uni.showToast({ - title: e, - icon: 'none' - }) + if (e === 'error') { + uni.showToast({ + title: '提交失败', + icon: 'none', + duration: 1500 + }) + } else { + uni.showToast({ + title: e, + icon: 'none', + duration: 1500 + }) + } } }, jump (num) { diff --git a/pages/Leader/Leader.vue b/pages/Leader/Leader.vue index 7a9335b..c94a4d1 100644 --- a/pages/Leader/Leader.vue +++ b/pages/Leader/Leader.vue @@ -22,7 +22,7 @@ import { coachInfo } from 'api/coachInfo' async onLoad(option) { const that = this if(option.id) { - console.log(option) + // console.log(option) try{ const params = { param: { @@ -30,7 +30,7 @@ import { coachInfo } from 'api/coachInfo' } } const data = await coachInfo(params) - console.log(data) + // console.log(data) that.list[0].content = data.name that.che = data.gender that.list[2].content = data.phone @@ -71,7 +71,7 @@ import { coachInfo } from 'api/coachInfo' radioChange(e) { const that = this that.che = e.detail.value - 0 - console.log(that.che) + // console.log(that.che) }, async submit() { const that = this @@ -123,11 +123,19 @@ import { coachInfo } from 'api/coachInfo' },1000) }catch(e){ //TODO handle the exception - uni.showToast({ - title: e, - icon: 'none', - duration: 1500 - }) + if (e === 'error') { + uni.showToast({ + title: '提交失败', + icon: 'none', + duration: 1500 + }) + } else { + uni.showToast({ + title: e, + icon: 'none', + duration: 1500 + }) + } } } // console.log('提交事件') @@ -183,11 +191,19 @@ import { coachInfo } from 'api/coachInfo' },1000) }catch(e){ //TODO handle the exception - uni.showToast({ - title: e, - icon: 'none', - duration: 1500 - }) + if (e === 'error') { + uni.showToast({ + title: '提交失败', + icon: 'none', + duration: 1500 + }) + } else { + uni.showToast({ + title: e, + icon: 'none', + duration: 1500 + }) + } } } } diff --git a/pages/Login/Login.vue b/pages/Login/Login.vue index 2d7dcc9..2f60480 100644 --- a/pages/Login/Login.vue +++ b/pages/Login/Login.vue @@ -102,14 +102,14 @@ import { login } from 'api/login' } const data = await login(params) localStorage.setItem("token", data.token); - console.log(data) + // console.log(data) that.cacheData(data) uni.navigateTo({ url:`../First/First` }) } catch(e){ //TODO handle the exception - console.log(e) + // console.log(e) uni.showToast({ title:e, icon: "none", diff --git a/pages/Login/Register.vue b/pages/Login/Register.vue index ad77645..504b113 100644 --- a/pages/Login/Register.vue +++ b/pages/Login/Register.vue @@ -484,7 +484,7 @@ import { phone } from 'api/phone' source: 1 } const data = await register(params) - console.log(data) + // console.log(data) if (!data || !data.token) { uni.showToast({ title: '注册失败', @@ -505,11 +505,19 @@ import { phone } from 'api/phone' } }catch(e){ //TODO handle the exception - uni.showToast({ - title: e, - icon: 'none', - duration: 1500 - }) + if (e === 'error') { + uni.showToast({ + title: '提交失败', + icon: 'none', + duration: 1500 + }) + } else { + uni.showToast({ + title: e, + icon: 'none', + duration: 1500 + }) + } that.safe = 0 } } @@ -553,7 +561,7 @@ import { phone } from 'api/phone' } } const data = await getcode(params) - console.log(data) + // console.log(data) if (data.expiredInSeconds) { that.imgbox = false uni.showToast({ @@ -578,11 +586,19 @@ import { phone } from 'api/phone' } }catch(e){ //TODO handle the exception - uni.showToast({ - title: e, - icon: 'none', - duration: 1500 - }) + if (e === 'error') { + uni.showToast({ + title: '提交失败', + icon: 'none', + duration: 1500 + }) + } else { + uni.showToast({ + title: e, + icon: 'none', + duration: 1500 + }) + } } } }, diff --git a/pages/Login/Retrieve.vue b/pages/Login/Retrieve.vue index 77b0aef..9708002 100644 --- a/pages/Login/Retrieve.vue +++ b/pages/Login/Retrieve.vue @@ -78,7 +78,7 @@ import { getcode } from 'api/getcode' } const data = await getbase(params) - console.log(data) + // console.log(data) that.imgsrc = data.imageBase64 that.codeId = data.verificationCodeId that.imgbox = true @@ -93,7 +93,7 @@ import { getcode } from 'api/getcode' code: that.code } const data = await password(params) - console.log(data) + // console.log(data) if (!data || !data.token) { uni.showToast({ title: '修改成功', @@ -103,11 +103,19 @@ import { getcode } from 'api/getcode' } }catch(e){ //TODO handle the exception - uni.showToast({ - title: e, - icon: 'none', - duration: 1500 - }) + if (e === 'error') { + uni.showToast({ + title: '提交失败', + icon: 'none', + duration: 1500 + }) + } else { + uni.showToast({ + title: e, + icon: 'none', + duration: 1500 + }) + } } }, async submit() { @@ -121,7 +129,7 @@ import { getcode } from 'api/getcode' } } const data = await getcode(params) - console.log(data) + // console.log(data) if (data.expiredInSeconds) { that.imgbox = false uni.showToast({ diff --git a/pages/Project/MatchDetail/MatchDetail.vue b/pages/Project/MatchDetail/MatchDetail.vue index d2ca140..6460fae 100644 --- a/pages/Project/MatchDetail/MatchDetail.vue +++ b/pages/Project/MatchDetail/MatchDetail.vue @@ -36,7 +36,8 @@ import { join } from 'api/join' objdata: {}, submit: 2, changeList: [], - originalList: [] + originalList: [], + joinNum:0 } }, methods: { @@ -57,12 +58,21 @@ import { join } from 'api/join' } else { that.submit = 2 } + for (var i=0; i - 暂无运动员信息 + 暂无报名信息 @@ -38,10 +38,13 @@ const that = this that.obj = JSON.parse(option.obj) that.showms = that.obj.joinRule - if (option.groupRemark - 0) { + if (option.groupRemark) { + // console.log('1') that.value = option.groupRemark - 0 - 1 that.value1 = option.gender - 0 + that.query() } else { + // console.log('2') that.query() } // console.log(that.obj,option) @@ -166,11 +169,19 @@ // console.log(that.$store.state) }catch(e){ //TODO handle the exception - uni.showToast({ - title: e, - icon: 'none', - duration: 1500 - }) + if (e === 'error') { + uni.showToast({ + title: '提交失败', + icon: 'none', + duration: 1500 + }) + } else { + uni.showToast({ + title: e, + icon: 'none', + duration: 1500 + }) + } } } // } @@ -192,21 +203,37 @@ }, async query() { const that = this + // console.log('xxx') try{ - const params = { - param: { - companyId: that.$store.state.project.companyId, - gender: that.value1, - groupRemark: that.value - 0 + 1, - projectId: that.obj.id + var params = {} + if (that.obj.joinRule) { + params = { + param: { + companyId: that.$store.state.project.companyId, + projectId: that.obj.id + } + } + } else { + params = { + param: { + companyId: that.$store.state.project.companyId, + gender: that.value1, + groupRemark: that.value - 0 + 1, + projectId: that.obj.id + } } } - that.list2 = [] const data = await rulePlayer(params) + that.list2 = [] if (that.obj.joinRule - 0 === 0 && that.value1 - 0 !== 2) { that.list2 = data[0].playerList - } else { - console.log(data) + } else if (that.obj.joinRule - 0 === 0 && that.value1 - 0 === 2) { + // console.log(data) + for (var i=0;i - 暂无运动员信息 + 暂无报名信息 @@ -35,7 +35,7 @@ onLoad(option) { const that = this var OBJ = JSON.parse(option.obj) - console.log(option.TypeNum,OBJ) + // console.log(option.TypeNum,OBJ) that.obj = OBJ that.query() }, @@ -53,7 +53,7 @@ content: '确定要删除整组么?', success: async (res) => { if (res.confirm) { - console.log(index) + // console.log(index) const params = { param: { teamId: index @@ -94,7 +94,7 @@ } const data = await teamProject(params) that.list = data - console.log(that.list) + // console.log(that.list) } }, watch:{ diff --git a/pages/Project/NumMatch.vue b/pages/Project/NumMatch.vue index 438365b..9cbf4d3 100644 --- a/pages/Project/NumMatch.vue +++ b/pages/Project/NumMatch.vue @@ -20,7 +20,7 @@ import { secondproject } from 'api/secondproject' } const data = await secondproject(params) that.list = data - console.log(data) + // console.log(data) }catch(e){ //TODO handle the exception } diff --git a/pages/Project/PatternMatch.vue b/pages/Project/PatternMatch.vue index 28226b9..4592ac0 100644 --- a/pages/Project/PatternMatch.vue +++ b/pages/Project/PatternMatch.vue @@ -20,7 +20,7 @@ import { secondproject } from 'api/secondproject' } const data = await secondproject(params) that.list = data - console.log(data) + // console.log(data) }catch(e){ //TODO handle the exception } diff --git a/pages/Project/Project.vue b/pages/Project/Project.vue index f8da93c..8d29167 100644 --- a/pages/Project/Project.vue +++ b/pages/Project/Project.vue @@ -25,7 +25,7 @@ import { firstproject } from 'api/firstproject' } const data = await firstproject(params) that.list = data - console.log(data) + // console.log(data) }catch(e){ //TODO handle the exception } diff --git a/pages/read/Privacy.vue b/pages/read/Privacy.vue index 1ecce99..33c886e 100644 --- a/pages/read/Privacy.vue +++ b/pages/read/Privacy.vue @@ -9,7 +9,7 @@ onLoad(option) { const that = this that.type = option.type - that.token = that.$store.state.user.user.token + that.token = that.$store.state.user.token that.src = `http://test.tall.wiki/compete/index/index.html?type=` + option.type + `&token=` + that.token }, data() { diff --git a/store/modules/user/state.js b/store/modules/user/state.js index 6d0c109..c930e1b 100644 --- a/store/modules/user/state.js +++ b/store/modules/user/state.js @@ -1,6 +1,8 @@ const state = { token: '', - user: null, + user: { + token:'' + }, fingerprint: 0 };