index.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  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. console.log(userInfo.avatar);
  131. },
  132. onPageScroll(e) {
  133. if (e.scrollTop > 100) {
  134. this.backTopBtn = true
  135. } else {
  136. this.backTopBtn = false
  137. }
  138. },
  139. onShow() {
  140. this.isLogin = this.$method.isLogin();
  141. if (this.isLogin) {
  142. this.$store.state.allowLoading = false;
  143. this.getNums();
  144. this.getCount();
  145. this.goodsLivingSectionList();
  146. this.$store.state.allowLoading = true;
  147. !this.userInfo && this.$api.refreshUserInfo();
  148. }
  149. // this.$store.dispatch('changeTabsNum')
  150. },
  151. methods: {
  152. getCount() {
  153. this.$api
  154. .mockSubscribeListSubscribe({
  155. mockStatus: 0,
  156. pageNum: 1,
  157. pageSize: 1,
  158. })
  159. .then((res) => {
  160. this.total1 = res.data.total;
  161. });
  162. },
  163. goodsLivingSectionList() {
  164. this.$api.goodsLivingSectionList().then((res) => {
  165. this.total2 = res.data.data.length;
  166. });
  167. },
  168. goBank() {
  169. this.$method.checkLock("bank").then((res) => {
  170. uni.navigateTo({
  171. url: "/pages2/wd/question_bank",
  172. });
  173. });
  174. },
  175. getNums() {
  176. this.$api.getinfoAttached().then((res) => {
  177. if (res.data.code === 200) {
  178. this.userNums = res.data.data;
  179. const nums =
  180. res.data.data.informSum +
  181. res.data.data.orderSum +
  182. res.data.data.periodSum +
  183. res.data.data.planSum +
  184. res.data.data.subscribeSum;
  185. this.$store.commit("tabNum", nums);
  186. }
  187. });
  188. },
  189. logout() {
  190. // websocket.stop()
  191. this.$method.exit();
  192. this.isLogin = this.$method.isLogin();
  193. },
  194. jumpLogin() {
  195. this.$navTo.togo("/pages4/login/login");
  196. },
  197. },
  198. computed: {
  199. ...mapGetters(["userInfo", "hideBuyState", "config"])
  200. },
  201. };
  202. </script>
  203. <style>
  204. ::-webkit-scrollbar {
  205. width: 0;
  206. height: 0;
  207. color: transparent;
  208. }
  209. page {
  210. height: 100%;
  211. background-color: #f0f1f5;
  212. }
  213. </style>
  214. <style scoped lang="scss">
  215. .login_wrap {
  216. text-align: center;
  217. margin-top: 100rpx;
  218. .login_text {
  219. color: #007aff;
  220. font-size: 36rpx;
  221. font-weight: bold;
  222. }
  223. .loginBtn {
  224. width: 526rpx;
  225. height: 80rpx;
  226. background: linear-gradient(90deg, #015eea, #00c0fa);
  227. box-shadow: 0rpx 10rpx 16rpx 4rpx rgba(1, 99, 235, 0.04);
  228. border-radius: 40rpx;
  229. color: #ffffff;
  230. line-height: 80rpx;
  231. margin: 0 auto;
  232. margin-top: 50rpx;
  233. }
  234. }
  235. .imgs_bg {
  236. width: 100%;
  237. height: 429rpx;
  238. position: fixed;
  239. z-index: 999;
  240. background: linear-gradient(180deg, rgba(0, 122, 255, 1) 0%, #f0f1f5 100%);
  241. .infos {
  242. position: absolute;
  243. top: 0;
  244. left: 0;
  245. width: 100%;
  246. z-index: 99;
  247. display: flex;
  248. flex-direction: column;
  249. align-items: center;
  250. }
  251. .bg_pic {
  252. width: 100%;
  253. height: 100%;
  254. display: block;
  255. position: absolute;
  256. top: 0;
  257. left: 0;
  258. z-index: 9;
  259. }
  260. }
  261. .avatar {
  262. height: 160rpx;
  263. width: 160rpx;
  264. border-radius: 50%;
  265. margin: 60rpx 0rpx 37rpx 0rpx;
  266. }
  267. .small_menu {
  268. width: 45%;
  269. height: 104rpx;
  270. background: #ffffff;
  271. border-radius: 24rpx;
  272. display: flex;
  273. align-items: center;
  274. padding-left: 20rpx;
  275. margin-top: 30rpx;
  276. }
  277. .two_menu {
  278. font-size: 32rpx;
  279. color: #666;
  280. display: flex;
  281. justify-content: space-between;
  282. }
  283. .my_icon {
  284. width: 56rpx;
  285. height: 56rpx;
  286. margin-right: 20rpx;
  287. }
  288. .menu_box {
  289. height: 130rpx;
  290. background: #ffffff;
  291. // border-radius: 24rpx;
  292. // margin-top: 30rpx;
  293. display: flex;
  294. align-items: center;
  295. // padding: 0 20rpx;
  296. justify-content: space-between;
  297. color: #666666;
  298. font-size: 30rpx;
  299. font-weight: 500;
  300. border-bottom: 1rpx solid #eeeeee;
  301. .box_left {
  302. display: flex;
  303. align-items: center;
  304. }
  305. .box_right {
  306. font-size: 32rpx;
  307. text {
  308. color: #007aff;
  309. margin: 0 5rpx;
  310. }
  311. }
  312. }
  313. .loginBox {
  314. position: relative;
  315. padding: 0 30rpx 200rpx 30rpx;
  316. top: 430rpx;
  317. width: 100%;
  318. margin-top: 30rpx;
  319. .contents {
  320. width: 100%;
  321. height: 100%;
  322. border-radius: 24rpx;
  323. background-color: #ffffff;
  324. padding: 0rpx 30rpx 0rpx 20rpx;
  325. }
  326. }
  327. .login_full_img {
  328. display: block;
  329. width: 100%;
  330. height: 150px !important;
  331. z-index: 300;
  332. top: 0;
  333. position: fixed;
  334. }
  335. .full_img {
  336. display: block;
  337. width: 100%;
  338. z-index: -999;
  339. top: 0;
  340. }
  341. .logout {
  342. color: #999999;
  343. text-align: center;
  344. font-size: 32rpx;
  345. margin-top: 50rpx;
  346. }
  347. </style>