index.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  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="" :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. export default {
  84. data() {
  85. return {
  86. test: true,
  87. show: false,
  88. keyword: '',
  89. top: 60,
  90. flootBootm: 0,
  91. time: '2022/3/27',
  92. ver: '1.2.30',
  93. sys: null,
  94. bottom: 0,
  95. list: [{
  96. icon: 'https://jx2d.cn/yuwuimages/120/com.png?v=2',
  97. title: '基础组件',
  98. label: '提供了基础组件90+',
  99. url: '/subpages/com/index',
  100. btn: '预览组件'
  101. },
  102. {
  103. icon: 'https://jx2d.cn/yuwuimages/120/theme.png?v=2',
  104. title: '主题切换',
  105. label: '暗黑,其它主题切换',
  106. url: 'themechange',
  107. btn: '前往体验'
  108. },
  109. {
  110. icon: 'https://jx2d.cn/yuwuimages/120/com.png?v=2',
  111. title: 'render',
  112. label: 'canvas渲染引擎',
  113. url: '/pages/index/crender',
  114. btn: '1.0正式版'
  115. },
  116. {
  117. icon: 'https://jx2d.cn/yuwuimages/120/css.png?v=2',
  118. title: '预设样式库',
  119. label: '零CSS写应用',
  120. url: '/subpages/csspage/csspage',
  121. btn: '预览相关'
  122. },
  123. {
  124. icon: 'https://jx2d.cn/yuwuimages/120/lottie.png?v=2',
  125. title: 'lottie动画',
  126. label: '提供了对lottie的封装',
  127. url: '/subpages/lottie/index',
  128. btn: '前往体验'
  129. },
  130. {
  131. icon: 'https://jx2d.cn/yuwuimages/120/echarts.png?v=2',
  132. title: 'Echarts',
  133. label: '对百度图表的封装',
  134. url: '/subpages/echarts/index',
  135. btn: '前往体验'
  136. },
  137. {
  138. icon: 'https://jx2d.cn/yuwuimages/120/yewu.png?v=2',
  139. title: '业务组件',
  140. label: '提供了相关行业的组件',
  141. url: '/subpages/food/index',
  142. btn: '预览相关'
  143. },
  144. {
  145. icon: 'https://jx2d.cn/yuwuimages/120/moban.png?v=2',
  146. title: '页面模板',
  147. label: '相关行业的页面模板',
  148. url: '/subpages/moban/index',
  149. btn: '预览模板'
  150. },
  151. {
  152. icon: 'https://jx2d.cn/yuwuimages/120/game.png?v=2',
  153. title: '游戏抽奖',
  154. label: '转盘|老虎机|九宫格等',
  155. url: '/subpages/yewu/index',
  156. btn: '体验相关'
  157. }
  158. ]
  159. };
  160. },
  161. created() {
  162. this.sys = uni.getSystemInfoSync();
  163. },
  164. onLoad() {
  165. // #ifdef MP
  166. this.top = uni.upx2px(150);
  167. // #endif
  168. // uni.request({
  169. // url: 'https://jisutqybmf.market.alicloudapi.com/weather/query?city=%E5%AE%89%E9%A1%BA&citycode=citycode&cityid=cityid&ip=ip&location=location',
  170. // data:{'src':'南京市'},//传入参数
  171. // method: 'POST',
  172. // success: res => {
  173. // }
  174. // })
  175. uni.request({
  176. url : "https://jisutqybmf.market.alicloudapi.com/weather/query",
  177. type : "post",
  178. beforeSend : function(req) {
  179. req.setRequestHeader("Authorization", "APPCODE acacbfc4fac24722996q34b284935353562340cd77c8be");
  180. },
  181. dataType : "json",
  182. success : function(data) {
  183. },
  184. error : function(e) {
  185. alert("网络异常,请重试");
  186. }
  187. });
  188. },
  189. mounted() {
  190. uni.showTabBar({
  191. animation: true
  192. });
  193. },
  194. methods: {
  195. openSearch() {
  196. uni.navigateTo({
  197. url: 'search?key=' + this.keyword
  198. });
  199. },
  200. openUrl(url) {
  201. let t = this;
  202. uni.navigateTo({
  203. url: url,
  204. fail: e => {
  205. t.show = true;
  206. }
  207. });
  208. },
  209. imte() {
  210. this.$tm.theme.setBlack();
  211. },
  212. }
  213. };
  214. </script>
  215. <style lang="scss">
  216. page,
  217. body {
  218. min-height: 100%;
  219. background-color: #f5f5f5;
  220. }
  221. </style>
  222. <style lang="scss" scoped></style>