my.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. <template>
  2. <view>
  3. <u-navbar title="我的" :is-back="false"></u-navbar>
  4. <view class="head">
  5. <u-row>
  6. <u-col span="3" offset="1">
  7. <navigator url="/pages2/wd/avatar" hover-class="none">
  8. <image :src="userInfo != null ? $method.splitImgHost(userInfo.avatar) : ''" class="avatar"></image>
  9. </navigator>
  10. </u-col>
  11. <u-col span="6">
  12. <view style="display: flex;">
  13. <navigator class="name" url="/pages2/wd/avatar" hover-class="none">{{ userInfo.nickname }}</navigator>
  14. <navigator class="tag" url="/pages2/wd/level" hover-class="none">
  15. {{ userInfo.userLevel === null ? '初出茅庐' : levelList[userInfo.userLevel - 1] }}
  16. </navigator>
  17. </view>
  18. <navigator url="/pages2/wd/level" hover-class="none" style="position: relative;margin-top: 20rpx;">
  19. <view class="progress_text">
  20. {{ userInfo.integral === null ? 0 : userInfo.integral }}/{{ userInfo.userLevel === null || userInfo.userLevel == undefined ? '0' : userLevelList[userInfo.userLevel - 1] }}
  21. </view>
  22. <u-line-progress height="8" active-color="#2F4379" :percent="userInfo.integral === null ? 0 : userInfo.integral" :show-percent="false"></u-line-progress>
  23. </navigator>
  24. </u-col>
  25. <view class="qiandao" @click="qd" v-if="issue === 0">签到</view>
  26. <view class="qiandao" v-if="issue === 1">已签到</view>
  27. </u-row>
  28. <view style="margin-top: 20rpx;">
  29. <u-row>
  30. <u-col span="4" text-align="center">
  31. <navigator url="/pages2/wd/collect" hover-class="none">
  32. <view class="head_t1">收藏</view>
  33. <view class="head_t2">{{ collectTotal }}</view>
  34. </navigator>
  35. </u-col>
  36. <u-col span="4" text-align="center">
  37. <navigator url="/pages2/coin/index" hover-class="none">
  38. <view class="head_t1">金币</view>
  39. <view class="head_t2">{{ userInfo.money }}</view>
  40. </navigator>
  41. </u-col>
  42. <u-col span="4" text-align="center">
  43. <navigator url="/pages2/wd/ranking" hover-class="none">
  44. <view class="head_t1">学习排名</view>
  45. <view class="head_t2" v-if="rank > 0">NO.{{ rank }}</view>
  46. <view class="head_t2" v-else>暂未上榜</view>
  47. </navigator>
  48. </u-col>
  49. </u-row>
  50. </view>
  51. </view>
  52. <view style="padding: 30rpx;">
  53. <!-- 学习记录-->
  54. <view class="record" v-if="list.length">
  55. <view class="r_t1">
  56. 最近学习记录
  57. <u-icon name="arrow-right" size="28"></u-icon>
  58. </view>
  59. <scroll-view class="r_sliper" scroll-x="true">
  60. <view v-for="(item, index) in list" :key="index" style="margin-right: 20rpx;display:inline-block" @click="jumpDetail(item)">
  61. <image :src="$method.splitImgHost(item.coverUrl)" class="r_image"></image>
  62. <view class="r_t2">{{ item.courseName }}</view>
  63. </view>
  64. </scroll-view>
  65. </view>
  66. <!-- 模块-->
  67. <view class="module">
  68. <u-row>
  69. <u-col span="3" text-align="center">
  70. <navigator url="/pages2/study/index" hover-class="none">
  71. <image src="/static/tool_1.png" class="tool_img"></image>
  72. <view class="tool_t">我的学习</view>
  73. </navigator>
  74. </u-col>
  75. <u-col span="3" text-align="center">
  76. <navigator url="/pages2/wd/menu" hover-class="none">
  77. <image src="/static/tool_2.png" class="tool_img"></image>
  78. <view class="tool_t">基本资料</view>
  79. </navigator>
  80. </u-col>
  81. <u-col span="3" text-align="center">
  82. <navigator url="/pages2/wd/help" hover-class="none">
  83. <image src="/static/tool_3.png" class="tool_img"></image>
  84. <view class="tool_t">助学活动</view>
  85. </navigator>
  86. </u-col>
  87. <u-col span="3" text-align="center">
  88. <navigator url="/pages2/wd/coupon" hover-class="none">
  89. <image src="/static/tool_7.png" class="tool_img"></image>
  90. <view class="tool_t">优惠券</view>
  91. </navigator>
  92. </u-col>
  93. </u-row>
  94. <view style="margin-top: 30rpx;">
  95. <u-row>
  96. <u-col span="3" text-align="center">
  97. <navigator url="/pages2/wd/enroll" hover-class="none">
  98. <image src="/static/tool_5.png" class="tool_img"></image>
  99. <view class="tool_t">考试报名</view>
  100. </navigator>
  101. </u-col>
  102. <u-col span="3" text-align="center">
  103. <view @click="jumpPopup">
  104. <image src="/static/tool_4.png" class="tool_img"></image>
  105. <view class="tool_t">成长地图</view>
  106. </view>
  107. </u-col>
  108. <u-col span="3" text-align="center">
  109. <navigator url="/pages2/resume/myResume" hover-class="none">
  110. <image src="/static/jianli@3x.png" class="tool_img"></image>
  111. <view class="tool_t">我的简历</view>
  112. </navigator>
  113. </u-col>
  114. <u-col span="3" text-align="center">
  115. <navigator url="/pages2/resume/delivery" hover-class="none">
  116. <image src="/static/toudi@3x.png" class="tool_img"></image>
  117. <view class="tool_t">我的投递</view>
  118. </navigator>
  119. </u-col>
  120. </u-row>
  121. </view>
  122. </view>
  123. <view class="module2">
  124. <u-row>
  125. <u-col span="3" text-align="center">
  126. <view @click="jumpPopup">
  127. <image src="/static/tool_6.png" class="tool_img"></image>
  128. <view class="tool_t">异常反馈</view>
  129. </view>
  130. </u-col>
  131. </u-row>
  132. </view>
  133. </view>
  134. </view>
  135. </template>
  136. <script>
  137. import { mapGetters } from 'vuex';
  138. export default {
  139. name: 'my',
  140. data() {
  141. return {
  142. list: [23, 24, 25, 26, 27, 28, 29],
  143. show: false,
  144. collectTotal: 0,
  145. rank: 0,
  146. issue: 0,
  147. levelList: ['初出茅庐', '崭露头角', '自成一派', '小有名气', '惊艳四座', '初露锋芒'],
  148. userLevelList: []
  149. };
  150. },
  151. methods: {
  152. getLevel() {
  153. var self = this;
  154. this.$api.gradelist().then(res => {
  155. res.data.rows.forEach((item, index) => {
  156. self.userLevelList.push(item.needIntegralEnd);
  157. });
  158. });
  159. },
  160. qd() {
  161. var self = this;
  162. var data = {
  163. taskType: 0
  164. };
  165. self.$api.taskSignIn(data).then(res => {
  166. if (res.data.code === 200) {
  167. self.getInfoAttached();
  168. //刷新用户信息
  169. self.$api.refreshUserInfo();
  170. }
  171. });
  172. },
  173. jumpDetail(item) {
  174. this.$navTo.togo('/pages2/course/detail', {
  175. id: item.courseId
  176. });
  177. return;
  178. },
  179. init() {
  180. this.getInfoAttached();
  181. this.getLevel();
  182. },
  183. jumpPopup() {
  184. uni.showModal({
  185. title: '提示',
  186. content: '此功能暂未开放',
  187. showCancel: false
  188. });
  189. },
  190. getInfoAttached() {
  191. let self = this;
  192. this.$api.appInfoAttached().then(res => {
  193. self.collectTotal = res.data.data.collectTotal;
  194. self.rank = res.data.data.rank;
  195. self.issue = res.data.data.issue;
  196. });
  197. this.studyRecordList();
  198. },
  199. studyRecordList() {
  200. let self = this;
  201. this.$api.studyRecordList().then(res => {
  202. self.list = res.data.rows;
  203. });
  204. }
  205. },
  206. computed: { ...mapGetters(['userInfo']) }
  207. };
  208. </script>
  209. <style>
  210. ::-webkit-scrollbar {
  211. width: 0;
  212. height: 0;
  213. color: transparent;
  214. }
  215. </style>
  216. <style scoped>
  217. .module2 {
  218. width: 100%;
  219. height: 130rpx;
  220. background: #ffffff;
  221. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  222. border-radius: 32rpx;
  223. margin-top: 30rpx;
  224. padding: 30rpx 0;
  225. }
  226. .tool_t {
  227. font-size: 24rpx;
  228. font-family: PingFang SC;
  229. font-weight: 500;
  230. color: #2f4379;
  231. }
  232. .tool_img {
  233. width: 42rpx;
  234. height: 42rpx;
  235. }
  236. .module {
  237. width: 100%;
  238. height: 260rpx;
  239. background: #ffffff;
  240. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  241. border-radius: 32rpx;
  242. margin-top: 30rpx;
  243. padding: 30rpx 0;
  244. }
  245. .r_sliper {
  246. padding: 0 20rpx;
  247. }
  248. .r_t2 {
  249. font-size: 20rpx;
  250. font-family: PingFang SC;
  251. font-weight: 400;
  252. color: #2f4379;
  253. }
  254. .r_image {
  255. width: 278rpx;
  256. height: 134rpx;
  257. }
  258. .r_t1 {
  259. font-size: 24rpx;
  260. font-family: PingFang SC;
  261. font-weight: 500;
  262. color: #2f4379;
  263. padding: 20rpx;
  264. }
  265. .record {
  266. width: 100%;
  267. height: 260rpx;
  268. background: #ffffff;
  269. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  270. border-radius: 32rpx;
  271. white-space: nowrap;
  272. overflow: hidden;
  273. }
  274. page {
  275. background: #fdfdfd;
  276. }
  277. .head_t2 {
  278. font-size: 32rpx;
  279. font-family: MF YiHei (Noncommercial);
  280. font-weight: bold;
  281. color: #2f4379;
  282. }
  283. .head_t1 {
  284. font-size: 24rpx;
  285. font-family: PingFang SC;
  286. font-weight: bold;
  287. color: #2f4379;
  288. opacity: 0.6;
  289. }
  290. .qiandao {
  291. float: right;
  292. width: 100rpx;
  293. height: 40rpx;
  294. background: #2f4379;
  295. border-radius: 20rpx 0rpx 0rpx 20rpx;
  296. color: #ffffff;
  297. text-align: center;
  298. }
  299. .progress_text {
  300. font-size: 24rpx;
  301. font-family: PingFang SC;
  302. font-weight: 800;
  303. color: #2f4379;
  304. position: relative;
  305. top: 15rpx;
  306. }
  307. .tag {
  308. font-size: 24rpx;
  309. font-family: PingFang SC;
  310. font-weight: bold;
  311. color: #2f4379;
  312. margin-left: 30rpx;
  313. border: 1px solid #2f4379;
  314. border-radius: 20px;
  315. padding: 6rpx;
  316. }
  317. .name {
  318. font-size: 32rpx;
  319. font-family: PingFang SC;
  320. font-weight: 800;
  321. color: #2f4379;
  322. }
  323. .wrap {
  324. padding: 24rpx;
  325. }
  326. .head {
  327. padding-top: 30rpx;
  328. background-color: #ffffff;
  329. padding-bottom: 20rpx;
  330. }
  331. .avatar {
  332. width: 140rpx;
  333. height: 140rpx;
  334. border-radius: 50%;
  335. }
  336. </style>