activityDetail.vue 32 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148
  1. <template>
  2. <view class="common_page adffc" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title="公益活动详情" bgColor="transparent"></cus-header>
  4. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/19/54b75bc8-d926-449b-95a5-1126f700b481.png" class="top_bg_img" mode="widthFix"></image>
  5. <view class="lunbo">
  6. <up-swiper
  7. :list="imgList"
  8. @change="e => current = e.current"
  9. :autoplay="true"
  10. height="440rpx"
  11. >
  12. <template #indicator>
  13. <view class="indicator adf">
  14. <view class="indicator__dot" v-for="(item, index) in imgList" :key="index"
  15. :class="[index === current && 'indicator__dot--active']">
  16. </view>
  17. </view>
  18. </template>
  19. </up-swiper>
  20. </view>
  21. <view class="box box1">
  22. <view class="box1-top">
  23. <text class="box1-top-status" :class="{'end':activityInfo?.activeState==3}">{{statusCfg[activityInfo?.activeState]||'未知'}}</text>
  24. <text class="box1-top-title">{{activityInfo?.activityName||''}}</text>
  25. </view>
  26. <view class="box1-line" style="margin-top: 36rpx;"></view>
  27. <view class="box1-place adfacjb">
  28. <view class="box1-place-left adffcjb">
  29. <text>活动地点</text>
  30. <view class="addr">{{activityInfo?.provinceName||''}}{{activityInfo?.cityName||''}}{{activityInfo?.address||''}}</view>
  31. </view>
  32. <view class="box1-place-right">
  33. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/10/239a8c29-499b-407b-a9b5-90447248d9ab.png"></image>
  34. </view>
  35. </view>
  36. <view class="box1-line" style="margin-top: 24rpx;"></view>
  37. <view class="box1-member adfacjb">
  38. <view class="box1-member-left adffc">
  39. <text>招募人数</text>
  40. <view class="num"><text>{{activityInfo?.recruitmentNow}}</text> /{{activityInfo?.recruitmentMax||'不限'}}</view>
  41. </view>
  42. <view class="box1-member-right adffc" @tap="handleReviewMembers">
  43. <view class="review adfac">
  44. <text>查看报名人员</text>
  45. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/10/b7b7531b-33fa-4ec3-841b-796be9035191.png"></image>
  46. </view>
  47. <view class="avatars">
  48. <up-avatar-group :urls="avatars" size="30" gap="0.4" :maxCount="3"></up-avatar-group>
  49. </view>
  50. </view>
  51. </view>
  52. <view class="box1-line" style="margin-top: 33rpx;"></view>
  53. <view class="box1-time adffc">
  54. <text>活动时间</text>
  55. <view class="text">{{activityInfo?.activityStartTime}} - {{activityInfo?.activityEndTime}}</view>
  56. </view>
  57. <view class="box1-line" style="margin-top: 30rpx;"></view>
  58. <view class="box1-need adffc">
  59. <text>报名要求</text>
  60. <template v-if="activityInfo?.activityLimit==1">
  61. <view class="text"><text>{{activityInfo?.valueLimit||0}}</text>爱心值</view>
  62. <view class="tip">{{activityInfo?.loveValueContent||''}}</view>
  63. </template>
  64. <template v-else-if="activityInfo?.activityLimit==2">
  65. <view class="text"><text>{{activityInfo?.valueLimit||0}}</text>张专享券</view>
  66. <view class="tip">{{activityInfo?.loveValueContent||''}}</view>
  67. </template>
  68. <template v-else-if="activityInfo?.activityLimit==3">
  69. <view class="text"><text>免费</text></view>
  70. <view class="tip"></view>
  71. </template>
  72. </view>
  73. <view class="box1-line" style="margin-top: 30rpx;"></view>
  74. <view class="box1-info adfacjb">
  75. <view class="box1-info-pre">
  76. <text>年龄限制</text>
  77. <view class="text" v-if="activityInfo?.userAgeMax">{{activityInfo?.userAgeMin}}岁 到 {{activityInfo?.userAgeMax}}岁</view>
  78. <view class="text" v-else>不限制</view>
  79. </view>
  80. <view class="box1-info-pre line">
  81. <text>可获得义工时长</text>
  82. <view class="hour"><text>{{activityInfo?.serviceHours||0}}</text> 小时</view>
  83. </view>
  84. </view>
  85. <view class="box1-line" style="margin-top: 30rpx;"></view>
  86. <view class="box1-info adfacjb">
  87. <view class="box1-info-pre">
  88. <text>联系人</text>
  89. <view class="text">{{activityInfo?.contact||''}}/{{activityInfo?.contactPhone||''}}</view>
  90. </view>
  91. <view class="box1-info-pre line">
  92. <text>公益合作</text>
  93. <view class="text">{{activityInfo?.channelName||''}}</view>
  94. </view>
  95. </view>
  96. </view>
  97. <view class="box box2">
  98. <view class="box-title">活动详情</view>
  99. <view class="box2-detail">
  100. <up-read-more :toggle="true" showHeight="374rpx" color="#989998" fontSize="24rpx" openText="收起更多信息" closeText="展开更多信息">
  101. <rich-text :nodes="activityInfo?.activityDetails||''"></rich-text>
  102. </up-read-more>
  103. </view>
  104. </view>
  105. <view class="bottom">
  106. <view class="time">
  107. 报名时间:{{activityInfo?.signupStartTime}} - {{activityInfo?.signupEndTime}}
  108. </view>
  109. <view class="btns adfacjb">
  110. <view class="left adffcacjc" @tap="showShareOptions">
  111. <up-icon name="share-square" color="#252525" size="48rpx"></up-icon>
  112. <text>分享</text>
  113. </view>
  114. <view class="right" @click="handleApply" v-if="activityInfo?.activeState==1">立即报名</view>
  115. <view class="right end" v-else-if="activityInfo?.activeState==0">活动未开始</view>
  116. <view class="right end" v-else-if="activityInfo?.activeState==3">活动已结束</view>
  117. </view>
  118. </view>
  119. <view class="fail" v-if="fail">
  120. <view class="fbox adffcac">
  121. <image class="clock" src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/10/5fe8627b-adc4-4e24-8e86-45771d3ba5a2.png"></image>
  122. <image class="close" src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/10/3d94527a-da92-4d8b-9e99-44683c4f5c84.png" @click="fail=false"></image>
  123. <image class="alert" src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/10/fdf05bfa-5593-4448-940e-437152bbbaf9.png" mode="widthFix"></image>
  124. <view class="texts adffcacjc">
  125. <view class="text">您当前{{activityLimitCfg[activityInfo?.activityLimit]}}不足,无法报名活动</view>
  126. <view class="tip">欢迎联系专属客服,了解更多公益活动,积攒{{activityLimitCfg[activityInfo?.activityLimit]}}</view>
  127. </view>
  128. <image class="down" src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/10/c7d4983d-ca93-4833-8922-e010dd1d450a.png"></image>
  129. <view class="user adfacjc">
  130. <!-- <view class="user adfac"> -->
  131. <!-- <view class="user-left">
  132. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/10/20ff1438-01a9-454c-b62c-501ed47c39a6.png"></image>
  133. </view>
  134. <view class="user-right">
  135. <view class="name">陈婧航</view>
  136. <view class="memo">@深圳善行少年基金会</view>
  137. </view> -->
  138. "善行少年"咨询微信
  139. </view>
  140. <view class="finfo adffcac">
  141. <view class="finfo-code adffcacjc">
  142. <!-- <image :src="imageUrl" @longpress="handleLongPress(imageUrl)"></image> -->
  143. <image :src="imageUrl" :show-menu-by-longpress="true"></image>
  144. </view>
  145. <view class="finfo-title">长按识别二维码</view>
  146. <view class="finfo-tip">添加您的专属公益向导</view>
  147. <view class="finfo-btn" @click="toWebView">了解善行少年</view>
  148. <view class="finfo-zblj" @click="fail=false">暂不了解</view>
  149. </view>
  150. </view>
  151. </view>
  152. <view class="share" v-if="share">
  153. <view class="sbox">
  154. <view class="sbox-title">分享给好友</view>
  155. <image class="close" src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/10/7d1c7cf4-199a-4008-8114-ee0e1a8f0cc3.png" @click="share=false"></image>
  156. <view class="sbox-items adfac">
  157. <view class="sbox-items-pre adffcac" @click="shareToFriend">
  158. <button class="share-btn" open-type="share">
  159. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/10/a993c721-a4c7-4f5e-95cc-6451a50bfdce.png"></image>
  160. <text>分享页面</text>
  161. </button>
  162. </view>
  163. <view class="sbox-items-pre adffcac" @click="generatePoster">
  164. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/10/0c87d8a1-d7c5-466c-84aa-87ec5f163955.png"></image>
  165. <text>生成海报</text>
  166. </view>
  167. <view class="sbox-items-pre adffcac" @click="shareToTimeline">
  168. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/10/732ac5fd-af58-44d8-9625-aaf96c24fed0.png"></image>
  169. <text>分享到朋友圈</text>
  170. </view>
  171. </view>
  172. </view>
  173. </view>
  174. <!-- 添加海报生成的canvas -->
  175. <canvas
  176. canvas-id="posterCanvas"
  177. :style="{width: canvasWidth + 'px', height: canvasHeight + 'px'}"
  178. style="position: fixed; top: -9999px; left: -9999px;"
  179. ></canvas>
  180. <!-- 海报预览弹窗 -->
  181. <view class="poster-preview" v-if="showPoster">
  182. <view class="poster-box">
  183. <view class="poster-header">
  184. <text>生成海报</text>
  185. <image class="close" src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/10/7d1c7cf4-199a-4008-8114-ee0e1a8f0cc3.png" @click="showPoster=false"></image>
  186. </view>
  187. <view class="poster-content">
  188. <image :src="posterUrl" mode="widthFix" class="poster-img"></image>
  189. </view>
  190. <view class="poster-actions">
  191. <button class="save-btn" @click="savePoster">保存到相册</button>
  192. <button class="share-btn" @click="sharePoster">分享给好友</button>
  193. </view>
  194. </view>
  195. </view>
  196. </view>
  197. </template>
  198. <script setup name="">
  199. import CusHeader from '@/components/CusHeader/index.vue'
  200. import { onLoad } from '@dcloudio/uni-app';
  201. import { ref, reactive, onMounted, getCurrentInstance } from 'vue'
  202. import { onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
  203. const { proxy } = getCurrentInstance()
  204. const id = ref('')
  205. const activityInfo = ref(null)
  206. const statusCfg = ref({
  207. 0:'未开始',
  208. 1:'报名中',
  209. 2:'进行中',
  210. 3:'已结束'
  211. })
  212. const activityLimitCfg = ref({
  213. 1:'爱心值',
  214. 2:'专享券',
  215. 3:'免费'
  216. })
  217. const imgList = ref([])
  218. const detail = ref('')
  219. const avatars = ref([])
  220. const fail = ref(false)
  221. const share = ref(false)
  222. const showPoster = ref(false)
  223. const posterUrl = ref('')
  224. const canvasWidth = ref(375)
  225. const canvasHeight = ref(667)
  226. const activityData = reactive({
  227. title: '《环保知识知多少》让孩子成为大自然的守护者!',
  228. time: '06.01-12:00 ~ 06.02-12:00',
  229. address: '深圳市南山区南山街道丰潭路',
  230. organizer: '锦鲤俱乐部'
  231. })
  232. const imageUrl = ref('https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/10/fbb4ac12-163e-48bd-9066-27b068078107.png')
  233. const handleReviewMembers = () => {
  234. uni.navigateTo({
  235. url:'/pagesHome/recruitsNumber?activityId='+activityInfo.value?.id+'&recruitmentMax='+activityInfo.value?.recruitmentMax+'&recruitmentMin='+activityInfo.value?.recruitmentMin
  236. })
  237. }
  238. const handleApply = async () => {
  239. let { loveValue, ticketValue } = await getUserLoveValue();
  240. // url:'/pagesHome/signSuccess'
  241. // url:'/pagesHome/fillNonprofitArchives'
  242. let url = `/pagesHome/activityApply?activity=${encodeURIComponent(JSON.stringify(activityInfo.value))}`;
  243. if((activityInfo.value?.activityLimit==1&&loveValue<activityInfo?.value.valueLimit)
  244. ||(activityInfo.value?.activityLimit==2&&ticketValue<activityInfo?.value.valueLimit)){
  245. fail.value = true;
  246. return
  247. }
  248. uni.navigateTo({ url })
  249. }
  250. const getUserLoveValue = () => {
  251. return new Promise(resolve=>{
  252. proxy.$api.get('/wx/'+JSON.parse(uni.getStorageSync('userInfo')).id).then(({data:res})=>{
  253. if(res.code!==0) return proxy.$showToast(res.msg)
  254. resolve({loveValue:res.data?.loveValue||0,ticketValue:0})
  255. })
  256. })
  257. }
  258. onShareAppMessage((res) => {
  259. const sharerId = JSON.parse(uni.getStorageSync('userInfo'))?.id;
  260. return {
  261. title: activityInfo.value?.activityName || '发现一个好物,分享给你!',
  262. path: `/pagesHome/activityDetail?shareADId=${activityInfo.value?.id}&shareUserId=${sharerId}`,
  263. imageUrl: activityInfo.value?.coverFile
  264. };
  265. })
  266. onShareTimeline((res) => {
  267. const sharerId = JSON.parse(uni.getStorageSync('userInfo'))?.id;
  268. return {
  269. title: activityInfo.value?.activityName || '发现一个好物,分享给你!',
  270. query: `shareADId=${activityInfo.value?.id}&shareUserId=${sharerId}`,
  271. imageUrl: activityInfo.value?.coverFile
  272. };
  273. })
  274. const showShareOptions = () => {
  275. share.value = true;
  276. uni.showShareMenu({
  277. withShareTicket: true,
  278. menus: ['shareAppMessage', 'shareTimeline'] // 显示分享给朋友和分享到朋友圈
  279. }).then(res => {
  280. console.log('显示分享菜单成功', res);
  281. }).catch(err => {
  282. console.error('显示分享菜单失败', err);
  283. });
  284. }
  285. // 分享到朋友圈
  286. const shareToTimeline = () => {
  287. uni.showModal({
  288. title:'温馨提示',
  289. content:'分享到朋友圈请点击页面右上方的“···”标志后选择“分享到朋友圈”进行分享'
  290. })
  291. }
  292. // 生成海报
  293. const generatePoster = async () => {
  294. share.value = false
  295. uni.showLoading({
  296. title: '正在生成海报...'
  297. })
  298. try {
  299. await createPoster()
  300. uni.hideLoading()
  301. showPoster.value = true
  302. } catch (error) {
  303. uni.hideLoading()
  304. uni.showToast({
  305. title: '海报生成失败',
  306. icon: 'none'
  307. })
  308. }
  309. }
  310. // 创建海报
  311. const createPoster = () => {
  312. return new Promise((resolve, reject) => {
  313. const ctx = uni.createCanvasContext('posterCanvas')
  314. // 设置画布尺寸
  315. const width = canvasWidth.value
  316. const height = canvasHeight.value
  317. // 绘制背景
  318. const gradient = ctx.createLinearGradient(0, 0, 0, height)
  319. gradient.addColorStop(0, '#87CEEB')
  320. gradient.addColorStop(1, '#98FB98')
  321. ctx.fillStyle = gradient
  322. ctx.fillRect(0, 0, width, height)
  323. // 加载并绘制背景图片(山峰)
  324. const bgImg = 'https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/10/5378bfeb-32f5-4325-aaef-5270e4a55a3a.png'
  325. uni.getImageInfo({
  326. src: bgImg,
  327. success: (res) => {
  328. // 绘制背景图
  329. ctx.drawImage(res.path, 0, 0, width, height * 0.6)
  330. // 绘制绿色标签
  331. ctx.fillStyle = '#B7F358'
  332. ctx.fillRect(20, 30, 120, 30)
  333. // 绘制标签文字
  334. ctx.fillStyle = '#000000'
  335. ctx.font = 'bold 14px PingFang-SC'
  336. ctx.fillText('节能低碳小妙招', 30, 50)
  337. // 绘制主标题
  338. ctx.fillStyle = '#FFFFFF'
  339. ctx.font = 'bold 24px PingFang-SC'
  340. ctx.fillText('环保知识', 50, 120)
  341. ctx.fillText('知多少', 50, 150)
  342. // 绘制白色信息区域背景
  343. ctx.fillStyle = '#FFFFFF'
  344. ctx.fillRect(20, height * 0.6 + 20, width - 40, height * 0.35)
  345. // 绘制活动信息
  346. ctx.fillStyle = '#000000'
  347. ctx.font = '16px PingFang-SC'
  348. const startY = height * 0.6 + 50
  349. // 活动标题
  350. ctx.font = 'bold 16px PingFang-SC'
  351. ctx.fillText(activityData.title.substring(0, 20), 30, startY)
  352. if (activityData.title.length > 20) {
  353. ctx.fillText(activityData.title.substring(20), 30, startY + 25)
  354. }
  355. // 时间图标和文字
  356. ctx.font = '14px PingFang-SC'
  357. ctx.fillStyle = '#666666'
  358. ctx.fillText('🕐', 30, startY + 60)
  359. ctx.fillText(activityData.time, 50, startY + 60)
  360. // 地址图标和文字
  361. ctx.fillText('📍', 30, startY + 85)
  362. ctx.fillText(activityData.address, 50, startY + 85)
  363. // 组织方
  364. ctx.fillText('👥', 30, startY + 110)
  365. ctx.fillText(activityData.organizer, 50, startY + 110)
  366. // 绘制小程序码区域
  367. ctx.fillStyle = '#F5F5F5'
  368. ctx.fillRect(width - 120, height - 140, 100, 100)
  369. ctx.fillStyle = '#000000'
  370. ctx.font = '12px PingFang-SC'
  371. ctx.fillText('微信扫一扫', width - 110, height - 25)
  372. // 执行绘制
  373. ctx.draw(false, () => {
  374. // 导出图片
  375. uni.canvasToTempFilePath({
  376. canvasId: 'posterCanvas',
  377. width: width,
  378. height: height,
  379. destWidth: width * 2,
  380. destHeight: height * 2,
  381. success: (res) => {
  382. posterUrl.value = res.tempFilePath
  383. resolve(res.tempFilePath)
  384. },
  385. fail: reject
  386. })
  387. })
  388. },
  389. fail: () => {
  390. // 如果图片加载失败,绘制纯色背景
  391. drawSimplePoster(ctx, width, height, resolve, reject)
  392. }
  393. })
  394. })
  395. }
  396. // 绘制简单海报(备用方案)
  397. const drawSimplePoster = (ctx, width, height, resolve, reject) => {
  398. // 绘制渐变背景
  399. const gradient = ctx.createLinearGradient(0, 0, 0, height)
  400. gradient.addColorStop(0, '#87CEEB')
  401. gradient.addColorStop(1, '#98FB98')
  402. ctx.fillStyle = gradient
  403. ctx.fillRect(0, 0, width, height)
  404. // 绘制白色内容区域
  405. ctx.fillStyle = '#FFFFFF'
  406. ctx.fillRect(20, 100, width - 40, height - 200)
  407. // 绘制标题
  408. ctx.fillStyle = '#000000'
  409. ctx.font = 'bold 20px PingFang-SC'
  410. ctx.fillText('公益活动邀请', width / 2 - 70, 150)
  411. // 绘制活动信息
  412. ctx.font = '16px PingFang-SC'
  413. ctx.fillText(activityData.title.substring(0, 15), 30, 200)
  414. if (activityData.title.length > 15) {
  415. ctx.fillText(activityData.title.substring(15), 30, 225)
  416. }
  417. ctx.font = '14px PingFang-SC'
  418. ctx.fillStyle = '#666666'
  419. ctx.fillText('活动时间:' + activityData.time, 30, 270)
  420. ctx.fillText('活动地点:' + activityData.address.substring(0, 12), 30, 295)
  421. ctx.draw(false, () => {
  422. uni.canvasToTempFilePath({
  423. canvasId: 'posterCanvas',
  424. width: width,
  425. height: height,
  426. destWidth: width * 2,
  427. destHeight: height * 2,
  428. success: (res) => {
  429. posterUrl.value = res.tempFilePath
  430. resolve(res.tempFilePath)
  431. },
  432. fail: reject
  433. })
  434. })
  435. }
  436. // 保存海报到相册
  437. const savePoster = () => {
  438. uni.saveImageToPhotosAlbum({
  439. filePath: posterUrl.value,
  440. success: () => {
  441. uni.showToast({
  442. title: '保存成功',
  443. icon: 'success'
  444. })
  445. showPoster.value = false
  446. },
  447. fail: (err) => {
  448. if (err.errMsg.includes('auth deny')) {
  449. uni.showModal({
  450. title: '提示',
  451. content: '需要您授权保存图片到相册',
  452. confirmText: '去设置',
  453. success: (res) => {
  454. if (res.confirm) {
  455. uni.openSetting()
  456. }
  457. }
  458. })
  459. } else {
  460. uni.showToast({
  461. title: '保存失败',
  462. icon: 'none'
  463. })
  464. }
  465. }
  466. })
  467. }
  468. // 分享海报给好友
  469. const sharePoster = () => {
  470. // 这里可以实现分享海报的逻辑
  471. uni.showToast({
  472. title: '请保存后手动分享',
  473. icon: 'none'
  474. })
  475. }
  476. const handleLongPress = (url) => {
  477. uni.previewImage({
  478. urls: [url],
  479. current: url,
  480. // 在小程序中,可以设置 longPressActions 来自定义长按菜单
  481. // 但注意:这个自定义菜单会覆盖掉“识别二维码”等原生功能
  482. // 所以我们不设置这个参数,以保留微信原生的预览页长按菜单
  483. /*
  484. longPressActions: {
  485. itemList: ['发送给朋友', '保存图片', '收藏'],
  486. success: function(data) {
  487. console.log('选中了第' + (data.tapIndex + 1) + '个按钮, 内容是' + data.item);
  488. },
  489. fail: function(err) {
  490. console.log(err.errMsg);
  491. }
  492. }
  493. */
  494. })
  495. }
  496. const toWebView = () => {
  497. uni.navigateTo({
  498. url:'/pages/webView?src=https://mp.weixin.qq.com/s/-oQlSBucYU_ifgd1j6eL3A?scene=1&click_id=2'
  499. })
  500. }
  501. const getActivityDetail = (id) => {
  502. proxy.$api.get(`/core/activity/${id}`).then(({data:res})=>{
  503. if(res.code!==0) return this.$showToast(res.msg)
  504. activityInfo.value = res.data;
  505. imgList.value = activityInfo.value?.imageFiles&&(activityInfo.value?.imageFiles.split(',')||[])
  506. for(let i=0;i<activityInfo.recruitmentNow;i++){
  507. avatars.value.push('https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/10/565ca09a-88e2-4c2c-a89e-98bd51fbea7f.png')
  508. }
  509. })
  510. }
  511. onLoad(options=>{
  512. id.value = options?.id||options?.shareADId||'';
  513. if(id.value) {
  514. getActivityDetail(id.value)
  515. }
  516. })
  517. </script>
  518. <style scoped lang="scss">
  519. .share-btn {
  520. background-color: transparent;
  521. border: none;
  522. padding: 0;
  523. margin: 0;
  524. line-height: 1;
  525. display: flex;
  526. flex-direction: column;
  527. justify-content: center;
  528. align-items: center;
  529. &::after {
  530. border: none;
  531. }
  532. }
  533. .common_page{
  534. padding-bottom: 276rpx;
  535. .lunbo{
  536. width: 100%;
  537. height: 440rpx;
  538. margin-top: 20rpx;
  539. position: relative;
  540. }
  541. .box{
  542. background: linear-gradient(45deg,#FFFFFF 70%,#F2FFE8 100%);
  543. border-radius: 24rpx;
  544. padding: 36rpx 24rpx 30rpx;
  545. margin-top: 20rpx;
  546. position: relative;
  547. &-title{
  548. width: 170rpx;
  549. height: 44rpx;
  550. padding-left: 2rpx;
  551. font-family: PingFang-SC, PingFang-SC;
  552. font-weight: 800;
  553. font-size: 36rpx;
  554. color: #151B29;
  555. line-height: 36rpx;
  556. background-image: url('https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/11/6ec1f999-fcbb-4a0b-a1a5-d0b5e1374bb1.png');
  557. background-size: 170rpx 31rpx;
  558. background-position: 0 20rpx;
  559. background-repeat: no-repeat;
  560. }
  561. }
  562. .box1{
  563. &-top{
  564. &-status{
  565. padding: 10rpx 20rpx;
  566. background: url('https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/10/46184afd-e7cd-4ffa-b32f-7390f7a1decc.png') no-repeat;
  567. background-size: 100% 100%;
  568. font-family: PingFang-SC, PingFang-SC;
  569. font-weight: bold;
  570. font-size: 24rpx;
  571. color: #151B29;
  572. line-height: 33rpx;
  573. &.end{
  574. background: linear-gradient( 270deg, #FD8A8A 0%, #FE6161 100%);
  575. border-radius: 16px 4px 16px 4px;
  576. color: #FFFFFF;
  577. }
  578. }
  579. &-title{
  580. font-family: PingFang-SC, PingFang-SC;
  581. font-weight: bold;
  582. font-size: 36rpx;
  583. color: #151B29;
  584. line-height: 54rpx;
  585. margin-left: 10rpx;
  586. }
  587. }
  588. &-line{
  589. width: 100%;
  590. height: 1rpx;
  591. background: #E7E7E7;
  592. }
  593. &-place{
  594. &-left{
  595. width: calc(100% - 228rpx);
  596. text{
  597. font-family: PingFangSC, PingFang SC;
  598. font-weight: 400;
  599. font-size: 24rpx;
  600. color: #989998;
  601. line-height: 26rpx;
  602. }
  603. .addr{
  604. width: 100%;
  605. font-family: PingFang-SC, PingFang-SC;
  606. font-weight: bold;
  607. font-size: 26rpx;
  608. color: #151B29;
  609. line-height: 26rpx;
  610. margin-top: 24rpx;
  611. }
  612. }
  613. &-right{
  614. width: 188rpx;
  615. height: 115rpx;
  616. image{
  617. width: 100%;
  618. height: 100%;
  619. }
  620. }
  621. }
  622. &-member{
  623. margin-top: 37rpx;
  624. &-left{
  625. &>text{
  626. font-family: PingFangSC, PingFang SC;
  627. font-weight: 400;
  628. font-size: 24rpx;
  629. color: #989998;
  630. line-height: 26rpx;
  631. }
  632. .num{
  633. font-family: PingFang-SC, PingFang-SC;
  634. font-weight: bold;
  635. font-size: 26rpx;
  636. color: #676775;
  637. line-height: 48rpx;
  638. margin-top: 25rpx;
  639. text{
  640. font-size: 36rpx;
  641. color: #151B29;
  642. }
  643. }
  644. }
  645. &-right{
  646. .review{
  647. text{
  648. font-family: PingFangSC, PingFang SC;
  649. font-weight: 400;
  650. font-size: 24rpx;
  651. color: #989998;
  652. line-height: 26rpx;
  653. }
  654. image{
  655. width: 28rpx;
  656. height: 28rpx;
  657. margin-left: 8rpx;
  658. }
  659. }
  660. .avatars{
  661. margin-top: 27rpx;
  662. display: flex;
  663. justify-content: flex-end;
  664. }
  665. }
  666. }
  667. &-time{
  668. margin-top: 30rpx;
  669. text{
  670. font-family: PingFangSC, PingFang SC;
  671. font-weight: 400;
  672. font-size: 24rpx;
  673. color: #989998;
  674. line-height: 26rpx;
  675. }
  676. .text{
  677. font-family: PingFang-SC, PingFang-SC;
  678. font-weight: bold;
  679. font-size: 26rpx;
  680. color: #151B29;
  681. line-height: 26rpx;
  682. margin-top: 24rpx;
  683. }
  684. }
  685. &-need{
  686. margin-top: 30rpx;
  687. &>text{
  688. font-family: PingFangSC, PingFang SC;
  689. font-weight: 400;
  690. font-size: 24rpx;
  691. color: #989998;
  692. line-height: 26rpx;
  693. }
  694. .text{
  695. margin-top: 30rpx;
  696. font-family: PingFangSC, PingFang SC;
  697. font-weight: 400;
  698. font-size: 24rpx;
  699. color: #676775;
  700. line-height: 26rpx;
  701. text{
  702. font-weight: bold;
  703. font-size: 36rpx;
  704. color: #151B29;
  705. }
  706. }
  707. .tip{
  708. font-family: PingFangSC, PingFang SC;
  709. font-weight: 400;
  710. font-size: 24rpx;
  711. color: #C9A771;
  712. line-height: 26rpx;
  713. margin-top: 20rpx;
  714. }
  715. }
  716. &-info{
  717. margin-top: 30rpx;
  718. &-pre{
  719. width: 50%;
  720. &.line{
  721. border-left: 1rpx solid #E7E7E7;
  722. padding-left: 24rpx;
  723. box-sizing: border-box;
  724. }
  725. &>text{
  726. font-family: PingFangSC, PingFang SC;
  727. font-weight: 400;
  728. font-size: 24rpx;
  729. color: #989998;
  730. line-height: 26rpx;
  731. }
  732. .text{
  733. font-family: PingFang-SC, PingFang-SC;
  734. font-weight: bold;
  735. font-size: 26rpx;
  736. color: #151B29;
  737. line-height: 26rpx;
  738. margin-top: 24rpx;
  739. }
  740. .hour{
  741. margin-top: 24rpx;
  742. font-family: PingFangSC, PingFang SC;
  743. font-weight: 400;
  744. font-size: 24rpx;
  745. color: #676775;
  746. line-height: 26rpx;
  747. text{
  748. font-weight: bold;
  749. font-size: 36rpx;
  750. color: #151B29;
  751. }
  752. }
  753. }
  754. }
  755. }
  756. .box2{
  757. &-detail{
  758. margin-top: 40rpx;
  759. }
  760. }
  761. .bottom{
  762. width: 100%;
  763. height: 256rpx;
  764. background: #FFFFFF;
  765. box-shadow: 0rpx -2rpx 8rpx 0rpx rgba(178,178,178,0.1);
  766. position: fixed;
  767. left: 0;
  768. right: 0;
  769. bottom: 0;
  770. padding: 30rpx 24rpx 0;
  771. box-sizing: border-box;
  772. .time{
  773. padding: 19rpx 24rpx 12rpx;
  774. background: #F8F8F9;
  775. border-radius: 32rpx;
  776. font-family: PingFangSC, PingFang SC;
  777. font-weight: 400;
  778. font-size: 24rpx;
  779. color: #4B545C;
  780. line-height: 33rpx;
  781. }
  782. .btns{
  783. margin-top: 24rpx;
  784. .left{
  785. margin-left: 30rpx;
  786. text{
  787. font-family: PingFangSC, PingFang SC;
  788. font-weight: 400;
  789. font-size: 26rpx;
  790. color: #151B29;
  791. line-height: 26rpx;
  792. margin-top: 17rpx;
  793. }
  794. }
  795. .right{
  796. width: 540rpx;
  797. height: 90rpx;
  798. background: #B7F358;
  799. border-radius: 45rpx;
  800. font-family: PingFang-SC, PingFang-SC;
  801. font-weight: bold;
  802. font-size: 32rpx;
  803. color: #151B29;
  804. line-height: 90rpx;
  805. text-align: center;
  806. letter-spacing: 2rpx;
  807. &.end{
  808. background: #F7F7F7;
  809. }
  810. }
  811. }
  812. }
  813. .fail{
  814. position: fixed;
  815. left: 0;
  816. right: 0;
  817. top: 0;
  818. bottom: 0;
  819. background: rgba(0,0,0,0.4);
  820. display: flex;
  821. flex-direction: column;
  822. justify-content: flex-end;
  823. .fbox{
  824. background: #FFFFFF;
  825. background-image: url('https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/10/e5ca0b95-ae33-4a93-8955-fe1d5e05ed2d.png');
  826. background-repeat: no-repeat;
  827. background-position: top left;
  828. background-size: 100% 399rpx;
  829. border-radius: 24rpx 24rpx 0 0;
  830. position: relative;
  831. padding: 40rpx 30rpx 123rpx;
  832. .clock{
  833. width: 219rpx;
  834. height: 143rpx;
  835. position: absolute;
  836. left: 51rpx;
  837. top: -37rpx;
  838. }
  839. .close{
  840. width: 40rpx;
  841. height: 40rpx;
  842. position: absolute;
  843. top: 40rpx;
  844. right: 36rpx;
  845. }
  846. .alert{
  847. width: 212rpx;
  848. }
  849. .texts{
  850. width: 100%;
  851. margin-top: 69rpx;
  852. background: #FFFFFF;
  853. border-radius: 24rpx;
  854. border: 1rpx dotted #979797;
  855. padding: 36rpx 0;
  856. .text{
  857. font-family: PingFang-SC, PingFang-SC;
  858. font-weight: bold;
  859. font-size: 36rpx;
  860. color: #252525;
  861. line-height: 36rpx;
  862. }
  863. .tip{
  864. font-family: PingFangSC, PingFang SC;
  865. font-weight: 400;
  866. font-size: 24rpx;
  867. color: #676775;
  868. line-height: 26rpx;
  869. margin-top: 24rpx;
  870. }
  871. }
  872. .down{
  873. width: 514rpx;
  874. height: 34rpx;
  875. margin-top: 20rpx;
  876. }
  877. .user{
  878. width: 100%;
  879. // margin-top: 30rpx;
  880. // padding-left: 50rpx;
  881. margin-top: 50rpx;
  882. box-sizing: border-box;
  883. font-family: PingFang-SC, PingFang-SC;
  884. font-weight: bold;
  885. font-size: 32rpx;
  886. color: #252525;
  887. line-height: 32rpx;
  888. &-left{
  889. image{
  890. width: 98rpx;
  891. height: 98rpx;
  892. }
  893. }
  894. &-right{
  895. margin-left: 20rpx;
  896. .name{
  897. font-family: PingFang-SC, PingFang-SC;
  898. font-weight: bold;
  899. font-size: 32rpx;
  900. color: #252525;
  901. line-height: 32rpx;
  902. }
  903. .memo{
  904. font-family: PingFang-SC, PingFang-SC;
  905. font-weight: bold;
  906. font-size: 24rpx;
  907. color: #05A9FE;
  908. line-height: 24rpx;
  909. margin-top: 24rpx;
  910. }
  911. }
  912. }
  913. .finfo{
  914. width: 100%;
  915. margin-top: 36rpx;
  916. &-code{
  917. width: 310rpx;
  918. height: 310rpx;
  919. background: #FFFFFF;
  920. border: 3rpx solid #C5E3FE;
  921. image{
  922. width: 244rpx;
  923. height: 244rpx;
  924. }
  925. }
  926. &-title{
  927. margin-top: 24rpx;
  928. font-size: 28rpx;
  929. color: #252525;
  930. line-height: 40rpx;
  931. }
  932. &-tip{
  933. margin-top: 10rpx;
  934. font-size: 24rpx;
  935. color: #656775;
  936. line-height: 40rpx;
  937. }
  938. &-btn{
  939. width: calc(100% - 20rpx);
  940. height: 90rpx;
  941. background: #B7F358;
  942. border-radius: 45rpx;
  943. font-family: PingFang-SC, PingFang-SC;
  944. font-weight: bold;
  945. font-size: 32rpx;
  946. color: #151B29;
  947. line-height: 90rpx;
  948. text-align: center;
  949. margin-top: 48rpx;
  950. }
  951. &-zblj{
  952. font-family: PingFangSC, PingFang SC;
  953. font-weight: 400;
  954. font-size: 28rpx;
  955. color: #989998;
  956. line-height: 40rpx;
  957. margin-top: 48rpx;
  958. padding-bottom: 5rpx;
  959. border-bottom: 1rpx solid #989998;
  960. }
  961. }
  962. }
  963. }
  964. .share{
  965. position: fixed;
  966. left: 0;
  967. right: 0;
  968. top: 0;
  969. bottom: 0;
  970. background: rgba(0,0,0,0.4);
  971. display: flex;
  972. flex-direction: column;
  973. justify-content: flex-end;
  974. .sbox{
  975. position: relative;
  976. background: #FFFFFF;
  977. border-radius: 24rpx 24rpx 0rpx 0rpx;
  978. padding: 50rpx 30rpx 148rpx;
  979. &-title{
  980. font-family: PingFang-SC, PingFang-SC;
  981. font-weight: bold;
  982. font-size: 36rpx;
  983. color: #151B29;
  984. line-height: 36rpx;
  985. text-align: center;
  986. }
  987. .close{
  988. width: 27rpx;
  989. height: 27rpx;
  990. position: absolute;
  991. top: 50rpx;
  992. right: 40rpx;
  993. }
  994. &-items{
  995. margin-top: 88rpx;
  996. &-pre{
  997. width: calc(100% / 3);
  998. image{
  999. width: 94rpx;
  1000. height: 94rpx;
  1001. }
  1002. text{
  1003. font-family: PingFangSC, PingFang SC;
  1004. font-weight: 400;
  1005. font-size: 26rpx;
  1006. color: #252525;
  1007. line-height: 26rpx;
  1008. text-align: center;
  1009. margin-top: 24rpx;
  1010. }
  1011. }
  1012. }
  1013. }
  1014. }
  1015. .poster-preview {
  1016. position: fixed;
  1017. left: 0;
  1018. right: 0;
  1019. top: 0;
  1020. bottom: 0;
  1021. background: rgba(0,0,0,0.8);
  1022. display: flex;
  1023. flex-direction: column;
  1024. justify-content: center;
  1025. align-items: center;
  1026. z-index: 9999;
  1027. .poster-box {
  1028. width: 80%;
  1029. max-width: 600rpx;
  1030. background: #FFFFFF;
  1031. border-radius: 24rpx;
  1032. overflow: hidden;
  1033. .poster-header {
  1034. display: flex;
  1035. justify-content: space-between;
  1036. align-items: center;
  1037. padding: 30rpx;
  1038. border-bottom: 1rpx solid #E7E7E7;
  1039. text {
  1040. font-family: PingFang-SC, PingFang-SC;
  1041. font-weight: bold;
  1042. font-size: 32rpx;
  1043. color: #151B29;
  1044. }
  1045. .close {
  1046. width: 40rpx;
  1047. height: 40rpx;
  1048. }
  1049. }
  1050. .poster-content {
  1051. padding: 30rpx;
  1052. display: flex;
  1053. justify-content: center;
  1054. .poster-img {
  1055. width: 100%;
  1056. border-radius: 12rpx;
  1057. }
  1058. }
  1059. .poster-actions {
  1060. display: flex;
  1061. padding: 0 30rpx 30rpx;
  1062. gap: 20rpx;
  1063. button {
  1064. flex: 1;
  1065. height: 80rpx;
  1066. border-radius: 40rpx;
  1067. border: none;
  1068. font-size: 28rpx;
  1069. font-weight: bold;
  1070. }
  1071. .save-btn {
  1072. background: #F5F5F5;
  1073. color: #151B29;
  1074. }
  1075. .share-btn {
  1076. background: #B7F358;
  1077. color: #151B29;
  1078. }
  1079. }
  1080. }
  1081. }
  1082. }
  1083. </style>