index.vue 17 KB

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