activityPageNew.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437
  1. <template>
  2. <view class="activityPageNew">
  3. <statusBar :item="navBarData"></statusBar>
  4. <!-- 消息提示 -->
  5. <msgPop></msgPop>
  6. <view class="search">
  7. <uni-search-bar v-model="searchText" bgColor="#f0f2f5" class="btntop" placeholder="搜索" cancelButton="none"
  8. clearButton="none"></uni-search-bar>
  9. </view>
  10. <view class="top">
  11. <view class="right" @click="accountLogin" :class="current == 0 ? info1 : info2">
  12. <text class="">常规教研</text>
  13. <view v-if="current == 0" class="yun">
  14. <image src="https://teacherapi.cocorobo.cn/teaching-file/static//yym/Ellipse 10.png"
  15. mode="aspectFill"></image>
  16. </view>
  17. </view>
  18. <view class="left" @click="phoneLogin" :class="current == 1 ? info1 : info2">
  19. <text class="">专题教研</text>
  20. <view v-if="current == 1" class="yun">
  21. <image src="https://teacherapi.cocorobo.cn/teaching-file/static/yym/Ellipse 10.png"
  22. mode="aspectFill"></image>
  23. </view>
  24. </view>
  25. <view class="right" @click="costClass" :class="current == 2 ? info1 : info2">
  26. <text class="">付费教研</text>
  27. <view v-if="current == 2" class="yun">
  28. <image src="https://teacherapi.cocorobo.cn/teaching-file/static/yym/Ellipse 10.png"
  29. mode="aspectFill"></image>
  30. </view>
  31. </view>
  32. </view>
  33. <swiper class="scroll-view-height" @change="swipeIndex" :current="current" :duration="300">
  34. <!-- 常规教研 -->
  35. <swiper-item>
  36. <scroll-view scroll-y="true" refresher-enabled='true' :refresher-triggered="putrigger"
  37. @refresherrefresh='purepulling' @scrolltolower="pulower" style="height: 100%;">
  38. <view>
  39. <listBlock1 ref="listBlock2" :classList="filteredClassList2"></listBlock1>
  40. </view>
  41. <view class="loading">
  42. <view v-if="puLoading==1">数据加载中...</view>
  43. <view v-if="puLoading==2">没有更多了~~</view>
  44. </view>
  45. </scroll-view>
  46. </swiper-item>
  47. <!-- 专题教研 -->
  48. <swiper-item>
  49. <scroll-view scroll-y="true" refresher-enabled='true' :refresher-triggered="trigger"
  50. @refresherrefresh='repulling' @scrolltolower="aclower" style="height: 100%;">
  51. <view class="">
  52. <listBlock1 ref="listBlock1" :classList="filteredClassList"></listBlock1>
  53. </view>
  54. <view class="loading">
  55. <view v-if="acLoading==1">数据加载中...</view>
  56. <view v-if="acLoading==2">没有更多了~~</view>
  57. </view>
  58. </scroll-view>
  59. </swiper-item>
  60. <!-- 付费教研 -->
  61. <swiper-item>
  62. <scroll-view scroll-y="true" style="height: 100%;">
  63. <!-- <view style="padding-bottom: 30rpx;"> -->
  64. <!-- <listBlock1 :classList="monlist" :indexId='indexId'></listBlock1> -->
  65. <!-- </view> -->
  66. <view class=""
  67. style="height: 100%; width: 750rpx;display: flex;justify-content: center;align-items: center;">
  68. <image src="../../static/Frame.png" style="width: 400rpx;height: 400rpx;" mode=""></image>
  69. </view>
  70. </scroll-view>
  71. </swiper-item>
  72. </swiper>
  73. </view>
  74. </template>
  75. <script>
  76. export default {
  77. data() {
  78. return {
  79. navBarData: {
  80. title: "活动",
  81. btn: 0,
  82. },
  83. indexId: 1,
  84. current: 0, //控制展示哪一个
  85. info1: "info1", //类名
  86. info2: "info2",
  87. // swiper: 0,
  88. searchText: "", // 搜索文本
  89. acLoading: 0, //0默认值 1加载中 2没有更多了
  90. accurrentPage: 1, //页数
  91. puLoading: 0, //0默认值 1加载中 2没有更多了
  92. pucurrentPage: 1,
  93. // 教研
  94. teclist: [],
  95. // 常规
  96. pulist: [],
  97. // 设置当前下拉刷新状态,true 表示下拉刷新已经被触发,false 表示下拉刷新未被触发
  98. trigger: false, //专题
  99. putrigger: false, //常规
  100. // 付费
  101. // monlist: [{
  102. // acId: "92e11d93-8778-11ee-b98c-005056b86db5",
  103. // acName: "丽湖职教双创教育国际虚拟教研室2023年常规教研活动安排",
  104. // acshape: "户外活动",
  105. // avatar: "http://139.159.246.165:7006/uploads/20231122/file-1700619408170.jpeg",
  106. // bnum: 0,
  107. // brief: "丽湖职教双创教育国际虚拟教研室为立足全国,辐射海外的国际化教研室,围绕创新创业教育的人才培养与课程建设开展深度研究。教研室以贯彻落实立德树人根本任务,通过加强跨专业、跨校、跨地域的教研交流,推动高校协同打造国际化的精品教学资源库、优秀教学案例库、优质教师培训资源库等,全面提高教师",
  108. // cost: "5000",
  109. // create_at: "2023.11.20 03:11",
  110. // pers: "15",
  111. // pic: "http://139.159.246.165:7006/uploads/20231120/file-1700466209242.png",
  112. // type: "1",
  113. // username: "袁一鸣",
  114. // }]
  115. };
  116. },
  117. // 模糊搜索
  118. computed: {
  119. filteredClassList() {
  120. const filteredList = this.teclist.filter((item) =>
  121. item.acName.includes(this.searchText)
  122. );
  123. return this.searchText ? filteredList : this.teclist;
  124. },
  125. filteredClassList2() {
  126. const filterdList2 = this.pulist.filter((item) =>
  127. item.acName.includes(this.searchText)
  128. );
  129. return this.searchText ? filterdList2 : this.pulist;
  130. },
  131. },
  132. onUnload() {
  133. this.$store.dispatch('asyncDelAll')
  134. },
  135. methods: {
  136. repulling() {
  137. this.trigger = true
  138. // this.isrepulling = true
  139. setTimeout(() => {
  140. this.trigger = false;
  141. }, 1000);
  142. this.acLoading = 0 //0默认值 1加载中 2没有更多了
  143. this.accurrentPage = 1 //页数
  144. this.teclist = [] // 教研
  145. // this.puLoading= 0 //0默认值 1加载中 2没有更多了
  146. // this.pucurrentPage=1
  147. // this.pulist= []// 常规
  148. this.getTecData()
  149. console.log(111);
  150. },
  151. purepulling() {
  152. this.putrigger = true
  153. // this.isrepulling = true
  154. setTimeout(() => {
  155. this.putrigger = false;
  156. }, 1000);
  157. // this.acLoading= 0 //0默认值 1加载中 2没有更多了
  158. // this.accurrentPage= 1 //页数
  159. // this.teclist= []// 教研
  160. this.puLoading = 0 //0默认值 1加载中 2没有更多了
  161. this.pucurrentPage = 1
  162. this.pulist = [] // 常规
  163. this.getpuData()
  164. console.log(111);
  165. },
  166. aclower() {
  167. console.log('没触底?');
  168. if (this.acLoading == 2) return
  169. this.acLoading = 1
  170. this.accurrentPage++
  171. setTimeout(this.getTecData, 1000)
  172. },
  173. pulower() {
  174. console.log('没触底?');
  175. if (this.puLoading == 2) return
  176. this.puLoading = 1
  177. this.pucurrentPage++
  178. setTimeout(this.getpuData, 1000)
  179. },
  180. // 获取专题
  181. getTecData() {
  182. let data = {
  183. openid: uni.getStorageSync('oId'),
  184. ty: 1,
  185. page: this.accurrentPage, //下拉获取更多的备用字段
  186. lim: 15 //一次获取多少数据
  187. }
  188. this.$request('/selectActivity', "POST", data).then(res => {
  189. // console.log('专题', res[0]);
  190. // this.teclist = res[0]
  191. if (!res[0].length) {
  192. this.acLoading = 2
  193. } else {
  194. this.acLoading = 0
  195. }
  196. this.teclist = [...this.teclist, ...res[0]]
  197. })
  198. },
  199. // 获取常规
  200. getpuData() {
  201. let data = {
  202. openid: uni.getStorageSync('oId'),
  203. ty: 2,
  204. page: this.pucurrentPage, //下拉获取更多的备用字段
  205. lim: 15 //一次获取多少数据
  206. }
  207. this.$request('/selectActivity', "POST", data).then(res => {
  208. // console.log('常规', res[0]);
  209. // this.pulist = res[0]
  210. if (!res[0].length) {
  211. this.puLoading = 2
  212. } else {
  213. this.puLoading = 0
  214. }
  215. this.pulist = [...this.pulist, ...res[0]]
  216. })
  217. },
  218. // 区域滑动变换头部
  219. swipeIndex(index) {
  220. this.current = index.detail.current;
  221. // this.$refs.listBlock1.getdata()
  222. },
  223. // 区域滑动
  224. accountLogin() {
  225. this.current = 0;
  226. },
  227. phoneLogin() {
  228. this.current = 1;
  229. },
  230. costClass() {
  231. this.current = 2;
  232. }
  233. },
  234. onLoad() {
  235. // 刷新
  236. // 教研
  237. // this.teclist = []
  238. // // 常规
  239. // this.pulist = []
  240. // this.accurrentPage = 1
  241. // this.pucurrentPage = 1
  242. // console.log('刷新',this.teclis);
  243. this.getpuData() //获取常规列表
  244. this.getTecData() //获取专题列表
  245. // 因为组件没有onshow
  246. // 获取订阅事件
  247. // this.$refs.listBlock1.getSub()
  248. },
  249. onShow() {
  250. this.getAllMessage() // 调用app.js中的方法
  251. // 获取收藏事件
  252. this.$refs.listBlock1.getdata() //专题
  253. this.$refs.listBlock2.getdata() //常规
  254. }
  255. };
  256. </script>
  257. <style lang="scss" scoped>
  258. .btntop {
  259. width: 100%;
  260. }
  261. .activityPageNew {
  262. display: flex;
  263. flex-direction: column;
  264. height: 100vh;
  265. .search {
  266. background-color: #ffffff;
  267. position: relative;
  268. display: flex;
  269. width: 750rpx;
  270. height: 88rpx;
  271. justify-content: center;
  272. align-items: center;
  273. .inpSer {
  274. width: 690rpx;
  275. height: 65rpx;
  276. margin: auto;
  277. background-color: rgba(240, 242, 245, 1);
  278. border-radius: 5rpx;
  279. color: rgba(0, 0, 0, 0.26);
  280. position: relative;
  281. .inpTxt {
  282. color: #000;
  283. height: 100%;
  284. width: 100%;
  285. }
  286. input::placeholder {
  287. color: #000;
  288. }
  289. .ico {
  290. position: absolute;
  291. top: 50%;
  292. left: 20rpx;
  293. transform: translate(0, -50%);
  294. display: flex;
  295. align-items: center;
  296. image {
  297. margin-right: 10rpx;
  298. }
  299. }
  300. }
  301. }
  302. .top {
  303. width: 100%;
  304. display: flex;
  305. justify-content: space-between;
  306. margin: auto;
  307. background-color: #ffffff;
  308. padding: 10px 60rpx;
  309. height: 98rpx;
  310. .info1 {
  311. font-weight: bold !important;
  312. position: relative;
  313. color: rgba(0, 0, 0, 0.8);
  314. font-size: 34rpx;
  315. line-height: 48rpx;
  316. width: 136rpx;
  317. height: 48rpx;
  318. text-align: center;
  319. // font-family: PingFang SC;
  320. // font-family: \9ed1\4f53;
  321. .yun {
  322. width: 134rpx;
  323. height: 32rpx;
  324. position: absolute;
  325. left: 0;
  326. bottom: -10rpx;
  327. // transform: translate(-50%,0%);
  328. // box-shadow: 0px 10rpx 30rpx 6rpx #4a97f2;
  329. image {
  330. width: 100%;
  331. height: 100%;
  332. }
  333. }
  334. }
  335. .info2 {
  336. color: rgba(0, 0, 0, 0.6);
  337. font-size: 34rpx;
  338. font-weight: 400;
  339. line-height: 48rpx;
  340. width: 136rpx;
  341. height: 48rpx;
  342. text-align: center;
  343. font-family: 微软雅黑;
  344. }
  345. }
  346. .scroll-view-height {
  347. flex: 1;
  348. width: 100%;
  349. display: flex;
  350. flex-wrap: wrap;
  351. justify-content: space-between;
  352. .cont {
  353. background-color: #ffffff;
  354. width: 332rpx;
  355. padding: 20rpx 15rpx;
  356. border-radius: 10px;
  357. margin-bottom: 20rpx;
  358. image {
  359. width: 300rpx;
  360. height: 170rpx;
  361. border-radius: 10rpx;
  362. }
  363. .tit {
  364. width: 257rpx;
  365. margin: 10rpx 0;
  366. // height: 80rpx;
  367. font-weight: bold;
  368. white-space: normal;
  369. display: -webkit-box;
  370. word-break: break-all;
  371. text-overflow: ellipsis;
  372. overflow: hidden;
  373. -webkit-box-orient: vertical;
  374. -webkit-line-clamp: 2;
  375. /*设置 需要显示的行数*/
  376. }
  377. .teacher {
  378. color: #999999;
  379. }
  380. }
  381. }
  382. }
  383. </style>