my.vue 7.4 KB

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