teaching-case.vue 9.3 KB

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