teachingDetail.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  1. <template>
  2. <!-- 教研室详情 -->
  3. <view class="teachingDetail">
  4. <statusBar :item="navbar"></statusBar>
  5. <!-- 顶部 -->
  6. <view class="backPic" v-for="(item,index) in actItemList" :key="index + 'a' ">
  7. <image src="https://teacherapi.cocorobo.cn/teaching-file/static//yym/Rectangle 40.png" mode="aspectFill">
  8. </image>
  9. <view class="card">
  10. <view class="cardTop">
  11. <view class="title three-font">{{ item.acName }}</view>
  12. <view class="icons">
  13. <view class="icon">
  14. <image
  15. src="https://teacherapi.cocorobo.cn/teaching-file/static//yym/Star 1 (Stroke) (2).png"
  16. style="width: 42rpx;height: 40rpx;" mode="aspectFill"></image>
  17. </view>
  18. <view class="icon">
  19. <image
  20. src="https://teacherapi.cocorobo.cn/teaching-file/static//yym/Vector (Stroke) (1).png"
  21. style="width: 38rpx;height: 42rpx;" mode="aspectFill"></image>
  22. </view>
  23. </view>
  24. </view>
  25. <view class="col fz-font">
  26. 成立日期:{{ item.create_at.split('T')[0] }}
  27. </view>
  28. <view class="col fz-font">
  29. 人数:{{ item.pers }}人
  30. </view>
  31. <view class="tag col">
  32. <view class="fz-font">教研标签:</view>
  33. <view class="" style="display: flex;">
  34. <view class="bqZ-font"
  35. style="color: #00b2b6; border: 1px #00b2b6 solid;padding: 2rpx 10rpx;border-radius: 5rpx;font-weight: 600;">
  36. {{ typetext }}
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. <!-- 两个大资料文件 -->
  43. <view class="teaData">
  44. <view class="cla">
  45. <view class="tit1 three-font">课程资料</view>
  46. <view class="tit2 fz-font">教研室专属课程</view>
  47. </view>
  48. <view class="cla2">
  49. <view class="tit1 titColor three-font">资源文件</view>
  50. <view class="tit2 titColor fz-font">教研室专属资源</view>
  51. </view>
  52. </view>
  53. <!-- 教研室详情 -->
  54. <view class="" style="padding: 0 30rpx;">
  55. <detailBlock :actItemList='actItemList' :item="judge"></detailBlock>
  56. </view>
  57. <!-- 创建者用户名 -->
  58. <view style="padding: 0 30rpx;">
  59. <view class="creator" v-for="(item,index) in actItemList" :key="index + 'b' ">
  60. <image
  61. :src="item.avatar == null ? 'https://teacherapi.cocorobo.cn/teaching-file/static//mine/Avatar_default.png' : item.avatar"
  62. mode="aspectFill"></image>
  63. <view class="creName btn-font">
  64. {{ item.username }}
  65. </view>
  66. </view>
  67. </view>
  68. <!-- 当前成员 -->
  69. <view style="padding: 0 30rpx; display: none;">
  70. <view class="member">
  71. <view class="memberTop">
  72. <view class="btn-font">当前成员</view>
  73. <view class="fz-font" style="color: rgba(0, 0, 0, 0.4);display: flex;align-items: center;"
  74. @click="gotoMorePer">
  75. <text>查看更多</text>
  76. <image src="https://teacherapi.cocorobo.cn/teaching-file/static//mine/arrow-right.png"
  77. style="width: 32rpx;height: 32rpx;" mode="aspectFill"></image>
  78. <!-- <uni-icons type="right"></uni-icons> -->
  79. </view>
  80. </view>
  81. <view class="pers">
  82. <!-- <view class="per" v-for="i in perNum">
  83. <image :src="i.img"></image>
  84. <view class="perName fz-font">
  85. {{i.Name}}
  86. </view>
  87. </view> -->
  88. <view class="per">
  89. <!-- <image :src="item.img"></image> -->
  90. <view class="perName fz-font">
  91. 暂无人员
  92. </view>
  93. </view>
  94. </view>
  95. </view>
  96. </view>
  97. <!-- 申请加入 -->
  98. <view class="btnBlock">
  99. <button class="btn zw-font" :disabled="isButtonDisabled" @click="applyAdd"
  100. :style="isButtonDisabled ? 'background-color:#87CEFA;' : 'background-colo:#0056a8;'">{{ btnText }}</button>
  101. </view>
  102. </view>
  103. </template>
  104. <script>
  105. export default {
  106. data() {
  107. return {
  108. navbar: {
  109. title: '教研室详情',
  110. btn: 1
  111. },
  112. isButtonDisabled: false,
  113. btnText: '申请加入',
  114. actItemList: [],
  115. perNum: [{
  116. Name: '金晶',
  117. img: 'https://teacherapi.cocorobo.cn/teaching-file/static//yym/Ellipse 4 (1).png'
  118. },
  119. {
  120. Name: '朱心艺',
  121. img: 'https://teacherapi.cocorobo.cn/teaching-file/static//yym/Ellipse 4 (2).png'
  122. },
  123. {
  124. Name: '李红',
  125. img: 'https://teacherapi.cocorobo.cn/teaching-file/static//yym/Ellipse 4 (3).png'
  126. },
  127. {
  128. Name: '杨婉',
  129. img: 'https://teacherapi.cocorobo.cn/teaching-file/static//yym/Ellipse 4 (4).png'
  130. },
  131. {
  132. Name: '郑元雄',
  133. img: 'https://teacherapi.cocorobo.cn/teaching-file/static//yym/Ellipse 4.png'
  134. },
  135. {
  136. Name: '罗佳诚',
  137. img: 'https://teacherapi.cocorobo.cn/teaching-file/static//yym/Ellipse 4 (3).png'
  138. }
  139. ],
  140. judge: {
  141. isShow: 0,
  142. info: ""
  143. },
  144. typetext: ''
  145. };
  146. },
  147. methods: {
  148. gotoMorePer() {
  149. uni.navigateTo({
  150. url: '/pages/dy/dy'
  151. })
  152. },
  153. applyAdd() {
  154. const clickedAcId = this.actItemList[0].acId;
  155. // console.log(clickedAcId);
  156. uni.navigateTo({
  157. url: '/pages/jys/jys?acId=' + clickedAcId
  158. })
  159. },
  160. //判断是否报名
  161. btnEnroll(clickedAcId) {
  162. this.$request('/selectActivityEnrollid', "POST", {
  163. acId: clickedAcId,
  164. openid: uni.getStorageSync('oId')
  165. }).then(res => {
  166. if (!res[0][0] || !res[0][0].hasOwnProperty('acId')) {
  167. console.log('acId 未定义或不存在');
  168. return
  169. }
  170. console.log(clickedAcId);
  171. console.log(res[0]);
  172. if (clickedAcId === res[0][0].acId) {
  173. this.isButtonDisabled = true
  174. this.btnText = '已加入'
  175. }
  176. })
  177. },
  178. mapTypeToText(type) {
  179. if (type === 0) {
  180. return "直播活动";
  181. } else if (type === 1) {
  182. return "常规教研活动";
  183. } else {
  184. return "专题教研活动";
  185. }
  186. },
  187. getActivity() {
  188. // 获取当前页面的URL
  189. const routes = getCurrentPages();
  190. console.log(routes);
  191. const acId = routes[1].options.acId ? routes[1].options.acId : routes[2].options.acId
  192. let data = {
  193. acId: acId,
  194. ty: 2
  195. }
  196. this.$request('/selectActivityID', "POST", data).then(res => {
  197. // console.log(res[0]);
  198. // this.activeList=[...this.activeList,...res[0]]
  199. this.actItemList = res[0]
  200. this.typetext = this.mapTypeToText(this.actItemList.type);
  201. const clickedAcId = this.actItemList[0].acId;
  202. this.btnEnroll(clickedAcId)
  203. })
  204. },
  205. },
  206. onShow() {
  207. this.getActivity()
  208. }
  209. }
  210. </script>
  211. <style lang="scss">
  212. .teachingDetail {
  213. padding-bottom: 80px;
  214. .backPic {
  215. width: 750rpx;
  216. position: relative;
  217. image {
  218. width: 100%;
  219. display: block;
  220. }
  221. .card {
  222. position: absolute;
  223. width: 690rpx;
  224. height: 256rpx;
  225. bottom: 10px;
  226. left: 50%;
  227. padding: 30rpx;
  228. background-color: rgba(0, 0, 0, 0.26);
  229. border-radius: 10px;
  230. transform: translate(-50%, 0);
  231. border: 1rpx #667870 solid;
  232. color: #ffffff;
  233. // display: flex;
  234. // flex-direction: column;
  235. // justify-content: space-between;
  236. .cardTop {
  237. display: flex;
  238. justify-content: space-between;
  239. .title {
  240. // padding-bottom: 20rpx;
  241. margin-bottom: 20rpx;
  242. width: 506rpx;
  243. height: 48rpx;
  244. color: #ffffff;
  245. font-family: PingFang SC;
  246. // font-weight: 550;
  247. overflow: hidden;
  248. text-overflow: ellipsis;
  249. white-space: nowrap;
  250. }
  251. .icons {
  252. flex: 1;
  253. display: flex;
  254. align-items: center;
  255. justify-content: space-between;
  256. .icon {
  257. width: 48rpx;
  258. height: 48rpx;
  259. display: flex;
  260. align-items: center;
  261. justify-content: center;
  262. }
  263. }
  264. }
  265. .col {
  266. margin-bottom: 10rpx;
  267. font-weight: 100;
  268. color: #f0edea;
  269. // font-size: 30rpx;
  270. }
  271. .tag {
  272. display: flex;
  273. }
  274. }
  275. // background-image: url(https://teacherapi.cocorobo.cn/teaching-file/static//resource/jqr.png);
  276. }
  277. .teaData {
  278. width: 750rpx;
  279. display: flex;
  280. padding: 20rpx 30rpx;
  281. justify-content: space-between;
  282. // padding: 20px 0;
  283. .cla {
  284. width: 49%;
  285. background: linear-gradient(to bottom, #fcfcff 30%, #e8ecfd 100%);
  286. border-radius: 10px;
  287. padding: 35rpx 30rpx;
  288. color: #424f85;
  289. .tit1 {
  290. // font-size: 38rpx;
  291. margin-bottom: 10rpx;
  292. font-weight: bold;
  293. }
  294. .tit2 {
  295. // font-size: 22px;
  296. // font-size: 30rpx;
  297. // margin-bottom: 5px;
  298. }
  299. }
  300. .cla2 {
  301. width: 45%;
  302. background: linear-gradient(to bottom, #fcfcff 10%, #fef3ea 100%);
  303. border-radius: 10px;
  304. padding: 35rpx 30rpx;
  305. color: #855e42;
  306. .tit1 {
  307. // font-size: 38rpx;
  308. margin-bottom: 10rpx;
  309. font-weight: bold;
  310. }
  311. .tit2 {
  312. // font-size: 22px;
  313. // margin-bottom: 5px;
  314. // font-size: 30rpx;
  315. }
  316. }
  317. }
  318. .creator {
  319. display: flex;
  320. padding: 30rpx;
  321. background-color: #ffffff;
  322. align-items: center;
  323. margin-top: 20rpx;
  324. border-radius: 10px;
  325. image {
  326. width: 96rpx;
  327. height: 96rpx;
  328. border-radius: 50%;
  329. margin-right: 20rpx;
  330. }
  331. .creName {
  332. font-weight: bold;
  333. }
  334. }
  335. .member {
  336. background-color: #ffffff;
  337. margin-top: 20rpx;
  338. padding: 30rpx;
  339. border-radius: 10px;
  340. margin-bottom: 30rpx;
  341. .memberTop {
  342. display: flex;
  343. justify-content: space-between;
  344. margin-bottom: 10px;
  345. }
  346. .pers {
  347. display: flex;
  348. justify-content: space-between;
  349. align-items: center;
  350. .per {
  351. display: flex;
  352. flex-direction: column;
  353. image {
  354. width: 72rpx;
  355. height: 72rpx;
  356. border-radius: 50%;
  357. }
  358. .perName {
  359. // font-size: 14px;
  360. text-align: center;
  361. }
  362. }
  363. }
  364. }
  365. .btnBlock {
  366. position: fixed;
  367. bottom: 0;
  368. width: 750rpx;
  369. background-color: #ffffff;
  370. // padding: 20px 0;
  371. padding: 2vh 0;
  372. .btn {
  373. width: 432rpx;
  374. height: 88rpx;
  375. font-weight: 500;
  376. display: flex;
  377. justify-content: center;
  378. align-items: center;
  379. margin: auto;
  380. background-color: #0056a8;
  381. color: #ffffff;
  382. }
  383. }
  384. }
  385. </style>