Compare commits

..

No commits in common. "hui.zhou" and "main" have entirely different histories.

24 changed files with 1647 additions and 3435 deletions

View File

@ -16,7 +16,6 @@
"dev:mp-qq": "uni -p mp-qq",
"dev:mp-toutiao": "uni -p mp-toutiao",
"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:quickapp-webview": "uni -p quickapp-webview",
"dev:quickapp-webview-huawei": "uni -p quickapp-webview-huawei",
@ -35,7 +34,6 @@
"build:mp-qq": "uni build -p mp-qq",
"build:mp-toutiao": "uni build -p mp-toutiao",
"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:quickapp-webview": "uni build -p quickapp-webview",
"build:quickapp-webview-huawei": "uni build -p quickapp-webview-huawei",
@ -58,10 +56,8 @@
"@dcloudio/uni-quickapp-webview": "3.0.0-alpha-4010520240507001",
"clipboard": "^2.0.11",
"dayjs": "^1.11.11",
"pinia": "2.0.33",
"pinia-plugin-persistedstate": "^3.2.1",
"tiny-emitter": "^2.1.0",
"uview-plus": "^3.3.4",
"uview-plus": "^3.1.41",
"vue": "^3.4.21",
"vue-i18n": "^9.1.9",
"vue3-eventbus": "^2.0.0"
@ -75,8 +71,6 @@
"@vue/runtime-core": "^3.4.21",
"sass": "^1.69.7",
"sass-loader": "10",
"unocss": "^0.58.5",
"unocss-applet": "^0.8.2",
"vite": "5.2.8"
}
}

View File

@ -1,198 +1,291 @@
<script>
import dayjs from 'dayjs'
import useAuthUser from '@/utils/hooks/useAuthUser'
import { submitCode2Session } from '@/api/xinjiang_guess'
import dayjs from 'dayjs';
import useAuthUser from '@/utils/hooks/useAuthUser';
import { submitCode2Session } from '@/api/xinjiang_guess';
export default {
globalData: {},
onLaunch: function () {
console.log('App Launch')
},
onShow: async function () {
console.log('App Show')
globalData: {},
onLaunch: function () {
console.log('App Launch')
},
onShow: async function () {
console.log('App Show')
if (uni.canIUse('getUpdateManager')) {
const updateManager = uni.getUpdateManager()
updateManager.onCheckForUpdate(function (res) {
//
if (res.hasUpdate) {
updateManager.onUpdateReady(function () {
wx.showModal({
title: '更新提示',
content: '新版本已经准备好,是否重启应用?',
success: function (res) {
// res: {errMsg: "showModal: ok", cancel: false, confirm: true}
if (res.confirm) {
// applyUpdate
updateManager.applyUpdate()
}
},
})
})
updateManager.onUpdateFailed(function () {
//
uni.showModal({
title: '已经有新版本了哟~',
content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~',
})
})
}
})
}
if (uni.canIUse('getUpdateManager')) {
const updateManager = uni.getUpdateManager();
updateManager.onCheckForUpdate(function (res) {
//
if (res.hasUpdate) {
updateManager.onUpdateReady(function () {
wx.showModal({
title: '更新提示',
content: '新版本已经准备好,是否重启应用?',
success: function (res) {
// res: {errMsg: "showModal: ok", cancel: false, confirm: true}
if (res.confirm) {
// applyUpdate
updateManager.applyUpdate()
}
}
})
});
updateManager.onUpdateFailed(function () {
//
uni.showModal({
title: '已经有新版本了哟~',
content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~'
});
});
}
})
}
console.log('checkSession', this.checkSession())
if (!this.checkSession()) {
await this.login(true)
}
console.log('checkSession', this.checkSession());
if (!this.checkSession()) {
await this.login(true);
}
console.log('App globalData', this.globalData)
},
onHide: function () {
console.log('App Hide')
},
methods: {
checkSession() {
const expire_in = this.globalData.expire_in
if (!expire_in) {
return false
}
console.log('App globalData', this.globalData);
},
onHide: function () {
console.log('App Hide')
},
methods: {
checkSession() {
const expire_in = this.globalData.expire_in;
if (!expire_in) {
return false;
}
if (expire_in) {
let isExpired = dayjs().isAfter(dayjs(expire_in))
console.log('isExpired', isExpired)
if (isExpired) {
return false
}
if (expire_in) {
let isExpired = dayjs().isAfter(dayjs(expire_in))
console.log('isExpired', isExpired);
if (isExpired) {
return false;
}
let willExpired = dayjs().add(6, 'hour').isAfter(dayjs(expire_in))
console.log('willExpired', willExpired)
if (willExpired) {
return false
}
}
let willExpired = dayjs().add(6, 'hour').isAfter(dayjs(expire_in))
console.log('willExpired', willExpired);
if (willExpired) {
return false;
}
}
return true
},
login() {
return new Promise(async (resolve, reject) => {
try {
const codeResp = await wx.login()
const wxLoginResp = await submitCode2Session({ code: codeResp.code })
const data = wxLoginResp.data
return true;
},
login() {
return new Promise(async (resolve, reject) => {
try {
const codeResp = await wx.login()
const wxLoginResp = await submitCode2Session({ code: codeResp.code });
const data = wxLoginResp.data;
this.globalData.api_token = data?.api_token
this.globalData.expire_in = data?.expire_in
this.globalData.user = data?.user
this.globalData.isLogin = !!this.globalData.api_token
this.globalData.isNeedBindPhone =
!!this.globalData.user?.is_need_bind_phone
this.globalData.api_token = data?.api_token;
this.globalData.expire_in = data?.expire_in;
this.globalData.user = data?.user;
this.globalData.isLogin = !!this.globalData.api_token;
this.globalData.isNeedBindPhone = !!this.globalData.user?.is_need_bind_phone;
const pages = getCurrentPages()
const page = pages[pages.length - 1]
const pages = getCurrentPages();
const page = pages[pages.length - 1];
if (page.$page) {
console.log('current page: ', page.$page.fullPath)
} else {
console.log('current page: ', page.route)
}
if (page.$page) {
console.log('current page: ', page.$page.fullPath);
} else {
console.log('current page: ', page.route);
}
resolve()
} catch (err) {
console.error(err)
reject()
}
})
},
},
resolve();
} catch (err) {
console.error(err);
reject();
}
});
}
}
}
</script>
<style lang="scss">
/*每个页面公共css */
@import 'uview-plus/index.scss';
@import "uview-plus/index.scss";
page {
background-color: #f3f3f3;
background-color: #f3f3f3;
}
button,
button[type='primary'],
button[type=primary],
button[plain],
button[type='primary'][plain],
button[type=primary][plain],
button::after {
border: none;
background: transparent;
border: none;
background: transparent;
}
//
.block-box {
padding: 12px;
box-shadow: 0.5px 0.5px 1px rgba(0, 0, 0, 0.1);
margin-bottom: 16px;
.p-16 {
padding: 16px;
}
.card-shadow {
background: #ffffff;
box-shadow: 0px 0px 16px 0px rgba(0, 0, 0, 0.04);
border-radius: 20rpx;
.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 {
padding: 12px;
box-shadow: 0.5px 0.5px 1px rgba(0, 0, 0, 0.1);
margin-bottom: 16px;
}
//
.board {
border-radius: 6px;
background-color: #fff;
padding: 12px 32px;
border-radius: 6px;
background-color: #fff;
padding: 12px 32px;
.title {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 26px 2px;
}
.title {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 26px 2px;
}
.btn-primary {
background-color: #182c5f;
color: #fff;
border: none;
border-radius: 4px;
padding: 8px 16px;
cursor: pointer;
}
.btn-primary {
background-color: #182c5f;
color: #fff;
border: none;
border-radius: 4px;
padding: 8px 16px;
cursor: pointer;
}
.line {
margin-top: 8px;
width: 100%;
height: 2px;
background-color: #d3d3d3;
}
.line {
margin-top: 8px;
width: 100%;
height: 2px;
background-color: #d3d3d3;
}
}
.btn-primary-sm {
width: 60px;
height: 24px;
line-height: 24px;
padding: 0px !important;
margin: 0;
font-size: 12px;
border-radius: 20px !important;
box-shadow: 1px 0.4px 1px #e91f35;
width: 60px;
height: 24px;
line-height: 24px;
padding: 0px !important;
margin: 0;
font-size: 12px;
border-radius: 20px !important;
box-shadow: 1px 0.4px 1px #e91f35;
}
.img {
width: 80px;
height: 80px;
line-height: 80px;
margin-right: 16px;
border-radius: 8px;
overflow: hidden;
width: 80px;
height: 80px;
line-height: 80px;
margin-right: 16px;
border-radius: 8px;
overflow: hidden;
}
//
.ellipsis {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
overflow: hidden;
}
.nodata {
margin-top: 40px;
display: flex;
justify-content: center;
align-items: center;
color: #999999;
margin-top: 40px;
display: flex;
justify-content: center;
align-items: center;
color: #999999;
}
.fixed{
position: fixed;
}
</style>

View File

@ -151,11 +151,3 @@ export const submitUploadAvatar = (params, config = {}) => {
export const submitUploadUserInfo = (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 });
}

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -1,17 +0,0 @@
export const status = [
{
value: 0,
label: '未公布',
color: '#1b2f85'
},
{
value: 1,
label: '猜中了',
color: '#e91f35'
},
{
value: 2,
label: '未猜中',
color: '#808080'
},
]

View File

@ -12,7 +12,6 @@ dayjs.locale('zh-cn');
import mpShare from 'uview-plus/libs/mixin/mpShare'
import mixin_common, { goToPage } from '@/utils/mixins/mixin_common';
import 'uno.css'
export function createApp() {
const app = createSSRApp(App);

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
<template>
<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" />
</view>
<view class="p-16 title-bar flex-1" v-if="data">

View File

@ -1,7 +1,7 @@
<template>
<view class="page-setting">
<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">
<text class="text">头像</text>
<button class="menu-item-btn" openType="chooseAvatar" @chooseavatar="handleChooseAvatar">

View File

@ -29,7 +29,7 @@
{
"path": "pages/news/news",
"style": {
"navigationBarTitleText": "推荐"
"navigationBarTitleText": "资讯"
}
},
{
@ -43,11 +43,6 @@
"style": {
"navigationBarTitleText": ""
}
},{
"path":"pages/quiz/logs",
"style": {
"navigationBarTitleText": "竞猜记录"
}
}
],
"subPackages": [
@ -135,7 +130,7 @@
"selectedIconPath": "static/icons/charts-1.png"
},
{
"text": "推荐",
"text": "资讯",
"pagePath": "pages/news/news",
"iconPath": "static/icons/earth.png",
"selectedIconPath": "static/icons/earth-1.png"

File diff suppressed because it is too large Load Diff

View File

@ -7,7 +7,7 @@
<image class="icon" src="../../static//images/error.png" />
</view>
</view>
<view class="p-base text-xs text-4e text-center ">
<view class="p-16 text-xs text-4e text-center ">
{{ props.rules }}
</view>
<view class="flex items-center">

File diff suppressed because it is too large Load Diff

View File

@ -3,8 +3,8 @@
<view class="phone-warp">
<view class="text-sm">人工客服</view>
<view style="margin-top: 10rpx">
<up-text mode="phone" call text="400-9915-666"></up-text>
</view>
<up-text mode="phone" call text="400-9915-666"></up-text>
</view>
</view>
</view>
<mescroll-body
@ -18,7 +18,7 @@
}"
>
<view class="mine-page">
<view class="p-base">
<view class="p-16">
<view class="userinfo-box">
<view class="userinfo" @click="handleClickUserInfo">
<up-avatar
@ -42,34 +42,27 @@
/>
</div>
</view>
<view class="space-y-3">
<view
v-for="(block, index) in menus"
:key="index"
class="card-shadow overflow-hidden px-30rpx"
>
<view v-for="(block, index) in menus" :key="index">
<view class="block-box bg-white rounded">
<view v-for="(item, index) in block" :key="index">
<view
class="flex text-primary items-center cell text-base"
@click="goToMenuPage(item)"
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">
<text class="text">{{ item.text }}</text>
<text class="extra" v-if="item.extra">{{ item.extra }}</text>
</view>
<image
class="w-30rpx h-30rpx opacity-50"
src="@/static/icons/arrow.svg"
/>
<image class="icon" src="@/static/icons/arrow.svg" />
</view>
<view
class="flex text-primary items-center cell text-base"
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">
<text class="text">{{ item.text }}</text>
<text class="extra" v-if="item.extra">{{ item.extra }}</text>
@ -224,21 +217,19 @@ const upCallback = (mescroll) => {
<style lang="scss">
.phone {
position: fixed;
// #ifdef MP-WEIXIN
bottom: 50rpx;
// #endif
// #ifdef H5
bottom: 180rpx;
// #endif
z-index: 9999;
z-index: 9999;
left: 0;
width: 100%;
&-warp {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
width: 100%;
&-warp{
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
}
.mr-12 {
margin-right: 12px;
}
.icon {

View File

@ -105,7 +105,9 @@ const upCallback = (mescroll) => {
</script>
<style lang="scss">
.mt-8 {
margin-top: 8px;
}
.m-title {
margin: 8px 0 10px;

View File

@ -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

View File

@ -39,7 +39,7 @@ const GlobalOption = {
textLoading: '加载中 ...', // 加载中的提示文本
textNoMore: '-- END --', // 没有更多数据的提示文本
empty: {
tip: '' // 空提示
tip: '~ 空空如也 ~' // 空提示
}
}
},

View File

@ -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,
],
})

View File

@ -1,10 +1,8 @@
import { defineConfig } from 'vite'
import uni from '@dcloudio/vite-plugin-uni'
import UnoCSS from 'unocss/vite'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
uni(),
UnoCSS()
],
})

780
yarn.lock

File diff suppressed because it is too large Load Diff