index.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513
  1. <template>
  2. <view class="zxbox">
  3. <view class="zxtop">
  4. <view class="navbox">
  5. <uni-nav-bar color="#ffffff" leftWidth='340rpx' @clickRight="getNewsFn" :background-color="backgroundColor" :border="false" statusBar='true' fixed="true">
  6. <block slot="left">
  7. <image :src="titimg" class="topl"></image>
  8. </block>
  9. <block slot="right" v-if="checkPermi(['zxNotice:notice:list'])">
  10. <view class="topr">
  11. <image :src="noticeimg"></image>
  12. <view class="cir"></view>
  13. </view>
  14. </block>
  15. </uni-nav-bar>
  16. </view>
  17. <image :src="bgimg" class="bgimg"></image>
  18. <view class="zxmain">
  19. <view class="flexc mb27">
  20. <view class="htop" @click="getAddCase" v-if="checkPermi(['proposalInfo:info:add'])">
  21. <view class="imgs">
  22. <image :src="htopa" class="imga"></image>
  23. </view>
  24. <view class="tit">提交提案</view>
  25. </view>
  26. <view class="htop" @click="getAddsqmy" v-if="checkPermi(['sqmyInfo:info:add'])">
  27. <view class="imgs">
  28. <image :src="htopb" class="imgb"></image>
  29. </view>
  30. <view class="tit">上报社情民意</view>
  31. </view>
  32. <view class="htop" @click="getAddlzda" v-if="checkPermi(['member:info:MemberReport'])">
  33. <view class="imgs">
  34. <image :src="htopc" class="imgc"></image>
  35. </view>
  36. <view class="tit">履职档案</view>
  37. </view>
  38. <view class="htop" @click="getAddhy" v-if="checkPermi(['zxConference:conference:add'])">
  39. <view class="imgs">
  40. <image :src="htopd" class="imga"></image>
  41. </view>
  42. <view class="tit">创建会议</view>
  43. </view>
  44. </view>
  45. <view class="hbox">
  46. <!-- 通知栏 -->
  47. <block v-if="checkPermi(['zxNotice:notice:list'])">
  48. <h-notice></h-notice>
  49. </block>
  50. <!-- 入口 -->
  51. <view class="mt22">
  52. <view class="htit">快捷入口</view>
  53. <view class="mt18 flexcw">
  54. <view class="htbox" @click="getZxCaseFn" v-if="checkPermi(['proposalInfo:info:list'])">
  55. <image :src="hrbga" class="hrbg"></image>
  56. <view class="htboxa flexc">
  57. <view class="flex1 mr10">
  58. <view class="tit">政协提案</view>
  59. <view class="txt">全方位审核委员提案</view>
  60. </view>
  61. <image :src="hrimga" class="flex0 imga"></image>
  62. </view>
  63. </view>
  64. <view class="htbox" @click="getsqmyInfoFn" v-if="checkPermi(['sqmyInfo:info:list'])">
  65. <image :src="hrbgb" class="hrbg"></image>
  66. <view class="htboxa flexc">
  67. <view class="flex1 mr10">
  68. <view class="tit">社情民意</view>
  69. <view class="txt">录入社情民意信息</view>
  70. </view>
  71. <image :src="hrimgb" class="flex0 imgb"></image>
  72. </view>
  73. </view>
  74. <view class="htbox" @click="getlzInfoFn" v-if="checkPermi(['member:info:list'])">
  75. <image :src="hrbgc" class="hrbg"></image>
  76. <view class="htboxa flexc">
  77. <view class="flex1 mr10">
  78. <view class="tit">履职信息</view>
  79. <view class="txt">管理委员履职信息</view>
  80. </view>
  81. <image :src="hrimgc" class="flex0 imgc"></image>
  82. </view>
  83. </view>
  84. <view class="htbox" @click="getMettFn" v-if="checkPermi(['zxConference:conference:list'])">
  85. <image :src="hrbgd" class="hrbg"></image>
  86. <view class="htboxa flexc">
  87. <view class="flex1 mr10">
  88. <view class="tit">会议活动</view>
  89. <view class="txt">了解会议活动信息</view>
  90. </view>
  91. <image :src="hrimgd" class="flex0 imgd"></image>
  92. </view>
  93. </view>
  94. </view>
  95. </view>
  96. </view>
  97. </view>
  98. </view>
  99. <!-- 新闻 -->
  100. <view class="hnbox">
  101. <view class="hntabs flexc" :class="fixedflag?'tabfix':''" :style="fixedflag?'top:'+nvaHeight+'px;':''">
  102. <view class="flex1 flexc">
  103. <block v-for="(ite,idx) in tabList" :key="idx">
  104. <view class="tit" v-if="checkPermi([ite.limit])" :class="tabval==ite.val?'act':''" @click="getTab(ite.val)">{{ite.tit}}</view>
  105. </block>
  106. </view>
  107. <view class="flex0 txtr" @click="getMoreList">了解更多>></view>
  108. </view>
  109. <view style="height:114rpx;" v-if="fixedflag"></view>
  110. <!-- 列表 -->
  111. <view class="mt2 plr12" :style="'min-height: ' + minheight + 'px;'">
  112. <notice-list :datalist="list" :wtdt="wtdt" :tajdlist="tajdlist" :ztlxlist="ztlxlist" :type='tabval' @getDetail="getDetail"></notice-list>
  113. <view class="upmore flexccc" @click="getMoreFn" v-if="reachflag">
  114. <image :src="upimg"></image>
  115. <view>下拉更多</view>
  116. </view>
  117. </view>
  118. </view>
  119. <pop-up :type='ptype' @getClose="getClose" @getFaFn="getFaFn"></pop-up>
  120. <footers v-if="isfootflag" :footlist="footlist" :footerindex="footerindex" :color_checked="color_checked" :color_nochecked="color_nochecked" :isHomeIndex="true"></footers>
  121. </view>
  122. </template>
  123. <script>
  124. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  125. // let { calendar } = require("@/components/lunc-calendar/calendar.js");
  126. import {getCaseListFn} from "@/api/mine/case.js"
  127. import {getsqmyInfoListFn} from "@/api/mine/sqmyInfo.js"
  128. import {getDictionaryFn} from "@/api/mine/register.js"
  129. import {getNoticeList} from "@/api/mine/news.js"
  130. import popUp from "@/components/popup/popup.vue"
  131. import hNotice from '@/components/swiper/notice.vue'
  132. import noticeList from '@/components/notice/list.vue'
  133. import footers from '@/components/footer/footer.vue'
  134. export default {
  135. components:{hNotice,noticeList,footers,popUp},
  136. data(){
  137. return{
  138. footlist:[
  139. {module:'home',title:'潜山政协',icon_checked:require('@/static/images/tabbar/home_.png'),icon_nochecked:require('@/static/images/tabbar/home.png')},
  140. {module:'report',title:'履职报告',icon_checked:require('@/static/images/tabbar/report_.png'),icon_nochecked:require('@/static/images/tabbar/report.png')},
  141. {module:'notice',title:'会议通知',icon_checked:require('@/static/images/tabbar/notice_.png'),icon_nochecked:require('@/static/images/tabbar/notice.png')},
  142. {module:'mine',title:'个人中心',icon_checked:require('@/static/images/tabbar/mine_.png'),icon_nochecked:require('@/static/images/tabbar/mine.png')},
  143. ],
  144. color_checked :'222327',
  145. color_nochecked :'AAAAAA',
  146. footerindex:'home',
  147. isfootflag:true,
  148. backgroundColor:'transparent',
  149. bgimg:require("@/static/images/bg.png"),
  150. titimg:require("@/static/images/home/tit.png"),
  151. noticeimg:require("@/static/images/home/notice.png"),
  152. htopa:require("@/static/images/home/htopa.png"),
  153. htopb:require("@/static/images/home/htopb.png"),
  154. htopc:require("@/static/images/home/htopc.png"),
  155. htopd:require("@/static/images/home/htopd.png"),
  156. hrbga:require("@/static/images/home/hrbga.png"),
  157. hrbgb:require("@/static/images/home/hrbgb.png"),
  158. hrbgc:require("@/static/images/home/hrbgc.png"),
  159. hrbgd:require("@/static/images/home/hrbgd.png"),
  160. hrimga:require("@/static/images/home/hrimga.png"),
  161. hrimgb:require("@/static/images/home/hrimgb.png"),
  162. hrimgc:require("@/static/images/home/hrimgc.png"),
  163. hrimgd:require("@/static/images/home/hrimgd.png"),
  164. upimg:require("@/static/images/home/up.png"),
  165. tabval:1,
  166. tabList:[{tit:'公开提案',val:1,limit:'proposalInfo:info:list'},{tit:'社情民意',val:2,limit:'sqmyInfo:info:list'},],
  167. list:[],
  168. pageSize: 10,
  169. pageNum: 1,
  170. reachflag: true,
  171. wtdt:'',
  172. nvaHeight:44,
  173. listTop:0,//距离顶部的距离
  174. fixedflag:false,
  175. ptype:"",//lmta 联名填弹窗
  176. tajdlist:[],
  177. ztlxlist:[],
  178. minheight:0,
  179. }
  180. },
  181. onPageScroll(e) {
  182. var scrollTop = Number(e.scrollTop);
  183. var listTop=Number(this.listTop)-Number(this.nvaHeight)
  184. if (scrollTop <=this.nvaHeight) {
  185. const opacity = scrollTop / 100 // 计算透明度值
  186. const color = `rgba(29, 100, 226, ${opacity})`
  187. this.backgroundColor = color // 更新盒子背景颜色
  188. } else {
  189. this.backgroundColor = '#1D64E2'
  190. }
  191. if(scrollTop>listTop){
  192. this.fixedflag=true
  193. }else{
  194. this.fixedflag=false
  195. }
  196. },
  197. onLoad: function() {
  198. // uni.$on('refreshdatalist',(e) => {
  199. // this.reachflag=false;
  200. // this.pageNum=1;
  201. // this.list=[];
  202. // this.getDataFn();
  203. // })
  204. this.init()
  205. this.getDataFn()
  206. if(checkPermi(['zxNotice:notice:list'])){
  207. this.getNoticeList()
  208. }
  209. uni.getSystemInfo({
  210. success: (e) => {
  211. this.nvaHeight = Number(e.statusBarHeight)+44;
  212. this.minheight = e.screenHeight -Number(this.nvaHeight)- 57;
  213. }
  214. })
  215. },
  216. onUnload() {
  217. uni.$off('refreshdatalist')
  218. },
  219. onShow() {
  220. // var that=this;
  221. // this.time();
  222. },
  223. mounted() {
  224. this.getHeightFn()
  225. },
  226. // 上拉触底加载更多触发事件
  227. onReachBottom() {
  228. // if (this.reachflag) {
  229. // this.pageNum++
  230. // this.getDataFn()
  231. // }
  232. },
  233. methods:{
  234. checkPermi, checkRole,
  235. getNewsFn(){
  236. if(checkPermi(['zxNotice:notice:list'])){
  237. this.$tab.navigateTo('/work/pages/news/list')
  238. }
  239. },
  240. getMoreFn(){
  241. if (this.reachflag) {
  242. this.pageNum++
  243. this.getDataFn()
  244. }
  245. },
  246. getNoticeList(){
  247. var params={
  248. pageSize:10,
  249. pageNum:1
  250. }
  251. getNoticeList(params).then(res=>{
  252. if(res.code==200){
  253. }
  254. })
  255. },
  256. getMoreList(){
  257. if(this.tabval==1){
  258. this.getZxCaseFn()
  259. }else if(this.tabval==2){
  260. this.getsqmyInfoFn()
  261. }
  262. },
  263. getClose(){
  264. this.ptype=''
  265. },
  266. getTab(val){
  267. this.tabval=val;
  268. this.list=[];
  269. this.pageNum=1;
  270. this.reachflag=true;
  271. this.getDataFn()
  272. },
  273. getHeightFn(){
  274. let query = uni.createSelectorQuery().in(this);
  275. //需要给黄色区域设置一个id标识,在这里是demo
  276. query.select('.zxtop').boundingClientRect(data => {
  277. this.listTop = data.height//赋值,待会要用
  278. }).exec();
  279. },
  280. getAddCase(){
  281. if(uni.getStorageSync('tjtaList')){
  282. // var newObj=JSON.parse(JSON.stringify(uni.getStorageSync('tjtaList')))
  283. this.ptype='zcta'
  284. }else{
  285. this.$tab.navigateTo('/work/pages/case/add')
  286. }
  287. },
  288. getAddsqmy(){
  289. if(uni.getStorageSync('sqmyList')){
  290. this.ptype='sqmy'
  291. }else{
  292. this.$tab.navigateTo('/work/pages/sqmyInfo/add')
  293. }
  294. },
  295. getAddlzda(){
  296. this.$tab.navigateTo('/work/pages/report/info')
  297. },
  298. getAddhy(){
  299. if(uni.getStorageSync('cjhyList')){
  300. this.ptype='zchy'
  301. }else{
  302. this.$tab.navigateTo('/work/pages/meeting/add')
  303. }
  304. },
  305. getFaFn(type,ptype){
  306. this.ptype='';
  307. if(ptype=='zcta'){
  308. if(type=='new'){uni.removeStorageSync('tjtaList')}
  309. this.$tab.navigateTo('/work/pages/case/add?type='+type)
  310. }else if(ptype=='zchy'){
  311. if(type=='new'){uni.removeStorageSync('cjhyList')}
  312. this.$tab.navigateTo('/work/pages/meeting/add?type='+type)
  313. }else if(ptype=='sqmy'){
  314. if(type=='new'){uni.removeStorageSync('sqmyList')}
  315. this.$tab.navigateTo('/work/pages/sqmyInfo/add?type='+type)
  316. }
  317. },
  318. getZxCaseFn(){
  319. this.$tab.navigateTo('/work/pages/case/mine')
  320. },
  321. getsqmyInfoFn(){
  322. this.$tab.navigateTo('/work/pages/sqmyInfo/mine')
  323. },
  324. getMettFn(){
  325. this.$tab.navigateTo('/work/pages/meeting/list')
  326. },
  327. getlzInfoFn(){
  328. this.$tab.navigateTo('/work/pages/report/info')
  329. },
  330. init(){
  331. // 提案进度
  332. getDictionaryFn('proposal_progress').then(res=>{
  333. if(res.code==200){
  334. this.tajdlist = res.data.map(v => {
  335. return {
  336. label: v.dictLabel,
  337. value: v.dictValue
  338. }
  339. })
  340. }
  341. })
  342. //主题类型
  343. getDictionaryFn('sqmy_topic_type').then(res=>{
  344. if(res.code==200){
  345. this.ztlxlist = res.data.map(v => {
  346. return {
  347. label: v.dictLabel,
  348. value: v.dictValue
  349. }
  350. })
  351. }
  352. })
  353. },
  354. time() {
  355. var date = new Date();
  356. var y = date.getFullYear();
  357. var m = date.getMonth() + 1;
  358. var d = date.getDate();
  359. let lunar = calendar.solar2lunar(y, m, d); //农历
  360. this.lunar=lunar.IMonthCn+lunar.IDayCn;
  361. this.daytime=m+'月'+d+"日";
  362. // var h = date.getHours();
  363. // var min = date.getMinutes();
  364. // var s = date.getSeconds();
  365. // var week = date.getDay(); //获取当前星期X(0-6,0代表星期天)
  366. // var weeks = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
  367. // var yearStr = y + '-' + (m < 10 ? ('0' + m) : m) + '-' + (d < 10 ? ('0' + d) : d)
  368. // var timeStr = (h < 10 ? ('0' + h) : h) + ':' + (min < 10 ? ('0' + min) : min) + ':' + (s < 10 ? (
  369. // '0' + s) : s);
  370. // this.kaTime = yearStr + ' ' + timeStr;
  371. },
  372. getDetail(data){
  373. // this.$tab.navigateTo('/pages/order/staffcode?type=look&id='+data)
  374. },
  375. getDataFn(){
  376. var params={
  377. pageSize:this.pageSize,
  378. pageNum: this.pageNum,
  379. // visitType:3
  380. }
  381. if(this.tabval==1){//公开提案
  382. params.isPublicity='是';
  383. params.isRecord=0
  384. getCaseListFn(params).then(res=>{
  385. if(res.code==200){
  386. if (res.rows.length < this.pageSize) {
  387. this.reachflag = false
  388. this.wtdt = '到底了~';
  389. } else {
  390. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  391. if (num < res.total) {
  392. this.reachflag = true
  393. this.wtdt = '上拉加载更多'
  394. } else {
  395. this.reachflag = false
  396. this.wtdt = '到底了~';
  397. }
  398. }
  399. if (this.pageNum == 1) {
  400. this.list = res.rows;
  401. } else {
  402. this.list = this.list.concat(res.rows)
  403. }
  404. }else{
  405. this.$toast(res.msg)
  406. }
  407. })
  408. }else if(this.tabval==2){//社情民意
  409. getsqmyInfoListFn(params).then(res=>{
  410. if(res.code==200){
  411. if (res.rows.length < this.pageSize) {
  412. this.reachflag = false
  413. this.wtdt = '到底了~';
  414. } else {
  415. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  416. if (num < res.total) {
  417. this.reachflag = true
  418. this.wtdt = '上拉加载更多'
  419. } else {
  420. this.reachflag = false
  421. this.wtdt = '到底了~';
  422. }
  423. }
  424. if (this.pageNum == 1) {
  425. this.list = res.rows;
  426. } else {
  427. this.list = this.list.concat(res.rows)
  428. }
  429. }else{
  430. this.$toast(res.msg)
  431. }
  432. })
  433. }
  434. },
  435. },
  436. }
  437. </script>
  438. <style lang="scss" scoped>
  439. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4;
  440. .topl{width: 274rpx;height: 50rpx;margin-left: 14rpx;}
  441. .topr{width: 36rpx;height: 36rpx;position: relative;margin-right: 10rpx;
  442. image{width: 100%;height: 100%;}
  443. .cir{width: 14rpx;height: 14rpx;background: #DF0024;border-radius: 50%;position: absolute;right: -7rpx;top: -7rpx;}
  444. }
  445. }
  446. // .zxbox /deep/ .ql-editor p{text-indent: 2rem;}
  447. .zxbox{
  448. .bgimg{width: 100%;height: 420rpx;}
  449. .zxmain{margin-top: -260rpx;z-index: 1;position: relative;
  450. .htop{width: 25%;display: flex;flex-direction: column;align-items: center;justify-content: center;
  451. .imgs{
  452. width: 74rpx;height: 74rpx;display: flex;align-items: center;justify-content: center;
  453. .imga{width: 72rpx;height: 72rpx;}
  454. .imgb{width: 68rpx;height: 74rpx;}
  455. .imgc{width: 68rpx;height: 72rpx;}
  456. }
  457. .tit{font-weight: 500;font-size: 26rpx;color: #F1F9FF;margin-top: 26rpx;}
  458. }
  459. .hbox{
  460. background: #ffffff;border-radius: 30rpx 30rpx 0 0;padding: 38rpx 24rpx 0 24rpx;
  461. .htit{font-size: 36rpx;color: #343434;font-weight: bold;}
  462. .htbox{position: relative;width: 342rpx;height: 146rpx;position: relative;margin-bottom: 24rpx;margin-right: 18rpx;
  463. &:nth-of-type(2n){margin-right: 0;}
  464. .hrbg{width: 100%;height: 100%;}
  465. .htboxa{position: absolute;left: 0;right: 0;top: 0;bottom: 0;padding: 0 18rpx 0 32rpx;box-sizing: border-box;
  466. .tit{font-size: 16px;color: #222327;font-weight: bold;margin-bottom: 8rpx;line-height: 44rpx;}
  467. .txt{font-weight: 500;font-size: 24rpx;color: #666666;}
  468. .imga{width: 56rpx;height: 60rpx;}
  469. .imgb{width: 50rpx;height: 60rpx;}
  470. .imgc{width: 54rpx;height: 58rpx;}
  471. .imgd{width: 70rpx;height: 56rpx;}
  472. }
  473. }
  474. }
  475. }
  476. .hnbox{background-color: #ffffff;padding-bottom: 32rpx;
  477. .hntabs{padding:32rpx 24rpx;background-color: #ffffff;
  478. &.tabfix{position: fixed;left: 0;right: 0;z-index: 4;box-shadow: 0rpx 4rpx 12rpx 0rpx rgba(196,191,191,0.22);}
  479. .tit{font-weight: 500;font-size: 32rpx;color: #AAAAAA;position: relative;line-height: 50rpx;margin-right: 64rpx;
  480. &.act{font-weight: bold;font-size: 36rpx;color: #222327;
  481. &::after{
  482. content: '';width: 52rpx;height: 12rpx;background: #1D64E2;border-radius: 6rpx;position: absolute;left: 50%;bottom: -32rpx;margin-left: -26rpx;
  483. }
  484. }
  485. }
  486. .txtr{font-size: 26rpx;color: #aaaaaa;font-weight:500;}
  487. }
  488. .upmore{
  489. image{width: 40rpx;height: 32rpx;margin-bottom: 16rpx;}
  490. view{font-weight: 500;font-size: 26rpx;color: #AAAAAA;}
  491. }
  492. }
  493. }
  494. </style>