index.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  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. if (this.$method.isLogin()) {
  124. this.orderUserAllBusinessList();
  125. }
  126. },
  127. methods: {
  128. orderUserAllBusinessList() {
  129. this.$api.orderUserAllBusinessList().then(res => {
  130. console.log(res)
  131. })
  132. },
  133. change(e) {
  134. this.businessId = this.list[e.detail.value].id
  135. this.businessName = this.list[e.detail.value].name
  136. this.isLogin = this.$method.isLogin();
  137. if (this.isLogin) {
  138. this.$store.state.allowLoading = false;
  139. this.getCount();
  140. this.goodsLivingSectionList();
  141. this.getNums()
  142. this.$store.state.allowLoading = true;
  143. }
  144. },
  145. getCount() {
  146. this.$api
  147. .mockSubscribeListSubscribe({
  148. mockStatus: 0,
  149. pageNum: 1,
  150. pageSize: 1,
  151. })
  152. .then((res) => {
  153. this.total1 = res.data.total;
  154. });
  155. },
  156. getNums() {
  157. this.$api.getinfoAttached().then((res) => {
  158. if (res.data.code === 200) {
  159. this.userNums = res.data.data;
  160. const nums =
  161. res.data.data.informSum +
  162. res.data.data.orderSum +
  163. res.data.data.periodSum +
  164. res.data.data.planSum +
  165. res.data.data.subscribeSum;
  166. this.$store.commit("tabNum", nums);
  167. }
  168. });
  169. },
  170. goodsLivingSectionList() {
  171. this.$api.goodsLivingSectionList().then((res) => {
  172. this.total2 = res.data.data.length;
  173. });
  174. },
  175. goIndex() {
  176. uni.switchTab({
  177. url:'../index/index'
  178. })
  179. }
  180. },
  181. onReachBottom() {
  182. },
  183. computed: { ...mapGetters(["userInfo"]) },
  184. };
  185. </script>
  186. <style >
  187. page {
  188. background-color: #EAEEF1;
  189. }
  190. </style>
  191. <style scoped lang="scss">
  192. .study-center {
  193. .navbar {
  194. /deep/ .u-navbar-inner {
  195. margin-right: 0 !important;
  196. }
  197. .slot-wrap {
  198. width: 100%;
  199. }
  200. }
  201. .no-course {
  202. margin: 80rpx auto 0;
  203. text-align: center;
  204. .img {
  205. width:360rpx;
  206. }
  207. .title {
  208. margin-top:10rpx;
  209. font-size: 32rpx;
  210. text-align: center;
  211. color: #999999;
  212. }
  213. .btn {
  214. margin:40rpx auto 0;
  215. width: 280rpx;
  216. text-align: center;
  217. line-height: 64rpx;
  218. color:#fff;
  219. font-size: 30rpx;
  220. height: 64rpx;
  221. background: #007AFF;
  222. border-radius: 32rpx;
  223. }
  224. }
  225. .note-list {
  226. background: #FFFFFF;
  227. display: flex;
  228. align-items: center;
  229. padding:0 32rpx;
  230. .picker {
  231. line-height: 80rpx;
  232. height: 80rpx;
  233. flex:1;
  234. }
  235. }
  236. .course-list {
  237. padding:0 32rpx;
  238. .menu_box {
  239. height: 104rpx;
  240. background: #ffffff;
  241. border-radius: 24rpx;
  242. margin-top: 30rpx;
  243. display: flex;
  244. align-items: center;
  245. padding: 0 20rpx;
  246. justify-content: space-between;
  247. color: #666666;
  248. font-size: 32rpx;
  249. .box_left {
  250. display: flex;
  251. align-items: center;
  252. position:relative;
  253. .point {
  254. width:16rpx;
  255. height:16rpx;
  256. border-radius:50%;
  257. background: red;
  258. position:absolute;
  259. left:50rpx;
  260. top:0;
  261. }
  262. }
  263. .box_right {
  264. font-size: 32rpx;
  265. text {
  266. color: #007aff;
  267. margin: 0 5rpx;
  268. }
  269. }
  270. }
  271. .my_icon {
  272. width: 56rpx;
  273. height: 56rpx;
  274. margin-right: 20rpx;
  275. }
  276. }
  277. }
  278. </style>