index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453
  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">
  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">
  21. <view class="imgs">
  22. <image :src="htopa" class="imga"></image>
  23. </view>
  24. <view class="tit">提交提案</view>
  25. </view>
  26. <view class="htop">
  27. <view class="imgs">
  28. <image :src="htopb" class="imgb"></image>
  29. </view>
  30. <view class="tit">上报社情民意</view>
  31. </view>
  32. <view class="htop">
  33. <view class="imgs">
  34. <image :src="htopc" class="imgc"></image>
  35. </view>
  36. <view class="tit">履职档案</view>
  37. </view>
  38. <view class="htop">
  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. <h-notice></h-notice>
  48. <!-- 入口 -->
  49. <view class="mt22">
  50. <view class="htit">快捷入口</view>
  51. <view class="mt18 flexcw">
  52. <view class="htbox" @click="getZxCaseFn">
  53. <image :src="hrbga" class="hrbg"></image>
  54. <view class="htboxa flexc">
  55. <view class="flex1 mr10">
  56. <view class="tit">政协提案</view>
  57. <view class="txt">全方位审核委员提案</view>
  58. </view>
  59. <image :src="hrimga" class="flex0 imga"></image>
  60. </view>
  61. </view>
  62. <view class="htbox">
  63. <image :src="hrbgb" class="hrbg"></image>
  64. <view class="htboxa flexc">
  65. <view class="flex1 mr10">
  66. <view class="tit">社情民意</view>
  67. <view class="txt">录入社情民意信息</view>
  68. </view>
  69. <image :src="hrimgb" class="flex0 imgb"></image>
  70. </view>
  71. </view>
  72. <view class="htbox">
  73. <image :src="hrbgc" class="hrbg"></image>
  74. <view class="htboxa flexc">
  75. <view class="flex1 mr10">
  76. <view class="tit">履职信息</view>
  77. <view class="txt">管理委员履职信息</view>
  78. </view>
  79. <image :src="hrimgc" class="flex0 imgc"></image>
  80. </view>
  81. </view>
  82. <view class="htbox">
  83. <image :src="hrbgd" class="hrbg"></image>
  84. <view class="htboxa flexc">
  85. <view class="flex1 mr10">
  86. <view class="tit">会议活动</view>
  87. <view class="txt">了解会议活动信息</view>
  88. </view>
  89. <image :src="hrimgd" class="flex0 imgd"></image>
  90. </view>
  91. </view>
  92. </view>
  93. </view>
  94. </view>
  95. </view>
  96. </view>
  97. <!-- 新闻 -->
  98. <view class="hnbox">
  99. <view class="hntabs flexc" :class="fixedflag?'tabfix':''" :style="fixedflag?'top:'+nvaHeight+'px;':''">
  100. <view class="flex1 flexc">
  101. <view class="tit" v-for="(ite,idx) in tabList" :key="idx" :class="tabval==ite.val?'act':''" @click="getTab(ite.val)">{{ite.tit}}</view>
  102. </view>
  103. <view class="flex0 txtr">了解更多>></view>
  104. </view>
  105. <view style="height:114rpx;" v-if="fixedflag"></view>
  106. <!-- 列表 -->
  107. <view class="mt2 plr12">
  108. <notice-list :datalist="list" :wtdt="wtdt" type='1' @getDetail="getDetail"></notice-list>
  109. <view class="upmore flexccc">
  110. <image :src="upimg"></image>
  111. <view>下拉更多</view>
  112. </view>
  113. </view>
  114. </view>
  115. <footers v-if="isfootflag" :footlist="footlist" :footerindex="footerindex" :color_checked="color_checked" :color_nochecked="color_nochecked" :isHomeIndex="true"></footers>
  116. </view>
  117. </template>
  118. <script>
  119. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  120. // let { calendar } = require("@/components/lunc-calendar/calendar.js");
  121. // import {getReservatcountl,getReservatList,getReservatDel,getReservatSh} from "@/api/mine/order.js"
  122. // import {getDictionaryFn} from "@/api/mine/register.js"
  123. import hNotice from '@/components/swiper/notice.vue'
  124. import noticeList from '@/components/notice/list.vue'
  125. import footers from '@/components/footer/footer.vue'
  126. export default {
  127. components:{hNotice,noticeList,footers},
  128. data(){
  129. return{
  130. footlist:[
  131. {module:'home',title:'潜山政协',icon_checked:require('@/static/images/tabbar/home_.png'),icon_nochecked:require('@/static/images/tabbar/home.png')},
  132. {module:'report',title:'履职报告',icon_checked:require('@/static/images/tabbar/report_.png'),icon_nochecked:require('@/static/images/tabbar/report.png')},
  133. {module:'notice',title:'会议通知',icon_checked:require('@/static/images/tabbar/notice_.png'),icon_nochecked:require('@/static/images/tabbar/notice.png')},
  134. {module:'mine',title:'个人中心',icon_checked:require('@/static/images/tabbar/mine_.png'),icon_nochecked:require('@/static/images/tabbar/mine.png')},
  135. ],
  136. color_checked :'222327',
  137. color_nochecked :'AAAAAA',
  138. footerindex:'home',
  139. isfootflag:true,
  140. backgroundColor:'transparent',
  141. bgimg:require("@/static/images/bg.png"),
  142. titimg:require("@/static/images/home/tit.png"),
  143. noticeimg:require("@/static/images/home/notice.png"),
  144. htopa:require("@/static/images/home/htopa.png"),
  145. htopb:require("@/static/images/home/htopb.png"),
  146. htopc:require("@/static/images/home/htopc.png"),
  147. htopd:require("@/static/images/home/htopd.png"),
  148. hrbga:require("@/static/images/home/hrbga.png"),
  149. hrbgb:require("@/static/images/home/hrbgb.png"),
  150. hrbgc:require("@/static/images/home/hrbgc.png"),
  151. hrbgd:require("@/static/images/home/hrbgd.png"),
  152. hrimga:require("@/static/images/home/hrimga.png"),
  153. hrimgb:require("@/static/images/home/hrimgb.png"),
  154. hrimgc:require("@/static/images/home/hrimgc.png"),
  155. hrimgd:require("@/static/images/home/hrimgd.png"),
  156. upimg:require("@/static/images/home/up.png"),
  157. tabval:'0',
  158. tabList:[{tit:'政协要闻',val:'0'},{tit:'界别活动',val:'1'},],
  159. list:[
  160. {tit:'全国政协十四届二次会议在京开幕 习近平等党和 国家领导人到会祝贺',img:require("@/static/images/bg.png"),from:'新华网',time:'2024-03-04',isTop:true},
  161. {tit:'政协全国委员会关于颁发2023年度全国政协委员 优秀履职奖的决定',img:require("@/static/images/bg.png"),from:'人民政协报',time:'2024-03-03',isTop:false},
  162. {tit:'市政协办公室党支部召开党员大会',img:require("@/static/images/bg.png"),from:'人民政协报',time:'2024-03-02',isTop:false},
  163. ],
  164. pageSize: 10,
  165. pageNum: 1,
  166. reachflag: true,
  167. wtdt:'',
  168. nvaHeight:44,
  169. listTop:0,//距离顶部的距离
  170. fixedflag:false,
  171. }
  172. },
  173. onPageScroll(e) {
  174. var scrollTop = Number(e.scrollTop);
  175. var listTop=Number(this.listTop)-Number(this.nvaHeight)
  176. if (scrollTop <=this.nvaHeight) {
  177. const opacity = scrollTop / 100 // 计算透明度值
  178. const color = `rgba(29, 100, 226, ${opacity})`
  179. this.backgroundColor = color // 更新盒子背景颜色
  180. } else {
  181. this.backgroundColor = '#1D64E2'
  182. }
  183. if(scrollTop>listTop){
  184. this.fixedflag=true
  185. }else{
  186. this.fixedflag=false
  187. }
  188. },
  189. onLoad: function() {
  190. // uni.$on('refreshdatalist',(e) => {
  191. // this.reachflag=false;
  192. // this.pageNum=1;
  193. // this.list=[];
  194. // this.getDataFn();
  195. // // this.getcount();
  196. // })
  197. // this.init()
  198. // // this.getcount()
  199. // this.getDataFn()
  200. this.nvaHeight=uni.getSystemInfoSync().statusBarHeight+44;
  201. },
  202. onUnload() {
  203. uni.$off('refreshdatalist')
  204. },
  205. onShow() {
  206. // var that=this;
  207. // this.time();
  208. },
  209. mounted() {
  210. this.getHeightFn()
  211. },
  212. // 上拉触底加载更多触发事件
  213. onReachBottom() {
  214. // if (this.reachflag) {
  215. // this.pageNum++
  216. // this.getDataFn()
  217. // }
  218. },
  219. methods:{
  220. checkPermi, checkRole,
  221. getNewsFn(){
  222. this.$tab.navigateTo('/work/pages/news/list')
  223. },
  224. getTab(val){
  225. this.tabval=val;
  226. },
  227. getHeightFn(){
  228. let query = uni.createSelectorQuery().in(this);
  229. //需要给黄色区域设置一个id标识,在这里是demo
  230. query.select('.zxtop').boundingClientRect(data => {
  231. this.listTop = data.height//赋值,待会要用
  232. }).exec();
  233. },
  234. getAddCase(){
  235. this.$tab.navigateTo('/work/pages/case/add')
  236. },
  237. getZxCaseFn(){
  238. this.$tab.navigateTo('/work/pages/case/mine')
  239. },
  240. init(){
  241. // 记录来源
  242. getDictionaryFn('jluly').then(res=>{
  243. if(res.code==200){
  244. this.adrlist = res.data.map(v => {
  245. return {
  246. dictLabel: v.dictLabel,
  247. dictValue: v.dictValue
  248. }
  249. })
  250. }
  251. })
  252. },
  253. getMoreFn(){
  254. this.$tab.navigateTo("/pages/order/list")
  255. },
  256. getDelFn(id){
  257. var that=this;
  258. getReservatDel(id).then(res=>{
  259. if(res.code==200){
  260. that.$toast('删除成功')
  261. setTimeout(function(){
  262. that.reachflag=true;
  263. that.pageNum=1;
  264. that.list=[];
  265. that.getDataFn();
  266. // that.getcount();
  267. },1500)
  268. }else{
  269. that.$toast(res.msg)
  270. }
  271. })
  272. },
  273. gettypeFn(ite){
  274. var that=this;
  275. var params={
  276. reservatId:ite.id,
  277. visitType:ite.type
  278. }
  279. getReservatSh(params).then(res=>{
  280. if(res.code==200){
  281. that.$toast('审核成功')
  282. setTimeout(function(){
  283. that.reachflag=true;
  284. that.pageNum=1;
  285. that.list=[];
  286. that.getDataFn();
  287. // that.getcount();
  288. },1500)
  289. }else{
  290. that.$toast(res.msg)
  291. }
  292. })
  293. },
  294. time() {
  295. var date = new Date();
  296. var y = date.getFullYear();
  297. var m = date.getMonth() + 1;
  298. var d = date.getDate();
  299. let lunar = calendar.solar2lunar(y, m, d); //农历
  300. this.lunar=lunar.IMonthCn+lunar.IDayCn;
  301. this.daytime=m+'月'+d+"日";
  302. // var h = date.getHours();
  303. // var min = date.getMinutes();
  304. // var s = date.getSeconds();
  305. // var week = date.getDay(); //获取当前星期X(0-6,0代表星期天)
  306. // var weeks = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
  307. // var yearStr = y + '-' + (m < 10 ? ('0' + m) : m) + '-' + (d < 10 ? ('0' + d) : d)
  308. // var timeStr = (h < 10 ? ('0' + h) : h) + ':' + (min < 10 ? ('0' + min) : min) + ':' + (s < 10 ? (
  309. // '0' + s) : s);
  310. // this.kaTime = yearStr + ' ' + timeStr;
  311. },
  312. getcount(){
  313. getReservatcountl().then(res=>{
  314. if(res.code==200){
  315. this.conuntinfo=res.data
  316. }else{
  317. this.$toast(res.msg)
  318. }
  319. })
  320. },
  321. getDetail(data){
  322. this.$tab.navigateTo('/pages/order/staffcode?type=look&id='+data)
  323. },
  324. getDataFn(){
  325. var params={
  326. pageSize:this.pageSize,
  327. pageNum: this.pageNum,
  328. // visitType:3
  329. }
  330. getReservatList(params).then(res=>{
  331. if(res.code==200){
  332. if (res.rows.length < this.pageSize) {
  333. this.reachflag = false
  334. this.wtdt = '到底了~';
  335. } else {
  336. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  337. if (num < res.total) {
  338. this.reachflag = true
  339. this.wtdt = '上拉加载更多'
  340. } else {
  341. this.reachflag = false
  342. this.wtdt = '到底了~';
  343. }
  344. }
  345. if (this.pageNum == 1) {
  346. this.list = res.rows;
  347. } else {
  348. this.list = this.list.concat(res.rows)
  349. }
  350. }else{
  351. this.$toast(res.msg)
  352. }
  353. })
  354. },
  355. },
  356. }
  357. </script>
  358. <style lang="scss" scoped>
  359. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4;
  360. .topl{width: 274rpx;height: 50rpx;margin-left: 14rpx;}
  361. .topr{width: 36rpx;height: 36rpx;position: relative;margin-right: 10rpx;
  362. image{width: 100%;height: 100%;}
  363. .cir{width: 14rpx;height: 14rpx;background: #DF0024;border-radius: 50%;position: absolute;right: -7rpx;top: -7rpx;}
  364. }
  365. }
  366. // .zxbox /deep/ .ql-editor p{text-indent: 2rem;}
  367. .zxbox{
  368. .bgimg{width: 100%;height: 420rpx;}
  369. .zxmain{margin-top: -260rpx;z-index: 1;position: relative;
  370. .htop{width: 25%;display: flex;flex-direction: column;align-items: center;justify-content: center;
  371. .imgs{
  372. width: 74rpx;height: 74rpx;display: flex;align-items: center;justify-content: center;
  373. .imga{width: 72rpx;height: 72rpx;}
  374. .imgb{width: 68rpx;height: 74rpx;}
  375. .imgc{width: 68rpx;height: 72rpx;}
  376. }
  377. .tit{font-weight: 500;font-size: 26rpx;color: #F1F9FF;margin-top: 26rpx;}
  378. }
  379. .hbox{
  380. background: #ffffff;border-radius: 30rpx 30rpx 0 0;padding: 38rpx 24rpx 0 24rpx;
  381. .htit{font-size: 36rpx;color: #343434;font-weight: bold;}
  382. .htbox{position: relative;width: 342rpx;height: 146rpx;position: relative;margin-bottom: 24rpx;margin-right: 18rpx;
  383. &:nth-of-type(2n){margin-right: 0;}
  384. .hrbg{width: 100%;height: 100%;}
  385. .htboxa{position: absolute;left: 0;right: 0;top: 0;bottom: 0;padding: 0 18rpx 0 32rpx;box-sizing: border-box;
  386. .tit{font-size: 16px;color: #222327;font-weight: bold;margin-bottom: 8rpx;line-height: 44rpx;}
  387. .txt{font-weight: 500;font-size: 24rpx;color: #666666;}
  388. .imga{width: 56rpx;height: 60rpx;}
  389. .imgb{width: 50rpx;height: 60rpx;}
  390. .imgc{width: 54rpx;height: 58rpx;}
  391. .imgd{width: 70rpx;height: 56rpx;}
  392. }
  393. }
  394. }
  395. }
  396. .hnbox{background-color: #ffffff;padding-bottom: 32rpx;
  397. .hntabs{padding:32rpx 24rpx;background-color: #ffffff;
  398. &.tabfix{position: fixed;left: 0;right: 0;z-index: 4;box-shadow: 0rpx 4rpx 12rpx 0rpx rgba(196,191,191,0.22);}
  399. .tit{font-weight: 500;font-size: 32rpx;color: #AAAAAA;position: relative;line-height: 50rpx;margin-right: 64rpx;
  400. &.act{font-weight: bold;font-size: 36rpx;color: #222327;
  401. &::after{
  402. content: '';width: 52rpx;height: 12rpx;background: #1D64E2;border-radius: 6rpx;position: absolute;left: 50%;bottom: -32rpx;margin-left: -26rpx;
  403. }
  404. }
  405. }
  406. .txtr{font-size: 26rpx;color: #aaaaaa;font-weight:500;}
  407. }
  408. .upmore{
  409. image{width: 40rpx;height: 32rpx;margin-bottom: 16rpx;}
  410. view{font-weight: 500;font-size: 26rpx;color: #AAAAAA;}
  411. }
  412. }
  413. }
  414. </style>