index.vue 6.4 KB

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