activityDetail.vue 38 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223
  1. <template>
  2. <view class="common_page adffc" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <!-- Canvas组件,用于后台绘制海报,通过绝对定位移出屏幕外 -->
  4. <canvas canvas-id="posterCanvas"
  5. :style="{width: canvasWidth + 'px', height: canvasHeight + 'px', position: 'fixed', top: '-99999px', left: '0'}" />
  6. <cus-header title="公益活动详情" bgColor="transparent"></cus-header>
  7. <image src="https://oss.familydaf.cn/sxsnfile/20251218/811a8863a74d4ed9b86f68284eaff0c9.png" class="top_bg_img" mode="widthFix"></image>
  8. <view class="lunbo">
  9. <up-swiper
  10. :list="imgList"
  11. @change="e => current = e.current"
  12. :autoplay="true"
  13. :interval="2000"
  14. :duration="200"
  15. :circular="true"
  16. imgMode="scaleToFill"
  17. height="440rpx"
  18. >
  19. <template #indicator>
  20. <view class="indicator adf">
  21. <view class="indicator__dot" v-for="(item, index) in imgList" :key="index"
  22. :class="[index === current && 'indicator__dot--active']">
  23. </view>
  24. </view>
  25. </template>
  26. </up-swiper>
  27. </view>
  28. <view class="box box1">
  29. <view class="box1-top">
  30. <text class="box1-top-status" :class="{'end':activityInfo?.activeState==3}">{{statusCfg[activityInfo?.activeState]||'未知'}}</text>
  31. <text class="box1-top-title">{{activityInfo?.activityName||''}}</text>
  32. </view>
  33. <view class="box1-line" style="margin-top: 36rpx;"></view>
  34. <view class="box1-place adfacjb">
  35. <view class="box1-place-left adffcjb">
  36. <text>活动地点</text>
  37. <view class="addr">{{activityInfo?.provinceName||''}}{{activityInfo?.cityName||''}}{{activityInfo?.address||''}}</view>
  38. </view>
  39. <view class="box1-place-right">
  40. <image src="https://oss.familydaf.cn/sxsnfile/20251218/dc3034ff405549059cc52eac7479f0e0.png"></image>
  41. </view>
  42. </view>
  43. <view class="box1-line" style="margin-top: 24rpx;"></view>
  44. <view class="box1-member adfacjb">
  45. <view class="box1-member-left adffc">
  46. <text>招募人数</text>
  47. <view class="num"><text>{{activityInfo?.recruitmentNow}}</text> /{{activityInfo?.recruitmentMax||'不限'}}</view>
  48. </view>
  49. <view class="box1-member-right adffc" @tap="handleReviewMembers">
  50. <view class="review adfac">
  51. <text>查看报名人员</text>
  52. <image src="https://oss.familydaf.cn/sxsnfile/20251218/d22838b7cdae42b5a8e6ebfa01d06445.png"></image>
  53. </view>
  54. <view class="avatars">
  55. <up-avatar-group :urls="avatars" size="30" gap="0.4" :maxCount="3"></up-avatar-group>
  56. </view>
  57. </view>
  58. </view>
  59. <view class="box1-line" style="margin-top: 33rpx;"></view>
  60. <view class="box1-time adffc">
  61. <text>活动时间</text>
  62. <view class="text">{{activityInfo?.activityStartTime}} - {{activityInfo?.activityEndTime}}</view>
  63. </view>
  64. <view class="box1-line" style="margin-top: 30rpx;"></view>
  65. <view class="box1-need adffc">
  66. <text>报名要求</text>
  67. <template v-if="activityInfo?.activityLimit==1">
  68. <view class="text"><text>{{activityInfo?.valueLimit||0}}</text>爱心值</view>
  69. <view class="tip">{{activityInfo?.loveValueContent||''}}</view>
  70. </template>
  71. <template v-else-if="activityInfo?.activityLimit==2">
  72. <view class="text"><text>{{activityInfo?.valueLimit||0}}</text>张专享券</view>
  73. <view class="tip">{{activityInfo?.loveValueContent||''}}</view>
  74. </template>
  75. <template v-else-if="activityInfo?.activityLimit==3">
  76. <view class="text"><text class="mf">免费</text></view>
  77. <view class="tip"></view>
  78. </template>
  79. <div class="box1-need-level">
  80. <div class="box1-need-level-title">报名等级</div>
  81. <div class="box1-need-level-num" :class="{'bxz':!activityInfo?.userLevel}">{{activityInfo?.userLevel?('Lv'+activityInfo?.userLevel):'不限制'}}</div>
  82. </div>
  83. </view>
  84. <view class="box1-line" style="margin-top: 30rpx;"></view>
  85. <view class="box1-info adfacjb">
  86. <view class="box1-info-pre">
  87. <text>年龄限制</text>
  88. <view class="text" v-if="activityInfo?.userAgeMax">{{activityInfo?.userAgeMin}}岁 到 {{activityInfo?.userAgeMax}}岁</view>
  89. <view class="text" v-else>不限制</view>
  90. </view>
  91. <view class="box1-info-pre line">
  92. <text>可获得义工时长</text>
  93. <!-- typeId=='1977564860095348737'为义工活动,义工时长只有义工活动才有 -->
  94. <view class="hour" v-if="activityInfo?.typeId=='1977564860095348737'"><text>{{activityInfo?.serviceHours||0}}</text> 小时</view>
  95. <view class="hour" v-else>无</view>
  96. </view>
  97. </view>
  98. <view class="box1-line" style="margin-top: 30rpx;"></view>
  99. <view class="box1-info adfacjb">
  100. <view class="box1-info-pre">
  101. <text>联系人</text>
  102. <view class="text">{{activityInfo?.contact||''}}/{{activityInfo?.contactPhone||''}}</view>
  103. </view>
  104. <view class="box1-info-pre line">
  105. <text>公益合作</text>
  106. <view class="text">{{activityInfo?.channelName||''}}</view>
  107. </view>
  108. </view>
  109. </view>
  110. <view class="box box2">
  111. <view class="box-title">活动详情</view>
  112. <view class="box2-detail" v-if="activityInfo&&activityInfo.activityDetails">
  113. <up-read-more :toggle="true" showHeight="374rpx" color="#989998" fontSize="24rpx" openText="收起" closeText="展开" ref="uReadMore">
  114. <!-- <rich-text :nodes="activityInfo.activityDetails"></rich-text> -->
  115. <u-parse :content="activityInfo.activityDetails" @load="load"></u-parse>
  116. </up-read-more>
  117. </view>
  118. </view>
  119. <view class="bottom">
  120. <view class="time">
  121. 报名时间:{{activityInfo?.signupStartTime}} - {{activityInfo?.signupEndTime}}
  122. </view>
  123. <view class="btns adfacjb">
  124. <view class="left adffcacjc" @tap="showShareOptions">
  125. <up-icon name="share-square" color="#252525" size="48rpx"></up-icon>
  126. <text>分享</text>
  127. </view>
  128. <view class="right" @click="handleApply" v-if="activityInfo?.activeState==1&&activityInfo?.signupState==0">立即报名</view>
  129. <view class="right" @click="handleCancel" v-else-if="activityInfo?.activeState==1&&activityInfo?.signupState==1">取消报名</view>
  130. <view class="right" @click="handleSignup" v-else-if="activityInfo?.activeState==2&&activityInfo?.signupState==1">我要签到</view>
  131. <view class="right" @click="handleFill" v-else-if="activityInfo?.activeState==3&&activityInfo?.signupState==1">填写公益档案</view>
  132. <view class="right end" v-else-if="activityInfo?.activeState==0">活动未开始</view>
  133. <view class="right end" v-else-if="activityInfo?.activeState==1&&activityInfo?.signupState==2">活动已签到</view>
  134. <view class="right end" v-else-if="activityInfo?.activeState==2&&activityInfo?.signupState==0">活动进行中不可报名</view>
  135. <view class="right end" v-else-if="activityInfo?.activeState==3">活动已结束</view>
  136. <view class="right end" v-else-if="activityInfo?.activeState==4">已报满暂无活动名额</view>
  137. </view>
  138. </view>
  139. <view class="fail" v-if="fail">
  140. <view class="fbox adffcac">
  141. <image class="clock" src="https://oss.familydaf.cn/sxsnfile/20251218/4a47278697174d04bf54b8b691587a9c.png"></image>
  142. <image class="close" src="https://oss.familydaf.cn/sxsnfile/20251218/5e39649ad9d0433c96a491bd040413eb.png" @click="fail=false"></image>
  143. <image class="alert" src="https://oss.familydaf.cn/sxsnfile/20251218/39c584e1f7214b32aab2418272bb8678.png" mode="widthFix"></image>
  144. <view class="texts adffcacjc">
  145. <view class="text">您当前{{activityLimitCfg[activityInfo?.activityLimit]}}不足,无法报名活动</view>
  146. <view class="tip">欢迎联系专属客服,了解更多公益活动,积攒{{activityLimitCfg[activityInfo?.activityLimit]}}</view>
  147. </view>
  148. <image class="down" src="https://oss.familydaf.cn/sxsnfile/20251218/445791524423424da07755060a6d50ad.png"></image>
  149. <view class="user adfacjc">
  150. "善行少年"咨询微信
  151. </view>
  152. <view class="finfo adffcac">
  153. <view class="finfo-code adffcacjc">
  154. <image :src="imageUrl" :show-menu-by-longpress="true"></image>
  155. </view>
  156. <view class="finfo-title">长按识别二维码</view>
  157. <view class="finfo-tip">添加您的专属公益向导</view>
  158. <view class="finfo-btn" @click="toWebView">了解善行少年</view>
  159. <view class="finfo-zblj" @click="fail=false">暂不了解</view>
  160. </view>
  161. </view>
  162. </view>
  163. <view class="share" v-if="share">
  164. <view class="sbox">
  165. <view class="sbox-title">分享给好友</view>
  166. <image class="close" src="https://oss.familydaf.cn/sxsnfile/20251218/bbf9472f744741bf9fcf2a2d4c5c0f11.png" @click="share=false"></image>
  167. <view class="sbox-items adfac">
  168. <view class="sbox-items-pre adffcac">
  169. <button class="share-btn" open-type="share">
  170. <image src="https://oss.familydaf.cn/sxsnfile/20251218/9b409327172b42b5a165e1d4da631753.png"></image>
  171. <text>分享页面</text>
  172. </button>
  173. </view>
  174. <view class="sbox-items-pre adffcac" @click="generatePoster">
  175. <image src="https://oss.familydaf.cn/sxsnfile/20251218/8f7e9292eb054271a03cf5f7d63a6b25.png"></image>
  176. <text>生成海报</text>
  177. </view>
  178. <view class="sbox-items-pre adffcac" @click="shareToTimeline">
  179. <image src="https://oss.familydaf.cn/sxsnfile/20251218/b29cf7f4b77e44458c5abc01ca2ff56e.png"></image>
  180. <text>分享到朋友圈</text>
  181. </view>
  182. </view>
  183. </view>
  184. </view>
  185. <!-- 海报展示弹窗 -->
  186. <view class="posterbox adffcacjc" v-if="posterShow">
  187. <!-- 加载状态 -->
  188. <u-loading-icon v-if="posterLoading" text="海报生成中..." size="28" textSize="18" inactiveColor="#ffffff" color="#ffffff"></u-loading-icon>
  189. <!-- 海报生成后的内容 -->
  190. <template v-else>
  191. <!-- 此处不再使用HTML结构,而是直接显示生成的图片 -->
  192. <div class="posterbox-card adffcac">
  193. <image :src="posterUrl" mode="widthFix" class="poster-image"></image>
  194. </div>
  195. <div class="posterbox-menu adfacjb">
  196. <div class="posterbox-menu-pre adffcac" v-for="(item,index) in menuList" :key="index" @click="handleMenuClick(item.type)">
  197. <template v-if="index===0">
  198. <button class="share-btn" open-type="share">
  199. <image :src="item.img"></image>
  200. <text>{{item.title}}</text>
  201. </button>
  202. </template>
  203. <template v-else>
  204. <image :src="item.img"></image>
  205. <text>{{item.title}}</text>
  206. </template>
  207. </div>
  208. </div>
  209. <div class="posterbox-close adfacjc">
  210. <image src="https://oss.familydaf.cn/sxsnfile/20251218/44d55c9cb46a404d9dfc0e4ed106c69d.png" @click="posterShow=false"></image>
  211. </div>
  212. </template>
  213. </view>
  214. </view>
  215. </template>
  216. <script setup name="">
  217. import CusHeader from '@/components/CusHeader/index.vue'
  218. import { onLoad } from '@dcloudio/uni-app';
  219. import { ref, reactive, onMounted, getCurrentInstance ,nextTick } from 'vue'
  220. import { onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
  221. const { proxy } = getCurrentInstance()
  222. const id = ref('')
  223. const activityInfo = ref(null)
  224. const statusCfg = ref({
  225. 0:'未开始',
  226. 1:'报名中',
  227. 4:'报名中',
  228. 2:'进行中',
  229. 3:'已结束'
  230. })
  231. const activityLimitCfg = ref({
  232. 1:'爱心值',
  233. 2:'专享券',
  234. 3:'免费'
  235. })
  236. const imgList = ref([])
  237. const current = ref(0)
  238. const detail = ref('')
  239. const avatars = ref([])
  240. const fail = ref(false)
  241. const share = ref(false)
  242. const uReadMore = ref()
  243. // --- 海报生成相关 ---
  244. const posterShow = ref(false) // 控制海报弹窗显示
  245. const posterLoading = ref(false) // 控制海报生成时的加载状态
  246. const posterUrl = ref('') // 存储生成的海报图片临时路径
  247. const canvasWidth = ref(0) // Canvas 宽度
  248. const canvasHeight = ref(0) // Canvas 高度
  249. // 海报上所需的动态数据
  250. const posterData = reactive({
  251. mainImg: 'https://sxsn.ringzle.com/happytree-admin/profile/2025/12/12/e8218de1-d059-4197-b677-f9d2e446971e.png',
  252. title: '《环保知识知多少》让孩子成为健康公益大使',
  253. time: '06.01-12:00 ~ 06.02-12:00',
  254. timeIcon: 'https://oss.familydaf.cn/sxsnfile/20251218/762878799914422d835e505291b9d4c6.png',
  255. address: '深圳市南山区南山街道丰潭路',
  256. addressIcon: 'https://oss.familydaf.cn/sxsnfile/20251218/57539643ab974aef9401d76818e1bf3b.png',
  257. organizer: '锦鲤俱乐部',
  258. organizerIcon: 'https://oss.familydaf.cn/sxsnfile/20251218/47953738adfc46d8b959d7cead7a186e.png',
  259. qrCode: 'https://oss.familydaf.cn/sxsnfile/20251218/4eeb3cf6799141c9853349533c33e529.jpg'
  260. })
  261. const imageUrl = ref('https://oss.familydaf.cn/sxsnfile/20251218/b25745272a52435194dbc3987d5645f2.png')
  262. const menuList = ref([
  263. { img:'https://oss.familydaf.cn/sxsnfile/20251218/533e0ec5511043c6853c4a05b720dadf.png',title:'发送给朋友', type:'shareApp' },
  264. { img:'https://oss.familydaf.cn/sxsnfile/20251218/43a1bf3fc87240a2b33359f10d9d4d19.png',title:'分享到朋友圈', type:'shareTimeline' },
  265. { img:'https://oss.familydaf.cn/sxsnfile/20251218/875a7d2a8f9e47cb813246879b2b0714.png',title:'收藏', type:'favorite' },
  266. { img:'https://oss.familydaf.cn/sxsnfile/20251218/125b3da887974ae2b600ce2ec72c1fbe.png',title:'保存图片', type:'save' },
  267. ])
  268. const load = () => {
  269. nextTick(()=>{
  270. proxy.$refs.uReadMore.init();
  271. })
  272. }
  273. const handleReviewMembers = () => {
  274. uni.navigateTo({
  275. url:'/pagesHome/recruitsNumber?activityId='+activityInfo.value?.id+'&recruitmentMax='+activityInfo.value?.recruitmentMax+'&recruitmentMin='+activityInfo.value?.recruitmentMin
  276. })
  277. }
  278. //立即报名
  279. const handleApply = async () => {
  280. let { loveValue, couponIds } = await getUserLoveTicket();
  281. let url = `/pagesHome/activityApply?activity=${encodeURIComponent(JSON.stringify(activityInfo.value))}`;
  282. if((activityInfo.value?.activityLimit==1&&loveValue<activityInfo?.value.valueLimit)
  283. ||(activityInfo.value?.activityLimit==2&&couponIds?.length<activityInfo?.value.valueLimit)){
  284. fail.value = true;
  285. return
  286. }
  287. uni.navigateTo({ url })
  288. }
  289. //取消报名
  290. const handleCancel = () => {
  291. uni.reLaunch({
  292. url:'/pages/nonprofit?type=1'
  293. })
  294. }
  295. //我要签到
  296. const handleSignup = () => {
  297. uni.reLaunch({
  298. url:'/pages/nonprofit?type=2'
  299. })
  300. }
  301. //填写公益档案
  302. const handleFill = () => {
  303. uni.reLaunch({
  304. url:'/pages/nonprofit?type=3'
  305. })
  306. }
  307. const getUserLoveTicket = () => {
  308. return new Promise(resolve=>{
  309. let userId = JSON.parse(uni.getStorageSync('userInfo'))?.id;
  310. proxy.$api.get(`/core/activity/signup/userAsset/${userId}/${activityInfo.value?.id}`).then(({data:res})=>{
  311. if(res.code!==0) return proxy.$showToast(res.msg)
  312. resolve({loveValue:res.data?.loveValue||0,couponIds:res.data?.couponIds||0})
  313. })
  314. })
  315. }
  316. onShareAppMessage((res) => {
  317. // 如果是点击海报菜单的“发送给朋友”按钮
  318. if (res.from === 'button' && res.target.id === 'posterShareBtn') {
  319. return {
  320. title: posterData.title,
  321. path: `/pagesHome/activityDetail?shareADId=${id.value}`,
  322. imageUrl: posterUrl.value // 使用生成的海报作为分享图
  323. };
  324. }
  325. // 默认页面右上角分享
  326. const sharerId = JSON.parse(uni.getStorageSync('userInfo'))?.id;
  327. return {
  328. title: activityInfo.value?.activityName || '发现一个好物,分享给你!',
  329. path: `/pagesHome/activityDetail?shareADId=${activityInfo.value?.id}&shareUserId=${sharerId}`,
  330. imageUrl: activityInfo.value?.coverFile
  331. };
  332. })
  333. onShareTimeline((res) => {
  334. const sharerId = JSON.parse(uni.getStorageSync('userInfo'))?.id;
  335. return {
  336. title: activityInfo.value?.activityName || '发现一个好物,分享给你!',
  337. query: `shareADId=${activityInfo.value?.id}&shareUserId=${sharerId}`,
  338. imageUrl: activityInfo.value?.coverFile
  339. };
  340. })
  341. const showShareOptions = () => {
  342. share.value = true;
  343. }
  344. // 分享到朋友圈(旧逻辑)
  345. const shareToTimeline = () => {
  346. uni.showModal({
  347. title:'温馨提示',
  348. content:'分享到朋友圈请点击页面右上方的“···”标志后选择“分享到朋友圈”进行分享'
  349. })
  350. }
  351. // --- Canvas海报生成核心逻辑 ---
  352. // 1. 触发生成
  353. const generatePoster = async () => {
  354. share.value = false;
  355. posterShow.value = true;
  356. posterLoading.value = true;
  357. posterUrl.value = ''; // 清空旧海报
  358. try {
  359. // 获取设备信息,用于rpx转px
  360. const systemInfo = uni.getSystemInfoSync();
  361. const screenWidth = systemInfo.screenWidth;
  362. const rpxRatio = screenWidth / 750;
  363. // --- 定义尺寸和坐标 (单位: px) ---
  364. // 卡片总宽度为 100% - 220rpx
  365. const cardWidth = screenWidth - 220 * rpxRatio;
  366. const cardPadding = 20 * rpxRatio;
  367. const contentWidth = cardWidth - cardPadding * 2;
  368. const mainImgHeight = 368 * rpxRatio;
  369. const infoTopMargin = 14 * rpxRatio;
  370. const qrCodeWidth = 123 * rpxRatio;
  371. const qrCodeHeight = 123 * rpxRatio;
  372. const rightPartWidth = 163 * rpxRatio;
  373. const leftPartWidth = contentWidth - rightPartWidth;
  374. // 计算总高度
  375. const titleHeight = calculateWrappedTextHeight(posterData.title, 24 * rpxRatio, contentWidth, 36 * rpxRatio);
  376. const infoBlockHeight = 160 * rpxRatio; // 估算下方信息区域高度
  377. const cardHeight = cardPadding * 2 + mainImgHeight + infoTopMargin + infoBlockHeight;
  378. canvasWidth.value = cardWidth;
  379. canvasHeight.value = cardHeight;
  380. // 等待一帧,确保canvas尺寸设置生效
  381. await new Promise(resolve => setTimeout(resolve, 50));
  382. const ctx = uni.createCanvasContext('posterCanvas', proxy);
  383. // --- 下载所有需要的图片 ---
  384. const [mainImg, timeIcon, addressIcon, orgIcon, qrCode] = await Promise.all([
  385. uni.getImageInfo({ src: posterData.mainImg }),
  386. uni.getImageInfo({ src: posterData.timeIcon }),
  387. uni.getImageInfo({ src: posterData.addressIcon }),
  388. uni.getImageInfo({ src: posterData.organizerIcon }),
  389. uni.getImageInfo({ src: posterData.qrCode }),
  390. ]);
  391. // --- 开始绘制 ---
  392. // 1. 绘制白色背景
  393. ctx.fillStyle = '#FFFFFF';
  394. ctx.fillRect(0, 0, cardWidth, cardHeight);
  395. // 2. 绘制主图 (带圆角)
  396. ctx.save(); // 保存当前画布状态
  397. const borderRadius = 16 * rpxRatio; // 16rpx
  398. // 创建圆角矩形路径
  399. ctx.beginPath();
  400. ctx.moveTo(cardPadding + borderRadius, cardPadding);
  401. ctx.lineTo(cardPadding + contentWidth - borderRadius, cardPadding);
  402. ctx.arcTo(cardPadding + contentWidth, cardPadding, cardPadding + contentWidth, cardPadding + borderRadius, borderRadius);
  403. ctx.lineTo(cardPadding + contentWidth, cardPadding + mainImgHeight - borderRadius);
  404. ctx.arcTo(cardPadding + contentWidth, cardPadding + mainImgHeight, cardPadding + contentWidth - borderRadius, cardPadding + mainImgHeight, borderRadius);
  405. ctx.lineTo(cardPadding + borderRadius, cardPadding + mainImgHeight);
  406. ctx.arcTo(cardPadding, cardPadding + mainImgHeight, cardPadding, cardPadding + mainImgHeight - borderRadius, borderRadius);
  407. ctx.lineTo(cardPadding, cardPadding + borderRadius);
  408. ctx.arcTo(cardPadding, cardPadding, cardPadding + borderRadius, cardPadding, borderRadius);
  409. ctx.closePath();
  410. ctx.clip(); // 裁剪后续绘图到此路径
  411. ctx.drawImage(mainImg.path, cardPadding, cardPadding, contentWidth, mainImgHeight);
  412. ctx.restore(); // 恢复画布状态 (移除裁剪路径)
  413. let currentY = cardPadding + mainImgHeight + infoTopMargin;
  414. // 3. 绘制左侧信息
  415. const leftX = cardPadding;
  416. // 3.1 绘制标题 (自动换行)
  417. ctx.font = `bold ${Math.round(24 * rpxRatio)}px "PingFang-SC", sans-serif`;
  418. ctx.fillStyle = '#252525';
  419. currentY += drawWrappedText(ctx, posterData.title, leftX, currentY + 24 * rpxRatio, leftPartWidth, 36 * rpxRatio, 1);
  420. currentY += 12 * rpxRatio; // 标题和下方内容的间距
  421. // 3.2 绘制时间
  422. const iconSize = 24 * rpxRatio;
  423. const textLeftMargin = 10 * rpxRatio;
  424. const infoLineHeight = 36 * rpxRatio;
  425. ctx.drawImage(timeIcon.path, leftX, currentY + (infoLineHeight - iconSize) / 2, iconSize, iconSize);
  426. ctx.font = `bold ${Math.round(20 * rpxRatio)}px "PingFang-SC", sans-serif`;
  427. ctx.fillStyle = '#8B8B8B';
  428. ctx.fillText(posterData.time, leftX + iconSize + textLeftMargin, currentY + 25 * rpxRatio);
  429. currentY += infoLineHeight;
  430. // 3.3 绘制地点
  431. ctx.drawImage(addressIcon.path, leftX, currentY + (infoLineHeight - iconSize) / 2, iconSize, iconSize);
  432. ctx.fillText(posterData.address, leftX + iconSize + textLeftMargin, currentY + 25 * rpxRatio);
  433. currentY += infoLineHeight;
  434. // 3.4 绘制俱乐部
  435. const orgIconSize = 30 * rpxRatio;
  436. ctx.drawImage(orgIcon.path, leftX, currentY + (infoLineHeight - orgIconSize) / 2, orgIconSize, orgIconSize);
  437. ctx.fillText(posterData.organizer, leftX + orgIconSize + textLeftMargin, currentY + 25 * rpxRatio);
  438. // 4. 绘制右侧二维码
  439. const rightX = cardPadding + leftPartWidth;
  440. const qrY = cardPadding + mainImgHeight + infoTopMargin;
  441. ctx.drawImage(qrCode.path, rightX + (rightPartWidth - qrCodeWidth) / 2, qrY, qrCodeWidth, qrCodeHeight);
  442. // 4.1 绘制二维码下方文字
  443. ctx.textAlign = 'center';
  444. ctx.font = `bold ${Math.round(20 * rpxRatio)}px "PingFang-SC", sans-serif`;
  445. ctx.fillStyle = '#8B8B8B';
  446. ctx.fillText('微信扫一扫', rightX + rightPartWidth / 2, qrY + qrCodeHeight + 30 * rpxRatio);
  447. ctx.textAlign = 'left'; // 恢复默认
  448. // --- 生成图片 ---
  449. ctx.draw(false, () => {
  450. uni.canvasToTempFilePath({
  451. canvasId: 'posterCanvas',
  452. success: (res) => {
  453. posterUrl.value = res.tempFilePath;
  454. posterLoading.value = false;
  455. },
  456. fail: (err) => {
  457. console.error('canvasToTempFilePath failed:', err);
  458. proxy.$showToast('海报生成失败,请稍后再试');
  459. posterLoading.value = false;
  460. posterShow.value = false;
  461. }
  462. }, proxy);
  463. });
  464. } catch (error) {
  465. console.error('generatePoster failed:', error);
  466. proxy.$showToast('图片资源加载失败,无法生成海报');
  467. posterLoading.value = false;
  468. posterShow.value = false;
  469. }
  470. }
  471. // Canvas 文本换行绘制函数
  472. // ctx: canvas context, text: 文本, x,y: 起始坐标, maxWidth: 最大宽度, lineHeight: 行高, maxLines: 最大行数
  473. function drawWrappedText(ctx, text, x, y, maxWidth, lineHeight, maxLines = 2) {
  474. let lines = [];
  475. let currentLine = '';
  476. let totalHeight = 0;
  477. for (let i = 0; i < text.length; i++) {
  478. let char = text[i];
  479. let testLine = currentLine + char;
  480. let metrics = ctx.measureText(testLine);
  481. let testWidth = metrics.width;
  482. if (testWidth > maxWidth && i > 0) {
  483. lines.push(currentLine);
  484. currentLine = char;
  485. } else {
  486. currentLine = testLine;
  487. }
  488. }
  489. lines.push(currentLine);
  490. if (lines.length > maxLines) {
  491. lines = lines.slice(0, maxLines);
  492. lines[maxLines - 1] += '...';
  493. }
  494. for (let j = 0; j < lines.length; j++) {
  495. ctx.fillText(lines[j], x, y + j * lineHeight);
  496. totalHeight += lineHeight;
  497. }
  498. return totalHeight;
  499. }
  500. // 辅助函数,用于估算换行后的文本高度
  501. function calculateWrappedTextHeight(text, fontSize, maxWidth, lineHeight) {
  502. // 这是一个简化的估算,实际应使用canvas.measureText
  503. const charsPerLine = Math.floor(maxWidth / (fontSize * 1.1));
  504. const lines = Math.ceil(text.length / charsPerLine);
  505. return lines * lineHeight;
  506. }
  507. // --- 海报下方菜单点击事件 ---
  508. const handleMenuClick = (type) => {
  509. switch(type) {
  510. case 'shareApp':
  511. break;
  512. case 'shareTimeline':
  513. // 同上,提示用户
  514. uni.showToast({ title: '请点击右上角“···”分享到朋友圈', icon: 'none' });
  515. break;
  516. case 'favorite':
  517. uni.showModal({
  518. title: '收藏提示',
  519. content: "请点击右上角 '...' 按钮,然后选择 '添加到我的小程序' 或 '收藏',即可方便下次访问哦!",
  520. showCancel: false, // 通常只保留一个“我知道了”按钮
  521. confirmText: '我知道了'
  522. });
  523. break;
  524. case 'save':
  525. // 保存图片到相册
  526. savePosterToAlbum();
  527. break;
  528. }
  529. }
  530. // 保存海报到相册
  531. const savePosterToAlbum = () => {
  532. if (!posterUrl.value) {
  533. proxy.$showToast('海报图片不存在');
  534. return;
  535. }
  536. uni.saveImageToPhotosAlbum({
  537. filePath: posterUrl.value,
  538. success: () => {
  539. proxy.$showToast('海报已保存到相册');
  540. },
  541. fail: (err) => {
  542. if (err.errMsg.includes('auth deny') || err.errMsg.includes('auth denied')) {
  543. uni.showModal({
  544. title: '授权提示',
  545. content: '需要您授权保存图片到相册',
  546. showCancel: false,
  547. success: () => {
  548. uni.openSetting(); //引导用户去设置页
  549. }
  550. })
  551. } else {
  552. proxy.$showToast('保存失败,请稍后再试');
  553. }
  554. }
  555. })
  556. }
  557. const toWebView = () => {
  558. uni.navigateTo({
  559. url:'/pages/webView?src=https://mp.weixin.qq.com/s/-oQlSBucYU_ifgd1j6eL3A?scene=1&click_id=2'
  560. })
  561. }
  562. const getActivityDetail = (id) => {
  563. proxy.$api.get(`/core/activity/${id}`).then(({data:res})=>{
  564. if(res.code!==0) return proxy.$showToast(res.msg)
  565. activityInfo.value = res.data;
  566. // 更新海报数据
  567. posterData.title = activityInfo.value?.activityName || posterData.title;
  568. posterData.time = `${new Date(activityInfo.value?.activityStartTime).Format('MM.dd-hh:mm') } ~ ${new Date(activityInfo.value?.activityEndTime).Format('MM.dd-hh:mm')}` || posterData.time;
  569. posterData.address = `${activityInfo.value?.provinceName||''}${activityInfo.value?.cityName||''}${activityInfo.value?.address||''}` || posterData.address;
  570. posterData.organizer = activityInfo.value?.channelName || posterData.organizer;
  571. if(activityInfo.value?.coverFile) posterData.mainImg = activityInfo.value?.coverFile;
  572. if(activityInfo.value.signupState==0
  573. &&activityInfo.value.activeState===1
  574. &&activityInfo.value.recruitmentNow==(activityInfo.value.recruitmentMax||99999)){
  575. activityInfo.value.activeState = 4;//已报满暂无活动名额
  576. }
  577. imgList.value = activityInfo.value?.imageFiles&&(activityInfo.value?.imageFiles.split(',')||[])
  578. for(let i=0;i<activityInfo.value.recruitmentNow;i++){
  579. avatars.value.push('https://oss.familydaf.cn/sxsnfile/20251218/3821654e080945998d464f3c3aa64122.png')
  580. }
  581. })
  582. }
  583. onLoad(options=>{
  584. id.value = options?.id||options?.shareADId||'';
  585. if(id.value) {
  586. getActivityDetail(id.value)
  587. }
  588. })
  589. </script>
  590. <style scoped lang="scss">
  591. ::v-deep .indicator__dot{
  592. width: 48rpx;
  593. height: 4rpx;
  594. background: #E2E5E9;
  595. border-radius: 2rpx;
  596. margin: 0 8rpx;
  597. }
  598. ::v-deep .indicator__dot--active{
  599. width: 48rpx;
  600. height: 4rpx;
  601. background: #00AE57;
  602. border-radius: 2rpx;
  603. }
  604. ::v-deep .u-swiper__wrapper__item__wrapper__image{
  605. border-radius: 24rpx !important;
  606. }
  607. /* 按钮分享样式 */
  608. .share-btn {
  609. background-color: transparent;
  610. border: none;
  611. padding: 0;
  612. margin: 0;
  613. line-height: 1;
  614. display: flex;
  615. flex-direction: column;
  616. justify-content: center;
  617. align-items: center;
  618. &::after {
  619. border: none;
  620. }
  621. }
  622. .common_page{
  623. padding-bottom: 276rpx;
  624. .lunbo{
  625. width: 100%;
  626. height: 440rpx;
  627. margin-top: 20rpx;
  628. position: relative;
  629. }
  630. .box{
  631. background: linear-gradient(45deg,#FFFFFF 70%,#F2FFE8 100%);
  632. border-radius: 24rpx;
  633. padding: 36rpx 24rpx 30rpx;
  634. margin-top: 20rpx;
  635. position: relative;
  636. &-title{
  637. width: 170rpx;
  638. height: 44rpx;
  639. padding-left: 2rpx;
  640. font-family: PingFang-SC, PingFang-SC;
  641. font-weight: 800;
  642. font-size: 36rpx;
  643. color: #151B29;
  644. line-height: 36rpx;
  645. background-image: url('https://oss.familydaf.cn/sxsnfile/20251218/6198fa26a7ff4fc1bce530fbdfaa20db.png');
  646. background-size: 170rpx 31rpx;
  647. background-position: 0 20rpx;
  648. background-repeat: no-repeat;
  649. }
  650. }
  651. .box1{
  652. &-top{
  653. &-status{
  654. padding: 10rpx 20rpx;
  655. background: url('https://oss.familydaf.cn/sxsnfile/20251218/5b591d1c173943dca6e33f950714e5e2.png') no-repeat;
  656. background-size: 100% 100%;
  657. font-family: PingFang-SC, PingFang-SC;
  658. font-weight: bold;
  659. font-size: 24rpx;
  660. color: #151B29;
  661. line-height: 33rpx;
  662. &.end{
  663. background: linear-gradient( 270deg, #FD8A8A 0%, #FE6161 100%);
  664. border-radius: 16px 4px 16px 4px;
  665. color: #FFFFFF;
  666. }
  667. }
  668. &-title{
  669. font-family: PingFang-SC, PingFang-SC;
  670. font-weight: bold;
  671. font-size: 36rpx;
  672. color: #151B29;
  673. line-height: 54rpx;
  674. margin-left: 10rpx;
  675. }
  676. }
  677. &-line{
  678. width: 100%;
  679. height: 1rpx;
  680. background: #E7E7E7;
  681. }
  682. &-place{
  683. &-left{
  684. width: calc(100% - 228rpx);
  685. text{
  686. font-family: PingFangSC, PingFang SC;
  687. font-weight: 400;
  688. font-size: 24rpx;
  689. color: #989998;
  690. line-height: 26rpx;
  691. }
  692. .addr{
  693. width: 100%;
  694. font-family: PingFang-SC, PingFang-SC;
  695. font-weight: bold;
  696. font-size: 26rpx;
  697. color: #151B29;
  698. line-height: 26rpx;
  699. margin-top: 24rpx;
  700. }
  701. }
  702. &-right{
  703. width: 188rpx;
  704. height: 115rpx;
  705. image{
  706. width: 100%;
  707. height: 100%;
  708. }
  709. }
  710. }
  711. &-member{
  712. margin-top: 37rpx;
  713. &-left{
  714. &>text{
  715. font-family: PingFangSC, PingFang SC;
  716. font-weight: 400;
  717. font-size: 24rpx;
  718. color: #989998;
  719. line-height: 26rpx;
  720. }
  721. .num{
  722. font-family: PingFang-SC, PingFang-SC;
  723. font-weight: bold;
  724. font-size: 26rpx;
  725. color: #676775;
  726. line-height: 48rpx;
  727. margin-top: 25rpx;
  728. text{
  729. font-size: 36rpx;
  730. color: #151B29;
  731. }
  732. }
  733. }
  734. &-right{
  735. .review{
  736. text{
  737. font-family: PingFangSC, PingFang SC;
  738. font-weight: 400;
  739. font-size: 24rpx;
  740. color: #989998;
  741. line-height: 26rpx;
  742. }
  743. image{
  744. width: 28rpx;
  745. height: 28rpx;
  746. margin-left: 8rpx;
  747. }
  748. }
  749. .avatars{
  750. margin-top: 27rpx;
  751. display: flex;
  752. justify-content: flex-end;
  753. }
  754. }
  755. }
  756. &-time{
  757. margin-top: 30rpx;
  758. text{
  759. font-family: PingFangSC, PingFang SC;
  760. font-weight: 400;
  761. font-size: 24rpx;
  762. color: #989998;
  763. line-height: 26rpx;
  764. }
  765. .text{
  766. font-family: PingFang-SC, PingFang-SC;
  767. font-weight: bold;
  768. font-size: 26rpx;
  769. color: #151B29;
  770. line-height: 26rpx;
  771. margin-top: 24rpx;
  772. }
  773. }
  774. &-need{
  775. margin-top: 30rpx;
  776. position: relative;
  777. &>text{
  778. font-family: PingFangSC, PingFang SC;
  779. font-weight: 400;
  780. font-size: 24rpx;
  781. color: #989998;
  782. line-height: 26rpx;
  783. }
  784. .text{
  785. margin-top: 30rpx;
  786. font-family: PingFangSC, PingFang SC;
  787. font-weight: 400;
  788. font-size: 24rpx;
  789. color: #676775;
  790. line-height: 26rpx;
  791. text{
  792. font-weight: bold;
  793. font-size: 36rpx;
  794. color: #151B29;
  795. &.mf{
  796. font-size: 26rpx;
  797. }
  798. }
  799. }
  800. .tip{
  801. font-family: PingFangSC, PingFang SC;
  802. font-weight: 400;
  803. font-size: 24rpx;
  804. color: #C9A771;
  805. line-height: 26rpx;
  806. margin-top: 20rpx;
  807. }
  808. &-level{
  809. position: absolute;
  810. left: 50%;
  811. padding-left: 25rpx;
  812. &-title{
  813. font-family: PingFangSC, PingFang SC;
  814. font-weight: 400;
  815. font-size: 24rpx;
  816. color: #989998;
  817. line-height: 26rpx;
  818. }
  819. &-num{
  820. margin-top: 30rpx;
  821. font-family: PingFangSC, PingFang SC;
  822. font-weight: bold;
  823. font-size: 36rpx;
  824. color: #151B29;
  825. line-height: 26rpx;
  826. &.bxz{
  827. font-size: 26rpx;
  828. }
  829. }
  830. }
  831. }
  832. &-info{
  833. margin-top: 30rpx;
  834. &-pre{
  835. width: 50%;
  836. &.line{
  837. border-left: 1rpx solid #E7E7E7;
  838. padding-left: 24rpx;
  839. box-sizing: border-box;
  840. }
  841. &>text{
  842. font-family: PingFangSC, PingFang SC;
  843. font-weight: 400;
  844. font-size: 24rpx;
  845. color: #989998;
  846. line-height: 26rpx;
  847. }
  848. .text{
  849. font-family: PingFang-SC, PingFang-SC;
  850. font-weight: bold;
  851. font-size: 26rpx;
  852. color: #151B29;
  853. line-height: 26rpx;
  854. margin-top: 24rpx;
  855. }
  856. .hour{
  857. margin-top: 24rpx;
  858. font-family: PingFangSC, PingFang SC;
  859. font-weight: 400;
  860. font-size: 24rpx;
  861. color: #676775;
  862. line-height: 26rpx;
  863. text{
  864. font-weight: bold;
  865. font-size: 36rpx;
  866. color: #151B29;
  867. }
  868. }
  869. }
  870. }
  871. }
  872. .box2{
  873. &-detail{
  874. margin-top: 40rpx;
  875. }
  876. }
  877. .bottom{
  878. width: 100%;
  879. height: 256rpx;
  880. background: #FFFFFF;
  881. box-shadow: 0rpx -2rpx 8rpx 0rpx rgba(178,178,178,0.1);
  882. position: fixed;
  883. left: 0;
  884. right: 0;
  885. bottom: 0;
  886. padding: 30rpx 24rpx 0;
  887. box-sizing: border-box;
  888. .time{
  889. padding: 19rpx 24rpx 12rpx;
  890. background: #F8F8F9;
  891. border-radius: 32rpx;
  892. font-family: PingFangSC, PingFang SC;
  893. font-weight: 400;
  894. font-size: 24rpx;
  895. color: #4B545C;
  896. line-height: 33rpx;
  897. }
  898. .btns{
  899. margin-top: 24rpx;
  900. .left{
  901. margin-left: 30rpx;
  902. text{
  903. font-family: PingFangSC, PingFang SC;
  904. font-weight: 400;
  905. font-size: 26rpx;
  906. color: #151B29;
  907. line-height: 26rpx;
  908. margin-top: 17rpx;
  909. }
  910. }
  911. .right{
  912. width: 540rpx;
  913. height: 90rpx;
  914. background: #B7F358;
  915. border-radius: 45rpx;
  916. font-family: PingFang-SC, PingFang-SC;
  917. font-weight: bold;
  918. font-size: 32rpx;
  919. color: #151B29;
  920. line-height: 90rpx;
  921. text-align: center;
  922. letter-spacing: 2rpx;
  923. &.end{
  924. background: #F7F7F7;
  925. }
  926. }
  927. }
  928. }
  929. .fail{
  930. position: fixed;
  931. left: 0;
  932. right: 0;
  933. top: 0;
  934. bottom: 0;
  935. background: rgba(0,0,0,0.4);
  936. display: flex;
  937. flex-direction: column;
  938. justify-content: flex-end;
  939. .fbox{
  940. background: #FFFFFF;
  941. background-image: url('https://oss.familydaf.cn/sxsnfile/20251218/f168e863e60b423588821f8aa0388e27.png');
  942. background-repeat: no-repeat;
  943. background-position: top left;
  944. background-size: 100% 399rpx;
  945. border-radius: 24rpx 24rpx 0 0;
  946. position: relative;
  947. padding: 40rpx 30rpx 123rpx;
  948. .clock{
  949. width: 219rpx;
  950. height: 143rpx;
  951. position: absolute;
  952. left: 51rpx;
  953. top: -37rpx;
  954. }
  955. .close{
  956. width: 40rpx;
  957. height: 40rpx;
  958. position: absolute;
  959. top: 40rpx;
  960. right: 36rpx;
  961. }
  962. .alert{
  963. width: 212rpx;
  964. }
  965. .texts{
  966. width: 100%;
  967. margin-top: 69rpx;
  968. background: #FFFFFF;
  969. border-radius: 24rpx;
  970. border: 1rpx dotted #979797;
  971. padding: 36rpx 0;
  972. .text{
  973. font-family: PingFang-SC, PingFang-SC;
  974. font-weight: bold;
  975. font-size: 36rpx;
  976. color: #252525;
  977. line-height: 36rpx;
  978. }
  979. .tip{
  980. font-family: PingFangSC, PingFang SC;
  981. font-weight: 400;
  982. font-size: 24rpx;
  983. color: #676775;
  984. line-height: 26rpx;
  985. margin-top: 24rpx;
  986. }
  987. }
  988. .down{
  989. width: 514rpx;
  990. height: 34rpx;
  991. margin-top: 20rpx;
  992. }
  993. .user{
  994. width: 100%;
  995. margin-top: 50rpx;
  996. box-sizing: border-box;
  997. font-family: PingFang-SC, PingFang-SC;
  998. font-weight: bold;
  999. font-size: 32rpx;
  1000. color: #252525;
  1001. line-height: 32rpx;
  1002. }
  1003. .finfo{
  1004. width: 100%;
  1005. margin-top: 36rpx;
  1006. &-code{
  1007. width: 310rpx;
  1008. height: 310rpx;
  1009. background: #FFFFFF;
  1010. border: 3rpx solid #C5E3FE;
  1011. image{
  1012. width: 244rpx;
  1013. height: 244rpx;
  1014. }
  1015. }
  1016. &-title{
  1017. margin-top: 24rpx;
  1018. font-size: 28rpx;
  1019. color: #252525;
  1020. line-height: 40rpx;
  1021. }
  1022. &-tip{
  1023. margin-top: 10rpx;
  1024. font-size: 24rpx;
  1025. color: #656775;
  1026. line-height: 40rpx;
  1027. }
  1028. &-btn{
  1029. width: calc(100% - 20rpx);
  1030. height: 90rpx;
  1031. background: #B7F358;
  1032. border-radius: 45rpx;
  1033. font-family: PingFang-SC, PingFang-SC;
  1034. font-weight: bold;
  1035. font-size: 32rpx;
  1036. color: #151B29;
  1037. line-height: 90rpx;
  1038. text-align: center;
  1039. margin-top: 48rpx;
  1040. }
  1041. &-zblj{
  1042. font-family: PingFangSC, PingFang SC;
  1043. font-weight: 400;
  1044. font-size: 28rpx;
  1045. color: #989998;
  1046. line-height: 40rpx;
  1047. margin-top: 48rpx;
  1048. padding-bottom: 5rpx;
  1049. border-bottom: 1rpx solid #989998;
  1050. }
  1051. }
  1052. }
  1053. }
  1054. .share{
  1055. position: fixed;
  1056. left: 0;
  1057. right: 0;
  1058. top: 0;
  1059. bottom: 0;
  1060. z-index: 1000;
  1061. background: rgba(0,0,0,0.4);
  1062. display: flex;
  1063. flex-direction: column;
  1064. justify-content: flex-end;
  1065. .sbox{
  1066. position: relative;
  1067. background: #FFFFFF;
  1068. border-radius: 24rpx 24rpx 0rpx 0rpx;
  1069. padding: 50rpx 30rpx 148rpx;
  1070. &-title{
  1071. font-family: PingFang-SC, PingFang-SC;
  1072. font-weight: bold;
  1073. font-size: 36rpx;
  1074. color: #151B29;
  1075. line-height: 36rpx;
  1076. text-align: center;
  1077. }
  1078. .close{
  1079. width: 27rpx;
  1080. height: 27rpx;
  1081. position: absolute;
  1082. top: 50rpx;
  1083. right: 40rpx;
  1084. }
  1085. &-items{
  1086. margin-top: 88rpx;
  1087. &-pre{
  1088. width: calc(100% / 3);
  1089. image{
  1090. width: 94rpx;
  1091. height: 94rpx;
  1092. }
  1093. text{
  1094. font-family: PingFangSC, PingFang SC;
  1095. font-weight: 400;
  1096. font-size: 26rpx;
  1097. color: #252525;
  1098. line-height: 26rpx;
  1099. text-align: center;
  1100. margin-top: 24rpx;
  1101. }
  1102. }
  1103. }
  1104. }
  1105. }
  1106. .posterbox{
  1107. position: fixed;
  1108. left: 0;
  1109. right: 0;
  1110. top: 0;
  1111. bottom: 0;
  1112. z-index: 1001;
  1113. background: rgba(0,0,0,0.7);
  1114. .posterbox-card{
  1115. width: calc(100% - 220rpx);
  1116. .poster-image {
  1117. width: 100%;
  1118. border-radius: 8px; // 给生成的图片也加个圆角,更美观
  1119. }
  1120. }
  1121. &-menu{
  1122. width: 100%;
  1123. margin-top: 239rpx;
  1124. &-pre{
  1125. width: 25%;
  1126. image{
  1127. width: 103rpx;
  1128. height: 104rpx;
  1129. }
  1130. text{
  1131. font-family: PingFangSC, PingFang SC;
  1132. font-weight: 400;
  1133. font-size: 24rpx;
  1134. color: rgba(255,255,255,0.6);
  1135. line-height: 33rpx;
  1136. margin-top: 32rpx;
  1137. }
  1138. }
  1139. }
  1140. &-close{
  1141. margin-top: 58rpx;
  1142. image{
  1143. width: 64rpx;
  1144. height: 64rpx;
  1145. }
  1146. }
  1147. }
  1148. }
  1149. </style>