Compare commits
No commits in common. "hui.zhou" and "main" have entirely different histories.
|
|
@ -16,7 +16,6 @@
|
||||||
"dev:mp-qq": "uni -p mp-qq",
|
"dev:mp-qq": "uni -p mp-qq",
|
||||||
"dev:mp-toutiao": "uni -p mp-toutiao",
|
"dev:mp-toutiao": "uni -p mp-toutiao",
|
||||||
"dev:mp-weixin": "uni -p mp-weixin",
|
"dev:mp-weixin": "uni -p mp-weixin",
|
||||||
"dev:mp-weixin:pro": "uni -p mp-weixin --mode production",
|
|
||||||
"dev:mp-xhs": "uni -p mp-xhs",
|
"dev:mp-xhs": "uni -p mp-xhs",
|
||||||
"dev:quickapp-webview": "uni -p quickapp-webview",
|
"dev:quickapp-webview": "uni -p quickapp-webview",
|
||||||
"dev:quickapp-webview-huawei": "uni -p quickapp-webview-huawei",
|
"dev:quickapp-webview-huawei": "uni -p quickapp-webview-huawei",
|
||||||
|
|
@ -35,7 +34,6 @@
|
||||||
"build:mp-qq": "uni build -p mp-qq",
|
"build:mp-qq": "uni build -p mp-qq",
|
||||||
"build:mp-toutiao": "uni build -p mp-toutiao",
|
"build:mp-toutiao": "uni build -p mp-toutiao",
|
||||||
"build:mp-weixin": "uni build -p mp-weixin",
|
"build:mp-weixin": "uni build -p mp-weixin",
|
||||||
"build:mp-weixin:dev": "uni build -p mp-weixin --mode development",
|
|
||||||
"build:mp-xhs": "uni build -p mp-xhs",
|
"build:mp-xhs": "uni build -p mp-xhs",
|
||||||
"build:quickapp-webview": "uni build -p quickapp-webview",
|
"build:quickapp-webview": "uni build -p quickapp-webview",
|
||||||
"build:quickapp-webview-huawei": "uni build -p quickapp-webview-huawei",
|
"build:quickapp-webview-huawei": "uni build -p quickapp-webview-huawei",
|
||||||
|
|
@ -58,10 +56,8 @@
|
||||||
"@dcloudio/uni-quickapp-webview": "3.0.0-alpha-4010520240507001",
|
"@dcloudio/uni-quickapp-webview": "3.0.0-alpha-4010520240507001",
|
||||||
"clipboard": "^2.0.11",
|
"clipboard": "^2.0.11",
|
||||||
"dayjs": "^1.11.11",
|
"dayjs": "^1.11.11",
|
||||||
"pinia": "2.0.33",
|
|
||||||
"pinia-plugin-persistedstate": "^3.2.1",
|
|
||||||
"tiny-emitter": "^2.1.0",
|
"tiny-emitter": "^2.1.0",
|
||||||
"uview-plus": "^3.3.4",
|
"uview-plus": "^3.1.41",
|
||||||
"vue": "^3.4.21",
|
"vue": "^3.4.21",
|
||||||
"vue-i18n": "^9.1.9",
|
"vue-i18n": "^9.1.9",
|
||||||
"vue3-eventbus": "^2.0.0"
|
"vue3-eventbus": "^2.0.0"
|
||||||
|
|
@ -75,8 +71,6 @@
|
||||||
"@vue/runtime-core": "^3.4.21",
|
"@vue/runtime-core": "^3.4.21",
|
||||||
"sass": "^1.69.7",
|
"sass": "^1.69.7",
|
||||||
"sass-loader": "10",
|
"sass-loader": "10",
|
||||||
"unocss": "^0.58.5",
|
|
||||||
"unocss-applet": "^0.8.2",
|
|
||||||
"vite": "5.2.8"
|
"vite": "5.2.8"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
185
src/App.vue
185
src/App.vue
|
|
@ -1,7 +1,7 @@
|
||||||
<script>
|
<script>
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs';
|
||||||
import useAuthUser from '@/utils/hooks/useAuthUser'
|
import useAuthUser from '@/utils/hooks/useAuthUser';
|
||||||
import { submitCode2Session } from '@/api/xinjiang_guess'
|
import { submitCode2Session } from '@/api/xinjiang_guess';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
globalData: {},
|
globalData: {},
|
||||||
|
|
@ -12,7 +12,7 @@ export default {
|
||||||
console.log('App Show')
|
console.log('App Show')
|
||||||
|
|
||||||
if (uni.canIUse('getUpdateManager')) {
|
if (uni.canIUse('getUpdateManager')) {
|
||||||
const updateManager = uni.getUpdateManager()
|
const updateManager = uni.getUpdateManager();
|
||||||
updateManager.onCheckForUpdate(function (res) {
|
updateManager.onCheckForUpdate(function (res) {
|
||||||
// 请求完新版本信息的回调
|
// 请求完新版本信息的回调
|
||||||
if (res.hasUpdate) {
|
if (res.hasUpdate) {
|
||||||
|
|
@ -26,99 +26,98 @@ export default {
|
||||||
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
||||||
updateManager.applyUpdate()
|
updateManager.applyUpdate()
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
});
|
||||||
updateManager.onUpdateFailed(function () {
|
updateManager.onUpdateFailed(function () {
|
||||||
// 新的版本下载失败
|
// 新的版本下载失败
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '已经有新版本了哟~',
|
title: '已经有新版本了哟~',
|
||||||
content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~',
|
content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~'
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('checkSession', this.checkSession())
|
console.log('checkSession', this.checkSession());
|
||||||
if (!this.checkSession()) {
|
if (!this.checkSession()) {
|
||||||
await this.login(true)
|
await this.login(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('App globalData', this.globalData)
|
console.log('App globalData', this.globalData);
|
||||||
},
|
},
|
||||||
onHide: function () {
|
onHide: function () {
|
||||||
console.log('App Hide')
|
console.log('App Hide')
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
checkSession() {
|
checkSession() {
|
||||||
const expire_in = this.globalData.expire_in
|
const expire_in = this.globalData.expire_in;
|
||||||
if (!expire_in) {
|
if (!expire_in) {
|
||||||
return false
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (expire_in) {
|
if (expire_in) {
|
||||||
let isExpired = dayjs().isAfter(dayjs(expire_in))
|
let isExpired = dayjs().isAfter(dayjs(expire_in))
|
||||||
console.log('isExpired', isExpired)
|
console.log('isExpired', isExpired);
|
||||||
if (isExpired) {
|
if (isExpired) {
|
||||||
return false
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let willExpired = dayjs().add(6, 'hour').isAfter(dayjs(expire_in))
|
let willExpired = dayjs().add(6, 'hour').isAfter(dayjs(expire_in))
|
||||||
console.log('willExpired', willExpired)
|
console.log('willExpired', willExpired);
|
||||||
if (willExpired) {
|
if (willExpired) {
|
||||||
return false
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true
|
return true;
|
||||||
},
|
},
|
||||||
login() {
|
login() {
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
try {
|
try {
|
||||||
const codeResp = await wx.login()
|
const codeResp = await wx.login()
|
||||||
const wxLoginResp = await submitCode2Session({ code: codeResp.code })
|
const wxLoginResp = await submitCode2Session({ code: codeResp.code });
|
||||||
const data = wxLoginResp.data
|
const data = wxLoginResp.data;
|
||||||
|
|
||||||
this.globalData.api_token = data?.api_token
|
this.globalData.api_token = data?.api_token;
|
||||||
this.globalData.expire_in = data?.expire_in
|
this.globalData.expire_in = data?.expire_in;
|
||||||
this.globalData.user = data?.user
|
this.globalData.user = data?.user;
|
||||||
this.globalData.isLogin = !!this.globalData.api_token
|
this.globalData.isLogin = !!this.globalData.api_token;
|
||||||
this.globalData.isNeedBindPhone =
|
this.globalData.isNeedBindPhone = !!this.globalData.user?.is_need_bind_phone;
|
||||||
!!this.globalData.user?.is_need_bind_phone
|
|
||||||
|
|
||||||
const pages = getCurrentPages()
|
const pages = getCurrentPages();
|
||||||
const page = pages[pages.length - 1]
|
const page = pages[pages.length - 1];
|
||||||
|
|
||||||
if (page.$page) {
|
if (page.$page) {
|
||||||
console.log('current page: ', page.$page.fullPath)
|
console.log('current page: ', page.$page.fullPath);
|
||||||
} else {
|
} else {
|
||||||
console.log('current page: ', page.route)
|
console.log('current page: ', page.route);
|
||||||
}
|
}
|
||||||
|
|
||||||
resolve()
|
resolve();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err)
|
console.error(err);
|
||||||
reject()
|
reject();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
/*每个页面公共css */
|
/*每个页面公共css */
|
||||||
@import 'uview-plus/index.scss';
|
@import "uview-plus/index.scss";
|
||||||
|
|
||||||
page {
|
page {
|
||||||
background-color: #f3f3f3;
|
background-color: #f3f3f3;
|
||||||
}
|
}
|
||||||
|
|
||||||
button,
|
button,
|
||||||
button[type='primary'],
|
button[type=primary],
|
||||||
button[plain],
|
button[plain],
|
||||||
button[type='primary'][plain],
|
button[type=primary][plain],
|
||||||
button::after {
|
button::after {
|
||||||
border: none;
|
border: none;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
|
|
@ -126,18 +125,100 @@ button::after {
|
||||||
|
|
||||||
// 页面布局相关 外边距
|
// 页面布局相关 外边距
|
||||||
|
|
||||||
|
.p-16 {
|
||||||
|
padding: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pt-24 {
|
||||||
|
padding-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.m-16 {
|
||||||
|
margin: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-white {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-red {
|
||||||
|
color: #e91f35;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-4e {
|
||||||
|
color: #4e4e4e;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-primary {
|
||||||
|
color: #525252;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-black {
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-bold {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mb-10 {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex-col {
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex-1 {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.justify-between {
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.items-center {
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-base {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-sm {
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-xs {
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-center {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-white {
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rounded {
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rounded-lg {
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
.block-box {
|
.block-box {
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
box-shadow: 0.5px 0.5px 1px rgba(0, 0, 0, 0.1);
|
box-shadow: 0.5px 0.5px 1px rgba(0, 0, 0, 0.1);
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-shadow {
|
|
||||||
background: #ffffff;
|
|
||||||
box-shadow: 0px 0px 16px 0px rgba(0, 0, 0, 0.04);
|
|
||||||
border-radius: 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 公共样式封装
|
// 公共样式封装
|
||||||
.board {
|
.board {
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
|
|
@ -188,6 +269,14 @@ button::after {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 多行文本最后一行展示省略号
|
||||||
|
.ellipsis {
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
-webkit-line-clamp: 3;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
.nodata {
|
.nodata {
|
||||||
margin-top: 40px;
|
margin-top: 40px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
@ -195,4 +284,8 @@ button::after {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
color: #999999;
|
color: #999999;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.fixed{
|
||||||
|
position: fixed;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -151,11 +151,3 @@ export const submitUploadAvatar = (params, config = {}) => {
|
||||||
export const submitUploadUserInfo = (params, config = {}) => {
|
export const submitUploadUserInfo = (params, config = {}) => {
|
||||||
return http.post(`/api/miniprogram/user/update-info`, params, { ...config });
|
return http.post(`/api/miniprogram/user/update-info`, params, { ...config });
|
||||||
}
|
}
|
||||||
// 最新竞猜记录
|
|
||||||
export const getLatestGameLogs = () => {
|
|
||||||
return http.get(`/api/miniprogram/latest-game-logs`);
|
|
||||||
}
|
|
||||||
// 最新竞猜记录
|
|
||||||
export const activityGameLogs = (params) => {
|
|
||||||
return http.get(`/api/miniprogram/activity-game-logs`,{ params });
|
|
||||||
}
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="relative h-46rpx flex items-center">
|
|
||||||
<view
|
|
||||||
class="absolute left-0 w-4px h-[80%] transform top-[50%] translate-y-[-50%]"
|
|
||||||
:style="{ background: '#D8524C' }"
|
|
||||||
></view>
|
|
||||||
<view class="ml-16px font-bold text-base">{{ title }}</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
const props = defineProps({
|
|
||||||
title: {
|
|
||||||
type: String,
|
|
||||||
default: '标题',
|
|
||||||
},
|
|
||||||
color: '#D8524C',
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
|
|
@ -1,51 +0,0 @@
|
||||||
<template>
|
|
||||||
<view>
|
|
||||||
<view
|
|
||||||
class="flex items-center py-2"
|
|
||||||
@click="
|
|
||||||
$goToPage({
|
|
||||||
url: 'pages/quiz/logs',
|
|
||||||
params: { activity_id: data.activity_id, user_id: data.user_id },
|
|
||||||
})
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<up-avatar
|
|
||||||
:size="`70rpx`"
|
|
||||||
mode="aspectFit"
|
|
||||||
:src="data.avatar"
|
|
||||||
></up-avatar>
|
|
||||||
<view class="ml-10rpx flex-1">
|
|
||||||
<view class="flex-1 flex justify-between items-center">
|
|
||||||
<view class="text-28rpx text-primary">{{ data.nick_name }}</view>
|
|
||||||
<view class="text-xs text-hex-999">{{ data.history }}</view>
|
|
||||||
</view>
|
|
||||||
<view class="flex items-center text-sm">
|
|
||||||
<view class="flex items-center flex-1">
|
|
||||||
<view>猜</view>
|
|
||||||
<view class="px-2">
|
|
||||||
<text class="font-medium">{{ data.game_home_field }}</text> vs <text class="font-medium">{{ data.game_away }}</text>
|
|
||||||
</view>
|
|
||||||
<view>{{ data.score }}</view>
|
|
||||||
</view>
|
|
||||||
<view :style="{ color: currentStatus.color }">{{
|
|
||||||
currentStatus.label
|
|
||||||
}}</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<up-line dashed></up-line>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
<script setup>
|
|
||||||
import { computed } from 'vue'
|
|
||||||
import { status } from './status'
|
|
||||||
const props = defineProps({
|
|
||||||
data: {
|
|
||||||
item: Object,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const currentStatus = computed(() =>
|
|
||||||
status.find((e) => e.value == props.data.status)
|
|
||||||
)
|
|
||||||
</script>
|
|
||||||
|
|
@ -1,42 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="text-sm text-hex-333">
|
|
||||||
<view class="p-3">
|
|
||||||
<view>{{ data.game_day }} {{ data.game_name }}</view>
|
|
||||||
<view class="flex mt-2">
|
|
||||||
<view class="flex-1">
|
|
||||||
<view class="flex">
|
|
||||||
<!-- <view >{{ data.game_home_field }}</view>
|
|
||||||
<view class="text-center mx-10rpx">vs</view>
|
|
||||||
<view class="text-right">{{ data.game_away }}</view> -->
|
|
||||||
<view class="flex-1 text-center">{{ data.game_home_field }}</view>
|
|
||||||
<view class="text-center mx-10rpx">vs</view>
|
|
||||||
<view class="flex-1 text-center">{{ data.game_away }}</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="w-200rpx flex ml-20rpx">
|
|
||||||
<view class="w-100rpx text-center">{{ data.score }}</view>
|
|
||||||
<view
|
|
||||||
:style="{ color: currentStatus.color }"
|
|
||||||
class="text-right flex-1"
|
|
||||||
>{{ currentStatus.label }}</view
|
|
||||||
>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<up-line color="#EEEEEE"></up-line>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
<script setup>
|
|
||||||
import { computed } from 'vue'
|
|
||||||
import { status } from './status'
|
|
||||||
const props = defineProps({
|
|
||||||
data: {
|
|
||||||
type: Object,
|
|
||||||
default: () => {},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const currentStatus = computed(() =>
|
|
||||||
status.find((e) => e.value == props.data.status)
|
|
||||||
)
|
|
||||||
</script>
|
|
||||||
|
|
@ -1,644 +0,0 @@
|
||||||
<template>
|
|
||||||
<up-modal
|
|
||||||
:show="showGuessModalVisible"
|
|
||||||
:width="335"
|
|
||||||
:closeOnClickOverlay="true"
|
|
||||||
:showConfirmButton="false"
|
|
||||||
:showCancelButton="false"
|
|
||||||
@close="hideGuessModal"
|
|
||||||
>
|
|
||||||
<view class="guess-model w-full" v-if="gameInfo">
|
|
||||||
<view class="slot-content">
|
|
||||||
<view class="guess-title">
|
|
||||||
<view class="flex-1 flex-center">{{ gameInfo.home_field }}</view>
|
|
||||||
<view class="w-170rpx text-center">VS</view>
|
|
||||||
<view class="flex-1 flex-center">{{ gameInfo.away }}</view>
|
|
||||||
</view>
|
|
||||||
<view
|
|
||||||
:class="[successGuessClass, readonly ? 'pointer-events-none' : '']"
|
|
||||||
>
|
|
||||||
<template v-if="gameInfo.score_type == 1">
|
|
||||||
<view class="guess-table">
|
|
||||||
<view class="row herder-title">
|
|
||||||
<view class="table-td col-12">单</view>
|
|
||||||
</view>
|
|
||||||
<view class="table-tr row row-3">
|
|
||||||
<view class="row-title table-td row-3 col-10">胜</view>
|
|
||||||
<view class="row-content">
|
|
||||||
<view class="row-1 col-10">
|
|
||||||
<view
|
|
||||||
class="table-td col-2"
|
|
||||||
:class="{
|
|
||||||
'result-active': gameScore === '1:0',
|
|
||||||
active: userGuess === '1:0',
|
|
||||||
}"
|
|
||||||
@click="userGuessChange('1:0')"
|
|
||||||
>1:0</view
|
|
||||||
>
|
|
||||||
<view
|
|
||||||
class="table-td col-2"
|
|
||||||
:class="{
|
|
||||||
'result-active': gameScore === '2:0',
|
|
||||||
active: userGuess === '2:0',
|
|
||||||
}"
|
|
||||||
@click="userGuessChange('2:0')"
|
|
||||||
>2:0</view
|
|
||||||
>
|
|
||||||
<view
|
|
||||||
class="table-td col-2"
|
|
||||||
:class="{
|
|
||||||
'result-active': gameScore === '2:1',
|
|
||||||
active: userGuess === '2:1',
|
|
||||||
}"
|
|
||||||
@click="userGuessChange('2:1')"
|
|
||||||
>2:1</view
|
|
||||||
>
|
|
||||||
<view
|
|
||||||
class="table-td col-2"
|
|
||||||
:class="{
|
|
||||||
'result-active': gameScore === '3:0',
|
|
||||||
active: userGuess === '3:0',
|
|
||||||
}"
|
|
||||||
@click="userGuessChange('3:0')"
|
|
||||||
>3:0</view
|
|
||||||
>
|
|
||||||
<view
|
|
||||||
class="table-td col-2"
|
|
||||||
:class="{
|
|
||||||
'result-active': gameScore === '3:1',
|
|
||||||
active: userGuess === '3:1',
|
|
||||||
}"
|
|
||||||
@click="userGuessChange('3:1')"
|
|
||||||
>3:1</view
|
|
||||||
>
|
|
||||||
</view>
|
|
||||||
<view class="row-1 col-10">
|
|
||||||
<view
|
|
||||||
class="table-td col-2"
|
|
||||||
:class="{
|
|
||||||
'result-active': gameScore === '3:2',
|
|
||||||
active: userGuess === '3:2',
|
|
||||||
}"
|
|
||||||
@click="userGuessChange('3:2')"
|
|
||||||
>3:2</view
|
|
||||||
>
|
|
||||||
<view
|
|
||||||
class="table-td col-2"
|
|
||||||
:class="{
|
|
||||||
'result-active': gameScore === '4:0',
|
|
||||||
active: userGuess === '4:0',
|
|
||||||
}"
|
|
||||||
@click="userGuessChange('4:0')"
|
|
||||||
>4:0</view
|
|
||||||
>
|
|
||||||
<view
|
|
||||||
class="table-td col-2"
|
|
||||||
:class="{
|
|
||||||
'result-active': gameScore === '4:1',
|
|
||||||
active: userGuess === '4:1',
|
|
||||||
}"
|
|
||||||
@click="userGuessChange('4:1')"
|
|
||||||
>4:1</view
|
|
||||||
>
|
|
||||||
<view
|
|
||||||
class="table-td col-2"
|
|
||||||
:class="{
|
|
||||||
'result-active': gameScore === '4:2',
|
|
||||||
active: userGuess === '4:2',
|
|
||||||
}"
|
|
||||||
@click="userGuessChange('4:2')"
|
|
||||||
>4:2</view
|
|
||||||
>
|
|
||||||
<view
|
|
||||||
class="table-td col-2"
|
|
||||||
:class="{
|
|
||||||
'result-active': gameScore === '5:0',
|
|
||||||
active: userGuess === '5:0',
|
|
||||||
}"
|
|
||||||
@click="userGuessChange('5:0')"
|
|
||||||
>5:0</view
|
|
||||||
>
|
|
||||||
</view>
|
|
||||||
<view class="row-1 col-10">
|
|
||||||
<view
|
|
||||||
class="table-td col-2"
|
|
||||||
:class="{
|
|
||||||
'result-active': gameScore === '5:1',
|
|
||||||
active: userGuess === '5:1',
|
|
||||||
}"
|
|
||||||
@click="userGuessChange('5:1')"
|
|
||||||
>5:1</view
|
|
||||||
>
|
|
||||||
<view
|
|
||||||
class="table-td col-2"
|
|
||||||
:class="{
|
|
||||||
'result-active': gameScore === '5:2',
|
|
||||||
active: userGuess === '5:2',
|
|
||||||
}"
|
|
||||||
@click="userGuessChange('5:2')"
|
|
||||||
>5:2</view
|
|
||||||
>
|
|
||||||
<view
|
|
||||||
class="table-td col-6"
|
|
||||||
:class="{
|
|
||||||
'result-active': gameScore === '胜其他',
|
|
||||||
active: userGuess === '胜其他',
|
|
||||||
}"
|
|
||||||
@click="userGuessChange('胜其他')"
|
|
||||||
>胜其他</view
|
|
||||||
>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="table-tr row row-1">
|
|
||||||
<view class="row-title table-td row-1 col-10">平</view>
|
|
||||||
<view class="row-content">
|
|
||||||
<view class="row-1 col-10">
|
|
||||||
<view
|
|
||||||
class="table-td col-2"
|
|
||||||
:class="{
|
|
||||||
'result-active': gameScore === '0:0',
|
|
||||||
active: userGuess === '0:0',
|
|
||||||
}"
|
|
||||||
@click="userGuessChange('0:0')"
|
|
||||||
>0:0</view
|
|
||||||
>
|
|
||||||
<view
|
|
||||||
class="table-td col-2"
|
|
||||||
:class="{
|
|
||||||
'result-active': gameScore === '1:1',
|
|
||||||
active: userGuess === '1:1',
|
|
||||||
}"
|
|
||||||
@click="userGuessChange('1:1')"
|
|
||||||
>1:1</view
|
|
||||||
>
|
|
||||||
<view
|
|
||||||
class="table-td col-2"
|
|
||||||
:class="{
|
|
||||||
'result-active': gameScore === '2:2',
|
|
||||||
active: userGuess === '2:2',
|
|
||||||
}"
|
|
||||||
@click="userGuessChange('2:2')"
|
|
||||||
>2:2</view
|
|
||||||
>
|
|
||||||
<view
|
|
||||||
class="table-td col-2"
|
|
||||||
:class="{
|
|
||||||
'result-active': gameScore === '3:3',
|
|
||||||
active: userGuess === '3:3',
|
|
||||||
}"
|
|
||||||
@click="userGuessChange('3:3')"
|
|
||||||
>3:3</view
|
|
||||||
>
|
|
||||||
<view
|
|
||||||
class="table-td col-2"
|
|
||||||
:class="{
|
|
||||||
'result-active': gameScore === '平其他',
|
|
||||||
active: userGuess === '平其他',
|
|
||||||
}"
|
|
||||||
@click="userGuessChange('平其他')"
|
|
||||||
>平其他</view
|
|
||||||
>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="table-tr row row-3">
|
|
||||||
<view class="row-title table-td row-3 col-10">负</view>
|
|
||||||
<view class="row-content">
|
|
||||||
<view class="row-1 col-10">
|
|
||||||
<view
|
|
||||||
class="table-td col-2"
|
|
||||||
:class="{
|
|
||||||
'result-active': gameScore === '0:1',
|
|
||||||
active: userGuess === '0:1',
|
|
||||||
}"
|
|
||||||
@click="userGuessChange('0:1')"
|
|
||||||
>0:1</view
|
|
||||||
>
|
|
||||||
<view
|
|
||||||
class="table-td col-2"
|
|
||||||
:class="{
|
|
||||||
'result-active': gameScore === '0:2',
|
|
||||||
active: userGuess === '0:2',
|
|
||||||
}"
|
|
||||||
@click="userGuessChange('0:2')"
|
|
||||||
>0:2</view
|
|
||||||
>
|
|
||||||
<view
|
|
||||||
class="table-td col-2"
|
|
||||||
:class="{
|
|
||||||
'result-active': gameScore === '0:3',
|
|
||||||
active: userGuess === '0:3',
|
|
||||||
}"
|
|
||||||
@click="userGuessChange('0:3')"
|
|
||||||
>0:3</view
|
|
||||||
>
|
|
||||||
<view
|
|
||||||
class="table-td col-2"
|
|
||||||
:class="{
|
|
||||||
'result-active': gameScore === '0:4',
|
|
||||||
active: userGuess === '0:4',
|
|
||||||
}"
|
|
||||||
@click="userGuessChange('0:4')"
|
|
||||||
>0:4</view
|
|
||||||
>
|
|
||||||
<view
|
|
||||||
class="table-td col-2"
|
|
||||||
:class="{
|
|
||||||
'result-active': gameScore === '0:5',
|
|
||||||
active: userGuess === '0:5',
|
|
||||||
}"
|
|
||||||
@click="userGuessChange('0:5')"
|
|
||||||
>0:5</view
|
|
||||||
>
|
|
||||||
</view>
|
|
||||||
<view class="row-1 col-10">
|
|
||||||
<view
|
|
||||||
class="table-td col-2"
|
|
||||||
:class="{
|
|
||||||
'result-active': gameScore === '1:2',
|
|
||||||
active: userGuess === '1:2',
|
|
||||||
}"
|
|
||||||
@click="userGuessChange('1:2')"
|
|
||||||
>1:2</view
|
|
||||||
>
|
|
||||||
<view
|
|
||||||
class="table-td col-2"
|
|
||||||
:class="{
|
|
||||||
'result-active': gameScore === '1:3',
|
|
||||||
active: userGuess === '1:3',
|
|
||||||
}"
|
|
||||||
@click="userGuessChange('1:3')"
|
|
||||||
>1:3</view
|
|
||||||
>
|
|
||||||
<view
|
|
||||||
class="table-td col-2"
|
|
||||||
:class="{
|
|
||||||
'result-active': gameScore === '1:4',
|
|
||||||
active: userGuess === '1:4',
|
|
||||||
}"
|
|
||||||
@click="userGuessChange('1:4')"
|
|
||||||
>1:4</view
|
|
||||||
>
|
|
||||||
<view
|
|
||||||
class="table-td col-2"
|
|
||||||
:class="{
|
|
||||||
'result-active': gameScore === '1:5',
|
|
||||||
active: userGuess === '1:5',
|
|
||||||
}"
|
|
||||||
@click="userGuessChange('1:5')"
|
|
||||||
>1:5</view
|
|
||||||
>
|
|
||||||
<view
|
|
||||||
class="table-td col-2"
|
|
||||||
:class="{
|
|
||||||
'result-active': gameScore === '2:3',
|
|
||||||
active: userGuess === '2:3',
|
|
||||||
}"
|
|
||||||
@click="userGuessChange('2:3')"
|
|
||||||
>2:3</view
|
|
||||||
>
|
|
||||||
</view>
|
|
||||||
<view class="row-1 col-10">
|
|
||||||
<view
|
|
||||||
class="table-td col-2"
|
|
||||||
:class="{
|
|
||||||
'result-active': gameScore === '2:4',
|
|
||||||
active: userGuess === '2:4',
|
|
||||||
}"
|
|
||||||
@click="userGuessChange('2:4')"
|
|
||||||
>2:4</view
|
|
||||||
>
|
|
||||||
<view
|
|
||||||
class="table-td col-2"
|
|
||||||
:class="{
|
|
||||||
'result-active': gameScore === '2:5',
|
|
||||||
active: userGuess === '2:5',
|
|
||||||
}"
|
|
||||||
@click="userGuessChange('2:5')"
|
|
||||||
>2:5</view
|
|
||||||
>
|
|
||||||
<view
|
|
||||||
class="table-td col-6"
|
|
||||||
:class="{
|
|
||||||
'result-active': gameScore === '负其他',
|
|
||||||
active: userGuess === '负其他',
|
|
||||||
}"
|
|
||||||
@click="userGuessChange('负其他')"
|
|
||||||
>负其他</view
|
|
||||||
>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
<template v-if="gameInfo.score_type == 2">
|
|
||||||
<view class="flex">
|
|
||||||
<view class="flex-1 flex-center">
|
|
||||||
<up-avatar
|
|
||||||
size="48"
|
|
||||||
mode="aspectFit"
|
|
||||||
:src="gameInfo.home_logo"
|
|
||||||
></up-avatar>
|
|
||||||
</view>
|
|
||||||
<view class="text-center w-170rpx text-12px text-hex-999">
|
|
||||||
<view>{{ gameInfo.game_day }}</view>
|
|
||||||
<view>{{ gameInfo.little_game_at }}</view>
|
|
||||||
</view>
|
|
||||||
<view class="flex-1 flex-center">
|
|
||||||
<up-avatar
|
|
||||||
size="48"
|
|
||||||
mode="aspectFit"
|
|
||||||
:src="gameInfo.away_logo"
|
|
||||||
></up-avatar>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="type2 my-30px flex-center">
|
|
||||||
<view
|
|
||||||
class="h-44px flex bg-hex-eeeeef rounded-8px text-hex-303133"
|
|
||||||
>
|
|
||||||
<view
|
|
||||||
class="text-12px rounded-4px h-full flex"
|
|
||||||
:class="{
|
|
||||||
'active-a': gameScore === item,
|
|
||||||
active: userGuess === item,
|
|
||||||
}"
|
|
||||||
@click="userGuessChange(item)"
|
|
||||||
v-for="(item,index) in subsectionList"
|
|
||||||
:key="item"
|
|
||||||
>
|
|
||||||
<view class="w-80px flex-center h-full">
|
|
||||||
{{ item }}
|
|
||||||
</view>
|
|
||||||
<up-line v-if="index!=subsectionList.length-1" direction="col"></up-line>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="guess-btns" v-if="!readonly">
|
|
||||||
<up-button
|
|
||||||
class="more-btn"
|
|
||||||
:customStyle="{
|
|
||||||
margin: 0,
|
|
||||||
width: '120px',
|
|
||||||
backgroundColor: '#D9D9D9',
|
|
||||||
color: '#000',
|
|
||||||
}"
|
|
||||||
shape="circle"
|
|
||||||
text="取消"
|
|
||||||
@click="hideGuessModal"
|
|
||||||
></up-button>
|
|
||||||
|
|
||||||
<up-button
|
|
||||||
class="more-btn"
|
|
||||||
:customStyle="{
|
|
||||||
margin: 0,
|
|
||||||
width: '120px',
|
|
||||||
backgroundColor: '#5fb358',
|
|
||||||
color: '#fff',
|
|
||||||
}"
|
|
||||||
shape="circle"
|
|
||||||
text="确定"
|
|
||||||
@click="submitGuessResult"
|
|
||||||
></up-button>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</up-modal>
|
|
||||||
</template>
|
|
||||||
<script setup>
|
|
||||||
import { computed } from 'vue'
|
|
||||||
import { ref, watch, watchEffect } from 'vue'
|
|
||||||
const props = defineProps({
|
|
||||||
show: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
gameInfo: {
|
|
||||||
type: Object,
|
|
||||||
default: () => ({}),
|
|
||||||
},
|
|
||||||
showResult: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const showGuessModalVisible = ref(props.show)
|
|
||||||
const subsectionList = ref(['胜', '平', '负'])
|
|
||||||
const userGuess = ref('')
|
|
||||||
const readonly = computed(() => {
|
|
||||||
if (props.gameInfo?.has_guess || props.gameInfo?.game_at_comparison_now) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
})
|
|
||||||
const gameScore = computed(() => props.gameInfo?.game_score)
|
|
||||||
// const gameScore = computed(() => '负')
|
|
||||||
const isGuess = computed(() => !!props.gameInfo?.has_guess)
|
|
||||||
const isResult = computed(() => !!props.gameInfo?.game_score)
|
|
||||||
const successGuess = computed(
|
|
||||||
() => gameScore.value === props.gameInfo?.has_guess
|
|
||||||
)
|
|
||||||
const successGuessClass = computed(() => {
|
|
||||||
if (!isGuess.value) {
|
|
||||||
return ''
|
|
||||||
}
|
|
||||||
if (!isResult.value) {
|
|
||||||
return ''
|
|
||||||
}
|
|
||||||
return successGuess.value ? 'success' : 'fail'
|
|
||||||
})
|
|
||||||
|
|
||||||
watchEffect(
|
|
||||||
() => {
|
|
||||||
userGuess.value = props.gameInfo?.has_guess || ''
|
|
||||||
},
|
|
||||||
{
|
|
||||||
deep: true,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
watchEffect(() => {
|
|
||||||
showGuessModalVisible.value = props.show
|
|
||||||
})
|
|
||||||
|
|
||||||
const emit = defineEmits([
|
|
||||||
'update:show',
|
|
||||||
'hideGuessModal',
|
|
||||||
'submitGuessResult',
|
|
||||||
'userGuessChange',
|
|
||||||
])
|
|
||||||
const hideGuessModal = () => {
|
|
||||||
emit('hideGuessModal')
|
|
||||||
}
|
|
||||||
const submitGuessResult = () => {
|
|
||||||
if (userGuess.value === '' || !userGuess.value) {
|
|
||||||
return uni.showToast({
|
|
||||||
title: '请选择竞猜结果',
|
|
||||||
icon: 'none',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
emit('submitGuessResult', userGuess.value)
|
|
||||||
}
|
|
||||||
const userGuessChange = (score) => {
|
|
||||||
userGuess.value = score
|
|
||||||
}
|
|
||||||
|
|
||||||
watch(
|
|
||||||
() => showGuessModalVisible.value,
|
|
||||||
(val) => {
|
|
||||||
emit('update:show', val)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.type2 {
|
|
||||||
.active {
|
|
||||||
background-color: #1d2b5c;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.success {
|
|
||||||
.active {
|
|
||||||
background-color: red !important;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.fail {
|
|
||||||
.active {
|
|
||||||
background-color: #1d2b5c !important;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.active-a {
|
|
||||||
background-color: red !important;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.guess-model {
|
|
||||||
.slot-content {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.guess-title {
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
// justify-content: center;
|
|
||||||
// align-items: center;
|
|
||||||
// gap: 58px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.guess-table {
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
font-size: 12px;
|
|
||||||
|
|
||||||
.table-td {
|
|
||||||
border: 1px solid #bbb;
|
|
||||||
width: 48px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.table-td.result-active {
|
|
||||||
background-color: red;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.table-td.active {
|
|
||||||
background-color: #1d2b5c;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.row-1 {
|
|
||||||
height: calc(30px * 1 - 2px) !important;
|
|
||||||
line-height: calc(30px * 1 - 2px) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.row-2 {
|
|
||||||
height: calc(30px * 2 - 2px) !important;
|
|
||||||
line-height: calc(30px * 2 - 2px) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.row-3 {
|
|
||||||
height: calc(30px * 3 - 8px) !important;
|
|
||||||
line-height: calc(30px * 3 - 8px) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.row {
|
|
||||||
width: 300px;
|
|
||||||
height: 30px;
|
|
||||||
line-height: 30px;
|
|
||||||
flex-shrink: 0;
|
|
||||||
display: flex;
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
.col-1 {
|
|
||||||
width: calc(292px / 12 * 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.col-2 {
|
|
||||||
width: calc(292px / 12 * 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
.col-10 {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-start;
|
|
||||||
align-self: flex-start;
|
|
||||||
flex-grow: 1;
|
|
||||||
|
|
||||||
.table-td {
|
|
||||||
width: 47.7px !important;
|
|
||||||
border: 1px solid #bbb;
|
|
||||||
}
|
|
||||||
|
|
||||||
.col-6 {
|
|
||||||
width: calc(47.7px * 3 + 4px) !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.col-12 {
|
|
||||||
width: 292px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.herder-title {
|
|
||||||
background-color: #1d2b5c;
|
|
||||||
color: #fff;
|
|
||||||
|
|
||||||
.table-td {
|
|
||||||
width: 100% !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.row-title {
|
|
||||||
background-color: #d9d9d9;
|
|
||||||
width: 48px !important;
|
|
||||||
justify-content: center !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.row-content {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
width: calc(300px - 48px - 3px) !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.guess-btns {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-around;
|
|
||||||
width: 300px;
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
export const status = [
|
|
||||||
{
|
|
||||||
value: 0,
|
|
||||||
label: '未公布',
|
|
||||||
color: '#1b2f85'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 1,
|
|
||||||
label: '猜中了',
|
|
||||||
color: '#e91f35'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 2,
|
|
||||||
label: '未猜中',
|
|
||||||
color: '#808080'
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
@ -12,7 +12,6 @@ dayjs.locale('zh-cn');
|
||||||
|
|
||||||
import mpShare from 'uview-plus/libs/mixin/mpShare'
|
import mpShare from 'uview-plus/libs/mixin/mpShare'
|
||||||
import mixin_common, { goToPage } from '@/utils/mixins/mixin_common';
|
import mixin_common, { goToPage } from '@/utils/mixins/mixin_common';
|
||||||
import 'uno.css'
|
|
||||||
|
|
||||||
export function createApp() {
|
export function createApp() {
|
||||||
const app = createSSRApp(App);
|
const app = createSSRApp(App);
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="bg-white wrap">
|
<view class="bg-white wrap">
|
||||||
<view class="image mb-2.5" v-if="data.cover">
|
<view class="image mb-10" v-if="data.cover">
|
||||||
<image class="image" :src="data.cover" mode="aspectFill" />
|
<image class="image" :src="data.cover" mode="aspectFill" />
|
||||||
</view>
|
</view>
|
||||||
<view class="p-16 title-bar flex-1" v-if="data">
|
<view class="p-16 title-bar flex-1" v-if="data">
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="page-setting">
|
<view class="page-setting">
|
||||||
<view class="setting-box">
|
<view class="setting-box">
|
||||||
<view class="block-box bg-white rounded-4px">
|
<view class="block-box bg-white rounded">
|
||||||
<view class="flex text-primary items-center cell text-base">
|
<view class="flex text-primary items-center cell text-base">
|
||||||
<text class="text">头像</text>
|
<text class="text">头像</text>
|
||||||
<button class="menu-item-btn" openType="chooseAvatar" @chooseavatar="handleChooseAvatar">
|
<button class="menu-item-btn" openType="chooseAvatar" @chooseavatar="handleChooseAvatar">
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
{
|
{
|
||||||
"path": "pages/news/news",
|
"path": "pages/news/news",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "推荐"
|
"navigationBarTitleText": "资讯"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -43,11 +43,6 @@
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": ""
|
"navigationBarTitleText": ""
|
||||||
}
|
}
|
||||||
},{
|
|
||||||
"path":"pages/quiz/logs",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "竞猜记录"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"subPackages": [
|
"subPackages": [
|
||||||
|
|
@ -135,7 +130,7 @@
|
||||||
"selectedIconPath": "static/icons/charts-1.png"
|
"selectedIconPath": "static/icons/charts-1.png"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"text": "推荐",
|
"text": "资讯",
|
||||||
"pagePath": "pages/news/news",
|
"pagePath": "pages/news/news",
|
||||||
"iconPath": "static/icons/earth.png",
|
"iconPath": "static/icons/earth.png",
|
||||||
"selectedIconPath": "static/icons/earth-1.png"
|
"selectedIconPath": "static/icons/earth-1.png"
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -7,7 +7,7 @@
|
||||||
<image class="icon" src="../../static//images/error.png" />
|
<image class="icon" src="../../static//images/error.png" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="p-base text-xs text-4e text-center ">
|
<view class="p-16 text-xs text-4e text-center ">
|
||||||
{{ props.rules }}
|
{{ props.rules }}
|
||||||
</view>
|
</view>
|
||||||
<view class="flex items-center">
|
<view class="flex items-center">
|
||||||
|
|
|
||||||
|
|
@ -1,46 +1,23 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="home-page">
|
<view class="home-page">
|
||||||
<mescroll-body
|
<mescroll-body @init="mescrollInit" @down="downCallback" @up="upCallback" :up="{
|
||||||
@init="mescrollInit"
|
|
||||||
@down="downCallback"
|
|
||||||
@up="upCallback"
|
|
||||||
:up="{
|
|
||||||
empty: {
|
empty: {
|
||||||
use: false,
|
use: false,
|
||||||
},
|
}
|
||||||
}"
|
}">
|
||||||
>
|
|
||||||
<view class="home-banner" v-if="homeBannerList.length">
|
<view class="home-banner" v-if="homeBannerList.length">
|
||||||
<up-swiper
|
<up-swiper class="bg" :radius="0" height="200" :list="homeBannerList"
|
||||||
class="bg"
|
:displayMultipleItems="displayMultipleItems" keyName="url" @click="clickHomeBanner"></up-swiper>
|
||||||
:radius="0"
|
|
||||||
height="200"
|
|
||||||
:list="homeBannerList"
|
|
||||||
:displayMultipleItems="displayMultipleItems"
|
|
||||||
keyName="url"
|
|
||||||
@click="clickHomeBanner"
|
|
||||||
></up-swiper>
|
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view class="home-content" v-if="gameInfo || articleList.length">
|
||||||
class="home-content"
|
<image class="bg" mode="widthFix" :src="`${config.baseUrl}/images/mini-bg.jpg`"></image>
|
||||||
v-if="gameInfo || articleList.length || gameLogs.length"
|
|
||||||
>
|
|
||||||
<image
|
|
||||||
class="bg"
|
|
||||||
mode="widthFix"
|
|
||||||
:src="`${config.baseUrl}/images/mini-bg.jpg`"
|
|
||||||
></image>
|
|
||||||
|
|
||||||
<view class="today-guess-box" v-if="gameInfo">
|
<view class="today-guess-box" v-if="gameInfo">
|
||||||
<view class="title">今日竞猜</view>
|
<view class="title">今日竞猜</view>
|
||||||
<view class="vs-box">
|
<view class="vs-box">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<up-avatar
|
<up-avatar class="item-box" size="48" mode="aspectFit"
|
||||||
class="item-box"
|
:src="gameInfo.home_logo"></up-avatar>
|
||||||
size="48"
|
|
||||||
mode="aspectFit"
|
|
||||||
:src="gameInfo.home_logo"
|
|
||||||
></up-avatar>
|
|
||||||
<view class="item-text">{{ gameInfo.home_field }}</view>
|
<view class="item-text">{{ gameInfo.home_field }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="middle">
|
<view class="middle">
|
||||||
|
|
@ -48,183 +25,204 @@
|
||||||
<view class="item-text">{{ gameInfo.little_game_at }}</view>
|
<view class="item-text">{{ gameInfo.little_game_at }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="right">
|
<view class="right">
|
||||||
<up-avatar
|
<up-avatar class="item-box" size="48" mode="aspectFit"
|
||||||
class="item-box"
|
:src="gameInfo.away_logo"></up-avatar>
|
||||||
size="48"
|
|
||||||
mode="aspectFit"
|
|
||||||
:src="gameInfo.away_logo"
|
|
||||||
></up-avatar>
|
|
||||||
<view class="item-text">{{ gameInfo.away }}</view>
|
<view class="item-text">{{ gameInfo.away }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="operation-box">
|
<view class="operation-box">
|
||||||
<up-button
|
<up-button class="guess-btn" :disabled="false" shape="circle" @click="showGuessModal(gameInfo)"
|
||||||
class="guess-btn"
|
:customStyle="{ margin: 0, width: '132px', backgroundColor: '#1D2B5C', color: '#fff', opacity: 1 }"
|
||||||
:disabled="false"
|
v-if="!gameInfo.game_at_comparison_now && !gameInfo.has_guess">立即竞猜</up-button>
|
||||||
shape="circle"
|
|
||||||
@click="showGuessModal(gameInfo)"
|
|
||||||
:customStyle="{
|
|
||||||
margin: 0,
|
|
||||||
width: '132px',
|
|
||||||
backgroundColor: '#1D2B5C',
|
|
||||||
color: '#fff',
|
|
||||||
opacity: 1,
|
|
||||||
}"
|
|
||||||
v-if="!gameInfo.game_at_comparison_now && !gameInfo.has_guess"
|
|
||||||
>立即竞猜</up-button
|
|
||||||
>
|
|
||||||
|
|
||||||
<up-button
|
<up-button class="guess-btn disabled" :disabled="false" shape="circle"
|
||||||
class="guess-btn disabled"
|
|
||||||
:disabled="false"
|
|
||||||
shape="circle"
|
|
||||||
@click="showGuessModal(gameInfo)"
|
@click="showGuessModal(gameInfo)"
|
||||||
:customStyle="{
|
:customStyle="{ margin: 0, width: '132px', backgroundColor: '#1D2B5C', color: '#fff', opacity: 0.7 }"
|
||||||
margin: 0,
|
v-if="gameInfo.has_guess">已竞猜</up-button>
|
||||||
width: '132px',
|
|
||||||
backgroundColor: '#1D2B5C',
|
|
||||||
color: '#fff',
|
|
||||||
opacity: 0.7,
|
|
||||||
}"
|
|
||||||
v-if="gameInfo.has_guess"
|
|
||||||
>已竞猜</up-button
|
|
||||||
>
|
|
||||||
|
|
||||||
<up-button
|
<up-button class="guess-btn disabled" :disabled="true" shape="circle"
|
||||||
class="guess-btn disabled"
|
|
||||||
:disabled="true"
|
|
||||||
shape="circle"
|
|
||||||
@click="showGuessModal(gameInfo)"
|
@click="showGuessModal(gameInfo)"
|
||||||
:customStyle="{
|
:customStyle="{ margin: 0, width: '132px', backgroundColor: '#1D2B5C', color: '#fff', opacity: 0.7 }"
|
||||||
margin: 0,
|
v-if="gameInfo.game_at_comparison_now && !gameInfo.has_guess">已结束</up-button>
|
||||||
width: '132px',
|
|
||||||
backgroundColor: '#1D2B5C',
|
|
||||||
color: '#fff',
|
|
||||||
opacity: 0.7,
|
|
||||||
}"
|
|
||||||
v-if="gameInfo.game_at_comparison_now && !gameInfo.has_guess"
|
|
||||||
>已结束</up-button
|
|
||||||
>
|
|
||||||
|
|
||||||
<up-button
|
<up-button class="more-btn" :disabled="false" shape="circle" @click="goToActivateDetailPage"
|
||||||
class="more-btn"
|
:customStyle="{ margin: 0, width: '75px', backgroundColor: '#f0f0f0', color: '#000', opacity: 1 }">更多</up-button>
|
||||||
:disabled="false"
|
|
||||||
shape="circle"
|
|
||||||
@click="goToActivateDetailPage"
|
|
||||||
:customStyle="{
|
|
||||||
margin: 0,
|
|
||||||
width: '75px',
|
|
||||||
backgroundColor: '#f0f0f0',
|
|
||||||
color: '#000',
|
|
||||||
opacity: 1,
|
|
||||||
}"
|
|
||||||
>更多</up-button
|
|
||||||
>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="news-box" v-if="articleList.length">
|
<view class="news-box" v-if="articleList.length">
|
||||||
<view class="news-title-box">
|
<view class="news-title-box">
|
||||||
<text class="title">体彩资讯</text>
|
<text class="title">体彩资讯</text>
|
||||||
<text class="more" @click="$goToPage('pages/news/news', true)"
|
<text class="more" @click="$goToPage('pages/news/news', true)">查看更多</text>
|
||||||
>查看更多</text
|
|
||||||
>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view
|
<view v-for="(item, index) in articleList" :key="index"
|
||||||
v-for="(item, index) in articleList"
|
@click="$goToPage({ url: 'packages/pages/news/newDetail/newDetail', params: { id: item.id } })">
|
||||||
:key="index"
|
<view class="news-image-box" :class="{ 'last': index === articleList.length - 1 }"
|
||||||
@click="
|
v-if="item.cover">
|
||||||
$goToPage({
|
|
||||||
url: 'packages/pages/news/newDetail/newDetail',
|
|
||||||
params: { id: item.id },
|
|
||||||
})
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<view
|
|
||||||
class="news-image-box"
|
|
||||||
:class="{ last: index === articleList.length - 1 }"
|
|
||||||
v-if="item.cover"
|
|
||||||
>
|
|
||||||
<image class="news-image" :src="item.cover"></image>
|
<image class="news-image" :src="item.cover"></image>
|
||||||
<view class="news-info">
|
<view class="news-info">
|
||||||
<view class="news-info-title">{{ item.title }}</view>
|
<view class="news-info-title">{{ item.title }}</view>
|
||||||
<view class="news-info-publish_time">{{
|
<view class="news-info-publish_time">{{ item.published_at }}</view>
|
||||||
item.published_at
|
|
||||||
}}</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view
|
<view class="news-content-box" :class="{ 'last': index === articleList.length - 1 }" v-else>
|
||||||
class="news-content-box"
|
|
||||||
:class="{ last: index === articleList.length - 1 }"
|
|
||||||
v-else
|
|
||||||
>
|
|
||||||
<view class="news-info">
|
<view class="news-info">
|
||||||
<view class="news-info-title">{{ item.title }}</view>
|
<view class="news-info-title">{{ item.title }}</view>
|
||||||
<view class="news-info-publish_time">{{
|
<view class="news-info-publish_time">{{ item.published_at }}</view>
|
||||||
item.published_at
|
</view>
|
||||||
}}</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="news-box">
|
<view class="guess-model" v-if="gameInfo">
|
||||||
<view class="news-title-box">
|
<up-modal :show="showGuessModalVisible" :width="335" :closeOnClickOverlay="true"
|
||||||
<text class="title">最新竞猜</text>
|
:showConfirmButton="false" :showCancelButton="false" @close="hideGuessModal">
|
||||||
<!-- <text class="more" @click="$goToPage('pages/news/news', true)">查看更多</text> -->
|
<view class="slot-content">
|
||||||
|
<view class="guess-title">
|
||||||
|
<view>{{ gameInfo.home_field }}</view>
|
||||||
|
<view>VS</view>
|
||||||
|
<view>{{ gameInfo.away }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-for="(item, i) in gameLogs" :key="i">
|
|
||||||
<QuizItem :data="item"></QuizItem>
|
<view class="guess-table">
|
||||||
|
<view class="row herder-title">
|
||||||
|
<view class="table-td col-12">单</view>
|
||||||
|
</view>
|
||||||
|
<view class="table-tr row row-3">
|
||||||
|
<view class="row-title table-td row-3 col-10">胜</view>
|
||||||
|
<view class="row-content">
|
||||||
|
<view class="row-1 col-10">
|
||||||
|
<view class="table-td col-2" :class="{ 'active': userGuess === '1:0' }"
|
||||||
|
@click="userGuessChange('1:0')">1:0</view>
|
||||||
|
<view class="table-td col-2" :class="{ 'active': userGuess === '2:0' }"
|
||||||
|
@click="userGuessChange('2:0')">2:0</view>
|
||||||
|
<view class="table-td col-2" :class="{ 'active': userGuess === '2:1' }"
|
||||||
|
@click="userGuessChange('2:1')">2:1</view>
|
||||||
|
<view class="table-td col-2" :class="{ 'active': userGuess === '3:0' }"
|
||||||
|
@click="userGuessChange('3:0')">3:0</view>
|
||||||
|
<view class="table-td col-2" :class="{ 'active': userGuess === '3:1' }"
|
||||||
|
@click="userGuessChange('3:1')">3:1</view>
|
||||||
|
</view>
|
||||||
|
<view class="row-1 col-10">
|
||||||
|
<view class="table-td col-2" :class="{ 'active': userGuess === '3:2' }"
|
||||||
|
@click="userGuessChange('3:2')">3:2</view>
|
||||||
|
<view class="table-td col-2" :class="{ 'active': userGuess === '4:0' }"
|
||||||
|
@click="userGuessChange('4:0')">4:0</view>
|
||||||
|
<view class="table-td col-2" :class="{ 'active': userGuess === '4:1' }"
|
||||||
|
@click="userGuessChange('4:1')">4:1</view>
|
||||||
|
<view class="table-td col-2" :class="{ 'active': userGuess === '4:2' }"
|
||||||
|
@click="userGuessChange('4:2')">4:2</view>
|
||||||
|
<view class="table-td col-2" :class="{ 'active': userGuess === '5:0' }"
|
||||||
|
@click="userGuessChange('5:0')">5:0</view>
|
||||||
|
</view>
|
||||||
|
<view class="row-1 col-10">
|
||||||
|
<view class="table-td col-2" :class="{ 'active': userGuess === '5:1' }"
|
||||||
|
@click="userGuessChange('5:1')">5:1</view>
|
||||||
|
<view class="table-td col-2" :class="{ 'active': userGuess === '5:2' }"
|
||||||
|
@click="userGuessChange('5:2')">5:2</view>
|
||||||
|
<view class="table-td col-6" :class="{ 'active': userGuess === '胜其他' }"
|
||||||
|
@click="userGuessChange('胜其他')">胜其他</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="table-tr row row-1">
|
||||||
|
<view class="row-title table-td row-1 col-10">平</view>
|
||||||
|
<view class="row-content">
|
||||||
|
<view class="row-1 col-10">
|
||||||
|
<view class="table-td col-2" :class="{ 'active': userGuess === '0:0' }"
|
||||||
|
@click="userGuessChange('0:0')">0:0</view>
|
||||||
|
<view class="table-td col-2" :class="{ 'active': userGuess === '1:1' }"
|
||||||
|
@click="userGuessChange('1:1')">1:1</view>
|
||||||
|
<view class="table-td col-2" :class="{ 'active': userGuess === '2:2' }"
|
||||||
|
@click="userGuessChange('2:2')">2:2</view>
|
||||||
|
<view class="table-td col-2" :class="{ 'active': userGuess === '3:3' }"
|
||||||
|
@click="userGuessChange('3:3')">3:3</view>
|
||||||
|
<view class="table-td col-2" :class="{ 'active': userGuess === '平其他' }"
|
||||||
|
@click="userGuessChange('平其他')">平其他</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="table-tr row row-3">
|
||||||
|
<view class="row-title table-td row-3 col-10">负</view>
|
||||||
|
<view class="row-content">
|
||||||
|
<view class="row-1 col-10">
|
||||||
|
<view class="table-td col-2" :class="{ 'active': userGuess === '0:1' }"
|
||||||
|
@click="userGuessChange('0:1')">0:1</view>
|
||||||
|
<view class="table-td col-2" :class="{ 'active': userGuess === '0:2' }"
|
||||||
|
@click="userGuessChange('0:2')">0:2</view>
|
||||||
|
<view class="table-td col-2" :class="{ 'active': userGuess === '0:3' }"
|
||||||
|
@click="userGuessChange('0:3')">0:3</view>
|
||||||
|
<view class="table-td col-2" :class="{ 'active': userGuess === '0:4' }"
|
||||||
|
@click="userGuessChange('0:4')">0:4</view>
|
||||||
|
<view class="table-td col-2" :class="{ 'active': userGuess === '0:5' }"
|
||||||
|
@click="userGuessChange('0:5')">0:5</view>
|
||||||
|
</view>
|
||||||
|
<view class="row-1 col-10">
|
||||||
|
<view class="table-td col-2" :class="{ 'active': userGuess === '1:2' }"
|
||||||
|
@click="userGuessChange('1:2')">1:2</view>
|
||||||
|
<view class="table-td col-2" :class="{ 'active': userGuess === '1:3' }"
|
||||||
|
@click="userGuessChange('1:3')">1:3</view>
|
||||||
|
<view class="table-td col-2" :class="{ 'active': userGuess === '1:4' }"
|
||||||
|
@click="userGuessChange('1:4')">1:4</view>
|
||||||
|
<view class="table-td col-2" :class="{ 'active': userGuess === '1:5' }"
|
||||||
|
@click="userGuessChange('1:5')">1:5</view>
|
||||||
|
<view class="table-td col-2" :class="{ 'active': userGuess === '2:3' }"
|
||||||
|
@click="userGuessChange('2:3')">2:3</view>
|
||||||
|
</view>
|
||||||
|
<view class="row-1 col-10">
|
||||||
|
<view class="table-td col-2" :class="{ 'active': userGuess === '2:4' }"
|
||||||
|
@click="userGuessChange('2:4')">2:4</view>
|
||||||
|
<view class="table-td col-2" :class="{ 'active': userGuess === '2:5' }"
|
||||||
|
@click="userGuessChange('2:5')">2:5</view>
|
||||||
|
<view class="table-td col-6" :class="{ 'active': userGuess === '负其他' }"
|
||||||
|
@click="userGuessChange('负其他')">负其他</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="guess-btns" v-if="!readonly">
|
||||||
|
<up-button class="more-btn"
|
||||||
|
:customStyle="{ margin: 0, width: '120px', backgroundColor: '#D9D9D9', color: '#000', }"
|
||||||
|
shape="circle" text="取消" @click="hideGuessModal"></up-button>
|
||||||
|
|
||||||
|
<up-button class="more-btn"
|
||||||
|
:customStyle="{ margin: 0, width: '120px', backgroundColor: '#5fb358', color: '#fff', }"
|
||||||
|
shape="circle" text="确定" @click="submitGuessResult"></up-button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</up-modal>
|
||||||
|
</view>
|
||||||
</mescroll-body>
|
</mescroll-body>
|
||||||
<QuizModal
|
|
||||||
:gameInfo="gameInfo"
|
|
||||||
:readonly="readonly"
|
|
||||||
@hideGuessModal="hideGuessModal"
|
|
||||||
@submitGuessResult="submitGuessResult"
|
|
||||||
@userGuessChange="userGuessChange"
|
|
||||||
v-model:show="showGuessModalVisible"
|
|
||||||
></QuizModal>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import QuizModal from '@/components/quiz/modal.vue'
|
import { ref, getCurrentInstance } from 'vue';
|
||||||
import { ref, getCurrentInstance } from 'vue'
|
|
||||||
import config from '@/common/config'
|
import config from '@/common/config'
|
||||||
import {
|
import { queryAds, queryLatestgame, queryRecommendArticles, submitGuess } from '@/api/xinjiang_guess';
|
||||||
queryAds,
|
import useAuthUser from '@/utils/hooks/useAuthUser';
|
||||||
queryLatestgame,
|
|
||||||
queryRecommendArticles,
|
|
||||||
submitGuess,
|
|
||||||
getLatestGameLogs,
|
|
||||||
} from '@/api/xinjiang_guess'
|
|
||||||
import useAuthUser from '@/utils/hooks/useAuthUser'
|
|
||||||
import jumpFun from '@/utils/jump.js'
|
import jumpFun from '@/utils/jump.js'
|
||||||
import QuizItem from '@/components/quiz/item-new.vue'
|
const vm = getCurrentInstance();
|
||||||
const vm = getCurrentInstance()
|
|
||||||
|
|
||||||
const loading = ref(false)
|
const loading = ref(false);
|
||||||
const homeBannerLoading = ref(false)
|
const homeBannerLoading = ref(false);
|
||||||
const homeBannerInfo = ref(null)
|
const homeBannerInfo = ref(null);
|
||||||
const homeBannerList = ref([])
|
const homeBannerList = ref([]);
|
||||||
const displayMultipleItems = ref(0)
|
const displayMultipleItems = ref(0);
|
||||||
|
|
||||||
const showGuessModalVisible = ref(false)
|
const showGuessModalVisible = ref(false);
|
||||||
const gameInfoLoading = ref(false)
|
const gameInfoLoading = ref(false);
|
||||||
const gameInfo = ref(null)
|
const gameInfo = ref(null);
|
||||||
const readonly = ref(false)
|
const readonly = ref(false);
|
||||||
const userGuess = ref('0:0')
|
const userGuess = ref('0:0');
|
||||||
const submitGuessLoading = ref(false)
|
const submitGuessLoading = ref(false);
|
||||||
|
|
||||||
const articleListLoading = ref(false)
|
const articleListLoading = ref(false);
|
||||||
const articleList = ref([])
|
const articleList = ref([]);
|
||||||
|
|
||||||
const gameLogs = ref([])
|
|
||||||
|
|
||||||
function clickHomeBanner(index) {
|
function clickHomeBanner(index) {
|
||||||
// if (!homeBannerList.value.length) {
|
// if (!homeBannerList.value.length) {
|
||||||
|
|
@ -235,41 +233,40 @@ function clickHomeBanner(index) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function userGuessChange(score) {
|
function userGuessChange(score) {
|
||||||
userGuess.value = score
|
|
||||||
if (readonly.value) {
|
if (readonly.value) {
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
userGuess.value = score
|
userGuess.value = score;
|
||||||
}
|
}
|
||||||
function showGuessModal(item) {
|
function showGuessModal(item) {
|
||||||
const { user } = useAuthUser()
|
const { user } = useAuthUser();
|
||||||
if (user.is_need_bind_phone) {
|
if (user.is_need_bind_phone) {
|
||||||
vm.proxy.$goToPage('packages/pages/login/login?previous=index')
|
vm.proxy.$goToPage('packages/pages/login/login?previous=index');
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
gameInfo.value = item
|
gameInfo.value = item;
|
||||||
|
|
||||||
if (gameInfo.value.has_guess) {
|
if (gameInfo.value.has_guess) {
|
||||||
readonly.value = true
|
readonly.value = true;
|
||||||
}
|
}
|
||||||
if (gameInfo.value.game_at_comparison_now) {
|
if (gameInfo.value.game_at_comparison_now) {
|
||||||
readonly.value = true
|
readonly.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (readonly.value) {
|
if (readonly.value) {
|
||||||
userGuess.value = item.has_guess
|
userGuess.value = item.has_guess;
|
||||||
} else {
|
} else {
|
||||||
userGuess.value = '0:0'
|
userGuess.value = '0:0';
|
||||||
}
|
}
|
||||||
|
|
||||||
showGuessModalVisible.value = true
|
showGuessModalVisible.value = true;
|
||||||
}
|
}
|
||||||
function hideGuessModal() {
|
function hideGuessModal() {
|
||||||
showGuessModalVisible.value = false
|
showGuessModalVisible.value = false;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
userGuess.value = '0:0'
|
userGuess.value = '0:0';
|
||||||
}, 300)
|
}, 300);
|
||||||
}
|
}
|
||||||
|
|
||||||
function goToActivateDetailPage() {
|
function goToActivateDetailPage() {
|
||||||
|
|
@ -277,153 +274,127 @@ function goToActivateDetailPage() {
|
||||||
url: 'packages/pages/activeDetail/activeDetail',
|
url: 'packages/pages/activeDetail/activeDetail',
|
||||||
params: {
|
params: {
|
||||||
id: gameInfo.value.activity_id,
|
id: gameInfo.value.activity_id,
|
||||||
},
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getHomeBanner() {
|
async function getHomeBanner() {
|
||||||
try {
|
try {
|
||||||
homeBannerLoading.value = true
|
homeBannerLoading.value = true;
|
||||||
const resp = await queryAds({
|
const resp = await queryAds({
|
||||||
address: 'index-top',
|
address: "index-top",
|
||||||
})
|
});
|
||||||
homeBannerInfo.value = resp.data
|
homeBannerInfo.value = resp.data;
|
||||||
|
|
||||||
homeBannerList.value =
|
homeBannerList.value = resp.data?.ads.map(item => {
|
||||||
resp.data?.ads.map((item) => {
|
|
||||||
return {
|
return {
|
||||||
url: item.resource,
|
url: item.resource,
|
||||||
title: '',
|
title: "",
|
||||||
poster: '',
|
poster: "",
|
||||||
jump_type: item.jump_type,
|
jump_type: item.jump_type,
|
||||||
jump_config: item.jump_config,
|
jump_config: item.jump_config,
|
||||||
}
|
}
|
||||||
}) || []
|
}) || [];
|
||||||
|
|
||||||
displayMultipleItems.value = 1
|
displayMultipleItems.value = 1;
|
||||||
if (homeBannerList.value.length > 3) {
|
if (homeBannerList.value.length > 3) {
|
||||||
displayMultipleItems.value = 3
|
displayMultipleItems.value = 3;
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err)
|
console.error(err);
|
||||||
} finally {
|
} finally {
|
||||||
homeBannerLoading.value = false
|
homeBannerLoading.value = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getLatestGuess() {
|
async function getLatestGuess() {
|
||||||
try {
|
try {
|
||||||
gameInfoLoading.value = true
|
gameInfoLoading.value = true;
|
||||||
const resp = await queryLatestgame()
|
const resp = await queryLatestgame()
|
||||||
gameInfo.value = resp.data
|
gameInfo.value = resp.data;
|
||||||
if (gameInfo.value && gameInfo.value.has_guess) {
|
if (gameInfo.value && gameInfo.value.has_guess) {
|
||||||
userGuess.value = gameInfo.value.has_guess
|
userGuess.value = gameInfo.value.has_guess;
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err)
|
console.error(err);
|
||||||
} finally {
|
} finally {
|
||||||
gameInfoLoading.value = false
|
gameInfoLoading.value = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getRecommendArticles(params) {
|
async function getRecommendArticles(params) {
|
||||||
try {
|
try {
|
||||||
articleListLoading.value = true
|
articleListLoading.value = true;
|
||||||
const resp = await queryRecommendArticles(params)
|
const resp = await queryRecommendArticles(params)
|
||||||
articleList.value = resp.data?.articles || []
|
articleList.value = resp.data?.articles || [];
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err)
|
console.error(err);
|
||||||
} finally {
|
} finally {
|
||||||
articleListLoading.value = false
|
articleListLoading.value = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getNewQuiz() {
|
async function submitGuessResult() {
|
||||||
try {
|
|
||||||
const resData = await getLatestGameLogs()
|
|
||||||
gameLogs.value = resData.data?.list || []
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function submitGuessResult(e) {
|
|
||||||
if(e){
|
|
||||||
userGuess.value = e
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '加载中...',
|
title: "加载中..."
|
||||||
})
|
});
|
||||||
|
|
||||||
const params = {
|
const params = {
|
||||||
game: gameInfo.value.id,
|
game: gameInfo.value.id,
|
||||||
score: userGuess.value,
|
score: userGuess.value,
|
||||||
}
|
};
|
||||||
submitGuessLoading.value = true
|
submitGuessLoading.value = true;
|
||||||
const res = await submitGuess(params, { custom: { catch: true } })
|
const res = await submitGuess(params, { custom: { catch: true } });
|
||||||
|
|
||||||
console.log('submitGuess', res)
|
console.log('submitGuess', res);
|
||||||
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.message,
|
title: res.message,
|
||||||
icon: 'none',
|
icon: "none",
|
||||||
})
|
});
|
||||||
|
|
||||||
getLatestGuess()
|
getLatestGuess();
|
||||||
setTimeout(hideGuessModal, 0)
|
setTimeout(hideGuessModal, 0);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err)
|
console.error(err);
|
||||||
} finally {
|
} finally {
|
||||||
submitGuessLoading.value = false
|
submitGuessLoading.value = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getData(page = 1, per_page = 10) {
|
function getData(page = 1, per_page = 10) {
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
try {
|
try {
|
||||||
loading.value = true
|
loading.value = true;
|
||||||
setTimeout(async () => {
|
setTimeout(async () => {
|
||||||
await getHomeBanner()
|
await getHomeBanner();
|
||||||
await getLatestGuess()
|
await getLatestGuess();
|
||||||
// await getRecommendArticles();
|
await getRecommendArticles();
|
||||||
getNewQuiz()
|
resolve();
|
||||||
resolve()
|
}, 1500);
|
||||||
}, 1500)
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log('getData index', err)
|
console.log('getData index', err);
|
||||||
reject()
|
reject();
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false
|
loading.value = false;
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
import {
|
import { onShow, onLoad, onPullDownRefresh, onPageScroll, onReachBottom, onShareAppMessage } from "@dcloudio/uni-app";
|
||||||
onShow,
|
import useMescroll from "@/uni_modules/mescroll-uni/hooks/useMescroll.js";
|
||||||
onLoad,
|
const { mescrollInit, downCallback, getMescroll } = useMescroll(onPageScroll, onReachBottom)
|
||||||
onPullDownRefresh,
|
|
||||||
onPageScroll,
|
|
||||||
onReachBottom,
|
|
||||||
onShareAppMessage,
|
|
||||||
} from '@dcloudio/uni-app'
|
|
||||||
import useMescroll from '@/uni_modules/mescroll-uni/hooks/useMescroll.js'
|
|
||||||
const { mescrollInit, downCallback, getMescroll } = useMescroll(
|
|
||||||
onPageScroll,
|
|
||||||
onReachBottom
|
|
||||||
)
|
|
||||||
|
|
||||||
const list = ref([])
|
const list = ref([]);
|
||||||
const upCallback = (mescroll) => {
|
const upCallback = (mescroll) => {
|
||||||
typeof getData === 'function' &&
|
typeof getData === 'function' && getData(mescroll.num, mescroll.size).then(data => {
|
||||||
getData(mescroll.num, mescroll.size)
|
|
||||||
.then((data) => {
|
|
||||||
let curPageData = [] // 当前页数据
|
let curPageData = [] // 当前页数据
|
||||||
if (Array.isArray(data)) {
|
if (Array.isArray(data)) {
|
||||||
curPageData = data
|
curPageData = data;
|
||||||
}
|
}
|
||||||
if (mescroll.num == 1) list.value = [] // 第一页需手动制空列表
|
if (mescroll.num == 1) list.value = []; // 第一页需手动制空列表
|
||||||
list.value = list.value.concat(curPageData) //追加新数据
|
list.value = list.value.concat(curPageData); //追加新数据
|
||||||
//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
|
//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
|
||||||
//mescroll会根据传的参数,自动判断列表如果无任何数据,则提示空;列表无下一页数据,则提示无更多数据;
|
//mescroll会根据传的参数,自动判断列表如果无任何数据,则提示空;列表无下一页数据,则提示无更多数据;
|
||||||
|
|
||||||
|
|
@ -437,13 +408,12 @@ const upCallback = (mescroll) => {
|
||||||
//mescroll.endSuccess(curPageData.length, hasNext); //必传参数(当前页的数据个数, 是否有下一页true/false)
|
//mescroll.endSuccess(curPageData.length, hasNext); //必传参数(当前页的数据个数, 是否有下一页true/false)
|
||||||
|
|
||||||
//方法四 (不推荐),会存在一个小问题:比如列表共有20条数据,每页加载10条,共2页.如果只根据当前页的数据个数判断,则需翻到第三页才会知道无更多数据.
|
//方法四 (不推荐),会存在一个小问题:比如列表共有20条数据,每页加载10条,共2页.如果只根据当前页的数据个数判断,则需翻到第三页才会知道无更多数据.
|
||||||
mescroll.endSuccess(curPageData.length) // 请求成功, 结束加载
|
mescroll.endSuccess(curPageData.length); // 请求成功, 结束加载
|
||||||
|
}).catch((err) => {
|
||||||
|
console.error(err);
|
||||||
|
mescroll.endErr(); // 请求失败, 结束加载
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
};
|
||||||
console.error(err)
|
|
||||||
mescroll.endErr() // 请求失败, 结束加载
|
|
||||||
})
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|
@ -524,7 +494,7 @@ const upCallback = (mescroll) => {
|
||||||
.guess-btn {
|
.guess-btn {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
width: 132px;
|
width: 132px;
|
||||||
background-color: #1d2b5c;
|
background-color: #1D2B5C;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
border-radius: 50px;
|
border-radius: 50px;
|
||||||
height: 36px;
|
height: 36px;
|
||||||
|
|
@ -532,7 +502,7 @@ const upCallback = (mescroll) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
.guess-btn.disabled {
|
.guess-btn.disabled {
|
||||||
opacity: 0.5;
|
opacity: .5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.more-btn {
|
.more-btn {
|
||||||
|
|
@ -556,7 +526,7 @@ const upCallback = (mescroll) => {
|
||||||
|
|
||||||
.news-title-box {
|
.news-title-box {
|
||||||
padding-left: 12px;
|
padding-left: 12px;
|
||||||
border-left: 4px solid #d8524c;
|
border-left: 4px solid #D8524C;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
|
|
||||||
|
|
@ -624,120 +594,120 @@ const upCallback = (mescroll) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// .guess-model {
|
.guess-model {
|
||||||
// .slot-content {
|
.slot-content {
|
||||||
// display: flex;
|
display: flex;
|
||||||
// flex-direction: column;
|
flex-direction: column;
|
||||||
// gap: 12px;
|
gap: 12px;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// .guess-title {
|
.guess-title {
|
||||||
// width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
// display: flex;
|
display: flex;
|
||||||
// justify-content: center;
|
justify-content: center;
|
||||||
// align-items: center;
|
align-items: center;
|
||||||
// gap: 58px;
|
gap: 58px;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// .guess-table {
|
.guess-table {
|
||||||
// width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
// display: flex;
|
display: flex;
|
||||||
// flex-direction: column;
|
flex-direction: column;
|
||||||
// justify-content: center;
|
justify-content: center;
|
||||||
// align-items: center;
|
align-items: center;
|
||||||
// font-size: 12px;
|
font-size: 12px;
|
||||||
|
|
||||||
// .table-td {
|
.table-td {
|
||||||
// border: 1px solid #bbb;
|
border: 1px solid #bbb;
|
||||||
// width: 48px !important;
|
width: 48px !important;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// .table-td.active {
|
.table-td.active {
|
||||||
// background-color: #1d2b5c;
|
background-color: #1D2B5C;
|
||||||
// color: #fff;
|
color: #fff;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// .row-1 {
|
.row-1 {
|
||||||
// height: calc(30px * 1 - 2px) !important;
|
height: calc(30px * 1 - 2px) !important;
|
||||||
// line-height: calc(30px * 1 - 2px) !important;
|
line-height: calc(30px * 1 - 2px) !important;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// .row-2 {
|
.row-2 {
|
||||||
// height: calc(30px * 2 - 2px) !important;
|
height: calc(30px * 2 - 2px) !important;
|
||||||
// line-height: calc(30px * 2 - 2px) !important;
|
line-height: calc(30px * 2 - 2px) !important;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// .row-3 {
|
.row-3 {
|
||||||
// height: calc(30px * 3 - 8px) !important;
|
height: calc(30px * 3 - 8px) !important;
|
||||||
// line-height: calc(30px * 3 - 8px) !important;
|
line-height: calc(30px * 3 - 8px) !important;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// .row {
|
.row {
|
||||||
// width: 300px;
|
width: 300px;
|
||||||
// height: 30px;
|
height: 30px;
|
||||||
// line-height: 30px;
|
line-height: 30px;
|
||||||
// flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
// display: flex;
|
display: flex;
|
||||||
// text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
// .col-1 {
|
.col-1 {
|
||||||
// width: calc(292px / 12 * 1);
|
width: calc(292px / 12 * 1);
|
||||||
// }
|
}
|
||||||
|
|
||||||
// .col-2 {
|
.col-2 {
|
||||||
// width: calc(292px / 12 * 2);
|
width: calc(292px / 12 * 2);
|
||||||
// }
|
}
|
||||||
|
|
||||||
// .col-10 {
|
.col-10 {
|
||||||
// display: flex;
|
display: flex;
|
||||||
// justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
// align-self: flex-start;
|
align-self: flex-start;
|
||||||
// flex-grow: 1;
|
flex-grow: 1;
|
||||||
|
|
||||||
// .table-td {
|
.table-td {
|
||||||
// width: 47.7px !important;
|
width: 47.7px !important;
|
||||||
// border: 1px solid #bbb;
|
border: 1px solid #bbb;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// .col-6 {
|
.col-6 {
|
||||||
// width: calc(47.7px * 3 + 4px) !important;
|
width: calc(47.7px * 3 + 4px) !important;
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
// .col-12 {
|
.col-12 {
|
||||||
// width: 292px;
|
width: 292px;
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
// .herder-title {
|
.herder-title {
|
||||||
// background-color: #1d2b5c;
|
background-color: #1D2B5C;
|
||||||
// color: #fff;
|
color: #fff;
|
||||||
|
|
||||||
// .table-td {
|
.table-td {
|
||||||
// width: 100% !important;
|
width: 100% !important;
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
// .row-title {
|
.row-title {
|
||||||
// background-color: #d9d9d9;
|
background-color: #D9D9D9;
|
||||||
// width: 48px !important;
|
width: 48px !important;
|
||||||
// justify-content: center !important;
|
justify-content: center !important;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// .row-content {
|
.row-content {
|
||||||
// display: flex;
|
display: flex;
|
||||||
// flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
// width: calc(300px - 48px - 3px) !important;
|
width: calc(300px - 48px - 3px) !important;
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
// .guess-btns {
|
.guess-btns {
|
||||||
// display: flex;
|
display: flex;
|
||||||
// justify-content: space-around;
|
justify-content: space-around;
|
||||||
// width: 300px;
|
width: 300px;
|
||||||
// flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<view class="mine-page">
|
<view class="mine-page">
|
||||||
<view class="p-base">
|
<view class="p-16">
|
||||||
<view class="userinfo-box">
|
<view class="userinfo-box">
|
||||||
<view class="userinfo" @click="handleClickUserInfo">
|
<view class="userinfo" @click="handleClickUserInfo">
|
||||||
<up-avatar
|
<up-avatar
|
||||||
|
|
@ -42,34 +42,27 @@
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</view>
|
</view>
|
||||||
<view class="space-y-3">
|
<view v-for="(block, index) in menus" :key="index">
|
||||||
<view
|
<view class="block-box bg-white rounded">
|
||||||
v-for="(block, index) in menus"
|
|
||||||
:key="index"
|
|
||||||
class="card-shadow overflow-hidden px-30rpx"
|
|
||||||
>
|
|
||||||
<view v-for="(item, index) in block" :key="index">
|
<view v-for="(item, index) in block" :key="index">
|
||||||
<view
|
<view
|
||||||
class="flex text-primary items-center cell text-base"
|
class="flex text-primary items-center cell text-base"
|
||||||
@click="goToMenuPage(item)"
|
@click="goToMenuPage(item)"
|
||||||
v-if="!item.openType"
|
v-if="!item.openType"
|
||||||
>
|
>
|
||||||
<image class="icon mr-12px" :src="item.icon" />
|
<image class="icon mr-12" :src="item.icon" />
|
||||||
<view class="menu-item" :openType="item.openType">
|
<view class="menu-item" :openType="item.openType">
|
||||||
<text class="text">{{ item.text }}</text>
|
<text class="text">{{ item.text }}</text>
|
||||||
<text class="extra" v-if="item.extra">{{ item.extra }}</text>
|
<text class="extra" v-if="item.extra">{{ item.extra }}</text>
|
||||||
</view>
|
</view>
|
||||||
<image
|
<image class="icon" src="@/static/icons/arrow.svg" />
|
||||||
class="w-30rpx h-30rpx opacity-50"
|
|
||||||
src="@/static/icons/arrow.svg"
|
|
||||||
/>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view
|
<view
|
||||||
class="flex text-primary items-center cell text-base"
|
class="flex text-primary items-center cell text-base"
|
||||||
v-if="item.openType"
|
v-if="item.openType"
|
||||||
>
|
>
|
||||||
<image class="icon mr-12px" :src="item.icon" />
|
<image class="icon mr-12" :src="item.icon" />
|
||||||
<up-button class="menu-item-btn" :openType="item.openType">
|
<up-button class="menu-item-btn" :openType="item.openType">
|
||||||
<text class="text">{{ item.text }}</text>
|
<text class="text">{{ item.text }}</text>
|
||||||
<text class="extra" v-if="item.extra">{{ item.extra }}</text>
|
<text class="extra" v-if="item.extra">{{ item.extra }}</text>
|
||||||
|
|
@ -224,12 +217,7 @@ const upCallback = (mescroll) => {
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.phone {
|
.phone {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
bottom: 50rpx;
|
bottom: 50rpx;
|
||||||
// #endif
|
|
||||||
// #ifdef H5
|
|
||||||
bottom: 180rpx;
|
|
||||||
// #endif
|
|
||||||
z-index: 9999;
|
z-index: 9999;
|
||||||
left: 0;
|
left: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
@ -240,6 +228,9 @@ const upCallback = (mescroll) => {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.mr-12 {
|
||||||
|
margin-right: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
width: 20px;
|
width: 20px;
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,9 @@ const upCallback = (mescroll) => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
.mt-8 {
|
||||||
|
margin-top: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
.m-title {
|
.m-title {
|
||||||
margin: 8px 0 10px;
|
margin: 8px 0 10px;
|
||||||
|
|
|
||||||
|
|
@ -1,178 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="bg-hex-1b2f85">
|
|
||||||
<mescroll-body
|
|
||||||
@init="mescrollInit"
|
|
||||||
@down="downCallback"
|
|
||||||
@up="upCallback"
|
|
||||||
:up="{
|
|
||||||
empty: {
|
|
||||||
use: false,
|
|
||||||
},
|
|
||||||
}"
|
|
||||||
>
|
|
||||||
<view>
|
|
||||||
<view class="h-188px w-full" v-if="detail.cover">
|
|
||||||
<image class="w-full" mode="aspectFill" :src="detail.cover" />
|
|
||||||
</view>
|
|
||||||
<view class="min-h-screen relative bg-hex-1b2f85 p-3">
|
|
||||||
<image
|
|
||||||
class="absolute left-0 w-full top-0"
|
|
||||||
mode="widthFix"
|
|
||||||
:src="`${config.baseUrl}/images/mini-bg.jpg`"
|
|
||||||
></image>
|
|
||||||
<view class="relative text-white">
|
|
||||||
<view class="flex justify-between">
|
|
||||||
<view class="text-base font-medium">{{ detail.name }}</view>
|
|
||||||
<view class="text-xs" @click="showRuleModal">活动规则</view>
|
|
||||||
</view>
|
|
||||||
<view class="text-sm mt-3 font-medium"
|
|
||||||
>{{ dayjs(detail.start_at).format('YYYY-MM-DD') }}至{{
|
|
||||||
dayjs(detail.end_at).format('YYYY-MM-DD')
|
|
||||||
}}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="bg-white rounded-12px relative mt-4 min-h-40vh">
|
|
||||||
<view class="px-3 pt-16rpx">
|
|
||||||
<CTitle title="他的竞猜"></CTitle>
|
|
||||||
</view>
|
|
||||||
<view class="">
|
|
||||||
<Item v-for="(item, i) in list" :key="i" :data="item"></Item>
|
|
||||||
<mescroll-empty v-if="!list.length"></mescroll-empty>
|
|
||||||
<view class="flex-center py-30rpx" v-else> </view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</mescroll-body>
|
|
||||||
<view class="h-160rpx">
|
|
||||||
<view
|
|
||||||
class="fixed bottom-50rpx h-100rpx flex left-0 w-full justify-center items-center box-content"
|
|
||||||
>
|
|
||||||
<up-button
|
|
||||||
class="guess-btn"
|
|
||||||
:disabled="false"
|
|
||||||
shape="circle"
|
|
||||||
:customStyle="{
|
|
||||||
margin: 0,
|
|
||||||
width: '132px',
|
|
||||||
backgroundColor: '#1D2B5C',
|
|
||||||
color: '#fff',
|
|
||||||
opacity: 1,
|
|
||||||
}"
|
|
||||||
@click="goActiveDetail"
|
|
||||||
>立即参与竞猜</up-button
|
|
||||||
>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<up-modal
|
|
||||||
:show="showRuleModalVisible"
|
|
||||||
:width="335"
|
|
||||||
:closeOnClickOverlay="true"
|
|
||||||
:showConfirmButton="false"
|
|
||||||
:showCancelButton="false"
|
|
||||||
@close="hideRuleModal"
|
|
||||||
>
|
|
||||||
<view class="slot-content-rule">
|
|
||||||
<view class="title">活动规则</view>
|
|
||||||
|
|
||||||
<view class="content">{{ detail.rules }}</view>
|
|
||||||
</view>
|
|
||||||
</up-modal>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
<script setup>
|
|
||||||
import dayjs from 'dayjs'
|
|
||||||
import { onPageScroll, onReachBottom, onLoad } from '@dcloudio/uni-app'
|
|
||||||
import useMescroll from '@/uni_modules/mescroll-uni/hooks/useMescroll.js'
|
|
||||||
import { queryActivitiesDetail, activityGameLogs } from '@/api/xinjiang_guess'
|
|
||||||
import Item from '@/components/quiz/item.vue'
|
|
||||||
import CTitle from '@/components/c-title/index.vue'
|
|
||||||
import config from '@/common/config'
|
|
||||||
import { ref, getCurrentInstance } from 'vue';
|
|
||||||
import useAuthUser from '@/utils/hooks/useAuthUser';
|
|
||||||
const vm = getCurrentInstance();
|
|
||||||
const activityId = ref(null)
|
|
||||||
const userId = ref(null)
|
|
||||||
const detail = ref({})
|
|
||||||
const list = ref([])
|
|
||||||
const showRuleModalVisible = ref(false)
|
|
||||||
const { mescrollInit, downCallback, getMescroll } = useMescroll(
|
|
||||||
onPageScroll,
|
|
||||||
onReachBottom
|
|
||||||
)
|
|
||||||
|
|
||||||
onLoad((query) => {
|
|
||||||
activityId.value = query.activity_id
|
|
||||||
userId.value = query.user_id
|
|
||||||
})
|
|
||||||
|
|
||||||
const upCallback = async (mescroll) => {
|
|
||||||
const { size, num } = mescroll
|
|
||||||
if (num === 1) getActiveDetail()
|
|
||||||
try {
|
|
||||||
const resData = await activityGameLogs({
|
|
||||||
user_id: userId.value,
|
|
||||||
activity_id: activityId.value,
|
|
||||||
per_page: size,
|
|
||||||
page: num,
|
|
||||||
})
|
|
||||||
const arr = resData.data.list || [] // 当前页数据
|
|
||||||
if (num == 1) list.value = [] //如果是第一页需手动制空列表
|
|
||||||
list.value = list.value.concat(arr) //追加新数据
|
|
||||||
mescroll.endSuccess(arr.length) // 请求成功, 结束加载
|
|
||||||
} catch (error) {
|
|
||||||
mescroll.endErr()
|
|
||||||
console.log(error)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const getActiveDetail = async () => {
|
|
||||||
try {
|
|
||||||
const resData = await queryActivitiesDetail({ id: activityId.value })
|
|
||||||
detail.value = resData.data
|
|
||||||
} catch (error) {}
|
|
||||||
}
|
|
||||||
|
|
||||||
const showRuleModal = async () => {
|
|
||||||
showRuleModalVisible.value = true
|
|
||||||
}
|
|
||||||
const hideRuleModal = async () => {
|
|
||||||
showRuleModalVisible.value = false
|
|
||||||
}
|
|
||||||
|
|
||||||
function goActiveDetail() {
|
|
||||||
const { user } = useAuthUser();
|
|
||||||
if (user.is_need_bind_phone) {
|
|
||||||
vm.proxy.$goToPage('packages/pages/login/login?previous=index');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
vm.proxy.$goToPage({
|
|
||||||
url: 'packages/pages/activeDetail/activeDetail',
|
|
||||||
params: {
|
|
||||||
id: activityId.value
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.slot-content-rule {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
gap: 12px;
|
|
||||||
|
|
||||||
.title {
|
|
||||||
font-size: 16px;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content {
|
|
||||||
font-size: 12px;
|
|
||||||
font-weight: 400;
|
|
||||||
white-space: pre-wrap;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 7.0 KiB |
|
|
@ -39,7 +39,7 @@ const GlobalOption = {
|
||||||
textLoading: '加载中 ...', // 加载中的提示文本
|
textLoading: '加载中 ...', // 加载中的提示文本
|
||||||
textNoMore: '-- END --', // 没有更多数据的提示文本
|
textNoMore: '-- END --', // 没有更多数据的提示文本
|
||||||
empty: {
|
empty: {
|
||||||
tip: '' // 空提示
|
tip: '~ 空空如也 ~' // 空提示
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,58 +0,0 @@
|
||||||
|
|
||||||
import { defineConfig, presetAttributify } from 'unocss'
|
|
||||||
|
|
||||||
import {
|
|
||||||
presetApplet,
|
|
||||||
presetRemRpx,
|
|
||||||
transformerAttributify,
|
|
||||||
} from 'unocss-applet'
|
|
||||||
|
|
||||||
// uni-app
|
|
||||||
const isApplet = process.env?.UNI_PLATFORM?.startsWith('mp-') ?? false
|
|
||||||
|
|
||||||
const presets = []
|
|
||||||
const transformers = []
|
|
||||||
|
|
||||||
if (isApplet) {
|
|
||||||
presets.push(presetApplet())
|
|
||||||
presets.push(presetRemRpx())
|
|
||||||
transformers.push(transformerAttributify({ ignoreAttributes: ['block'] }))
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
presets.push(presetApplet())
|
|
||||||
presets.push(presetAttributify())
|
|
||||||
presets.push(presetRemRpx({ mode: 'rpx2rem' }))
|
|
||||||
}
|
|
||||||
|
|
||||||
export default defineConfig({
|
|
||||||
shortcuts: {
|
|
||||||
'flex-center': 'flex items-center justify-center',
|
|
||||||
},
|
|
||||||
theme: {
|
|
||||||
colors: {
|
|
||||||
'4e': '#4e4e4e',
|
|
||||||
primary: '#525252',
|
|
||||||
black: '#000000',
|
|
||||||
},
|
|
||||||
spacing: {
|
|
||||||
'base': '30rpx',
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
rules: [
|
|
||||||
[
|
|
||||||
'p-safe',
|
|
||||||
{
|
|
||||||
padding: 'env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
['pt-safe', { 'padding-top': 'env(safe-area-inset-top)' }],
|
|
||||||
['pb-safe', { 'padding-bottom': 'env(safe-area-inset-bottom)' }],
|
|
||||||
],
|
|
||||||
presets: [
|
|
||||||
...presets,
|
|
||||||
],
|
|
||||||
transformers: [
|
|
||||||
...transformers,
|
|
||||||
],
|
|
||||||
})
|
|
||||||
|
|
@ -1,10 +1,8 @@
|
||||||
import { defineConfig } from 'vite'
|
import { defineConfig } from 'vite'
|
||||||
import uni from '@dcloudio/vite-plugin-uni'
|
import uni from '@dcloudio/vite-plugin-uni'
|
||||||
import UnoCSS from 'unocss/vite'
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [
|
plugins: [
|
||||||
uni(),
|
uni(),
|
||||||
UnoCSS()
|
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue