| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452 |
- <template>
- <view class="column" style="position: relative">
- <view class="top-content">
- <view class="status_bar" :style="{ height: statusBarHeight + 'px' }"></view>
- <view class="top-title">首页</view>
- </view>
-
- <!-- <view class="index-body" :style="{ marginTop: statusBarHeight+64 + 'px' }">
- <swiper
- :autoplay="swiper.autoplay"
- :circular="true"
- class="swipr-box"
- :duration="swiper.duration"
- :easingFunction="swiper.easing"
- :indicatorActiveColor="swiper.activeColor"
- :indicatorColor="swiper.color"
- :indicatorDots="swiper.indicatorDots"
- :interval="swiper.interval"
- :nextMargin="swiper.lrmargin"
- :previousMargin="swiper.lrmargin">
- <swiper-item class="seiper-smbox" v-for="(item, index) in imgUrls" :key="index">
- <navigator hoverClass="none" openType="navigate" :url="item.openpath">
- <image class="slide-image" :src="item.img"></image>
- </navigator>
- </swiper-item>
- </swiper> -->
-
- <!-- 推荐区域 -->
- <view class="featured-section" :style="{ marginTop: statusBarHeight+64 + 'px' }">
- <view class="section-title">
- <span>常用工具</span>
- <!-- <span class="see-all">查看全部 <i class="material-icons">></i></span> -->
- </view>
-
- <view class="featured-tools">
- <view class="featured-tool animate-fade" @click="goToNav('../../pages_tool/pages/qrcode/index')">
- <view class="featured-icon">
- <image style="width: 35px;height:35px" src="/static/images/toolIcon/qrcode.png"></image>
- </view>
- <view class="featured-info">
- <view class="featured-name">生成二维码</view>
- <view class="featured-desc">快速生成各种二维码,支持文本、网址等多种格式</view>
- <!-- <view class="usage-count">
- <i class="material-icons" style="font-size: 16px; margin-right: 5px;">trending_up</i>
- 12.8万使用
- </view> -->
- </view>
- </view>
- <!--
- <view class="featured-tool animate-fade delay-1" @click="goToNav('../../pages_tool/pages/figure/figure')">
- <view class="featured-icon">
- <image style="width: 35px;height:35px" class="img" src="/static/images/toolIcon/sc.png"></image>
- </view>
- <view class="featured-info">
- <view class="featured-name">身材计算</view>
- <view class="featured-desc">快速计算BMI指数,了解身体健康状况</view>
- <view class="usage-count">
- <i class="material-icons" style="font-size: 16px; margin-right: 5px;">trending_up</i>
- 9.5万使用
- </view>
- </view>
- </view> -->
- </view>
- </view>
-
- <!-- 工具网格 -->
- <view class="section-title">所有工具</view>
- <view class="tools-grid" >
- <!-- 循环生成工具卡片 -->
- <view class="tool-card animate-fade" v-for="(item, index) in server" :key="index" @click="goToNav(item.openpath)">
- <view class="tool-icon">
- <image class="img" :src="item.img"></image>
- </view>
- <view class="tool-name">{{ item.text }}</view>
- <view class="tool-badge" v-if="index%4==0">Hot</view>
- </view>
- </view>
-
- <view style="height:60px"></view>
-
-
- </view>
- </view>
- </template>
- <script>
- export default {
- name: 'tools',
- data() {
- return {
- statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
- swiper: {
- indicatorDots: true,
- autoplay: true,
- interval: 5000,
- duration: 1000,
- lrmargin: '40rpx',
- easing: 'easeInOutCubic',
- activeColor: '#fff',
- color: 'rgba(255, 255, 255, .3)'
- },
- imgUrls: [
- {
- img: 'https://zkzh-2025.oss-cn-beijing.aliyuncs.com/fs/20250901/55d56de7b34d4450bb39464a16fc591c.jpg',
- openpath: ''
- }
- ],
- recommend: [
- {
- img: '/static/images/toolIcon/weather.png',
- openpath: '../../pages/weather/weather',
- text: '天气'
- },
- {
- img: '/static/images/toolIcon/qrcode.png',
- openpath: '../../pages/qrcode/index',
- text: '生成二维码'
- },
- {
- img: '/static/images/toolIcon/IP.png',
- openpath: '../../pages/IP/IP',
- text: 'IP地址查询'
- },
- {
- img: '/static/images/toolIcon/hl.png',
- openpath: '../../pages/cand/index',
- text: '程序员黄历'
- }
- ],
- server: [
- {
- img: '/static/images/toolIcon/sdm.png',
- openpath: '../../pages_tool/pages/christmasHat/index/index',
- text: '圣诞帽'
- },
- // {
- // img: '/static/images/toolIcon/sc.png',
- // openpath: '../../pages_tool/pages/figure/figure',
- // text: '身材计算'
- // },
- {
- img: '/static/images/toolIcon/wsyt.png',
- openpath: '../../pages_tool/pages/gojuuonn/gojuuonn',
- text: '五十音图'
- },
- // {
- // img: '/static/images/toolIcon/qrcode.png',
- // openpath: '../../pages_tool/pages/qrcode/index',
- // text: '生成二维码'
- // },
- // {
- // img: '/static/images/toolIcon/cha.png',
- // openpath: '../../pages_tool/pages/pinyin/index',
- // text: '查拼音'
- // },
- // {
- // img: '/static/images/toolIcon/hl.png',
- // openpath: '../../pages_tool/pages/cand/index',
- // text: '程序员黄历'
- // },
- {
- img: '/static/images/toolIcon/clac.png',
- openpath: '../../pages_tool/pages/calc/index',
- text: '计算器'
- },
- {
- img: '/static/images/toolIcon/gz.png',
- openpath: '../../pages_tool/pages/game/game',
- text: '摇骰子'
- },
- {
- img: '/static/images/toolIcon/weather.png',
- openpath: '../../pages_tool/pages/weather/weather',
- text: '天气'
- },
- {
- img: '/static/images/toolIcon/IP.png',
- openpath: '../../pages_tool/pages/IP/IP',
- text: 'IP地址查询'
- },
- // {
- // img: '/static/images/toolIcon/MobileHome.png',
- // openpath: '../../pages_tool/pages/MobileHome/MobileHome',
- // text: '手机归属地'
- // },
- {
- img: '/static/images/toolIcon/codePars.png',
- openpath: '../../pages_tool/pages/codePars/codePars',
- text: '电码查询'
- },
- {
- img: '/static/images/toolIcon/historyToday.png',
- openpath: '../../pages_tool/pages/historyToday/historyToday',
- text: '历史今天'
- }
- ]
- };
- },
- methods: {
- goToNav(url){
- uni.navigateTo({
- url:url
- });
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .top-content {
- width: 100%;
- z-index: 10;
- position: fixed;
- top: 0;
- left: 0;
- background-color: #ffffff;
- .top-title {
- height: 88rpx;
- line-height: 88rpx;
- font-size: 42rpx;
- font-family: Source Han Sans CN;
- font-weight: bold;
- color: #222222;
- padding-left: 41rpx;
- background-color: #ffffff;
- }
- }
- .swipr-box {
- width: 100%;
- height: 280rpx;
- padding: 20rpx 0rpx;
- background-color: #fff;
- box-shadow: 0rpx 2rpx 4rpx 0rpx rgba(0, 0, 0, 0.05);
- }
- .seiper-smbox {
- padding: 0rpx 0rpx;
- box-sizing: border-box;
- width: 100%;
- }
- .slide-image {
- display: inline-block;
- width: 100%;
- height: 280rpx;
- border-radius: 10rpx;
- }
- </style>
- <style lang="scss" scoped>
- /* 工具网格布局 */
- .tools-grid {
- display: grid;
- grid-template-columns: repeat(3, 1fr);
- gap: 15px;
- padding: 10px 0;
- }
-
- .tool-card {
- background: white;
- border-radius: 16px;
- padding: 20px 15px;
- text-align: center;
- box-shadow: 0 4px 12px rgba(0,0,0,0.05);
- transition: all 0.3s ease;
- cursor: pointer;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- position: relative;
- }
-
- .tool-card:hover {
- transform: translateY(-5px);
- box-shadow: 0 8px 20px rgba(0,0,0,0.1);
- }
-
- .tool-card:active {
- transform: translateY(0);
- }
-
- .tool-badge {
- position: absolute;
- top: -8px;
- right: -8px;
- background: #ff4757;
- color: white;
- border-radius: 50%;
- width: 22px;
- height: 22px;
- font-size: 12px;
- display: flex;
- align-items: center;
- justify-content: center;
- }
-
- .tool-icon {
- width: 50px;
- height: 50px;
- border-radius: 50%;
- display: flex;
- align-items: center;
- justify-content: center;
- background: #f8f9ff;
- }
-
- .tool-icon .img {
- width: 30px;
- height: 30px;
- }
-
- .tool-name {
- font-size: 14px;
- color: #333;
- font-weight: 500;
- margin-top: 5px;
- }
-
- /* 推荐区域 */
- .featured-section {
- margin: 30px 0;
- }
-
- .section-title {
- font-size: 20px;
- font-weight: 600;
- margin-bottom: 20rpx;
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding-left: 5px;
- }
-
- .see-all {
- font-size: 14px;
- color: #6e8efb;
- display: flex;
- align-items: center;
- }
-
- .featured-tools {
- display: grid;
- grid-template-columns: 1fr;
- gap: 15px;
- }
-
- .featured-tool {
- background: white;
- border-radius: 16px;
- overflow: hidden;
- box-shadow: 0 4px 12px rgba(0,0,0,0.05);
- display: flex;
- transition: all 0.3s ease;
- }
-
- .featured-tool:hover {
- transform: translateY(-3px);
- box-shadow: 0 8px 20px rgba(0,0,0,0.1);
- }
-
- .featured-icon {
- width: 80px;
- display: flex;
- align-items: center;
- justify-content: center;
- background: #f8f9ff;
- }
-
- .featured-icon .img {
- width: 35px;
- height: 35px;
- }
-
- .featured-info {
- padding: 20px;
- flex: 1;
- }
-
- .featured-name {
- font-size: 18px;
- font-weight: 500;
- margin-bottom: 8px;
- }
-
- .featured-desc {
- font-size: 14px;
- color: #666;
- margin-bottom: 12px;
- line-height: 1.4;
- }
-
- .usage-count {
- font-size: 13px;
- color: #888;
- display: flex;
- align-items: center;
- }
-
- .nav-icon {
- font-size: 24px;
- margin-bottom: 4px;
- }
-
- /* 响应式调整 */
- // @media (max-width: 480px) {
- .tools-grid {
- grid-template-columns: repeat(2, 1fr);
- }
-
- .tool-card {
- padding: 15px 10px;
- }
-
- .tool-icon {
- width: 45px;
- height: 45px;
- }
-
- .tool-icon .img {
- width: 35px;
- height: 35px;
- }
-
- .featured-icon {
- width: 70px;
- }
-
- .featured-info {
- padding: 15px;
- }
- //}
-
- /* 动画效果 */
- @keyframes fadeIn {
- from { opacity: 0; transform: translateY(20px); }
- to { opacity: 1; transform: translateY(0); }
- }
-
- .animate-fade {
- animation: fadeIn 0.5s ease forwards;
- }
-
- .delay-1 { animation-delay: 0.1s; }
- .delay-2 { animation-delay: 0.2s; }
- .delay-3 { animation-delay: 0.3s; }
- </style>
|