index.vue 12 KB

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