Browse Source

feat: 添加基础组件和页面以及工具函数

添加了基础组件、页面和工具函数,为后续开发奠定基础。这包括卡片组件、扫描仪组件、点赞和评论的SVG图标,以及日期处理的工具函数。同时,注册了多个新页面,如商场、材料、消息和个人中心页面。
EvilDragon 8 months ago
parent
commit
5c1877b57e

+ 5 - 0
src/components/card.vue

@@ -0,0 +1,5 @@
+<template>
+  <view class="rounded-2xl bg-white shadow-[0_16rpx_20rpx_-10rpx_rgba(0,0,0,0.05)] p-3.5">
+    <slot></slot>
+  </view>
+</template>

+ 11 - 0
src/components/hot-activity-item.vue

@@ -0,0 +1,11 @@
+<script lang="ts" setup></script>
+<template>
+  <view class="relative w-full box-border">
+    <view class="absolute w-full h-full pt-2 pb-6 box-border">
+      <view class="bg-black w-full h-full rounded-2xl"></view>
+    </view>
+    <view class="relative h-full z-1 mx--3 mb--6 mt--1 box-border">
+      <wd-img :width="'100%'" :height="'100%'" src="/static/a.svg" mode="widthFix"></wd-img>
+    </view>
+  </view>
+</template>

+ 21 - 0
src/components/hot-activity.vue

@@ -0,0 +1,21 @@
+<script lang="ts" setup>
+import HotActivityItem from './hot-activity-item.vue'
+
+const swiperList = [{}]
+</script>
+<template>
+  <uni-swipe-action>
+    <template v-for="it of swiperList" :key="it.id">
+      <uni-swipe-action-item>
+        <HotActivityItem></HotActivityItem>
+      </uni-swipe-action-item>
+    </template>
+  </uni-swipe-action>
+  <!-- <wd-swiper :list="swiperList" autoplay>
+    <template #default="{ item }">
+      <wd-swiper-item>
+        <hot-activity-item></hot-activity-item>
+      </wd-swiper-item>
+    </template>
+  </wd-swiper> -->
+</template>

+ 103 - 0
src/components/moment-item.vue

@@ -0,0 +1,103 @@
+<script lang="ts" setup>
+import Card from '@/components/card.vue'
+import dayjs from 'dayjs'
+import TiltedButton from './tilted-button.vue'
+import { beforeNow } from '@/utils/date-util'
+import Tag from './tag.vue'
+const props = defineProps({
+  options: {
+    type: Object,
+    default: () => ({
+      author: {
+        nickname: '张三',
+        avatar: 'https://img.yzcdn.cn/vant/cat.jpeg',
+      },
+      createdAt: new Date(),
+      images: ['', '', ''],
+      content: '',
+      tags: [],
+      shares: 0,
+      comments: 0,
+      likes: 0,
+    }),
+  },
+})
+const imgClass = ref('')
+
+onMounted(async () => {
+  console.log('加载')
+  if (props.options.images.length === 1) {
+    const { width, height } = await uni.getImageInfo({
+      src: props.options.images[0],
+    })
+
+    if (Number(width / height) > 1) {
+      imgClass.value = 'w-[60vw]'
+    } else {
+      imgClass.value = 'w-[44vw]'
+    }
+  }
+})
+</script>
+<template>
+  <Card>
+    <view class="flex items-center">
+      <view class="overflow-hidden rounded-full mr-2">
+        <wd-img
+          custom-class="vertical-bottom"
+          :width="35"
+          :height="35"
+          :src="props.options.author.avatar"
+          mode="scaleToFill"
+        />
+      </view>
+      <view class="">{{ props.options.author.nickname }}</view>
+      <view class="flex-1"></view>
+      <view>{{ beforeNow(props.options.createdAt) }}</view>
+    </view>
+    <view
+      :class="[props.options.images.length > 1 ? 'grid grid-cols-3 grid-gap-1' : 'w-full', 'my-6']"
+    >
+      <template v-for="it of props.options.images" :key="it">
+        <view
+          :class="[
+            props.options.images.length > 1 ? 'aspect-square' : '',
+            'rounded-lg overflow-hidden',
+            imgClass,
+          ]"
+        >
+          <wd-img
+            custom-class="vertical-bottom"
+            :width="'100%'"
+            :src="it"
+            :height="props.options.images.length > 1 ? '100%' : 'auto'"
+            :mode="props.options.images.length > 1 ? 'aspectFill' : 'widthFix'"
+          ></wd-img>
+        </view>
+      </template>
+    </view>
+    <view class="text-[rgba(0,0,0,0.85)] text-4 font-400 line-height-2.5 my-1">
+      {{ props.options.content }}
+    </view>
+    <view class="my-5.5">
+      <!-- <TiltedButton>按钮</TiltedButton> -->
+      <template v-for="it of props.options.tags" :key="it">
+        <Tag>{{ it }}</Tag>
+      </template>
+    </view>
+    <view class="flex justify-between">
+      <view class="flex items-center text-[rgba(0,0,0,0.85)] text-3.5 font-400 line-height-5.5">
+        <wd-img width="15" height="15" src="/static/svgs/share.svg"></wd-img>
+        <view class="ml-1">{{ props.options.shares }}</view>
+      </view>
+      <view class="flex items-center text-[rgba(0,0,0,0.85)] text-3.5 font-400 line-height-5.5">
+        <wd-img width="15" height="15" src="/static/svgs/comment.svg"></wd-img>
+        <view class="ml-1">{{ props.options.shares }}</view>
+      </view>
+      <view class="flex items-center text-[rgba(0,0,0,0.85)] text-3.5 font-400 line-height-5.5">
+        <wd-img width="15" height="15" src="/static/svgs/like.svg"></wd-img>
+        <view class="ml-1">{{ props.options.shares }}</view>
+      </view>
+    </view>
+  </Card>
+</template>

+ 112 - 0
src/components/scaner.vue

@@ -0,0 +1,112 @@
+<script lang="ts" setup></script>
+<template>
+  <div class="qr-scanner w-full h-full pos-absolute">
+    <div class="box">
+      <div class="line"></div>
+      <div class="angle"></div>
+    </div>
+  </div>
+</template>
+<style lang="scss">
+.qr-scanner {
+  background-color: #111;
+  background-image: linear-gradient(
+      0deg,
+      transparent 24%,
+      rgba(32, 255, 77, 0.1) 25%,
+      rgba(32, 255, 77, 0.1) 26%,
+      transparent 27%,
+      transparent 74%,
+      rgba(32, 255, 77, 0.1) 75%,
+      rgba(32, 255, 77, 0.1) 76%,
+      transparent 77%,
+      transparent
+    ),
+    linear-gradient(
+      90deg,
+      transparent 24%,
+      rgba(32, 255, 77, 0.1) 25%,
+      rgba(32, 255, 77, 0.1) 26%,
+      transparent 27%,
+      transparent 74%,
+      rgba(32, 255, 77, 0.1) 75%,
+      rgba(32, 255, 77, 0.1) 76%,
+      transparent 77%,
+      transparent
+    );
+  background-position: -1rem -1rem;
+  background-size: 3rem 3rem;
+}
+
+.qr-scanner .box {
+  position: relative;
+  top: 50%;
+  left: 50%;
+  height: 100%;
+  //   width: 75vw;
+  //   max-width: 75vh;
+  //   height: 75vw;
+  //   max-height: 75vh;
+  overflow: hidden;
+  border: 0.1rem solid rgba(0, 255, 51, 0.2);
+  transform: translate(-50%, -50%);
+}
+
+.qr-scanner .line {
+  width: 100%;
+  height: calc(100% - 2px);
+  background: linear-gradient(180deg, rgba(0, 255, 51, 0) 43%, #00ff33 211%);
+  border-bottom: 3px solid #00ff33;
+  transform: translateY(-100%);
+  animation: radar-beam 2s infinite;
+  animation-timing-function: cubic-bezier(0.53, 0, 0.43, 0.99);
+  animation-delay: 1.4s;
+}
+
+.qr-scanner .box:after,
+.qr-scanner .box:before,
+.qr-scanner .angle:after,
+.qr-scanner .angle:before {
+  position: absolute;
+  display: block;
+  width: 3vw;
+  height: 3vw;
+  content: '';
+
+  border: 0.2rem solid transparent;
+}
+
+.qr-scanner .box:after,
+.qr-scanner .box:before {
+  top: 0;
+  border-top-color: #00ff33;
+}
+
+.qr-scanner .angle:after,
+.qr-scanner .angle:before {
+  bottom: 0;
+  border-bottom-color: #00ff33;
+}
+
+.qr-scanner .box:before,
+.qr-scanner .angle:before {
+  left: 0;
+  border-left-color: #00ff33;
+}
+
+.qr-scanner .box:after,
+.qr-scanner .angle:after {
+  right: 0;
+  border-right-color: #00ff33;
+}
+
+@keyframes radar-beam {
+  0% {
+    transform: translateY(-100%);
+  }
+
+  100% {
+    transform: translateY(0);
+  }
+}
+</style>

+ 9 - 0
src/components/tag.vue

@@ -0,0 +1,9 @@
+<script lang="ts" setup></script>
+<template>
+  <view
+    class="inline-flex py-1.5 px-2.5 justify-center items-center gap-1.25 rounded-full border-[rgba(0,0,0,0.16)] border-0.75 border-solid text-[rgba(0,0,0,0.65)] text-3 font-400 line-height-4"
+  >
+    <wd-img width="15" height="15" src="/static/svgs/tag.svg"></wd-img>
+    <slot></slot>
+  </view>
+</template>

+ 20 - 0
src/components/tilted-button.vue

@@ -0,0 +1,20 @@
+<script lang="ts" setup></script>
+<template>
+  <view
+    class="aaa inline-block text-white relative box-border text-3.5 font-400 line-height-5 px-4 py-1"
+  >
+    <view class="flex items-center justify-center">
+      <slot></slot>
+    </view>
+  </view>
+</template>
+<style lang="scss">
+.aaa {
+  border-style: solid;
+  border-image-source: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI5MiIgaGVpZ2h0PSIzNSIgdmlld0JveD0iMCAwIDkyIDM1IiBmaWxsPSJub25lIj4KICA8cGF0aCBkPSJNOS45MzAxNSA1LjI3NjI0QzExLjY3MTMgMi4wMjc1NCAxNS4wNTgzIDAgMTguNzQ0MSAwSDgyQzg3LjUyMjkgMCA5MiA0LjQ3NzE1IDkyIDEwVjI1QzkyIDMwLjUyMjggODcuNTIyOSAzNSA4MiAzNUg5LjAzNDUxQzIuMjMyMiAzNSAtMi4xMTEzMSAyNy43NDQyIDEuMTAxOTQgMjEuNzQ4Nkw5LjkzMDE1IDUuMjc2MjRaIiBmaWxsPSJibGFjayIgZmlsbC1vcGFjaXR5PSIwLjg1Ii8+Cjwvc3ZnPg==');
+  border-image-slice: 10 10 10 25 fill;
+  border-image-width: 20rpx 20rpx 20rpx 40rpx;
+  border-image-outset: 0 0 0 0;
+  border-image-repeat: stretch stretch;
+}
+</style>

+ 49 - 0
src/pages.json

@@ -52,6 +52,55 @@
       "style": {
       "style": {
         "navigationBarTitleText": "关于"
         "navigationBarTitleText": "关于"
       }
       }
+    },
+    {
+      "path": "pages/mall/index",
+      "type": "page",
+      "style": {
+        "navigationBarTitleText": "品质商城"
+      }
+    },
+    {
+      "path": "pages/material/index",
+      "type": "page",
+      "style": {
+        "navigationBarTitleText": "材料"
+      }
+    },
+    {
+      "path": "pages/messages/index",
+      "type": "page",
+      "style": {
+        "navigationBarTitleText": "材料"
+      }
+    },
+    {
+      "path": "pages/mine/index",
+      "type": "page",
+      "style": {
+        "navigationBarTitleText": "材料"
+      }
+    },
+    {
+      "path": "pages/offline-activity/index",
+      "type": "page",
+      "style": {
+        "navigationBarTitleText": "线下活动"
+      }
+    },
+    {
+      "path": "pages/publish/index",
+      "type": "page",
+      "style": {
+        "navigationBarTitleText": "发布"
+      }
+    },
+    {
+      "path": "pages/spread/index",
+      "type": "page",
+      "style": {
+        "navigationBarTitleText": "设计传播"
+      }
     }
     }
   ],
   ],
   "subPackages": []
   "subPackages": []

+ 11 - 0
src/pages/mall/index.vue

@@ -0,0 +1,11 @@
+<route lang="json5">
+{ style: { navigationBarTitleText: '品质商城' } }
+</route>
+
+<script setup lang="ts"></script>
+
+<template>
+  <view></view>
+</template>
+
+<style scoped lang="scss"></style>

+ 11 - 0
src/pages/material/index.vue

@@ -0,0 +1,11 @@
+<route lang="json5">
+{ style: { navigationBarTitleText: '材料' } }
+</route>
+
+<script setup lang="ts"></script>
+
+<template>
+  <view></view>
+</template>
+
+<style scoped lang="scss"></style>

+ 11 - 0
src/pages/messages/index.vue

@@ -0,0 +1,11 @@
+<route lang="json5">
+{ style: { navigationBarTitleText: '材料' } }
+</route>
+
+<script setup lang="ts"></script>
+
+<template>
+  <view></view>
+</template>
+
+<style scoped lang="scss"></style>

+ 11 - 0
src/pages/mine/index.vue

@@ -0,0 +1,11 @@
+<route lang="json5">
+{ style: { navigationBarTitleText: '材料' } }
+</route>
+
+<script setup lang="ts"></script>
+
+<template>
+  <view></view>
+</template>
+
+<style scoped lang="scss"></style>

+ 11 - 0
src/pages/offline-activity/index.vue

@@ -0,0 +1,11 @@
+<route lang="json5">
+{ style: { navigationBarTitleText: '线下活动' } }
+</route>
+
+<script setup lang="ts"></script>
+
+<template>
+  <view></view>
+</template>
+
+<style scoped lang="scss"></style>

+ 11 - 0
src/pages/publish/index.vue

@@ -0,0 +1,11 @@
+<route lang="json5">
+{ style: { navigationBarTitleText: '发布' } }
+</route>
+
+<script setup lang="ts"></script>
+
+<template>
+  <view></view>
+</template>
+
+<style scoped lang="scss"></style>

+ 11 - 0
src/pages/spread/index.vue

@@ -0,0 +1,11 @@
+<route lang="json5">
+{ style: { navigationBarTitleText: '设计传播' } }
+</route>
+
+<script setup lang="ts"></script>
+
+<template>
+  <view></view>
+</template>
+
+<style scoped lang="scss"></style>

+ 18 - 0
src/static/a.svg

@@ -0,0 +1,18 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="367" height="258" viewBox="0 0 367 258" fill="none">
+  <g filter="url(#filter0_d_62_39)">
+    <path d="M10 23C10 14.1634 17.1634 7 26 7H341C349.837 7 357 14.1634 357 23V166C357 174.837 349.837 182 341 182H26C17.1634 182 10 174.837 10 166V23Z" fill="black" fill-opacity="0.85"/>
+    <path d="M10 18C10 9.16344 17.1634 2 26 2H135.723C144.17 2 152.226 5.56112 157.911 11.8085L179.439 35.4643C185.124 41.7117 193.179 45.2729 201.626 45.2729H341C349.837 45.2729 357 52.4363 357 61.2729V224C357 232.837 349.837 240 341 240H26C17.1634 240 10 232.837 10 224V18Z" fill="white"/>
+  </g>
+  <defs>
+    <filter id="filter0_d_62_39" x="0" y="0" width="367" height="258" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
+      <feFlood flood-opacity="0" result="BackgroundImageFix"/>
+      <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
+      <feOffset dy="8"/>
+      <feGaussianBlur stdDeviation="5"/>
+      <feComposite in2="hardAlpha" operator="out"/>
+      <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"/>
+      <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_62_39"/>
+      <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_62_39" result="shape"/>
+    </filter>
+  </defs>
+</svg>

+ 3 - 0
src/static/svgs/button.svg

@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="92" height="35" viewBox="0 0 92 35" fill="none">
+  <path d="M9.93015 5.27624C11.6713 2.02754 15.0583 0 18.7441 0H82C87.5229 0 92 4.47715 92 10V25C92 30.5228 87.5229 35 82 35H9.03451C2.2322 35 -2.11131 27.7442 1.10194 21.7486L9.93015 5.27624Z" fill="black" fill-opacity="0.85"/>
+</svg>

+ 5 - 0
src/static/svgs/comment.svg

@@ -0,0 +1,5 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
+  <path fill-rule="evenodd" clip-rule="evenodd" d="M7.61539 1.5C3.92951 1.5 1 4.28527 1 7.65134C1 9.23706 1.6452 10.6865 2.71411 11.7824C2.90693 11.98 2.90299 12.2966 2.70532 12.4894C2.50764 12.6822 2.19109 12.6783 1.99827 12.4806C0.761041 11.2123 0 9.51718 0 7.65134C0 3.67054 3.44182 0.5 7.61539 0.5C11.7889 0.5 15.2308 3.67054 15.2308 7.65134C15.2308 11.6321 11.7889 14.8027 7.61539 14.8027H3.1296C2.16806 14.8027 1.75503 15.2452 1.70216 15.3333C1.56008 15.5701 1.25295 15.6469 1.01616 15.5048C0.779373 15.3628 0.702591 15.0556 0.844665 14.8188C1.10116 14.3913 1.86372 13.8027 3.1296 13.8027H7.61539C11.3013 13.8027 14.2308 11.0174 14.2308 7.65134C14.2308 4.28527 11.3013 1.5 7.61539 1.5Z" fill="black"/>
+  <path fill-rule="evenodd" clip-rule="evenodd" d="M4.02148 6.87793C4.02148 6.60179 4.24534 6.37793 4.52148 6.37793H10.7088C10.9849 6.37793 11.2088 6.60179 11.2088 6.87793C11.2088 7.15407 10.9849 7.37793 10.7088 7.37793H4.52148C4.24534 7.37793 4.02148 7.15407 4.02148 6.87793Z" fill="#060606"/>
+  <path fill-rule="evenodd" clip-rule="evenodd" d="M4.02148 9.35284C4.02148 9.0767 4.24534 8.85284 4.52148 8.85284H7.92449C8.20064 8.85284 8.42449 9.0767 8.42449 9.35284C8.42449 9.62899 8.20064 9.85284 7.92449 9.85284H4.52148C4.24534 9.85284 4.02148 9.62899 4.02148 9.35284Z" fill="#060606"/>
+</svg>

+ 5 - 0
src/static/svgs/like.svg

@@ -0,0 +1,5 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
+  <path fill-rule="evenodd" clip-rule="evenodd" d="M7.61539 1.5C3.92951 1.5 1 4.28527 1 7.65134C1 9.23706 1.6452 10.6865 2.71411 11.7824C2.90693 11.98 2.90299 12.2966 2.70532 12.4894C2.50764 12.6822 2.19109 12.6783 1.99827 12.4806C0.761041 11.2123 0 9.51718 0 7.65134C0 3.67054 3.44182 0.5 7.61539 0.5C11.7889 0.5 15.2308 3.67054 15.2308 7.65134C15.2308 11.6321 11.7889 14.8027 7.61539 14.8027H3.1296C2.16806 14.8027 1.75503 15.2452 1.70216 15.3333C1.56008 15.5701 1.25295 15.6469 1.01616 15.5048C0.779373 15.3628 0.702591 15.0556 0.844665 14.8188C1.10116 14.3913 1.86372 13.8027 3.1296 13.8027H7.61539C11.3013 13.8027 14.2308 11.0174 14.2308 7.65134C14.2308 4.28527 11.3013 1.5 7.61539 1.5Z" fill="black"/>
+  <path fill-rule="evenodd" clip-rule="evenodd" d="M4.02148 6.87793C4.02148 6.60179 4.24534 6.37793 4.52148 6.37793H10.7088C10.9849 6.37793 11.2088 6.60179 11.2088 6.87793C11.2088 7.15407 10.9849 7.37793 10.7088 7.37793H4.52148C4.24534 7.37793 4.02148 7.15407 4.02148 6.87793Z" fill="#060606"/>
+  <path fill-rule="evenodd" clip-rule="evenodd" d="M4.02148 9.35284C4.02148 9.0767 4.24534 8.85284 4.52148 8.85284H7.92449C8.20064 8.85284 8.42449 9.0767 8.42449 9.35284C8.42449 9.62899 8.20064 9.85284 7.92449 9.85284H4.52148C4.24534 9.85284 4.02148 9.62899 4.02148 9.35284Z" fill="#060606"/>
+</svg>

+ 3 - 0
src/static/svgs/share.svg

@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
+  <path d="M13.3332 8.33333C13.3332 8.20072 13.3858 8.07355 13.4796 7.97978C13.5734 7.88601 13.7006 7.83333 13.8332 7.83333C13.9658 7.83333 14.093 7.88601 14.1867 7.97978C14.2805 8.07355 14.3332 8.20072 14.3332 8.33333V12.5C14.3332 13.5125 13.5123 14.3333 12.4998 14.3333H3.49984C2.48734 14.3333 1.6665 13.5125 1.6665 12.5V4C1.6665 2.9875 2.48734 2.16666 3.49984 2.16666H7.83317C7.96578 2.16666 8.09296 2.21934 8.18672 2.31311C8.28049 2.40688 8.33317 2.53406 8.33317 2.66666C8.33317 2.79927 8.28049 2.92645 8.18672 3.02022C8.09296 3.11399 7.96578 3.16666 7.83317 3.16666H3.49984C3.27882 3.16666 3.06686 3.25446 2.91058 3.41074C2.7543 3.56702 2.6665 3.77898 2.6665 4V12.5C2.6665 12.721 2.7543 12.933 2.91058 13.0893C3.06686 13.2455 3.27882 13.3333 3.49984 13.3333H12.4998C12.7209 13.3333 12.9328 13.2455 13.0891 13.0893C13.2454 12.933 13.3332 12.721 13.3332 12.5V8.33333ZM12.676 4L11.273 2.50933C11.1821 2.41275 11.1333 2.28402 11.1374 2.15146C11.1414 2.0189 11.1979 1.89338 11.2945 1.8025C11.3911 1.71162 11.5198 1.66283 11.6524 1.66686C11.7849 1.67089 11.9105 1.72741 12.0013 1.824L14.1973 4.15733C14.4977 4.47633 14.2713 5 13.8332 5H11.3233C10.0472 5 8.99984 6.11266 8.99984 7.5V10.5C8.99984 10.6326 8.94716 10.7598 8.85339 10.8536C8.75962 10.9473 8.63245 11 8.49984 11C8.36723 11 8.24005 10.9473 8.14628 10.8536C8.05252 10.7598 7.99984 10.6326 7.99984 10.5V7.5C7.99984 5.5735 9.48084 4 11.3233 4H12.676Z" fill="black" fill-opacity="0.85"/>
+</svg>

File diff suppressed because it is too large
+ 1 - 0
src/static/svgs/tag.svg


File diff suppressed because it is too large
+ 2 - 0
src/static/svgs/unnamed.svg


+ 4 - 0
src/static/tabbar/home.svg

@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="23" height="23" viewBox="0 0 23 23" fill="none">
+  <path d="M19.35 8.85205V15.8446C19.35 17.2242 18.2229 18.35 16.8235 18.35H5.17647C3.77705 18.35 2.65 17.2242 2.65 15.8446V8.85205C2.65 8.14715 2.96643 7.47948 3.51202 7.03314L9.39226 2.22275C10.3258 1.45908 11.6742 1.45908 12.6077 2.22275L18.488 7.03314C19.0336 7.47947 19.35 8.14715 19.35 8.85205Z" stroke="black" stroke-width="1.3"/>
+  <path d="M9.99986 13.9448L9.99986 8.805C9.99986 8.35995 10.3598 8 10.8049 8C11.2499 8 11.6099 8.35995 11.6099 8.805L11.6099 13.9448C11.6099 14.3899 11.2499 14.7499 10.8049 14.7499C10.3598 14.7499 9.99986 14.3899 9.99986 13.9448Z" fill="black"/>
+</svg>

+ 4 - 0
src/static/tabbar/material.svg

@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 22 22" fill="none">
+  <path d="M6.20075 11.97H6.05387C4.90821 11.97 3.82131 11.5078 3.05753 10.7566C2.35251 10.0343 2 9.10985 2 8.18536C2 7.80978 2.05875 7.43421 2.20563 7.05864L2.23501 7.00085L3.88006 3.47623C4.26195 2.55174 5.26073 1.94504 6.31826 2.00282H16.7467C17.863 1.94504 18.8618 2.58063 19.273 3.53401L20.7125 6.76973C20.7418 6.82751 20.7712 6.91418 20.8006 6.97196L20.83 7.05864V7.11642C21.3881 8.84984 20.5362 10.6988 18.803 11.5655C18.1861 11.8544 17.4811 11.9989 16.8055 11.9989C15.8361 11.9989 14.896 11.6811 14.1322 11.1322C12.5753 12.3167 10.3428 12.2589 8.84459 11.1322C8.11019 11.6522 7.17016 11.97 6.20075 11.97ZM8.84459 9.19652L9.34398 9.71655C10.3428 10.7855 12.1053 10.9299 13.3097 10.0055C13.4272 9.91878 13.5447 9.80322 13.6622 9.68766L14.1616 9.16763L14.661 9.68766C15.2192 10.2655 16.0123 10.5833 16.8642 10.5833C17.3342 10.5833 17.8042 10.4677 18.2155 10.2944C19.3612 9.74544 19.8899 8.53204 19.5374 7.43421L19.508 7.34754L19.4493 7.28976L17.9805 4.02515C17.8042 3.5629 17.3048 3.274 16.7761 3.30289H6.25951C5.76012 3.274 5.2901 3.53401 5.11385 3.96737L5.08447 3.99626L3.49817 7.43421C3.41004 7.69422 3.35129 7.95424 3.35129 8.18536C3.35129 8.79206 3.5863 9.36986 4.02694 9.80322C4.52633 10.3232 5.2901 10.6122 6.05387 10.6122H6.17138C7.02328 10.6122 7.78705 10.2944 8.3452 9.71655L8.84459 9.19652Z" fill="#8C8C8C"/>
+  <path d="M15.9753 6.50505H7.02473C6.60424 6.50505 6.27385 6.17372 6.27385 5.75204C6.27385 5.33035 6.60424 4.99902 7.02473 4.99902H15.9753C16.3958 4.99902 16.7261 5.33035 16.7261 5.75204C16.7261 6.1436 16.3958 6.50505 15.9753 6.50505ZM18.1078 19.999H4.89223C3.84099 19.999 3 19.1255 3 18.0713V10.2701H4.38163V18.0713C4.38163 18.3725 4.62191 18.6135 4.89223 18.6135H18.1078C18.3781 18.6135 18.6184 18.3725 18.6184 18.0713V10.2701H20V18.0713C20 19.1255 19.159 19.999 18.1078 19.999Z" fill="#8C8C8C"/>
+</svg>

+ 4 - 0
src/static/tabbar/message.svg

@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 22 22" fill="none">
+  <path d="M6 10H14.5M6 13H10" stroke="#8C8C8C" stroke-width="1.4"/>
+  <path d="M2 7C2 5.34315 3.34315 4 5 4H16C17.6569 4 19 5.34315 19 7V16C19 17.6569 17.6569 19 16 19H2V7Z" stroke="#8C8C8C" stroke-width="1.4"/>
+</svg>

+ 4 - 0
src/static/tabbar/mine.svg

@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 22 22" fill="none">
+  <circle cx="11" cy="11" r="9" stroke="#8C8C8C" stroke-width="1.4"/>
+  <path d="M14 11C13.5 12 12.6569 13 11 13C9.34315 13 8.5 12 8 11" stroke="#8C8C8C" stroke-width="1.4" stroke-linecap="round"/>
+</svg>

+ 4 - 0
src/static/tabbar/publish.svg

@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40" fill="none">
+  <circle cx="20" cy="20" r="20" fill="black"/>
+  <path d="M18.6667 18.6667H13.3367C13.1613 18.6664 12.9877 18.7007 12.8256 18.7676C12.6635 18.8344 12.5162 18.9326 12.3921 19.0564C12.268 19.1802 12.1694 19.3273 12.1022 19.4892C12.0349 19.6511 12.0002 19.8247 12 20C12 20.7413 12.5987 21.3333 13.3367 21.3333H18.6667V26.6633C18.6667 27.402 19.2633 28 20 28C20.7413 28 21.3333 27.4013 21.3333 26.6633V21.3333H26.6633C26.8387 21.3336 27.0123 21.2993 27.1744 21.2324C27.3365 21.1656 27.4838 21.0674 27.6079 20.9436C27.732 20.8198 27.8306 20.6727 27.8978 20.5108C27.9651 20.3489 27.9998 20.1753 28 20C28 19.2587 27.4013 18.6667 26.6633 18.6667H21.3333V13.3367C21.3336 13.1613 21.2993 12.9877 21.2324 12.8256C21.1656 12.6635 21.0674 12.5162 20.9436 12.3921C20.8198 12.268 20.6727 12.1694 20.5108 12.1022C20.3489 12.0349 20.1753 12.0002 20 12C19.2587 12 18.6667 12.5987 18.6667 13.3367V18.6667Z" fill="white" fill-opacity="0.85"/>
+</svg>

+ 8 - 1
src/types/uni-pages.d.ts

@@ -5,7 +5,14 @@
 
 
 interface NavigateToOptions {
 interface NavigateToOptions {
   url: "/pages/index/index" |
   url: "/pages/index/index" |
-       "/pages/about/about";
+       "/pages/about/about" |
+       "/pages/mall/index" |
+       "/pages/material/index" |
+       "/pages/messages/index" |
+       "/pages/mine/index" |
+       "/pages/offline-activity/index" |
+       "/pages/publish/index" |
+       "/pages/spread/index";
 }
 }
 interface RedirectToOptions extends NavigateToOptions {}
 interface RedirectToOptions extends NavigateToOptions {}
 
 

+ 16 - 0
src/utils/date-util.ts

@@ -0,0 +1,16 @@
+export const beforeNow = (date: Date) => {
+  const now = new Date()
+  // 1分钟内发布的,展示刚刚;
+  if (now.getTime() - date.getTime() < 60 * 1000) return '刚刚'
+  // 大于1分钟小于1小时内发布的,展示x分钟前;
+  if (now.getTime() - date.getTime() < 60 * 60 * 1000)
+    return `${Math.floor((now.getTime() - date.getTime()) / 60 / 1000)}分钟前`
+  // 大于1小时小于1天内发布的,展示x小时前;
+  if (now.getTime() - date.getTime() < 24 * 60 * 60 * 1000)
+    return `${Math.floor((now.getTime() - date.getTime()) / 60 / 60 / 1000)}小时前`
+  // 大于1天且本年内发布的,显示mm-dd hh:mm;
+  if (now.getFullYear() === date.getFullYear())
+    return `${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}`
+  // 不是本年内发布的,显示yyyy-mm-dd hh:mm;
+  return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}`
+}

Some files were not shown because too many files changed in this diff