App.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  1. <script>
  2. import {
  3. init
  4. } from "@/common";
  5. export default {
  6. onLaunch(options) {
  7. // init(options);
  8. // // #ifndef MP-TOUTIAO
  9. // uni.hideTabBar({});
  10. // // #endif
  11. },
  12. };
  13. </script>
  14. <style lang="scss">
  15. /*每个页面公共css */
  16. @import "uview-ui/index.scss";
  17. @import "animate.css";
  18. @import "static/iconfont/iconfont.css";
  19. @import './tuniao-ui/index.scss';
  20. @import './tuniao-ui/iconfont.css';
  21. ::-webkit-scrollbar {
  22. display: none;
  23. width: 0 !important;
  24. height: 0 !important;
  25. -webkit-appearance: none;
  26. background: transparent;
  27. }
  28. ::v-deep uni-swiper .uni-swiper-wrapper {
  29. // background: red !important;
  30. // padding-left: 150rpx;
  31. }
  32. .uni-textarea {
  33. width: 100% !important;
  34. height: 200rpx !important;
  35. }
  36. .uni-easyinput__content {
  37. background: #fff !important;
  38. }
  39. .uni-easyinput__content-input {
  40. height: 78rpx !important;
  41. padding-left: 100rpx !important;
  42. }
  43. .uni-input-placeholder {
  44. // margin-left: 90rpx;
  45. // height: 90rpx;
  46. line-height: 78rpx;
  47. }
  48. .uni-easyinput__content-input {
  49. background: #eee;
  50. border-radius: 50rpx;
  51. height: 120rpx;
  52. }
  53. .flxe {
  54. display: flex;
  55. }
  56. .justify-between {
  57. justify-content: space-between;
  58. }
  59. .flxe-column {
  60. flex-direction: column;
  61. }
  62. .align-center {
  63. align-items: center;
  64. }
  65. .justify-center {
  66. justify-content: center;
  67. }
  68. .flex-wrap {
  69. flex-wrap: wrap;
  70. }
  71. .u-relative,
  72. .u-rela {
  73. position: relative;
  74. }
  75. .u-absolute,
  76. .u-abso {
  77. position: absolute;
  78. }
  79. // nvue不能用标签命名样式,不能放在微信组件中,否则微信开发工具会报警告,无法使用标签名当做选择器
  80. /* #ifndef APP-NVUE */
  81. image {
  82. display: inline-block;
  83. }
  84. // 在weex,也即nvue中,所有元素默认为border-box
  85. view,
  86. text {
  87. box-sizing: border-box;
  88. }
  89. /* #endif */
  90. .u-font-xs {
  91. font-size: 22rpx;
  92. }
  93. .u-font-sm {
  94. font-size: 26rpx;
  95. }
  96. .u-font-md {
  97. font-size: 28rpx;
  98. }
  99. .u-font-lg {
  100. font-size: 30rpx;
  101. }
  102. .u-font-xl {
  103. font-size: 34rpx;
  104. }
  105. .u-flex {
  106. /* #ifndef APP-NVUE */
  107. display: flex;
  108. /* #endif */
  109. flex-direction: row;
  110. align-items: center;
  111. }
  112. .u-flex-wrap {
  113. flex-wrap: wrap;
  114. }
  115. .u-flex-nowrap {
  116. flex-wrap: nowrap;
  117. }
  118. .u-col-center {
  119. align-items: center;
  120. }
  121. .u-col-top {
  122. align-items: flex-start;
  123. }
  124. .u-col-bottom {
  125. align-items: flex-end;
  126. }
  127. .u-row-center {
  128. justify-content: center;
  129. }
  130. .u-row-left {
  131. justify-content: flex-start;
  132. }
  133. .u-row-right {
  134. justify-content: flex-end;
  135. }
  136. .u-row-between {
  137. justify-content: space-between;
  138. }
  139. .u-row-around {
  140. justify-content: space-around;
  141. }
  142. .u-text-left {
  143. text-align: left;
  144. }
  145. .u-text-center {
  146. text-align: center;
  147. }
  148. .u-text-right {
  149. text-align: right;
  150. }
  151. .u-flex-col {
  152. /* #ifndef APP-NVUE */
  153. display: flex;
  154. /* #endif */
  155. flex-direction: column;
  156. }
  157. /**
  158. * 弹性盒三段式布局
  159. */
  160. .page_box {
  161. height: 100%;
  162. width: 100%;
  163. display: flex;
  164. flex-direction: column;
  165. justify-content: space-between;
  166. overflow-x: hidden;
  167. background: $u-bg-color;
  168. }
  169. .scroll-box {
  170. flex: 1;
  171. height: 100%;
  172. position: relative;
  173. }
  174. .content_box {
  175. flex: 1;
  176. overflow-y: auto;
  177. }
  178. /**
  179. * 溢出省略号
  180. * @param {Number} 行数
  181. */
  182. @mixin ellipsis($rowCount: 1) {
  183. @if $rowCount <=1 {
  184. overflow: hidden;
  185. text-overflow: ellipsis;
  186. white-space: nowrap;
  187. }
  188. @else {
  189. min-width: 0;
  190. overflow: hidden;
  191. text-overflow: ellipsis;
  192. display: -webkit-box;
  193. -webkit-line-clamp: $rowCount;
  194. -webkit-box-orient: vertical;
  195. }
  196. }
  197. @for $i from 1 through 12 {
  198. .u-ellipsis-#{$i} {
  199. @include ellipsis($i);
  200. }
  201. }
  202. // 定义flex等分
  203. @for $i from 0 through 12 {
  204. .u-flex-#{$i} {
  205. flex: $i;
  206. }
  207. }
  208. // 定义字体(px)单位,小于20都为px单位字体
  209. @for $i from 9 to 20 {
  210. .u-font-#{$i} {
  211. font-size: $i + px;
  212. }
  213. }
  214. // 定义字体(rpx)单位,大于或等于20的都为rpx单位字体
  215. @for $i from 20 through 40 {
  216. .u-font-#{$i} {
  217. font-size: $i + rpx;
  218. }
  219. }
  220. // 定义内外边距,历遍1-100
  221. @for $i from 0 through 100 {
  222. // 只要双数和能被5除尽的数
  223. @if $i % 2==0 or $i % 5==0 {
  224. // 得出:u-margin-30或者u-m-30
  225. .u-margin-#{$i},
  226. .u-m-#{$i} {
  227. margin: $i + rpx !important;
  228. }
  229. .u-m-x-#{$i} {
  230. margin-left: $i + rpx !important;
  231. margin-right: $i + rpx !important;
  232. }
  233. .u-m-y-#{$i} {
  234. margin-top: $i + rpx !important;
  235. margin-bottom: $i + rpx !important;
  236. }
  237. // 得出:u-padding-30或者u-p-30
  238. .u-padding-#{$i},
  239. .u-p-#{$i} {
  240. padding: $i + rpx !important;
  241. }
  242. .u-p-x-#{$i} {
  243. padding-left: $i + rpx !important;
  244. padding-right: $i + rpx !important;
  245. }
  246. .u-p-y-#{$i} {
  247. padding-top: $i + rpx !important;
  248. padding-bottom: $i + rpx !important;
  249. }
  250. @each $short,
  251. $long in l left,
  252. t top,
  253. r right,
  254. b bottom {
  255. // 缩写版,结果如: u-m-l-30
  256. // 定义外边距
  257. .u-m-#{$short}-#{$i} {
  258. margin-#{$long}: $i + rpx !important;
  259. }
  260. // 定义内边距
  261. .u-p-#{$short}-#{$i} {
  262. padding-#{$long}: $i + rpx !important;
  263. }
  264. // 完整版,结果如:u-margin-left-30
  265. // 定义外边距
  266. .u-margin-#{$long}-#{$i} {
  267. margin-#{$long}: $i + rpx !important;
  268. }
  269. // 定义内边距
  270. .u-padding-#{$long}-#{$i} {
  271. padding-#{$long}: $i + rpx !important;
  272. }
  273. }
  274. }
  275. }
  276. // 重置nvue的默认关于flex的样式
  277. .u-reset-nvue {
  278. flex-direction: row;
  279. align-items: center;
  280. }
  281. </style>