mineSubscribe.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428
  1. <template>
  2. <view class="content">
  3. <statusBar :item="navBarData"></statusBar>
  4. <view class="" style="width: 750rpx;height: 60px;">
  5. <view class="activeTitle">
  6. <view class="left" @click="phoneLogin" :class="current==0?active:test">
  7. <text>教研室活动</text>
  8. <view :class="current==0?yun:test"></view>
  9. </view>
  10. <view class="right" @click="accountLogin" :class="current==1?active:test">
  11. <text class="zw-font">特色活动</text>
  12. <view :class="current==1?yun:test"></view>
  13. </view>
  14. </view>
  15. </view>
  16. <swiper class="scroll-view-height" @change="swipeIndex" :current="current" :duration="300">
  17. <swiper-item>
  18. <scroll-view scroll-y="true" style="height: 80vh;">
  19. <view class="activeClass">
  20. <view class="classBox" @click="" v-for="(item,index) in classList" :key="index">
  21. <view class="classLeft">
  22. <view class="class_Img">
  23. <image :src="item.pic" mode="aspectFill"></image>
  24. </view>
  25. <view class="class_Text">
  26. <view class="text_Title">
  27. <text class="manage">类型</text>
  28. <text>{{ item.acName }}</text>
  29. </view>
  30. <view class="text_Intro">
  31. <text>{{ item.brief }}</text>
  32. </view>
  33. </view>
  34. </view>
  35. <view class="classright">
  36. <!-- <image src="../../static/mine/Union.png" mode="aspectFill"></image> -->
  37. <image src="../../static/mine/Union.png" mode="aspectFill" @click="sub" :data-e="item"></image>
  38. </view>
  39. </view>
  40. </view>
  41. </scroll-view>
  42. </swiper-item>
  43. <swiper-item>
  44. <scroll-view scroll-y="true" style="height: 80vh;">
  45. <view class="activeClass">
  46. <view class="classBox" @click="gotoWeb_2(index)" v-for="(item,index) in activeList" :key="index">
  47. <view class="classLeft">
  48. <view class="class_Img">
  49. <image :src="activeList[index].img" mode="aspectFill"></image>
  50. </view>
  51. <view class="class_Text">
  52. <view class="text_Title">
  53. <text class="manage">类型</text>
  54. <text>{{ item.className }}</text>
  55. </view>
  56. <view class="text_Intro">
  57. <text>{{ item.intro }}</text>
  58. </view>
  59. </view>
  60. </view>
  61. <view class="classright">
  62. <image src="https://teacherapi.cocorobo.cn/teaching-file/static//mine/Union.png" mode=""></image>
  63. </view>
  64. </view>
  65. </view>
  66. </scroll-view>
  67. </swiper-item>
  68. </swiper>
  69. </view>
  70. </template>
  71. <script>
  72. export default {
  73. data() {
  74. return {
  75. navBarData: {
  76. title: '我的订阅',
  77. btn: 1
  78. },
  79. current: 0, //切换
  80. aaa: `calc(100vh-60vh)`,
  81. navheight: this.navheight, //导航栏高度
  82. active: 'active', //类名
  83. test: 'test',
  84. yun: 'yun',
  85. subArr: [],
  86. classList: [
  87. // {
  88. // img: "https://teacherapi.cocorobo.cn/teaching-file/static//img/1695656271245-image.png",
  89. // className: "丽湖职教双创教育国际虚拟教研室启动大会暨双创教育国际论坛圆满举行",
  90. // intro: "丽湖职教双创教育国际虚拟教研室为立足全国,辐射海外的国际化教研室,围绕创新创业教育的人才培养与课程建设开展深度研究。教研室以贯彻落实立德树人根本任务,通过加强跨专业、跨校、跨地域的教研交流,推动高校协同打造国际化的精品教学资",
  91. // },
  92. // {
  93. // img: "https://teacherapi.cocorobo.cn/teaching-file/static//img/img1.png",
  94. // className: "丽湖职教双创教育国际虚拟教研室2023年常规教研活动安排",
  95. // intro: "丽湖职教双创教育国际虚拟教研室为立足全国,辐射海外的国际化教研室,围绕创新创业教育的人才培养与课程建设开展深度研究。教研室以贯彻落实立德树人根本任务,通过加强跨专业、跨校、跨地域的教研交流,推动高校协同打造国际化的精品教学资",
  96. // },
  97. // {
  98. // img: "https://teacherapi.cocorobo.cn/teaching-file/static//img/img3.png",
  99. // className: "产教融合情境下的双创通识课程建设 | 丽湖职教双创教育国际虚拟教研室常规教研活动第2期顺利举行",
  100. // intro: "【图片】为提升职业院校双创课程建设水平,促进双创课程的改革与发展,丽湖职教双创教育国际虚拟教研室于3月29日组织举办了以“产教融合情境下的双创通识课程建设”为主题的第2期线上教研活动,来自全国各职业院校的60多位教师参会。本",
  101. // },
  102. // {
  103. // img: "https://teacherapi.cocorobo.cn/teaching-file/static//yym/83b48be81d4ed9c93908737496f2a54.png",
  104. // className: "丽湖职教双创教育国际虚拟教研室 • 常规教研活动 第9期",
  105. // intro: "丽湖职教双创教育国际虚拟教研室 • 常规教研活动 第9期:主题为创新创业在线课程建设与运营。【图片】【图片】【图片】【图片】【图片】"
  106. // },
  107. ],
  108. activeList: [
  109. {
  110. img: "https://teacherapi.cocorobo.cn/teaching-file/static//img/img1.png",
  111. count: "17",
  112. price: "188",
  113. className: "丽湖职教双创教育国际虚拟教研室2023年常规教研活动安排",
  114. intro: "丽湖职教双创教育国际虚拟教研室为立足全国,辐射海外的国际化教研室,围绕创新创业教育的人才培养与课程建设开展深度研究。教研室以贯彻落实立德树人根本任务,通过加强跨专业、跨校、跨地域的教研交流,推动高校协同打造国际化的精品教学资",
  115. },
  116. {
  117. img: "https://teacherapi.cocorobo.cn/teaching-file/static//img/img2.png",
  118. count: "6",
  119. price: "188",
  120. className: "赛创融合、协同育人—高职院校双创大赛赛事组织| 丽湖职教双创教育国际虚拟教研室常规教研活动第3期顺利举",
  121. intro: " 为全面落实双创教育“以赛促教、以赛促学、以赛促创”,提升学校双创大赛的组织效果和参赛成绩,促进更多教育成果落地,实现赛创融合育人的目标,丽湖职教双创教育国际虚拟教研室于4月26日组织举办了第3期线上教研活动,活动主题为“赛",
  122. },
  123. {
  124. img: "https://teacherapi.cocorobo.cn/teaching-file/static//img/img3.png",
  125. count: "1",
  126. price: "188",
  127. className: "产教融合情境下的双创通识课程建设 | 丽湖职教双创教育国际虚拟教研室常规教研活动第2期顺利举行",
  128. intro: "【图片】为提升职业院校双创课程建设水平,促进双创课程的改革与发展,丽湖职教双创教育国际虚拟教研室于3月29日组织举办了以“产教融合情境下的双创通识课程建设”为主题的第2期线上教研活动,来自全国各职业院校的60多位教师参会。本",
  129. },
  130. {
  131. img: "https://teacherapi.cocorobo.cn/teaching-file/static//img/img4.png",
  132. count: "0",
  133. price: "188",
  134. className: "打造双创“金课” | 丽湖职教双创教育国际虚拟教研室常规教研活动第1期顺利举行",
  135. intro: "为推动高职院校双创课程建设,打造更多的双创精品课程和金课,丽湖职教双创教育国际虚拟教研室于2月22日组织举办了以“如何打造高职双创金课”为主题的第1期教研活动,来自全国各高职院校的80多位教师参会。本次活动由",
  136. },
  137. ],
  138. };
  139. },
  140. computed: {
  141. dynamicStyle() {
  142. return {
  143. height: `calc(100vh - 10px)`
  144. };
  145. }
  146. },
  147. methods: {
  148. getData() {
  149. let data = {
  150. oid: this.$store.state.user.openid, //用户id
  151. }
  152. this.$request('/selectSub', 'POST', data).then(res => {
  153. this.subArr = JSON.parse(res[0][0].sub)
  154. // console.log(this.collArr);
  155. // let a=this.collArr.join(', ');
  156. // return console.log({a});
  157. let data = {
  158. oid: this.$store.state.user.openid, //用户id
  159. list: this.subArr
  160. }
  161. // return console.log(data);
  162. this.$request('/selectSubList', 'POST', data).then(res => {
  163. console.log("要渲染的数据",res);
  164. // this.collArr=res[0]
  165. this.classList = res[0]
  166. })
  167. })
  168. },
  169. // 这里获取的活动肯定是已订阅的,就不用判断直接删除就可以了
  170. sub(event){
  171. console.log(this.$store.state.user.openid);
  172. let aId=event.currentTarget.dataset.e.acId
  173. // 先获取用户订阅信息
  174. let data={
  175. oid:this.$store.state.user.openid, //用户id
  176. }
  177. this.$request('/selectSub','POST',data).then(res=>{
  178. let subs=JSON.parse(res[0][0].sub)
  179. // 把未取消订阅的数据提取出来
  180. const newArray = subs.filter(item => item !== aId);
  181. let arr3={
  182. oid:this.$store.state.user.openid, //用户id
  183. acid:JSON.stringify(newArray)
  184. }
  185. this.$request('/updateSub','POST',arr3).then(res=>{
  186. // 删除后重新获取数据进行渲染
  187. this.getData()
  188. })
  189. })
  190. },
  191. swipeIndex(index) {
  192. this.current = index.detail.current;
  193. },
  194. phoneLogin() {
  195. this.current = 0
  196. },
  197. accountLogin() {
  198. this.current = 1
  199. },
  200. gotoWeb(index) {
  201. const urls = [
  202. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1181",
  203. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1183",
  204. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210",
  205. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1234",
  206. ];
  207. if (index >= 0 && index < urls.length) {
  208. const url = urls[index];
  209. uni.navigateTo({
  210. url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
  211. });
  212. }
  213. },
  214. gotoWeb_2(index) {
  215. const urls = [
  216. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1183",
  217. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1211",
  218. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1210",
  219. "https://szptxnjys.yuketang.cn/pro/portal/announcementdetail/1209",
  220. ];
  221. if (index >= 0 && index < urls.length) {
  222. const url = urls[index];
  223. uni.navigateTo({
  224. url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
  225. });
  226. }
  227. }
  228. },
  229. onShow() {
  230. this.getData()
  231. }
  232. }
  233. </script>
  234. <style lang="scss">
  235. .content {
  236. height: 100vh;
  237. width: 750rpx;
  238. background-color: #ffffff;
  239. .activeTitle {
  240. position: fixed;
  241. z-index: 9;
  242. width: 100%;
  243. height: 60px;
  244. background-color: white;
  245. border-top: 1px solid lightgray;
  246. display: flex;
  247. justify-content: center;
  248. padding: 0 30px;
  249. font-size: 34rpx;
  250. .test {
  251. // height: ;
  252. }
  253. .active {
  254. position: relative;
  255. font-weight: bold;
  256. .yun {
  257. width: 80rpx;
  258. height: 0rpx;
  259. position: absolute;
  260. left: 50%;
  261. top: 65%;
  262. transform: translate(-50%, -50%);
  263. box-shadow: 0px 0px 10px 2px #4a97f2;
  264. }
  265. }
  266. .left {
  267. width: 50%;
  268. height: 100%;
  269. display: flex;
  270. justify-content: center;
  271. align-items: center;
  272. }
  273. .right {
  274. width: 50%;
  275. height: 100%;
  276. display: flex;
  277. justify-content: center;
  278. align-items: center;
  279. }
  280. }
  281. .scroll-view-height {
  282. // height: 200vmin;
  283. height: 80vh;
  284. // height: auto;
  285. .activeClass {
  286. width: 100%;
  287. // height: auto;
  288. .classBox {
  289. display: flex;
  290. justify-content: space-between;
  291. padding: 0 47rpx;
  292. background-color: #fff;
  293. height: 144rpx;
  294. .classLeft {
  295. display: flex;
  296. height: 100%;
  297. .class_Img {
  298. display: flex;
  299. align-items: center;
  300. flex-grow: 1;
  301. image {
  302. width: 80rpx;
  303. height: 80rpx;
  304. border-radius: 10rpx;
  305. }
  306. }
  307. .class_Text {
  308. display: flex;
  309. justify-content: center;
  310. flex-grow: 2;
  311. flex-direction: column;
  312. margin-left: 20rpx;
  313. .text_Title {
  314. display: flex;
  315. margin-bottom: 6px;
  316. align-items: center;
  317. text {
  318. &:last-child {
  319. width: 220px;
  320. color: #000;
  321. font-size: 28rpx;
  322. font-weight: 600;
  323. display: -webkit-box;
  324. word-break: break-all;
  325. text-overflow: ellipsis;
  326. overflow: hidden;
  327. -webkit-box-orient: vertical;
  328. -webkit-line-clamp: 1;
  329. /*设置 需要显示的行数*/
  330. }
  331. &.manage {
  332. // border: 1px #00b2b6 solid;
  333. // font-size: 10px;
  334. // display: flex;
  335. // white-space: nowrap;
  336. // justify-content: center;
  337. // align-items: center;
  338. // padding: 1px 6px;
  339. // border-radius: 3px;
  340. // margin-right: 10rpx;
  341. // color: #00b2b6;
  342. // margin-left: 6px;
  343. // font-weight: 600;
  344. border: 1px #00b2b6 solid;
  345. font-size: 20rpx;
  346. width: 64rpx;
  347. display: flex;
  348. height: 32rpx;
  349. white-space: nowrap;
  350. justify-content: center;
  351. align-items: center;
  352. // padding: 4px 12px 4px 12px;
  353. border-radius: 5rpx;
  354. margin-right: 10rpx;
  355. color: #00b2b6;
  356. }
  357. }
  358. }
  359. .text_Intro {
  360. display: flex;
  361. text {
  362. font-size: 24rpx;
  363. font-weight: 400;
  364. color: rgb(191, 191, 191);
  365. width: 90%;
  366. letter-spacing: 2rpx;
  367. display: -webkit-box;
  368. word-break: break-all;
  369. text-overflow: ellipsis;
  370. overflow: hidden;
  371. -webkit-box-orient: vertical;
  372. -webkit-line-clamp: 1;
  373. /*设置 需要显示的行数*/
  374. // margin-left: 6px;
  375. }
  376. }
  377. }
  378. }
  379. .classright {
  380. display: flex;
  381. height: 100%;
  382. align-items: center;
  383. image {
  384. width: 38rpx;
  385. height: 42rpx;
  386. }
  387. }
  388. }
  389. }
  390. }
  391. }
  392. </style>