mineRelease.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427
  1. <template>
  2. <view>
  3. <statusBar :item="navBarData"></statusBar>
  4. <view class="activeBox" v-for="(item,index) in activeList" :key="index">
  5. <view class="teaching_case" @click="gotoActdetail" :data-index="index">
  6. <view class="img">
  7. <!-- <image src="https://teacherapi.cocorobo.cn/teaching-file/static//activity/bg2.png" mode="aspectFill"></image> -->
  8. <image :src="item.pic" mode="aspectFill"></image>
  9. </view>
  10. <view class="right">
  11. <view class="title">
  12. <view class="tag bqZ-font">类型</view>
  13. <text class="three-font" style="font-weight: 600;">{{ item.acName }}</text>
  14. </view>
  15. <view class="introduce">
  16. <view class="money fNum-font"><text class="three-font">¥</text> {{ item.cost }}</view>
  17. </view>
  18. <view class="operate">
  19. <view class="left">
  20. <view class="person">浏览0 · 订阅0 · 收藏0 · 已购0</view>
  21. </view>
  22. <view class="Oright">
  23. <view class="text">查看详情</view>
  24. <view class="arrow">
  25. <image src="https://teacherapi.cocorobo.cn/teaching-file/static//mine/arrow-right-blue.png"
  26. mode="aspectFill"></image>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. <view class="controls">
  33. <view class="controls_btns">
  34. <button @click="gotoEdit(index)">编辑</button>
  35. <button @click="actDelete(index)">删除</button>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="loading">
  40. <view v-if="newsLoading==1">数据加载中...</view>
  41. <view v-if="newsLoading==2">没有更多了~~</view>
  42. </view>
  43. <view class="" style="width: 100%;height: 50rpx;"></view>
  44. <!-- 弹窗 -->
  45. <view>
  46. <view class="mask" v-show="showPopup" @click="closePopup"></view>
  47. <view class="popup-container" v-show="showPopup">
  48. <view class="popup">
  49. <view class="header">
  50. <text>确认删除</text>
  51. </view>
  52. <view class="footer">
  53. <button class="cancel-btn" @click="closePopup">取消</button>
  54. <button class="confirm-btn" @click="confirm">确认</button>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. </template>
  61. <script>
  62. export default {
  63. data() {
  64. return {
  65. navBarData: {
  66. title: '我的发布', //导航栏标题
  67. btn: 1 //是否显示返回按钮 0不显示 1 显示
  68. },
  69. showPopup: false,
  70. deleteAcId : '',
  71. // 触底加载动画提示
  72. newsLoading: 0, //0默认值 1加载中 2没有更多了
  73. currentPage: 1,
  74. activeList: [
  75. // {
  76. // pic: "https://teacherapi.cocorobo.cn/teaching-file/static//img/1695656271245-image.png",
  77. // count: "3842",
  78. // cost: "299",
  79. // acName: "丽湖职教双创教育国际虚拟教研室启动大会暨双创教育国际论坛圆满举行",
  80. // intro: "丽湖职教双创教育国际虚拟教研室为立足全国,辐射海外的国际化教研室,围绕创新创业教育的人才培养与课程建设开展深度研究。教研室以贯彻落实立德树人根本任务,通过加强跨专业、跨校、跨地域的教研交流,推动高校协同打造国际化的精品教学资",
  81. // },
  82. ],
  83. };
  84. },
  85. methods: {
  86. getpublish() {
  87. let data={
  88. openid:uni.getStorageSync('oId'),
  89. del: 0,
  90. page: this.currentPage, //下拉获取更多的备用字段
  91. lim: 5 //一次获取多少数据
  92. }
  93. this.$request('/selectMyPublish', "POST", data).then(res => {
  94. console.log(res[0]);
  95. if (!res[0].length) {
  96. this.newsLoading = 2
  97. } else {
  98. this.newsLoading = 0
  99. }
  100. this.activeList = [...this.activeList, ...res[0]]
  101. if (this.activeList.length < 1) {
  102. uni.showToast({
  103. title: '没有您发布的内容',
  104. icon: 'none'
  105. });
  106. // return;
  107. }
  108. })
  109. },
  110. gotoActdetail(e) {
  111. let edata = e.currentTarget.dataset['index'];
  112. const clickedAcId = this.activeList[edata].acId;
  113. const type = this.activeList[edata].type;
  114. const isShow = false
  115. uni.navigateTo({
  116. url: "/pages/activityDetail/activityDetail?acId=" + clickedAcId + "&ty=" + type + "&isShow=" + isShow,
  117. });
  118. },
  119. gotoEdit(index) {
  120. const clickedAcId = this.activeList[index].acId;
  121. const type = this.activeList[index].type;
  122. // console.log(clickedAcId);
  123. uni.navigateTo({
  124. url: "/pages/publish/publish?acId=" + clickedAcId + "&ty=" + type,
  125. });
  126. },
  127. actDelete(index) {
  128. this.deleteAcId = this.activeList[index].acId;
  129. this.showPopup = true; //显示弹窗
  130. },
  131. confirm() {
  132. let data={
  133. id: this.deleteAcId,
  134. }
  135. console.log(this.deleteAcId);
  136. this.$request('/deleteMyPublish', "POST", data).then(res => {
  137. // console.log(res);
  138. console.log('删除成功');
  139. this.getpublish()
  140. })
  141. this.closePopup()
  142. },
  143. closePopup() {
  144. // 取消操作
  145. this.showPopup = false
  146. this.deleteAcId = null
  147. },
  148. },
  149. // 触底加载更多
  150. onReachBottom() {
  151. console.log(111);
  152. if (this.newsLoading == 2) {
  153. return
  154. }
  155. this.newsLoading = 1
  156. this.currentPage++
  157. setTimeout(this.getpublish, 2000)
  158. },
  159. onShow() {
  160. this.getpublish();
  161. }
  162. }
  163. </script>
  164. <style lang="scss" scoped>
  165. .loading {
  166. height: 50rpx;
  167. text-align: center;
  168. padding-top: 20rpx;
  169. padding-bottom: 100rpx;
  170. font-size: 26rpx;
  171. color: #888;
  172. line-height: 2em;
  173. }
  174. .activeBox {
  175. width: 100%;
  176. background-color: #fff;
  177. &:first-child{
  178. padding: 10px 0 0 0;
  179. }
  180. .teaching_case {
  181. display: flex;
  182. justify-content: space-between;
  183. padding: 10px 10px;
  184. border-top: 1px solid #E7E7E7;
  185. .img {
  186. width: 160rpx;
  187. height: 160rpx;
  188. image {
  189. width: 160rpx;
  190. height: 160rpx;
  191. border-radius: 10rpx;
  192. }
  193. }
  194. .right {
  195. padding-left: 15px;
  196. flex: 1;
  197. display: flex;
  198. flex-direction: column;
  199. // align-content: flex-end;
  200. justify-content: space-between;
  201. .title {
  202. display: flex;
  203. align-items: center;
  204. margin-bottom: 5px;
  205. .tag {
  206. border: 1px #00b2b6 solid;
  207. // font-size: 20rpx;
  208. width: 64rpx;
  209. height: 38rpx;
  210. display: flex;
  211. white-space: nowrap;
  212. justify-content: center;
  213. align-items: center;
  214. padding: 1rpx 4rpx;
  215. border-radius: 3px;
  216. margin-right: 10rpx;
  217. color: #00b2b6;
  218. }
  219. text {
  220. width: 190px;
  221. overflow: hidden;
  222. text-overflow: ellipsis;
  223. white-space: nowrap;
  224. }
  225. }
  226. .introduce {
  227. width: 230px;
  228. // font-size: 28rpx;
  229. // color: #a7a7a7;
  230. // margin-top: 8px;
  231. overflow: hidden;
  232. text-overflow: ellipsis;
  233. white-space: nowrap;
  234. .money {
  235. color: #FFA338;
  236. font-weight: bold;
  237. font-size: 36rpx;
  238. line-height: 20px;
  239. }
  240. }
  241. .operate {
  242. display: flex;
  243. justify-content: space-between;
  244. // align-items: flex-end;
  245. align-items: baseline;
  246. // margin-top: 15px;
  247. .left {
  248. display: flex;
  249. flex-direction: row;
  250. justify-content: space-between;
  251. align-items: baseline;
  252. width: 330rpx;
  253. .person {
  254. color: #00000099;
  255. font-size: 20rpx;
  256. // margin-left: 6px;
  257. }
  258. }
  259. .Oright {
  260. width: 200rpx;
  261. display: flex;
  262. justify-content: flex-end;
  263. align-items: center;
  264. // flex-direction: row;
  265. // justify-content: space-around;
  266. // align-items: flex-end;
  267. .text {
  268. font-size: 24rpx;
  269. color: #3081E8;
  270. }
  271. .arrow {
  272. display: flex;
  273. justify-content: center;
  274. margin-top: 5rpx;
  275. image {
  276. width: 32rpx;
  277. height: 32rpx;
  278. }
  279. }
  280. }
  281. }
  282. }
  283. }
  284. .controls {
  285. display: flex;
  286. justify-content: flex-end;
  287. padding: 0 10px;
  288. border-top: 1px solid #E7E7E7;
  289. align-items: center;
  290. height: 45px;
  291. .controls_btns {
  292. display: flex;
  293. align-items: center;
  294. width: 115px;
  295. height: 35px;
  296. button {
  297. width: 96rpx;
  298. height: 48rpx;
  299. font-size: 24rpx;
  300. border-radius: 10rpx;
  301. border: 1px solid #3081E8;
  302. background-color: white;
  303. color: #3081E8;
  304. padding: 0;
  305. line-height: 23px;
  306. }
  307. }
  308. }
  309. }
  310. .mask {
  311. position: fixed;
  312. top: 0;
  313. left: 0;
  314. width: 100%;
  315. height: 100%;
  316. background-color: rgba(0, 0, 0, 0.3);
  317. z-index: 999;
  318. // display: none;
  319. }
  320. .popup-container {
  321. position: fixed;
  322. top: 50%;
  323. left: 50%;
  324. transform: translate(-50%, -50%);
  325. width: 520rpx;
  326. height: 260rpx;
  327. z-index: 1000;
  328. // display: none;
  329. .popup {
  330. width: 100%;
  331. height: 100%;
  332. display: flex;
  333. flex-direction: column;
  334. background-color: #fff;
  335. border-radius: 16rpx;
  336. .header {
  337. flex: 1;
  338. display: flex;
  339. justify-content: center;
  340. align-items: center;
  341. flex-direction: column;
  342. margin-top: 24px;
  343. font-size: 34rpx;
  344. font-weight: 600;
  345. image {
  346. width: 150rpx;
  347. height: 150rpx;
  348. margin-top: 15px;
  349. margin-bottom: 15px;
  350. }
  351. }
  352. .footer {
  353. flex: 1;
  354. display: flex;
  355. justify-content: space-around;
  356. align-items: end;
  357. padding-top: 17px;
  358. .cancel-btn {
  359. width: 259rpx;
  360. height: 100rpx;
  361. background-color: #F7F7F7;
  362. color: #000;
  363. font-size: 34rpx;
  364. text-align: center;
  365. border-radius: 0;
  366. border-bottom-left-radius: 16rpx;
  367. line-height: 50px;
  368. }
  369. .confirm-btn {
  370. width: 259rpx;
  371. height: 100rpx;
  372. background-color: #0081FE;
  373. color: #fff;
  374. font-size: 34rpx;
  375. text-align: center;
  376. border-radius: 0;
  377. border-bottom-right-radius: 16rpx;
  378. line-height: 50px;
  379. }
  380. }
  381. }
  382. }
  383. </style>