You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

App.vue 4.5 KiB

4 years ago
4 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
3 years ago
4 years ago
4 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. <script>
  2. /**
  3. * vuex管理登陆状态,具体可以参考官方登陆模板示例.
  4. */
  5. import {
  6. mapMutations,
  7. mapState
  8. } from 'vuex';
  9. export default {
  10. methods: {
  11. ...mapMutations(['login', 'logout', 'setUserInfo']),
  12. // #ifdef H5
  13. // 检查登录状态
  14. async checkLogin() {
  15. let user = uni.getStorageSync('userInfo');
  16. if (user) {
  17. this.login(user);
  18. }
  19. let result = await this.$api.request('/user/status');
  20. if (!result) {
  21. // 若没有登录则清空个人信息
  22. this.logout();
  23. uni.navigateTo({
  24. url: '/pages/public/login'
  25. });
  26. }
  27. },
  28. // #endif
  29. },
  30. onLaunch: function () {
  31. // 锁定屏幕竖向
  32. // #ifdef APP-PLUS
  33. plus.screen.lockOrientation('portrait-primary');
  34. // #endif
  35. // 检查用户登录情况
  36. // #ifdef H5
  37. this.checkLogin();
  38. // #endif
  39. // #ifdef MP-WEIXIN
  40. this.$wechatMiniLogin();
  41. // #endif
  42. },
  43. onShow: function () {
  44. console.log('App Show')
  45. },
  46. onHide: function () {
  47. console.log('App Hide')
  48. },
  49. }
  50. </script>
  51. <style lang='scss'>
  52. input {
  53. border: 1px solid #ccc;
  54. border-radius: 4px;
  55. transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;
  56. }
  57. uni-app {
  58. height: auto;
  59. }
  60. body {
  61. max-width: 1024px;
  62. min-height: 100%;
  63. margin: 0 auto;
  64. background-color: #eee;
  65. /* background-image: linear-gradient(to right, #fa709a 0%, #fee140 100%)!important */
  66. }
  67. uni-modal {
  68. .uni-modal__hd {
  69. padding: 20px !important;
  70. }
  71. }
  72. uni-page {
  73. min-height: 100%;
  74. background-color: white;
  75. }
  76. .uni-tabbar {
  77. max-width: 1024px !important;
  78. left: 0;
  79. right: 0;
  80. margin: auto;
  81. }
  82. /* project id 1729059 */
  83. @font-face {
  84. font-family: 'unishop';
  85. font-weight: normal;
  86. font-style: normal;
  87. src: url('https://at.alicdn.com/t/font_1729059_llr8d2acjac.ttf') format('truetype');
  88. }
  89. .ProgressBar {
  90. font-size: 12 rpx;
  91. }
  92. .yticon {
  93. font-family: "unishop" !important;
  94. font-size: 16px;
  95. font-style: normal;
  96. -webkit-font-smoothing: antialiased;
  97. -moz-osx-font-smoothing: grayscale;
  98. }
  99. .icon-shouhuodizhi:before {
  100. content: "\e6b5";
  101. }
  102. .icon-xuanzhong:before {
  103. content: "\e64c";
  104. }
  105. .icon-fenlei:before {
  106. content: "\e71b";
  107. }
  108. .icon-bianji:before {
  109. content: "\e77d";
  110. }
  111. .icon-jiahao:before {
  112. content: "\e616";
  113. }
  114. .icon-jianhao:before {
  115. content: "\e617";
  116. }
  117. .icon-wxpay:before {
  118. content: "\e607";
  119. }
  120. .icon-pay:before {
  121. content: "\e624";
  122. }
  123. .icon-alipay:before {
  124. content: "\e60b";
  125. }
  126. .icon-you:before {
  127. content: "\e65f";
  128. }
  129. .icon-huoche:before {
  130. content: "\e6f0";
  131. }
  132. .icon-shoucang:before {
  133. content: "\e60a";
  134. }
  135. .icon-gouwuche:before {
  136. content: "\e60e";
  137. }
  138. .icon-fangzi:before {
  139. content: "\e657";
  140. }
  141. .icon-daifukuan:before {
  142. content: "\e601";
  143. }
  144. .icon-daifahuo:before {
  145. content: "\e704";
  146. }
  147. .icon-daishouhuo:before {
  148. content: "\e62f";
  149. }
  150. .icon-pingjia:before {
  151. content: "\e61d";
  152. }
  153. .icon-shouhou:before {
  154. content: "\e610";
  155. }
  156. .icon-shoucang-setting:before {
  157. content: "\e612";
  158. }
  159. .icon-setting:before {
  160. content: "\e62b";
  161. }
  162. .icon-dizhi:before {
  163. content: "\e67c";
  164. }
  165. .icon-lajitong:before {
  166. content: "\e615";
  167. }
  168. view,
  169. scroll-view,
  170. swiper,
  171. swiper-item,
  172. cover-view,
  173. cover-image,
  174. icon,
  175. text,
  176. rich-text,
  177. progress,
  178. button,
  179. checkbox,
  180. form,
  181. input,
  182. label,
  183. radio,
  184. slider,
  185. switch,
  186. textarea,
  187. navigator,
  188. audio,
  189. camera,
  190. image,
  191. video {
  192. box-sizing: border-box;
  193. }
  194. /* 骨架屏替代方案 */
  195. .Skeleton {
  196. background: #f3f3f3;
  197. padding: 20 upx 0;
  198. border-radius: 8 upx;
  199. }
  200. /* 图片载入替代方案 */
  201. .image-wrapper {
  202. font-size: 0;
  203. background: #f3f3f3;
  204. border-radius: 4px;
  205. image {
  206. width: 100%;
  207. height: 100%;
  208. transition: .6s;
  209. opacity: 0;
  210. &.loaded {
  211. opacity: 1;
  212. }
  213. }
  214. }
  215. .clamp {
  216. overflow: hidden;
  217. text-overflow: ellipsis;
  218. white-space: nowrap;
  219. display: block;
  220. }
  221. .common-hover {
  222. background: #f5f5f5;
  223. }
  224. /*边框*/
  225. .b-b:after,
  226. .b-t:after {
  227. position: absolute;
  228. z-index: 3;
  229. left: 0;
  230. right: 0;
  231. height: 0;
  232. content: '';
  233. transform: scaleY(.5);
  234. border-bottom: 1px solid $border-color-base;
  235. }
  236. .b-b:after {
  237. bottom: 0;
  238. }
  239. .b-t:after {
  240. top: 0;
  241. }
  242. /* button样式改写 */
  243. uni-button,
  244. button {
  245. height: 80 upx;
  246. line-height: 80 upx;
  247. font-size: $font-lg + 2upx;
  248. font-weight: normal;
  249. &.no-border:before,
  250. &.no-border:after {
  251. border: 0;
  252. }
  253. }
  254. uni-button[type=default],
  255. button[type=default] {
  256. color: $font-color-dark;
  257. }
  258. /* input 样式 */
  259. .input-placeholder {
  260. color: #999999;
  261. }
  262. .placeholder {
  263. color: #999999;
  264. }
  265. </style>