Commit db9ef5ca 吴良建

初步完成

1 个父辈 a2112175
<script>
<script>
import {
transformImageCodeToUri
} from "@/utils/image_utils.js";
import common from '@/utils/common.js'
import http from '@/utils/http.js'
import app_config from '@/utils/app.js'
......@@ -41,25 +45,6 @@
// #endif
}
})
//获取配置
let local_ic = await uni.getStorageSync('info_config_key')
if (local_ic) {
common.info_config = JSON.parse(local_ic)
}
console.debug('---0000------', common.info_config)
let ic_res = await http.gql({
query: 'query{info_config}'
})
let info_config = ic_res.data.info_config
if (info_config) {
common.info_config = info_config
await uni.setStorageSync('info_config_key', JSON.stringify(info_config))
console.log(common.info_config);
} else {
console.debug('---获取后台配置失败---')
}
},
onShow: function() {
......@@ -88,7 +73,7 @@
},
methods: {
async antoLogin() {
var appToken = uni.getStorageSync('appToken') || ""
var appToken = loginHelper.getAppToken() || ""
console.log("antoLogin " + JSON.stringify(appToken))
if (appToken) {
var mac_code = uni.getSystemInfoSync().deviceId
......@@ -113,7 +98,8 @@
loginHelper.logout()
}
}
} else {
loginHelper.logout()
}
}
}
......
<template>
<view>
<view style="display: flex; justify-content: space-between; width: 100%; margin-top: 30rpx;">
<text class="title_text" style="width: 20%;">赛事</text>
<view style="display: flex; justify-content: space-between;">
<text class="title_text">主</text>
<text class="title_text"
style="flex: 1; display: flex; margin-left: 30rpx; margin-right: 30rpx;">比分(半场)</text>
<text class="title_text">客</text>
</view>
<text class="title_text" style="color: #6f83fc; width: 20%;">{{getWinTypeName()}}</text>
</view>
<view v-for="(item, index) in data_array" :class="index % 2 == 0 ?'item_bg' : 'item_bg_two'" :key="index">
<view style="display: flex; width: 16%; flex-direction: column;
justify-content: center; align-items: center;">
<text class="text1">{{competition[item.Id[1]].ShortName}}</text>
<text class="text1">{{utils.dateFormatYear2(item.Date)}}</text>
</view>
<view style="display: flex; width: 100%; flex: 1; font-size: 16px;
flex-direction: row;">
<text :style="'color:' + getTeamNameColor(item.Id[2],item)"
style="flex: 1; text-align: right;">{{Team[item.Id[2]].ShortName}}</text>
<view style="margin-left: 30rpx; margin-right: 30rpx; ">
<text
style="font-size: 18px; color: #666; font-weight: bold;">{{item.ScoreAll[0] + ":" + item.ScoreAll[1]}}</text>
<text style="font-size: 14px; margin-left: 6rpx;
color: #999; padding-top: 5px">{{"["+item.Half+"]"}}</text>
</view>
<text :style="'color:' + getTeamNameColor(item.Id[3],item)"
style="flex: 1; text-align: left;">{{Team[item.Id[3]].ShortName}}</text>
</view>
<view class="item_win_text" :style="'background-color:' + getTeamNameColor(HomeId, item)"
@click="switchWinType()">
<text>{{getWinTypeInfo(HomeId, item)}}</text>
</view>
</view>
</view>
</template>
<script>
import utils from '../utils/utils.js';
export default {
name: "AnalysisList",
data() {
return {
winTypeArray: ["胜平负", "进球", "半全场"],
utils,
winTypeIndex: 0
};
},
props: {
data_array: {
type: Array,
default: () => []
},
competition: {
type: Object,
default: () => ({})
},
Team: {
type: Object,
default: () => ({})
},
HomeId: {
type: Number,
default: 0
}
},
watch: {
data_array: function(newVal, oldVal) {
console.log('属性值变为:', newVal);
this.data_array = newVal
}
},
methods: {
checkTramWin(id, item, score) { // 判断是赢是输是平
var index1 = item.Id[2] === id ? 0 : 1;
var index2 = item.Id[3] === id ? 1 : 0;
if (score[index1] > [index2]) {
return "胜";
} else if (score[index1] == score[index2]) {
return "平";
} else {
return "负";
}
},
getWinTypeInfo(id, item) {
switch (this.winTypeIndex) {
case 0:
return this.checkTramWin(id, item, item.ScoreAll);
case 1:
return (item.ScoreAll[0] + item.ScoreAll[1]) + "球"
case 2:
return this.checkTramWin(id, item, item.Half.split('-')) + this.checkTramWin(id, item, item
.ScoreAll)
}
},
getTeamNameColor(id, item) {
if (this.HomeId !== id) {
return "#888888"
} else {
var index1 = item.Id[2] === id ? 0 : 1;
var index2 = item.Id[2] === id ? 1 : 0;
var home = item.ScoreAll[index1]
if (item.ScoreAll[index1] > item.ScoreAll[index2]) {
return "#ff6858";
} else if (item.ScoreAll[index1] == item.ScoreAll[index2]) {
return "#82c866";
} else {
return "#6f83fc";
}
}
},
getWinTypeName() {
return this.winTypeArray[this.winTypeIndex]
},
switchWinType() {
this.winTypeIndex++
if (this.winTypeIndex >= this.winTypeArray.length) {
this.winTypeIndex = 0
}
}
},
mounted() {
console.log(Array.isArray(this.data_array) )
}
}
</script>
<style>
.red {
color: #ff6858;
}
.green {
color: #82c866;
}
.blue {
color: #6f83fc;
}
.title_text {
text-align: center;
font-size: 24rpx;
color: #b2b2b2;
}
.item_bg {
font-size: 14px;
display: flex;
justify-content: space-between;
align-items: center;
text-align: center;
padding-top: 15rpx;
padding-bottom: 15rpx;
padding-left: 15rpx;
padding-right: 15rpx;
background-color: #fafafa;
}
.item_bg_two {
font-size: 14px;
display: flex;
justify-content: space-between;
align-items: center;
text-align: center;
padding-top: 15rpx;
padding-bottom: 15rpx;
padding-left: 15rpx;
padding-right: 15rpx;
background-color: white;
}
.item_win_text {
width: 16%;
text-align: center;
border-radius: 2px;
padding: 1px 0px;
font-size: 12px;
background-color: rgb(145, 187, 128);
color: rgb(255, 255, 255);
}
.text1 {
text-align: center;
font-size: 12px;
color: #999;
}
.text2 {
text-align: center;
font-size: 12px;
color: #b2b2b2;
}
</style>
<template>
<view>
<scroll-view>
<view>
<view v-for="(key, index) in keySet" :key="index">
<view class="header-item">
{{key + ' ' + utils.getweekDay(key)}}
</view>
<view v-for="(item, index) in data_map.get(key)" :key="item.Id" class="match_item"
onclick="event.stopPropagation();" @click="goToMatch(item)">
<view style="display: flex; flex-direction: row;
justify-content: space-between; width: 100%; ">
<view style="display: flex; flex: 1; ">
<text class="match_text">{{item.GameName}}</text>
<text class="match_time_text"
style="margin-left: 32rpx;">{{getMatchTime(item.MatchTime)}}</text>
</view>
<view>
<text class="match_info_text">{{item.MatchState}}</text>
</view>
<view style="display: flex; flex-direction: row-reverse; flex: 1;">
<view v-if="item.MatchState != '完'">
<view v-show="item.SportsInfoCount != 0" style="display: flex;flex-direction: row;
justify-content: right;
background: #5589FF;
color: white;
align-items: center;
padding-left: 16rpx;
border-radius: 26rpx 0rpx 0rpx 26rpx;">
<text>{{item.SportsInfoCount + "条情报"}}</text>
<image style="width: 40rpx; height: 40rpx;"
src="../static/tab_icons/ic_in@2x.png"></image>
</view>
</view>
<text v-else class="match_info_text"
style="margin-left: 32rpx;">{{getMatchInfo(item)}}</text>
</view>
</view>
<view style="display: flex; justify-content: space-between; ">
<view @click.stop="follow_action(item, index)" style="padding-top: 32rpx;">
<image class="follow_iv" v-show="item.isFollow"
src="../static/tab_icons/follow01.png" />
<image class="follow_iv" v-show="!item.isFollow"
src="../static/tab_icons/follow02.png" />
</view>
<view
style=" display: flex; align-items: center; width: 100%; justify-content: space-between;">
<view
style="display: flex; flex: 1; flex-direction: row-reverse; ; width: 100%; margin-right: 75rpx; align-items: center;">
<text v-show="item.HostYellow" class="yellow_p">{{item.HostYellow}}</text>
<text v-show="item.HostRed" class="reb_p">{{item.HostRed}}</text>
<text class="name-text">{{item.HostName}}</text>
</view>
<view>
<text class="score"
v-if="item.QcBf">{{getHostScore(item) + ":" + getGuestScore(item)}}</text>
<text v-else class="vs_text" style="min-width: 60rpx;">VS</text>
</view>
<view
style="flex: 1; display: flex; width: 100%; margin-left: 75rpx; align-items: center;">
<text class="name-text">{{item.GuestName}}</text>
<text v-show="item.GuestRed" class="reb_p">{{item.GuestRed}}</text>
<text v-show="item.GuestYellow" class="yellow_p">{{item.GuestYellow}}</text>
</view>
</view>
<view class="follow_iv"></view>
</view>
</view>
</view>
</view>
</scroll-view>
</view>
</template>
<script>
import utils from "../utils/utils.js";
import followHelper from '../utils/followHelper.js';
import common from '../utils/common';
export default {
name: "MatchList",
props: {
data_info: [Array],
},
data() {
return {
data_in : this.data_info,
utils,
data_map: new Map(),
keySet: []
};
},
methods: {
getHostScore(item) {
if (item.QcBf && item.QcBf.length > 0) {
var split = item.QcBf.split('-')
return split[0]
}
return "-"
},
getGuestScore(item) {
if (item.QcBf && item.QcBf.length > 0) {
var split = item.QcBf.split('-')
return split[1]
}
return "-"
},
getMatchTime(time) {
return utils.dateFormatHoursMinutes(time)
},
getMatchInfo(item) {
if (item.BcBf) {
return "半场:" + item.BcBf
}
return ""
},
async follow_action(match,index) {
this.$emit("updateItem", match.Id , index)
await followHelper.follow_action(match)
await this.handlerData()
},
async handlerData() {
//获取关注的比赛
var follow_list = await followHelper.getFollowList()
this.data_map.clear()
for (var i = 0; i < this.data_in.length; i++) {
var moudle = this.data_in[i]
if (moudle) {
var mId = moudle.Id
var same = follow_list.some(function(item, index) {
return item.Id === mId
})
if (same) {
moudle.isFollow = true
} else {
moudle.isFollow = false
}
var list = this.data_map.get(moudle.IssueName)
if (!list) {
list = []
}
list.push(moudle)
this.data_map.set(moudle.IssueName, list)
}
}
this.keySet.length = 0
this.keySet.push(...this.data_map.keys())
},
onRefreshInfo() {
this.handlerData()
},
goToMatch(match) {
console.log("Detail:" + JSON.stringify(match))
let gameid = match.Sportsdt.SportsdtMatchId
if (gameid) {
uni.navigateTo({
url: `/pages/analysis/analysis?info=${JSON.stringify(gameid)}`
})
}
}
},
mounted() {
this.handlerData()
}
}
</script>
<style>
.content {
width: 100%;
height: 100%;
}
.match_item {
margin: 32rpx;
padding-left: 24rpx;
padding-top: 24rpx;
padding-bottom: 24rpx;
background: #F3F3F3;
border-radius: 24rpx;
}
.follow_iv {
width: 44rpx;
height: 44rpx;
}
.match_text {
font-size: 30rpx;
font-weight: 400;
color: #FF9139;
}
.match_time_text {
font-size: 30rpx;
font-weight: 400;
color: #333333;
}
.centered-component {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.match_info_text {
height: 42rpx;
max-height: 42rpx;
font-size: 30rpx;
font-weight: 400;
color: #AAAAAA;
line-height: 42rpx;
}
.vs_text {
font-size: 36rpx;
font-weight: bold;
color: #777777;
}
.score {
font-size: 36rpx;
font-weight: bold;
color: #333333;
}
.yellow_p {
background: #FF9139;
border-radius: 4rpx;
padding-left: 2rpx;
padding-right: 2rpx;
font-size: 30rpx;
font-weight: bold;
color: #FFFFFF;
margin-left: 5rpx;
margin-right: 5rpx;
height: 34rpx;
line-height: 34rpx;
text-align: center;
}
.red_p {
background: #F02626;
border-radius: 4rpx;
padding-left: 2rpx;
padding-right: 2rpx;
font-size: 30rpx;
font-weight: bold;
margin-left: 5rpx;
margin-right: 5rpx;
color: #FFFFFF;
height: 34rpx;
line-height: 34rpx;
text-align: center;
}
.sports_info_count_text {
font-size: 30rpx;
font-weight: 400;
color: #FFFFFF;
line-height: 42rpx;
}
.header-item {
height: 44rpx;
margin-right: 9px;
line-height: 17px;
position: sticky;
z-index: 9999;
top: auto;
left: 0;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
font-size: 32rpx;
font-weight: 500;
color: #333333;
line-height: 44rpx;
}
.name-text {
font-size: 32rpx;
font-weight: 500;
color: #333333;
}
</style>
<template>
<view>
<view v-if="loading"
style="width: 50vw; height: 70vh; display: flex; justify-items: center; align-items: center;">
<view
style="width: 50vw; height: 100%; display: flex; justify-items: center; align-items: center; align-content: center; justify-content: center; ">
<image style="width: 63px; height: 34px;" src="../../static/loading_icon.gif"></image>
</view>
</view>
<view v-if="!loading">
<view class="charts-box">
<qiun-data-charts type="radar" :opts="opts" :chartData="chartData" :canvas2d="true"/>
</view>
<view class="content"
style="display: flex; flex-direction: row; padding-left: 13px; padding-right: 13px; margin-top: 11px;">
<view
style="display: flex; flex: 1; flex-direction: column; padding-right: 14px ; padding-bottom: 7px; ">
<view class="text2" style="text-align: right;">{{host.win_avg_balls}}</view>
<view class="text" style="text-align: right;">主队均进球</view>
</view>
<view
style="display: flex; flex: 1; flex-direction: column; padding-left: 14px; border-left: 1px solid #E8EFFF; padding-bottom: 7px; ">
<view class="text2" style="text-align: left;">{{guest.win_avg_balls}}</view>
<view class="text" style="text-align: left;">客队均进球</view>
</view>
</view>
<view class="content"
style="display: flex; flex-direction: row; border-top:1px solid ; border-color: #E8EFFF; margin-bottom: 17px; margin-left: 13px; margin-right: 13px;">
<view style="display: flex; flex: 1; flex-direction: column; padding-right: 14px; padding-top: 7px">
<view class="text2" style="text-align: right;">{{host.lose_avg_balls}}</view>
<view class="text" style="text-align: right;">主队均失球</view>
</view>
<view
style="display: flex; flex: 1; flex-direction: column; padding-left: 14px; border-left: 1px solid #E8EFFF; padding-top: 7px">
<view class="text2" style="text-align: left;">{{guest.lose_avg_balls}}</view>
<view class="text" style="text-align: left;">客队均失球</view>
</view>
</view>
<view style="display: flex; justify-content: space-between; padding-left: 14px; padding-right: 14px;">
<image style="width: 18px; height: 18px; border-radius: 18px;" :src="data_info.HostTeam.LogoFullPath" />
<view class="title">综合能力</view>
<image style="width: 18px; height: 18px; border-radius: 18px;"
:src="data_info.GuestTeam.LogoFullPath" />
</view>
<view style="display: flex; width: 90%; margin-top: 15px; margin-left: 14px; margin-right: 14px;">
<view class="left-bar" :style="'width:' + host.rate">{{host.rate}}</view>
<view class="right-bar" :style="'width:' + guest.rate">{{guest.rate}}</view>
</view>
<view class="text3">{{radar_chart_data.predict_value}}</view>
<view class="button" @click="toDetail(select_data)">详情分析</view>
</view>
</view>
</template>
<script>
import {
default as http
} from "@/utils/http.js";
import common from '@/utils/common.js'
import {
setTimeout
} from "timers";
export default {
props: {
data_info: [Object]
},
data() {
return {
common,
canvasId: "yiqiu_id"+ this.data_info.YiqiuMatchId,
loading: true,
select_data: this.data_info,
host: {},
guest: {},
radar_chart_data: {},
chartData: {},
//您可以通过修改 config-ucharts.js 文件中下标为 ['radar'] 的节点来配置全局默认参数,如都是默认参数,此处可以不传 opts 。实际应用过程中 opts 只需传入与全局默认参数中不一致的【某一个属性】即可实现同类型的图表显示不同的样式,达到页面简洁的需求。
opts: {
color: ["#2878FF", "#FFD03E", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
"#ea7ccc"
],
padding: [0, 0, 0, 0],
dataLabel: false,
enableScroll: false,
fontSize: 12,
legend: {
show: true,
position: "bottom",
lineHeight: 25
},
extra: {
radar: {
gridType: "radar",
gridColor: "#CCCCCC",
gridCount: 2,
opacity: 0.2,
max: 100,
labelShow: true,
border: true
}
}
}
};
},
mounted() {
this.getServerData()
},
methods: {
async getServerData() {
console.log("getServerData:" + JSON.stringify(this.select_data))
var yiqiu_id = this.select_data.YiqiuMatchId;
// var yiqiu_id = 7065015
this.canvasId = "yiqiu_id:" + yiqiu_id
console.log(yiqiu_id)
this.loading = true
if (yiqiu_id) {
let result = await http.gql({
query: `query{
get_soccer_game_base_surface_detail(yiqiu_id:${yiqiu_id})
}`
})
//处理返回请求
if (result && result.data && result.data.get_soccer_game_base_surface_detail) {
if (result.data.get_soccer_game_base_surface_detail.error) {
clearInterval(this.timer);
this_.disabled = false;
uni.showToast({
icon: "none",
title: result.data.get_soccer_game_base_surface_detail.error,
});
} else {
this.radar_chart_data = result.data.get_soccer_game_base_surface_detail.result
.radar_chart_data
this.host = this.radar_chart_data.host_result;
this.guest = this.radar_chart_data.guest_result;
let res = {
categories: ["身价", "技术", "排名", "状态", "防守", "进攻"],
series: [{
name: "主队",
data: [this.host.team_worth, this.host.tech_score, this.host.team_rank,
this.host
.status_score, this.host.defend_total, this.host.attack_total
]
},
{
name: "客队",
data: [this.guest.team_worth, this.guest.tech_score, this.guest
.team_rank, this.guest
.status_score, this.guest.defend_total, this.guest.attack_total
]
}
]
};
console.log(JSON.stringify(res))
var this_ = this;
setTimeout(function() {
this_.chartData = JSON.parse(JSON.stringify(res));
}, 100)
}
}
} else {
uni.showToast({
icon: "none",
title: "暂无详情数据",
});
}
this.loading = false
},
toDetail(match) {
console.log("Detail:" + JSON.stringify(match))
let matchId = match.Sportsdt.SportsdtMatchId
let infoId = match.InfoId
let yiqiuMatchId = match.YiqiuMatchId
console.log(JSON.stringify(match))
if (common.info_config.match_url && yiqiuMatchId) {
let tempData = {
url: common.info_config.match_url.replace("%s", yiqiuMatchId),
}
uni.navigateTo({
url: `/pages/notitle_h5/notitle_h5?info=${encodeURIComponent(JSON.stringify(tempData))}`
})
}
},
childmethods(item) {
console.log("childMethods:" + JSON.stringify(item))
this.select_data = item;
this.getServerData()
}
}
}
</script>
<style>
<template>
<view>
<view v-if="loading" style="height: 100vh; width: 100vw; display: flex; justify-items: center; align-items: center;">
<view
style="height: 100%; width: 100%; display: flex; justify-items: center; align-items: center; align-content: center; justify-content: center; ">
<image src="../../static/loading_icon.gif"></image>
</view>
</view>
<view v-if="!loading">
<view class="charts-box">
<qiun-data-charts type="radar" :opts="opts" :chartData="chartData" :canvas2d="true" />
</view>
<view class="content"
style="display: flex; flex-direction: row; padding-left: 13px; padding-right: 13px; margin-top: 11px; ">
<view style="display: flex;flex-direction: column; padding-right: 14px ; padding-bottom: 7px;">
<view class="text2" style="text-align: right;">{{host.win_avg_balls}}</view>
<view class="text" style="text-align: right;">主队均进球</view>
</view>
<image style="width: 50rpx; height: 90rpx;" src="../../static/VS@2x.png"></image>
<view style="display: flex; flex-direction: column; padding-left: 14px; padding-bottom: 7px; ">
<view class="text2" style="text-align: left;">{{guest.win_avg_balls}}</view>
<view class="text" style="text-align: left;">客队均进球</view>
</view>
</view>
<view class="content"
style="display: flex; flex-direction: row; padding-left: 13px; padding-right: 13px; margin-top: 11px; ">
<view style="display: flex;flex-direction: column; padding-right: 14px; padding-top: 7px">
<view class="text2" style="text-align: right;">{{host.lose_avg_balls}}</view>
<view class="text" style="text-align: right;">主队均失球</view>
</view>
<view style="display: flex; flex-direction: column; padding-left: 14px; padding-top: 7px">
<view class="text2" style="text-align: left;">{{guest.lose_avg_balls}}</view>
<view class="text" style="text-align: left;">客队均失球</view>
</view>
</view>
<view style="display: flex; justify-content: center; margin: 32rpx;">
<image style="width: 210rpx; height: 50rpx; " src="../../static/common/zonghenengli.png"></image>
</view>
<view style="display: flex; margin-left: 30rpx; margin-right: 30rpx; margin-top: 16rpx;">
<view class="left-bar" :style="'width:' + host.rate">{{host.rate}}</view>
<view class="right-bar" :style="'width:' + guest.rate">{{guest.rate}}</view>
</view>
<view
style="display: flex; justify-content: space-between; margin-left: 30rpx; margin-right: 30rpx; margin-top: 16rpx;">
<text class="team_text">{{info.home_name}}</text>
<text class="team_text">{{info.away_name}}</text>
</view>
<view class="text3">{{radar_chart_data.predict_value}}</view>
<view style="display: flex; justify-content: center;">
<image style="width: 210rpx; height: 50rpx;margin: 32rpx;" src="../../static/common/status_a.png"></image>
</view>
<view v-show="info.status_analysis" style="display: flex; margin-left: 30rpx; margin-right: 30rpx;">
<text class="team_text" style="margin-right: 30rpx;">{{info.home_name}}</text>
<view style="display: flex; flex: 1;">
<view class="left-bar" :style="'width:' + info.status_analysis.home_result.status_score + '%'">
{{info.status_analysis.home_result.status_score + "%"}}
</view>
</view>
<text
style="color: #333333; font-size: 30rpx;">{{info.status_analysis.home_result.status_score + "分"}}</text>
<text class="status_s_text">{{info.status_analysis.home_result.status_txt}} </text>
</view>
<view v-show="info.status_analysis" class="status_text_bg">
<text style="color: #777777; font-size: 30rpx;">{{info.status_analysis.home_result.result_value}}</text>
<text
style="color: #04764E; font-size: 30rpx; margin-top: 16rpx;">{{info.status_analysis.pre_home_data}}</text>
</view>
<view v-show="info.status_analysis" style="display: flex; margin-left: 30rpx; margin-right: 30rpx; margin-top: 30rpx;">
<text class="team_text" style="margin-right: 30rpx;">{{info.away_name}}</text>
<view style="display: flex; flex: 1;">
<view class="left-bar" :style="'width:' + info.status_analysis.away_result.status_score + '%'">
{{info.status_analysis.away_result.status_score + "%"}}
</view>
</view>
<text
style="color: #333333; font-size: 30rpx;">{{info.status_analysis.away_result.status_score + "分"}}</text>
<text class="status_s_text">{{info.status_analysis.away_result.status_txt}} </text>
</view>
<view v-show="info.status_analysis" class="status_text_bg">
<text style="color: #777777; font-size: 30rpx;">{{info.status_analysis.away_result.result_value}}</text>
<text
style="color: #04764E; font-size: 30rpx; margin-top: 16rpx;">{{info.status_analysis.pre_away_data}}</text>
</view>
</view>
</view>
</template>
<script>
import {
default as http
} from "@/utils/http.js";
import common from '@/utils/common.js'
import {
setTimeout
} from "timers";
export default {
props: {
data_info: [Object]
},
data() {
return {
common,
canvasId: "yiqiu_id" + this.data_info.YiqiuMatchId,
loading: true,
select_data: this.data_info,
host: {},
guest: {},
radar_chart_data: {},
info: {},
chartData: {},
//您可以通过修改 config-ucharts.js 文件中下标为 ['radar'] 的节点来配置全局默认参数,如都是默认参数,此处可以不传 opts 。实际应用过程中 opts 只需传入与全局默认参数中不一致的【某一个属性】即可实现同类型的图表显示不同的样式,达到页面简洁的需求。
opts: {
color: ["#F02121", "#04764E", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
"#ea7ccc"
],
padding: [0, 0, 0, 0],
dataLabel: false,
enableScroll: false,
fontSize: 16,
fontColor: "#333333",
legend: {
show: true,
position: "bottom",
lineHeight: 25
},
extra: {
radar: {
gridType: "radar",
gridColor: "#D8DDDB",
gridCount: 2,
opacity: 0.2,
max: 100,
labelShow: true,
border: true
}
}
}
};
},
mounted() {
this.getServerData()
},
methods: {
async getServerData() {
console.log("getServerData:" + JSON.stringify(this.select_data))
var yiqiu_id = this.select_data.YiqiuMatchId;
// var yiqiu_id = 7065015
this.canvasId = "yiqiu_id:" + yiqiu_id
console.log(yiqiu_id)
this.loading = true
if (yiqiu_id) {
let result = await http.gql({
query: `query{
get_soccer_game_base_surface_detail(yiqiu_id:${yiqiu_id})
}`
})
//处理返回请求
if (result && result.data && result.data.get_soccer_game_base_surface_detail) {
if (result.data.get_soccer_game_base_surface_detail.error) {
clearInterval(this.timer);
this_.disabled = false;
uni.showToast({
icon: "none",
title: result.data.get_soccer_game_base_surface_detail.error,
});
} else {
this.radar_chart_data = result.data.get_soccer_game_base_surface_detail.result
.radar_chart_data
this.info = result.data.get_soccer_game_base_surface_detail.result;
this.host = this.radar_chart_data.host_result;
this.guest = this.radar_chart_data.guest_result;
let res = {
categories: ["身价", "技术", "排名", "状态", "防守", "进攻"],
series: [{
name: "主队",
data: [this.host.team_worth, this.host.tech_score, this.host.team_rank,
this.host
.status_score, this.host.defend_total, this.host.attack_total
]
},
{
name: "客队",
data: [this.guest.team_worth, this.guest.tech_score, this.guest
.team_rank, this.guest
.status_score, this.guest.defend_total, this.guest.attack_total
]
}
]
};
console.log(JSON.stringify(result))
var this_ = this;
setTimeout(function() {
this_.chartData = JSON.parse(JSON.stringify(res));
}, 100)
}
}
} else {
uni.showToast({
icon: "none",
title: "暂无详情数据",
});
}
this.loading = false
},
childmethods(item) {
console.log("childMethods:" + JSON.stringify(item))
this.select_data = item;
this.getServerData()
}
}
}
</script>
<style>
.charts-box {
width: 100%;
height: 200px;
}
.text {
color: #D8D8D8;
font-size: 12px;
text-align: left;
font-family: SourceHanSansSC-regular;
}
.text2 {
color: #20262E;
font-size: 14px;
text-align: right;
font-family: SourceHanSansSC-regular;
}
.content {
display: flex;
width: 100%;
justify-content: center;
justify-items: center;
}
.left-bar {
color: #fff;
font-size: 12px;
text-align: center;
background: #2878FF;
border-top-left-radius: 0.8rem;
border-bottom-left-radius: 0.8rem;
}
.right-bar {
color: #fff;
font-size: 12px;
text-align: center;
background: #FFD03E;
border-top-right-radius: 0.8rem;
border-bottom-right-radius: 0.8rem;
}
.text3 {
color: #42464C;
font-size: 12px;
text-align: left;
padding-left: 14px;
padding-right: 14px;
margin-top: 10px;
margin-bottom: 20px;
font-family: SourceHanSansSC-regular;
}
.button {
line-height: 20px;
border-radius: 20px;
background: linear-gradient(180deg, rgba(40, 120, 255, 1) 0%, rgba(40, 111, 234, 1) 100%);
color: rgba(255, 255, 255, 1);
font-size: 14px;
padding-top: 10px;
padding-bottom: 10px;
margin-left: 13px;
margin-right: 13px;
text-align: center;
font-family: Roboto;
}
margin-top: 30rpx;
width: 100%;
height: 300px;
}
.text {
color: #D8D8D8;
font-size: 28rpx;
text-align: left;
font-family: SourceHanSansSC-regular;
}
.text2 {
color: #20262E;
font-size: 30rpx;
text-align: right;
font-family: SourceHanSansSC-regular;
}
.content {
display: flex;
margin-left: 60rpx;
margin-right: 60rpx;
justify-content: space-between;
justify-items: center;
align-items: center;
}
.left-bar {
color: #fff;
font-size: 15px;
text-align: center;
font-weight: bold;
background: #F02121;
border-top-left-radius: 0.8rem;
border-bottom-left-radius: 0.8rem;
}
.right-bar {
color: #fff;
font-size: 15px;
text-align: center;
background: #04764E;
font-weight: bold;
border-top-right-radius: 0.8rem;
border-bottom-right-radius: 0.8rem;
}
.text3 {
text-align: left;
padding-left: 28rpx;
padding-right: 28rpx;
margin-top: 20rpx;
margin-bottom: 40rpx;
font-size: 30rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #777777;
}
.button {
line-height: 40rpx;
border-radius: 40rpx;
background: linear-gradient(180deg, rgba(40, 120, 255, 1) 0%, rgba(40, 111, 234, 1) 100%);
color: rgba(255, 255, 255, 1);
font-size: 28rpx;
padding-top: 20rpx;
padding-bottom: 20rpx;
margin-left: 26rpx;
margin-right: 26rpx;
text-align: center;
font-family: Roboto;
}
.team_text {
font-size: 30rpx;
font-weight: 500;
color: #333333;
}
.status_text_bg {
background: #E3F0EC;
border-radius: 16rpx;
margin-left: 30rpx;
margin-right: 30rpx;
margin-bottom: 24rpx;
margin-top: 24rpx;
padding: 24rpx;
display: flex;
flex-direction: column;
}
.status_s_text {
background: #FF9139;
border-radius: 8rpx 8rpx 8rpx 8rpx;
font-size: 28rpx;
font-weight: 400;
height: 40rpx;
line-height: 40rpx;
padding-left: 6rpx;
padding-right: 6rpx;
color: #FFFFFF;
text-align: center;
margin-left: 24rpx;
margin-right: 24rpx;
}
</style>
{
"name" : "JinQiuSports",
"name" : "金球体育",
"appid" : "__UNI__E81960F",
"description" : "",
"description" : "金球体育",
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,
......@@ -68,5 +68,11 @@
"uniStatistics" : {
"enable" : false
},
"vueVersion" : "2"
"vueVersion" : "2",
"h5" : {
"router" : {
"mode" : "history"
},
"template" : "template.h5.html"
}
}
......@@ -3,104 +3,101 @@
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "首页",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#25CDAA"
"navigationBarTitleText": "首页",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#04764E"
}
}, {
"path": "pages/study/study",
"style": {
"navigationBarTitleText": "研究",
"enablePullDownRefresh": false,
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#04764E"
}
}, {
"path": "pages/info/info",
"style": {
"navigationBarTitleText": "情报",
"enablePullDownRefresh": false,
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#04764E"
}
}, {
"path": "pages/mine/mine",
"style": {
"navigationBarTitleText": "我的",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}, {
"path": "pages/login_pwd/login_pwd",
"style": {
"navigationBarTitleText": "账号登录",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}, {
"path": "pages/login_yzm/login_yzm",
"style": {
"navigationBarTitleText": "验证码登录",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}, {
"path": "pages/suggest/suggest",
"style": {
"navigationBarTitleText": "提建议",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}, {
"path": "pages/settings/settings",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}, {
"path": "pages/logout/logout",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}, {
"path": "pages/notitle_webview/notitle_webview",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}, {
"path": "pages/normal_webview/normal_webview",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}, {
"path": "pages/analysis/analysis",
"style": {
"navigationBarTitleText": "分析",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#04764E"
}
}
,{
"path" : "pages/study/study",
"style" :
{
"navigationBarTitleText": "研究",
"enablePullDownRefresh": false,
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#25CDAA"
}
}
,{
"path" : "pages/info/info",
"style" :
{
"navigationBarTitleText": "情报",
"enablePullDownRefresh": false,
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#25CDAA"
}
}
,{
"path" : "pages/mine/mine",
"style" :
{
"navigationBarTitleText": "我的",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}
,{
"path" : "pages/login_pwd/login_pwd",
"style" :
{
"navigationBarTitleText": "账号登录",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}
,{
"path" : "pages/login_yzm/login_yzm",
"style" :
{
"navigationBarTitleText": "验证码登录",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}
,{
"path" : "pages/suggest/suggest",
"style" :
{
"navigationBarTitleText": "提建议",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}
,{
"path" : "pages/settings/settings",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/logout/logout",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/notitle_webview/notitle_webview",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}
,{
"path" : "pages/normal_webview/normal_webview",
"path" : "pages/test/test",
"style" :
{
"navigationBarTitleText": "",
......@@ -110,41 +107,40 @@
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTextStyle": "white",
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
},
"tabBar": {
"backgroundColor": "#F8F8F8",
"selectedColor": "#0a1b31",
"color": "#999999",
"list": [
{
"text": "首页",
"iconPath": "static/tab_icons/Home02.png",
"selectedIconPath": "static/tab_icons/Home01.png",
"pagePath": "pages/index/index"
},
{
"text": "研究",
"iconPath": "static/tab_icons/gc02.png",
"selectedIconPath": "static/tab_icons/gc01.png",
"pagePath": "pages/study/study"
},
{
"text": "情报",
"iconPath": "static/tab_icons/qb02.png",
"selectedIconPath": "static/tab_icons/qb01.png",
"pagePath": "pages/info/info"
},
{
"text": "我的",
"iconPath": "static/tab_icons/wd02.png",
"selectedIconPath": "static/tab_icons/wd01.png",
"pagePath": "pages/mine/mine"
}
]
"navigationBarBackgroundColor": "#04764E",
"backgroundColor": "#F5F5F5"
},
"tabBar": {
"backgroundColor": "#F8F8F8",
"selectedColor": "#0a1b31",
"color": "#999999",
"list": [{
"text": "首页",
"iconPath": "static/tab_icons/ic_shouye_off@2x.png",
"selectedIconPath": "static/tab_icons/ic_shouye_on@2x.png",
"pagePath": "pages/index/index"
},
{
"text": "研究",
"iconPath": "static/tab_icons/ic_yanjiu_off@2x.png",
"selectedIconPath": "static/tab_icons/ic_yanjiu_on@2x.png",
"pagePath": "pages/study/study"
},
{
"text": "情报",
"iconPath": "static/tab_icons/ic_qingbao_off@2x.png",
"selectedIconPath": "static/tab_icons/ic_qingbao_on@2x.png",
"pagePath": "pages/info/info"
},
{
"text": "我的",
"iconPath": "static/tab_icons/ic_person_off@2x.png",
"selectedIconPath": "static/tab_icons/ic_person_on@2x.png",
"pagePath": "pages/mine/mine"
}
]
},
"uniIdRouter": {}
}
<template>
<view>
<view v-if="isLoading" style="display: flex; justify-content: center; width: 100%; height: 100vh; align-items: center;">
<image src="../../static/loading_icon.gif"></image>
</view>
<view v-else>
<view style="display: flex; margin: 35rpx; justify-content: space-between;">
<text>积分对比</text>
<view style="display: flex;">
<text :class="headerType === 0 ? 'tong_ke' : 'unselect_tong_ke'" @click="selectHeader(0)">主客</text>
<text :class="headerType === 1 ? 'tong_ke' : 'unselect_tong_ke'" style="margin-left: 35rpx;"
@click="selectHeader(1)">主场</text>
<text :class="headerType === 2 ? 'tong_ke' : 'unselect_tong_ke'" style="margin-left: 35rpx;"
@click="selectHeader(2)">客场</text>
</view>
</view>
<view style="display: flex; margin-left: 35rpx; margin-right: 35rpx; margin-bottom: 35rpx;">
<view :v-show="getIntegralData(true,6)" class="unselect_tong_ke" style="flex: 1;">
<view style="flex: 1; display: flex; flex-direction: column; align-items: center;">
<text style="color: #666; font-size: 28rpx; margin-top: 10rpx;">主队</text>
<text style="color: #666; font-size: 50rpx;">{{getIntegralData(true,6)}}</text>
</view>
<view style="flex: 1;">
<view class="color_item">
<text style="flex: 1; color: #333333;">{{getIntegralData(true,1) + "胜"}}</text>
<view style="flex: 1; height: 30rpx; background-color: #ff6858;"></view>
</view>
<view class="color_item">
<text style="flex: 1; color: #333333;">{{getIntegralData(true,2) + "平"}}</text>
<view style="flex: 1; height: 30rpx; background-color: #91bb80;"></view>
</view>
<view class="color_item">
<text style="flex: 1; color: #333333;">{{getIntegralData(true,3) + "负"}}</text>
<view style="flex: 1; height: 30rpx; background-color: #6f83fc;"></view>
</view>
</view>
</view>
<view :v-show="getIntegralData(true,6)" class="unselect_tong_ke" style="flex: 1; margin-left: 35rpx">
<view style="flex: 1; display: flex; flex-direction: column; align-items: center;">
<text style="color: #666; font-size: 28rpx; margin-top: 10rpx;">客队</text>
<text style="color: #666; font-size: 50rpx;">{{getIntegralData(false,6)}}</text>
</view>
<view style="flex: 1;">
<view class="color_item">
<text style="flex: 1; color: #333333;">{{getIntegralData(false,1) + "胜"}}</text>
<view style="flex: 1; height: 30rpx; background-color: #ff6858;"></view>
</view>
<view class="color_item">
<text style="flex: 1; color: #333333;">{{getIntegralData(false,2) + "平"}}</text>
<view style="flex: 1; height: 30rpx; background-color: #91bb80;"></view>
</view>
<view class="color_item">
<text style="flex: 1; color: #333333;">{{getIntegralData(false,3) + "负"}}</text>
<view style="flex: 1; height: 30rpx; background-color: #6f83fc;"></view>
</view>
</view>
</view>
</view>
<view
style="display: flex; justify-content: space-between; align-items: center; margin-left: 30rpx; margin-right: 30rpx;">
<image style="width: 60rpx; height: 60rpx;" :src="gameInfo.HomeTeam.Photo" />
<view>
<text style="width: 100%; display: flex;
justify-content: center; align-items: center; text-align: center; font-size: 28rpx; color: #666;">历史交锋</text>
<view style="font-size: 28rpx; color: #666;">
<text>{{"近"+ gameanalyse.Meeting.length+"场 " + gameInfo.HomeTeam.ShortName + " " }}</text>
<text class="red">{{this.countWin(gameInfo.HomeTeam.Id,gameanalyse.Meeting, "胜") + "胜"}}</text>
<text
class="green">{{this.countWin(gameInfo.HomeTeam.Id,gameanalyse.Meeting, "平") + "平"}}</text>
<text class="blue">{{this.countWin(gameInfo.HomeTeam.Id,gameanalyse.Meeting, "负") + "负"}}</text>
</view>
</view>
<image style="width: 60rpx; height: 60rpx;" :src="gameInfo.AwayTeam.Photo" />
</view>
<view>
<view style="display: flex; justify-content: space-between; width: 100%; margin-top: 30rpx;">
<text class="title_text" style="width: 20%;">赛事</text>
<view style="display: flex; justify-content: space-between;">
<text class="title_text"></text>
<text class="title_text"
style="flex: 1; display: flex; margin-left: 30rpx; margin-right: 30rpx;">比分(半场)</text>
<text class="title_text"></text>
</view>
<text class="title_text" style="color: #6f83fc; width: 20%;">{{getWinTypeName()}}</text>
</view>
<view v-for="(item, index) in gameanalyse.Meeting" :class="index % 2 == 0 ?'item_bg' : 'item_bg_two'"
:key="index">
<view style="display: flex; width: 16%; flex-direction: column;
justify-content: center; align-items: center;">
<text class="text1">{{Competition[item.Id[1]].ShortName}}</text>
<text class="text1">{{utils.dateFormatYear2(item.Date)}}</text>
</view>
<view style="display: flex; width: 100%; flex: 1; font-size: 16px;
flex-direction: row;">
<text :style="'color:' + getTeamNameColor(gameInfo.HomeTeam.Id,item.Id[2],item)"
style="flex: 1; text-align: right;">{{Team[item.Id[2]].ShortName}}</text>
<view style="margin-left: 30rpx; margin-right: 30rpx; ">
<text
style="font-size: 18px; color: #666; font-weight: bold;">{{item.ScoreAll[0] + ":" + item.ScoreAll[1]}}</text>
<text style="font-size: 14px; margin-left: 6rpx;
color: #999; padding-top: 5px">{{"["+item.Half+"]"}}</text>
</view>
<text :style="'color:' + getTeamNameColor(gameInfo.HomeTeam.Id,item.Id[3],item)"
style="flex: 1; text-align: left;">{{Team[item.Id[3]].ShortName}}</text>
</view>
<view class="item_win_text"
:style="'background-color:' + getTeamNameColor(gameInfo.HomeTeam.Id, gameInfo.HomeTeam.Id, item)"
@click="switchWinType()">
<text>{{getWinTypeInfo( gameInfo.HomeTeam.Id, item)}}</text>
</view>
</view>
</view>
<view style="display: flex; margin-top: 35rpx; background-color: white;">
<image style="width: 60rpx; height: 60rpx; margin-left: 35rpx; margin-right: 35rpx;"
:src="gameInfo.HomeTeam.Photo" />
<view>
<view style="font-size: 28rpx; color: #666;">
<text style="font-size: 16px; color: #333333;">{{gameInfo.HomeTeam.Name}}</text>
<text>{{" 近"+ homeList.length+"场 "}}</text>
<text class="red">{{this.countWin(gameInfo.HomeTeam.Id,homeList, "胜") + "胜 "}}</text>
<text class="green">{{this.countWin(gameInfo.HomeTeam.Id,homeList, "平") + "平 "}}</text>
<text class="blue">{{this.countWin(gameInfo.HomeTeam.Id,homeList, "负") + "负"}}</text>
</view>
<view style="font-size: 24rpx; color: #888;">
<text>{{gameInfo.HomeTeam.Name + "在各项赛事中已经"}}</text>
</view>
</view>
</view>
<view style="display: flex;
justify-content: space-between;
height: 50rpx;
margin-left: 35rpx;
margin-right: 35rpx;
margin-top: 35rpx;">
<view style="display: flex;">
<text :class="homeChang ? 'left_chang_shu' : 'unselect_left_chang_shu'"
@click="selectTong(false ,homeTongSai, homeTongKe,true)">10场</text>
<text :class="homeChang ? 'unselect_right_chang_shu' : 'right_chang_shu'"
@click="selectTong(false ,homeTongSai, homeTongKe,false)">20场</text>
</view>
<view style="display: flex; ">
<text :class="homeTongSai ? 'tong_ke' : 'unselect_tong_ke'"
@click="selectTong(false, !homeTongSai, homeTongKe,homeChang)">同赛事</text>
<text :class="homeTongKe ? 'tong_ke' : 'unselect_tong_ke'" style="margin-left: 35rpx;"
@click="selectTong(false, homeTongSai, !homeTongKe,homeChang)">同主客</text>
</view>
</view>
<view>
<view style="display: flex; justify-content: space-between; width: 100%; margin-top: 30rpx;">
<text class="title_text" style="width: 20%;">赛事</text>
<view style="display: flex; justify-content: space-between;">
<text class="title_text"></text>
<text class="title_text"
style="flex: 1; display: flex; margin-left: 30rpx; margin-right: 30rpx;">比分(半场)</text>
<text class="title_text"></text>
</view>
<text class="title_text" style="color: #6f83fc; width: 20%;">{{getWinTypeName()}}</text>
</view>
<view v-for="(item, index) in homeList" :class="index % 2 == 0 ?'item_bg' : 'item_bg_two'" :key="index">
<view style="display: flex; width: 16%; flex-direction: column;
justify-content: center; align-items: center;">
<text class="text1">{{Competition[item.Id[1]].ShortName}}</text>
<text class="text1">{{utils.dateFormatYear2(item.Date)}}</text>
</view>
<view style="display: flex; width: 100%; flex: 1; font-size: 16px;
flex-direction: row;">
<text :style="'color:' + getTeamNameColor(gameInfo.HomeTeam.Id,item.Id[2],item)"
style="flex: 1; text-align: right;">{{Team[item.Id[2]].ShortName}}</text>
<view style="margin-left: 30rpx; margin-right: 30rpx; ">
<text
style="font-size: 18px; color: #666; font-weight: bold;">{{item.ScoreAll[0] + ":" + item.ScoreAll[1]}}</text>
<text style="font-size: 14px; margin-left: 6rpx;
color: #999; padding-top: 5px">{{"["+item.Half+"]"}}</text>
</view>
<text :style="'color:' + getTeamNameColor(gameInfo.HomeTeam.Id,item.Id[3],item)"
style="flex: 1; text-align: left;">{{Team[item.Id[3]].ShortName}}</text>
</view>
<view class="item_win_text"
:style="'background-color:' + getTeamNameColor(gameInfo.HomeTeam.Id, gameInfo.HomeTeam.Id, item)"
@click="switchWinType()">
<text>{{getWinTypeInfo( gameInfo.HomeTeam.Id, item)}}</text>
</view>
</view>
</view>
<view style="display: flex; margin-top: 35rpx; background-color: white;">
<image style="width: 60rpx; height: 60rpx; margin-left: 35rpx; margin-right: 35rpx;"
:src="gameInfo.AwayTeam.Photo" />
<view>
<view style="font-size: 28rpx; color: #666;">
<text style="font-size: 16px; color: #333333;">{{gameInfo.AwayTeam.Name}}</text>
<text>{{" 近"+ awayList.length+"场 "}}</text>
<text class="red">{{this.countWin(gameInfo.AwayTeam.Id,awayList, "胜") + "胜 "}}</text>
<text class="green">{{this.countWin(gameInfo.AwayTeam.Id,awayList, "平") + "平 "}}</text>
<text class="blue">{{this.countWin(gameInfo.AwayTeam.Id,awayList, "负") + "负"}}</text>
</view>
<view style="font-size: 24rpx; color: #888;">
<text>{{gameInfo.AwayTeam.Name + "在各项赛事中已经"}}</text>
</view>
</view>
</view>
<view style="display: flex;
justify-content: space-between;
height: 50rpx;
margin-left: 35rpx;
margin-right: 35rpx;
margin-top: 35rpx;">
<view style="display: flex;">
<text :class="awayChang ? 'left_chang_shu' : 'unselect_left_chang_shu'"
@click="selectTong(true , awayTongSai, awayTongKe,true)">10场</text>
<text :class="awayChang ? 'unselect_right_chang_shu' : 'right_chang_shu'"
@click="selectTong(true ,awayTongSai, awayTongKe,false)">20场</text>
</view>
<view style="display: flex; ">
<text :class="awayTongSai ? 'tong_ke' : 'unselect_tong_ke'"
@click="selectTong(true, !awayTongSai,awayTongKe, awayChang)">同赛事</text>
<text :class="awayTongKe ? 'tong_ke' : 'unselect_tong_ke'" style="margin-left: 35rpx;"
@click="selectTong(true, awayTongSai, !awayTongKe,awayChang)">同主客</text>
</view>
</view>
<view>
<view style="display: flex; justify-content: space-between; width: 100%; margin-top: 30rpx;">
<text class="title_text" style="width: 20%;">赛事</text>
<view style="display: flex; justify-content: space-between;">
<text class="title_text"></text>
<text class="title_text"
style="flex: 1; display: flex; margin-left: 30rpx; margin-right: 30rpx;">比分(半场)</text>
<text class="title_text"></text>
</view>
<text class="title_text" style="color: #6f83fc; width: 20%;">{{getWinTypeName()}}</text>
</view>
<view v-for="(item, index) in awayList" :class="index % 2 == 0 ?'item_bg' : 'item_bg_two'" :key="index">
<view style="display: flex; width: 16%; flex-direction: column;
justify-content: center; align-items: center;">
<text class="text1">{{Competition[item.Id[1]].ShortName}}</text>
<text class="text1">{{utils.dateFormatYear2(item.Date)}}</text>
</view>
<view style="display: flex; width: 100%; flex: 1; font-size: 16px;
flex-direction: row;">
<text :style="'color:' + getTeamNameColor(gameInfo.AwayTeam.Id,item.Id[2],item)"
style="flex: 1; text-align: right;">{{Team[item.Id[2]].ShortName}}</text>
<view style="margin-left: 30rpx; margin-right: 30rpx; ">
<text
style="font-size: 18px; color: #666; font-weight: bold;">{{item.ScoreAll[0] + ":" + item.ScoreAll[1]}}</text>
<text style="font-size: 14px; margin-left: 6rpx;
color: #999; padding-top: 5px">{{"["+item.Half+"]"}}</text>
</view>
<text :style="'color:' + getTeamNameColor(gameInfo.AwayTeam.Id,item.Id[3],item)"
style="flex: 1; text-align: left;">{{Team[item.Id[3]].ShortName}}</text>
</view>
<view class="item_win_text"
:style="'background-color:' + getTeamNameColor(gameInfo.AwayTeam.Id, gameInfo.AwayTeam.Id, item)"
@click="switchWinType()">
<text>{{getWinTypeInfo( gameInfo.AwayTeam.Id, item)}}</text>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import {
default as http
} from "@/utils/http.js";
import utils from "../../utils/utils.js";
import AnalysisList from "@/components/AnalysisList.nvue"
export default {
components: {
AnalysisList
},
data() {
return {
winTypeArray: ["胜平负", "进球", "半全场"],
winTypeIndex: 0,
utils,
gameInfo: {},
gameanalyse: {},
competitionstanding: {},
competitionschedule: {},
isLoading: false,
awayChang: true,
homeChang: true,
homeList: [],
awayList: [],
awayTongSai: false,
awayTongKe: false,
homeTongSai: false,
homeTongKe: false,
Competition: {},
Team: {},
headerType: 0,
homeIntegral: {},
awayIntegral: {}
}
},
async onLoad(val) {
console.log(val)
this.isLoading = true
let data = JSON.parse(decodeURIComponent(val.info))
let query_data = `query{
getgameinfo(gameid:${data})
getgameanalyse(gameid:${data})
}`
let result = await http.gql({
query: query_data
})
this.isLoading = false
console.log("result:" + JSON.stringify(result))
if (result && result.data && result.data.getgameinfo) {
await this.requestData(result.data.getgameinfo.Competition.Id)
this.gameInfo = result.data.getgameinfo
this.gameanalyse = result.data.getgameanalyse
this.Competition = this.gameanalyse.Competition
this.Team = this.gameanalyse.Team
this.selectHeader(0)
this.selectTong(true, this.awayTongSai, this.awayTongKe, this.awayChang)
this.selectTong(false, this.homeTongSai, this.homeTongKe, this.homeChang)
} else {
uni.showToast({
icon: "none",
title: "数据异常",
});
return;
}
},
methods: {
getIntegralData(home, index) {
var data = this.homeIntegral
if (!home) {
data = this.awayIntegral
}
if (data && Object.keys(data).length !== 0) {
console.log(JSON.stringify(data))
return data.Data[index]
}
return 0;
},
selectHeader(type) {
this.headerType = type
var this_ = this
var cName = this.gameInfo.Competition.Name
switch (type) {
case 0:
console.log(JSON.stringify(Object.values(this.competitionstanding.Standing)[0]) + "--" + cName)
var data = Object.values(this.competitionstanding.Standing)[0].Away
data.forEach(function(item) {
console.log(JSON.stringify(item) + "--" + this_.gameInfo.HomeTeam.Id + "--" + this_
.gameInfo.AwayTeam.Id)
if (item.Team === this_.gameInfo.HomeTeam.Id) {
this_.homeIntegral = item;
}
if (item.Team === this_.gameInfo.AwayTeam.Id) {
this_.awayIntegral = item;
}
});
break
case 1:
var data = Object.values(this.competitionstanding.Standing)[0].Home
data.forEach(function(item) {
console.log(JSON.stringify(item) + "--" + this_.gameInfo.HomeTeam.Id + "--" + this_
.gameInfo.AwayTeam.Id)
if (item.Team === this_.gameInfo.HomeTeam.Id) {
this_.homeIntegral = item;
}
if (item.Team === this_.gameInfo.AwayTeam.Id) {
this_.awayIntegral = item;
}
});
break
case 2:
var data = Object.values(this.competitionstanding.Standing)[0].Total
data.forEach(function(item) {
if (item.Team === this_.gameInfo.HomeTeam.Id) {
this_.homeIntegral = item;
}
if (item.Team === this_.gameInfo.AwayTeam.Id) {
this_.awayIntegral = item;
}
});
break
}
},
selectTong(away, sai, ke, chang) {
console.log("away:" + away + " sai:" + sai + "ke:" + ke + "chang:" + chang)
if (away) {
this.awayTongKe = ke
this.awayTongSai = sai
this.awayChang = chang
var count = this.awayChang ? 10 : 20;
if (sai) {
var id = this.gameInfo.Id[1]
this.awayList = this.gameanalyse.TeamHistory.Away.filter(item => item.Id[1] === id)
} else {
this.awayList = this.gameanalyse.TeamHistory.Away
}
if (ke) {
var id = this.gameInfo.AwayTeam.Id
this.awayList = this.awayList.filter(item => item.Id[3] === id)
}
this.awayList = this.awayList.slice(0, count)
} else {
this.homeChang = chang
var count = this.homeChang ? 10 : 20;
this.homeTongKe = ke
this.homeTongSai = sai
if (sai) {
var id = this.gameInfo.Id[1]
this.homeList = this.gameanalyse.TeamHistory.Home.filter(item => item.Id[1] === id)
} else {
this.homeList = this.gameanalyse.TeamHistory.Home
}
if (ke) {
var id = this.gameInfo.HomeTeam.Id
this.homeList = this.homeList.filter(item => item.Id[2] === id)
}
this.homeList = this.homeList.slice(0, count)
}
},
async requestData(competitionid) {
let query_data = `query{
getcompetitionstanding(competitionid:${competitionid})
getcompetitionschedule(competitionid:${competitionid}) {
Mode
Team
Schedule
Competition
}
}`
let result = await http.gql({
query: query_data
})
console.log("result:" + JSON.stringify(result))
if (result && result.data && result.data.getcompetitionstanding) {
this.competitionstanding = result.data.getcompetitionstanding
this.competitionschedule = result.data.getcompetitionschedule
} else {
uni.showToast({
icon: "none",
title: "数据异常",
});
return;
}
},
countWin(homeId, date, type) { // 计算胜负平场数
var result = 0;
for (let item of date) {
if (this.checkTramWin(homeId, item, item.ScoreAll) === type) {
result++
}
}
return result
},
checkTramWin(id, item, score) { // 判断是赢是输是平
var index1 = item.Id[2] === id ? 0 : 1;
var index2 = item.Id[2] === id ? 1 : 0;
if (score[index1] > score[index2]) {
return "胜";
} else if (score[index1] == score[index2]) {
return "平";
} else {
return "负";
}
},
getWinTypeInfo(id, item) {
switch (this.winTypeIndex) {
case 0:
return this.checkTramWin(id, item, item.ScoreAll);
case 1:
return (item.ScoreAll[0] + item.ScoreAll[1]) + "球"
case 2:
return this.checkTramWin(id, item, item.Half.split('-')) + this.checkTramWin(id, item, item
.ScoreAll)
}
},
getTeamNameColor(homdId, id, item) {
if (homdId !== id) {
return "#888888"
} else {
var type = this.checkTramWin(id, item, item.ScoreAll)
if (type === "胜") {
return "#ff6858";
} else if (type === "平") {
return "#82c866";
} else {
return "#6f83fc";
}
}
},
getWinTypeName() {
return this.winTypeArray[this.winTypeIndex]
},
switchWinType() {
this.winTypeIndex++
if (this.winTypeIndex >= this.winTypeArray.length) {
this.winTypeIndex = 0
}
}
}
}
</script>
<style>
.red {
color: #ff6858;
}
.green {
color: #82c866;
}
.blue {
color: #6f83fc;
}
.title_text {
text-align: center;
font-size: 24rpx;
color: #b2b2b2;
}
.item_bg {
font-size: 14px;
display: flex;
justify-content: space-between;
align-items: center;
text-align: center;
padding-top: 15rpx;
padding-bottom: 15rpx;
padding-left: 15rpx;
padding-right: 15rpx;
background-color: #fafafa;
}
.item_bg_two {
font-size: 14px;
display: flex;
justify-content: space-between;
align-items: center;
text-align: center;
padding-top: 15rpx;
padding-bottom: 15rpx;
padding-left: 15rpx;
padding-right: 15rpx;
background-color: white;
}
.item_win_text {
width: 16%;
text-align: center;
border-radius: 2px;
padding: 1px 0px;
font-size: 12px;
background-color: rgb(145, 187, 128);
color: rgb(255, 255, 255);
}
.text1 {
text-align: center;
font-size: 12px;
color: #999;
}
.text2 {
text-align: center;
font-size: 12px;
color: #b2b2b2;
}
.left_chang_shu {
text-align: center;
font-size: 12px;
flex: 1;
padding: 3px 5px;
display: flex;
justify-content: center;
align-items: center;
background: #545578;
color: #ffffff;
width: 130rpx;
border-top-left-radius: 40rpx;
border-bottom-left-radius: 40rpx;
border: 2rpx solid #545578;
}
.unselect_left_chang_shu {
text-align: center;
font-size: 12px;
flex: 1;
padding: 3px 5px;
display: flex;
justify-content: center;
align-items: center;
background: #ffffff;
color: #888;
width: 130rpx;
border-top-left-radius: 40rpx;
border-bottom-left-radius: 40rpx;
border: 2rpx solid #545578;
}
.right_chang_shu {
text-align: center;
font-size: 12px;
background: #545578;
color: #ffffff;
flex: 1;
width: 130rpx;
padding: 3px 5px;
display: flex;
justify-content: center;
align-items: center;
border-top-right-radius: 40rpx;
border-bottom-right-radius: 40rpx;
border: 2rpx solid #545578;
}
.unselect_right_chang_shu {
text-align: center;
font-size: 24rpx;
color: #888;
flex: 1;
width: 130rpx;
padding: 6rpx 10rpx;
display: flex;
background-color: white;
justify-content: center;
align-items: center;
border-top-right-radius: 40rpx;
border-bottom-right-radius: 40rpx;
border: 2rpx solid #545578;
}
.tong_ke {
font: 28rpx;
text-align: center;
font-size: 24rpx;
background: #545578;
color: #ffffff;
justify-content: center;
align-items: center;
padding: 3px 10px;
display: flex;
border: 1px solid #e8e8e8;
border-radius: 2px;
}
.unselect_tong_ke {
font: 14px;
text-align: center;
font-size: 12px;
color: #888;
background-color: white;
justify-content: center;
align-items: center;
padding: 3px 10px;
display: flex;
border: 1px solid #e8e8e8;
border-radius: 2px;
}
.color_item {
display: flex;
justify-content: space-between;
align-items: center;
padding-top: 3px;
padding-bottom: 3px;
font-size: 24rpx;
}
</style>
<template>
<view class="content">
<view>
<v-tabs v-model="current" :tabs="tabs" @change="changeTab" line-height="5rpx" line-color="#25CDAA"></v-tabs>
<v-tabs class="tab_c" v-model="current" :tabs="tabs" @change="changeTab"
line-height="8rpx" line-color="#04764E"
color="#AAAAAA" activeColor="#04764E" height="88rpx"></v-tabs>
<z-swiper style="padding-top: 100rpx;" ref="zSwiper" v-model="tabs" @slideChange="onSwiperChange"
:options="options">
<z-swiper-item v-for="(item, index) in tabs" :key="item" style="min-height: 90vh;">
<view v-if="match_map.get(item) && match_map.get(item).length > 0 " style="width: 100vw;">
<MatchList :data_info="match_map.get(item)" ref="MatchListRef" :key="index" @updateItem ="updateItem"></MatchList>
</view>
<view style="width: 100vw; height: 80vh; align-items: center; display: flex; justify-content: center;"
v-else>
<text>暂无比赛</text>
</view>
</z-swiper-item>
</z-swiper>
</view>
</template>
<script>
import MatchList from '../../components/MatchList.vue'
import {
default as http
} from "@/utils/http.js";
import common from '../../utils/common';
import followHelper from '../../utils/followHelper.js';
export default {
components: {
MatchList
},
data() {
return {
current: 0,
tabs: ['关注', '国内', '新闻新闻', '军事', '国内', '新闻', '军事', '国内', '新闻']
match_map: new Map(),
options: {
autoHeight: true,
centeredSlides: true,
centeredSlidesBounds: true,
initialSlide: 1
},
current: 1,
tabs: []
}
},
onLoad() {
async onLoad() {
let infoRes = await http.gql({
"query": `{
liveScore(lotIds: "72,45",order:[["MatchTime","desc"]], limit:100) {
count
matchs {
Id
InfoId
LotteryId
IssueName
MatchTime
MatchNumber
HostName
HostRed
HostYellow
GuestName
GuestRed
GuestYellow
GameName
QcBf
BcBf
HostTeam {
LogoFullPath
}
GuestTeam {
LogoFullPath
}
MatchState
MatchRound
PreTotalScore
Temperature
SportsInjury
SportsInfoCount
Sportsdt {
SportsdtMatchId
}
}
}
} `
})
let matchs = infoRes.data.liveScore.matchs
if (this.match_map.size > 0) {
this.match_map.clear()
}
this.tabs.length = 0
var followList = await followHelper.getFollowList()
this.match_map.set("关注", followList)
let zhongyao = []
let wancheng = []
for (let m of matchs) {
if (m.MatchState === "完") {
wancheng.push(m)
} else if(m.MatchState === "未"){
zhongyao.push(m)
}
}
zhongyao.sort((item1, item2) => (new Date(item1.IssueName) - new Date(item2.IssueName)))
this.match_map.set("重要", zhongyao)
this.match_map.set("完赛", wancheng)
for (let m of matchs) {
if (m.GameName) {
var list = this.match_map.get(m.GameName)
if (!list) {
list = []
}
list.push(m)
this.match_map.set(m.GameName, list)
}
}
for (const [key, value] of this.match_map.entries()) {
console.log(key, value.length);
}
this.tabs.push(...this.match_map.keys())
},
methods: {
methods: {
updateItem(id, index) {
console.log("id:" + id + "index:" + index)
var list = this.match_map.get(this.tabs[this.current])
var follow_list = followHelper.getFollowList()
var same = follow_list.some(function(item, index) {
return item.Id === id
})
if (same) {
list[index].isFollow = true
} else {
list[index].isFollow = false
}
console.log(list[index])
},
async startRealTime() {
let query_data = `query{
getlivedata
}`
let result = await http.gql({
query: query_data
})
console.log(result)
if (result && result.data && result.data.getlivedata) {
var liveData = result.data.getlivedata.LiveData
var zhongyao = this.match_map.get("重要")
for (let m of zhongyao) {
if (m && m.Sportsdt &&
m.Sportsdt.SportsdtMatchId
) {
var live = liveData[m.Sportsdt.SportsdtMatchId]
if (live) {
m.QcBf = live.ScoreAll[0] + "-" + live.ScoreAll[1]
m.BcBf = live.Score[0] + "-" + live.Score[1]
m.HostRed = live.RedCard[0]
m.HostYellow = live.YellowCard[0]
m.GuestRed = live.RedCard[1]
m.GuestYellow = live.YellowCard[1]
}
}
}
ref.onRefreshInfo(zhongyao)
console.log(zhongyao)
}
},
onSwiperChange(swiper) {
this.current = swiper.activeIndex
console.log("---》" + this.tabs[this.current] +"--"+ this.match_map.get(this.tabs[this.current]))
console.log('onSwiperChange:' + swiper.activeIndex)
var ref = this.$refs.MatchListRef[this.current]
console.log(this.$refs.MatchListRef)
if (this.current === 0) {
var followList = followHelper.getFollowList()
ref.onRefreshInfo(followList)
} else {
var data = this.match_map.get(this.tabs[this.current])
ref.onRefreshInfo(data)
}
},
changeTab(index) {
console.log('当前选中的项:' + index)
this.$refs.zSwiper.swiper.slideTo(index); //切换到第一个slide,速度为1秒
}
}
}
......@@ -31,6 +215,7 @@
flex-direction: column;
align-items: center;
justify-content: center;
background-color: #F5F5F5;
}
.logo {
......@@ -51,4 +236,9 @@
font-size: 36rpx;
color: #8f8f94;
}
.tab_c {
position: fixed;
z-index: 4;
}
</style>
<template>
<view>
<z-swiper ref="zSwiper" v-model="match_list"
@slideChange="onSwiperChange" :options="options">
<z-swiper ref="zSwiper" v-model="match_list" @slideChange="onSwiperChange" :options="options">
<z-swiper-item v-for="(item, index) in match_list" :key="item.Id" :custom-style="{width:'46%'}">
<view class="match-info"
:style="{'background-color': (select_index === index)
? '#25CDAA' : '#ffffff'}" @click="change_match(item, index)">
<view :class="select_index === index ? 'match-info' : 'match-info-unselect'"
@click="change_match(item, index)">
<view style="display: flex; justify-content: space-between; width: 100%;">
<text class="title-text-one"
:style="{'color': (select_index === index)
<text class="title-text-one" :style="{'color': (select_index === index)
? '#ffffff' : '#101010'}" @click="change_match(item, index)">{{deal_match_time(item)}}</text>
<text class="title-text-one"
:style="{'color': (select_index === index)
<text class="title-text-one" :style="{'color': (select_index === index)
? '#ffffff' : '#101010'}" @click="change_match(item, index)">{{item.MatchState}}</text>
</view>
<view class="team-h-g">
<image class="team-logo" :src="item.HostTeam.LogoFullPath" />
<text class="title-text-two"
:style="{'color': (select_index === index)
<text class="title-text-two" :style="{'color': (select_index === index)
? '#ffffff' : '#101010'}">{{item.HostName}}</text>
</view>
<view class="team-h-g">
<image class="team-logo" :src="item.GuestTeam.LogoFullPath" />
<text class="title-text-two"
:style="{'color': (select_index === index)
<text class="title-text-two" :style="{'color': (select_index === index)
? '#ffffff' : '#101010'}">{{item.GuestName}}</text>
</view>
</view>
......@@ -38,12 +32,20 @@
<view v-if="info_item.Info">
<view v-for="(strInfo, index) in info_item.Info" style="display: flex; flex-direction: row;">
<view class="text-index">{{index + 1}}</view>
<view v-for="(strInfo, index) in info_item.Info"
style="display: flex; flex-direction: row; margin: 35rpx; float: left;">
<view>
<text class="text-item">{{strInfo}}</text>
<text class="text-index-c">
{{index + 1}}
</text>
</view>
<text class="text-item">{{strInfo}}</text>
</view>
</view>
......@@ -71,14 +73,15 @@
options: {
slidesPerView: 'auto'
},
info_options: {
info_options: {
autoHeight: true,
centeredSlides: true,
centeredSlidesBounds: true
},
load_status: 0,
match_list: [],
view_point: null,
select_index : 0,
view_point: null,
select_index: 0,
}
},
methods: {
......@@ -113,7 +116,7 @@
},
change_match(item, index) {
this.$refs.zSwiperInfo.swiper.slideTo(index); //切换到第一个slide,速度为1秒
}
},
async onLoad() {
......@@ -143,14 +146,27 @@
.match-info {
display: flex;
flex-direction: column;
margin: 10rpx;
padding: 10rpx;
background-color: #25CDAA;
}
margin-top: 32rpx;
margin-left: 32rpx;
padding: 24rpx;
background: linear-gradient(135deg, #34C592 0%, #287E60 100%);
border-radius: 16rpx;
}
.match-info-unselect {
display: flex;
flex-direction: column;
margin-top: 32rpx;
margin-left: 32rpx;
padding: 24rpx;
border-radius: 16rpx;
border: 2rpx solid #04764E;
}
.team-logo {
width: 20px;
height: 20px;
width: 40rpx;
height: 40rpx;
border-radius: 10px;
}
......@@ -163,35 +179,37 @@
font-size: 25rpx;
}
.text-index {
width: 56rpx;
height: 56rpx;
margin: 11px;
background-color: #F5F5F5;
color: #888888;
font-size: 14px;
border-radius: 56rpx;
line-height: 56rpx;
.text-index-c{
width: 42rpx;
height: 42rpx;
margin: 22rpx;
background-color: #5589FF;
color: white;
float: left;
font-size: 28rpx;
border-radius: 100%;
line-height: 42rpx;
text-align: center;
}
.text-item {
color: #333333;
font-size: 16px;
text-align: justify;
border-radius: 20px;
line-height: 20px;
}
.title-text-one {
font-size: 13px;
color: white;
}
.title-text-two {
font-size: 18rpx;
margin-left: 6px;
color: white;
font-weight: 700;
font-size: 30rpx;
font-weight: 400;
color: #333333;
line-height: 42rpx;
}
.title-text-one {
font-size: 30rpx;
color: white;
font-weight: 400;
}
.title-text-two {
font-size: 36rpx;
margin-left: 6px;
color: white;
font-weight: 500;
}
</style>
......@@ -102,8 +102,10 @@
.Result
.FaceImageCode);
loginHelper.login(result.data.ydn_login.Result,result.data.ydn_login.AppToken)
loginHelper.login(result.data.ydn_login.Result , result.data.ydn_login.AppToken)
console.log("login")
uni.navigateBack();
return
} else {
uni.showToast({
icon: "none",
......
......@@ -19,25 +19,11 @@
</view>
</view>
<view style="border-top-left-radius: 30rpx;
border-bottom-left-radius: 30rpx; background: linear-gradient(to right, #e3b66a, #f6dc9f);
padding-left: 26rpx;
padding-right: 20rpx;
padding-top: 12rpx;
padding-bottom: 12rpx; font-size: 28rpx; color: #FFFFFF;" @click="gotoMember()">我的会员</view>
</view>
</view>
<view style="background-color: white; border-radius: 10rpx;
margin-left: 34rpx; margin-right: 34rpx;
padding-left: 20rpx ; padding-right: 20rpx; margin-top: 10%; align-self: center;">
<view class="qh-list-c" @click="gotoMyOrder()">
<view style="display: flex;">
<image src="../../static/mine_icons/mine_order_icon.png" style="width: 50rpx; height: 50rpx;" />
<text class="list-text">我的订单</text>
</view>
<image src="../../static/mine_icons/mine_right_arrow.png" style="width: 40rpx; height: 40rpx;" />
</view>
<view class="qh-list-c" @click="gotoSuggest()">
<view style="display: flex;">
......@@ -189,9 +175,8 @@
},
onShow: function() {
var userInfo = uni.getStorageSync("userInfo")
if (userInfo) {
loginHelper.login(userInfo);
var userInfo = loginHelper.getUserInfo()
if (userInfo) {
this.headIcon = userInfo.FaceImageCode
this.userName = userInfo.NickName
} else {
......
......@@ -29,9 +29,7 @@ export default {
},
onReady() {
let appInfo = app_config.app_info;
let token = uni.getStorageSync('uni_cookie');
let header = {
'Cookie': token,
AppVersion: encodeURI(JSON.stringify(appInfo))
}
// #ifdef APP-PLUS
......
......@@ -29,9 +29,7 @@ export default {
},
onReady() {
let appInfo = app_config.app_info;
let token = uni.getStorageSync('uni_cookie');
let header = {
'Cookie': token,
AppVersion: encodeURI(JSON.stringify(appInfo))
}
// #ifdef APP-PLUS
......
......@@ -32,7 +32,8 @@
</view>
</view>
<button style="background-color: white; margin: 35rpx; color: #469bf4;" @click="bindLogout()"> {{ this.hasLogin ? "退出登录" : '登陆/注册' }}</button>
<button style="background-color: white; margin: 35rpx; color: #469bf4;" @click="bindLogout()">
{{ this.hasLogin ? "退出登录" : '登陆/注册' }}</button>
</view>
</template>
......@@ -53,12 +54,14 @@
data() {
return {
app_config,
hasLogin : false,
updateInfoStr : "已是最新版本",
versionData : null,
versionName : app_config.app_info.AppName,
}
},
onShow() {
this.hasLogin = loginHelper.hasLogin()
console.log("onShow");
this.updateVersion();
},
......@@ -67,7 +70,7 @@
{
loginHelper.logout();
uni.reLaunch({
url: '/pages/user/user'
url: '/pages/mine/mine'
})
}
},
......
<template>
<view>
<z-swiper ref="zSwiper" v-model="match_list" @slideChange="onSwiperChange" :options="options">
<z-swiper-item v-for="(item, index) in match_list" :key="item.Id" :custom-style="{width:'46%'}">
<view class="match-info" :style="{'background-color': (select_index === index)
? '#25CDAA' : '#ffffff'}" @click="change_match(item, index)">
<z-swiper-item v-for="(item, index) in match_list" :key="item.Id" :custom-style="{width:'48%'}">
<view :class="select_index === index ? 'match-info' : 'match-info-unselect'"
@click="change_match(item, index)">
<view style="display: flex; justify-content: space-between; width: 100%;">
<text class="title-text-one" :style="{'color': (select_index === index)
? '#ffffff' : '#101010'}" @click="change_match(item, index)">{{deal_match_time(item)}}</text>
? '#ffffff' : '#777777'}" @click="change_match(item, index)">{{deal_match_time(item)}}</text>
<text class="title-text-one" :style="{'color': (select_index === index)
? '#ffffff' : '#101010'}" @click="change_match(item, index)">{{item.MatchState}}</text>
? '#ffffff' : '#777777'}" @click="change_match(item, index)">{{item.MatchState}}</text>
</view>
<view class="team-h-g">
<image class="team-logo" :src="item.HostTeam.LogoFullPath" />
<text class="title-text-two" :style="{'color': (select_index === index)
? '#ffffff' : '#101010'}">{{item.HostName}}</text>
? '#ffffff' : '#333333'}">{{item.HostName}}</text>
</view>
<view class="team-h-g">
<image class="team-logo" :src="item.GuestTeam.LogoFullPath" />
<text class="title-text-two" :style="{'color': (select_index === index)
? '#ffffff' : '#101010'}">{{item.GuestName}}</text>
? '#ffffff' : '#333333'}">{{item.GuestName}}</text>
</view>
</view>
</z-swiper-item>
......@@ -28,19 +28,13 @@
<z-swiper ref="zSwiperInfo" v-model="match_list" @slideChange="onSwiperInfoChange" :options="info_options">
<z-swiper-item v-for="(info_item, index) in match_list" :key="info_item.Id">
<MatchEventStatistics ref="child" v-if="info_item.MatchState !== '未'" :data_info="info_item" />
<MatchEventAnalysis ref="child" v-else="info_item.MatchState === '未'" :data_info="info_item" />
<z-swiper-item v-for="(info_item, index) in match_list" :key="info_item.Id">
<MatchEventAnalysis ref="child" :data_info="info_item" />
</z-swiper-item>
</z-swiper>
</view>
</template>
......@@ -51,6 +45,8 @@
import MatchEventStatistics from "@/components/match-list/MatchEventStatistics.vue";
import MatchEventAnalysis from "@/components/match-list/MatchEventAnalysis.vue";
import common from '../../utils/common';
export default {
components: {
MatchEventStatistics,
......@@ -73,11 +69,13 @@
},
methods: {
onSwiperChange(swiper) {
this.select_index = swiper.activeIndex
this.select_index = swiper.activeIndex
this.$refs.child[this.select_index].childmethods(this.match_list[this.select_index]) //子组件$on中的名字
this.$refs.zSwiperInfo.swiper.slideTo(this.select_index); //切换到第一个slide,速度为1秒
},
onSwiperInfoChange(swiper) {
this.select_index = swiper.activeIndex
this.select_index = swiper.activeIndex
this.$refs.child[this.select_index].childmethods(this.match_list[this.select_index]) //子组件$on中的名字
this.$refs.zSwiper.swiper.slideTo(this.select_index); //切换到第一个slide,速度为1秒
},
deal_match_time(match) {
......@@ -87,23 +85,8 @@
return match.GameName + ' ' + bj_time.substring(5, 16)
},
deal_viewpoint(item) {
var info = []
if (item) {
let viewpoint = JSON.parse(item.JcInfo)
if (viewpoint) {
info.push(...viewpoint.HostGood)
info.push(...viewpoint.HostBad)
info.push(...viewpoint.GuestGood)
info.push(...viewpoint.GuestBad)
}
}
return info
},
change_match(item, index) {
this.$refs.zSwiperInfo.swiper.slideTo(index); //切换到第一个slide,速度为1秒
}
},
async onLoad() {
......@@ -113,7 +96,7 @@
count
matchs {
Id
InfoId
InfoId
YiqiuMatchId
LotteryId
IssueName
......@@ -144,18 +127,17 @@
let matchs = infoRes.data.liveScore.matchs
if (this.match_list.length > 0) {
this.match_list.length = 0
}
for (let m of matchs) {
if (m.YiqiuMatchId) {
this.match_list.push(m)
}
}
for (let m of matchs) {
if (m.SportsInfoCount > 0) {
m.Info = this.deal_viewpoint(m)
this.match_list.push(m)
}
}
if (this.match_list.length > 0) {
this.select_index = 0
}
console.log("==========>>>", this.match_list)
console.log("==========>>>", JSON.stringify(this.match_list))
}
}
</script>
......@@ -163,15 +145,30 @@
<style>
.match-info {
display: flex;
flex-direction: column;
min-width: 400;
margin-top: 32rpx;
margin-left: 32rpx;
padding: 24rpx;
background: linear-gradient(135deg, #34C592 0%, #287E60 100%);
border-radius: 16rpx;
}
.match-info-unselect {
display: flex;
flex-direction: column;
margin: 10rpx;
padding: 10rpx;
background-color: #25CDAA;
margin-top: 32rpx;
min-width: 400;
margin-left: 32rpx;
padding: 24rpx;
border-radius: 16rpx;
border: 2rpx solid #04764E;
}
.team-logo {
width: 20px;
height: 20px;
width: 40rpx;
height: 40rpx;
border-radius: 10px;
}
......@@ -205,14 +202,17 @@
}
.title-text-one {
font-size: 13px;
color: white;
font-size: 28rpx;
color: white;
white-space: nowrap;
font-weight: 400;
}
.title-text-two {
font-size: 18rpx;
font-size: 36rpx;
margin-left: 6px;
color: white;
font-weight: 700;
color: white;
white-space: nowrap;
font-weight: 500;
}
</style>
<template>
<view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>
<style>
</style>

13.6 KB | 宽: | 高:

51.6 KB | 宽: | 高:

static/loading_icon.gif
static/loading_icon.gif
static/loading_icon.gif
static/loading_icon.gif
  • 两方对比
  • 交换覆盖
  • 透明覆盖

3.5 KB | 宽: | 高:

636.4 KB | 宽: | 高:

static/logo.png
static/logo.png
static/logo.png
static/logo.png
  • 两方对比
  • 交换覆盖
  • 透明覆盖

3.2 KB | 宽: | 高:

1.4 KB | 宽: | 高:

static/tab_icons/follow01.png
static/tab_icons/follow01.png
static/tab_icons/follow01.png
static/tab_icons/follow01.png
  • 两方对比
  • 交换覆盖
  • 透明覆盖

3.2 KB | 宽: | 高:

1.1 KB | 宽: | 高:

static/tab_icons/follow02.png
static/tab_icons/follow02.png
static/tab_icons/follow02.png
static/tab_icons/follow02.png
  • 两方对比
  • 交换覆盖
  • 透明覆盖
......@@ -5,11 +5,10 @@ if (uni) {
export default {
app: "150414001",
secret: "5C7B92CF77E1535BE41F45A0F04057EA",
ppolicy_app : 'http://www.qianhaiyilan.cn/ppolicy_app.html' ,// 隐私政策
ppolicy_user : 'http://www.qianhaiyilan.cn/ppolicy_user.html' , // 用户协议
ppolicy_app : 'http://www.qianhaiyilan.cn/ppolicy_jqty.html' ,// 隐私政策
ppolicy_user : 'http://www.qianhaiyilan.cn/ppolicy_jqty.html' , // 用户协议
server_url: {
app_host: "https://app.ydniu.com/",
app_host: "http://81.71.82.24/",
// 192.168.1.97
//app_host:"http://192.168.1.97:4000/",
},
......
const common = {
statusBarH: 0,
info_config: null,
info_config: null
}
export default common
import loginHelper from './loginHelper.js';
import utils from './utils.js';
let Follow_List = null
const followHelper = {
getFollowList() {
if (!loginHelper.hasLogin()) {
return []
}
if(!Follow_List) {
Follow_List = []
let temp_data = uni.getStorageSync('follow_list_key')
console.log(temp_data)
if (temp_data.length > 0) {
let temp_list = JSON.parse(temp_data)
Follow_List.push(...temp_list)
}
for (var i = 0; i < Follow_List.length; i++) {
var item = Follow_List[i]
if (utils.diffCurrentDay(item.MatchTime) >= 7) {
Follow_List.splice(i, 1);
}
}
let follow_str = JSON.stringify(Follow_List)
uni.setStorageSync('follow_list_key', follow_str)
}
console.log(Follow_List)
return Follow_List;
},
async follow_action(match) {
if (!loginHelper.hasLogin()) {
uni.showToast({
icon: "none",
title: "未登录",
});
return []
}
var index_flag = Follow_List.some(function(item, index) {
if (item.Id === match.Id) {
Follow_List.splice(index, 1);
}
return item.Id === match.Id;
})
let follow_str = JSON.stringify(Follow_List)
await uni.setStorageSync('follow_list_key', follow_str)
if (index_flag) {
uni.showToast({
title: "已取关"
})
match.isFollow = false
} else {
Follow_List.push(match)
match.isFollow = true
uni.showToast({
title: "已关注"
})
}
return Follow_List;
}
}
export default followHelper
......@@ -3,13 +3,13 @@ let info = null;
const loginHelper = {
login(userInfo, appToken) {
console.log("login" + hasLogin)
console.log("login" + userInfo + "appToken:" + appToken)
uni.setStorageSync("appToken", appToken);
uni.setStorageSync("userName", userInfo.NickName);
uni.setStorageSync("headIcon", userInfo.FaceImageCode);
uni.setStorageSync('userInfo', userInfo)
hasLogin = true;
info = userInfo;
info = userInfo;
},
logout() {
console.log("logout" + hasLogin)
......@@ -21,6 +21,12 @@ const loginHelper = {
info = null;
},
hasLogin() {
info = uni.getStorageSync('userInfo')
if(info) {
hasLogin = true
} else {
hasLogin = false
}
return hasLogin;
},
getDefaultHeadIcon() {
......@@ -31,6 +37,9 @@ const loginHelper = {
info = uni.getStorageSync('userInfo')
}
return info;
},
getAppToken() {
return uni.getStorageSync("appToken");
}
}
......
......@@ -32,6 +32,15 @@ const utils = {
return year + "-" + month + "-" + day + " " + hours + ":" + minutes;
},
dateFormatHoursMinutes(time) {
let date = new Date(time);
let hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
let minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
let seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
// 拼接
return hours + ":" + minutes;
},
dateFormatYear(time) {
let date = new Date(time);
let year = date.getFullYear();
......@@ -43,6 +52,17 @@ const utils = {
return year + "-" + month + "-" + day;
},
dateFormatYear2(time) {
let date = new Date(time);
let year = date.getFullYear() % 100;
// 在日期格式中,月份是从0开始的,因此要加0,使用三元表达式在小于10的前面加0,以达到格式统一 如 09:11:05
let month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
let day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
// 拼接
return year + "/" + month + "/" + day;
},
getTimeByISO(time) {
let temp_data = new Date(time).toJSON()
let bj_time = new Date(+new Date(temp_data) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(
......@@ -138,6 +158,22 @@ const utils = {
break;
}
return result
},
diffCurrentDay(time) {
// 将时间字符串转换为 Date 对象
var targetDate = new Date(time);
// 获取当前时间
const currentDate = new Date();
// 计算当前时间与目标时间之间的差距(以毫秒为单位)
const timeDifference = currentDate.getTime() - targetDate.getTime();
// 计算差距的天数
const daysDifference = Math.abs(Math.floor(timeDifference / (1000 * 3600 * 24)));
return daysDifference
}
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!