index.ux 4.8 KB

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