|
|
@ -2,38 +2,71 @@ |
|
|
|
|
|
|
|
<view class="content flex_col flex_start"> |
|
|
|
|
|
|
|
<view class="head flex_row flex_around"> |
|
|
|
<view class="head flex_row flex_around" v-if="!!showHeader"> |
|
|
|
<view class="tap-btn" :class="[getTabClass(e)]" @click="clickHead(i)" v-for="(e,i) in headDate" :key="i"> |
|
|
|
{{e.name}} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- item --> |
|
|
|
<!--schedule item --> |
|
|
|
<block v-if="headIndex==0"> |
|
|
|
<view class="item flex_col flex_start_y bg-white " v-for="(i,k) in pageList" :key="k"> |
|
|
|
|
|
|
|
<view class="title flex_row flex_start"> |
|
|
|
<view class="text-m text-left">{{i.schedule_name}}</view> |
|
|
|
<view class="text-m text-left">{{match_name}}</view> |
|
|
|
<!-- <view class="bandage"></view> --> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="info flex_row flex_between"> |
|
|
|
<view class="time">{{i.schedule_start_date}}</view> |
|
|
|
<view class="type">半决赛</view> |
|
|
|
<view class="type">{{i.schedule_name}}</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="card flex_row flex_between"> |
|
|
|
<view class="card flex_row flex_between" v-for="(u,ukey) in i.son_list"> |
|
|
|
<view class="persion flex_row"> |
|
|
|
<image class="bg-brown" src="../../static/images/event/event_lock.png" mode=""></image> |
|
|
|
<text>adjksk</text> |
|
|
|
<image class="bg-brown" :src="u.member_img" :key="ukey" mode=""></image> |
|
|
|
<text>{{u.member_name}}</text> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="btn-box flex_row"> |
|
|
|
<view class="btn state-0 flex_row">已打分</view> |
|
|
|
<view class="btn state-1 flex_row" @click="openGrade()">打分</view> |
|
|
|
<view class="btn state-2 flex_row" @click="openGradeMore()">数据</view> |
|
|
|
<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> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</block> |
|
|
|
<!--match item --> |
|
|
|
<block v-if="headIndex==1"> |
|
|
|
<view class="item flex_col flex_start_y bg-white "> |
|
|
|
|
|
|
|
<view class="title flex_row flex_start"> |
|
|
|
<view class="text-m text-left">{{match_name}}</view> |
|
|
|
<!-- <view class="bandage"></view> --> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- <view class="info flex_row flex_between"> |
|
|
|
<view class="time">{{i.schedule_start_date}}</view> |
|
|
|
<view class="type">{{i.schedule_name}}</view> |
|
|
|
</view> --> |
|
|
|
|
|
|
|
<view class="card flex_row flex_between" v-for="(u,ukey) in pageList" :key="ukey"> |
|
|
|
<view class="persion flex_row"> |
|
|
|
<image class="bg-brown" :src="u.member_img" :key="ukey" mode=""></image> |
|
|
|
<text>{{u.member_name}}</text> |
|
|
|
</view> |
|
|
|
|
|
|
|
<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> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</block> |
|
|
|
|
|
|
|
<!-- 无数据 --> |
|
|
|
<no-data :txt="no_data_txt_arr[headIndex]" v-if="pageList.length==0"></no-data> |
|
|
|
|
|
|
|
<!-- 弹出交互 uview popup有bug,废弃重写--> |
|
|
|
<!-- <u-popup :show="showGrade" @close="close" @open="open" mode="center" :closeOnClickOverlay="true" :closeable="true" :round="10"> |
|
|
@ -51,69 +84,83 @@ |
|
|
|
<view class="grade flex_col flex_start" > |
|
|
|
<image class="g-close" src="../../static/images/event/event_close.png" mode="" @click="closeGrade()"></image> |
|
|
|
<text class="g-title">赛事打分</text> |
|
|
|
<text class="g-txt">李静分数录入</text> |
|
|
|
<input type="text" value="" placeholder="请录入分数" placeholder-class="place-style"/> |
|
|
|
<text class="g-txt">{{gradeData.user.member_name||""}}分数录入</text> |
|
|
|
<input type="number " class="" v-model="gradeData.score" value="" placeholder="请录入分数" placeholder-class="place-style"/> |
|
|
|
<view class="g-tip">请输入成员该赛程最终得分,非累计</view> |
|
|
|
<view class="g-btn flex_row" @click="closeGrade()">保存</view> |
|
|
|
<view class="g-btn flex_row" @click="saveGrade()">保存</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 赛事数据弹出 --> |
|
|
|
<view class="overlay flex_col" v-if="showGradeMore"> |
|
|
|
<!-- 赛事数据录入弹出 --> |
|
|
|
<view class="overlay flex_col" v-if="showGradeRank"> |
|
|
|
<view class="grade grade-more flex_col flex_start" > |
|
|
|
<image class="g-close" src="../../static/images/event/event_close.png" mode="" @click="closeGradeMore()"></image> |
|
|
|
<text class="g-title">入围赛数据</text> |
|
|
|
<text class="g-txt">李静分数录入</text> |
|
|
|
<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-txt">{{gradeDataRank.user.member_name}}分数录入</text> |
|
|
|
<view class="g-input-box"> |
|
|
|
<view class="b-item flex_row"> |
|
|
|
<text>篮板</text> |
|
|
|
<input type="text" value="" placeholder="请录入数据" placeholder-class="place-style"/> |
|
|
|
<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="b-item flex_row"> |
|
|
|
<!-- <view class="b-item flex_row"> |
|
|
|
<text>助攻</text> |
|
|
|
<input type="text" value="" placeholder="请录入数据" placeholder-class="place-style"/> |
|
|
|
<input type="number" value="" placeholder="请录入数据" placeholder-class="place-style"/> |
|
|
|
</view> |
|
|
|
<view class="b-item flex_row"> |
|
|
|
<text>场次</text> |
|
|
|
<input type="text" value="" placeholder="请录入数据" placeholder-class="place-style"/> |
|
|
|
</view> |
|
|
|
<input type="number" value="" placeholder="请录入数据" placeholder-class="place-style"/> |
|
|
|
</view> --> |
|
|
|
|
|
|
|
</view> |
|
|
|
<view class="g-tip">请输入成员该赛程最终得分,非累计</view> |
|
|
|
<view class="g-btn flex_row" @click="closeGradeMore()">保存</view> |
|
|
|
<view class="g-btn flex_row" @click="saveRank()">保存</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- <u-modal :show="showGrade" @confirm="open" ref="uModal" :asyncClose="true" @close="close" :closeOnClickOverlay="true">确认????</u-modal> --> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
import {matchScheduleList} from "../../nxTemp/apis/userAPI.js" |
|
|
|
import {schedule_matchList,schedule_scoreSave, |
|
|
|
scoreSave,scoreMemberList, |
|
|
|
rankOcondList,rankSave} from "../../nxTemp/apis/userAPI.js" |
|
|
|
|
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
showGrade:false, |
|
|
|
showGradeMore:true, |
|
|
|
address:"", |
|
|
|
headIndex:0, |
|
|
|
showGrade:false,//赛事个人打分弹窗 |
|
|
|
showGradeRank:false,//赛事数据弹窗 |
|
|
|
showHeader:true,//是否显示头部导航 |
|
|
|
headIndex:0,// |
|
|
|
headDate:[{name:'赛程打分'},{name:'赛事打分'}], |
|
|
|
|
|
|
|
postData:{ |
|
|
|
postData:{//请求数据 |
|
|
|
page:1, |
|
|
|
page_size:10, |
|
|
|
match_id:"" |
|
|
|
match_id:"", |
|
|
|
// brand_id:"" |
|
|
|
}, |
|
|
|
listLoadFinished:false,//是否已加载全部列表 |
|
|
|
listTotal:0,//列表总长 |
|
|
|
match_name:"",//赛程名称(赛程,赛事一同使用) |
|
|
|
pageList:[], |
|
|
|
gradeData:{//打分弹窗数据 |
|
|
|
user:"", |
|
|
|
score:0 |
|
|
|
}, |
|
|
|
gradeDataRank:{//入围数据录入 |
|
|
|
user:"", |
|
|
|
score:0, |
|
|
|
list:"" |
|
|
|
}, |
|
|
|
listLoadFinished:false, |
|
|
|
listTotal:0, |
|
|
|
pageList:[] |
|
|
|
brand_id:"", |
|
|
|
no_data_txt_arr:["暂无赛程安排~","暂无人员参加~"] |
|
|
|
}; |
|
|
|
}, |
|
|
|
computed:{ |
|
|
|
|
|
|
|
}, |
|
|
|
onLoad(opt) { |
|
|
|
console.log("onLoad:",opt); |
|
|
|
this.postData.match_id = opt.match_id |
|
|
|
onLoad(opts) { |
|
|
|
console.log(8888,opts); |
|
|
|
this.setOnloadOpts(opts) |
|
|
|
this.updatePage() |
|
|
|
}, |
|
|
|
onUnload() { |
|
|
@ -130,45 +177,128 @@ |
|
|
|
//更新页面列表 |
|
|
|
updatePage() { |
|
|
|
if(this.listLoadFinished)return this.$tools.showNone("已加载完毕") |
|
|
|
matchScheduleList(this.postData).then(res => { |
|
|
|
this.$tools.showNone("已更新"); |
|
|
|
getPostAPI(this)(this.postData).then(res => { |
|
|
|
this.pageList.push(...res.list) |
|
|
|
this.match_name = res.match_name |
|
|
|
checkListLoadFinished(res,this); |
|
|
|
}).catch(e=>{ |
|
|
|
this.$tools.showNone(e.errMsg) |
|
|
|
}) |
|
|
|
|
|
|
|
function getPostAPI(that){ |
|
|
|
return [schedule_matchList,scoreMemberList][that.headIndex] |
|
|
|
// return [schedule_matchList,matchList][that.headIndex] |
|
|
|
} |
|
|
|
//检测是否完成加载 |
|
|
|
function checkListLoadFinished(res,that){ |
|
|
|
if(that.pageList.length == res.total)that.listLoadFinished = true |
|
|
|
else that.postData.page++ |
|
|
|
} |
|
|
|
function getFilterList(list){ |
|
|
|
return list |
|
|
|
} |
|
|
|
}, |
|
|
|
//预留 |
|
|
|
getFilteredItem(item){ |
|
|
|
return Promise.resolve({}=item) |
|
|
|
}, |
|
|
|
//重置请求参数 |
|
|
|
setOnloadOpts(opts){ |
|
|
|
console.log("onLoad:",opts); |
|
|
|
opts.showHeader = JSON.parse(opts.showHeader) |
|
|
|
this.postData.match_id = opts.match_id||"" |
|
|
|
this.headIndex = opts.showHeader?0:1;// 一定有赛事打分, 但不一定有赛程 |
|
|
|
this.showHeader = opts.showHeader |
|
|
|
// this.postData.brand_id = opts.brand_id||"" |
|
|
|
this.brand_id = opts.brand_id||"" |
|
|
|
}, |
|
|
|
resetPostData(){ |
|
|
|
this.postData = { |
|
|
|
page:1, |
|
|
|
page_size:10, |
|
|
|
match_id:"" |
|
|
|
// this.postData = { |
|
|
|
// page:1, |
|
|
|
// page_size:10, |
|
|
|
// match_id:"" |
|
|
|
// } |
|
|
|
this.postData.page = 1; |
|
|
|
this.pageList = []; |
|
|
|
this.listLoadFinished = false; |
|
|
|
}, |
|
|
|
saveGrade() {//保存分数 |
|
|
|
let {score} = this.gradeData |
|
|
|
let {order_no,schedule_son_id,id:schedule_id} = this.gradeData.user |
|
|
|
if(score<=0)return this.$tools.showNone("请输入分数"); |
|
|
|
getPostAPI(this)(getPostData(this)).then(res => { |
|
|
|
this.$tools.showNone("已保存"); |
|
|
|
this.closeGrade() |
|
|
|
}).catch(e=>{ |
|
|
|
this.$tools.showNone(e.errMsg) |
|
|
|
this.closeGrade() |
|
|
|
}) |
|
|
|
function getPostAPI(that){ |
|
|
|
return [schedule_scoreSave,scoreSave][that.headIndex] |
|
|
|
} |
|
|
|
function getPostData(that){ |
|
|
|
let {brand_id} = that |
|
|
|
return [{order_no,schedule_son_id,schedule_id,score},{order_no,score,brand_id}][that.headIndex] |
|
|
|
} |
|
|
|
}, |
|
|
|
openGrade() { |
|
|
|
this.showGrade = ! this.showGrade |
|
|
|
console.log('open'); |
|
|
|
openGrade(user) { |
|
|
|
this.showGrade = true |
|
|
|
this.gradeData.user = user |
|
|
|
this.gradeData.score = "" |
|
|
|
console.log('open',JSON.stringify(user)); |
|
|
|
}, |
|
|
|
closeGrade() { |
|
|
|
this.showGrade = false |
|
|
|
console.log('close'); |
|
|
|
console.log('closeGrade'); |
|
|
|
}, |
|
|
|
openGradeMore() { |
|
|
|
this.showGradeMore = ! this.showGradeMore |
|
|
|
console.log('open'); |
|
|
|
async openGradeRank(user) { |
|
|
|
this.gradeDataRank.user = user |
|
|
|
this.gradeDataRank.score = "" |
|
|
|
let res = await this.updateRankList() |
|
|
|
this.showGradeRank = true |
|
|
|
console.log('openGradeRank',res); |
|
|
|
}, |
|
|
|
closeGradeMore() { |
|
|
|
this.showGradeMore = false |
|
|
|
console.log('close'); |
|
|
|
closeGradeRank() { |
|
|
|
this.showGradeRank = false |
|
|
|
console.log('closeGradeRank'); |
|
|
|
}, |
|
|
|
saveRank(){ |
|
|
|
let {order_no} = this.gradeDataRank.user |
|
|
|
let {brand_id} = this |
|
|
|
brand_id = parseInt(brand_id) |
|
|
|
let rank_data = getRankData(this) |
|
|
|
if(!checkData(rank_data)) return this.$tools.showNone("请输入合适的分数") |
|
|
|
rankSave({ |
|
|
|
order_no,brand_id,rank_data |
|
|
|
}).then(res => { |
|
|
|
this.$tools.showNone("保存成功") |
|
|
|
this.closeGradeRank() |
|
|
|
}).catch(e=>{ |
|
|
|
this.$tools.showNone(e.errMsg) |
|
|
|
}) |
|
|
|
function getRankData(that){ |
|
|
|
return that.gradeDataRank.list.map((item)=>{ |
|
|
|
let {id,val} = item |
|
|
|
return {id,val} |
|
|
|
}) |
|
|
|
} |
|
|
|
function checkData(list){ |
|
|
|
return list.every((e)=>{ |
|
|
|
return parseInt(e.val)>0 |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
updateRankList(){ |
|
|
|
let {order_no} = this.gradeDataRank.user |
|
|
|
let {brand_id} = this |
|
|
|
return rankOcondList({ |
|
|
|
order_no,brand_id |
|
|
|
}).then(res => { |
|
|
|
console.log("updateRankList:",res); |
|
|
|
this.gradeDataRank.list = res.list |
|
|
|
}).catch(e=>{ |
|
|
|
this.$tools.showNone(e.errMsg) |
|
|
|
}) |
|
|
|
}, |
|
|
|
getTabClass(item){ |
|
|
|
let {headDate,headIndex} = this |
|
|
@ -176,6 +306,9 @@ |
|
|
|
}, |
|
|
|
clickHead(index){ |
|
|
|
this.headIndex = index |
|
|
|
console.log("click index: ",index); |
|
|
|
this.resetPostData(); |
|
|
|
this.updatePage(); |
|
|
|
}, |
|
|
|
jumpPage(){ |
|
|
|
this.$Router.push({name:"login"}) |
|
|
@ -322,7 +455,7 @@ |
|
|
|
background: #FFFFFF; |
|
|
|
border: 2rpx solid #D8D8D8; |
|
|
|
border-radius: 10rpx; |
|
|
|
padding: 20rpx; |
|
|
|
padding:0 20rpx; |
|
|
|
} |
|
|
|
.g-tip{ |
|
|
|
align-self: flex-start; |
|
|
@ -366,6 +499,8 @@ |
|
|
|
.place-style{ |
|
|
|
font-size: 28rpx; |
|
|
|
color: #9A9A9D; |
|
|
|
// text-align: center; |
|
|
|
// line-height: 88rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|