Browse Source

赛事列表等待数据对接

master
zmt 3 years ago
parent
commit
72d13070bc
  1. 6
      nxTemp/apis/userAPI.js
  2. 5
      nxTemp/config/index.config.js
  3. 59
      pages/event/event_grade.vue
  4. 55
      pages/event/event_list.vue

6
nxTemp/apis/userAPI.js

@ -11,7 +11,7 @@ export function postLogin(data) {
//发送验证码
export function postSendSMS(data) {
return http.post(`${config.baseUrl}/gaMatchAssistant/captchaSms/send`, data,{
// needLogin:false //未登录前操作取消登录验证
needLogin:false //未登录前操作取消登录验证
});
}
@ -26,7 +26,9 @@ export function postSendSMS(data) {
* @author:
*/
export function wechatGetPhoneNumber(data) {
return http.post(`${config.baseUrl}/user/wechatGetPhoneNumber`, data);
return http.post(`${config.baseUrl}/user/wechatGetPhoneNumber`, data,{
needLogin:false //未登录前操作取消登录验证
});
}
/**

5
nxTemp/config/index.config.js

@ -4,7 +4,8 @@ const CONFIG = {
loginTitleTxt: "development_wx", // 登录页标题
copyrightTxt: "XXXv1.0", // 版本信息
assetsPath: "http://cdn.com/img", // 静态资源路径
baseUrl: "http://testmanager.ouxuanzhineng.cn",
// baseUrl: "http://testmanager.ouxuanzhineng.cn",
baseUrl: "https://testmatch.ouxuanzhineng.cn",
tokenKey: "wxf368fa7316d6952f", // 登录标识
testOpenId: "", // 小程序测试openId
forcedLogin: false, // touristMode游客模式下APP是否强制用户登录 场景:当用户进入登录页面后无法后退。
@ -17,7 +18,7 @@ const CONFIG = {
loginTitleTxt: "production_wx", // 登录页标题
copyrightTxt: "XXXv1.0", // 版本信息
assetsPath: "/static/img", // 静态资源路径
baseUrl: "http://testmanager.ouxuanzhineng.cn",
baseUrl: "https://testmatch.ouxuanzhineng.cn",
tokenKey: "WECHAT_TRADE", // 登录标识
testOpenId: "wxf368fa7316d6952f", // 小程序测试openId
forcedLogin: false, // touristMode游客模式下APP是否强制用户登录 场景:当用户进入登录页面后无法后退。

59
pages/event/event_grade.vue

@ -9,15 +9,15 @@
</view>
<!-- item -->
<view class="item flex_col flex_start_y bg-white " v-for="i in 2">
<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">消息中心</view>
<view class="text-m text-left">{{i.schedule_name}}</view>
<!-- <view class="bandage"></view> -->
</view>
<view class="info flex_row flex_between">
<view class="time">2020.06.22</view>
<view class="time">{{i.schedule_start_date}}</view>
<view class="type">半决赛</view>
</view>
@ -88,6 +88,7 @@
</view>
</template>
<script>
import {matchScheduleList} from "../../nxTemp/apis/userAPI.js"
export default {
data() {
return {
@ -96,19 +97,63 @@
address:"",
headIndex:0,
headDate:[{name:'赛程打分'},{name:'赛事打分'}],
login:true
postData:{
page:1,
page_size:10,
match_id:""
},
listLoadFinished:false,
listTotal:0,
pageList:[]
};
},
computed:{
},
onLoad(parms) {
onLoad(opt) {
console.log("onLoad:",opt);
this.postData.match_id = opt.match_id
this.updatePage()
},
onUnload() {
this.resetPostData()
},
onPullDownRefresh(){
console.log("onPullDownRefresh");
},
onReachBottom(){
console.log("onReachBottom");
this.updatePage()
},
methods: {
//
updatePage() {
if(this.listLoadFinished)return this.$tools.showNone("已加载完毕")
matchScheduleList(this.postData).then(res => {
this.$tools.showNone("已更新");
this.pageList.push(...res.list)
checkListLoadFinished(res,this);
}).catch(e=>{
this.$tools.showNone(e.errMsg)
})
function checkListLoadFinished(res,that){
if(that.pageList.length == res.total)that.listLoadFinished = true
else that.postData.page++
}
},
//
getFilteredItem(item){
return Promise.resolve({}=item)
},
//
resetPostData(){
this.postData = {
page:1,
page_size:10,
match_id:""
}
},
openGrade() {
this.showGrade = ! this.showGrade
console.log('open');

55
pages/event/event_list.vue

@ -7,26 +7,27 @@
</view> -->
<!-- item -->
<view class="item flex_col flex_start_y bg-white padding " v-for="(i,k) in pageList.list" :key="k" @click="jumpPage('eventGrade')">
<view class="item flex_col flex_start_y bg-white padding " v-for="(i,k) in pageList" :key="k" @click="jumpDetail(i)">
<view class="time flex_row">
<image src="../../static/images/event/event_lock.png" mode=""></image>
<text>2020.06.22</text>
<text>{{i.match_sign_before}}</text>
<text>前报名</text>
</view>
<view class="box flex_row flex_start_y">
<image class="img" src="../../static/images/index/index_cup.png" mode=""></image>
<image class="img" :src="i.match_cover" mode=""></image>
<view class="info flex_col flex_start flex_start_y">
<view class="event_title flex_row flex_start flex_start_y">
<text class="tag tag_green" >团队</text>
<text class="tag tag_blue" >个人</text>
<text class="">{{title|autoAddPoints}}</text>
<!-- <text class="tag tag_green" >团队</text>
<text class="tag tag_blue" >个人</text> -->
<text class="tag tag_blue" :class="i.match_type=='personal'?'tag_blue':'tag_green'" >{{i.match_type_text}}</text>
<text class="match_name" >{{i.match_name|autoAddPoints}}</text>
</view>
<view class="location flex_row">
<image src="../../static/images/event/event_location.png" mode=""></image>
<text class="text-maxline-one">{{address}}</text>
<text class="text-maxline-one">{{i.match_addr}}</text>
</view>
</view>
@ -34,7 +35,7 @@
</view>
<view class="load-finish">我是有底线的</view>
<view class="load-finish" v-if="listLoadFinished">我是有底线的</view>
</view>
</template>
@ -43,15 +44,13 @@
export default {
data() {
return {
title:"默认块级元素默认块级元素默认块级元素",
address:"广州省广州市区白云区广州省广州市区白云区永泰广州省广州市区白云区广州省广州市区白云区永泰",
postData:{
page:1,
page_size:10,
token:123
page_size:10
},
listLoadFinished:false,
listTotal:0,
pageList:[]
};
},
onLoad(opt) {
@ -60,19 +59,40 @@
onUnload() {
this.resetPostData()
},
onPullDownRefresh(){
console.log("onPullDownRefresh");
},
onReachBottom(){
console.log("onReachBottom");
this.updatePage()
},
methods: {
jumpDetail(i){
let {match_id} = i
this.$Router.push({
name:"eventGrade",
params:{
match_id
}
})
},
jumpPage(name){
this.$Router.push({name})
},
//
updatePage() {
if(this.listLoadFinished)return this.$tools.showNone("已加载完毕")
matchList(this.postData).then(res => {
this.$tools.showNone("已更新");
this.pageList.push(res)
this.postData.page++
this.pageList.push(...res.list)
checkListLoadFinished(res,this);
}).catch(e=>{
this.$tools.showNone(e.errMsg)
})
function checkListLoadFinished(res,that){
if(that.pageList.length == res.total)that.listLoadFinished = true
else that.postData.page++
}
},
//
getFilteredItem(item){
@ -142,6 +162,7 @@ page{
display: inline;
> text{
margin-left: 10rpx;
// margin-bottom: 10rpx;
}
}
.tag{
@ -153,9 +174,11 @@ page{
text-align: center;
line-height: 36rpx;
padding: 5rpx 5rpx;
// margin: 10rpx 0;
}
.match_name{
// padding-top: 50rpx;
}
.tag_blue{
color: #32C5FF;
background: #E0F6FF;

Loading…
Cancel
Save