index.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <template>
  2. <view :style="{ minHeight: sys.windowHeight + 'px' }"
  3. :class="[$tm.vx.state().tmVuetify.black ? 'black' : 'grey text ']">
  4. <tm-menubars color="primary" title="tm-vuetify" :shadow="0" :showback="false">
  5. <template #left>
  6. <view class="pl-24">
  7. <tm-images :width="86" src="static/logowhite.png"></tm-images>
  8. </view>
  9. </template>
  10. </tm-menubars>
  11. <view>
  12. <view class="fixed fulled overflow" style="z-index: 8;">
  13. <tm-search @confirm="openSearch" v-model="keyword" suffixIcon=" " :showRight="false" :fllowTheme="false"
  14. color="white" :bg-color="$tm.vx.state().tmVuetify.color || 'primary'"
  15. :insertColor="$tm.vx.state().tmVuetify.color || 'primary'" :round="4" placeholder="组件中英文名的关键词"
  16. :shadow="0">
  17. <template #suffixIcon>
  18. <view @click="openSearch">
  19. <tm-tags dense color="primary" model="text">搜索组件</tm-tags>
  20. </view>
  21. </template>
  22. </tm-search>
  23. </view>
  24. <view style="height: 84rpx;"></view>
  25. </view>
  26. <view :class="[$tm.vx.state().tmVuetify.black ? 'black' : $tm.vx.state().tmVuetify.color || 'primary']">
  27. <view class=" py-32" style=""
  28. :class="[$tm.vx.state().tmVuetify.black ? 'grey-darken-5 bk' : $tm.vx.state().tmVuetify.color || 'primary']">
  29. <!-- <navigator url="gonggao" class=" text-align-center text-white pb-12 flex-center mx-32" style="vertical-align: middle;">
  30. <text class="pr-32 text-weight-b text-size-s">来自作者的一条公告>></text>
  31. </navigator> -->
  32. <view class="text-size-s text-align-center text-white opacity-8">
  33. <text class="pr-24 ">当前版本:{{ ver }}</text>
  34. <text>更新时间:{{ time }}</text>
  35. </view>
  36. </view>
  37. <view class="pt-14 pb-n10 round-t-8" :class="[$tm.vx.state().tmVuetify.black ? 'black' : 'grey text ']">
  38. <view class="ma-32 flex-between flex-wrap ">
  39. <view @click="openUrl(item.url)" v-for="(item, index) in list" :key="index"
  40. class=" round-10 mb-n10 shadow-24" style="width: 48%;"
  41. :class="[$tm.vx.state().tmVuetify.black ? 'grey-darken-5 bk' : 'white']">
  42. <view class="flex-center flex-col px-32 py-n12">
  43. <tm-icons :color="$tm.vx.state().tmVuetify.color || 'primary'" :size="130"
  44. :name="item.icon"></tm-icons>
  45. <view class="text-size-lg text-weight-b">{{ item.title }}</view>
  46. <view class="text-size-s py-12 text-align-center">{{ item.label }}</view>
  47. <view>
  48. <!-- <tm-tags color="grey" size="g" model="text">{{ item.btn }}</tm-tags> -->
  49. <tm-button :round="12" text size="s">
  50. <view class="flex-center px-10 vertical-align-middle" style="line-height: 0;">
  51. <text class="pr-10">{{ item.btn }}</text>
  52. <tm-icons :fllowTheme="true" style="line-height: 0;" dense size="20"
  53. name="icon-angle-right"></tm-icons>
  54. </view>
  55. </tm-button>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. <view class="flex-center">
  61. <tm-images :width="60" src="static/logo_great.png"></tm-images>
  62. </view>
  63. <view class="py-24 px-0 text-size-xs text-grey-lighten-1 text mx-32 text-align-center">
  64. 本UI经过细致打磨,并且还在不断的细化中,让它成为高效率、高颜值、高覆盖率的组件库,需要各方努力贡献。
  65. <view>请不要盗版,可免费使用。</view>
  66. <view class=" text-weight-b" :class="[`text-${$tm.vx.state().tmVuetify.color || 'primary'}`]">
  67. 用户Q群:
  68. <text selectable>18593916</text>
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. <tm-dialog v-model="show" title="提醒"
  74. content="因小程序大小限制,本demo页面过大,主体导入的js超过2mb,对于分包已无作用,因此如需查询相关demo请前往H5预览,一定是兼容小程序的,不用担心."></tm-dialog>
  75. <tm-flotbutton :safe="true" color="bg-gradient-primary-accent-b" @click="imte"
  76. :icon="$tm.vx.state().tmVuetify.black ? 'icon-lightbulb-fill' : 'icon-lightbulb'"
  77. :label="$tm.vx.state().tmVuetify.black ? '亮色' : '暗黑'" :show-text="true" :offset="[16, bottom]">
  78. </tm-flotbutton>
  79. <view style="height: 150rpx;" @click="show=true"></view>
  80. </view>
  81. </template>
  82. <script>
  83. import{myRequest} from '@/api/request.js'
  84. export default {
  85. data() {
  86. return {
  87. test: true,
  88. show: false,
  89. keyword: '',
  90. top: 60,
  91. flootBootm: 0,
  92. time: '2022/3/27',
  93. ver: '1.2.30',
  94. sys: null,
  95. bottom: 0,
  96. list: [{
  97. icon: 'https://jx2d.cn/yuwuimages/120/com.png?v=2',
  98. title: '基础组件',
  99. label: '提供了基础组件90+',
  100. url: '/subpages/com/index',
  101. btn: '预览组件'
  102. },
  103. {
  104. icon: 'https://jx2d.cn/yuwuimages/120/theme.png?v=2',
  105. title: '主题切换',
  106. label: '暗黑,其它主题切换',
  107. url: 'themechange',
  108. btn: '前往体验'
  109. },
  110. {
  111. icon: 'https://jx2d.cn/yuwuimages/120/com.png?v=2',
  112. title: 'render',
  113. label: 'canvas渲染引擎',
  114. url: '/pages/index/crender',
  115. btn: '1.0正式版'
  116. },
  117. {
  118. icon: 'https://jx2d.cn/yuwuimages/120/css.png?v=2',
  119. title: '预设样式库',
  120. label: '零CSS写应用',
  121. url: '/subpages/csspage/csspage',
  122. btn: '预览相关'
  123. },
  124. {
  125. icon: 'https://jx2d.cn/yuwuimages/120/lottie.png?v=2',
  126. title: 'lottie动画',
  127. label: '提供了对lottie的封装',
  128. url: '/subpages/lottie/index',
  129. btn: '前往体验'
  130. },
  131. {
  132. icon: 'https://jx2d.cn/yuwuimages/120/echarts.png?v=2',
  133. title: 'Echarts',
  134. label: '对百度图表的封装',
  135. url: '/subpages/echarts/index',
  136. btn: '前往体验'
  137. },
  138. {
  139. icon: 'https://jx2d.cn/yuwuimages/120/yewu.png?v=2',
  140. title: '业务组件',
  141. label: '提供了相关行业的组件',
  142. url: '/subpages/food/index',
  143. btn: '预览相关'
  144. },
  145. {
  146. icon: 'https://jx2d.cn/yuwuimages/120/moban.png?v=2',
  147. title: '页面模板',
  148. label: '相关行业的页面模板',
  149. url: '/subpages/moban/index',
  150. btn: '预览模板'
  151. },
  152. {
  153. icon: 'https://jx2d.cn/yuwuimages/120/game.png?v=2',
  154. title: '游戏抽奖',
  155. label: '转盘|老虎机|九宫格等',
  156. url: '/subpages/yewu/index',
  157. btn: '体验相关'
  158. }
  159. ]
  160. };
  161. },
  162. onLoad() {
  163. // #ifdef MP
  164. this.top = uni.upx2px(150);
  165. // #endif
  166. },
  167. created() {
  168. this.sys = uni.getSystemInfoSync();
  169. console.log(this.sys)
  170. },
  171. methods: {
  172. openSearch() {
  173. uni.navigateTo({
  174. url: 'search?key=' + this.keyword
  175. });
  176. },
  177. openUrl(url) {
  178. let t = this;
  179. uni.navigateTo({
  180. url: url,
  181. fail: e => {
  182. t.show = true;
  183. }
  184. });
  185. },
  186. imte() {
  187. this.$tm.theme.setBlack();
  188. },
  189. },
  190. }
  191. </script>
  192. <style lang="scss">
  193. </style>