index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  1. <template>
  2. <view class="content">
  3. <statusBar :item="navBarData"></statusBar>
  4. <view class="top">
  5. <!-- <image src="https://teacherapi.cocorobo.cn/teaching-file/static//logo.png" mode="aspectFill"></image> -->
  6. <image src="https://teacherapi.cocorobo.cn/teaching-file/static//yym/Rectangle25.png" mode="aspectFill"
  7. @click="gotoHome">
  8. </image>
  9. </view>
  10. <viewX-Case class="mid">
  11. <template #title>
  12. <view class="title three-font">专题教研活动</view>
  13. </template>
  14. <template #lookMore>
  15. <view class="lookMore fz-font" @click="gotoActivity">查看更多</view>
  16. </template>
  17. <template #activeBlock>
  18. <view class="activeData" @click="gotoActivityDetail" v-for="(item, index) in activeList" :key="index"
  19. :data-index="index">
  20. <image :src="item.pic" mode="aspectFill"></image>
  21. <view class="activeTit sBtn-font" style="font-weight: bold">
  22. {{ item.acName }}
  23. </view>
  24. <view class="numData">
  25. <view class="proNum bqZ-font">{{ item.pers }} 人报名</view>
  26. <view class="price num-font">
  27. <text class="fz-font">¥</text>{{ item.cost }}
  28. </view>
  29. </view>
  30. <button class="btn sBtn-font" @click.stop="gotoHd(index)">
  31. 立即报名
  32. </button>
  33. </view>
  34. </template>
  35. </viewX-Case>
  36. <viewX-Case>
  37. <template #title>
  38. <view class="title three-font">推荐课程</view>
  39. </template>
  40. <template #lookMore>
  41. <view class="lookMore fz-font" @click="listBlock1More">查看更多</view>
  42. </template>
  43. <template #teaching>
  44. <!-- <teaching-case :classList="classList"></teaching-case> -->
  45. <!-- 推荐课程插槽组件 -->
  46. <listBlock1 v-for="i in classList">
  47. <template #pic>
  48. <image :src="i.pic" mode="aspectFill"></image>
  49. </template>
  50. <template #tit>
  51. {{i.acName}}
  52. </template>
  53. <template #intro>
  54. {{ i.brief }}
  55. </template>
  56. <template #Sicon>
  57. <image src="http://43.139.158.220:5007/img/static/yym/Star 1 (Stroke).png"
  58. style="width: 28rpx; height: 26rpx" mode="aspectFill"></image>
  59. </template>
  60. <template #Dicon>
  61. <image src="http://43.139.158.220:5007/img/static/yym/Vector (Stroke).png"
  62. style="width: 22rpx; height: 26rpx" mode="aspectFill"></image>
  63. </template>
  64. <template #btn>
  65. <button class="list1btn sBtn-font" @click.stop="join">
  66. 立即参与
  67. </button>
  68. </template>
  69. </listBlock1>
  70. </template>
  71. </viewX-Case>
  72. <view class="" style="height: 30rpx; width: 100%"> </view>
  73. </view>
  74. </template>
  75. <script>
  76. export default {
  77. data() {
  78. return {
  79. title: "Hello",
  80. navBarData: {
  81. title: "首页", //导航栏标题
  82. btn: 0, //是否显示返回按钮 0不显示 1 显示
  83. },
  84. activeList: [
  85. // {
  86. // img: "https://teacherapi.cocorobo.cn/teaching-file/static//img/1695656271245-image.png",
  87. // count: "3842",
  88. // className: "丽湖职教双创教育国际虚拟教研室启动大会暨双创教育国际论坛圆满举行",
  89. // intro: "丽湖职教双创教育国际虚拟教研室为立足全国,辐射海外的国际化教研室,围绕创新创业教育的人才培养与课程建设开展深度研究。教研室以贯彻落实立德树人根本任务,通过加强跨专业、跨校、跨地域的教研交流,推动高校协同打造国际化的精品教学资",
  90. // },
  91. // {
  92. // img: "https://teacherapi.cocorobo.cn/teaching-file/static//img/img1.png",
  93. // count: "3842",
  94. // className: "丽湖职教双创教育国际虚拟教研室2023年常规教研活动安排",
  95. // intro: "为深入贯彻落实立德树人根本任务,提升教师教学育人能力,增强教师将现代信息技术与教育教学深度融合的能力,加强跨专业、跨校、跨地域的双创教研交流,推动职教创新创业教育改革纵深发展,由深圳职业技术学院创新创业学院、联合国教科文组织...",
  96. // },
  97. // {
  98. // img: "https://teacherapi.cocorobo.cn/teaching-file/static//img/img3.png",
  99. // count: "3842",
  100. // className: "产教融合情境下的双创通识课程建设 | 丽湖职教双创教育国际虚拟教研室常规教研活动第2期顺利举行",
  101. // },
  102. // {
  103. // img: "https://teacherapi.cocorobo.cn/teaching-file/static//yym/83b48be81d4ed9c93908737496f2a54.png",
  104. // count: "3842",
  105. // className: "丽湖职教双创教育国际虚拟教研室 • 常规教研活动 第9期",
  106. // },
  107. ],
  108. classList: [
  109. // {
  110. // img: "https://teacherapi.cocorobo.cn/teaching-file/static//img/jiaoxueship.jpg",
  111. // className: "教学视频",
  112. // intro: "课程简介:丽湖职教双创教育国际虚拟教研室教学视频",
  113. // url: 'https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210'
  114. // },
  115. // {
  116. // img: "https://teacherapi.cocorobo.cn/teaching-file/static//img/jiaoxuedagang.jpg",
  117. // className: "教学大纲",
  118. // intro: "课程简介:丽湖职教双创教育国际虚拟教研室教学大纲",
  119. // url: 'https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210'
  120. // },
  121. // {
  122. // img: "https://teacherapi.cocorobo.cn/teaching-file/static//img/peiyangfangan.jpg",
  123. // className: "培养方案",
  124. // intro: "课程简介:丽湖职教双创教育国际虚拟教研室培养方案",
  125. // url: 'https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210'
  126. // },
  127. // {
  128. // img: "https://teacherapi.cocorobo.cn/teaching-file/static//img/xitishiti.jpg",
  129. // className: "习题试题",
  130. // intro: "课程简介:丽湖职教双创教育国际虚拟教研室习题试题",
  131. // url: 'https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210'
  132. // },
  133. ],
  134. };
  135. },
  136. onLoad() {},
  137. methods: {
  138. getData() {
  139. let data = {
  140. openid: uni.getStorageSync('oId'),
  141. ty: 2,
  142. page: 1, //下拉获取更多的备用字段
  143. lim: 6 //一次获取多少数据
  144. }
  145. this.$request('/selectActivity', "POST", data).then(res => {
  146. console.log(res[0]);
  147. // this.activeList=[...this.activeList,...res[0]]
  148. this.activeList = res[0].slice(0, 6);
  149. })
  150. },
  151. // 获取推荐课程list 数据
  152. getlistBlock1Data() {
  153. let data = {
  154. openid: uni.getStorageSync('oId'),
  155. ty: 3,
  156. page: 1, //下拉获取更多的备用字段
  157. lim: 6 //一次获取多少数据
  158. }
  159. this.$request('/selectActivity', "POST", data).then(res => {
  160. console.log('推荐课程', res[0]);
  161. // this.activeList=[...this.activeList,...res[0]]
  162. this.classList = res[0]
  163. })
  164. },
  165. // 跳转到推荐课程查看更多
  166. listBlock1More() {
  167. const value = this.$store.state.user.openid;
  168. if (value == '') {
  169. uni.navigateTo({
  170. url: "/pages/login_Wechat/login_Wechat",
  171. });
  172. } else {
  173. uni.navigateTo({
  174. url: "/pages/teachingList/teachingList",
  175. });
  176. }
  177. },
  178. gotoTeDetail() {
  179. const value = this.$store.state.user.openid;
  180. if (value == '') {
  181. uni.navigateTo({
  182. url: "/pages/login_Wechat/login_Wechat",
  183. });
  184. } else {
  185. uni.navigateTo({
  186. url: "/pages/teachingDetail/teachingDetail",
  187. });
  188. }
  189. },
  190. // 跳转到专题教研活动查看更多
  191. gotoActivity() {
  192. const value = this.$store.state.user.openid;
  193. if (value == '') {
  194. uni.navigateTo({
  195. url: "/pages/login_Wechat/login_Wechat",
  196. });
  197. } else {
  198. uni.navigateTo({
  199. url: "/pages/activityList_2/activityList_2",
  200. });
  201. }
  202. },
  203. gotoActivityDetail(e) {
  204. let edata = e.currentTarget.dataset['index'];
  205. console.log(e.currentTarget.dataset['index'], 123);
  206. const clickedAcId = this.activeList[edata].acId;
  207. console.log(clickedAcId);
  208. const value = this.$store.state.user.openid;
  209. if (value == '') {
  210. uni.navigateTo({
  211. url: "/pages/login_Wechat/login_Wechat",
  212. });
  213. } else {
  214. uni.navigateTo({
  215. url: "/pages/teachingDetail/teachingDetail?acId=" + clickedAcId,
  216. });
  217. // const urls = [
  218. // "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1181",
  219. // "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1183",
  220. // "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210",
  221. // "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1234",
  222. // ];
  223. // if (index >= 0 && index < urls.length) {
  224. // const url = urls[index];
  225. // uni.navigateTo({
  226. // url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
  227. // });
  228. // }
  229. }
  230. },
  231. gotoHd(index) {
  232. // console.log(this.$store.state.user.openid,33333333333333333);
  233. const value = this.$store.state.user.openid;
  234. if (value == '') {
  235. console.log(11);
  236. uni.navigateTo({
  237. url: "/pages/login_Wechat/login_Wechat",
  238. });
  239. } else {
  240. const urls = [
  241. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1181",
  242. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1183",
  243. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210",
  244. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1234",
  245. ];
  246. if (index >= 0 && index < urls.length) {
  247. const url = urls[index];
  248. uni.navigateTo({
  249. url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
  250. });
  251. }
  252. }
  253. },
  254. gotoHome() {
  255. // const web = this.classList[this.current];
  256. const url = "https://mp.weixin.qq.com/s/QZEGcvBn3aW7aHirMFLBQA";
  257. uni.navigateTo({
  258. url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
  259. });
  260. },
  261. },
  262. onShow() {
  263. this.getData()
  264. this.getlistBlock1Data()
  265. }
  266. };
  267. </script>
  268. <style lang="scss" scoped>
  269. .content {
  270. // .listBlock1PIC {
  271. // width: 160rpx;
  272. // height: 160rpx;
  273. // border-radius: 10rpx;
  274. // }
  275. .list1btn {
  276. z-index: 5;
  277. border: none;
  278. padding: 0;
  279. text-align: center;
  280. // padding: 8px, 24px, 8px, 24px;
  281. background-color: rgba(48, 129, 232, 1);
  282. color: #fff;
  283. border-radius: 100rpx;
  284. float: right;
  285. width: 144rpx;
  286. height: 48rpx;
  287. line-height: 48rpx;
  288. letter-spacing: 1px;
  289. }
  290. // background-color: ;
  291. // background-color: #f0f2f5;
  292. .top {
  293. width: 750rpx;
  294. height: 288rpx;
  295. display: flex;
  296. margin-bottom: 20rpx;
  297. align-items: center;
  298. background-color: #fff;
  299. justify-content: center;
  300. image {
  301. height: 246rpx;
  302. width: 690rpx;
  303. border-radius: 12rpx;
  304. }
  305. }
  306. .mid {
  307. margin: 10px 0;
  308. height: 498rpx;
  309. .activeData {
  310. width: 290rpx;
  311. display: inline-block;
  312. padding-right: 20rpx;
  313. image {
  314. width: 100%;
  315. height: 80px;
  316. border-radius: 10px;
  317. margin-bottom: 10rpx;
  318. }
  319. .activeTit {
  320. // font-weight: 600;
  321. height: 64rpx;
  322. white-space: normal;
  323. /*隐藏溢出*/
  324. /*当文本溢出包含元素时显示省略符号来代表被修剪的文本*/
  325. /*规定段落中的文本不进行换行*/
  326. letter-spacing: 2rpx;
  327. display: -webkit-box;
  328. word-break: break-all;
  329. text-overflow: ellipsis;
  330. overflow: hidden;
  331. -webkit-box-orient: vertical;
  332. -webkit-line-clamp: 2;
  333. /*设置 需要显示的行数*/
  334. }
  335. .numData {
  336. display: flex;
  337. justify-content: space-between;
  338. align-items: baseline;
  339. // padding: 10rpx 0;
  340. .proNum {
  341. color: #999999;
  342. // font-size: 14px;
  343. }
  344. .price {
  345. color: #f68717;
  346. // font-size: 18px;
  347. }
  348. }
  349. .btn {
  350. border: none;
  351. padding: 0;
  352. float: left;
  353. text-align: center;
  354. // padding: 8px 24px 8px 24px;
  355. background-color: #3081e8;
  356. color: #fff;
  357. border-radius: 100rpx;
  358. width: 144rpx;
  359. height: 48rpx;
  360. line-height: 48rpx;
  361. letter-spacing: 1px;
  362. margin-bottom: 30rpx;
  363. }
  364. }
  365. .activeData:nth-child(1) {
  366. margin-left: 15px;
  367. }
  368. }
  369. .title {
  370. font-weight: bold;
  371. }
  372. .lookMore {
  373. color: #666666;
  374. // font-size: 14px;
  375. }
  376. }
  377. </style>