teaching-case.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504
  1. <template>
  2. <view>
  3. <view class="teaching_case" v-for="(i,index) in classList" :key="i+'b'" @click="gotoTeDetail" :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+'a'">
  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 1 activityList_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/1181",
  111. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1183",
  112. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210",
  113. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1234",
  114. ];
  115. console.log(value);
  116. if (value == '') {
  117. console.log(111);
  118. uni.navigateTo({
  119. url: "/pages/login/login",
  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 value = this.$store.state.user.openid;
  155. const urls = [
  156. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1181",
  157. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1183",
  158. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210",
  159. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1234",
  160. ];
  161. console.log(value);
  162. if (value == '') {
  163. console.log(111);
  164. uni.navigateTo({
  165. url: "/pages/login/login",
  166. });
  167. } else {
  168. switch (edata) {
  169. case 0:
  170. uni.navigateTo({
  171. url: "/pages/skipone/skipone?url=" + encodeURIComponent(urls[0]),
  172. });
  173. break;
  174. case 1:
  175. uni.navigateTo({
  176. url: "/pages/skipone/skipone?url=" + encodeURIComponent(urls[1]),
  177. });
  178. break;
  179. case 2:
  180. uni.navigateTo({
  181. url: "/pages/skipone/skipone?url=" + encodeURIComponent(urls[2]),
  182. });
  183. break;
  184. case 3:
  185. uni.navigateTo({
  186. url: "/pages/skipone/skipone?url=" + encodeURIComponent(urls[3]),
  187. });
  188. break;
  189. default:
  190. uni.navigateTo({
  191. url: "/pages/skipone/skipone?url=" + encodeURIComponent(urls[3]),
  192. });
  193. break;
  194. }
  195. }
  196. // if (this.item.btn) {
  197. // if (value == '') {
  198. // uni.navigateTo({
  199. // url: "/pages/login/login",
  200. // });
  201. // } else {
  202. // if (this.item.btn_2 === 1) {
  203. // const urls = [
  204. // "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1181",
  205. // "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1183",
  206. // "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210",
  207. // "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1234",
  208. // ];
  209. // let index = this.indexId;
  210. // if (index >= 0 && index < urls.length) {
  211. // const url = urls[index];
  212. // uni.navigateTo({
  213. // url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
  214. // });
  215. // }
  216. // } else {
  217. // //常规教研活动
  218. // const urls = [
  219. // "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1183",
  220. // "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1211",
  221. // "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210",
  222. // "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1209",
  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. // }
  232. // }
  233. // } else {
  234. // const value = this.$store.state.user.openid;
  235. // if (value == '') {
  236. // uni.navigateTo({
  237. // url: "/pages/login/login",
  238. // });
  239. // } else {
  240. // //推荐课程
  241. // const urls = [
  242. // "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00351166273N",
  243. // "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00330324841N",
  244. // "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00231455802N",
  245. // "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00406339964N",
  246. // ];
  247. // let index = this.indexId;
  248. // if (index >= 0 && index < urls.length) {
  249. // const url = urls[index];
  250. // uni.navigateTo({
  251. // url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
  252. // });
  253. // }
  254. // }
  255. // }
  256. },
  257. join() {
  258. const value = this.$store.state.user.openid;
  259. if (value == '') {
  260. uni.navigateTo({
  261. url: "/pages/login/login",
  262. });
  263. return 1;
  264. } else {
  265. //推荐课程
  266. const urls = [
  267. "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00351166273N",
  268. "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00330324841N",
  269. "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00231455802N",
  270. "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00406339964N",
  271. ];
  272. let index = this.indexId;
  273. if (index >= 0 && index < urls.length) {
  274. const url = urls[index];
  275. uni.navigateTo({
  276. url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
  277. });
  278. }
  279. }
  280. },
  281. actApply() {
  282. const value = this.$store.state.user.openid;
  283. if (value == '') {
  284. uni.navigateTo({
  285. url: "/pages/login/login",
  286. });
  287. return 1;
  288. } else {
  289. if (this.item.btn_2 === 1) {
  290. const urls = [
  291. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1181",
  292. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1183",
  293. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210",
  294. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1234",
  295. ];
  296. let index = this.indexId;
  297. if (index >= 0 && index < urls.length) {
  298. const url = urls[index];
  299. uni.navigateTo({
  300. url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
  301. });
  302. }
  303. } else {
  304. //常规教研活动
  305. const urls = [
  306. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1183",
  307. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1211",
  308. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210",
  309. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1209",
  310. ];
  311. let index = this.indexId;
  312. if (index >= 0 && index < urls.length) {
  313. const url = urls[index];
  314. uni.navigateTo({
  315. url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
  316. });
  317. }
  318. }
  319. }
  320. },
  321. },
  322. };
  323. </script>
  324. <style lang="scss">
  325. .AClist {
  326. display: flex;
  327. justify-content: space-between;
  328. background-color: #ffffff;
  329. padding: 20rpx 30rpx;
  330. }
  331. .teaching_case {
  332. display: flex;
  333. justify-content: space-between;
  334. // margin-bottom: 10px;
  335. background-color: #ffffff;
  336. padding: 20rpx 30rpx;
  337. // padding-bottom: 50rpx;
  338. .img {
  339. width: 160rpx;
  340. height: 160rpx;
  341. image {
  342. width: 100%;
  343. height: 100%;
  344. border-radius: 10rpx;
  345. }
  346. }
  347. .right {
  348. padding-left: 20rpx;
  349. flex: 1;
  350. // height: 300px;
  351. width: 100rpx;
  352. display: flex;
  353. flex-direction: column;
  354. // align-content: flex-end ;
  355. justify-content: space-between;
  356. // align-content: space-between;
  357. .title {
  358. display: flex;
  359. justify-content: flex-start;
  360. align-items: center;
  361. margin-bottom: 15rpx;
  362. // margin-bottom: 10rpx;
  363. .tag {
  364. border: 1px #00b2b6 solid;
  365. flex-shrink: 0;
  366. letter-spacing: 2rpx;
  367. width: 64rpx;
  368. height: 32rpx;
  369. display: flex;
  370. white-space: nowrap;
  371. justify-content: center;
  372. align-items: center;
  373. border-radius: 4rpx;
  374. margin-right: 10rpx;
  375. color: #00b2b6;
  376. line-height: 32rpx;
  377. }
  378. text {
  379. font-weight: bold;
  380. overflow: hidden;
  381. text-overflow: ellipsis;
  382. white-space: nowrap;
  383. }
  384. }
  385. .introduce {
  386. // font-size: 28rpx;
  387. color: #a7a7a7;
  388. // padding: 20rpx 0;
  389. // width: 560rpx;
  390. height: 40rpx;
  391. overflow: hidden;
  392. text-overflow: ellipsis;
  393. white-space: nowrap;
  394. }
  395. .operate {
  396. display: flex;
  397. justify-content: space-between;
  398. // align-items: baseline;
  399. align-items: flex-end;
  400. .left {
  401. display: flex;
  402. // justify-content: space-between;
  403. // align-items: center;
  404. align-items: baseline;
  405. // width: 200rpx;
  406. .opr {
  407. display: flex;
  408. align-items: center;
  409. .icon {
  410. width: 32rpx;
  411. height: 32rpx;
  412. display: flex;
  413. justify-content: center;
  414. align-items: center;
  415. }
  416. text {
  417. padding-left: 3rpx;
  418. color: #666666;
  419. }
  420. }
  421. .pernum {
  422. color: #666666;
  423. // font-size: 30rpx;
  424. }
  425. .price {
  426. // font-size: 40rpx;
  427. font-weight: bold;
  428. color: #f8a551;
  429. padding-right: 10rpx;
  430. }
  431. }
  432. .btn {
  433. z-index: 5;
  434. border: none;
  435. padding: 0;
  436. text-align: center;
  437. // padding: 8px, 24px, 8px, 24px;
  438. background-color: rgba(48, 129, 232, 1);
  439. color: #fff;
  440. border-radius: 100rpx;
  441. float: right;
  442. width: 144rpx;
  443. height: 48rpx;
  444. line-height: 48rpx;
  445. letter-spacing: 1px;
  446. }
  447. }
  448. }
  449. }
  450. </style>