activityDetail.vue 41 KB

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