learn.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. <template>
  2. <view class="container">
  3. <view class="top">
  4. <image class="bg" src="/static/assets/learn-bg.png" mode="widthFix"></image>
  5. <view class="top-box">
  6. <view class="title">《健康生活方式指导》</view>
  7. <view class="txt">
  8. <image src="/static/assets/learn1.png"></image>
  9. <text>共5节课</text>
  10. </view>
  11. </view>
  12. </view>
  13. <view class="container-body">
  14. <view class="center-box">
  15. <u-tabs lineColor="#f56c6c" :scrollable="false"
  16. :activeStyle="{color: '#fd694f',fontWeight: 'bold',fontSize:'34rpx'}"
  17. :inactiveStyle="{color: '#787878',fontSize:'34rpx'}" :list="tabList" @click="ontabList">
  18. </u-tabs>
  19. <view class="progress-box">
  20. <image src="/static/assets/learn2.png"></image>
  21. <text class="title">听课进度</text>
  22. <text class="txt">已学习<text style="color: #f74d3a;">0</text>/5节课</text>
  23. </view>
  24. <view class="progress">
  25. <u-line-progress inactiveColor="#f0f4f7" activeColor="#3c9cff" :percentage="0"
  26. :showText="false"></u-line-progress>
  27. <text>0%</text>
  28. </view>
  29. </view>
  30. <!-- <view class="list">
  31. <view class="img-box">
  32. <view class="sub">第一课</view>
  33. <image src="/static/assets/learn-img.png"></image>
  34. </view>
  35. <view class="right">
  36. <view class="title">第一课 如何防控烦人的慢性病</view>
  37. <view class="bottom">
  38. <view class="tip">
  39. <image src="/static/assets/learn3.png" mode="widthFix"></image>
  40. <text>答题送金币+200</text>
  41. </view>
  42. <view class="btn">已学习4%</view>
  43. </view>
  44. </view>
  45. </view> -->
  46. <view class="list" v-for="(item,index) in learnList" :key="index">
  47. <view class="img-box">
  48. <view class="sub">第一课</view>
  49. <image src="/static/assets/learn-img.png"></image>
  50. </view>
  51. <view class="right">
  52. <view class="title">{{item.title}}</view>
  53. <view class="bottom">
  54. <view class="tip">
  55. <image :src="item.img" mode="widthFix"></image>
  56. <text>答题送金币+200</text>
  57. </view>
  58. <view class="btn" v-if="item.stauts==0">已学习4%</view>
  59. <view class="btn-red" v-else>去学习</view>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. </template>
  66. <script>
  67. export default {
  68. data() {
  69. return {
  70. tabList: [{
  71. name: '详情'
  72. }, {
  73. name: '课程目录'
  74. }],
  75. learnList: [{
  76. img: '/static/assets/learn3.png',
  77. title: '第一课 如何防控烦人的慢性病',
  78. stauts: 0
  79. },
  80. {
  81. img: '/static/assets/learn3.png',
  82. title: '第一课 如何防控烦人的慢性病',
  83. stauts: 1
  84. }]
  85. }
  86. },
  87. computed: {
  88. },
  89. onLoad(option) {
  90. },
  91. methods: {
  92. ontabList() {
  93. // this.stauts = 0
  94. }
  95. // goLearn() {
  96. // uni.navigateTo({
  97. // url: '/pages_manage/learn'
  98. // })
  99. // },
  100. }
  101. }
  102. </script>
  103. <style lang="scss" scoped>
  104. .container {
  105. padding: 0 0 30rpx;
  106. background-color: #f0f4f7;
  107. .top {
  108. position: relative;
  109. .bg {
  110. width: 100%;
  111. }
  112. .top-box {
  113. position: absolute;
  114. bottom: -90rpx;
  115. width: 100%;
  116. padding: 30rpx;
  117. background: linear-gradient(to bottom,
  118. rgba(255, 255, 255, 0.5) 0%,
  119. rgba(255, 255, 255, 0.9) 20%,
  120. rgba(255, 255, 255, 1) 100%);
  121. border-radius: 16rpx;
  122. .title {
  123. font-size: 34rpx;
  124. }
  125. .txt {
  126. margin-top: 20rpx;
  127. display: flex;
  128. align-items: center;
  129. image {
  130. width: 36rpx;
  131. height: 36rpx;
  132. margin: 0 8rpx;
  133. }
  134. text {
  135. font-size: 28rpx;
  136. color: #595959;
  137. }
  138. }
  139. }
  140. }
  141. .container-body {
  142. margin-top: 110rpx;
  143. padding: 0 24rpx;
  144. .center-box {
  145. background-color: #ffffff;
  146. padding: 10rpx 24rpx 50rpx;
  147. border-radius: 16rpx;
  148. .progress-box {
  149. display: flex;
  150. align-items: center;
  151. margin: 50rpx 0 30rpx;
  152. image {
  153. width: 38rpx;
  154. height: 38rpx;
  155. }
  156. .title {
  157. margin: 0 10rpx 0 4rpx;
  158. font-size: 34rpx;
  159. }
  160. .txt {
  161. font-size: 28rpx;
  162. color: #595959;
  163. }
  164. }
  165. .progress {
  166. display: flex;
  167. align-items: center;
  168. text {
  169. font-size: 26rpx;
  170. margin-left: 12rpx;
  171. }
  172. }
  173. }
  174. .list {
  175. padding: 20rpx;
  176. background-color: #ffffff;
  177. border-radius: 16rpx;
  178. display: flex;
  179. justify-content: space-between;
  180. align-items: center;
  181. box-sizing: border-box;
  182. margin-top: 20rpx;
  183. .img-box {
  184. width: 240rpx;
  185. height: 150rpx;
  186. border-radius: 16rpx;
  187. overflow: hidden;
  188. position: relative;
  189. .sub {
  190. background-color: rgba(0, 0, 0, 0.8);
  191. padding: 4rpx 16rpx;
  192. color: #ffffff;
  193. position: absolute;
  194. top: 0;
  195. left: 0;
  196. font-size: 24rpx;
  197. border-radius: 8rpx;
  198. }
  199. image {
  200. width: 100%;
  201. height: 100%;
  202. }
  203. }
  204. .right {
  205. height: 150rpx;
  206. margin-left: 20rpx;
  207. flex: 1;
  208. display: flex;
  209. flex-direction: column;
  210. justify-content: space-between;
  211. .title {
  212. font-size: 30rpx;
  213. font-weight: 500;
  214. }
  215. .bottom {
  216. display: flex;
  217. // flex-direction: column;
  218. justify-content: space-between;
  219. align-items: center;
  220. font-size: 26rpx;
  221. .tip {
  222. background: linear-gradient(to right, #fcecd0, #ffffff);
  223. padding: 8rpx 12rpx;
  224. border-radius: 22rpx;
  225. color: #f2931d;
  226. image {
  227. width: 36rpx;
  228. height: 36rpx;
  229. margin-right: 4rpx;
  230. }
  231. text {}
  232. }
  233. .btn {
  234. background-color: #fdf0e7;
  235. padding: 8rpx 16rpx;
  236. color: #f38600;
  237. border-radius: 12rpx;
  238. }
  239. .btn-red{
  240. background-color:#ff512f;
  241. padding: 8rpx 18rpx;
  242. color: #ffffff;
  243. border-radius: 12rpx;
  244. }
  245. }
  246. }
  247. }
  248. }
  249. }
  250. </style>