activityDetail.vue 42 KB

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