my.vue 7.7 KB

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