index.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. <template>
  2. <view class="study-center">
  3. <u-navbar
  4. :is-back="false"
  5. title="学习中心"
  6. class="navbar"
  7. :border-bottom="false"
  8. title-color="#333333"
  9. back-icon-color="#ffffff"
  10. >
  11. <view class="slot-wrap">
  12. <image
  13. src="/static/logo2.png"
  14. style="width: 178rpx; height: 31rpx; margin-left: 30rpx"
  15. ></image>
  16. </view>
  17. </u-navbar>
  18. <view class="no-course" v-if="false">
  19. <image class="img" src="/static/no-course.png" mode="widthFix"></image>
  20. <view class="title">暂无学习内容</view>
  21. <view class="title">请先购买课程/题库</view>
  22. <view class="btn" @click="goIndex">马上选课/选题</view>
  23. </view>
  24. <view class="note-list">
  25. <picker class='picker' :range="list" range-key="name" @change="change">
  26. <view class="text">{{businessName || '请选择业务层次'}}</view>
  27. </picker>
  28. <u-icon name="arrow-down"></u-icon>
  29. </view>
  30. <view class="course-list">
  31. <navigator
  32. hover-class="none"
  33. url="/pages5/liveDetail/list"
  34. class="menu_box"
  35. >
  36. <view class="box_left">
  37. <image src="/static/icon/my_icon3.png" class="my_icon">
  38. </image>
  39. <view class="point" v-if="total2 > 0"></view>
  40. <view>我的网课</view>
  41. </view>
  42. <view class="box_right">
  43. <text>{{ total2 }}</text>
  44. 个课程直播中
  45. </view>
  46. </navigator>
  47. <navigator
  48. hover-class="none"
  49. url="/pages5/liveDetail/list"
  50. class="menu_box"
  51. >
  52. <view class="box_left">
  53. <image src="/static/icon/my_icon12.png" class="my_icon">
  54. </image>
  55. <view class="point" v-if="total2 > 0"></view>
  56. <view>我的直播课</view>
  57. </view>
  58. <view class="box_right">
  59. <text>{{ total2 }}</text>
  60. 个课程直播中
  61. </view>
  62. </navigator>
  63. <navigator
  64. hover-class="none"
  65. url="/pages2/learn/my_learn"
  66. class="menu_box"
  67. >
  68. <view class="box_left">
  69. <image src="/static/icon/my_icon2.png" class="my_icon"></image>
  70. <view class="point" v-if="userNums.periodSum > 0"></view>
  71. <view>我的学时</view>
  72. </view>
  73. <view class="box_right">
  74. 累计
  75. <text>{{ userNums.periodSum }}</text>
  76. 学时未通过
  77. </view>
  78. </navigator>
  79. <navigator hover-class="none" url="/pages5/exam/index" class="menu_box">
  80. <view class="box_left">
  81. <image src="/static/icon/my_icon11.png" class="my_icon"></image>
  82. <view class="point" v-if="total1 > 0"></view>
  83. <view>我的模考</view>
  84. </view>
  85. <view class="box_right">
  86. <text>{{ total1 }}</text>
  87. 个模考预约
  88. </view>
  89. </navigator>
  90. <navigator hover-class="none" url="/pages2/exam/index" class="menu_box">
  91. <view class="box_left">
  92. <image src="/static/icon/my_icon10.png" class="my_icon"></image>
  93. <view class="point" v-if="userNums.subscribeSum > 0"></view>
  94. <view>我的考试</view>
  95. </view>
  96. <view class="box_right">
  97. <text>{{ userNums.subscribeSum }}</text>
  98. 考试预约
  99. </view>
  100. </navigator>
  101. </view>
  102. </view>
  103. </template>
  104. <script>
  105. import { mapGetters } from "vuex";
  106. export default {
  107. components: {},
  108. data() {
  109. return {
  110. list:[{name:'继续教育-建造师-二级',id:1},{name:'继续教育-建造师-一级',id:2}],
  111. businessId:'',
  112. businessName:'',
  113. userNums: {},
  114. total1: 0,
  115. total2: 0,
  116. };
  117. },
  118. onPullDownRefresh() {
  119. },
  120. onLoad(option) {
  121. },
  122. onShow() {
  123. },
  124. methods: {
  125. change(e) {
  126. this.businessId = this.list[e.detail.value].id
  127. this.businessName = this.list[e.detail.value].name
  128. this.isLogin = this.$method.isLogin();
  129. if (this.isLogin) {
  130. this.$store.state.allowLoading = false;
  131. this.getCount();
  132. this.goodsLivingSectionList();
  133. this.getNums()
  134. this.$store.state.allowLoading = true;
  135. }
  136. },
  137. getCount() {
  138. this.$api
  139. .mockSubscribeListSubscribe({
  140. mockStatus: 0,
  141. pageNum: 1,
  142. pageSize: 1,
  143. })
  144. .then((res) => {
  145. this.total1 = res.data.total;
  146. });
  147. },
  148. getNums() {
  149. this.$api.getinfoAttached().then((res) => {
  150. if (res.data.code === 200) {
  151. this.userNums = res.data.data;
  152. const nums =
  153. res.data.data.informSum +
  154. res.data.data.orderSum +
  155. res.data.data.periodSum +
  156. res.data.data.planSum +
  157. res.data.data.subscribeSum;
  158. this.$store.commit("tabNum", nums);
  159. }
  160. });
  161. },
  162. goodsLivingSectionList() {
  163. this.$api.goodsLivingSectionList().then((res) => {
  164. this.total2 = res.data.data.length;
  165. });
  166. },
  167. goIndex() {
  168. uni.switchTab({
  169. url:'../index/index'
  170. })
  171. }
  172. },
  173. onReachBottom() {
  174. },
  175. computed: { ...mapGetters(["userInfo"]) },
  176. };
  177. </script>
  178. <style >
  179. page {
  180. background-color: #EAEEF1;
  181. }
  182. </style>
  183. <style scoped lang="scss">
  184. .study-center {
  185. .navbar {
  186. /deep/ .u-navbar-inner {
  187. margin-right: 0 !important;
  188. }
  189. .slot-wrap {
  190. width: 100%;
  191. }
  192. }
  193. .no-course {
  194. margin: 80rpx auto 0;
  195. text-align: center;
  196. .img {
  197. width:360rpx;
  198. }
  199. .title {
  200. margin-top:10rpx;
  201. font-size: 32rpx;
  202. text-align: center;
  203. color: #999999;
  204. }
  205. .btn {
  206. margin:40rpx auto 0;
  207. width: 280rpx;
  208. text-align: center;
  209. line-height: 64rpx;
  210. color:#fff;
  211. font-size: 30rpx;
  212. height: 64rpx;
  213. background: #007AFF;
  214. border-radius: 32rpx;
  215. }
  216. }
  217. .note-list {
  218. background: #FFFFFF;
  219. display: flex;
  220. align-items: center;
  221. padding:0 32rpx;
  222. .picker {
  223. line-height: 80rpx;
  224. height: 80rpx;
  225. flex:1;
  226. }
  227. }
  228. .course-list {
  229. padding:0 32rpx;
  230. .menu_box {
  231. height: 104rpx;
  232. background: #ffffff;
  233. border-radius: 24rpx;
  234. margin-top: 30rpx;
  235. display: flex;
  236. align-items: center;
  237. padding: 0 20rpx;
  238. justify-content: space-between;
  239. color: #666666;
  240. font-size: 32rpx;
  241. .box_left {
  242. display: flex;
  243. align-items: center;
  244. position:relative;
  245. .point {
  246. width:16rpx;
  247. height:16rpx;
  248. border-radius:50%;
  249. background: red;
  250. position:absolute;
  251. left:50rpx;
  252. top:0;
  253. }
  254. }
  255. .box_right {
  256. font-size: 32rpx;
  257. text {
  258. color: #007aff;
  259. margin: 0 5rpx;
  260. }
  261. }
  262. }
  263. .my_icon {
  264. width: 56rpx;
  265. height: 56rpx;
  266. margin-right: 20rpx;
  267. }
  268. }
  269. }
  270. </style>