index.ux 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <template>
  2. <div class="page-column">
  3. <image class="w h-350" src="https://ytnovels.oss-cn-shanghai.aliyuncs.com/appStatic/images/index_banner.jpg"></image>
  4. <div class="search-hot">
  5. <div class="box" for="(index, item) in hotList">
  6. <text class="title_"> {{ item.title }}</text>
  7. <div class="hot-list" >
  8. <div class="hot-item" style="background-color: {{items.bg}}"
  9. @click="toPage(items.path)" for="(indexs, items) in item.list">
  10. <text class="icon-font-span icon {{ items.name =='一键省电'?'left_0':'left_28' }}" style="color:{{ items.color }}">{{ items.icon }}</text>
  11. <text class="name" style="color:{{ items.color }};"> {{ items.name }}</text>
  12. <text class="btn" style="background-color:{{ items.color }};">立即使用 <span style="font-size: 18px;">▶</span></text>
  13. </div>
  14. </div>
  15. </div>
  16. <div>
  17. <!-- <text @click="fnTest('vibrator')">震动</text> -->
  18. </div>
  19. </div>
  20. </div>
  21. </template>
  22. <script>
  23. import { bookListData } from '../../assets/data/book-list.js'
  24. import vibrator from '@system.vibrator'
  25. import router from '@system.router'
  26. export default {
  27. props: [],
  28. data: {
  29. hotList: [
  30. {
  31. title:'基础功能',
  32. list:[
  33. {name:'一键省电',icon:'\ue607',bg:'#cfffcd',color:'#60b956',path:'yiJianShengDian'},
  34. {name:'声波除尘',icon:'\ue7dc',bg:'#ffd8db',color:'#fb5e53',path:'shengBoChuChen'},
  35. {name:'网络信息',icon:'\ue61d',bg:'#ccccfe',color:'#8370ee',path:'wangLuoXinXi'},
  36. {name:'手机测距',icon:'\uea07',bg:'#80fafb',color:'#02cfdf',path:'shouJiCeJu'},
  37. {name:'WiFi管理',icon:'\ue76c',bg:'#9ed1fe',color:'#3d9aee',path:'wifiGuanLi'},
  38. {name:'手机清理',icon:'\ue60e',bg:'#fad2ec',color:'#ff4bb9',path:'shouJiQingLi'},
  39. {name:'精选壁纸',icon:'\ue640',bg:'#fec2f8',color:'#c95884',path:'jingXuanBiZhi'},
  40. ],
  41. },
  42. {
  43. title:'趣味测评',
  44. list:[
  45. {name:'趣味测评',icon:'\ue6cc',bg:'#e8ffc4',color:'#98ec05',path:'quWeiCePing'},
  46. ],
  47. },
  48. {
  49. title:'知识课堂',
  50. list:[
  51. {name:'养生课堂',icon:'\ue650',bg:'#fdd1c0',color:'#fc7f43',path:'yangShengKeTang'},
  52. {name:'运动计步',icon:'\ue61c',bg:'#9ce4fd',color:'#3d9afb',path:'yunDongJiBu'},
  53. {name:'字体大小',icon:'\ue7b1',bg:'#edcbfd',color:'#d617d1',path:'ziTiDaXiao'},
  54. ],
  55. }
  56. ],
  57. page: 1
  58. },
  59. onReady() {
  60. // this.refreshHostList()
  61. console.log('onReady')
  62. },
  63. fnTest(type){
  64. console.log('type',type)
  65. vibrator.vibrate({
  66. mode: 'long'
  67. })
  68. },
  69. toPage(path) {
  70. router.push({
  71. uri: `pages/tools/${ path }`,
  72. params: { key: 1 }
  73. })
  74. },
  75. }
  76. </script>
  77. <style lang="less">
  78. @import '../../assets/styles/index.less';
  79. @font-face {
  80. font-family: iconfont;
  81. src: url("/assets/iconfont/iconfont.ttf");
  82. }
  83. .icon-font-span {
  84. font-family: iconfont;
  85. font-size: 92px;
  86. /* color: #ff0000; */
  87. }
  88. .left_0{
  89. left: -18px;
  90. }
  91. .left_28{
  92. left: 28px;
  93. }
  94. .icon{
  95. position: absolute;
  96. top: 14px;
  97. /* left: 28px; */
  98. }
  99. .name{
  100. position: absolute;
  101. font-size: 30px;
  102. letter-spacing: 2px;
  103. right: 50px;
  104. top: 40px;
  105. }
  106. .btn{
  107. position: absolute;
  108. background-color: skyblue;
  109. padding: 8px 10px;
  110. border-radius: 30px;
  111. color: #fff;
  112. font-size: 22px;
  113. right: 40px;
  114. bottom: 30px;
  115. }
  116. .search-hot {
  117. background-color: @white;
  118. width: 100%;
  119. padding: @gap-4;
  120. .flex-box-mixins(column, flex-start, flex-start);
  121. .search-title {
  122. width: 100%;
  123. margin-bottom: @gap-4;
  124. .flex-box-mixins(row, space-between, center);
  125. }
  126. .box{
  127. width: 100%;
  128. display: flex;
  129. flex-direction: column;
  130. .title_{
  131. font-size: 30px;
  132. margin: 10px 0;
  133. color: #000;
  134. }
  135. }
  136. .hot-list {
  137. width: 100%;
  138. flex-wrap: wrap;
  139. }
  140. .hot-item {
  141. width: 320px;
  142. height: 200px;
  143. padding: @gap-1 0;
  144. text-align: center;
  145. border-radius: 20px;
  146. margin: 15px @gap-4 15px 0;
  147. }
  148. }
  149. .search-refresh {
  150. .text-primary;
  151. .iconfont;
  152. padding: 0 @gap-3;
  153. }
  154. </style>