activityDetail.vue 43 KB

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