my.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  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">{{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}}/{{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. mounted() {
  132. },
  133. methods: {
  134. getLevel(){
  135. var self = this
  136. this.$api.gradelist().then(res => {
  137. res.data.rows.forEach((item,index) => {
  138. self.userLevelList.push(item.needIntegralEnd)
  139. })
  140. })
  141. },
  142. qd() {
  143. var self = this
  144. var data = {
  145. taskType: 0
  146. }
  147. self.$api.taskSignIn(data).then(res => {
  148. if(res.data.code === 200){
  149. self.getInfoAttached()
  150. }
  151. })
  152. },
  153. jumpDetail(item) {
  154. this.$navTo.togo('/pages2/course/detail', {
  155. id: item.courseId
  156. });
  157. return;
  158. },
  159. init() {
  160. this.getInfoAttached();
  161. this.getLevel()
  162. },
  163. jumpPopup() {
  164. this.show = true;
  165. },
  166. getInfoAttached() {
  167. let self = this;
  168. this.$api.appInfoAttached().then(res => {
  169. self.collectTotal = res.data.data.collectTotal;
  170. self.rank = res.data.data.rank;
  171. self.issue = res.data.data.issue
  172. });
  173. this.studyRecordList();
  174. },
  175. studyRecordList() {
  176. let self = this;
  177. this.$api.studyRecordList().then(res => {
  178. self.list = res.data.rows;
  179. });
  180. }
  181. },
  182. computed: { ...mapGetters(['userInfo']) }
  183. };
  184. </script>
  185. <style>
  186. ::-webkit-scrollbar {
  187. width: 0;
  188. height: 0;
  189. color: transparent;
  190. }
  191. </style>
  192. <style scoped>
  193. .module2 {
  194. width: 100%;
  195. height: 130rpx;
  196. background: #ffffff;
  197. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  198. border-radius: 32rpx;
  199. margin-top: 30rpx;
  200. padding: 30rpx 0;
  201. }
  202. .tool_t {
  203. font-size: 24rpx;
  204. font-family: PingFang SC;
  205. font-weight: 500;
  206. color: #2f4379;
  207. }
  208. .tool_img {
  209. width: 42rpx;
  210. height: 42rpx;
  211. }
  212. .module {
  213. width: 100%;
  214. height: 260rpx;
  215. background: #ffffff;
  216. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  217. border-radius: 32rpx;
  218. margin-top: 30rpx;
  219. padding: 30rpx 0;
  220. }
  221. .r_sliper {
  222. padding: 0 20rpx;
  223. }
  224. .r_t2 {
  225. font-size: 20rpx;
  226. font-family: PingFang SC;
  227. font-weight: 400;
  228. color: #2f4379;
  229. }
  230. .r_image {
  231. width: 278rpx;
  232. height: 134rpx;
  233. }
  234. .r_t1 {
  235. font-size: 24rpx;
  236. font-family: PingFang SC;
  237. font-weight: 500;
  238. color: #2f4379;
  239. padding: 20rpx;
  240. }
  241. .record {
  242. width: 100%;
  243. height: 260rpx;
  244. background: #ffffff;
  245. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  246. border-radius: 32rpx;
  247. white-space: nowrap;
  248. overflow: hidden;
  249. }
  250. page {
  251. background: #fdfdfd;
  252. }
  253. .head_t2 {
  254. font-size: 32rpx;
  255. font-family: MF YiHei (Noncommercial);
  256. font-weight: bold;
  257. color: #2f4379;
  258. }
  259. .head_t1 {
  260. font-size: 24rpx;
  261. font-family: PingFang SC;
  262. font-weight: bold;
  263. color: #2f4379;
  264. opacity: 0.6;
  265. }
  266. .qiandao {
  267. float: right;
  268. width: 100rpx;
  269. height: 40rpx;
  270. background: #2f4379;
  271. border-radius: 20rpx 0rpx 0rpx 20rpx;
  272. color: #ffffff;
  273. text-align: center;
  274. }
  275. .progress_text {
  276. font-size: 24rpx;
  277. font-family: PingFang SC;
  278. font-weight: 800;
  279. color: #2f4379;
  280. position: relative;
  281. top: 15rpx;
  282. }
  283. .tag {
  284. font-size: 24rpx;
  285. font-family: PingFang SC;
  286. font-weight: bold;
  287. color: #2f4379;
  288. margin-left: 30rpx;
  289. border: 1px solid #2f4379;
  290. border-radius: 20px;
  291. padding: 6rpx;
  292. }
  293. .name {
  294. font-size: 32rpx;
  295. font-family: PingFang SC;
  296. font-weight: 800;
  297. color: #2f4379;
  298. }
  299. .wrap {
  300. padding: 24rpx;
  301. }
  302. .head {
  303. padding-top: 30rpx;
  304. background-color: #ffffff;
  305. padding-bottom: 20rpx;
  306. }
  307. .avatar {
  308. width: 140rpx;
  309. height: 140rpx;
  310. border-radius: 50%;
  311. }
  312. </style>