teaching-case.vue 13 KB

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