list.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  1. <template>
  2. <div class="activityPromulgate">
  3. <div class="activityTop">
  4. <div class="addRepair" @tap="newRelease(null)">新增活动 <van-icon name="add" style="margin-left: 8rpx"/></div>
  5. <div class="parkDynamicTab2">
  6. <div
  7. v-for="(item, index) in tabList"
  8. :key="index"
  9. class="tabItem"
  10. :class="selectTab === item.label ? 'selectTabItem' : ''"
  11. @click="clickTab(item)"
  12. >
  13. {{ item.label }}
  14. </div>
  15. </div>
  16. </div>
  17. <div class="activityListBody">
  18. <div class="listItem" v-for="item in activityList">
  19. <div class="listItemInfoBox">
  20. <div class="listItemInfoLeft">
  21. <span class="listTitle">{{item.activityName}}</span>
  22. <span class="listCon">发布时间:{{item.releaseTime}} </span>
  23. <span class="listCon">报名截止时间:{{item.registrationEndTime}}</span>
  24. <span class="listCon">活动开始时间:{{item.activityStartTime}}</span>
  25. </div>
  26. <div class="listItemInfoRight">
  27. <img :src="item.imgUrl" class="listImg">
  28. <div class="tags" :class="item.status==='2'?'bmzTag':item.status==='3'?'bmjsTag':item.status==='4'?'hdjsTag':'wksTag'">{{item.statusName}}</div>
  29. </div>
  30. </div>
  31. <div class="listItemInfoBox2">
  32. <div class="fbrBox">
  33. <van-icon name="contact" style="color:rgba(102, 102, 102, 1)"/>
  34. 发布人:{{item.releaseUserName}}
  35. </div>
  36. <div class="fbrBox">
  37. {{item.registrationNumbers}}人报名 {{item.signInNumber}}人签到
  38. </div>
  39. </div>
  40. <div class="listItemInfoBox3">
  41. <div class="qrCodeBox" @tap="toQrCode(item)">
  42. <img src="https://www.idea-co-sf.com/gardenProduct/image/icon01.png" class="qrIcon">
  43. <span>活动签到码</span>
  44. </div>
  45. <div class="listBtnBox">
  46. <button class="rBtn editBtn" v-if="item.releaseStatus !== '1'" @tap="newRelease(item)">编辑</button>
  47. <button class="rBtn" :class="item.releaseStatus==='1'?'downBtn':'upBtn'" @tap="clickType(item)">{{item.releaseStatus==='1'?'下架':'上架'}}</button>
  48. </div>
  49. </div>
  50. </div>
  51. <van-dialog
  52. use-slot
  53. :show="show"
  54. show-cancel-button
  55. confirm-button-open-type="getUserInfo"
  56. @confirm="confirm"
  57. confirm-button-text="确定"
  58. cancel-button-text="取消"
  59. confirm-button-color="rgba(87, 107, 149, 1)"
  60. @close="show = false"
  61. >
  62. <div class="dialogInfo">
  63. <van-icon name="warning" style="color:#10aeff;font-size: 128rpx"/>
  64. <span style="margin-top: 16rpx" v-if="dialogType==='下架'">下架后小程序端将无法查看</span>
  65. <span style="margin-top: 8rpx" v-if="dialogType==='下架'">该活动信息,确认下架吗?</span>
  66. <span style="margin-top: 16rpx" v-if="dialogType==='上架'">上架后小程序端将显示该活动信息,</span>
  67. <span style="margin-top: 8rpx" v-if="dialogType==='上架'">确认上架吗?</span>
  68. </div>
  69. </van-dialog>
  70. </div>
  71. </div>
  72. </template>
  73. <script>
  74. import { listHomeCommunityActivity, getUserLocalStorageInfo,editHomeCommunityActivity ,getByCodes} from "@/js_sdk/http";
  75. export default {
  76. data() {
  77. return{
  78. dc_key:['activity_type'],
  79. show: false,
  80. selectTab:'全部',
  81. activityList:[
  82. // {name:'互联网私募如何入门?',typeName:'下架',status:'报名中'},
  83. // {name:'公募基金中的大数据挖掘?',typeName:'上架',status:'报名结束'},
  84. // {name:'年度小艾杯篮球赛开始啦?',typeName:'下架',status:'活动结束'},
  85. // {name:'互联网私募如何入门??',typeName:'下架',status:'未开始'},
  86. ],
  87. tabList:[
  88. {label:'全部',value:''}
  89. ],
  90. dialogType:'',
  91. search: {
  92. createdBy: getUserLocalStorageInfo().userId,
  93. pageNum: 1,
  94. pageSize: 10
  95. },
  96. actType:{
  97. id:'',
  98. releaseStatus:''
  99. }
  100. }
  101. },
  102. onShow(){
  103. this.getByCodes()
  104. },
  105. onPullDownRefresh() {
  106. this.getList()
  107. setTimeout(function () {
  108. uni.stopPullDownRefresh();
  109. }, 1000);
  110. },
  111. mounted() {
  112. },
  113. methods: {
  114. async getByCodes() {
  115. this.tabList = [{label:'全部',value:''}]
  116. let data = await getByCodes(JSON.stringify(this.dc_key));
  117. this.dic_SelectList = this.$common.handleDicList(data);
  118. this.dic_SelectList.activity_type.forEach(item=>{
  119. this.tabList.push(item)
  120. })
  121. this.getList()
  122. // console.log('this.tabList',this.tabList)
  123. },
  124. clickTab(item) {
  125. this.selectTab = item.label;
  126. this.search.activityType = item.value
  127. this.getList()
  128. },
  129. getList(){
  130. this.activityList = []
  131. listHomeCommunityActivity(this.search).then(res=>{
  132. if (res.errno == 0){
  133. this.activityList = res.data.rows
  134. this.activityList.forEach(item=>{
  135. if (item.annex) {
  136. item.imgUrl = JSON.parse(item.annex)[0].url
  137. }
  138. })
  139. }
  140. })
  141. },
  142. newRelease(e){
  143. // console.log(e)
  144. if (e){
  145. uni.navigateTo({
  146. url:'/pages/subPackages/activityPromulgate/add?item=' + JSON.stringify(e)
  147. })
  148. }else{
  149. uni.navigateTo({
  150. url:'/pages/subPackages/activityPromulgate/add'
  151. })
  152. }
  153. },
  154. onChange(){
  155. },
  156. clickType(item) {
  157. if (item.releaseStatus==='1'){
  158. this.dialogType = '下架'
  159. this.actType.releaseStatus = '2'
  160. }else{
  161. this.dialogType = '上架'
  162. this.actType.releaseStatus = '1'
  163. }
  164. this.actType.id = item.id
  165. this.show = true
  166. },
  167. confirm(e){
  168. editHomeCommunityActivity(this.actType).then(res=>{
  169. uni.showToast({
  170. title: res.errmsg,
  171. icon: 'none',
  172. mask: true,
  173. duration: 1000
  174. });
  175. this.getList()
  176. })
  177. },
  178. toQrCode(item) {
  179. uni.navigateTo({
  180. url:'/pages/subPackages/activityPromulgate/qrCode?item=' + JSON.stringify(item)
  181. })
  182. }
  183. }
  184. }
  185. </script>
  186. <style lang="scss">
  187. .activityPromulgate{
  188. .activityTop{
  189. background: white;
  190. padding: 26rpx 32rpx;
  191. .addRepair{
  192. display: flex;
  193. justify-content: flex-end;
  194. align-items: center;
  195. color: rgba(3, 101, 249, 1);
  196. }
  197. }
  198. .activityListBody{
  199. padding: 32rpx;
  200. .listItem{
  201. width: 686rpx;
  202. height: 388rpx;
  203. padding: 24rpx 0;
  204. border-radius: 16rpx;
  205. background: white;
  206. box-sizing: border-box;
  207. margin-bottom: 24rpx;
  208. .listItemInfoBox{
  209. display: flex;
  210. align-items: center;
  211. justify-content: space-between;
  212. padding: 0 24rpx;
  213. .listItemInfoLeft{
  214. display: flex;
  215. flex-direction: column;
  216. .listTitle{
  217. width: 375rpx;
  218. white-space: nowrap;
  219. overflow: hidden;
  220. text-overflow: ellipsis;
  221. font-size: 32rpx;
  222. color: rgba(24, 23, 42, 1);
  223. font-weight: 600;
  224. margin-bottom: 10rpx;
  225. }
  226. .listCon{
  227. font-size: 26rpx;
  228. color: rgba(102, 102, 102, 1);
  229. line-height: 42rpx;
  230. }
  231. }
  232. .listItemInfoRight{
  233. position: relative;
  234. width: 220rpx;
  235. height: 180rpx;
  236. border-radius: 8rpx;
  237. overflow: hidden;
  238. .tags{
  239. width: 128rpx;
  240. height: 48rpx;
  241. position: absolute;
  242. top: 0;
  243. right: 0;
  244. border-radius: 0 8rpx 0 8rpx;
  245. display: flex;
  246. align-items: center;
  247. justify-content: center;
  248. font-size: 28rpx;
  249. }
  250. .bmzTag{
  251. background: rgba(198, 255, 224, 1);
  252. color: rgba(34, 181, 101, 1);
  253. }
  254. .bmjsTag{
  255. color: rgba(255, 107, 24, 1);
  256. background: rgba(255, 211, 186, 1);
  257. }
  258. .hdjsTag{
  259. color: rgba(141, 146, 155, 1);
  260. background: rgba(226, 232, 239, 1);
  261. }
  262. .wksTag{
  263. color: rgba(3, 101, 249, 1);
  264. background: rgba(197, 218, 250, 1);
  265. }
  266. .listImg{
  267. width: 100%;
  268. height: 100%;
  269. }
  270. }
  271. }
  272. .listItemInfoBox2{
  273. display: flex;
  274. justify-content: space-between;
  275. padding: 0 24rpx;
  276. margin-top: 12rpx;
  277. margin-bottom: 28rpx;
  278. .fbrBox{
  279. font-size: 26rpx;
  280. color: rgba(102, 102, 102, 1);
  281. line-height: 44rpx;
  282. }
  283. }
  284. .listItemInfoBox3{
  285. display: flex;
  286. justify-content: space-between;
  287. align-items: center;
  288. padding: 34rpx 32rpx 0 32rpx;
  289. border-top: 1px solid rgba(230, 230, 230, 1);
  290. .listBtnBox{
  291. display: flex;
  292. align-items: center;
  293. .rBtn{
  294. width: 160rpx;
  295. height: 60rpx;
  296. border-radius: 32rpx;
  297. display: flex;
  298. align-items: center;
  299. justify-content: center;
  300. font-size: 28rpx;
  301. &::after{
  302. border-radius: 32rpx;
  303. border: none;
  304. }
  305. }
  306. .editBtn{
  307. border: 1px solid rgba(3, 101, 249, 1);
  308. color: rgba(3, 101, 249, 1);
  309. margin-right: 24rpx;
  310. }
  311. .downBtn{
  312. background: linear-gradient( 316deg, #84AAFF 0%, #0365F9 100%);
  313. color: white;
  314. }
  315. .upBtn{
  316. background: linear-gradient( 316deg, #52E997 0%, #21A45C 100%);
  317. color: white;
  318. }
  319. }
  320. .qrCodeBox{
  321. display: flex;
  322. align-items: center;
  323. color: rgba(3, 101, 249, 1);
  324. font-size: 28rpx;
  325. .qrIcon{
  326. width: 32rpx;
  327. height: 32rpx;
  328. margin-right: 16rpx;
  329. }
  330. }
  331. }
  332. }
  333. }
  334. .dialogInfo{
  335. padding: 64rpx 32rpx;
  336. font-size: 34rpx;
  337. color:rgba(51, 51, 51, 1);
  338. display: flex;
  339. flex-direction: column;
  340. align-items: center;
  341. }
  342. .parkDynamicTab2 {
  343. display: flex;
  344. padding: 24rpx 0;
  345. margin-top: 24rpx;
  346. .tabItem {
  347. color: #666666;
  348. font-size: 28rpx;
  349. margin: 0 auto;
  350. }
  351. .selectTabItem {
  352. color: #18172a;
  353. border-bottom: 6rpx solid #034df7;
  354. }
  355. }
  356. }
  357. </style>