keCheng.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <view class="box">
  3. <u-navbar :autoBack="true" title="专家课程" bgColor="rgba(255,255,255,0)" :placeholder="true" titleStyle="font-weight:bold;color:#000000"></u-navbar>
  4. <view class="scarch_box">
  5. <u-search
  6. @custom="search"
  7. :actionStyle="{ color: '#985741', fontSize: '28rpx', fontWeight: 'bold' }"
  8. height="25"
  9. shape="square"
  10. placeholder="搜索课程"
  11. v-model.trim="value"
  12. ></u-search>
  13. </view>
  14. <view class="" v-if="state.course_list.length > 0">
  15. <course-item v-for="(item, index) in state.course_list" :key="index" :item="item"></course-item>
  16. </view>
  17. <u-empty v-else text="暂无课程" mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png"></u-empty>
  18. <view class="kc_box">
  19. <!-- <view class="b-cover">
  20. <image style="width: 100%; height: 100%" src="https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/dt_lb1.jpg" mode="aspectFill"></image>
  21. </view> -->
  22. <!-- <view class="b-main">
  23. <view class="text_23">
  24. <view class="">学习文物新知识</view>
  25. <view class="text_25">讲师:李老师</view>
  26. </view>
  27. <view class="button_6">立即观看</view>
  28. </view> -->
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. let that;
  34. export default {
  35. data() {
  36. return { value: '', state: null };
  37. },
  38. onLoad() {
  39. that = this;
  40. this.getHomeData();
  41. },
  42. methods: {
  43. search() {
  44. console.log(this.value);
  45. },
  46. // 课程
  47. getHomeData() {
  48. this.$api.getHomeData({}, function (res) {
  49. console.log(res, 1010);
  50. // this.hasLoad = true
  51. // this.loadingType = -1
  52. that.state = res.data;
  53. console.log(that.state, 1010);
  54. });
  55. }
  56. }
  57. };
  58. </script>
  59. <style>
  60. .box {
  61. width: 100%;
  62. padding-bottom: 50rpx;
  63. /* background-image: url('https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/xbg_2.png');
  64. background-size: 100% 100%;
  65. background-attachment: fixed;
  66. background-repeat: repeat-y; */
  67. min-height: 100%;
  68. height: auto;
  69. background-color: #fff9e9;
  70. }
  71. .scarch_box {
  72. width: 600rpx;
  73. height: 82rpx;
  74. margin: auto;
  75. padding: 15rpx 0 0 30rpx;
  76. background-image: url('/static/img/search_bg1.png');
  77. background-size: 100% 100%;
  78. }
  79. /deep/.u-search__content.data-v-0a306a29 {
  80. border-radius: 0 !important;
  81. }
  82. .kc_box {
  83. padding: 30upx;
  84. display: flex;
  85. align-items: center;
  86. /* box-shadow: rgba(0, 0, 0, 0.1) 0px 20rpx 15px -6rpx, rgba(0, 0, 0, 0.05) 0px 8rpx 12rpx -4rpx; */
  87. }
  88. .b-cover {
  89. width: 307rpx;
  90. height: 171rpx;
  91. }
  92. .b-main {
  93. flex: 1;
  94. margin-left: 20upx;
  95. }
  96. .text_23 {
  97. color: #272727;
  98. font-size: 30rpx;
  99. margin-top: 10rpx;
  100. font-weight: 600;
  101. }
  102. .button_6 {
  103. background-color: rgba(202, 86, 66, 1);
  104. color: rgba(248, 226, 175, 1);
  105. font-size: 24rpx;
  106. line-height: 45rpx;
  107. height: 42rpx;
  108. width: 137rpx;
  109. text-align: center;
  110. margin: 62rpx 0 0 160rpx;
  111. }
  112. .text_25 {
  113. font-size: 26rpx;
  114. color: #727070;
  115. margin-top: 10rpx;
  116. font-weight: 400;
  117. }
  118. </style>