@ -0,0 +1,163 @@ |
||||
<script> |
||||
export default { |
||||
onLaunch: function() { |
||||
console.log('App Launch') |
||||
}, |
||||
onShow: function() { |
||||
|
||||
}, |
||||
onHide: function() { |
||||
console.log('App Hide') |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss"> |
||||
/*每个页面公共css */ |
||||
.header{ |
||||
width: 100%; |
||||
height: 184px; |
||||
box-sizing: border-box; |
||||
background: url(/static/hd2-bg.png) left top no-repeat; |
||||
background-size: auto 100%; |
||||
display: flex; |
||||
align-items: center; |
||||
.logo{ |
||||
width: 130px; |
||||
height: 130px; |
||||
image{ |
||||
width: 100%; |
||||
height: 100%; |
||||
} |
||||
margin-right: 88px; |
||||
margin-left: 50px; |
||||
} |
||||
.info{ |
||||
flex: 1; |
||||
.a{ |
||||
font-weight: bold; |
||||
font-size: 58px; |
||||
color: #FFFFFF; |
||||
} |
||||
.b{ |
||||
font-weight: bold; |
||||
font-size: 48px; |
||||
color: #FFFFFF; |
||||
margin-top: 15px; |
||||
display: flex; |
||||
align-items: center; |
||||
justify-content: space-between; |
||||
.fs{ |
||||
font-weight: bold; |
||||
font-size: 48px; |
||||
color: #FFFFFF; |
||||
margin-right: 50px; |
||||
text{ |
||||
margin-right: 50px; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
.header1{ |
||||
width: 100%; |
||||
height: 136px; |
||||
box-sizing: border-box; |
||||
background: url(/static/hd1-bg.png) left top no-repeat; |
||||
background-size: auto 100%; |
||||
display: flex; |
||||
align-items: center; |
||||
.logo{ |
||||
width: 245px; |
||||
height: 95px; |
||||
image{ |
||||
width: 100%; |
||||
height: 100%; |
||||
} |
||||
margin-right: 25px; |
||||
margin-left: 45px; |
||||
} |
||||
.info{ |
||||
flex: 1; |
||||
display: flex; |
||||
align-items: center; |
||||
justify-content: space-between; |
||||
.a{ |
||||
font-weight: bold; |
||||
font-size: 73px; |
||||
color: #FFFFFF; |
||||
float: left; |
||||
} |
||||
.b{ |
||||
float: right; |
||||
font-weight: bold; |
||||
font-size: 50px; |
||||
color: #FFFF00; |
||||
line-height: 46px; |
||||
margin-right: 20px; |
||||
text{ |
||||
font-weight: 400; |
||||
font-size: 40rpx; |
||||
color: #FFFF00; |
||||
display: block; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
@media screen and (min-width: 1200px) and (max-width: 1359px) { |
||||
.header{ |
||||
.info{ |
||||
.a{ |
||||
font-size: 45px; |
||||
white-space: nowrap; |
||||
} |
||||
.b{ |
||||
font-size: 36px; |
||||
white-space: nowrap; |
||||
margin-top: 30px; |
||||
.fs{ |
||||
font-size: 36px; |
||||
margin-right: 10px; |
||||
text{ |
||||
margin-right: 10px; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
.header1{ |
||||
.info{ |
||||
.a{ |
||||
font-size: 45px; |
||||
white-space: nowrap; |
||||
} |
||||
.b{ |
||||
font-size: 30px; |
||||
text-align: right; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
@media screen and (min-width: 1360px) and (max-width: 1500px) { |
||||
.header{ |
||||
.info{ |
||||
.b{ |
||||
font-size: 36px; |
||||
white-space: nowrap; |
||||
.fs{ |
||||
font-size: 36px; |
||||
margin-right: 20px; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
.header1{ |
||||
.info{ |
||||
.a{ |
||||
font-size: 45px; |
||||
white-space: nowrap; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
</style> |
@ -0,0 +1,20 @@ |
||||
<!DOCTYPE html> |
||||
<html lang="en"> |
||||
<head> |
||||
<meta charset="UTF-8" /> |
||||
<script> |
||||
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || |
||||
CSS.supports('top: constant(a)')) |
||||
document.write( |
||||
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + |
||||
(coverSupport ? ', viewport-fit=cover' : '') + '" />') |
||||
</script> |
||||
<title></title> |
||||
<!--preload-links--> |
||||
<!--app-context--> |
||||
</head> |
||||
<body> |
||||
<div id="app"><!--app-html--></div> |
||||
<script type="module" src="/main.js"></script> |
||||
</body> |
||||
</html> |
@ -0,0 +1,24 @@ |
||||
import App from './App' |
||||
|
||||
// #ifndef VUE3
|
||||
import Vue from 'vue' |
||||
import './uni.promisify.adaptor' |
||||
Vue.config.productionTip = false |
||||
App.mpType = 'app' |
||||
import websocketUtils from '@/webscoke/index.js'; |
||||
Vue.prototype.$websocketUtils = websocketUtils |
||||
const app = new Vue({ |
||||
...App |
||||
}) |
||||
app.$mount() |
||||
// #endif
|
||||
|
||||
// #ifdef VUE3
|
||||
import { createSSRApp } from 'vue' |
||||
export function createApp() { |
||||
const app = createSSRApp(App) |
||||
return { |
||||
app |
||||
} |
||||
} |
||||
// #endif
|
@ -0,0 +1,72 @@ |
||||
{ |
||||
"name" : "sport_big", |
||||
"appid" : "__UNI__0D1DD09", |
||||
"description" : "", |
||||
"versionName" : "1.0.0", |
||||
"versionCode" : "100", |
||||
"transformPx" : false, |
||||
/* 5+App特有相关 */ |
||||
"app-plus" : { |
||||
"usingComponents" : true, |
||||
"nvueStyleCompiler" : "uni-app", |
||||
"compilerVersion" : 3, |
||||
"splashscreen" : { |
||||
"alwaysShowBeforeRender" : true, |
||||
"waiting" : true, |
||||
"autoclose" : true, |
||||
"delay" : 0 |
||||
}, |
||||
/* 模块配置 */ |
||||
"modules" : {}, |
||||
/* 应用发布信息 */ |
||||
"distribute" : { |
||||
/* android打包配置 */ |
||||
"android" : { |
||||
"permissions" : [ |
||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", |
||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>", |
||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>", |
||||
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>", |
||||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>", |
||||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>", |
||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>", |
||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>", |
||||
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>", |
||||
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>", |
||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>", |
||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>", |
||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>", |
||||
"<uses-feature android:name=\"android.hardware.camera\"/>", |
||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>" |
||||
] |
||||
}, |
||||
/* ios打包配置 */ |
||||
"ios" : {}, |
||||
/* SDK配置 */ |
||||
"sdkConfigs" : {} |
||||
} |
||||
}, |
||||
/* 快应用特有相关 */ |
||||
"quickapp" : {}, |
||||
/* 小程序特有相关 */ |
||||
"mp-weixin" : { |
||||
"appid" : "", |
||||
"setting" : { |
||||
"urlCheck" : false |
||||
}, |
||||
"usingComponents" : true |
||||
}, |
||||
"mp-alipay" : { |
||||
"usingComponents" : true |
||||
}, |
||||
"mp-baidu" : { |
||||
"usingComponents" : true |
||||
}, |
||||
"mp-toutiao" : { |
||||
"usingComponents" : true |
||||
}, |
||||
"uniStatistics" : { |
||||
"enable" : false |
||||
}, |
||||
"vueVersion" : "2" |
||||
} |
@ -0,0 +1,69 @@ |
||||
{ |
||||
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages |
||||
{ |
||||
"path" : "pages/index/index", |
||||
"style" : |
||||
{ |
||||
"navigationStyle": "custom" |
||||
} |
||||
|
||||
},{ |
||||
"path": "pages/award/index", |
||||
"style": { |
||||
"navigationStyle": "custom" |
||||
} |
||||
}, |
||||
{ |
||||
"path" : "pages/schedule/index", |
||||
"style" : |
||||
{ |
||||
"navigationStyle": "custom" |
||||
} |
||||
}, |
||||
{ |
||||
"path" : "pages/clear/index", |
||||
"style" : |
||||
{ |
||||
"navigationStyle": "custom" |
||||
} |
||||
}, |
||||
{ |
||||
"path" : "pages/check/index", |
||||
"style" : |
||||
{ |
||||
"navigationStyle": "custom" |
||||
} |
||||
} |
||||
,{ |
||||
"path" : "pages/score/index", |
||||
"style" : |
||||
{ |
||||
"navigationStyle": "custom" |
||||
} |
||||
|
||||
} |
||||
,{ |
||||
"path" : "pages/declare/index", |
||||
"style" : |
||||
{ |
||||
"navigationStyle": "custom" |
||||
} |
||||
|
||||
} |
||||
,{ |
||||
"path" : "pages/index/init", |
||||
"style" : |
||||
{ |
||||
"navigationStyle": "custom" |
||||
} |
||||
|
||||
} |
||||
], |
||||
"globalStyle": { |
||||
"navigationBarTextStyle": "black", |
||||
"navigationBarTitleText": "uni-app", |
||||
"navigationBarBackgroundColor": "#F8F8F8", |
||||
"backgroundColor": "#F8F8F8" |
||||
}, |
||||
"uniIdRouter": {} |
||||
} |
@ -0,0 +1,102 @@ |
||||
<template> |
||||
<view class="home"> |
||||
<view class="header1"> |
||||
<view class="logo"> |
||||
<image src="@/static/logo.png"></image> |
||||
</view> |
||||
<view class="info"> |
||||
<view class="a">弹射者|{{saiName}}</view> |
||||
</view> |
||||
</view> |
||||
<view class="body"> |
||||
<view class="a"> |
||||
<image mode="widthFix" src="@/static/logo3.png"></image> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
const app = getApp(); |
||||
export default { |
||||
data() { |
||||
return { |
||||
saiName: "", |
||||
id: "" |
||||
} |
||||
}, |
||||
onLoad() { |
||||
this.saiName = uni.getStorageSync("saiName"); |
||||
this.id = uni.getStorageSync("sid"); |
||||
|
||||
if(app.globalData.socketWBObj){ |
||||
app.globalData.socketWBObj.closeSocket(); |
||||
} |
||||
app.globalData.socketWBObj = new this.$websocketUtils(1); |
||||
//监听获取消息 |
||||
uni.$on('socketMessage', res=>{ |
||||
if(res.data){ |
||||
var { cmd, data } = res.data !='链接成功'?JSON.parse(res.data):{}; |
||||
//成绩 |
||||
if(cmd == 'score'){ |
||||
uni.setStorageSync("slist",data) |
||||
uni.navigateTo({ |
||||
url: '/pages/score/index' |
||||
}) |
||||
}else if(cmd == 'declare') {//宣告 |
||||
uni.setStorageSync("slist",data) |
||||
uni.navigateTo({ |
||||
url: '/pages/declare/index' |
||||
}) |
||||
}else if(cmd == 'schedule') {//日程 |
||||
uni.setStorageSync("slist",data) |
||||
uni.navigateTo({ |
||||
url: '/pages/schedule/index' |
||||
}) |
||||
}else if(cmd == 'check_in') {//检录 |
||||
uni.navigateTo({ |
||||
url: '/pages/check/index' |
||||
}) |
||||
}else if(cmd == 'award') {//颁奖 |
||||
uni.setStorageSync("slist",data) |
||||
uni.navigateTo({ |
||||
url: '/pages/award/index' |
||||
}) |
||||
} |
||||
} |
||||
}) |
||||
}, |
||||
methods: { |
||||
|
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.body{ |
||||
width: 100%; |
||||
min-height: calc(100vh - 136px); |
||||
background: url(@/static/bg3.png) center center no-repeat; |
||||
background-size: cover; |
||||
.a{ |
||||
width: 100%; |
||||
text-align: center; |
||||
padding-top: 210px; |
||||
image{ |
||||
width: 1306px; |
||||
height: 513px; |
||||
} |
||||
} |
||||
|
||||
} |
||||
@media screen and (min-width: 1200px) and (max-width: 1359px) { |
||||
.body{ |
||||
.a{ |
||||
padding-top: 190px; |
||||
image{ |
||||
width: 100%; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
</style> |
@ -0,0 +1,127 @@ |
||||
<template> |
||||
<view class="home"> |
||||
<view class="header1"> |
||||
<view class="logo"> |
||||
<image src="@/static/logo.png"></image> |
||||
</view> |
||||
<view class="info"> |
||||
<view class="a">弹射者</view> |
||||
</view> |
||||
</view> |
||||
<view class="body"> |
||||
<view class="a"> |
||||
<view class="item">赛事ID<input type="text" v-model="num" placeholder="请输入赛事id" /></view> |
||||
</view> |
||||
<view class="btn" @click="toEnter()">立即进入</view> |
||||
</view> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
export default { |
||||
data() { |
||||
return { |
||||
num: "", |
||||
saiName: "" |
||||
} |
||||
}, |
||||
onShow() { |
||||
uni.removeStorageSync("saiName") |
||||
uni.removeStorageSync("sid") |
||||
uni.removeStorageSync("slist") |
||||
}, |
||||
methods: { |
||||
async getInfo() { |
||||
const that = this; |
||||
uni.request({ |
||||
url: "https://sports.njrenzhou.cn/api/matchsDetails", |
||||
method: "post", |
||||
data: { |
||||
matchs_id: this.num |
||||
}, |
||||
success(res) { |
||||
if(res.data.code == 200){ |
||||
that.saiName = res.data.name |
||||
uni.setStorageSync("saiName",res.data.data.name); |
||||
uni.setStorageSync("sid", that.num) |
||||
uni.navigateTo({ |
||||
url: "/pages/clear/index?id="+that.num |
||||
}) |
||||
} |
||||
}, |
||||
fail(err) { |
||||
console.log(err) |
||||
} |
||||
}) |
||||
}, |
||||
toEnter() { |
||||
if(!this.num) { |
||||
uni.showToast({ |
||||
title: "请输入赛事ID", |
||||
icon: "none" |
||||
}) |
||||
return ; |
||||
} |
||||
this.getInfo(); |
||||
|
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.body{ |
||||
width: 100%; |
||||
min-height: calc(100vh - 136px); |
||||
background: url(@/static/bg3.png) center center no-repeat; |
||||
background-size: cover; |
||||
.btn{ |
||||
width: 420px; |
||||
line-height: 60px; |
||||
background-color: #2681ea; |
||||
text-align: center; |
||||
border-radius: 5px; |
||||
margin: 0 auto; |
||||
font-size: 20px; |
||||
color: #fff; |
||||
margin-top: 120px; |
||||
cursor: pointer; |
||||
} |
||||
.a{ |
||||
padding-top: 200px; |
||||
overflow: hidden; |
||||
.item{ |
||||
width: 420px; |
||||
line-height: 60px; |
||||
background-color: #fff; |
||||
text-align: center; |
||||
border-radius: 5px; |
||||
display: flex; |
||||
margin: 0 auto; |
||||
padding: 0 20px; |
||||
box-sizing: border-box; |
||||
font-size: 20px; |
||||
color: #212121; |
||||
input{ |
||||
flex: 1; |
||||
height: 60px; |
||||
text-align: left; |
||||
margin-left: 20px; |
||||
font-size: 20px; |
||||
} |
||||
} |
||||
|
||||
} |
||||
|
||||
} |
||||
@media screen and (min-width: 1200px) and (max-width: 1359px) { |
||||
.body{ |
||||
.a{ |
||||
padding-top: 190px; |
||||
image{ |
||||
width: 100%; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
</style> |
@ -0,0 +1,127 @@ |
||||
<template> |
||||
<view class="home"> |
||||
<view class="header1"> |
||||
<view class="logo"> |
||||
<image src="@/static/logo.png"></image> |
||||
</view> |
||||
<view class="info"> |
||||
<view class="a">弹射者</view> |
||||
</view> |
||||
</view> |
||||
<view class="body"> |
||||
<view class="a"> |
||||
<view class="item">赛事ID<input type="text" v-model="num" placeholder="请输入赛事id" /></view> |
||||
</view> |
||||
<view class="btn" @click="toEnter()">立即进入</view> |
||||
</view> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
export default { |
||||
data() { |
||||
return { |
||||
num: "", |
||||
saiName: "" |
||||
} |
||||
}, |
||||
onShow() { |
||||
uni.removeStorageSync("saiName") |
||||
uni.removeStorageSync("sid") |
||||
uni.removeStorageSync("slist") |
||||
}, |
||||
methods: { |
||||
async getInfo() { |
||||
const that = this; |
||||
uni.request({ |
||||
url: "https://sports.njrenzhou.cn/api/matchsDetails", |
||||
method: "post", |
||||
data: { |
||||
matchs_id: this.num |
||||
}, |
||||
success(res) { |
||||
if(res.data.code == 200){ |
||||
that.saiName = res.data.name |
||||
uni.setStorageSync("saiName",res.data.data.name); |
||||
uni.setStorageSync("sid", that.num) |
||||
uni.navigateTo({ |
||||
url: "/pages/check/index?id="+that.num |
||||
}) |
||||
} |
||||
}, |
||||
fail(err) { |
||||
console.log(err) |
||||
} |
||||
}) |
||||
}, |
||||
toEnter() { |
||||
if(!this.num) { |
||||
uni.showToast({ |
||||
title: "请输入赛事ID", |
||||
icon: "none" |
||||
}) |
||||
return ; |
||||
} |
||||
this.getInfo(); |
||||
|
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.body{ |
||||
width: 100%; |
||||
min-height: calc(100vh - 136px); |
||||
background: url(@/static/bg3.png) center center no-repeat; |
||||
background-size: cover; |
||||
.btn{ |
||||
width: 420px; |
||||
line-height: 60px; |
||||
background-color: #2681ea; |
||||
text-align: center; |
||||
border-radius: 5px; |
||||
margin: 0 auto; |
||||
font-size: 20px; |
||||
color: #fff; |
||||
margin-top: 120px; |
||||
cursor: pointer; |
||||
} |
||||
.a{ |
||||
padding-top: 200px; |
||||
overflow: hidden; |
||||
.item{ |
||||
width: 420px; |
||||
line-height: 60px; |
||||
background-color: #fff; |
||||
text-align: center; |
||||
border-radius: 5px; |
||||
display: flex; |
||||
margin: 0 auto; |
||||
padding: 0 20px; |
||||
box-sizing: border-box; |
||||
font-size: 20px; |
||||
color: #212121; |
||||
input{ |
||||
flex: 1; |
||||
height: 60px; |
||||
text-align: left; |
||||
margin-left: 20px; |
||||
font-size: 20px; |
||||
} |
||||
} |
||||
|
||||
} |
||||
|
||||
} |
||||
@media screen and (min-width: 1200px) and (max-width: 1359px) { |
||||
.body{ |
||||
.a{ |
||||
padding-top: 190px; |
||||
image{ |
||||
width: 100%; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
</style> |
After Width: | Height: | Size: 486 KiB |
After Width: | Height: | Size: 700 KiB |
After Width: | Height: | Size: 1.0 MiB |
After Width: | Height: | Size: 957 KiB |
After Width: | Height: | Size: 188 KiB |
After Width: | Height: | Size: 98 KiB |
After Width: | Height: | Size: 1.6 MiB |
After Width: | Height: | Size: 48 KiB |
After Width: | Height: | Size: 907 KiB |
After Width: | Height: | Size: 1.2 MiB |
After Width: | Height: | Size: 2.4 MiB |
After Width: | Height: | Size: 419 KiB |
After Width: | Height: | Size: 2.2 MiB |
After Width: | Height: | Size: 289 KiB |
@ -0,0 +1,10 @@ |
||||
uni.addInterceptor({ |
||||
returnValue (res) { |
||||
if (!(!!res && (typeof res === "object" || typeof res === "function") && typeof res.then === "function")) { |
||||
return res; |
||||
} |
||||
return new Promise((resolve, reject) => { |
||||
res.then((res) => res[0] ? reject(res[0]) : resolve(res[1])); |
||||
}); |
||||
}, |
||||
}); |
@ -0,0 +1,76 @@ |
||||
/** |
||||
* 这里是uni-app内置的常用样式变量 |
||||
* |
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量 |
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App |
||||
* |
||||
*/ |
||||
|
||||
/** |
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能 |
||||
* |
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件 |
||||
*/ |
||||
|
||||
/* 颜色变量 */ |
||||
|
||||
/* 行为相关颜色 */ |
||||
$uni-color-primary: #007aff; |
||||
$uni-color-success: #4cd964; |
||||
$uni-color-warning: #f0ad4e; |
||||
$uni-color-error: #dd524d; |
||||
|
||||
/* 文字基本颜色 */ |
||||
$uni-text-color:#333;//基本色 |
||||
$uni-text-color-inverse:#fff;//反色 |
||||
$uni-text-color-grey:#999;//辅助灰色,如加载更多的提示信息 |
||||
$uni-text-color-placeholder: #808080; |
||||
$uni-text-color-disable:#c0c0c0; |
||||
|
||||
/* 背景颜色 */ |
||||
$uni-bg-color:#ffffff; |
||||
$uni-bg-color-grey:#f8f8f8; |
||||
$uni-bg-color-hover:#f1f1f1;//点击状态颜色 |
||||
$uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色 |
||||
|
||||
/* 边框颜色 */ |
||||
$uni-border-color:#c8c7cc; |
||||
|
||||
/* 尺寸变量 */ |
||||
|
||||
/* 文字尺寸 */ |
||||
$uni-font-size-sm:12px; |
||||
$uni-font-size-base:14px; |
||||
$uni-font-size-lg:16px; |
||||
|
||||
/* 图片尺寸 */ |
||||
$uni-img-size-sm:20px; |
||||
$uni-img-size-base:26px; |
||||
$uni-img-size-lg:40px; |
||||
|
||||
/* Border Radius */ |
||||
$uni-border-radius-sm: 2px; |
||||
$uni-border-radius-base: 3px; |
||||
$uni-border-radius-lg: 6px; |
||||
$uni-border-radius-circle: 50%; |
||||
|
||||
/* 水平间距 */ |
||||
$uni-spacing-row-sm: 5px; |
||||
$uni-spacing-row-base: 10px; |
||||
$uni-spacing-row-lg: 15px; |
||||
|
||||
/* 垂直间距 */ |
||||
$uni-spacing-col-sm: 4px; |
||||
$uni-spacing-col-base: 8px; |
||||
$uni-spacing-col-lg: 12px; |
||||
|
||||
/* 透明度 */ |
||||
$uni-opacity-disabled: 0.3; // 组件禁用态的透明度 |
||||
|
||||
/* 文章场景相关 */ |
||||
$uni-color-title: #2C405A; // 文章标题颜色 |
||||
$uni-font-size-title:20px; |
||||
$uni-color-subtitle: #555555; // 二级标题颜色 |
||||
$uni-font-size-subtitle:26px; |
||||
$uni-color-paragraph: #3F536E; // 文章段落颜色 |
||||
$uni-font-size-paragraph:15px; |
@ -0,0 +1,2 @@ |
||||
<!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>sport_big</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)')) |
||||
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/static/index.b0707a6a.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.77e5a542.js></script><script src=/static/js/index.0dea3b84.js></script></body></html> |
After Width: | Height: | Size: 486 KiB |
After Width: | Height: | Size: 700 KiB |
After Width: | Height: | Size: 1.0 MiB |
After Width: | Height: | Size: 957 KiB |
After Width: | Height: | Size: 188 KiB |
After Width: | Height: | Size: 98 KiB |
After Width: | Height: | Size: 1.6 MiB |
After Width: | Height: | Size: 48 KiB |
After Width: | Height: | Size: 907 KiB |
After Width: | Height: | Size: 1.2 MiB |
After Width: | Height: | Size: 486 KiB |
After Width: | Height: | Size: 700 KiB |
After Width: | Height: | Size: 1.0 MiB |
After Width: | Height: | Size: 957 KiB |
After Width: | Height: | Size: 98 KiB |
After Width: | Height: | Size: 1.6 MiB |
After Width: | Height: | Size: 48 KiB |
After Width: | Height: | Size: 2.4 MiB |
After Width: | Height: | Size: 419 KiB |
After Width: | Height: | Size: 2.2 MiB |
@ -0,0 +1 @@ |
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-clear-index"],{"0d7e":function(t,a,e){var n=e("34ec");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var i=e("4f06").default;i("4b28d94a",n,!0,{sourceMap:!1,shadowMode:!1})},"11df":function(t,a,e){"use strict";e.r(a);var n=e("4d22"),i=e("dfec");for(var s in i)"default"!==s&&function(t){e.d(a,t,(function(){return i[t]}))}(s);e("a9ab");var r,c=e("f0c5"),d=Object(c["a"])(i["default"],n["b"],n["c"],!1,null,"fd999252",null,!1,n["a"],r);a["default"]=d.exports},"1de5":function(t,a,e){"use strict";t.exports=function(t,a){return a||(a={}),t=t&&t.__esModule?t.default:t,"string"!==typeof t?t:(/^['"].*['"]$/.test(t)&&(t=t.slice(1,-1)),a.hash&&(t+=a.hash),/["'() \t\n]/.test(t)||a.needQuotes?'"'.concat(t.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):t)}},"34ec":function(t,a,e){var n=e("24fb"),i=e("1de5"),s=e("725c");a=n(!1);var r=i(s);a.push([t.i,'@charset "UTF-8";\r\n/**\r\n * 这里是uni-app内置的常用样式变量\r\n *\r\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\r\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\r\n *\r\n */\r\n/**\r\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\r\n *\r\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\r\n */\r\n/* 颜色变量 */\r\n/* 行为相关颜色 */\r\n/* 文字基本颜色 */\r\n/* 背景颜色 */\r\n/* 边框颜色 */\r\n/* 尺寸变量 */\r\n/* 文字尺寸 */\r\n/* 图片尺寸 */\r\n/* Border Radius */\r\n/* 水平间距 */\r\n/* 垂直间距 */\r\n/* 透明度 */\r\n/* 文章场景相关 */.body[data-v-fd999252]{width:100%;min-height:calc(100vh - 136px);background:url('+r+") 50% no-repeat;background-size:cover}.body .a[data-v-fd999252]{width:100%;text-align:center;padding-top:210px}.body .a uni-image[data-v-fd999252]{width:1306px;height:513px}@media screen and (min-width:1200px) and (max-width:1359px){.body .a[data-v-fd999252]{padding-top:190px}.body .a uni-image[data-v-fd999252]{width:100%}}",""]),t.exports=a},"4d22":function(t,a,e){"use strict";var n;e.d(a,"b",(function(){return i})),e.d(a,"c",(function(){return s})),e.d(a,"a",(function(){return n}));var i=function(){var t=this,a=t.$createElement,n=t._self._c||a;return n("v-uni-view",{staticClass:"home"},[n("v-uni-view",{staticClass:"header1"},[n("v-uni-view",{staticClass:"logo"},[n("v-uni-image",{attrs:{src:e("5286")}})],1),n("v-uni-view",{staticClass:"info"},[n("v-uni-view",{staticClass:"a"},[t._v("弹射者|"+t._s(t.saiName))])],1)],1),n("v-uni-view",{staticClass:"body"},[n("v-uni-view",{staticClass:"a"},[n("v-uni-image",{attrs:{mode:"widthFix",src:e("6dd0")}})],1)],1)],1)},s=[]},5286:function(t,a,e){t.exports=e.p+"static/img/logo.a8ef51b9.png"},"6dd0":function(t,a,e){t.exports=e.p+"static/img/logo3.9c8258d0.png"},"725c":function(t,a,e){t.exports=e.p+"static/img/bg3.891accd5.png"},a9ab:function(t,a,e){"use strict";var n=e("0d7e"),i=e.n(n);i.a},dfec:function(t,a,e){"use strict";e.r(a);var n=e("f2af"),i=e.n(n);for(var s in n)"default"!==s&&function(t){e.d(a,t,(function(){return n[t]}))}(s);a["default"]=i.a},f2af:function(t,a,e){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n=getApp(),i={data:function(){return{saiName:"",id:""}},onLoad:function(){this.saiName=uni.getStorageSync("saiName"),this.id=uni.getStorageSync("sid"),n.globalData.socketWBObj&&n.globalData.socketWBObj.closeSocket(),n.globalData.socketWBObj=new this.$websocketUtils(1),uni.$on("socketMessage",(function(t){if(t.data){var a="链接成功"!=t.data?JSON.parse(t.data):{},e=a.cmd,n=a.data;"score"==e?(uni.setStorageSync("slist",n),uni.navigateTo({url:"/pages/score/index"})):"declare"==e?(uni.setStorageSync("slist",n),uni.navigateTo({url:"/pages/declare/index"})):"schedule"==e?(uni.setStorageSync("slist",n),uni.navigateTo({url:"/pages/schedule/index"})):"check_in"==e?uni.navigateTo({url:"/pages/check/index"}):"award"==e&&(uni.setStorageSync("slist",n),uni.navigateTo({url:"/pages/award/index"}))}}))},methods:{}};a.default=i}}]); |
After Width: | Height: | Size: 2.4 MiB |
After Width: | Height: | Size: 419 KiB |
After Width: | Height: | Size: 2.2 MiB |
After Width: | Height: | Size: 289 KiB |
@ -0,0 +1,136 @@ |
||||
class websocketUtils { |
||||
constructor(type) { |
||||
this.url = 'wss://sports.njrenzhou.cn/ws' //ws地址 拼接一下 此处用的是openId
|
||||
this.data = null |
||||
this.isOpenSocket = false //避免重复连接
|
||||
this.timeout = 10 //隔多久执行检测 单位秒(s)
|
||||
this.sid = uni.getStorageSync("sid") //赛事id
|
||||
this.type = type |
||||
this.heartbeatInterval = null //检测服务器端是否还存活
|
||||
this.reconnectTimeOut = null //重连之后隔多久才再次重连
|
||||
try { |
||||
return this.connectSocketInit() |
||||
} catch (e) { |
||||
console.log('===========连接错误捕获catch====================',e); |
||||
this.isOpenSocket = false |
||||
this.reconnect(); |
||||
} |
||||
} |
||||
// 创建websocket连接
|
||||
connectSocketInit() { |
||||
this.socketTask = uni.connectSocket({ |
||||
url: this.url, |
||||
header: { |
||||
//头部可以添加所需字段如token
|
||||
'content-type': 'application/json' |
||||
}, |
||||
success:()=>{ |
||||
console.log("============正准备建立websocket中================"); |
||||
// 返回实例
|
||||
return this.socketTask |
||||
}, |
||||
}); |
||||
this.socketTask.onOpen((res) => { |
||||
console.log("==============WebSocket连接正常============="); |
||||
clearTimeout(this.reconnectTimeOut) |
||||
clearInterval(this.heartbeatInterval) |
||||
this.isOpenSocket = true; |
||||
if(this.type ==2){ |
||||
if(this.sid){ |
||||
this.startCheck(); |
||||
} |
||||
}else{ |
||||
if(this.sid){ |
||||
this.startStatement(); |
||||
} |
||||
} |
||||
|
||||
this.start(); |
||||
// 只有连接正常打开中 ,才能正常收到消息
|
||||
this.socketTask.onMessage((res) => { |
||||
console.log(res.data,'===============接收===onMessage===============') |
||||
//全局注册uniapp事件,在任何页面都能接受到
|
||||
uni.$emit('socketMessage', res) |
||||
}); |
||||
}) |
||||
|
||||
// socket关闭了会执行 此处
|
||||
this.socketTask.onClose((e) => { |
||||
console.log("========已经被关闭了====================",e) |
||||
this.isOpenSocket = false; |
||||
// 加了flag判断是否为手动(用户主动关闭)
|
||||
uni.$emit('onClose', 1) |
||||
e && e.reason == 'user' ? '' : this.reconnect(); |
||||
}) |
||||
} |
||||
//发送消息
|
||||
send(value){ |
||||
// 连接正常打开时 ,才能正常成功发送消息
|
||||
this.socketTask.send({ |
||||
data: value, |
||||
async success() { |
||||
console.log("===========消息发送成功==============="); |
||||
}, |
||||
}); |
||||
} |
||||
//开启心跳检测
|
||||
start(){ |
||||
this.data={cmd:"ping"} |
||||
this.heartbeatInterval = setInterval(()=>{ |
||||
console.log('======start====开启心跳检测====',this.data) |
||||
this.send(JSON.stringify(this.data)); |
||||
},this.timeout * 1000) |
||||
} |
||||
startStatement() { |
||||
this.data={cmd:"statement",'matchs_id': this.sid} |
||||
this.send(JSON.stringify(this.data)); |
||||
} |
||||
startCheck() { |
||||
this.data={cmd:"check",'matchs_id': this.sid} |
||||
this.send(JSON.stringify(this.data)); |
||||
} |
||||
//重新连接
|
||||
reconnect(){ |
||||
//停止发送心跳
|
||||
clearInterval(this.heartbeatInterval) |
||||
//如果不是人为关闭的话,进行重连
|
||||
if(!this.isOpenSocket ){ |
||||
this.reconnectTimeOut = setTimeout(()=>{ |
||||
this.connectSocketInit(); |
||||
},3000) |
||||
} |
||||
} |
||||
// 关闭 WebSocket 连接
|
||||
closeSocket(reason = '关闭') { |
||||
const _this = this |
||||
this.socketTask.close({ |
||||
reason, |
||||
success() { |
||||
_this.data = null |
||||
_this.isOpenSocket = false |
||||
_this.socketTask = null |
||||
clearTimeout(_this.reconnectTimeOut) |
||||
clearInterval(_this.heartbeatInterval) |
||||
console.log('===============关闭 WebSocket 成功===================') |
||||
// setTimeout(()=>{
|
||||
// uni.navigateTo({
|
||||
// url: "/pages/index/index"
|
||||
// })
|
||||
// },1000)
|
||||
}, |
||||
fail() { |
||||
console.log('===================关闭 WebSocket 失败=====================') |
||||
} |
||||
}) |
||||
} |
||||
//将获取的消息导出外部
|
||||
exportMessage(callback) { |
||||
this.socketTask.onMessage((res) => { |
||||
console.log(res,'===============exportMessage============') |
||||
return callback(res) |
||||
}) |
||||
} |
||||
} |
||||
|
||||
|
||||
module.exports = websocketUtils
|