index.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <template>
  2. <view >
  3. <image mode="widthFix" :src="isLogin?'/static/wd_bg_login.jpg':'/static/wd_bg.jpg'" :class="isLogin?'login_full_img':'full_img'"></image>
  4. <view style="text-align: center;margin-top: 60rpx;" v-if="!isLogin">
  5. <view style="color: #007AFF ;font-size: 36rpx;font-weight: bold;">
  6. 您还没有登录哦~
  7. </view>
  8. <view class="loginBtn" @click="jumpLogin">
  9. 立即登录/注册
  10. </view>
  11. </view>
  12. <view v-if="isLogin" class="loginBox">
  13. <view style="width: 100%;height: 40px;background-color: #F0F1F5;position: fixed;top: 150px;z-index: 100;"></view>
  14. <view style="display: flex;height: 160rpx;align-items: center; position: fixed;z-index: 999;top: 110px;" v-if="isLogin">
  15. <image :src="userInfo?$method.splitImgHost(userInfo.avatar, true):''" class="avatar"></image>
  16. <view style="margin-left: 20rpx;z-index: 999;">
  17. <view style="color: #FFFFFF;font-size: 36rpx;padding: 10rpx;">{{userInfo.realname}}</view>
  18. <view style="color: #333333;font-size: 36rpx;padding: 10rpx;">{{userInfo.telphone}}</view>
  19. </view>
  20. <view style="background-color: #F0F1F5;height:80rpx;"></view>
  21. </view>
  22. <view style="top: 195px;position: relative;padding-bottom: 30rpx;">
  23. <navigator url="/pages2/plan/index" class="menu_box">
  24. <view style="display: flex;align-items: center;">
  25. <image src="/static/icon/my_icon1.png" class="my_icon"></image>
  26. <view>学习计划</view>
  27. </view>
  28. <view>
  29. 今天有 <text style="color: #007AFF;margin: 0 5rpx;">3</text> 个学习任务
  30. </view>
  31. </navigator>
  32. <view class="two_menu">
  33. <navigator url="/pages2/wd/class" class="small_menu">
  34. <image src="/static/icon/my_icon3.png" class="my_icon"></image>
  35. <view>我的网课</view>
  36. </navigator>
  37. <navigator url="/pages2/wd/question_bank" class="small_menu">
  38. <image src="/static/icon/my_icon4.png" class="my_icon"></image>
  39. <view>我的题库通</view>
  40. </navigator>
  41. </view>
  42. <navigator url="/pages2/learn/my_learn" class="menu_box">
  43. <view style="display: flex;align-items: center;">
  44. <image src="/static/icon/my_icon2.png" class="my_icon"></image>
  45. <view>我的学时</view>
  46. </view>
  47. <view>
  48. 累计<text style="color: #007AFF;margin: 0 5rpx;">3</text> 学时未通过
  49. </view>
  50. </navigator>
  51. <navigator url="/pages2/exam/index" class="menu_box">
  52. <view style="display: flex;align-items: center;">
  53. <image src="/static/icon/my_icon7.png" class="my_icon"></image>
  54. <view>我的考试</view>
  55. </view>
  56. <view>
  57. <text style="color: #007AFF;margin: 0 5rpx;">3</text>考试预约
  58. </view>
  59. </navigator>
  60. <navigator url="/pages2/order/index" class="menu_box">
  61. <view style="display: flex;align-items: center;">
  62. <image src="/static/icon/my_icon7.png" class="my_icon"></image>
  63. <view>我的订单</view>
  64. </view>
  65. <view>
  66. <text style="color: #007AFF;margin: 0 5rpx;">3</text>笔待支付
  67. </view>
  68. </navigator>
  69. <navigator url="/pages2/msg/index" class="menu_box">
  70. <view style="display: flex;align-items: center;">
  71. <image src="/static/icon/my_icon8.png" class="my_icon"></image>
  72. <view>我的消息</view>
  73. </view>
  74. <view>
  75. <text style="color: #007AFF;margin: 0 5rpx;">3</text>条未读
  76. </view>
  77. </navigator>
  78. <navigator url="/pages2/wd/info" class="menu_box">
  79. <view style="display: flex;align-items: center;">
  80. <image src="/static/icon/my_icon9.png" class="my_icon"></image>
  81. <view>我的资料</view>
  82. </view>
  83. </navigator>
  84. <view style="color: #999999;text-align: center;font-size: 32rpx;margin-top: 50rpx;" @click="logout">
  85. 退出
  86. </view>
  87. </view>
  88. </view>
  89. <u-navbar :is-back="false" title="我的" :border-bottom="false" background="{ background: '#ffffff',opacity:0.4; }" title-color="#ffffff" back-icon-color="#ffffff">
  90. <view class="slot-wrap">
  91. <image src="/static/logo.png" style="width: 178rpx;height: 31rpx;margin-left: 30rpx;"></image>
  92. </view>
  93. </u-navbar>
  94. </view>
  95. </template>
  96. <script>
  97. import {mapGetters} from 'vuex';
  98. export default {
  99. components: {
  100. },
  101. data() {
  102. return {
  103. list:[23,24,25,26,27,28,29],
  104. content:'此功能暂未开放',
  105. show:false,
  106. isLogin:false
  107. }
  108. },
  109. onLoad() {
  110. },
  111. onShow(){
  112. this.isLogin = this.$method.isLogin()
  113. console.log(this.isLogin)
  114. },
  115. methods: {
  116. logout(){
  117. console.log(343)
  118. this.$method.isLogout()
  119. this.isLogin = this.$method.isLogin()
  120. uni.switchTab({
  121. url:'/pages/index/index'
  122. })
  123. },
  124. jumpLogin(){
  125. this.$navTo.togo('/pages/login/login');
  126. }
  127. },
  128. computed: {...mapGetters(['userInfo'])}
  129. }
  130. </script>
  131. <style>
  132. ::-webkit-scrollbar{
  133. width: 0;
  134. height: 0;
  135. color: transparent;
  136. }
  137. page{
  138. background-color: #F0F1F5;
  139. }
  140. </style>
  141. <style scoped>
  142. .avatar{
  143. height: 70rpx;
  144. width: 70rpx;
  145. border-radius: 50%;
  146. }
  147. .small_menu{
  148. width: 45%;
  149. height: 104rpx;
  150. background: #FFFFFF;
  151. border-radius: 24rpx;
  152. display: flex;
  153. align-items: center;
  154. padding-left: 20rpx;
  155. margin-top: 30rpx;
  156. }
  157. .two_menu{
  158. display: flex;
  159. justify-content:space-between;
  160. }
  161. .my_icon{
  162. width: 56rpx;
  163. height: 56rpx;
  164. margin-right: 20rpx;
  165. }
  166. .menu_box{
  167. height: 104rpx;
  168. background: #FFFFFF;
  169. border-radius: 24rpx;
  170. margin-top: 30rpx;
  171. display: flex;
  172. align-items: center;
  173. padding: 0 20rpx;
  174. justify-content:space-between;
  175. color: #666666;
  176. font-size: 32rpx;
  177. }
  178. .loginBox{
  179. position: relative;
  180. padding:0 30rpx;
  181. }
  182. .avatar{
  183. width: 80px;
  184. height: 80px;
  185. }
  186. .login_full_img {
  187. display: block;
  188. width: 100%;
  189. height: 150px !important;
  190. z-index: 300;
  191. top: 0;
  192. position: fixed;
  193. }
  194. .full_img {
  195. display: block;
  196. width: 100%;
  197. z-index: -999;
  198. top: 0;
  199. }
  200. .loginBtn{
  201. width: 526rpx;
  202. height: 80rpx;
  203. background: linear-gradient(90deg, #015EEA, #00C0FA);
  204. box-shadow: 0rpx 10rpx 16rpx 4rpx rgba(1, 99, 235, 0.04);
  205. border-radius: 40rpx;
  206. color: #FFFFFF;
  207. line-height: 80rpx;
  208. margin: 0 auto;
  209. margin-top: 50rpx;
  210. }
  211. </style>