index.vue 8.6 KB

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