index.vue 7.7 KB

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