| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435 |
- <template>
- <view class="activity-detail-page">
- <u-navbar title="活动详情" :autoBack="true" :bgColor="bgColor" leftIconColor="#333"
- titleStyle="font-weight:bold;"></u-navbar>
- <image class="bg_dance" src="/static/images/enter/activity/bg_dance.png" mode=""></image>
- <view class="header-banner">
- <image src="/static/images/enter/activity/banner_dance.png" class="banner-text" mode=""></image>
- </view>
- <view class="content-container">
- <view class="action-grid u-f u-f-jsb" v-if="!joinShow">
- <view class="action-btn create" @click="handleCreate">
- <view class="btn-title">创建队伍</view>
- <image src="/static/images/enter/activity/icon_more.png" class="es-icon-32 rightIcon" mode="">
- </image>
- <image src="/static/images/enter/activity/icon_flag.png" class="bg-icon" mode=""></image>
- </view>
- <view class="action-btn join" @click="showJoinPopup = true">
- <view class="btn-title">加入队伍</view>
- <image src="/static/images/enter/activity/icon_more.png" class="es-icon-32 rightIcon" mode="">
- </image>
- <image src="/static/images/enter/activity/icon_join.png" class="bg-icon" mode=""></image>
- </view>
- </view>
- <view class="u-f-ajc u-f-jsb box es-mb-24" @tap="$navTo('/pages_enter/activity/team')" v-else>
- <view class="u-f-ajc">
- <view class="es-mr-40">
- <image :src="teamInfo.coverUrl || '/static/images/enter/activity/icon_team.png'"
- class="es-icon-88" mode="">
- </image>
- </view>
- <view class="">
- <view class="es-fs-36 es-c-22">
- {{teamInfo.title || ''}}
- </view>
- <!-- <view class="es-fs-28 es-c-55 es-mt-20" >
- 票数:123
- </view> -->
- </view>
- </view>
- <view class="">
- <image src="/static/images/enter/activity/icon_team_more.png" class="es-icon-36" mode="">
- </image>
- </view>
- </view>
- <!-- Awards Section -->
- <view class="section-box">
- <view class="section-title u-f u-f-ajc">
- <view class="line left"></view>
- <view class="dot"></view>
- <text class="title-text">活动奖品</text>
- <view class="dot"></view>
- <view class="line right"></view>
- </view>
- <view class="award-list">
- <view v-for="(item, index) in awards" :key="index" class="award-item u-f u-f-ac">
- <image :src="item.prizeUrl" class="award-img" mode="aspectFill"></image>
- <view class="award-info u-f u-f-ac">
- <view class="award-info-dot"></view>
- <view class="award-level">{{item.prizeLevel}}</view>
- <view class="award-name">{{item.prizeName}}</view>
- </view>
- </view>
- </view>
- </view>
- <!-- Rules Section -->
- <view class="section-box">
- <view class="section-title u-f u-f-ajc">
- <view class="line left"></view>
- <view class="dot"></view>
- <text class="title-text">活动规则</text>
- <view class="dot"></view>
- <view class="line right"></view>
- </view>
- <view class="rules-content" v-html="teamInfo.rules"></view>
- </view>
- </view>
- <!-- Join Team Popup -->
- <u-popup :show="showJoinPopup" mode="center" :round="40" @close="showJoinPopup = false">
- <view class="join-popup-content">
- <view class="popup-title">队伍码</view>
- <view class="input-wrap">
- <u-input v-model="joinCode" placeholder="请输入队伍码" border="none" clearable></u-input>
- </view>
- <view class="input-wrap">
- <u-input v-model="joinName" placeholder="请输入名称" border="none" clearable></u-input>
- </view>
- <view class="popup-btns u-f">
- <view class="popup-btn cancel" @click="showJoinPopup = false">取消</view>
- <view class="popup-btn confirm" @click="handleConfirmJoin">加入</view>
- </view>
- </view>
- </u-popup>
- </view>
- </template>
- <script>
- import {
- signUpUser,
- getUserTeam,
- getActivityInfo
- } from '@/api/activity.js';
- export default {
- data() {
- return {
- showJoinPopup: false,
- joinName: '',
- joinCode: '',
- teamInfo: {},
- awards: [],
- joinShow: false, //是否组队
- bgColor: 'transparent',
- }
- },
- onShow() {
- this.fetchDetail();
- },
- onPageScroll(e) {
- if (e.scrollTop > 20) {
- this.bgColor = '#ffefef'
- } else {
- this.bgColor = 'transparent'
- }
- },
- methods: {
- async fetchDetail() {
- const res = await getUserTeam({
- activityId: 1
- })
- if (res.code == 200) {
- this.joinShow = true
- }
- const result = await getActivityInfo({
- activityId: 1
- })
- if (result.code == 200) {
- this.teamInfo = result.data
- this.awards = result.data.prize || []
- } else {
- uni.showToast({
- icon: 'none',
- title: result.msg
- })
- }
- },
- handleCreate() {
- uni.navigateTo({
- url: '/pages_enter/activity/create'
- });
- },
- async handleConfirmJoin() {
- if (!this.joinCode) {
- return uni.showToast({
- title: '请输入队伍码',
- icon: 'none'
- });
- }
- if (!this.joinName) {
- return uni.showToast({
- title: '请输入名称',
- icon: 'none'
- });
- }
- uni.showLoading({
- title: '正在加入...'
- });
- const res = await signUpUser({
- activityId: 1,
- teamCode: this.joinCode,
- userName: this.joinName
- })
- if (res.code == 200) {
- uni.hideLoading();
- uni.showToast({
- title: '加入成功',
- icon: 'success'
- });
- this.joinShow = true
- this.showJoinPopup = false;
- } else {
- uni.hideLoading();
- uni.showToast({
- icon: 'none',
- title: res.msg
- })
- }
- },
- goMyTeam() {
- uni.navigateTo({
- url: '/pages_enter/activity/team'
- });
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .activity-detail-page {
- min-height: 100vh;
- background-color: #FFF2F2;
- padding-bottom: 60rpx;
- }
- .bg_dance {
- width: 100%;
- position: absolute;
- top: 0;
- left: 0;
- z-index: 0;
- height: 530rpx;
- }
- .header-banner {
- height: 400rpx;
- background: linear-gradient(180deg, #FF9B9B 0%, #FFF2F2 100%);
- display: flex;
- align-items: center;
- justify-content: center;
- padding-top: 80rpx;
- .banner-text {
- width: calc(100vw - 48rpx);
- height: 200rpx;
- }
- }
- .content-container {
- padding: 0 30rpx;
- margin-top: -40rpx;
- position: relative;
- z-index: 2;
- }
- .action-grid {
- margin-bottom: 40rpx;
- .action-btn {
- width: 334rpx;
- height: 160rpx;
- border-radius: 24rpx;
- padding: 30rpx;
- position: relative;
- overflow: hidden;
- &.create {
- background: linear-gradient(135deg, #FF8E8E, #FF6B6B);
- }
- &.join {
- background: linear-gradient(135deg, #7EB1FF, #4D91FF);
- }
- .btn-title {
- font-size: 36rpx;
- font-weight: bold;
- color: #fff;
- margin-bottom: 16rpx;
- position: relative;
- z-index: 1;
- }
- .btn-icon {
- position: relative;
- z-index: 1;
- }
- .bg-icon {
- position: absolute;
- right: 10rpx;
- bottom: 0rpx;
- width: 124rpx;
- height: 112rpx;
- opacity: 0.3;
- }
- }
- }
- .section-box {
- background-color: #fff;
- border-radius: 24rpx;
- padding: 40rpx 30rpx;
- margin-bottom: 30rpx;
- .section-title {
- margin-bottom: 40rpx;
- .line {
- width: 60rpx;
- height: 2rpx;
- background: linear-gradient(90deg, transparent, #FF7E7E);
- &.right {
- background: linear-gradient(270deg, transparent, #FF7E7E);
- }
- }
- .dot {
- width: 8rpx;
- height: 8rpx;
- background-color: #FF7E7E;
- transform: rotate(45deg);
- margin: 0 16rpx;
- }
- .title-text {
- font-size: 32rpx;
- font-weight: bold;
- color: #333;
- }
- }
- }
- .award-list {
- max-height: 500rpx;
- overflow: hidden;
- overflow-y: auto;
- .award-item {
- background-color: #FFF8F8;
- border-radius: 16rpx;
- padding: 20rpx;
- margin-bottom: 20rpx;
- .award-img {
- width: 120rpx;
- height: 120rpx;
- border-radius: 12rpx;
- margin-right: 24rpx;
- background-color: #eee;
- }
- .award-info {
- flex: 1;
- .award-info-dot {
- width: 12rpx;
- height: 12rpx;
- background: #FF3245;
- border-radius: 50%;
- margin-right: 16rpx;
- }
- }
- .award-level {
- background-color: #ffddb6;
- color: #764105;
- font-size: 22rpx;
- padding: 4rpx 16rpx;
- border-radius: 8rpx;
- margin-right: 16rpx;
- }
- .award-name {
- font-size: 28rpx;
- color: #333;
- font-weight: 500;
- }
- }
- }
- .rules-content {
- .rule-line {
- font-size: 26rpx;
- color: #666;
- line-height: 1.8;
- margin-bottom: 20rpx;
- text-align: justify;
- }
- }
- .join-popup-content {
- width: 600rpx;
- padding: 60rpx 40rpx;
- background-color: #fff;
- .popup-title {
- font-size: 36rpx;
- font-weight: bold;
- color: #333;
- text-align: center;
- margin-bottom: 40rpx;
- }
- .input-wrap {
- background-color: #f8f8f8;
- border-radius: 40rpx;
- padding: 10rpx 40rpx;
- margin-bottom: 60rpx;
- }
- .popup-btns {
- justify-content: space-between;
- .popup-btn {
- width: 240rpx;
- height: 88rpx;
- border-radius: 44rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 32rpx;
- font-weight: 500;
- &.cancel {
- border: 2rpx solid #D9D9D9;
- color: #666;
- }
- &.confirm {
- background: linear-gradient(90deg, #2583EB, #4DA1FF);
- color: #fff;
- }
- }
- }
- }
- .box {
- background: #FFFFFF;
- border-radius: 24rpx;
- padding: 32rpx 34rpx;
- .es-icon-36 {
- width: 36rpx;
- height: 36rpx;
- }
- }
- </style>
|