teaching-case.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  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>{{ activeList.price }}</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. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1234",
  108. ];
  109. let index = this.indexId;
  110. if (index >= 0 && index < urls.length) {
  111. const url = urls[index];
  112. uni.navigateTo({
  113. url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
  114. });
  115. }
  116. }else{
  117. //常规教研活动
  118. const urls = [
  119. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1183",
  120. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1211",
  121. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210",
  122. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1209",
  123. ];
  124. let index = this.indexId;
  125. if (index >= 0 && index < urls.length) {
  126. const url = urls[index];
  127. uni.navigateTo({
  128. url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
  129. });
  130. }
  131. }
  132. }
  133. } else {
  134. const value = uni.getStorageSync("login");
  135. if (value == 0) {
  136. uni.navigateTo({
  137. url: "/pages/login/login",
  138. });
  139. } else {
  140. //推荐课程
  141. const urls = [
  142. "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00351166273N",
  143. "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00330324841N",
  144. "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00231455802N",
  145. "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00406339964N",
  146. ];
  147. let index = this.indexId;
  148. if (index >= 0 && index < urls.length) {
  149. const url = urls[index];
  150. uni.navigateTo({
  151. url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
  152. });
  153. }
  154. }
  155. }
  156. },
  157. join() {
  158. const value = uni.getStorageSync("login");
  159. if (value == 0) {
  160. uni.navigateTo({
  161. url: "/pages/login/login",
  162. });
  163. return 1;
  164. } else {
  165. //推荐课程
  166. const urls = [
  167. "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00351166273N",
  168. "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00330324841N",
  169. "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00231455802N",
  170. "https://szptxnjys.yuketang.cn/pro/portal/about/szpt-99Q00406339964N",
  171. ];
  172. let index = this.indexId;
  173. if (index >= 0 && index < urls.length) {
  174. const url = urls[index];
  175. uni.navigateTo({
  176. url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
  177. });
  178. }
  179. }
  180. },
  181. actApply() {
  182. const value = uni.getStorageSync("login");
  183. if (value == 0) {
  184. uni.navigateTo({
  185. url: "/pages/login/login",
  186. });
  187. return 1;
  188. } else {
  189. if(this.item.btn_2 === 1){
  190. const urls = [
  191. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1181",
  192. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1183",
  193. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210",
  194. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1234",
  195. ];
  196. let index = this.indexId;
  197. if (index >= 0 && index < urls.length) {
  198. const url = urls[index];
  199. uni.navigateTo({
  200. url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
  201. });
  202. }
  203. }else{
  204. //常规教研活动
  205. const urls = [
  206. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1183",
  207. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1211",
  208. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210",
  209. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1209",
  210. ];
  211. let index = this.indexId;
  212. if (index >= 0 && index < urls.length) {
  213. const url = urls[index];
  214. uni.navigateTo({
  215. url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
  216. });
  217. }
  218. }
  219. }
  220. },
  221. },
  222. };
  223. </script>
  224. <style lang="scss">
  225. .teaching_case {
  226. display: flex;
  227. justify-content: space-between;
  228. // margin-bottom: 10px;
  229. background-color: #ffffff;
  230. padding: 20rpx 30rpx;
  231. // padding-bottom: 50rpx;
  232. .img {
  233. width: 160rpx;
  234. height: 160rpx;
  235. image {
  236. width: 100%;
  237. height: 100%;
  238. border-radius: 10rpx;
  239. }
  240. }
  241. .right {
  242. padding-left: 20rpx;
  243. flex: 1;
  244. // height: 300px;
  245. width: 100rpx;
  246. display: flex;
  247. flex-direction: column;
  248. // align-content: flex-end ;
  249. justify-content: space-between;
  250. // align-content: space-between;
  251. .title {
  252. display: flex;
  253. justify-content: flex-start;
  254. align-items: center;
  255. margin-bottom: 15rpx;
  256. // margin-bottom: 10rpx;
  257. .tag {
  258. border: 1px #00b2b6 solid;
  259. flex-shrink: 0;
  260. letter-spacing: 2rpx;
  261. width: 64rpx;
  262. height: 32rpx;
  263. display: flex;
  264. white-space: nowrap;
  265. justify-content: center;
  266. align-items: center;
  267. border-radius: 4rpx;
  268. margin-right: 10rpx;
  269. color: #00b2b6;
  270. line-height: 32rpx;
  271. // border: 1px #00b2b6 solid;
  272. // font-size: 20rpx;
  273. // width: 94rpx;
  274. // display: flex;
  275. // height: 36rpx;
  276. // white-space: nowrap;
  277. // justify-content: center;
  278. // align-items: center;
  279. // // padding: 4px 12px 4px 12px;
  280. // border-radius: 5rpx;
  281. // margin-right: 10rpx;
  282. // color: #00b2b6;
  283. }
  284. text {
  285. font-weight: bold;
  286. overflow: hidden;
  287. text-overflow: ellipsis;
  288. white-space: nowrap;
  289. }
  290. }
  291. .introduce {
  292. // font-size: 28rpx;
  293. color: #a7a7a7;
  294. // padding: 20rpx 0;
  295. // width: 560rpx;
  296. height: 40rpx;
  297. overflow: hidden;
  298. text-overflow: ellipsis;
  299. white-space: nowrap;
  300. }
  301. .operate {
  302. display: flex;
  303. justify-content: space-between;
  304. // align-items: baseline;
  305. align-items: flex-end;
  306. .left {
  307. display: flex;
  308. // justify-content: space-between;
  309. // align-items: center;
  310. align-items: baseline;
  311. // width: 200rpx;
  312. .opr {
  313. display: flex;
  314. align-items: center;
  315. .icon {
  316. width: 32rpx;
  317. height: 32rpx;
  318. display: flex;
  319. justify-content: center;
  320. align-items: center;
  321. }
  322. text {
  323. padding-left: 3rpx;
  324. color: #666666;
  325. }
  326. }
  327. .pernum {
  328. color: #666666;
  329. // font-size: 30rpx;
  330. }
  331. .price {
  332. // font-size: 40rpx;
  333. font-weight: bold;
  334. color: #f8a551;
  335. padding-right: 10rpx;
  336. }
  337. }
  338. .btn {
  339. z-index: 5;
  340. border: none;
  341. padding: 0;
  342. text-align: center;
  343. // padding: 8px, 24px, 8px, 24px;
  344. background-color: rgba(48, 129, 232, 1);
  345. color: #fff;
  346. border-radius: 100rpx;
  347. float: right;
  348. width: 144rpx;
  349. height: 48rpx;
  350. line-height: 48rpx;
  351. letter-spacing: 1px;
  352. }
  353. }
  354. }
  355. }
  356. </style>