index.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  1. <template>
  2. <view style="height: 100%">
  3. <nav-logo title="我的"></nav-logo>
  4. <view v-if="isLogin" class="imgs_bg">
  5. <view class="infos" v-if="userInfo">
  6. <image :src="$method.splitImgHost(userInfo.avatar, true)" class="avatar"></image>
  7. <view style="color: #ffffff; font-size: 32rpx">{{
  8. userInfo.nickname
  9. }}</view>
  10. <view style="color: #ffffff; font-size: 20rpx; margin-top: 17rpx">{{
  11. userInfo.telphone
  12. }}</view>
  13. </view>
  14. <!-- <image src="/static/me/me_bgpic.jpg" class="bg_pic"></image> -->
  15. </view>
  16. <view class="login_wrap" v-if="!isLogin">
  17. <view class="login_text">您还没有登录哦~</view>
  18. <view class="loginBtn" @click="jumpLogin">立即登录/注册</view>
  19. </view>
  20. <view v-if="isLogin" class="loginBox">
  21. <view class="contents">
  22. <navigator hover-class="none" url="/pages2/learn/my_learn" class="menu_box">
  23. <view class="box_left">
  24. <image src="/static/icon/my_icon2.png" class="my_icon"></image>
  25. <view>我的学时</view>
  26. </view>
  27. <view class="box_right">
  28. 累计
  29. <text>{{ userNums.periodSum }}</text>
  30. 学时未通过
  31. </view>
  32. </navigator>
  33. <navigator hover-class="none" url="/pages5/exam/index" class="menu_box">
  34. <view class="box_left">
  35. <image src="/static/icon/my_icon11.png" class="my_icon"></image>
  36. <view>我的模考</view>
  37. </view>
  38. <view class="box_right">
  39. <text>{{ total1 }}</text>
  40. 个模考预约
  41. </view>
  42. </navigator>
  43. <!-- /pages2/exam/index-->
  44. <navigator hover-class="none" url="/pages2/exam/exam_appointment" class="menu_box">
  45. <view class="box_left">
  46. <image src="/static/icon/my_icon10.png" class="my_icon"></image>
  47. <view>我的考试</view>
  48. </view>
  49. <view class="box_right">
  50. <text>{{ userNums.subscribeSum }}</text>
  51. 考试预约
  52. </view>
  53. </navigator>
  54. <navigator hover-class="none" v-if="!hideBuyState" url="/pages2/order/index" class="menu_box">
  55. <view class="box_left">
  56. <image src="/static/icon/my_icon7.png" class="my_icon"></image>
  57. <view>我的订单</view>
  58. </view>
  59. <view class="box_right">
  60. <text>{{ userNums.orderSum }}</text>
  61. 笔待支付
  62. </view>
  63. </navigator>
  64. <navigator hover-class="none" url="/pages2/msg/index" class="menu_box">
  65. <view class="box_left">
  66. <image src="/static/icon/my_icon8.png" class="my_icon"></image>
  67. <view>我的消息</view>
  68. </view>
  69. <view class="box_right">
  70. <text>{{ userNums.informSum }}</text>
  71. 条未读
  72. </view>
  73. </navigator>
  74. <navigator hover-class="none" url="/pages2/wd/info" class="menu_box">
  75. <view class="box_left">
  76. <image src="/static/icon/my_icon9.png" class="my_icon"></image>
  77. <view>我的资料</view>
  78. </view>
  79. <view class="box_right">
  80. <u-icon name="arrow-right" color="#999" size="24"></u-icon>
  81. </view>
  82. </navigator>
  83. <navigator hover-class="none" url="/pages2/wd/pwd" class="menu_box">
  84. <view class="box_left">
  85. <image src="/static/icon/my_icon9.png" class="my_icon"></image>
  86. <view>修改密码</view>
  87. </view>
  88. <view class="box_right">
  89. <u-icon name="arrow-right" color="#999" size="24"></u-icon>
  90. </view>
  91. </navigator>
  92. <navigator hover-class="none" url="/pages2/wd/stuff" class="menu_box">
  93. <view class="box_left">
  94. <image src="/static/icon/my_icon14.png" class="my_icon"></image>
  95. <view>讲义资料</view>
  96. </view>
  97. <view class="box_right">
  98. <u-icon name="arrow-right" color="#999" size="24"></u-icon>
  99. </view>
  100. </navigator>
  101. </view>
  102. <view class="logout" @click="logout">退出</view>
  103. </view>
  104. <!-- tabbar -->
  105. <myTabbar :backTopBtn="backTopBtn"></myTabbar>
  106. </view>
  107. </template>
  108. <script>
  109. // import { websocket } from '@/common/socket.js';
  110. import {
  111. mapGetters
  112. } from "vuex";
  113. export default {
  114. data() {
  115. return {
  116. backTopBtn:false,
  117. list: [23, 24, 25, 26, 27, 28, 29],
  118. content: "此功能暂未开放",
  119. show: false,
  120. isLogin: false,
  121. userNums: {},
  122. total1: 0,
  123. total2: 0,
  124. current: 4,
  125. };
  126. },
  127. onLoad(option) {
  128. uni.hideTabBar();
  129. // console.log(option,987)
  130. },
  131. onPageScroll(e) {
  132. if (e.scrollTop > 100) {
  133. this.backTopBtn = true
  134. } else {
  135. this.backTopBtn = false
  136. }
  137. },
  138. onShow() {
  139. this.isLogin = this.$method.isLogin();
  140. if (this.isLogin) {
  141. this.$store.state.allowLoading = false;
  142. this.getNums();
  143. this.getCount();
  144. this.goodsLivingSectionList();
  145. this.$store.state.allowLoading = true;
  146. !this.userInfo && this.$api.refreshUserInfo();
  147. }
  148. // this.$store.dispatch('changeTabsNum')
  149. },
  150. methods: {
  151. getCount() {
  152. this.$api
  153. .mockSubscribeListSubscribe({
  154. mockStatus: 0,
  155. pageNum: 1,
  156. pageSize: 1,
  157. })
  158. .then((res) => {
  159. this.total1 = res.data.total;
  160. });
  161. },
  162. goodsLivingSectionList() {
  163. this.$api.goodsLivingSectionList().then((res) => {
  164. this.total2 = res.data.data.length;
  165. });
  166. },
  167. goBank() {
  168. this.$method.checkLock("bank").then((res) => {
  169. uni.navigateTo({
  170. url: "/pages2/wd/question_bank",
  171. });
  172. });
  173. },
  174. getNums() {
  175. this.$api.getinfoAttached().then((res) => {
  176. if (res.data.code === 200) {
  177. this.userNums = res.data.data;
  178. const nums =
  179. res.data.data.informSum +
  180. res.data.data.orderSum +
  181. res.data.data.periodSum +
  182. res.data.data.planSum +
  183. res.data.data.subscribeSum;
  184. this.$store.commit("tabNum", nums);
  185. }
  186. });
  187. },
  188. logout() {
  189. // websocket.stop()
  190. this.$method.exit();
  191. this.isLogin = this.$method.isLogin();
  192. },
  193. jumpLogin() {
  194. this.$navTo.togo("/pages4/login/login");
  195. },
  196. },
  197. computed: {
  198. ...mapGetters(["userInfo", "hideBuyState", "config"])
  199. },
  200. };
  201. </script>
  202. <style>
  203. ::-webkit-scrollbar {
  204. width: 0;
  205. height: 0;
  206. color: transparent;
  207. }
  208. page {
  209. height: 100%;
  210. background-color: #f0f1f5;
  211. }
  212. </style>
  213. <style scoped lang="scss">
  214. .login_wrap {
  215. text-align: center;
  216. margin-top: 100rpx;
  217. .login_text {
  218. color: #007aff;
  219. font-size: 36rpx;
  220. font-weight: bold;
  221. }
  222. .loginBtn {
  223. width: 526rpx;
  224. height: 80rpx;
  225. background: linear-gradient(90deg, #015eea, #00c0fa);
  226. box-shadow: 0rpx 10rpx 16rpx 4rpx rgba(1, 99, 235, 0.04);
  227. border-radius: 40rpx;
  228. color: #ffffff;
  229. line-height: 80rpx;
  230. margin: 0 auto;
  231. margin-top: 50rpx;
  232. }
  233. }
  234. .imgs_bg {
  235. width: 100%;
  236. height: 429rpx;
  237. position: fixed;
  238. z-index: 999;
  239. background: linear-gradient(180deg, rgba(0, 122, 255, 1) 0%, #f0f1f5 100%);
  240. .infos {
  241. position: absolute;
  242. top: 0;
  243. left: 0;
  244. width: 100%;
  245. z-index: 99;
  246. display: flex;
  247. flex-direction: column;
  248. align-items: center;
  249. }
  250. .bg_pic {
  251. width: 100%;
  252. height: 100%;
  253. display: block;
  254. position: absolute;
  255. top: 0;
  256. left: 0;
  257. z-index: 9;
  258. }
  259. }
  260. .avatar {
  261. height: 160rpx;
  262. width: 160rpx;
  263. border-radius: 50%;
  264. margin: 60rpx 0rpx 37rpx 0rpx;
  265. }
  266. .small_menu {
  267. width: 45%;
  268. height: 104rpx;
  269. background: #ffffff;
  270. border-radius: 24rpx;
  271. display: flex;
  272. align-items: center;
  273. padding-left: 20rpx;
  274. margin-top: 30rpx;
  275. }
  276. .two_menu {
  277. font-size: 32rpx;
  278. color: #666;
  279. display: flex;
  280. justify-content: space-between;
  281. }
  282. .my_icon {
  283. width: 56rpx;
  284. height: 56rpx;
  285. margin-right: 20rpx;
  286. }
  287. .menu_box {
  288. height: 130rpx;
  289. background: #ffffff;
  290. // border-radius: 24rpx;
  291. // margin-top: 30rpx;
  292. display: flex;
  293. align-items: center;
  294. // padding: 0 20rpx;
  295. justify-content: space-between;
  296. color: #666666;
  297. font-size: 30rpx;
  298. font-weight: 500;
  299. border-bottom: 1rpx solid #eeeeee;
  300. .box_left {
  301. display: flex;
  302. align-items: center;
  303. }
  304. .box_right {
  305. font-size: 32rpx;
  306. text {
  307. color: #007aff;
  308. margin: 0 5rpx;
  309. }
  310. }
  311. }
  312. .loginBox {
  313. position: relative;
  314. padding: 0 30rpx 200rpx 30rpx;
  315. top: 430rpx;
  316. width: 100%;
  317. margin-top: 30rpx;
  318. .contents {
  319. width: 100%;
  320. height: 100%;
  321. border-radius: 24rpx;
  322. background-color: #ffffff;
  323. padding: 0rpx 30rpx 0rpx 20rpx;
  324. }
  325. }
  326. .login_full_img {
  327. display: block;
  328. width: 100%;
  329. height: 150px !important;
  330. z-index: 300;
  331. top: 0;
  332. position: fixed;
  333. }
  334. .full_img {
  335. display: block;
  336. width: 100%;
  337. z-index: -999;
  338. top: 0;
  339. }
  340. .logout {
  341. color: #999999;
  342. text-align: center;
  343. font-size: 32rpx;
  344. margin-top: 50rpx;
  345. }
  346. </style>