activityPage.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  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="http://43.139.158.220:5007/img/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="http://43.139.158.220:5007/img/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="http://43.139.158.220:5007/img/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'),ty:1
  81. }
  82. this.$request('/selectActivity',"POST",data).then(res=>{
  83. console.log(res[0]);
  84. // this.activeList=[...this.activeList,...res[0]]
  85. this.activeList=res[0]
  86. })
  87. },
  88. // 获取直播活动
  89. getData2(){
  90. let data={
  91. openid:uni.getStorageSync('oId'),ty:0
  92. }
  93. this.$request('/selectActivity',"POST",data).then(res=>{
  94. console.log(res[0]);
  95. // this.activeList=[...this.activeList,...res[0]]
  96. this.liveList=res[0].slice(0, 6);
  97. })
  98. },
  99. lookMore() {
  100. const value = this.$store.state.user.openid;
  101. if (value == '') {
  102. uni.navigateTo({
  103. url: "/pages/login_Wechat/login_Wechat",
  104. });
  105. } else {
  106. uni.navigateTo({
  107. url: "/pages/activityList/activityList",
  108. });
  109. }
  110. },
  111. gotoLiveList(){
  112. uni.navigateTo({
  113. url:'/pages/liveActivityList/liveActivityList'
  114. })
  115. },
  116. fabClick() {
  117. const value = this.$store.state.user.openid;
  118. if (value == '') {
  119. uni.navigateTo({
  120. url: "/pages/login_Wechat/login_Wechat",
  121. });
  122. } else {
  123. uni.navigateTo({
  124. url: "/pages/publish/publish",
  125. });
  126. }
  127. },
  128. gotoAnnoun(e) {
  129. let edata = e.currentTarget.dataset['index'];
  130. console.log(e.currentTarget.dataset['index'], 123);
  131. const clickedAcId = this.liveList[edata].acId;
  132. console.log(clickedAcId);
  133. const value = this.$store.state.user.openid;
  134. if (value == '') {
  135. uni.navigateTo({
  136. url: "/pages/login_Wechat/login_Wechat",
  137. });
  138. } else {
  139. uni.navigateTo({
  140. url: "/pages/activityDetail/activityDetail?acId=" + clickedAcId + "&ty=0",
  141. });
  142. // const urls = [
  143. // "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1181",//丽湖职教双创教育国际虚拟教研室启动大会暨双创教育国际论坛圆满举行
  144. // "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1234",//丽湖职教双创教育国际虚拟教研室 • 常规教研活动 第9期
  145. // "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210",//产教融合情境下的双创通识课程建设 | 丽湖职教双创教育国际虚拟教研室常规教研活动第2期顺利举行
  146. // "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1209",//打造双创“金课” | 丽湖职教双创教育国际虚拟教研室常规
  147. // ];
  148. // if (index >= 0 && index < urls.length) {
  149. // const url = urls[index];
  150. // uni.navigateTo({
  151. // url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
  152. // });
  153. // }
  154. }
  155. },
  156. },
  157. onShow() {
  158. this.getData()
  159. this.getData2()
  160. }
  161. };
  162. </script>
  163. <style lang="scss">
  164. .activity {
  165. .qiu {
  166. width: 90rpx;
  167. height: 90rpx;
  168. position: fixed;
  169. z-index: 19;
  170. right: 30rpx;
  171. bottom: 10vh;
  172. border-radius: 50%;
  173. background-color: rgba(0, 86, 168, 1);
  174. display: flex;
  175. justify-content: center;
  176. align-items: center;
  177. image {
  178. position: absolute;
  179. width: 36rpx;
  180. height: 36rpx;
  181. }
  182. }
  183. .mid {
  184. // margin:20px 0;
  185. .activeData {
  186. width: 460rpx;
  187. display: inline-block;
  188. margin-right: 20px;
  189. image {
  190. width: 100%;
  191. height: 120px;
  192. border-radius: 10px;
  193. margin-bottom: 10px;
  194. }
  195. .liveBroadcast {
  196. flex: 1;
  197. width: 460rpx;
  198. display: flex;
  199. flex-direction: column;
  200. align-content: flex-end;
  201. .title {
  202. display: flex;
  203. align-items: center;
  204. margin-bottom: 10rpx;
  205. .tag {
  206. // border: 1px #00b2b6 solid;
  207. // // font-size: 12px;
  208. // width: 64rpx;
  209. // height: 38rpx;
  210. // display: flex;
  211. // white-space: nowrap;
  212. // justify-content: center;
  213. // align-items: center;
  214. // // padding: 2px 4px;
  215. // padding: 1rpx 4rpx;
  216. // border-radius: 3px;
  217. // margin-right: 10rpx;
  218. // color: #00b2b6;
  219. border: 1px #00b2b6 solid;
  220. font-size: 20rpx;
  221. width: 64rpx;
  222. display: flex;
  223. height: 34rpx;
  224. white-space: nowrap;
  225. justify-content: center;
  226. align-items: center;
  227. // padding: 4px 12px 4px 12px;
  228. border-radius: 5rpx;
  229. margin-right: 10rpx;
  230. color: #00b2b6;
  231. }
  232. text {
  233. // display: -webkit-box;//对象作为弹性伸缩盒子模型显示
  234. // overflow: hidden;//溢出隐藏
  235. // -webkit-box-orient: vertical;//设置伸缩盒子对象的子元素的排列方式
  236. // -webkit-line-clamp: 2;//设置 块元素包含的文本行数
  237. overflow: hidden;
  238. text-overflow: ellipsis;
  239. white-space: nowrap;
  240. }
  241. }
  242. .operate {
  243. display: flex;
  244. justify-content: space-between;
  245. align-items: center;
  246. padding: 20rpx 0;
  247. color: #666666;
  248. // margin-bottom: 20rpx;
  249. // padding-bottom: 20rpx;
  250. .left {
  251. display: flex;
  252. align-items: center;
  253. .img {
  254. width: 48rpx;
  255. height: 48rpx;
  256. margin-right: 10rpx;
  257. image {
  258. width: 100%;
  259. height: 100%;
  260. border-radius: 50%;
  261. }
  262. }
  263. .user {}
  264. }
  265. .collection {
  266. display: flex;
  267. align-items: center;
  268. justify-content: space-between;
  269. width: 88rpx;
  270. height: 32rpx;
  271. position: relative;
  272. .img {
  273. position: absolute;
  274. left: 0;
  275. top: 6rpx;
  276. transform: translate(-130%, 0);
  277. }
  278. image {
  279. width: 27rpx;
  280. height: 25rpx;
  281. display: block;
  282. }
  283. // float: right;
  284. // font-size: 14px;
  285. // padding-top: 10px;
  286. }
  287. }
  288. }
  289. }
  290. .activeData:nth-child(1) {
  291. margin-left: 15px;
  292. }
  293. }
  294. .title {
  295. font-weight: bold;
  296. // color: #999999;
  297. }
  298. .lookMore {
  299. color: #666666;
  300. // font-size: 14px;
  301. }
  302. }
  303. </style>