tools1.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  1. <template>
  2. <view class="column" style="position: relative">
  3. <view class="top-content">
  4. <view class="status_bar" :style="{ height: statusBarHeight + 'px' }"></view>
  5. <view class="top-title">首页</view>
  6. </view>
  7. <!-- <view class="index-body" :style="{ marginTop: statusBarHeight+64 + 'px' }">
  8. <swiper
  9. :autoplay="swiper.autoplay"
  10. :circular="true"
  11. class="swipr-box"
  12. :duration="swiper.duration"
  13. :easingFunction="swiper.easing"
  14. :indicatorActiveColor="swiper.activeColor"
  15. :indicatorColor="swiper.color"
  16. :indicatorDots="swiper.indicatorDots"
  17. :interval="swiper.interval"
  18. :nextMargin="swiper.lrmargin"
  19. :previousMargin="swiper.lrmargin">
  20. <swiper-item class="seiper-smbox" v-for="(item, index) in imgUrls" :key="index">
  21. <navigator hoverClass="none" openType="navigate" :url="item.openpath">
  22. <image class="slide-image" :src="item.img"></image>
  23. </navigator>
  24. </swiper-item>
  25. </swiper> -->
  26. <!-- 推荐区域 -->
  27. <view class="featured-section" :style="{ marginTop: statusBarHeight+64 + 'px' }">
  28. <view class="section-title">
  29. <span>常用工具</span>
  30. <!-- <span class="see-all">查看全部 <i class="material-icons">></i></span> -->
  31. </view>
  32. <view class="featured-tools">
  33. <view class="featured-tool animate-fade" @click="goToNav('../../pages_tool/pages/qrcode/index')">
  34. <view class="featured-icon">
  35. <image style="width: 35px;height:35px" src="/static/images/toolIcon/qrcode.png"></image>
  36. </view>
  37. <view class="featured-info">
  38. <view class="featured-name">生成二维码</view>
  39. <view class="featured-desc">快速生成各种二维码,支持文本、网址等多种格式</view>
  40. <!-- <view class="usage-count">
  41. <i class="material-icons" style="font-size: 16px; margin-right: 5px;">trending_up</i>
  42. 12.8万使用
  43. </view> -->
  44. </view>
  45. </view>
  46. <!--
  47. <view class="featured-tool animate-fade delay-1" @click="goToNav('../../pages_tool/pages/figure/figure')">
  48. <view class="featured-icon">
  49. <image style="width: 35px;height:35px" class="img" src="/static/images/toolIcon/sc.png"></image>
  50. </view>
  51. <view class="featured-info">
  52. <view class="featured-name">身材计算</view>
  53. <view class="featured-desc">快速计算BMI指数,了解身体健康状况</view>
  54. <view class="usage-count">
  55. <i class="material-icons" style="font-size: 16px; margin-right: 5px;">trending_up</i>
  56. 9.5万使用
  57. </view>
  58. </view>
  59. </view> -->
  60. </view>
  61. </view>
  62. <!-- 工具网格 -->
  63. <view class="section-title">所有工具</view>
  64. <view class="tools-grid" >
  65. <!-- 循环生成工具卡片 -->
  66. <view class="tool-card animate-fade" v-for="(item, index) in server" :key="index" @click="goToNav(item.openpath)">
  67. <view class="tool-icon">
  68. <image class="img" :src="item.img"></image>
  69. </view>
  70. <view class="tool-name">{{ item.text }}</view>
  71. <view class="tool-badge" v-if="index%4==0">Hot</view>
  72. </view>
  73. </view>
  74. <view style="height:60px"></view>
  75. </view>
  76. </view>
  77. </template>
  78. <script>
  79. export default {
  80. name: 'tools',
  81. data() {
  82. return {
  83. statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
  84. swiper: {
  85. indicatorDots: true,
  86. autoplay: true,
  87. interval: 5000,
  88. duration: 1000,
  89. lrmargin: '40rpx',
  90. easing: 'easeInOutCubic',
  91. activeColor: '#fff',
  92. color: 'rgba(255, 255, 255, .3)'
  93. },
  94. imgUrls: [
  95. {
  96. img: 'https://zkzh-2025.oss-cn-beijing.aliyuncs.com/fs/20250901/55d56de7b34d4450bb39464a16fc591c.jpg',
  97. openpath: ''
  98. }
  99. ],
  100. recommend: [
  101. {
  102. img: '/static/images/toolIcon/weather.png',
  103. openpath: '../../pages/weather/weather',
  104. text: '天气'
  105. },
  106. {
  107. img: '/static/images/toolIcon/qrcode.png',
  108. openpath: '../../pages/qrcode/index',
  109. text: '生成二维码'
  110. },
  111. {
  112. img: '/static/images/toolIcon/IP.png',
  113. openpath: '../../pages/IP/IP',
  114. text: 'IP地址查询'
  115. },
  116. {
  117. img: '/static/images/toolIcon/hl.png',
  118. openpath: '../../pages/cand/index',
  119. text: '程序员黄历'
  120. }
  121. ],
  122. server: [
  123. {
  124. img: '/static/images/toolIcon/sdm.png',
  125. openpath: '../../pages_tool/pages/christmasHat/index/index',
  126. text: '圣诞帽'
  127. },
  128. // {
  129. // img: '/static/images/toolIcon/sc.png',
  130. // openpath: '../../pages_tool/pages/figure/figure',
  131. // text: '身材计算'
  132. // },
  133. {
  134. img: '/static/images/toolIcon/wsyt.png',
  135. openpath: '../../pages_tool/pages/gojuuonn/gojuuonn',
  136. text: '五十音图'
  137. },
  138. // {
  139. // img: '/static/images/toolIcon/qrcode.png',
  140. // openpath: '../../pages_tool/pages/qrcode/index',
  141. // text: '生成二维码'
  142. // },
  143. // {
  144. // img: '/static/images/toolIcon/cha.png',
  145. // openpath: '../../pages_tool/pages/pinyin/index',
  146. // text: '查拼音'
  147. // },
  148. // {
  149. // img: '/static/images/toolIcon/hl.png',
  150. // openpath: '../../pages_tool/pages/cand/index',
  151. // text: '程序员黄历'
  152. // },
  153. {
  154. img: '/static/images/toolIcon/clac.png',
  155. openpath: '../../pages_tool/pages/calc/index',
  156. text: '计算器'
  157. },
  158. {
  159. img: '/static/images/toolIcon/gz.png',
  160. openpath: '../../pages_tool/pages/game/game',
  161. text: '摇骰子'
  162. },
  163. {
  164. img: '/static/images/toolIcon/weather.png',
  165. openpath: '../../pages_tool/pages/weather/weather',
  166. text: '天气'
  167. },
  168. {
  169. img: '/static/images/toolIcon/IP.png',
  170. openpath: '../../pages_tool/pages/IP/IP',
  171. text: 'IP地址查询'
  172. },
  173. // {
  174. // img: '/static/images/toolIcon/MobileHome.png',
  175. // openpath: '../../pages_tool/pages/MobileHome/MobileHome',
  176. // text: '手机归属地'
  177. // },
  178. {
  179. img: '/static/images/toolIcon/codePars.png',
  180. openpath: '../../pages_tool/pages/codePars/codePars',
  181. text: '电码查询'
  182. },
  183. {
  184. img: '/static/images/toolIcon/historyToday.png',
  185. openpath: '../../pages_tool/pages/historyToday/historyToday',
  186. text: '历史今天'
  187. }
  188. ]
  189. };
  190. },
  191. methods: {
  192. goToNav(url){
  193. uni.navigateTo({
  194. url:url
  195. });
  196. }
  197. }
  198. };
  199. </script>
  200. <style lang="scss" scoped>
  201. .top-content {
  202. width: 100%;
  203. z-index: 10;
  204. position: fixed;
  205. top: 0;
  206. left: 0;
  207. background-color: #ffffff;
  208. .top-title {
  209. height: 88rpx;
  210. line-height: 88rpx;
  211. font-size: 42rpx;
  212. font-family: Source Han Sans CN;
  213. font-weight: bold;
  214. color: #222222;
  215. padding-left: 41rpx;
  216. background-color: #ffffff;
  217. }
  218. }
  219. .swipr-box {
  220. width: 100%;
  221. height: 280rpx;
  222. padding: 20rpx 0rpx;
  223. background-color: #fff;
  224. box-shadow: 0rpx 2rpx 4rpx 0rpx rgba(0, 0, 0, 0.05);
  225. }
  226. .seiper-smbox {
  227. padding: 0rpx 0rpx;
  228. box-sizing: border-box;
  229. width: 100%;
  230. }
  231. .slide-image {
  232. display: inline-block;
  233. width: 100%;
  234. height: 280rpx;
  235. border-radius: 10rpx;
  236. }
  237. </style>
  238. <style lang="scss" scoped>
  239. /* 工具网格布局 */
  240. .tools-grid {
  241. display: grid;
  242. grid-template-columns: repeat(3, 1fr);
  243. gap: 15px;
  244. padding: 10px 0;
  245. }
  246. .tool-card {
  247. background: white;
  248. border-radius: 16px;
  249. padding: 20px 15px;
  250. text-align: center;
  251. box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  252. transition: all 0.3s ease;
  253. cursor: pointer;
  254. display: flex;
  255. flex-direction: column;
  256. align-items: center;
  257. justify-content: center;
  258. position: relative;
  259. }
  260. .tool-card:hover {
  261. transform: translateY(-5px);
  262. box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  263. }
  264. .tool-card:active {
  265. transform: translateY(0);
  266. }
  267. .tool-badge {
  268. position: absolute;
  269. top: -8px;
  270. right: -8px;
  271. background: #ff4757;
  272. color: white;
  273. border-radius: 50%;
  274. width: 22px;
  275. height: 22px;
  276. font-size: 12px;
  277. display: flex;
  278. align-items: center;
  279. justify-content: center;
  280. }
  281. .tool-icon {
  282. width: 50px;
  283. height: 50px;
  284. border-radius: 50%;
  285. display: flex;
  286. align-items: center;
  287. justify-content: center;
  288. background: #f8f9ff;
  289. }
  290. .tool-icon .img {
  291. width: 30px;
  292. height: 30px;
  293. }
  294. .tool-name {
  295. font-size: 14px;
  296. color: #333;
  297. font-weight: 500;
  298. margin-top: 5px;
  299. }
  300. /* 推荐区域 */
  301. .featured-section {
  302. margin: 30px 0;
  303. }
  304. .section-title {
  305. font-size: 20px;
  306. font-weight: 600;
  307. margin-bottom: 20rpx;
  308. display: flex;
  309. align-items: center;
  310. justify-content: space-between;
  311. padding-left: 5px;
  312. }
  313. .see-all {
  314. font-size: 14px;
  315. color: #6e8efb;
  316. display: flex;
  317. align-items: center;
  318. }
  319. .featured-tools {
  320. display: grid;
  321. grid-template-columns: 1fr;
  322. gap: 15px;
  323. }
  324. .featured-tool {
  325. background: white;
  326. border-radius: 16px;
  327. overflow: hidden;
  328. box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  329. display: flex;
  330. transition: all 0.3s ease;
  331. }
  332. .featured-tool:hover {
  333. transform: translateY(-3px);
  334. box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  335. }
  336. .featured-icon {
  337. width: 80px;
  338. display: flex;
  339. align-items: center;
  340. justify-content: center;
  341. background: #f8f9ff;
  342. }
  343. .featured-icon .img {
  344. width: 35px;
  345. height: 35px;
  346. }
  347. .featured-info {
  348. padding: 20px;
  349. flex: 1;
  350. }
  351. .featured-name {
  352. font-size: 18px;
  353. font-weight: 500;
  354. margin-bottom: 8px;
  355. }
  356. .featured-desc {
  357. font-size: 14px;
  358. color: #666;
  359. margin-bottom: 12px;
  360. line-height: 1.4;
  361. }
  362. .usage-count {
  363. font-size: 13px;
  364. color: #888;
  365. display: flex;
  366. align-items: center;
  367. }
  368. .nav-icon {
  369. font-size: 24px;
  370. margin-bottom: 4px;
  371. }
  372. /* 响应式调整 */
  373. // @media (max-width: 480px) {
  374. .tools-grid {
  375. grid-template-columns: repeat(2, 1fr);
  376. }
  377. .tool-card {
  378. padding: 15px 10px;
  379. }
  380. .tool-icon {
  381. width: 45px;
  382. height: 45px;
  383. }
  384. .tool-icon .img {
  385. width: 35px;
  386. height: 35px;
  387. }
  388. .featured-icon {
  389. width: 70px;
  390. }
  391. .featured-info {
  392. padding: 15px;
  393. }
  394. //}
  395. /* 动画效果 */
  396. @keyframes fadeIn {
  397. from { opacity: 0; transform: translateY(20px); }
  398. to { opacity: 1; transform: translateY(0); }
  399. }
  400. .animate-fade {
  401. animation: fadeIn 0.5s ease forwards;
  402. }
  403. .delay-1 { animation-delay: 0.1s; }
  404. .delay-2 { animation-delay: 0.2s; }
  405. .delay-3 { animation-delay: 0.3s; }
  406. </style>