mineRelease.vue 8.4 KB

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