index.vue 6.4 KB

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