teaching-case.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  1. <template>
  2. <view class="teaching_case" @click="gotoTeDetail">
  3. <view class="img cell-img">
  4. <!-- <slot name="img"></slot> -->
  5. <image :src="classList.img" v-if="!item.btn" mode="aspectFill"></image>
  6. <image :src="activeList.img" v-else mode="aspectFill"></image>
  7. </view>
  8. <view class="right">
  9. <view class="">
  10. <view class="title">
  11. <view v-if="!item.btn" class="tag bqZ-font">类型</view>
  12. <view v-else class="tag bqZ-font">类型</view>
  13. <text class="btn-font" v-if="!item.btn" style="">{{
  14. classList.className
  15. }}</text>
  16. <text class="three-font" v-else>{{ activeList.className }}</text>
  17. </view>
  18. <view v-if="!item.btn" class="introduce fwb-font">
  19. {{ classList.intro }}
  20. </view>
  21. <view v-else class="introduce fwb-font">
  22. {{ activeList.intro }}
  23. </view>
  24. </view>
  25. <view class="operate" v-if="!item.btn">
  26. <view class="left">
  27. <view class="opr" style="padding-right: 25rpx">
  28. <view class="icon">
  29. <image src="http://43.139.158.220:5007/img/static/yym/Star 1 (Stroke).png"
  30. style="width: 28rpx; height: 26rpx" mode="aspectFill"></image>
  31. </view>
  32. <text class="fz-font">收藏</text>
  33. </view>
  34. <view class="opr">
  35. <view class="icon">
  36. <image src="http://43.139.158.220:5007/img/static/yym/Vector (Stroke).png"
  37. style="width: 22rpx; height: 26rpx" mode="aspectFill"></image>
  38. </view>
  39. <text class="fz-font">订阅</text>
  40. </view>
  41. </view>
  42. <view class="">
  43. <button class="btn sBtn-font" disableEventPropagation="true" @click.stop="join">
  44. 立即参与
  45. </button>
  46. </view>
  47. </view>
  48. <view class="operate" v-else>
  49. <view class="left">
  50. <view class="price num-font"><text class="three-font">¥</text> 188</view>
  51. <view class="pernum fz-font">已报名{{ activeList.count }}人</view>
  52. </view>
  53. <view class="">
  54. <button class="btn sBtn-font" @click.stop="actApply">立即报名</button>
  55. </view>
  56. </view>
  57. </view>
  58. <!-- <view class="" style="height: 50rpx;width: 100%;background-color: #ffffff;"></view> -->
  59. </view>
  60. </template>
  61. <script>
  62. export default {
  63. name: "teaching-case",
  64. props: {
  65. item: {
  66. type: Object,
  67. default () {
  68. return {
  69. btn: 0, //0教研列表 1活动列表
  70. btn_2: 0 //0 activityList 1 activityList_2
  71. };
  72. },
  73. },
  74. classList: {
  75. type: Object,
  76. default () {
  77. return [];
  78. },
  79. },
  80. activeList: {
  81. type: Object,
  82. default () {
  83. return [];
  84. },
  85. },
  86. indexId: {
  87. type: Number,
  88. },
  89. },
  90. data() {
  91. return {};
  92. },
  93. methods: {
  94. gotoTeDetail() {
  95. if (this.item.btn) {
  96. const value = uni.getStorageSync("login");
  97. if (value == 0) {
  98. uni.navigateTo({
  99. url: "/pages/login/login",
  100. });
  101. } else {
  102. if(this.item.btn_2 === 1){
  103. const urls = [
  104. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1181",
  105. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1183",
  106. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210",
  107. ];
  108. let index = this.indexId;
  109. if (index >= 0 && index < urls.length) {
  110. const url = urls[index];
  111. uni.navigateTo({
  112. url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
  113. });
  114. }
  115. }else{
  116. //常规教研活动
  117. const urls = [
  118. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1183",
  119. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1211",
  120. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210",
  121. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1209",
  122. ];
  123. let index = this.indexId;
  124. if (index >= 0 && index < urls.length) {
  125. const url = urls[index];
  126. uni.navigateTo({
  127. url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
  128. });
  129. }
  130. }
  131. }
  132. } else {
  133. const value = uni.getStorageSync("login");
  134. if (value == 0) {
  135. uni.navigateTo({
  136. url: "/pages/login/login",
  137. });
  138. } else {
  139. //推荐课程
  140. const urls = [
  141. "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00351166273N",
  142. "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00330324841N",
  143. "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00231455802N",
  144. "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00406339964N",
  145. ];
  146. let index = this.indexId;
  147. if (index >= 0 && index < urls.length) {
  148. const url = urls[index];
  149. uni.navigateTo({
  150. url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
  151. });
  152. }
  153. }
  154. }
  155. },
  156. join() {
  157. const value = uni.getStorageSync("login");
  158. if (value == 0) {
  159. uni.navigateTo({
  160. url: "/pages/login/login",
  161. });
  162. return 1;
  163. } else {
  164. //推荐课程
  165. const urls = [
  166. "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00351166273N",
  167. "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00330324841N",
  168. "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00231455802N",
  169. "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00406339964N",
  170. ];
  171. let index = this.indexId;
  172. if (index >= 0 && index < urls.length) {
  173. const url = urls[index];
  174. uni.navigateTo({
  175. url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
  176. });
  177. }
  178. }
  179. },
  180. actApply() {
  181. const value = uni.getStorageSync("login");
  182. if (value == 0) {
  183. uni.navigateTo({
  184. url: "/pages/login/login",
  185. });
  186. return 1;
  187. } else {
  188. if(this.item.btn_2 === 1){
  189. const urls = [
  190. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1181",
  191. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1183",
  192. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210",
  193. ];
  194. let index = this.indexId;
  195. if (index >= 0 && index < urls.length) {
  196. const url = urls[index];
  197. uni.navigateTo({
  198. url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
  199. });
  200. }
  201. }else{
  202. //常规教研活动
  203. const urls = [
  204. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1183",
  205. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1211",
  206. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210",
  207. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1209",
  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. }
  217. }
  218. },
  219. },
  220. };
  221. </script>
  222. <style lang="scss">
  223. .teaching_case {
  224. display: flex;
  225. justify-content: space-between;
  226. // margin-bottom: 10px;
  227. background-color: #ffffff;
  228. padding: 20rpx 30rpx;
  229. // padding-bottom: 50rpx;
  230. .img {
  231. width: 160rpx;
  232. height: 160rpx;
  233. image {
  234. width: 100%;
  235. height: 100%;
  236. border-radius: 10rpx;
  237. }
  238. }
  239. .right {
  240. padding-left: 20rpx;
  241. flex: 1;
  242. // height: 300px;
  243. width: 100rpx;
  244. display: flex;
  245. flex-direction: column;
  246. // align-content: flex-end ;
  247. justify-content: space-between;
  248. // align-content: space-between;
  249. .title {
  250. display: flex;
  251. justify-content: flex-start;
  252. align-items: center;
  253. margin-bottom: 15rpx;
  254. // margin-bottom: 10rpx;
  255. .tag {
  256. border: 1px #00b2b6 solid;
  257. flex-shrink: 0;
  258. letter-spacing: 2rpx;
  259. width: 64rpx;
  260. height: 32rpx;
  261. display: flex;
  262. white-space: nowrap;
  263. justify-content: center;
  264. align-items: center;
  265. border-radius: 4rpx;
  266. margin-right: 10rpx;
  267. color: #00b2b6;
  268. line-height: 32rpx;
  269. // border: 1px #00b2b6 solid;
  270. // font-size: 20rpx;
  271. // width: 94rpx;
  272. // display: flex;
  273. // height: 36rpx;
  274. // white-space: nowrap;
  275. // justify-content: center;
  276. // align-items: center;
  277. // // padding: 4px 12px 4px 12px;
  278. // border-radius: 5rpx;
  279. // margin-right: 10rpx;
  280. // color: #00b2b6;
  281. }
  282. text {
  283. font-weight: bold;
  284. overflow: hidden;
  285. text-overflow: ellipsis;
  286. white-space: nowrap;
  287. }
  288. }
  289. .introduce {
  290. // font-size: 28rpx;
  291. color: #a7a7a7;
  292. // padding: 20rpx 0;
  293. // width: 560rpx;
  294. height: 40rpx;
  295. overflow: hidden;
  296. text-overflow: ellipsis;
  297. white-space: nowrap;
  298. }
  299. .operate {
  300. display: flex;
  301. justify-content: space-between;
  302. // align-items: baseline;
  303. align-items: flex-end;
  304. .left {
  305. display: flex;
  306. // justify-content: space-between;
  307. // align-items: center;
  308. align-items: baseline;
  309. // width: 200rpx;
  310. .opr {
  311. display: flex;
  312. align-items: center;
  313. .icon {
  314. width: 32rpx;
  315. height: 32rpx;
  316. display: flex;
  317. justify-content: center;
  318. align-items: center;
  319. }
  320. text {
  321. padding-left: 3rpx;
  322. color: #666666;
  323. }
  324. }
  325. .pernum {
  326. color: #666666;
  327. // font-size: 30rpx;
  328. }
  329. .price {
  330. // font-size: 40rpx;
  331. font-weight: bold;
  332. color: #f8a551;
  333. padding-right: 10rpx;
  334. }
  335. }
  336. .btn {
  337. z-index: 5;
  338. border: none;
  339. padding: 0;
  340. text-align: center;
  341. // padding: 8px, 24px, 8px, 24px;
  342. background-color: rgba(48, 129, 232, 1);
  343. color: #fff;
  344. border-radius: 100rpx;
  345. float: right;
  346. width: 144rpx;
  347. height: 48rpx;
  348. line-height: 48rpx;
  349. letter-spacing: 1px;
  350. }
  351. }
  352. }
  353. }
  354. </style>