love.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  1. <template>
  2. <view class="app-page bg-white">
  3. <!-- 情侣信息 -->
  4. <view class="lover-wrap" :style="[loveWrapStyle]">
  5. <view class="lover-card">
  6. <view class="boy">
  7. <image class="avatar" :src="loveConfig.boy.avatar" mode="aspectFit"></image>
  8. <view class="name">{{ loveConfig.boy.name }}</view>
  9. </view>
  10. <image class="like" :src="loveConfig.loveImageUrl" mode="scaleToFill"></image>
  11. <view class="girl">
  12. <image class="avatar" :src="loveConfig.girl.avatar" mode="aspectFit"></image>
  13. <view class="name">{{ loveConfig.girl.name }}</view>
  14. </view>
  15. </view>
  16. <image class="wave-image" :src="loveConfig.waveImageUrl" mode="scaleToFill"></image>
  17. </view>
  18. <!-- 恋爱记时 -->
  19. <view class="love-time-wrap">
  20. <view class="title">{{ loveConfig.timeTitle }}</view>
  21. <view class="content">
  22. <text class="text">
  23. <text class="number">{{ loveDayCount.d }}</text>
  24. </text>
  25. <text class="text">
  26. <text class="number">{{ loveDayCount.h }}</text>
  27. 小时
  28. </text>
  29. <text class="text">
  30. <text class="number">{{ loveDayCount.m }}</text>
  31. 分钟
  32. </text>
  33. <text class="text">
  34. <text class="number">{{ loveDayCount.s }}</text>
  35. </text>
  36. </view>
  37. </view>
  38. <!-- 功能导航 -->
  39. <view class="list-wrap">
  40. <view class="list-item" @click="fnToPage('journey')">
  41. <view class="left"><image class="icon" src="https://b.925i.cn/uni_halo_love/diandian.png" mode="aspectFit"></image></view>
  42. <view class="right">
  43. <view class="name">关于我们</view>
  44. <view class="desc">我们一起度过的那些经历</view>
  45. </view>
  46. </view>
  47. <view class="list-item" @click="fnToPage('album')">
  48. <view class="left"><image class="icon" src="https://b.925i.cn/uni_halo_love/diandian.png" mode="aspectFit"></image></view>
  49. <view class="right">
  50. <view class="name">恋爱相册</view>
  51. <view class="desc">定格了我们的那些小美好</view>
  52. </view>
  53. </view>
  54. <view class="list-item" @click="fnToPage('list')">
  55. <view class="left"><image class="icon" src="https://b.925i.cn/uni_halo_love/diandian.png" mode="aspectFit"></image></view>
  56. <view class="right">
  57. <view class="name">恋爱清单</view>
  58. <view class="desc">你我之间的约定我们都在努力实现</view>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. </template>
  64. <script>
  65. import LoveConfig from '@/config/love.config.js';
  66. export default {
  67. data() {
  68. return {
  69. loveConfig: LoveConfig,
  70. loveDayTimer: null,
  71. loveDayCount: {
  72. d: 0,
  73. h: 0,
  74. m: 0,
  75. s: 0
  76. }
  77. };
  78. },
  79. computed: {
  80. loveWrapStyle() {
  81. return {
  82. backgroundImage: `url(${this.loveConfig.bgImageUrl})`
  83. };
  84. }
  85. },
  86. onLoad() {
  87. this.fnSetPageTitle('恋爱日记');
  88. this.fnInitLoveDayCount();
  89. },
  90. methods: {
  91. fnInitLoveDayCount() {
  92. clearTimeout(this.loveDayTimer);
  93. const _countDownFn = () => {
  94. this.loveDayTimer = setTimeout(_countDownFn, 1000);
  95. const start = new Date(this.loveConfig.loveStartDate),
  96. now = new Date();
  97. const T = now.getTime() - start.getTime();
  98. const i = 24 * 60 * 60 * 1000;
  99. const d = T / i;
  100. const D = Math.floor(d);
  101. const h = (d - D) * 24;
  102. const H = Math.floor(h);
  103. const m = (h - H) * 60;
  104. const M = Math.floor(m);
  105. const s = (m - M) * 60;
  106. const S = Math.floor(s);
  107. this.loveDayCount = {
  108. d: D,
  109. h: H,
  110. m: M,
  111. s: S
  112. };
  113. };
  114. _countDownFn();
  115. },
  116. fnToPage(pageName) {
  117. uni.navigateTo({
  118. url: `/pagesA/love/${pageName}`
  119. });
  120. }
  121. }
  122. };
  123. </script>
  124. <style scoped lang="scss">
  125. .app-page {
  126. width: 100vw;
  127. min-height: 100vh;
  128. background: linear-gradient(
  129. -45deg,
  130. rgba(247, 149, 51, 0.1),
  131. rgba(243, 112, 85, 0.1) 15%,
  132. rgba(239, 78, 123, 0.1) 30%,
  133. rgba(161, 102, 171, 0.1) 44%,
  134. rgba(80, 115, 184, 0.1) 58%,
  135. rgba(16, 152, 173, 0.1) 72%,
  136. rgba(7, 179, 155, 0.1) 86%,
  137. rgba(109, 186, 130, 0.1)
  138. );
  139. }
  140. .lover-wrap {
  141. position: relative;
  142. width: 100vw;
  143. height: 50vh;
  144. display: flex;
  145. align-items: center;
  146. justify-content: center;
  147. background-size: cover;
  148. background-repeat: no-repeat;
  149. background-position: 50% 50%;
  150. &::before {
  151. position: absolute;
  152. left: 0;
  153. top: 0;
  154. right: 0;
  155. bottom: 0;
  156. content: '';
  157. background-color: rgba(0, 0, 0, 0.07);
  158. background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAKUlEQVQImU3IMREAIAgAwJfNkQCEsH8cijjpMf6vnXlQaIiJFx+omEBfmqIEZLe2jzcAAAAASUVORK5CYII=);
  159. z-index: 0;
  160. backdrop-filter: blur(4rpx);
  161. overflow: hidden;
  162. }
  163. &::after {
  164. content: '';
  165. position: absolute;
  166. left: 0;
  167. bottom: -60rpx;
  168. width: 100vw;
  169. height: 60rpx;
  170. background-image: linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0));
  171. }
  172. .lover-card {
  173. position: absolute;
  174. left: 50%;
  175. top: 58%;
  176. transform: translate(-50%, -50%);
  177. width: 90vw;
  178. display: flex;
  179. align-items: center;
  180. justify-content: space-around;
  181. border-radius: 12rpx;
  182. z-index: 2;
  183. .avatar {
  184. width: 180rpx;
  185. height: 180rpx;
  186. border-radius: 50%;
  187. box-sizing: border-box;
  188. // border: 8rpx solid transparent;
  189. // border: 8rpx solid rgba(255, 255, 255, 0.7) !important;
  190. border: 8rpx solid rgba(255, 255, 255, 1) !important;
  191. }
  192. .name {
  193. font-size: 32rpx;
  194. font-weight: bold;
  195. color: #ffffff;
  196. text-align: center;
  197. letter-spacing: 2rpx;
  198. }
  199. .boy {
  200. color: #3ab8e4;
  201. .avatar {
  202. border-color: rgba(58, 184, 228, 0.7);
  203. }
  204. }
  205. .girl {
  206. color: #f57ab3;
  207. .avatar {
  208. border-color: rgba(245, 122, 179, 0.7);
  209. }
  210. }
  211. .like {
  212. width: 120rpx;
  213. height: 120rpx;
  214. animation: likeani 1s ease-in-out infinite;
  215. }
  216. }
  217. .wave-image {
  218. width: 100%;
  219. height: 120rpx;
  220. position: absolute;
  221. left: 0;
  222. bottom: 0;
  223. mix-blend-mode: screen;
  224. }
  225. }
  226. .love-time-wrap {
  227. margin-top: 80rpx;
  228. width: 100vw;
  229. display: flex;
  230. flex-direction: column;
  231. align-items: center;
  232. justify-content: center;
  233. .title {
  234. font-size: 46rpx;
  235. letter-spacing: 4rpx;
  236. // background-image: linear-gradient(270deg, #ff4500, #ffa500, #ffd700, #90ee90, #00ffff, #1e90ff, #9370db, #ff69b4, #ff4500);
  237. // -webkit-background-clip: text;
  238. // color: #000;
  239. color: #333;
  240. font-size: 42rpx;
  241. font-weight: bold;
  242. // animation: loveTimeTitleAni 80s linear infinite;
  243. }
  244. .content {
  245. margin-top: 24rpx;
  246. display: flex;
  247. align-items: center;
  248. justify-content: center;
  249. .text {
  250. font-size: 28rpx;
  251. }
  252. .number {
  253. margin: 0 8rpx;
  254. font-size: 46rpx;
  255. // color: #ff69b4;
  256. color: #f83856;
  257. font-weight: bold;
  258. }
  259. }
  260. }
  261. .list-wrap {
  262. margin-top: 75rpx;
  263. display: flex;
  264. flex-direction: column;
  265. align-items: center;
  266. justify-content: center;
  267. box-sizing: border-box;
  268. padding: 0 36rpx;
  269. .list-item {
  270. width: 100%;
  271. display: flex;
  272. align-items: center;
  273. justify-content: space-around;
  274. box-sizing: border-box;
  275. padding: 28rpx 32rpx;
  276. background-color: #ffffff;
  277. border-radius: 50rpx;
  278. margin-bottom: 32rpx;
  279. box-shadow: 0rpx 4rpx 24rpx rgba(0, 0, 0, 0.03);
  280. &:nth-child(1) {
  281. animation: listItemAni1 3s ease-in-out infinite;
  282. }
  283. &:nth-child(2) {
  284. animation: listItemAni1 3s ease-in-out infinite;
  285. animation-delay: 1.5s;
  286. }
  287. &:nth-child(3) {
  288. animation: listItemAni1 3s ease-in-out infinite;
  289. animation-delay: 2s;
  290. }
  291. .left {
  292. width: 120rpx;
  293. height: 120rpx;
  294. .icon {
  295. width: 100%;
  296. height: 100%;
  297. }
  298. }
  299. .right {
  300. flex-grow: 1;
  301. display: flex;
  302. flex-direction: column;
  303. justify-content: center;
  304. box-sizing: border-box;
  305. padding-left: 40rpx;
  306. .name {
  307. font-size: 32rpx;
  308. font-weight: bold;
  309. color: #333333;
  310. }
  311. .desc {
  312. margin-top: 8px;
  313. font-size: 26rpx;
  314. color: #777777;
  315. }
  316. }
  317. }
  318. }
  319. @keyframes likeani {
  320. 0% {
  321. transform: scale(1);
  322. }
  323. 25% {
  324. transform: scale(1.2);
  325. }
  326. 50% {
  327. transform: scale(1.1);
  328. }
  329. 75% {
  330. transform: scale(1.3);
  331. }
  332. 100% {
  333. transform: scale(1);
  334. }
  335. }
  336. @keyframes loveTimeTitleAni {
  337. to {
  338. background-position: -200rem;
  339. }
  340. }
  341. @keyframes listItemAni1 {
  342. 0% {
  343. transform: translateY(0rpx);
  344. }
  345. 50% {
  346. transform: translateY(-10rpx);
  347. }
  348. 100% {
  349. transform: translateY(0rpx);
  350. }
  351. }
  352. </style>