my.vue 7.5 KB

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