my.vue 7.2 KB

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