uni-events-helper-wx
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.

143 lines
3.4 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. <template>
  2. <view class="content">
  3. <view class="login-box flex_col flex_start">
  4. <image class="bg" src="../../static/images/index/index_bg.png" mode="aspectFit"></image>
  5. <view class="login-info flex_col" v-if="login">
  6. <text>{{userInfo.mobile||"-"}}</text>
  7. <text>您好!</text>
  8. </view>
  9. <view class="button-login " v-else @click="jumpPage('login')">前往登录</view>
  10. </view>
  11. <view class="item flex_row flex_start bg-white padding solid-bottom" @click="jumpPage('messageList')">
  12. <image src="../../static/images/index/index_bell.png" mode=""></image>
  13. <view class="text-m text-left">消息中心</view>
  14. <view class="bandage">99</view>
  15. <image src="../../static/images/index/arrow_right.png" mode=""></image>
  16. </view>
  17. <view class="item flex_row flex_start bg-white padding solid-bottom" @click="clickEvent">
  18. <image src="../../static/images/index/index_cup.png" mode=""></image>
  19. <view class="text-m text-left">活动赛事{{hasLogin}}+{{userInfo.mobile}}</view>
  20. <image src="../../static/images/index/arrow_right.png" mode=""></image>
  21. </view>
  22. <view class="item flex_row flex_start bg-white padding solid-bottom" v-if="login" @click="login=!login">
  23. <image src="../../static/images/index/index_logout.png" mode=""></image>
  24. <view class="text-m text-left" >退出登录</view>
  25. <image src="../../static/images/index/arrow_right.png" mode=""></image>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. import { mapState,mapActions,mapGetters } from 'vuex'
  31. export default {
  32. data() {
  33. return {
  34. address:"",
  35. login:false
  36. };
  37. },
  38. computed:{
  39. ...mapState(['userInfo']),
  40. ...mapGetters(['hasLogin']),
  41. // hasLogin(){
  42. // return this.$store.getters.hasLogin
  43. // }
  44. },
  45. onLoad(parms) {
  46. },
  47. onUnload() {
  48. },
  49. methods: {
  50. ...mapActions(['getUserInfo']),
  51. jumpPage(name){
  52. this.$Router.push({name:name})
  53. // this.$Router.pushTab('/pages/login/login')
  54. },
  55. clickEvent(){
  56. let that = this
  57. if(this.login)this.jumpPage('eventList');
  58. else {
  59. uni.showModal({
  60. title: '提示',
  61. content: '需要登录后才能查看,是否跳转去登录界面?',
  62. success: function (res) {
  63. if (res.confirm) {
  64. that.jumpPage('login');
  65. } else if (res.cancel) {
  66. }
  67. }
  68. });
  69. }
  70. },
  71. }
  72. }
  73. </script>
  74. <style lang="less" scoped>
  75. .content{
  76. .login-box{
  77. position: relative;
  78. width: 750rpx;
  79. height: 480rpx;
  80. > image ,.bg{
  81. width: 100%;height: 100%;
  82. position: absolute;
  83. z-index: 1;
  84. }
  85. .button-login{
  86. margin-top: 132rpx;
  87. color: #009874;
  88. z-index: 20;
  89. width: 240rpx;
  90. height: 96rpx;
  91. background: #FFFFFF;
  92. border-radius: 48rpx;
  93. text-align: center;
  94. line-height: 96rpx;
  95. font-weight: 900;
  96. font-size: 36rpx;
  97. letter-spacing: -0.2rpx;
  98. }
  99. .login-info{
  100. margin-top: 132rpx;
  101. z-index: 20;
  102. font-size: 40rpx;
  103. color: #FFFFFF;
  104. font-weight: 900;
  105. }
  106. }
  107. .item{
  108. color: #333333;
  109. position: relative;
  110. > image:first-child{
  111. width: 52rpx;
  112. height: 52rpx;
  113. margin-right: 14rpx;
  114. }
  115. > image:last-child{
  116. width: 30rpx;
  117. height: 30rpx;
  118. position: absolute;
  119. right: 20rpx;
  120. }
  121. .bandage{
  122. width: 34rpx;
  123. height: 34rpx;
  124. position: absolute;
  125. right: 60rpx;
  126. background: #EA5061;
  127. border-radius: 50%;
  128. font-size: 24rpx;
  129. color: white;
  130. text-align: center;
  131. line-height: 34rpx;
  132. }
  133. }
  134. }
  135. </style>