teaching-case.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  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/about/szpt-99Q00351166273N",
  111. "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00330324841N",
  112. "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00231455802N",
  113. "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00406339964N",
  114. ];
  115. console.log(value);
  116. if (value == '') {
  117. // console.log(111);
  118. uni.navigateTo({
  119. url: "/pages/login_Wechat/login_Wechat",
  120. });
  121. } else {
  122. switch (edata) {
  123. case 0:
  124. uni.navigateTo({
  125. url: "/pages/skipone/skipone?url=" + encodeURIComponent(urls[0]),
  126. });
  127. break;
  128. case 1:
  129. uni.navigateTo({
  130. url: "/pages/skipone/skipone?url=" + encodeURIComponent(urls[1]),
  131. });
  132. break;
  133. case 2:
  134. uni.navigateTo({
  135. url: "/pages/skipone/skipone?url=" + encodeURIComponent(urls[2]),
  136. });
  137. break;
  138. case 3:
  139. uni.navigateTo({
  140. url: "/pages/skipone/skipone?url=" + encodeURIComponent(urls[3]),
  141. });
  142. break;
  143. default:
  144. uni.navigateTo({
  145. url: "/pages/skipone/skipone?url=" + encodeURIComponent(urls[3]),
  146. });
  147. break;
  148. }
  149. }
  150. },
  151. gotoACdetail(e) {
  152. console.log(e.currentTarget.dataset['index'], 123);
  153. let edata = e.currentTarget.dataset['index'];
  154. const clickedAcId = this.activeList[edata].acId;
  155. const type = this.activeList[edata].type;
  156. console.log(clickedAcId);
  157. const value = this.$store.state.user.openid;
  158. const urls = [
  159. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210",//产教融合情境下的双创通识课程建设 | 丽湖职教双创教育国际虚拟教研室常规教研活动第2期顺利举
  160. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1209", //打造双创“金课” | 丽湖职教双创教
  161. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1211",//赛创融合、协同育人—高职院校双创大赛赛事组织| 丽湖职教双创教育国际虚拟教研室常规研活动第2期
  162. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1183",//丽湖职教双创教育国际虚拟教研室2023年常规教研
  163. ];
  164. if (value == '') {
  165. console.log(111);
  166. uni.navigateTo({
  167. url: "/pages/login_Wechat/login_Wechat",
  168. });
  169. } else {
  170. if (this.item.btn_2 === 1) {
  171. uni.navigateTo({
  172. url: "/pages/teachingDetail/teachingDetail?acId=" + clickedAcId,
  173. });
  174. }else if (this.item.btn_2 === 2) {
  175. uni.navigateTo({
  176. url: "/pages/activityDetail/activityDetail?acId=" + clickedAcId + "&ty=" + type,
  177. });
  178. }else{
  179. uni.navigateTo({
  180. url: "/pages/activityDetail/activityDetail?acId=" + clickedAcId + "&ty=" + type,
  181. });
  182. }
  183. }
  184. },
  185. join() {
  186. const value = this.$store.state.user.openid;
  187. if (value == '') {
  188. uni.navigateTo({
  189. url: "/pages/login_Wechat/login_Wechat",
  190. });
  191. return 1;
  192. } else {
  193. //推荐课程
  194. const urls = [
  195. "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00351166273N",
  196. "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00330324841N",
  197. "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00231455802N",
  198. "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00406339964N",
  199. ];
  200. let index = this.indexId;
  201. if (index >= 0 && index < urls.length) {
  202. const url = urls[index];
  203. uni.navigateTo({
  204. url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
  205. });
  206. }
  207. }
  208. },
  209. actApply() {
  210. const value = this.$store.state.user.openid;
  211. if (value == '') {
  212. uni.navigateTo({
  213. url: "/pages/login_Wechat/login_Wechat",
  214. });
  215. return 1;
  216. } else {
  217. if (this.item.btn_2 === 1) {
  218. const urls = [
  219. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1181",
  220. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1183",
  221. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210",
  222. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1234",
  223. ];
  224. let index = this.indexId;
  225. if (index >= 0 && index < urls.length) {
  226. const url = urls[index];
  227. uni.navigateTo({
  228. url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
  229. });
  230. }
  231. } else {
  232. //常规教研活动
  233. const urls = [
  234. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1183",
  235. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1211",
  236. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210",
  237. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1209",
  238. ];
  239. let index = this.indexId;
  240. if (index >= 0 && index < urls.length) {
  241. const url = urls[index];
  242. uni.navigateTo({
  243. url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
  244. });
  245. }
  246. }
  247. }
  248. },
  249. },
  250. };
  251. </script>
  252. <style lang="scss">
  253. .AClist {
  254. display: flex;
  255. justify-content: space-between;
  256. background-color: #ffffff;
  257. padding: 20rpx 30rpx;
  258. }
  259. .teaching_case {
  260. display: flex;
  261. justify-content: space-between;
  262. // margin-bottom: 10px;
  263. background-color: #ffffff;
  264. padding: 20rpx 30rpx;
  265. // padding-bottom: 50rpx;
  266. .img {
  267. width: 160rpx;
  268. height: 160rpx;
  269. image {
  270. width: 100%;
  271. height: 100%;
  272. border-radius: 10rpx;
  273. }
  274. }
  275. .right {
  276. padding-left: 20rpx;
  277. flex: 1;
  278. // height: 300px;
  279. width: 100rpx;
  280. display: flex;
  281. flex-direction: column;
  282. // align-content: flex-end ;
  283. justify-content: space-between;
  284. // align-content: space-between;
  285. .title {
  286. display: flex;
  287. justify-content: flex-start;
  288. align-items: center;
  289. margin-bottom: 15rpx;
  290. // margin-bottom: 10rpx;
  291. .tag {
  292. border: 1px #00b2b6 solid;
  293. flex-shrink: 0;
  294. letter-spacing: 2rpx;
  295. width: 64rpx;
  296. height: 32rpx;
  297. display: flex;
  298. white-space: nowrap;
  299. justify-content: center;
  300. align-items: center;
  301. border-radius: 4rpx;
  302. margin-right: 10rpx;
  303. color: #00b2b6;
  304. line-height: 32rpx;
  305. }
  306. text {
  307. font-weight: bold;
  308. overflow: hidden;
  309. text-overflow: ellipsis;
  310. white-space: nowrap;
  311. }
  312. }
  313. .introduce {
  314. // font-size: 28rpx;
  315. color: #a7a7a7;
  316. // padding: 20rpx 0;
  317. // width: 560rpx;
  318. height: 40rpx;
  319. overflow: hidden;
  320. text-overflow: ellipsis;
  321. white-space: nowrap;
  322. }
  323. .operate {
  324. display: flex;
  325. justify-content: space-between;
  326. // align-items: baseline;
  327. align-items: flex-end;
  328. .left {
  329. display: flex;
  330. // justify-content: space-between;
  331. // align-items: center;
  332. align-items: baseline;
  333. // width: 200rpx;
  334. .opr {
  335. display: flex;
  336. align-items: center;
  337. .icon {
  338. width: 32rpx;
  339. height: 32rpx;
  340. display: flex;
  341. justify-content: center;
  342. align-items: center;
  343. }
  344. text {
  345. padding-left: 3rpx;
  346. color: #666666;
  347. }
  348. }
  349. .pernum {
  350. color: #666666;
  351. // font-size: 30rpx;
  352. }
  353. .price {
  354. // font-size: 40rpx;
  355. font-weight: bold;
  356. color: #f8a551;
  357. padding-right: 10rpx;
  358. }
  359. }
  360. .btn {
  361. z-index: 5;
  362. border: none;
  363. padding: 0;
  364. text-align: center;
  365. // padding: 8px, 24px, 8px, 24px;
  366. background-color: rgba(48, 129, 232, 1);
  367. color: #fff;
  368. border-radius: 100rpx;
  369. float: right;
  370. width: 144rpx;
  371. height: 48rpx;
  372. line-height: 48rpx;
  373. letter-spacing: 1px;
  374. }
  375. }
  376. }
  377. }
  378. </style>