|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283 |
- <script>
- /**
- * vuex管理登陆状态,具体可以参考官方登陆模板示例
- */
- import {
- mapMutations,
- mapState
- } from 'vuex';
- export default {
- methods: {
- ...mapMutations(['login', 'logout', 'setUserInfo']),
- // #ifdef H5
- // 检查登录状态
- async checkLogin() {
- let user = uni.getStorageSync('userInfo');
- if (user) {
- this.login(user);
- }
- let result = await this.$api.request('/user/status');
- if (!result) {
- // 若没有登录则清空个人信息
- this.logout();
- }
- },
- // #endif
- },
- onLaunch: function() {
- // 锁定屏幕竖向
- // #ifdef APP-PLUS
- plus.screen.lockOrientation('portrait-primary');
- // #endif
-
- // 检查用户登录情况
- // #ifdef H5
- this.checkLogin();
- // #endif
- // #ifdef MP-WEIXIN
- this.$wechatMiniLogin();
- // #endif
-
- },
- onShow: function() {
- console.log('App Show')
-
- },
- onHide: function() {
- console.log('App Hide')
- },
- }
- </script>
-
- <style lang='scss'>
- /* project id 1729059 */
- @font-face {
- font-family: 'unishop';
- font-weight: normal;
- font-style: normal;
- src: url('https://at.alicdn.com/t/font_1729059_llr8d2acjac.ttf') format('truetype');
- }
- @font-face {
- font-family: 'iconfont'; /* Project id 2580225 */
- src: url('//at.alicdn.com/t/font_2580225_f8oa549svjw.ttf?t=1622888027544') format('truetype');
- }
- .yticon {
- font-family: "unishop" !important;
- font-size: 16px;
- font-style: normal;
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
- }
-
- .xbicon{
- font-family: "iconfont" !important;
- font-size: 16px;
- font-style: normal;
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
- }
-
-
- .icon-shouhuodizhi:before{
- content: "\e6b5";
- }
-
- .icon-xuanzhong:before{
- content: "\e64c";
- }
-
- .icon-fenlei:before{
- content: "\e71b";
- }
-
- .icon-bianji:before{
- content: "\e77d";
- }
-
- .icon-jiahao:before{
- content: "\e616";
- }
-
- .icon-jianhao:before{
- content: "\e617";
- }
-
- .icon-wxpay:before{
- content: "\e607";
- }
-
- .icon-pay:before{
- content: "\e624";
- }
-
- .icon-alipay:before{
- content: "\e60b";
- }
-
- .icon-you:before{
- content: "\e65f";
- }
-
- .icon-huoche:before{
- content: "\e6f0";
- }
-
- .icon-shoucang:before{
- content: "\e60a";
- }
-
- .icon-gouwuche:before{
- content: "\e60e";
- }
-
- .icon-fangzi:before{
- content: "\e657";
- }
-
- .icon-daifukuan:before{
- content: "\e601";
- }
-
- .icon-daifahuo:before{
- content: "\e704";
- }
-
- .icon-daishouhuo:before{
- content: "\e62f";
- }
-
- .icon-pingjia:before{
- content: "\e61d";
- }
-
- .icon-shouhou:before{
- content:"\e610";
- }
-
- .icon-shoucang-setting:before{
- content:"\e612";
- }
-
- .icon-setting:before{
- content:"\e62b";
- }
-
- .icon-dizhi:before{
- content: "\e67c";
- }
-
- .icon-lajitong:before{
- content: "\e615";
- }
-
- view,
- scroll-view,
- swiper,
- swiper-item,
- cover-view,
- cover-image,
- icon,
- text,
- rich-text,
- progress,
- button,
- checkbox,
- form,
- input,
- label,
- radio,
- slider,
- switch,
- textarea,
- navigator,
- audio,
- camera,
- image,
- video {
- box-sizing: border-box;
- }
- /* 骨架屏替代方案 */
- .Skeleton {
- background: #f3f3f3;
- padding: 20upx 0;
- border-radius: 8upx;
- }
-
- /* 图片载入替代方案 */
- .image-wrapper {
- font-size: 0;
- background: #f3f3f3;
- border-radius: 4px;
-
- image {
- width: 100%;
- height: 100%;
- transition: .6s;
- opacity: 0;
-
- &.loaded {
- opacity: 1;
- }
- }
- }
-
- .clamp {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- display: block;
- }
-
- .common-hover {
- background: #f5f5f5;
- }
-
- /*边框*/
- .b-b:after,
- .b-t:after {
- position: absolute;
- z-index: 3;
- left: 0;
- right: 0;
- height: 0;
- content: '';
- transform: scaleY(.5);
- border-bottom: 1px solid $border-color-base;
- }
-
- .b-b:after {
- bottom: 0;
- }
-
- .b-t:after {
- top: 0;
- }
-
- /* button样式改写 */
- uni-button,
- button {
- height: 80upx;
- line-height: 80upx;
- font-size: $font-lg + 2upx;
- font-weight: normal;
-
- &.no-border:before,
- &.no-border:after {
- border: 0;
- }
- }
-
- uni-button[type=default],
- button[type=default] {
- color: $font-color-dark;
- }
-
- /* input 样式 */
- .input-placeholder {
- color: #999999;
- }
-
- .placeholder {
- color: #999999;
- }
- </style>
|