activityPage.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. <template>
  2. <view class="activity">
  3. <statusBar :item="navBarData"></statusBar>
  4. <viewX-Case class="mid">
  5. <template #title>
  6. <view class="title three-font" >直播活动</view>
  7. </template>
  8. <template #lookMore>
  9. <view class="lookMore fz-font" @click="gotoLiveList">查看更多</view>
  10. </template>
  11. <template #activeBlock>
  12. <view class="activeData" v-for="(item, index) in liveList" :key="index" @click="gotoAnnoun" :data-index="index">
  13. <!-- <image src="https://teacherapi.cocorobo.cn/teaching-file/static//activity/bg1.png" mode="aspectFill"></image> -->
  14. <image :src="item.pic" mode="aspectFill"></image>
  15. <view class="liveBroadcast">
  16. <view class="title">
  17. <view class="tag bqZ-font">类型</view>
  18. <text three-font>{{ item.acName }}</text>
  19. </view>
  20. <view class="operate">
  21. <view class="left">
  22. <view class="img">
  23. <image :src="item.avatar" mode="aspectFill"></image>
  24. </view>
  25. <view class="user fwb-font">{{ item.username }}</view>
  26. </view>
  27. <view class="collection">
  28. <!-- <view class="" style="display: flex;margin-right: 10rpx;align-items: center;"> -->
  29. <view class="img">
  30. <image src="https://teacherapi.cocorobo.cn/teaching-file/static//yym/Vector (Stroke) (2).png"
  31. mode="aspectFill"></image>
  32. </view>
  33. <text class="fz-font">收藏</text>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </template>
  39. </viewX-Case>
  40. <viewX-Case style="margin-top: 10px">
  41. <template #title>
  42. <view class="title three-font">常规教研活动</view>
  43. </template>
  44. <template #lookMore>
  45. <view class="lookMore fz-font" @click="lookMore">查看更多</view>
  46. </template>
  47. <template #activeBlock>
  48. <!-- <activity-case v-for="i in 10" :key="i"></activity-case> -->
  49. <teaching-case :activeList="activeList"></teaching-case>
  50. </template>
  51. </viewX-Case>
  52. <view class="" style="height: 30rpx; width: 100%"> </view>
  53. <view class="qiu" @click="fabClick">
  54. <image src="https://teacherapi.cocorobo.cn/teaching-file/static//yym/jia.png" mode="aspectFill"></image>
  55. </view>
  56. </view>
  57. </template>
  58. <script>
  59. export default {
  60. data() {
  61. return {
  62. navBarData: {
  63. title: "活动", //导航栏标题
  64. btn: 0, //是否显示返回按钮 0不显示 1 显示
  65. },
  66. actData: {
  67. btn: 1,
  68. },
  69. title: "uni-fab",
  70. // 直播活动列表
  71. liveList: [],
  72. // 教研活动列表
  73. activeList: [],
  74. };
  75. },
  76. methods: {
  77. // 获取教研活动
  78. getData(){
  79. let data={
  80. openid:uni.getStorageSync('oId'),
  81. ty:1,
  82. page:1, //下拉获取更多的备用字段
  83. lim:6 //一次获取多少数据
  84. }
  85. this.$request('/selectActivity',"POST",data).then(res=>{
  86. console.log(res[0]);
  87. // this.activeList=[...this.activeList,...res[0]]
  88. this.activeList=res[0]
  89. })
  90. },
  91. // 获取直播活动
  92. getData2(){
  93. let data={
  94. openid:uni.getStorageSync('oId'),
  95. ty:0,
  96. page:1, //下拉获取更多的备用字段
  97. lim:6 //一次获取多少数据
  98. }
  99. this.$request('/selectActivity',"POST",data).then(res=>{
  100. console.log(res[0]);
  101. // this.activeList=[...this.activeList,...res[0]]
  102. this.liveList=res[0].slice(0, 6);
  103. })
  104. },
  105. lookMore() {
  106. const value = this.$store.state.user.openid;
  107. if (value == '') {
  108. uni.navigateTo({
  109. url: "/pages/login_Wechat/login_Wechat",
  110. });
  111. } else {
  112. uni.navigateTo({
  113. url: "/pages/activityList/activityList",
  114. });
  115. }
  116. },
  117. gotoLiveList(){
  118. uni.navigateTo({
  119. url:'/pages/liveActivityList/liveActivityList'
  120. })
  121. },
  122. fabClick() {
  123. const value = this.$store.state.user.openid;
  124. if (value == '') {
  125. uni.navigateTo({
  126. url: "/pages/login_Wechat/login_Wechat",
  127. });
  128. } else {
  129. uni.navigateTo({
  130. url: "/pages/publish/publish",
  131. });
  132. }
  133. },
  134. gotoAnnoun(e) {
  135. let edata = e.currentTarget.dataset['index'];
  136. console.log(e.currentTarget.dataset['index'], 123);
  137. const clickedAcId = this.liveList[edata].acId;
  138. console.log(clickedAcId);
  139. const value = this.$store.state.user.openid;
  140. if (value == '') {
  141. uni.navigateTo({
  142. url: "/pages/login_Wechat/login_Wechat",
  143. });
  144. } else {
  145. uni.navigateTo({
  146. url: "/pages/activityDetail/activityDetail?acId=" + clickedAcId + "&ty=0",
  147. });
  148. // const urls = [
  149. // "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1181",//丽湖职教双创教育国际虚拟教研室启动大会暨双创教育国际论坛圆满举行
  150. // "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1234",//丽湖职教双创教育国际虚拟教研室 • 常规教研活动 第9期
  151. // "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210",//产教融合情境下的双创通识课程建设 | 丽湖职教双创教育国际虚拟教研室常规教研活动第2期顺利举行
  152. // "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1209",//打造双创“金课” | 丽湖职教双创教育国际虚拟教研室常规
  153. // ];
  154. // if (index >= 0 && index < urls.length) {
  155. // const url = urls[index];
  156. // uni.navigateTo({
  157. // url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
  158. // });
  159. // }
  160. }
  161. },
  162. },
  163. onShow() {
  164. this.getData()
  165. this.getData2()
  166. }
  167. };
  168. </script>
  169. <style lang="scss">
  170. .activity {
  171. .qiu {
  172. width: 90rpx;
  173. height: 90rpx;
  174. position: fixed;
  175. z-index: 19;
  176. right: 30rpx;
  177. bottom: 10vh;
  178. border-radius: 50%;
  179. background-color: rgba(0, 86, 168, 1);
  180. display: flex;
  181. justify-content: center;
  182. align-items: center;
  183. image {
  184. position: absolute;
  185. width: 36rpx;
  186. height: 36rpx;
  187. }
  188. }
  189. .mid {
  190. // margin:20px 0;
  191. .activeData {
  192. width: 460rpx;
  193. display: inline-block;
  194. margin-right: 20px;
  195. image {
  196. width: 100%;
  197. height: 120px;
  198. border-radius: 10px;
  199. margin-bottom: 10px;
  200. }
  201. .liveBroadcast {
  202. flex: 1;
  203. width: 460rpx;
  204. display: flex;
  205. flex-direction: column;
  206. align-content: flex-end;
  207. .title {
  208. display: flex;
  209. align-items: center;
  210. margin-bottom: 10rpx;
  211. .tag {
  212. // border: 1px #00b2b6 solid;
  213. // // font-size: 12px;
  214. // width: 64rpx;
  215. // height: 38rpx;
  216. // display: flex;
  217. // white-space: nowrap;
  218. // justify-content: center;
  219. // align-items: center;
  220. // // padding: 2px 4px;
  221. // padding: 1rpx 4rpx;
  222. // border-radius: 3px;
  223. // margin-right: 10rpx;
  224. // color: #00b2b6;
  225. border: 1px #00b2b6 solid;
  226. font-size: 20rpx;
  227. width: 64rpx;
  228. display: flex;
  229. height: 34rpx;
  230. white-space: nowrap;
  231. justify-content: center;
  232. align-items: center;
  233. // padding: 4px 12px 4px 12px;
  234. border-radius: 5rpx;
  235. margin-right: 10rpx;
  236. color: #00b2b6;
  237. }
  238. text {
  239. // display: -webkit-box;//对象作为弹性伸缩盒子模型显示
  240. // overflow: hidden;//溢出隐藏
  241. // -webkit-box-orient: vertical;//设置伸缩盒子对象的子元素的排列方式
  242. // -webkit-line-clamp: 2;//设置 块元素包含的文本行数
  243. overflow: hidden;
  244. text-overflow: ellipsis;
  245. white-space: nowrap;
  246. }
  247. }
  248. .operate {
  249. display: flex;
  250. justify-content: space-between;
  251. align-items: center;
  252. padding: 20rpx 0;
  253. color: #666666;
  254. // margin-bottom: 20rpx;
  255. // padding-bottom: 20rpx;
  256. .left {
  257. display: flex;
  258. align-items: center;
  259. .img {
  260. width: 48rpx;
  261. height: 48rpx;
  262. margin-right: 10rpx;
  263. image {
  264. width: 100%;
  265. height: 100%;
  266. border-radius: 50%;
  267. }
  268. }
  269. .user {}
  270. }
  271. .collection {
  272. display: flex;
  273. align-items: center;
  274. justify-content: space-between;
  275. width: 88rpx;
  276. height: 32rpx;
  277. position: relative;
  278. .img {
  279. position: absolute;
  280. left: 0;
  281. top: 6rpx;
  282. transform: translate(-130%, 0);
  283. }
  284. image {
  285. width: 27rpx;
  286. height: 25rpx;
  287. display: block;
  288. }
  289. // float: right;
  290. // font-size: 14px;
  291. // padding-top: 10px;
  292. }
  293. }
  294. }
  295. }
  296. .activeData:nth-child(1) {
  297. margin-left: 15px;
  298. }
  299. }
  300. .title {
  301. font-weight: bold;
  302. // color: #999999;
  303. }
  304. .lookMore {
  305. color: #666666;
  306. // font-size: 14px;
  307. }
  308. }
  309. </style>