index.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. <template>
  2. <view class="zxbox">
  3. <view class="navbox">
  4. <uni-nav-bar color="#ffffff" leftWidth='300rpx' :background-color="backgroundColor" :border="false" statusBar='true' fixed="true">
  5. <block slot="left">
  6. <image :src="titimg" class="topl"></image>
  7. </block>
  8. <block slot="right">
  9. <view class="topr">
  10. <image :src="noticeimg"></image>
  11. <view class="cir"></view>
  12. </view>
  13. </block>
  14. </uni-nav-bar>
  15. </view>
  16. <image :src="bgimg" class="bgimg"></image>
  17. <footers v-if="isfootflag" :footlist="footlist" :footerindex="footerindex" :color_checked="color_checked" :color_nochecked="color_nochecked" :isHomeIndex="true"></footers>
  18. </view>
  19. </template>
  20. <script>
  21. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  22. import yList from "@/components/order/list.vue"
  23. let { calendar } = require("@/components/lunc-calendar/calendar.js");
  24. import {getReservatcountl,getReservatList,getReservatDel,getReservatSh} from "@/api/mine/order.js"
  25. import {getDictionaryFn} from "@/api/mine/register.js"
  26. import footers from '@/components/footer/footer.vue'
  27. export default {
  28. components:{yList,footers},
  29. data(){
  30. return{
  31. footlist:[
  32. {module:'home',title:'潜山政协',icon_checked:require('@/static/images/tabbar/home_.png'),icon_nochecked:require('@/static/images/tabbar/home.png')},
  33. {module:'report',title:'履职报告',icon_checked:require('@/static/images/tabbar/report_.png'),icon_nochecked:require('@/static/images/tabbar/report.png')},
  34. {module:'notice',title:'会议通知',icon_checked:require('@/static/images/tabbar/notice_.png'),icon_nochecked:require('@/static/images/tabbar/notice.png')},
  35. {module:'mine',title:'个人中心',icon_checked:require('@/static/images/tabbar/mine_.png'),icon_nochecked:require('@/static/images/tabbar/mine.png')},
  36. ],
  37. color_checked :'222327',
  38. color_nochecked :'AAAAAA',
  39. footerindex:'home',
  40. isfootflag:true,
  41. backgroundColor:'transparent',
  42. bgimg:require("@/static/images/navbg.png"),
  43. titimg:require("@/static/images/home/tit.png"),
  44. noticeimg:require("@/static/images/home/notice.png"),
  45. list:[],
  46. pageSize: 10,
  47. pageNum: 1,
  48. reachflag: true,
  49. wtdt:'',
  50. nvaHeight:44,
  51. }
  52. },
  53. onPageScroll(e) {
  54. var scrollTop = Number(e.scrollTop);
  55. if (scrollTop <=this.nvaHeight) {
  56. const opacity = scrollTop / 100 // 计算透明度值
  57. const color = `rgba(4, 145, 253, ${opacity})`
  58. this.backgroundColor = color // 更新盒子背景颜色
  59. } else {
  60. this.backgroundColor = '#0491fd'
  61. }
  62. },
  63. onLoad: function() {
  64. // uni.$on('refreshdatalist',(e) => {
  65. // this.reachflag=false;
  66. // this.pageNum=1;
  67. // this.list=[];
  68. // this.getDataFn();
  69. // // this.getcount();
  70. // })
  71. // this.init()
  72. // // this.getcount()
  73. // this.getDataFn()
  74. this.nvaHeight=uni.getSystemInfoSync().statusBarHeight+44;
  75. },
  76. onUnload() {
  77. uni.$off('refreshdatalist')
  78. },
  79. onShow() {
  80. // var that=this;
  81. // this.time();
  82. },
  83. mounted() {
  84. },
  85. // 上拉触底加载更多触发事件
  86. onReachBottom() {
  87. // if (this.reachflag) {
  88. // this.pageNum++
  89. // this.getDataFn()
  90. // }
  91. },
  92. methods:{
  93. checkPermi, checkRole,
  94. init(){
  95. // 记录来源
  96. getDictionaryFn('jluly').then(res=>{
  97. if(res.code==200){
  98. this.adrlist = res.data.map(v => {
  99. return {
  100. dictLabel: v.dictLabel,
  101. dictValue: Number(v.dictValue)
  102. }
  103. })
  104. }
  105. })
  106. },
  107. getMoreFn(){
  108. this.$tab.navigateTo("/pages/order/list")
  109. },
  110. getDelFn(id){
  111. var that=this;
  112. getReservatDel(id).then(res=>{
  113. if(res.code==200){
  114. that.$toast('删除成功')
  115. setTimeout(function(){
  116. that.reachflag=true;
  117. that.pageNum=1;
  118. that.list=[];
  119. that.getDataFn();
  120. // that.getcount();
  121. },1500)
  122. }else{
  123. that.$toast(res.msg)
  124. }
  125. })
  126. },
  127. gettypeFn(ite){
  128. var that=this;
  129. var params={
  130. reservatId:ite.id,
  131. visitType:ite.type
  132. }
  133. getReservatSh(params).then(res=>{
  134. if(res.code==200){
  135. that.$toast('审核成功')
  136. setTimeout(function(){
  137. that.reachflag=true;
  138. that.pageNum=1;
  139. that.list=[];
  140. that.getDataFn();
  141. // that.getcount();
  142. },1500)
  143. }else{
  144. that.$toast(res.msg)
  145. }
  146. })
  147. },
  148. time() {
  149. var date = new Date();
  150. var y = date.getFullYear();
  151. var m = date.getMonth() + 1;
  152. var d = date.getDate();
  153. let lunar = calendar.solar2lunar(y, m, d); //农历
  154. this.lunar=lunar.IMonthCn+lunar.IDayCn;
  155. this.daytime=m+'月'+d+"日";
  156. // var h = date.getHours();
  157. // var min = date.getMinutes();
  158. // var s = date.getSeconds();
  159. // var week = date.getDay(); //获取当前星期X(0-6,0代表星期天)
  160. // var weeks = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
  161. // var yearStr = y + '-' + (m < 10 ? ('0' + m) : m) + '-' + (d < 10 ? ('0' + d) : d)
  162. // var timeStr = (h < 10 ? ('0' + h) : h) + ':' + (min < 10 ? ('0' + min) : min) + ':' + (s < 10 ? (
  163. // '0' + s) : s);
  164. // this.kaTime = yearStr + ' ' + timeStr;
  165. },
  166. getcount(){
  167. getReservatcountl().then(res=>{
  168. if(res.code==200){
  169. this.conuntinfo=res.data
  170. }else{
  171. this.$toast(res.msg)
  172. }
  173. })
  174. },
  175. getDetail(data){
  176. this.$tab.navigateTo('/pages/order/staffcode?type=look&id='+data)
  177. },
  178. getDataFn(){
  179. var params={
  180. pageSize:this.pageSize,
  181. pageNum: this.pageNum,
  182. // visitType:3
  183. }
  184. getReservatList(params).then(res=>{
  185. if(res.code==200){
  186. if (res.rows.length < this.pageSize) {
  187. this.reachflag = false
  188. this.wtdt = '到底了~';
  189. } else {
  190. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  191. if (num < res.total) {
  192. this.reachflag = true
  193. this.wtdt = '上拉加载更多'
  194. } else {
  195. this.reachflag = false
  196. this.wtdt = '到底了~';
  197. }
  198. }
  199. if (this.pageNum == 1) {
  200. this.list = res.rows;
  201. } else {
  202. this.list = this.list.concat(res.rows)
  203. }
  204. }else{
  205. this.$toast(res.msg)
  206. }
  207. })
  208. },
  209. },
  210. }
  211. </script>
  212. <style lang="scss" scoped>
  213. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4;
  214. .topl{width: 274rpx;height: 50rpx;margin-left: 14rpx;}
  215. .topr{width: 36rpx;height: 36rpx;position: relative;margin-right: 10rpx;
  216. image{width: 100%;height: 100%;}
  217. .cir{width: 14rpx;height: 14rpx;background: #DF0024;border-radius: 50%;position: absolute;right: -7rpx;top: -7rpx;}
  218. }
  219. }
  220. .zxbox{
  221. .bgimg{width: 100%;height: 420rpx;}
  222. .zxmain{
  223. }
  224. }
  225. </style>