teaching-case.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536
  1. <template>
  2. <view>
  3. <view class="teaching_case" v-for="(i,index) in classList" :key="index + 'a'" @click="" :data-index="index">
  4. <view class="img cell-img">
  5. <image :src="i.img" v-if="!item.btn" mode="aspectFill"></image>
  6. </view>
  7. <view class="right">
  8. <view class="">
  9. <view class="title">
  10. <view v-if="!item.btn" class="tag bqZ-font">类型</view>
  11. <text class="btn-font" v-if="!item.btn" style="">{{i.className}}</text>
  12. </view>
  13. <view v-if="!item.btn" class="introduce fwb-font">
  14. {{ i.intro }}
  15. </view>
  16. </view>
  17. <view class="operate">
  18. <view class="left">
  19. <view class="opr" style="padding-right: 25rpx">
  20. <view class="icon">
  21. <image src="http://43.139.158.220:5007/img/static/yym/Star 1 (Stroke).png"
  22. style="width: 28rpx; height: 26rpx" mode="aspectFill"></image>
  23. </view>
  24. <text class="fz-font">收藏</text>
  25. </view>
  26. <view class="opr">
  27. <view class="icon">
  28. <image src="http://43.139.158.220:5007/img/static/yym/Vector (Stroke).png"
  29. style="width: 22rpx; height: 26rpx" mode="aspectFill"></image>
  30. </view>
  31. <text class="fz-font">订阅</text>
  32. </view>
  33. </view>
  34. <view class="">
  35. <button class="btn sBtn-font" disableEventPropagation="true" @click.stop="join">
  36. 立即参与
  37. </button>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. <!-- 活动列表 -->
  43. <view class="teaching_case" v-for="(i,index) in activeList" @click="gotoACdetail" :data-index="index"
  44. :key="index + 'b'">
  45. <view class="img cell-img">
  46. <image :src="i.pic" mode="aspectFill"></image>
  47. </view>
  48. <view class="right">
  49. <view class="">
  50. <view class="title">
  51. <view class="tag bqZ-font">类型</view>
  52. <text class="three-font">{{ i.acName }}</text>
  53. </view>
  54. <view class="introduce fwb-font">
  55. {{ i.brief }}
  56. </view>
  57. </view>
  58. <view class="operate">
  59. <view class="left">
  60. <view class="price num-font"><text class="three-font">¥</text>{{ i.cost }}</view>
  61. <view class="pernum fz-font">已报名{{ i.pers }}人</view>
  62. </view>
  63. <view class="">
  64. <button class="btn sBtn-font" @click.stop="actApply">立即报名</button>
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. <!-- <view class="" style="height: 50rpx;width: 100%;background-color: #ffffff;"></view> -->
  70. </view>
  71. </template>
  72. <script>
  73. export default {
  74. name: "teaching-case",
  75. props: {
  76. item: {
  77. type: Object,
  78. default () {
  79. return {
  80. btn: 0, //0教研列表 1活动列表
  81. btn_2: 0 //0 activityList 0 activityList_2 1 liveactivityList 2
  82. };
  83. },
  84. },
  85. classList: {
  86. type: Array,
  87. default () {
  88. return [];
  89. },
  90. },
  91. activeList: {
  92. type: Array,
  93. default () {
  94. return [];
  95. },
  96. },
  97. indexId: {
  98. type: Number,
  99. },
  100. },
  101. data() {
  102. return {};
  103. },
  104. methods: {
  105. gotoTeDetail(e) {
  106. console.log(e.currentTarget.dataset['index'], 123);
  107. let edata = e.currentTarget.dataset['index']
  108. const value = this.$store.state.user.openid;
  109. const urls = [
  110. // "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210",//产教融合情境下的双创通识课程建设 | 丽湖职教双创教育国际虚拟教研室常规教研活动第2期顺利举
  111. // "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1209", //打造双创“金课” | 丽湖职教双创教
  112. // "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1211",//赛创融合、协同育人—高职院校双创大赛赛事组织| 丽湖职教双创教育国际虚拟教研室常规研活动第2期
  113. // "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1183",
  114. // "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1181",
  115. // "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1183",
  116. // "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210",
  117. // "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1234",
  118. "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00351166273N",
  119. "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00330324841N",
  120. "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00231455802N",
  121. "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00406339964N",
  122. ];
  123. console.log(value);
  124. if (value == '') {
  125. // console.log(111);
  126. uni.navigateTo({
  127. url: "/pages/login_Wechat/login_Wechat",
  128. });
  129. } else {
  130. switch (edata) {
  131. case 0:
  132. uni.navigateTo({
  133. url: "/pages/skipone/skipone?url=" + encodeURIComponent(urls[0]),
  134. });
  135. break;
  136. case 1:
  137. uni.navigateTo({
  138. url: "/pages/skipone/skipone?url=" + encodeURIComponent(urls[1]),
  139. });
  140. break;
  141. case 2:
  142. uni.navigateTo({
  143. url: "/pages/skipone/skipone?url=" + encodeURIComponent(urls[2]),
  144. });
  145. break;
  146. case 3:
  147. uni.navigateTo({
  148. url: "/pages/skipone/skipone?url=" + encodeURIComponent(urls[3]),
  149. });
  150. break;
  151. default:
  152. uni.navigateTo({
  153. url: "/pages/skipone/skipone?url=" + encodeURIComponent(urls[3]),
  154. });
  155. break;
  156. }
  157. }
  158. },
  159. gotoACdetail(e) {
  160. console.log(e.currentTarget.dataset['index'], 123);
  161. let edata = e.currentTarget.dataset['index'];
  162. const clickedAcId = this.activeList[edata].acId;
  163. const type = this.activeList[edata].type;
  164. console.log(clickedAcId);
  165. const value = this.$store.state.user.openid;
  166. const urls = [
  167. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210",//产教融合情境下的双创通识课程建设 | 丽湖职教双创教育国际虚拟教研室常规教研活动第2期顺利举
  168. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1209", //打造双创“金课” | 丽湖职教双创教
  169. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1211",//赛创融合、协同育人—高职院校双创大赛赛事组织| 丽湖职教双创教育国际虚拟教研室常规研活动第2期
  170. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1183",//丽湖职教双创教育国际虚拟教研室2023年常规教研
  171. // "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00351166273N",
  172. // "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00330324841N",
  173. // "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00231455802N",
  174. // "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00406339964N",
  175. ];
  176. if (value == '') {
  177. console.log(111);
  178. uni.navigateTo({
  179. url: "/pages/login_Wechat/login_Wechat",
  180. });
  181. } else {
  182. if (this.item.btn_2 === 1) {
  183. uni.navigateTo({
  184. url: "/pages/teachingDetail/teachingDetail?acId=" + clickedAcId,
  185. });
  186. }else if (this.item.btn_2 === 2) {
  187. uni.navigateTo({
  188. url: "/pages/activityDetail/activityDetail?acId=" + clickedAcId + "&ty=" + type,
  189. });
  190. }else{
  191. uni.navigateTo({
  192. url: "/pages/activityDetail/activityDetail?acId=" + clickedAcId + "&ty=" + type,
  193. });
  194. }
  195. // console.log("/pages/activityDetail/activityDetail?openid=" + value);
  196. // switch (edata) {
  197. // case 0:
  198. // uni.navigateTo({
  199. // url: "/pages/skipone/skipone?url=" + encodeURIComponent(urls[0]),
  200. // });
  201. // break;
  202. // case 1:
  203. // uni.navigateTo({
  204. // url: "/pages/skipone/skipone?url=" + encodeURIComponent(urls[1]),
  205. // });
  206. // break;
  207. // case 2:
  208. // uni.navigateTo({
  209. // url: "/pages/skipone/skipone?url=" + encodeURIComponent(urls[2]),
  210. // });
  211. // break;
  212. // case 3:
  213. // uni.navigateTo({
  214. // url: "/pages/skipone/skipone?url=" + encodeURIComponent(urls[3]),
  215. // });
  216. // break;
  217. // default:
  218. // uni.navigateTo({
  219. // url: "/pages/skipone/skipone?url=" + encodeURIComponent(urls[3]),
  220. // });
  221. // break;
  222. // }
  223. }
  224. // if (this.item.btn) {
  225. // if (value == '') {
  226. // uni.navigateTo({
  227. // url: "/pages/login/login",
  228. // });
  229. // } else {
  230. // if (this.item.btn_2 === 1) {
  231. // const urls = [
  232. // "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1181",
  233. // "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1183",
  234. // "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210",
  235. // "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1234",
  236. // ];
  237. // let index = this.indexId;
  238. // if (index >= 0 && index < urls.length) {
  239. // const url = urls[index];
  240. // uni.navigateTo({
  241. // url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
  242. // });
  243. // }
  244. // } else {
  245. // //常规教研活动
  246. // const urls = [
  247. // "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1183",
  248. // "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1211",
  249. // "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210",
  250. // "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1209",
  251. // ];
  252. // let index = this.indexId;
  253. // if (index >= 0 && index < urls.length) {
  254. // const url = urls[index];
  255. // uni.navigateTo({
  256. // url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
  257. // });
  258. // }
  259. // }
  260. // }
  261. // } else {
  262. // const value = this.$store.state.user.openid;
  263. // if (value == '') {
  264. // uni.navigateTo({
  265. // url: "/pages/login/login",
  266. // });
  267. // } else {
  268. // //推荐课程
  269. // const urls = [
  270. // "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00351166273N",
  271. // "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00330324841N",
  272. // "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00231455802N",
  273. // "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00406339964N",
  274. // ];
  275. // let index = this.indexId;
  276. // if (index >= 0 && index < urls.length) {
  277. // const url = urls[index];
  278. // uni.navigateTo({
  279. // url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
  280. // });
  281. // }
  282. // }
  283. // }
  284. },
  285. join() {
  286. const value = this.$store.state.user.openid;
  287. if (value == '') {
  288. uni.navigateTo({
  289. url: "/pages/login_Wechat/login_Wechat",
  290. });
  291. return 1;
  292. } else {
  293. //推荐课程
  294. const urls = [
  295. "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00351166273N",
  296. "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00330324841N",
  297. "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00231455802N",
  298. "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00406339964N",
  299. ];
  300. let index = this.indexId;
  301. if (index >= 0 && index < urls.length) {
  302. const url = urls[index];
  303. uni.navigateTo({
  304. url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
  305. });
  306. }
  307. }
  308. },
  309. actApply() {
  310. const value = this.$store.state.user.openid;
  311. if (value == '') {
  312. uni.navigateTo({
  313. url: "/pages/login_Wechat/login_Wechat",
  314. });
  315. return 1;
  316. } else {
  317. if (this.item.btn_2 === 1) {
  318. const urls = [
  319. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1181",
  320. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1183",
  321. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210",
  322. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1234",
  323. ];
  324. let index = this.indexId;
  325. if (index >= 0 && index < urls.length) {
  326. const url = urls[index];
  327. uni.navigateTo({
  328. url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
  329. });
  330. }
  331. } else {
  332. //常规教研活动
  333. const urls = [
  334. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1183",
  335. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1211",
  336. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210",
  337. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1209",
  338. ];
  339. let index = this.indexId;
  340. if (index >= 0 && index < urls.length) {
  341. const url = urls[index];
  342. uni.navigateTo({
  343. url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
  344. });
  345. }
  346. }
  347. }
  348. },
  349. },
  350. };
  351. </script>
  352. <style lang="scss">
  353. .AClist {
  354. display: flex;
  355. justify-content: space-between;
  356. background-color: #ffffff;
  357. padding: 20rpx 30rpx;
  358. }
  359. .teaching_case {
  360. display: flex;
  361. justify-content: space-between;
  362. // margin-bottom: 10px;
  363. background-color: #ffffff;
  364. padding: 20rpx 30rpx;
  365. // padding-bottom: 50rpx;
  366. .img {
  367. width: 160rpx;
  368. height: 160rpx;
  369. image {
  370. width: 100%;
  371. height: 100%;
  372. border-radius: 10rpx;
  373. }
  374. }
  375. .right {
  376. padding-left: 20rpx;
  377. flex: 1;
  378. // height: 300px;
  379. width: 100rpx;
  380. display: flex;
  381. flex-direction: column;
  382. // align-content: flex-end ;
  383. justify-content: space-between;
  384. // align-content: space-between;
  385. .title {
  386. display: flex;
  387. justify-content: flex-start;
  388. align-items: center;
  389. margin-bottom: 15rpx;
  390. // margin-bottom: 10rpx;
  391. .tag {
  392. border: 1px #00b2b6 solid;
  393. flex-shrink: 0;
  394. letter-spacing: 2rpx;
  395. width: 64rpx;
  396. height: 32rpx;
  397. display: flex;
  398. white-space: nowrap;
  399. justify-content: center;
  400. align-items: center;
  401. border-radius: 4rpx;
  402. margin-right: 10rpx;
  403. color: #00b2b6;
  404. line-height: 32rpx;
  405. }
  406. text {
  407. font-weight: bold;
  408. overflow: hidden;
  409. text-overflow: ellipsis;
  410. white-space: nowrap;
  411. }
  412. }
  413. .introduce {
  414. // font-size: 28rpx;
  415. color: #a7a7a7;
  416. // padding: 20rpx 0;
  417. // width: 560rpx;
  418. height: 40rpx;
  419. overflow: hidden;
  420. text-overflow: ellipsis;
  421. white-space: nowrap;
  422. }
  423. .operate {
  424. display: flex;
  425. justify-content: space-between;
  426. // align-items: baseline;
  427. align-items: flex-end;
  428. .left {
  429. display: flex;
  430. // justify-content: space-between;
  431. // align-items: center;
  432. align-items: baseline;
  433. // width: 200rpx;
  434. .opr {
  435. display: flex;
  436. align-items: center;
  437. .icon {
  438. width: 32rpx;
  439. height: 32rpx;
  440. display: flex;
  441. justify-content: center;
  442. align-items: center;
  443. }
  444. text {
  445. padding-left: 3rpx;
  446. color: #666666;
  447. }
  448. }
  449. .pernum {
  450. color: #666666;
  451. // font-size: 30rpx;
  452. }
  453. .price {
  454. // font-size: 40rpx;
  455. font-weight: bold;
  456. color: #f8a551;
  457. padding-right: 10rpx;
  458. }
  459. }
  460. .btn {
  461. z-index: 5;
  462. border: none;
  463. padding: 0;
  464. text-align: center;
  465. // padding: 8px, 24px, 8px, 24px;
  466. background-color: rgba(48, 129, 232, 1);
  467. color: #fff;
  468. border-radius: 100rpx;
  469. float: right;
  470. width: 144rpx;
  471. height: 48rpx;
  472. line-height: 48rpx;
  473. letter-spacing: 1px;
  474. }
  475. }
  476. }
  477. }
  478. </style>