ソースを参照

🐳 chore(edit): 添加编辑器文本

陈雪 1 ヶ月 前
コミット
10a31b56a3
5 ファイル変更131 行追加111 行削除
  1. 3 0
      .vscode/settings.json
  2. 1 1
      src/components/shop-tabbar/shop-tabbar.vue
  3. 1 1
      src/pages.json
  4. 111 32
      src/pages/index/index.vue
  5. 15 77
      src/uni.scss

+ 3 - 0
.vscode/settings.json

@@ -38,16 +38,19 @@
   },
   "cSpell.words": [
     "Aplipay",
+    "Attributify",
     "climblee",
     "commitlint",
     "dcloudio",
     "iconfont",
+    "iconify",
     "qrcode",
     "refresherrefresh",
     "scrolltolower",
     "tabbar",
     "Toutiao",
     "unibest",
+    "unocss",
     "uvui",
     "Wechat",
     "WechatMiniprogram",

+ 1 - 1
src/components/shop-tabbar/shop-tabbar.vue

@@ -159,7 +159,7 @@
         .tabbar-item-wrapper {
           .tabbar-item-wrapper-active-bg {
             display: block;
-            box-shadow: 0 0 40rpx 0 rgba($color: #ff4c1b, $alpha: 0.6);
+            @include shop-box-show(40rpx);
           }
         }
       }

+ 1 - 1
src/pages.json

@@ -63,7 +63,7 @@
       "layout": "tabbar",
       "style": {
         "navigationStyle": "custom",
-        "navigationBarTitleText": "首页"
+        "navigationBarTitleText": "%tabbar.home%"
       }
     },
     {

+ 111 - 32
src/pages/index/index.vue

@@ -4,57 +4,136 @@
   layout: 'tabbar',
   style: {
     navigationStyle: 'custom',
-    navigationBarTitleText: '首页',
+    navigationBarTitleText: '%tabbar.home%',
   },
 }
 </route>
 <template>
-  <view
-    class="bg-white overflow-hidden pt-2 px-4"
-    :style="{ marginTop: safeAreaInsets?.top + 'px' }"
-  >
-    <view class="mt-12">
-      <image src="/static/logo.svg" alt="" class="w-28 h-28 block mx-auto" />
+  <view class="bg-white overflow-hidden" :style="{ marginTop: safeAreaInsets?.top + 'px' }">
+    <view class="pos-msg-container">
+      <view class="pos-container">
+        <image style="width: 36rpx" src="@/static/images/pos.svg" mode="widthFix"></image>
+        <view class="pos-name">Serbia</view>
+        <image style="width: 36rpx" src="@/static/images/select.svg" mode="widthFix"></image>
+      </view>
+      <view class="msg-info">
+        <image style="width: 76rpx" src="@/static/images/msg.svg" mode="widthFix"></image>
+      </view>
     </view>
-    <view class="text-center text-4xl main-title-color mt-4">unibest</view>
-    <view class="text-center text-2xl mt-2 mb-8">最好用的 uniapp 开发模板</view>
-
-    <view class="text-justify max-w-100 m-auto text-4 indent mb-2">{{ description }}</view>
-    <view class="text-center mt-8">
-      当前平台是:
-      <text class="text-green-500">{{ PLATFORM.platform }}</text>
+    <view class="search-container">
+      <view class="search-item">
+        <image style="width: 40rpx" src="@/static/images/search.svg" mode="widthFix"></image>
+        <view class="search-text">Search</view>
+      </view>
     </view>
-    <view class="text-center mt-4">
-      模板分支是:
-      <text class="text-green-500">i18n</text>
+    <view class="card-swiper-container">
+      <wd-swiper
+        autoplay
+        v-model:current="current"
+        custom-indicator-class="custom-indicator-class"
+        custom-image-class="custom-image"
+        custom-next-image-class="custom-image-prev"
+        custom-prev-image-class="custom-image-prev"
+        :list="swiperList"
+      ></wd-swiper>
     </view>
+    <view class="hot-category w-28rpx h-28rpx border-4rpx border-indigo-600"></view>
+    <view class="hot-selling"></view>
   </view>
   <tabbar />
 </template>
 
 <script lang="ts" setup>
-  import { TestEnum } from '@/typings'
-  import PLATFORM from '@/utils/platform'
-
   defineOptions({
     name: 'Home',
   })
 
+  const current = ref(0)
+
+  const swiperList = ref([
+    'https://t.xiaoyaotravel.com/image/TourImComplait/messageContent/696b679508664bb4bceb6cc6b06d0cdc.png',
+    'https://registry.npmmirror.com/wot-design-uni-assets/*/files/redpanda.jpg',
+    'https://registry.npmmirror.com/wot-design-uni-assets/*/files/capybara.jpg',
+    'https://registry.npmmirror.com/wot-design-uni-assets/*/files/panda.jpg',
+    'https://registry.npmmirror.com/wot-design-uni-assets/*/files/moon.jpg',
+    'https://registry.npmmirror.com/wot-design-uni-assets/*/files/meng.jpg',
+  ])
+
   // 获取屏幕边界到安全区域距离
   const { safeAreaInsets } = uni.getSystemInfoSync()
-  const author = ref('菲鸽')
-  const description = ref(
-    'unibest 是一个集成了多种工具和技术的 uniapp 开发模板,由 uniapp + Vue3 + Ts + Vite4 + UnoCss + UniUI + VSCode 构建,模板具有代码提示、自动格式化、统一配置、代码片段等功能,并内置了许多常用的基本组件和基本功能,让你编写 uniapp 拥有 best 体验。',
-  )
-  // 测试 uni API 自动引入
-  onLoad(() => {
-    console.log(author)
-    console.log(TestEnum.A)
-  })
 </script>
 
-<style>
-  .main-title-color {
-    color: #d14328;
+<style lang="scss" scoped>
+  .hot-category {
+    background-color: aqua;
+  }
+
+  .card-swiper-container {
+    box-sizing: border-box;
+    padding: 0 16rpx 24rpx;
+    padding-bottom: 24rpx;
+    --wot-swiper-radius: 0;
+    --wot-swiper-item-padding: 0 0;
+    --wot-swiper-nav-dot-color: rgba(255, 169, 145, 0.2);
+    --wot-swiper-nav-dot-active-color: #ff4c1b;
+
+    :deep(.custom-indicator-class) {
+      bottom: -24rpx;
+    }
+    :deep(.custom-image) {
+      border-radius: 12rpx;
+    }
+    :deep(.custom-image-prev) {
+      height: 300rpx !important;
+    }
+  }
+  .search-container {
+    box-sizing: border-box;
+    padding: 0 16rpx 24rpx;
+
+    .search-item {
+      box-sizing: border-box;
+      display: flex;
+      align-items: center;
+      height: 84rpx;
+      padding: 20rpx 24rpx;
+      border: 2rpx solid $shop-bg-line;
+      border-radius: 42rpx;
+
+      .search-text {
+        margin-left: 16rpx;
+        font-family: 'PingFang SC';
+        font-size: 28rpx;
+        font-style: normal;
+        font-weight: 400;
+        line-height: 44rpx; /* 157.143% */
+        color: var(--999, #999);
+        text-align: center;
+      }
+    }
+  }
+  .pos-msg-container {
+    box-sizing: border-box;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    padding: 16rpx 23rpx;
+
+    .pos-container {
+      display: flex;
+      align-items: center;
+      height: 76rpx;
+
+      .pos-name {
+        margin: 0 16rpx;
+        font-family: 'PingFang SC';
+        font-size: 28rpx;
+        font-style: normal;
+        font-weight: 600;
+        line-height: 44rpx; /* 157.143% */
+        color: var(--333, #333);
+        text-align: center;
+      }
+    }
   }
 </style>

+ 15 - 77
src/uni.scss

@@ -1,77 +1,15 @@
-/* stylelint-disable comment-empty-line-before */
-/**
- * 这里是uni-app内置的常用样式变量
- *
- * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
- * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
- *
- */
-
-/**
- * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
- *
- * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
- */
-
-/* 颜色变量 */
-
-/* 行为相关颜色 */
-$uni-color-primary: #007aff;
-$uni-color-success: #4cd964;
-$uni-color-warning: #f0ad4e;
-$uni-color-error: #dd524d;
-
-/* 文字基本颜色 */
-$uni-text-color: #333; // 基本色
-$uni-text-color-inverse: #fff; // 反色
-$uni-text-color-grey: #999; // 辅助灰色,如加载更多的提示信息
-$uni-text-color-placeholder: #808080;
-$uni-text-color-disable: #c0c0c0;
-
-/* 背景颜色 */
-$uni-bg-color: #fff;
-$uni-bg-color-grey: #f8f8f8;
-$uni-bg-color-hover: #f1f1f1; // 点击状态颜色
-$uni-bg-color-mask: rgb(0 0 0 / 40%); // 遮罩颜色
-
-/* 边框颜色 */
-$uni-border-color: #c8c7cc;
-
-/* 尺寸变量 */
-
-/* 文字尺寸 */
-$uni-font-size-sm: 12px;
-$uni-font-size-base: 14px;
-$uni-font-size-lg: 16;
-
-/* 图片尺寸 */
-$uni-img-size-sm: 20px;
-$uni-img-size-base: 26px;
-$uni-img-size-lg: 40px;
-
-/* Border Radius */
-$uni-border-radius-sm: 2px;
-$uni-border-radius-base: 3px;
-$uni-border-radius-lg: 6px;
-$uni-border-radius-circle: 50%;
-
-/* 水平间距 */
-$uni-spacing-row-sm: 5px;
-$uni-spacing-row-base: 10px;
-$uni-spacing-row-lg: 15px;
-
-/* 垂直间距 */
-$uni-spacing-col-sm: 4px;
-$uni-spacing-col-base: 8px;
-$uni-spacing-col-lg: 12px;
-
-/* 透明度 */
-$uni-opacity-disabled: 0.3; // 组件禁用态的透明度
-
-/* 文章场景相关 */
-$uni-color-title: #2c405a; // 文章标题颜色
-$uni-font-size-title: 20px;
-$uni-color-subtitle: #555; // 二级标题颜色
-$uni-font-size-subtitle: 18px;
-$uni-color-paragraph: #3f536e; // 文章段落颜色
-$uni-font-size-paragraph: 15px;
+$shop-primary: #ff4c1b; // 主题色
+$shop-help: #fc7b1c; // 辅助色
+$shop-bg-line: #f2f2f2; // 背景色-分割线
+$shop-text-3: #333; // 文字颜色
+$shop-text-6: #666; // 文字颜色
+$shop-text-9: #999; // 文字颜色
+$shop-white: #fff; // 文字颜色
+
+@mixin shop-gradient-color {
+  background: linear-gradient($shop-primary, $shop-help);
+}
+
+@mixin shop-box-show($limit) {
+  box-shadow: 0 0 $limit 0 rgba($color: $shop-primary, $alpha: 0.6);
+}