Browse Source

修复已知问题,优化数据录入等

master
zmt 3 years ago
parent
commit
925e4a4ba9
  1. 4
      nxTemp/config/requestConfig.js
  2. 5
      nxTemp/request/core/request.js
  3. 63
      pages/event/event_grade.vue
  4. 21
      pages/event/event_list.vue
  5. 27
      pages/login/login.vue

4
nxTemp/config/requestConfig.js

@ -183,7 +183,7 @@ $http.dataFactory = async function(res) {
// 返回错误的结果(catch接受数据) // 返回错误的结果(catch接受数据)
return Promise.reject({ return Promise.reject({
statusCode: 0, statusCode: 0,
errMsg: "【request】" + (httpData.info || httpData.msg),
errMsg: "请求失败:" + (httpData.info || httpData.msg),
data: res.data data: res.data
}); });
} else if (httpData.code == "401") { // token失效 } else if (httpData.code == "401") { // token失效
@ -211,7 +211,7 @@ $http.dataFactory = async function(res) {
// 返回错误的结果(catch接受数据) // 返回错误的结果(catch接受数据)
return Promise.reject({ return Promise.reject({
statusCode: 0, statusCode: 0,
errMsg: "【request】" + (httpData.info || httpData.msg|| httpData.message),
errMsg: "请求失败:" + (httpData.info || httpData.msg|| httpData.message),
data: res.data data: res.data
}); });
} }

5
nxTemp/request/core/request.js

@ -88,9 +88,10 @@ export default class request {
changekeys.forEach(key => { changekeys.forEach(key => {
requestInfo[key] = requestStart[key]; requestInfo[key] = requestStart[key];
}); });
} else {
} else {
console.log("【request】请求开始拦截器未通过");
throw { throw {
errMsg: "【request】请求开始拦截器未通过",
errMsg: "请重试",
statusCode: 0, statusCode: 0,
data: requestInfo.data, data: requestInfo.data,
method: requestInfo.method, method: requestInfo.method,

63
pages/event/event_grade.vue

@ -24,14 +24,14 @@
<view class="card flex_row flex_between" v-for="(u,ukey) in i.son_list"> <view class="card flex_row flex_between" v-for="(u,ukey) in i.son_list">
<view class="persion flex_row"> <view class="persion flex_row">
<image class="bg-brown" :src="u.member_img" :key="ukey" mode=""></image>
<image class="" :src="u.member_img" :key="ukey" mode=""></image>
<text>{{u.member_name}}</text> <text>{{u.member_name}}</text>
</view> </view>
<view class="btn-box flex_row"> <view class="btn-box flex_row">
<view class="btn state-0 flex_row" v-if="u.is_set_score" @click="openGrade(u)">已打分</view>
<view class="btn state-1 flex_row" v-else @click="openGrade(u)">打分</view>
<view class="btn state-2 flex_row" @click="openGradeRank(u)">数据</view>
<view class="btn state-0 flex_row" v-if="u.is_set_score" @click="openGrade(i,u)">已打分</view>
<view class="btn state-1 flex_row" v-else @click="openGrade(i,u)">打分</view>
<view class="btn state-2 flex_row" @click="openGradeRank(i,u)">数据</view>
</view> </view>
</view> </view>
</view> </view>
@ -52,14 +52,14 @@
<view class="card flex_row flex_between" v-for="(u,ukey) in pageList" :key="ukey"> <view class="card flex_row flex_between" v-for="(u,ukey) in pageList" :key="ukey">
<view class="persion flex_row"> <view class="persion flex_row">
<image class="bg-brown" :src="u.member_img" :key="ukey" mode=""></image>
<image class="" :src="u.member_img" :key="ukey" mode=""></image>
<text>{{u.member_name}}</text> <text>{{u.member_name}}</text>
</view> </view>
<view class="btn-box flex_row"> <view class="btn-box flex_row">
<view class="btn state-0 flex_row" v-if="u.is_set_score" @click="openGrade(u)">已打分</view>
<view class="btn state-1 flex_row" v-else @click="openGrade(u)">打分</view>
<view class="btn state-2 flex_row" @click="openGradeRank(u)">数据</view>
<view class="btn state-0 flex_row" v-if="u.is_set_score" @click="openGrade(i,u)">已打分</view>
<view class="btn state-1 flex_row" v-else @click="openGrade(i,u)">打分</view>
<view class="btn state-2 flex_row" @click="openGradeRank(i,u)">数据</view>
</view> </view>
</view> </view>
</view> </view>
@ -97,11 +97,14 @@
<image class="g-close" src="../../static/images/event/event_close.png" mode="" @click="closeGradeRank()"></image> <image class="g-close" src="../../static/images/event/event_close.png" mode="" @click="closeGradeRank()"></image>
<text class="g-title">{{match_name}}数据</text> <text class="g-title">{{match_name}}数据</text>
<text class="g-txt">{{gradeDataRank.user.member_name}}分数录入</text> <text class="g-txt">{{gradeDataRank.user.member_name}}分数录入</text>
<view class="g-input-box">
<view class="b-item flex_row" v-for="(si,sk) in gradeDataRank.list" :key="sk">
<text>{{si.rank_param_name}}</text>
<input type="number" value="" v-model="si.val" placeholder="请录入数据" placeholder-class="place-style"/>
</view>
<view class="g-input-box flex_col">
<scroll-view scroll-y="true" class="scroll-Y">
<view class="b-item flex_row" v-for="(si,sk) in gradeDataRank.list" :key="sk">
<text>{{si.rank_param_name}}</text>
<input type="number" value="" v-model="si.val" placeholder="请录入数据" placeholder-class="place-style"/>
</view>
</scroll-view>
<!-- <view class="b-item flex_row"> <!-- <view class="b-item flex_row">
<text>助攻</text> <text>助攻</text>
<input type="number" value="" placeholder="请录入数据" placeholder-class="place-style"/> <input type="number" value="" placeholder="请录入数据" placeholder-class="place-style"/>
@ -112,7 +115,7 @@
</view> --> </view> -->
</view> </view>
<view class="g-tip">请输入成员该赛程最终得分非累计</view>
<view class="g-tip">数据录入会累计到用户原有数据中</view>
<view class="g-btn flex_row" @click="saveRank()">保存</view> <view class="g-btn flex_row" @click="saveRank()">保存</view>
</view> </view>
</view> </view>
@ -144,11 +147,11 @@
pageList:[], pageList:[],
gradeData:{// gradeData:{//
user:"", user:"",
score:0
score:""
}, },
gradeDataRank:{// gradeDataRank:{//
user:"", user:"",
score:0,
score:"",
list:"" list:""
}, },
brand_id:"", brand_id:"",
@ -176,7 +179,7 @@
methods: { methods: {
// //
updatePage() { updatePage() {
if(this.listLoadFinished)return this.$tools.showNone("已加载完毕")
if(this.listLoadFinished)return console.log("已加载完毕")
getPostAPI(this)(this.postData).then(res => { getPostAPI(this)(this.postData).then(res => {
this.pageList.push(...res.list) this.pageList.push(...res.list)
this.match_name = res.match_name this.match_name = res.match_name
@ -224,7 +227,9 @@
}, },
saveGrade() {// saveGrade() {//
let {score} = this.gradeData let {score} = this.gradeData
let {order_no,schedule_son_id,id:schedule_id} = this.gradeData.user
score = parseFloat(score)
let {order_no,schedule_son_id} = this.gradeData.user
let {id:schedule_id} = this.gradeData.item
if(score<=0)return this.$tools.showNone("请输入分数"); if(score<=0)return this.$tools.showNone("请输入分数");
getPostAPI(this)(getPostData(this)).then(res => { getPostAPI(this)(getPostData(this)).then(res => {
this.$tools.showNone("已保存"); this.$tools.showNone("已保存");
@ -241,25 +246,31 @@
return [{order_no,schedule_son_id,schedule_id,score},{order_no,score,brand_id}][that.headIndex] return [{order_no,schedule_son_id,schedule_id,score},{order_no,score,brand_id}][that.headIndex]
} }
}, },
openGrade(user) {
openGrade(item,user) {
this.showGrade = true this.showGrade = true
this.gradeData.user = user this.gradeData.user = user
this.gradeData.score = ""
console.log('open',JSON.stringify(user));
this.gradeData.score = user.score //
this.gradeData.item = item
console.log('open',item,JSON.stringify(user));
}, },
closeGrade() { closeGrade() {
this.showGrade = false this.showGrade = false
this.resetPostData()
this.updatePage()
console.log('closeGrade'); console.log('closeGrade');
}, },
async openGradeRank(user) {
async openGradeRank(item,user) {
this.gradeDataRank.user = user this.gradeDataRank.user = user
this.gradeDataRank.score = ""
this.gradeDataRank.score = user.score //
this.gradeDataRank.item = item
let res = await this.updateRankList() let res = await this.updateRankList()
this.showGradeRank = true this.showGradeRank = true
console.log('openGradeRank',res); console.log('openGradeRank',res);
}, },
closeGradeRank() { closeGradeRank() {
this.showGradeRank = false this.showGradeRank = false
this.resetPostData()
this.updatePage()
console.log('closeGradeRank'); console.log('closeGradeRank');
}, },
saveRank(){ saveRank(){
@ -279,12 +290,13 @@
function getRankData(that){ function getRankData(that){
return that.gradeDataRank.list.map((item)=>{ return that.gradeDataRank.list.map((item)=>{
let {id,val} = item let {id,val} = item
val = parseFloat(val)
return {id,val} return {id,val}
}) })
} }
function checkData(list){ function checkData(list){
return list.every((e)=>{ return list.every((e)=>{
return parseInt(e.val)>0
return parseFloat(e.val)>0
}) })
} }
}, },
@ -480,6 +492,9 @@
padding-left:72rpx; padding-left:72rpx;
padding-right: 80rpx; padding-right: 80rpx;
.g-input-box{ .g-input-box{
.scroll-Y{
height: 300rpx;
}
.b-item{ .b-item{
margin-top: 20rpx; margin-top: 20rpx;
> text{ > text{

21
pages/event/event_list.vue

@ -15,7 +15,7 @@
<text>前报名</text> <text>前报名</text>
</view> </view>
<view class="box flex_row flex_start_y"> <view class="box flex_row flex_start_y">
<text class="img_tag" :class="i.match_status_text=='已结束'?'img_tag_white':''" >{{i.match_status_text}}</text>
<image class="img" :src="i.match_cover" mode=""></image> <image class="img" :src="i.match_cover" mode=""></image>
<view class="info flex_col flex_start flex_start_y"> <view class="info flex_col flex_start flex_start_y">
@ -138,6 +138,25 @@ page{
height: 224rpx; height: 224rpx;
background-color: lightgray; background-color: lightgray;
} }
.img_tag{
position: absolute;
left: 40rpx;
top: 120rpx;
z-index: 99;
width: 100rpx;
height: 40rpx;
background: #009874;
border-radius: 6rpx;
font-size: 24rpx;
color: #FFFFFF;
font-weight: border;
text-align: center;
line-height: 40rpx;
}
.img_tag_white{
background: #FFFFFF;
color: #9A9A9D;
}
.info{ .info{
width: 350rpx; width: 350rpx;
font-size: 36rpx; font-size: 36rpx;

27
pages/login/login.vue

@ -8,7 +8,9 @@
<view class="sjh list-call"> <view class="sjh list-call">
<input class="sl-input" v-model="login.mobile" type="number" maxlength="11" placeholder="输入手机号码" /> <input class="sl-input" v-model="login.mobile" type="number" maxlength="11" placeholder="输入手机号码" />
</view> </view>
<view class="tips" v-if="showPhoneErr">手机号码格式错误请重新填写</view>
<view class="tips">
<text v-if="showPhoneErr">手机号码格式错误请重新填写</text>
</view>
<view class="yzm flex_row"> <view class="yzm flex_row">
<view class="list-call l-short"> <view class="list-call l-short">
@ -21,7 +23,9 @@
</view> </view>
<view v-else class="list-call l-small flex_col">{{count}}s</view> <view v-else class="list-call l-small flex_col">{{count}}s</view>
</view> </view>
<view class="tips" v-if="showCodeErr">验证码错误请重新填写</view>
<view class="tips" >
<text v-if="showCodeErr">验证码错误请重新填写</text>
</view>
</view> </view>
@ -56,7 +60,7 @@
data() { data() {
return { return {
sended:false,// sended:false,//
count:5,
count:60,
code:"", code:"",
agreed:false,// agreed:false,//
login: {// login: {//
@ -139,7 +143,7 @@
} }
postSendSMS({mobile}).then(res => { postSendSMS({mobile}).then(res => {
this.$tools.showNone("发送成功"); this.$tools.showNone("发送成功");
this.login.ticket = res.data||""
this.login.ticket = res||""
setButtonCount(this) setButtonCount(this)
}); });
function setButtonCount(that){// function setButtonCount(that){//
@ -160,7 +164,7 @@
if(!this.agreed){ if(!this.agreed){
return this.$tools.showNone("请确认已阅读并同意隐私协议"); return this.$tools.showNone("请确认已阅读并同意隐私协议");
} }
if(e.detail.errMsg!=="getPhoneNumber:ok")return this.$tools.showNone(e.detail.errMsg)
if(e.detail.errMsg!=="getPhoneNumber:ok")return this.$tools.showNone("该操作需要您的手机号码信息")
this.$tools.showNone("解析数据...") this.$tools.showNone("解析数据...")
const accountInfo = uni.getAccountInfoSync(); const accountInfo = uni.getAccountInfoSync();
@ -211,22 +215,15 @@
} }
.list { .list {
display: flex;
flex-direction: column;
padding-top: 130rpx; padding-top: 130rpx;
padding-left: 70rpx; padding-left: 70rpx;
padding-right: 70rpx; padding-right: 70rpx;
position: relative;
.tips{ .tips{
// position: absolute;
// left: 10rpx;
text-align: left;
height: 50rpx;
padding-top: 10rpx;
width: 100%; width: 100%;
margin-bottom: 20rpx;
margin-top: 10rpx;
color: #EA5061; color: #EA5061;
margin-left: -20rpx;
}
}
} }
.list-call { .list-call {

Loading…
Cancel
Save