teaching-case.vue 13 KB

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