index.vue 10 KB

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