From 78685131317e9a08a05895c899ebea9970be52c8 Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期一, 09 六月 2025 11:20:31 +0800 Subject: [PATCH] Merge branch 'dev' of http://42.193.1.25:9521/r/lmk-shop-wx into dev --- pages/mine/activity/detail.vue | 318 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 318 insertions(+), 0 deletions(-) diff --git a/pages/mine/activity/detail.vue b/pages/mine/activity/detail.vue new file mode 100644 index 0000000..fb61737 --- /dev/null +++ b/pages/mine/activity/detail.vue @@ -0,0 +1,318 @@ +<template> + <view class="container"> + <!-- 椤堕儴娴锋姤鍥� --> + <!-- 鍔ㄦ�佸皝闈㈠尯鍩� --> + <view class="cover-container"> + <!-- 鍥剧墖绫诲瀷 --> + <block v-if="activityInfo.coverType === '鍥剧墖'"> + <image :src="getUrl(activityInfo.cover)" class="activity-cover" /> + </block> + <block v-if=" activityInfo.coverType === '瑙嗛'"> + <video :src="getUrl(item.cover)" + @play="handleVideoPlay" class="activity-cover"></video> + </block> + <!-- 鏂囧瓧绫诲瀷 --> + <block v-if="activityInfo.coverType === '鏂囧瓧'"> + <view class="text-cover"> + <text class="cover-text">{{ activityInfo.cover }}</text> + </view> + </block> + </view> + + <!-- 娲诲姩鍩烘湰淇℃伅 --> + <view class="info-section"> + <text class="title">{{ activityInfo.activityName }}</text> + <view class="meta-info"> + <view> + <text class="time"> + 寮�濮嬫椂闂达細{{ activityInfo.startTime }} + </text> + + </view> + <view> + <text class="time"> + 缁撴潫鏃堕棿锛歿{ activityInfo.endTime }} + </text> + </view> + <view> + <text class="location">鍦扮偣锛歿{ activityInfo.activityLocation || '鏆傛棤' }}</text> + </view> + <view> + <text class="location">鏈�澶т汉鏁帮細{{ activityInfo.limitUserNum || '鏆傛棤' }}</text> + </view> + <view> + <text class="location">娲诲姩绫诲瀷锛歿{ activityInfo.activityType || '鏆傛棤' }}</text> + </view> + </view> + <view class="tags"> + <text v-for="(tag, index) in activityInfo.tags" :key="index" class="tag">{{ tag }}</text> + </view> + </view> + + + + <!-- 娲诲姩璇︽儏鍐呭 --> + <view class="content-section"> + <rich-text :nodes="activityInfo.activityContent"></rich-text> + </view> + <!-- 鎶ュ悕鐘舵�� --> + <view class="status-bar" :style="{ backgroundColor: statusBarColor }"> + <u-button class="signup-btn" @click.stop="activityReport()" :disabled="reportBtn" >{{ reportBtn ? '宸叉姤鍚�': '绔嬪嵆鎶ュ悕'}}</u-button> + <u-button class="signup-btn" @click.stop="collect()">{{ isCollect ? '鍙栨秷鏀惰棌' : '鏀惰棌' }}</u-button> + </view> + </view> +</template> + +<script> + import UButton from '@/uview-components/uview-ui/components/u-button/u-button.vue'; + import {changeCollect} from '@/api/collect.js' + import {getFilePreviewUrl} from '@/api/common.js' + import { + getActivityDetail, + activityReport + } from '@/api/activity.js'; + export default { + components: { + UButton + }, + data() { + return { + activityInfo: { + coverType: '', + cover: '', + activityName: '', + startTime: '', // 鏃堕棿鎴� + endTime: '', + activityLocation: '', + tags: [], + activityContent: '', + activityType: '', + limitUserNum:'', + }, + isCollect:false, + reportBtn:false, + detailId: null, // 瀛樺偍鎺ユ敹鐨勫弬鏁� + reportFrom: { + activityId: '', + cancel: false, //鎶ュ悕鎺ュ彛榛樿鎴慺alse + }, + collectForm:{ + collectType:'', + refId:'', + }, + }; + }, + onLoad(options) { + // 鎺ユ敹 URL 鍙傛暟 + if (options.id) { + this.detailId = options.id; + // 鍙湪姝ゅ鍙戣捣璇锋眰锛屾牴鎹� ID 鍔犺浇璇︽儏鏁版嵁 + this.loadDetailData(); + } + }, + methods: { + collect(){ + this.collectForm.collectType = 'activity' + this.collectForm.refId = this.detailId + changeCollect(this.collectForm).then(res=>{ + if (res.statusCode === 200) { + this.isCollect = true; + uni.showToast({ + title: res.data.msg, // 鎻愮ず鏂囧瓧 + icon: 'success', // 鍥炬爣绫诲瀷锛坰uccess/loading/none锛� + mask: true // 鏄惁鏄剧ず閫忔槑钂欏眰锛堥槻姝㈣Е鎽哥┛閫忥級 + }); + } + }) + }, + //鎶ュ悕 + activityReport() { + this.reportFrom.activityId = this.detailId + activityReport(this.reportFrom).then(res => { + if (res.statusCode === 200) { + this.reportBtn = true; + uni.showToast({ + title: res.data.msg, // 鎻愮ず鏂囧瓧 + icon: 'success', // 鍥炬爣绫诲瀷锛坰uccess/loading/none锛� + mask: true // 鏄惁鏄剧ず閫忔槑钂欏眰锛堥槻姝㈣Е鎽哥┛閫忥級 + }); + } + + }) + }, + getUrl(params){ + getFilePreviewUrl(params).then(res =>{ + return res.data.data + }) + }, + getActivityDetail(id) { + uni.showLoading({ + title: '鍔犺浇涓�' + }); + getActivityDetail(id).then(res => { + uni.hideLoading(); + console.log(res.data) + if (res.statusCode === 200) { + //璧嬪�� + this.activityInfo.coverType = res.data.data.coverType; + this.activityInfo.cover = res.data.data.cover; + this.activityInfo.activityName = res.data.data.activityName; + this.activityInfo.startTime = res.data.data.startTime; + this.activityInfo.endTime = res.data.data.endTime; + this.activityInfo.activityLocation = res.data.data.activityLocation; + this.activityInfo.activityContent = '<h2>娲诲姩浠嬬粛</h2>' + '<p>' + res.data.data.activityContent + '</p>'; + this.activityInfo.activityType = res.data.data.activityType; + this.activityInfo.limitUserNum = res.data.data.limitUserNum; + this.reportBtn = res.data.data.isReport; + this.isCollect = res.data.data.isCollect; + } + }) + }, + loadDetailData() { + + //鑾峰緱璇︽儏鎺ュ彛 + this.getActivityDetail(this.detailId); + + + + } + } + }; +</script> +<style lang="scss"> + /* 灏侀潰瀹瑰櫒 */ + .cover-container { + position: relative; + width: 100%; + height: 400rpx; + overflow: hidden; + background-color: #f5f5f5; + } + + /* 鍥剧墖/瑙嗛灏侀潰鏍峰紡 */ + .activity-cover { + width: 100%; + height: 100%; + border-radius: 0; /* 涓庡垪琛ㄩ〉淇濇寔涓�鑷� */ + } + + /* 鏂囧瓧灏侀潰鏍峰紡 - 涓庡垪琛ㄩ〉淇濇寔涓�鑷� */ + .text-cover { + width: 100%; + height: 100%; + display: flex; + align-items: center; + justify-content: center; + background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%); + padding: 40rpx; + } + + .cover-text { + color: #fff; + font-size: 36rpx; + font-weight: bold; + text-align: center; + line-height: 1.4; + text-shadow: 0 2rpx 4rpx rgba(0,0,0,0.2); + } + .header-image { + width: 100%; + height: 400rpx; + } + + .info-section { + padding: 30rpx; + background: #fff; + margin-top: 20rpx; + } + + .title { + font-size: 40rpx; + font-weight: bold; + color: #333; + display: block; + margin-bottom: 20rpx; + } + + .meta-info { + margin-bottom: 20rpx; + color: #666; + } + + .time { + margin-right: 30rpx; + } + + .tags { + display: flex; + flex-wrap: wrap; + margin-top: 20rpx; + } + + .tag { + font-size: 24rpx; + padding: 8rpx 20rpx; + background: #f0f0f0; + border-radius: 30rpx; + margin-right: 15rpx; + margin-bottom: 15rpx; + } + + .status-bar { + padding: 25rpx 30rpx; + display: flex; + justify-content: space-between; + align-items: center; + color: #fff; + font-size: 28rpx; + margin: 20rpx 0; + } + + .signup-btn { + background: #fff; + color: #2196F3; + padding: 10rpx 30rpx; + border-radius: 50rpx; + font-size: 28rpx; + } + + .content-section { + padding: 30rpx; + background: #fff; + margin-top: 20rpx; + } + + .footer { + position: fixed; + bottom: 0; + left: 0; + right: 0; + height: 100rpx; + background: #fff; + display: flex; + justify-content: space-around; + align-items: center; + border-top: 1rpx solid #eee; + padding: 20rpx 0; + } + + .footer-item { + display: flex; + flex-direction: column; + align-items: center; + font-size: 24rpx; + color: #666; + } + + .footer-icon { + width: 40rpx; + height: 40rpx; + margin-bottom: 10rpx; + } + .btn-container { + display: flex; + justify-content: center; + align-items: center; + margin-top: 8px; /* 涓庝笂鏂规爣棰樹繚鎸侀棿璺� */ + } +</style> \ No newline at end of file -- Gitblit v1.8.0