App.vue 5.8 KB

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