index.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. <template>
  2. <view style="padding: 30rpx;" >
  3. <view style="padding: 0 50rpx;">
  4. <uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="button" activeColor="#2F4379"></uni-segmented-control>
  5. </view>
  6. <view >
  7. <view v-show="current === 0">
  8. <view class="content" v-for="(item,index) in list1" :key="index" @click="jumpDetail(item)">
  9. <view>
  10. <u-row >
  11. <u-col span="5" >
  12. <view style="padding: 5rpx;">
  13. <image :src="$method.splitImgHost(item.coverUrl)" class="c_img"></image>
  14. </view>
  15. </u-col>
  16. <u-col span="7" >
  17. <view style="position: relative;height: 134rpx;padding-left: 10rpx;">
  18. <view class="c_title">
  19. {{item.categoryName}}
  20. </view>
  21. </view>
  22. </u-col>
  23. </u-row>
  24. </view>
  25. </view>
  26. </view>
  27. <view v-show="current === 1">
  28. <view class="content" v-for="(item,index) in list2" :key="index" @click="jumpDetail(item)">
  29. <view>
  30. <u-row >
  31. <u-col span="5" >
  32. <view style="padding: 5rpx;">
  33. <image :src="$method.splitImgHost(item.coverUrl)" class="c_img"></image>
  34. </view>
  35. </u-col>
  36. <u-col span="7" >
  37. <view style="position: relative;height: 134rpx;padding-left: 10rpx;">
  38. <view class="c_title">
  39. {{item.bankName}}
  40. </view>
  41. </view>
  42. </u-col>
  43. </u-row>
  44. </view>
  45. </view>
  46. </view>
  47. <view v-show="current === 2">
  48. <view class="content" v-for="(item,index) in list3" :key="index" @click="jumpDetail(item)">
  49. <view>
  50. <u-row >
  51. <u-col span="5" >
  52. <view style="padding: 5rpx;">
  53. <image :src="$method.splitImgHost(item.coverUrl)" class="c_img"></image>
  54. </view>
  55. </u-col>
  56. <u-col span="7" >
  57. <view style="position: relative;height: 134rpx;padding-left: 10rpx;">
  58. <view class="c_title">
  59. {{item.name}}
  60. </view>
  61. </view>
  62. </u-col>
  63. </u-row>
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. </template>
  70. <script>
  71. export default {
  72. data() {
  73. return {
  74. current:0,
  75. items: [
  76. '课程',
  77. '刷题',
  78. '重点考点'
  79. ],
  80. list:[1,1,1,1,1,1,1,1,1,1,1],
  81. list1: [],
  82. list2: [],
  83. list3: [],
  84. paramList: [
  85. {
  86. typeId:0
  87. },
  88. {
  89. typeId:1
  90. },
  91. {
  92. typeId:2
  93. }
  94. ],
  95. }
  96. },
  97. onLoad(option) {
  98. this.getMyCourse()
  99. this.getMyBank()
  100. this.getMyNote()
  101. },
  102. onShow(){
  103. },
  104. methods: {
  105. jumpDetail(item) {
  106. if (this.current == 0) {
  107. this.$navTo.togo('/pages2/course/detail', {
  108. id: item.courseId
  109. });
  110. return;
  111. }
  112. if (this.current == 1) {
  113. this.$navTo.togo('/pages2/bank/detail', {
  114. id: item.bankId
  115. });
  116. return;
  117. }
  118. if (this.current == 2) {
  119. this.$navTo.togo('/pages2/course/keynote', {
  120. id: item.fileId
  121. });
  122. return;
  123. }
  124. },
  125. onClickItem(e){
  126. this.current = e.currentIndex
  127. },
  128. getMyCourse(){
  129. var self = this;
  130. var param = this.paramList[0];
  131. this.$api.getUserBuy(param).then(result => {
  132. console.log(result.data.data.courseVoList,33)
  133. self.list1.push.apply(self.list1, result.data.data.courseVoList);
  134. });
  135. },
  136. getMyBank(){
  137. var self = this;
  138. var param = this.paramList[1];
  139. this.$api.getUserBuy(param).then(result => {
  140. self.list2.push.apply(self.list2, result.data.data.questionBankList);
  141. });
  142. },
  143. getMyNote(){
  144. var self = this;
  145. var param = this.paramList[2];
  146. this.$api.getUserBuy(param).then(result => {
  147. self.list3.push.apply(self.list3, result.data.data.examNoteList);
  148. });
  149. },
  150. },
  151. }
  152. </script>
  153. <style scope>
  154. .c_log{
  155. font-size: 20rpx;
  156. font-family: PingFang SC;
  157. font-weight: 400;
  158. color: #2F4379;
  159. position: absolute;
  160. bottom: 10rpx;
  161. }
  162. .c_title{
  163. font-size: 30rpx;
  164. font-family: PingFang SC;
  165. font-weight: bold;
  166. color: #2F4379;
  167. padding-top: 10rpx;
  168. }
  169. .c_img{
  170. width: 278rpx;
  171. height: 134rpx;
  172. }
  173. .c_t1{
  174. font-size: 20rpx;
  175. color: #2F4379;
  176. padding: 15rpx;
  177. }
  178. .content{
  179. margin-top: 20rpx;
  180. width: 100%;
  181. height: 225rpx;
  182. background: #FFFFFF;
  183. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  184. border-radius: 32rpx;
  185. }
  186. .segmented-control__text{
  187. font-size: 24rpx !important;
  188. }
  189. .segmented-control{
  190. height: 56rpx !important;
  191. background-color: #F8F9FF;
  192. }
  193. page {
  194. background: #FFFFFF;
  195. }
  196. </style>