index.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  1. <template>
  2. <view class="page">
  3. <u-navbar :is-back="false" :border-bottom="false" :background="background">
  4. <view style="width: 100%;padding: 0 10rpx;">
  5. <view class="flztoa inlbhhe ">
  6. <view class="indihh">
  7. <text style="font-size: 44rpx;color: #374B6E;;">最新</text>
  8. <view
  9. style="width: 26rpx;height: 4rpx;background: #374B6E;border-radius: 4rpx;margin-top: 10rpx;">
  10. </view>
  11. </view>
  12. <navigator class="indihh" url="/pages/index/hykt" open-type="redirect" hover-class="none">
  13. <text>会员</text>
  14. </navigator>
  15. <navigator class="indihh" url="/pages/index/zylx" open-type="redirect" hover-class="none">
  16. <text>治愈练习</text>
  17. </navigator>
  18. <navigator class="indihh" url="/pages/index/hd" open-type="redirect" hover-class="none">
  19. <text>活动</text>
  20. </navigator>
  21. </view>
  22. </view>
  23. </u-navbar>
  24. <navigator hover-class="none" class="inbddwwer" url="./SearchPage">
  25. <view class="fzctob inbddwddre">
  26. <image src="/static/index/ina1.png"
  27. style="width: 40rpx;height: 40rpx;min-width: 40rpx;margin-right: 12rpx;"></image>
  28. <input type="text" disabled value="" placeholder-style="color: #CCCCCC;font-size: 28rpx;"
  29. placeholder="搜索你感兴趣的内容" />
  30. </view>
  31. </navigator>
  32. <view class="flztoa" style="padding:30rpx 50rpx;">
  33. <navigator class="incfh" url="../index/kc" hover-class="none">
  34. <image src="/static/index/ibb5.png" style="width: 68rpx;height: 68rpx;"></image>
  35. <text>课程</text>
  36. </navigator>
  37. <navigator class="incfh" url="../index/ztsp" hover-class="none">
  38. <image src="/static/index/ibb6.png" style="width: 68rpx;height: 68rpx;"></image>
  39. <text>主题视频</text>
  40. </navigator>
  41. <navigator class="incfh" url="../user/cp" hover-class="none">
  42. <image src="/static/index/ibb7.png" style="width: 68rpx;height: 68rpx;"></image>
  43. <text>测评</text>
  44. </navigator>
  45. <navigator class="incfh" url="../index/jiehuo" open-type="redirect" hover-class="none">
  46. <image src="/static/index/ibb8.png" style="width: 68rpx;height: 68rpx;"></image>
  47. <text>解惑</text>
  48. </navigator>
  49. </view>
  50. <view class="pages-banner-box">
  51. <view class="banner-box">
  52. <image src="/static/index/index-bg.png" style="width: 100%;" mode="widthFix"></image>
  53. </view>
  54. <view class="banner-list">
  55. <scroll-view scroll-y style="width: 100%;" type="custom" lower-threshold="20">
  56. <grid-view type="masonry" cross-axis-count="2">
  57. <view class="scroll-item-box">
  58. <view class="list-item">
  59. <image src="/static/index/index-bg-1.png" mode="" style="width: 100%;height: 100%;" @click="goToUrl('/pages/user/cp')"></image>
  60. </view>
  61. </view>
  62. <view class="scroll-item-box">
  63. <view class="list-item">
  64. <image src="/static/index/index-bg-2.png" mode="" style="width: 100%;height: 100%;"></image>
  65. </view>
  66. </view>
  67. <view class="scroll-item-box">
  68. <view class="list-item">
  69. <image src="/static/index/index-bg-3.png" mode="" style="width: 100%;height: 100%;"></image>
  70. </view>
  71. </view>
  72. <view class="scroll-item-box">
  73. <view class="list-item">
  74. <image src="/static/index/index-bg-4.png" mode="" style="width: 100%;height: 100%;"></image>
  75. </view>
  76. </view>
  77. <view class="scroll-item-box">
  78. <view class="list-item">
  79. <image src="/static/index/index-bg-5.png" mode="" style="width: 100%;height: 100%;"></image>
  80. </view>
  81. </view>
  82. </grid-view>
  83. </scroll-view>
  84. </view>
  85. </view>
  86. <view class="inyyeddf">
  87. <view class="indhuyr">
  88. <view class="indjbrr"></view>
  89. <text>最新资讯</text>
  90. </view>
  91. <view class="inyyelb">
  92. <view class="inyyelbks" @click="toDetail(item.id)" v-for="(item,index) in ArticleList" :key="index">
  93. <image class="indkkimg" :src="item.img" mode="aspectFill"></image>
  94. <view class="fsxto">
  95. <view class="indkktxta"><text>{{item.title}}</text></view>
  96. <view class="indkktxtb u-line-1"><text>{{item.desc}}</text></view>
  97. <view class="indkktxtc"><text>{{item.type_name}}</text></view>
  98. </view>
  99. </view>
  100. </view>
  101. </view>
  102. <!-- <view class="inyyeddf">
  103. <view class="indhuyr">
  104. <view class="indjbrr"></view>
  105. <text>资讯</text>
  106. </view>
  107. <view class="inyyshiy" style="overflow-x: scroll;">
  108. <image class="inckkeer1" :src="`../../static/zy/zy0${index+1}.png`" mode="aspectFill" v-for="(item,index) in list"
  109. :key="index" @click="godetails('4',item.to_id,item)"></image>
  110. </view>
  111. </view> -->
  112. <view class="inyyeddf">
  113. <view class="indhuyr">
  114. <view class="indjbrr"></view>
  115. <text>课程</text>
  116. </view>
  117. <view>
  118. <view class="zytlidde" @click="goKcDetails(item)"
  119. v-for="(item,index) in newCourseList" :key="index">
  120. <view class="zytyyrimg" style="overflow: hidden;">
  121. <image :src="item.cover" mode="aspectFill" style="width: 100%; height: 100%;"></image>
  122. </view>
  123. <view class="zytyyopf">
  124. <view class="zytyotxta"><text>{{item.title}}</text></view>
  125. <view class="flztoa zytyotxtb">
  126. <text>{{item.lecturer_name}}</text>
  127. </view>
  128. <view class="flztoa zytyotxtc" style="margin-top: 6rpx;">
  129. <text>
  130. <text style="padding-right: 10rpx;">折扣价格: {{item.current_price}}</text>
  131. <text>原价格: {{item.original_price}}</text>
  132. </text>
  133. <image src="/static/zy/zyb3.png" style="width: 48rpx;height: 48rpx;" mode=""></image>
  134. </view>
  135. <view class="flztoa">
  136. <view class="fzctob zytyotxtc">
  137. <text>{{item.play_count}}播放量 - 共{{item.chapter_num}}课时</text>
  138. <!-- <image v-show="xqaxuye" @click="xqaxuye = false" src="/static/zy/zyb1.png" style="width: 36rpx;height: 36rpx;margin-left: 20rpx;" mode=""></image>
  139. <image v-show="!xqaxuye" @click="xqaxuye = true" src="/static/zy/zyb2.png" style="width: 36rpx;height: 36rpx;margin-left: 20rpx;" mode=""></image> -->
  140. </view>
  141. <!-- 分钟 -->
  142. <text class="zytyotxtd">{{item.time}}</text>
  143. </view>
  144. </view>
  145. </view>
  146. <view class="zyhxyyer"></view>
  147. </view>
  148. </view>
  149. <!-- <view class="inyyeddf">
  150. <view class="indhuyr">
  151. <view class="indjbrr"></view>
  152. <text>讲师</text>
  153. </view>
  154. <view class="inyyshiy" style="overflow-x: scroll;">
  155. <image class="inckkeer1" :src="item.img" mode="aspectFill" v-for="(item,index) in type_3"
  156. :key="index" @click="godetails(item.to_type,item.to_id)"></image>
  157. </view>
  158. </view> -->
  159. <view style="height: 130rpx;"></view>
  160. <tabBar :active-index="activeIndex" @change="onTabBarChange"></tabBar>
  161. </view>
  162. </template>
  163. <style>
  164. page {
  165. background: #FAFAFA;
  166. }
  167. </style>
  168. <script>
  169. export default {
  170. data() {
  171. return {
  172. background: {
  173. backgroundColor: '#ffffff',
  174. },
  175. page: 1,
  176. num: 10,
  177. banner: [],
  178. ArticleList: [], //最新咨询
  179. type_1: [], //小视频
  180. newCourseList: [], //课程
  181. type_3: [], //讲师
  182. sh: 0,
  183. activeIndex: 0,
  184. }
  185. },
  186. onLoad(res) {
  187. // #ifdef MP
  188. if(res.scene){
  189. uni.setStorageSync('invite_id',res.scene);
  190. }
  191. // #endif
  192. // this.getArticleList();
  193. // this.getHomeView();
  194. // this.getSh();
  195. },
  196. onShow() {
  197. this.activeIndex = 0;
  198. this.getcureList();
  199. this.getnewCourse();
  200. },
  201. methods: {
  202. goToUrl(u){
  203. uni.navigateTo({
  204. url: u
  205. })
  206. },
  207. onTabBarChange(index) {
  208. this.activeIndex = index;
  209. },
  210. getcureList(){
  211. this.$request.getcureList({}).then(res => {
  212. console.log(res)
  213. this.list = res.data.splice(0,3);
  214. }).catch(err => {
  215. console.log(err)
  216. })
  217. },
  218. // 获取资讯列表
  219. getSh() {
  220. this.$post({
  221. data: {
  222. do: 'Sh',
  223. data: {
  224. }
  225. }
  226. }).then(res => {
  227. this.sh = res.data.sh;
  228. }).catch(err => {
  229. this.sh = 0;
  230. })
  231. },
  232. // 获取资讯列表
  233. getArticleList() {
  234. this.$post({
  235. data: {
  236. do: 'articlelist',
  237. data: {
  238. page: this.page,
  239. num: this.num,
  240. type_id: 1
  241. }
  242. }
  243. }).then(res => {
  244. this.ArticleList = res.data.data
  245. }).catch(err => {
  246. this.ArticleList = []
  247. })
  248. },
  249. // 获取小视频 课程 讲师展示
  250. getHomeView() {
  251. this.$post({
  252. data: {
  253. do: 'HomeView'
  254. }
  255. }).then(res => {
  256. this.banner = res.data.banner
  257. this.type_1 = res.data.type_1
  258. this.type_2 = res.data.type_2
  259. this.type_3 = res.data.type_3
  260. })
  261. },
  262. // 获取课程
  263. getnewCourse() {
  264. let that = this;
  265. that.$request.getnewCourse({}).then(res => {
  266. this.newCourseList = res.data.splice(0,5);
  267. }).catch(err => {
  268. console.log(err)
  269. })
  270. },
  271. godetails(type, id,item) {
  272. if (type == '1') {
  273. uni.navigateTo({
  274. url: './kcxq-x?id=' + id
  275. })
  276. } else if (type == '2') {
  277. uni.navigateTo({
  278. url: './zxshi?id=' + id
  279. })
  280. } else if (type == '3') {
  281. uni.navigateTo({
  282. url: './hykt'
  283. })
  284. } else if (type == '4') {
  285. uni.navigateTo({
  286. url: './zyDetail?item=' + JSON.stringify(item)
  287. })
  288. }
  289. },
  290. // 资讯详情
  291. toDetail(id) {
  292. uni.navigateTo({
  293. url: './zxxq?id=' + id
  294. })
  295. },
  296. goKcDetails(id) {
  297. let item = JSON.stringify(i);
  298. uni.navigateTo({
  299. url: './kcxq-x?item=' + item
  300. })
  301. },
  302. tokc() {
  303. // if(uni.getStorageSync('is_lecturer')==1){
  304. uni.navigateTo({
  305. url: "../index/rmkc"
  306. })
  307. // }else{
  308. // uni.navigateTo({
  309. // url:"../user/rmkc"
  310. // })
  311. // }
  312. }
  313. }
  314. }
  315. </script>
  316. <style lang="scss" scoped>
  317. .page{
  318. background: #fff !important;
  319. }
  320. .pages-banner-box{
  321. width: 100%;
  322. padding: 0 30rpx;
  323. box-sizing: border-box;
  324. }
  325. .banner-box{
  326. width: 100%;
  327. height: auto;
  328. border-radius: 6px;
  329. }
  330. .banner-box image {
  331. display: inline-block;
  332. }
  333. .banner-list{
  334. margin-top: 10rpx;
  335. }
  336. .scroll-item-box {
  337. padding: 10rpx 10rpx 0 10rpx;
  338. box-sizing: border-box;
  339. border-radius: 6px;
  340. overflow: hidden;
  341. }
  342. .list-item{
  343. background-color: #d9d9d9;
  344. height: 120rpx;
  345. }
  346. .scroll-item-box:nth-of-type(1) .list-item{
  347. height: 250rpx;
  348. }
  349. .incfh text{
  350. margin: 0;
  351. }
  352. </style>