|
@@ -68,13 +68,7 @@
|
|
|
<div class="playVideo" v-if="play.phone">
|
|
|
<van-icon @click="() => playVideo({})" name="close" class="close" />
|
|
|
<video :src="play.url" controls></video>
|
|
|
- <van-button
|
|
|
- round
|
|
|
- class="btn"
|
|
|
- block
|
|
|
- color="#c11616"
|
|
|
- @click="saveVote"
|
|
|
- >
|
|
|
+ <van-button round class="btn" block color="#c11616" @click="saveVote">
|
|
|
投票
|
|
|
</van-button>
|
|
|
</div>
|
|
@@ -83,19 +77,19 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script setup>
|
|
|
-import Shanshipin from "@/components/shanshipin.vue";
|
|
|
+import Shanshipin from '@/components/shanshipin.vue';
|
|
|
// import { ElCarouselItem, ElCarousel } from "element-plus";
|
|
|
// import "element-plus/theme-chalk/base.css";
|
|
|
// import "element-plus/theme-chalk/el-carousel.css";
|
|
|
// import "element-plus/theme-chalk/el-carousel-item.css";
|
|
|
-import { isShanshipin, isWechat } from "@/utils/isTerminal";
|
|
|
-import { ref, provide, reactive } from "vue";
|
|
|
-import chat from "./components/chat.vue";
|
|
|
-import ranking from "./components/ranking.vue";
|
|
|
-import match from "./components/match.vue";
|
|
|
-import { showToast, Dialog } from "vant";
|
|
|
+import { isShanshipin, isWechat } from '@/utils/isTerminal';
|
|
|
+import { ref, provide, reactive } from 'vue';
|
|
|
+import chat from './components/chat.vue';
|
|
|
+import ranking from './components/ranking.vue';
|
|
|
+import match from './components/match.vue';
|
|
|
+import { showToast, showDialog } from 'vant';
|
|
|
|
|
|
-import { getMatch, getBannerAndVideo, votpSave } from "@/api/worldCup.js";
|
|
|
+import { getMatch, getBannerAndVideo, votpSave } from '@/api/worldCup.js';
|
|
|
|
|
|
const availWidth =
|
|
|
window.$originData.orginParames.availWidth > 1440
|
|
@@ -109,14 +103,14 @@ const maxcol = [8, 4, 2, 1, 1, 1, 2, 4, 8];
|
|
|
let team = reactive([]);
|
|
|
const shanshipin = window.$shanshipin || {};
|
|
|
const from = reactive({
|
|
|
- name: shanshipin.UserName || localStorage.getItem("worldCupName") || "",
|
|
|
- phone: shanshipin.Phone || localStorage.getItem("worldCupPhone") || "",
|
|
|
+ name: shanshipin.UserName || localStorage.getItem('worldCupName') || '',
|
|
|
+ phone: shanshipin.Phone || localStorage.getItem('worldCupPhone') || '',
|
|
|
});
|
|
|
-provide("fontSize", fontSize); // 配置全域参数
|
|
|
-provide("availWidth", availWidth); // 配置全域参数
|
|
|
-provide("maxcol", maxcol); // 配置全域参数
|
|
|
-provide("team", team); // 配置全域参数
|
|
|
-provide("user", from); // 配置全域参数
|
|
|
+provide('fontSize', fontSize); // 配置全域参数
|
|
|
+provide('availWidth', availWidth); // 配置全域参数
|
|
|
+provide('maxcol', maxcol); // 配置全域参数
|
|
|
+provide('team', team); // 配置全域参数
|
|
|
+provide('user', from); // 配置全域参数
|
|
|
// import { onMounted, reactive } from "vue";
|
|
|
// import { isIpad, isIpod, isIphone } from "../../utils/isTerminal";
|
|
|
/**
|
|
@@ -124,11 +118,11 @@ provide("user", from); // 配置全域参数
|
|
|
* window.$originData.orginParames.parameters 固定参数值
|
|
|
* window.$originData.urlParames url参数
|
|
|
*/
|
|
|
-const p = isWechat ? "微信" : isShanshipin ? "闪视频" : "其它";
|
|
|
+const p = isWechat ? '微信' : isShanshipin ? '闪视频' : '其它';
|
|
|
|
|
|
function setStorage() {
|
|
|
- localStorage.setItem("worldCupPhone", from.phone || "");
|
|
|
- localStorage.setItem("worldCupName", from.name || "");
|
|
|
+ localStorage.setItem('worldCupPhone', from.phone || '');
|
|
|
+ localStorage.setItem('worldCupName', from.name || '');
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -147,7 +141,7 @@ Promise.all([
|
|
|
function upWay() {
|
|
|
getMatch({
|
|
|
phone: from.phone,
|
|
|
- }).then(r=>{
|
|
|
+ }).then(r => {
|
|
|
formmateMatch(r || []);
|
|
|
});
|
|
|
}
|
|
@@ -161,10 +155,10 @@ function formmateMatch(matchList) {
|
|
|
const isForeast = !!matchList[14].winner;
|
|
|
for (let i = 0; i < matchList.length; i++) {
|
|
|
const v = matchList[i];
|
|
|
- if (v.rounds === "1/8决赛") setRow(0, v, isForeast); // 16进8
|
|
|
- else if (v.rounds === "1/4决赛") setRow(1, v, isForeast); // 8进4
|
|
|
- else if (v.rounds === "半决赛") setRow(2, v); // 4进2
|
|
|
- else if (v.rounds === "决赛") {
|
|
|
+ if (v.rounds === '1/8决赛') setRow(0, v, isForeast); // 16进8
|
|
|
+ else if (v.rounds === '1/4决赛') setRow(1, v, isForeast); // 8进4
|
|
|
+ else if (v.rounds === '半决赛') setRow(2, v); // 4进2
|
|
|
+ else if (v.rounds === '决赛') {
|
|
|
// 2进1
|
|
|
team[3] = [
|
|
|
{
|
|
@@ -192,14 +186,14 @@ function formmateMatch(matchList) {
|
|
|
];
|
|
|
team[Math.ceil((maxcol.length - 1) / 2)] = [
|
|
|
{
|
|
|
- team: v.winner || "",
|
|
|
+ team: v.winner || '',
|
|
|
isWinner: true,
|
|
|
teamlogo:
|
|
|
v.winner === v.home
|
|
|
? v.homeLogo
|
|
|
: v.winner === v.away
|
|
|
? v.awayLogo
|
|
|
- : "",
|
|
|
+ : '',
|
|
|
isHome: true,
|
|
|
isForeast,
|
|
|
isED: !!v.winner,
|
|
@@ -229,9 +223,9 @@ function setRow(index, v) {
|
|
|
function setTeam(teamIndex, item, isForeast) {
|
|
|
if (!team[teamIndex]) team[teamIndex] = [];
|
|
|
team[teamIndex].push({
|
|
|
- team: item.home || "",
|
|
|
+ team: item.home || '',
|
|
|
isWinner: item.winner === item.home,
|
|
|
- teamlogo: item.homeLogo || "",
|
|
|
+ teamlogo: item.homeLogo || '',
|
|
|
isED: !!item.winner,
|
|
|
isForeast,
|
|
|
isHome: true,
|
|
@@ -239,9 +233,9 @@ function setTeam(teamIndex, item, isForeast) {
|
|
|
pSelectId: item.homePid,
|
|
|
});
|
|
|
team[teamIndex].push({
|
|
|
- team: item.away || "",
|
|
|
+ team: item.away || '',
|
|
|
isWinner: item.winner === item.away,
|
|
|
- teamlogo: item.awayLogo || "",
|
|
|
+ teamlogo: item.awayLogo || '',
|
|
|
isED: !!item.winner,
|
|
|
isForeast,
|
|
|
isHome: false,
|
|
@@ -251,44 +245,44 @@ function setTeam(teamIndex, item, isForeast) {
|
|
|
}
|
|
|
|
|
|
function login(next) {
|
|
|
- Dialog.alert({
|
|
|
- title: "",
|
|
|
- messageAlign: "left",
|
|
|
- theme: "round-button",
|
|
|
- confirmButtonText: "登录",
|
|
|
+ showDialog({
|
|
|
+ title: '',
|
|
|
+ messageAlign: 'left',
|
|
|
+ theme: 'round-button',
|
|
|
+ confirmButtonText: '登录',
|
|
|
message: () => (
|
|
|
<div>
|
|
|
<van-field
|
|
|
required
|
|
|
v-model={from.name}
|
|
|
- label="姓名"
|
|
|
- placeholder="请输入用户名"
|
|
|
+ label='姓名'
|
|
|
+ placeholder='请输入用户名'
|
|
|
/>
|
|
|
<van-field
|
|
|
required
|
|
|
v-model={from.phone}
|
|
|
- label="联系方式"
|
|
|
- type="tel"
|
|
|
- placeholder="请输入手机号"
|
|
|
+ label='联系方式'
|
|
|
+ type='tel'
|
|
|
+ placeholder='请输入手机号'
|
|
|
/>
|
|
|
</div>
|
|
|
),
|
|
|
}).then(() => {
|
|
|
- if(!from.phone) return showToast("登录后才能看到自己的作品哦~")
|
|
|
+ if (!from.phone) return showToast('登录后才能看到自己的作品哦~');
|
|
|
setStorage();
|
|
|
next && next();
|
|
|
});
|
|
|
}
|
|
|
|
|
|
function verification() {
|
|
|
- if (!from.phone) return login(() => toNewPage("./WorldCupDetail.html"));
|
|
|
- toNewPage("./WorldCupDetail.html");
|
|
|
+ if (!from.phone) return login(() => toNewPage('./WorldCupDetail.html'));
|
|
|
+ toNewPage('./WorldCupDetail.html');
|
|
|
}
|
|
|
|
|
|
function toNewPage(url) {
|
|
|
if (!url) return;
|
|
|
- let U = url || "";
|
|
|
- if (window.$shanshipin.Phone) U += "?phone=" + window.$shanshipin.Phone;
|
|
|
+ let U = url || '';
|
|
|
+ if (window.$shanshipin.Phone) U += '?phone=' + window.$shanshipin.Phone;
|
|
|
location.href = U;
|
|
|
}
|
|
|
|
|
@@ -303,7 +297,7 @@ function vote() {
|
|
|
client: p,
|
|
|
}).then(r => {
|
|
|
console.log(r);
|
|
|
- showToast("感谢您的支持!");
|
|
|
+ showToast('感谢您的支持!');
|
|
|
});
|
|
|
}
|
|
|
</script>
|