list.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <template>
  2. <view class="pb50" :style="'padding-top:'+nvaHeight+'px;'">
  3. <view class="navbox">
  4. <uni-nav-bar color="#ffffff" rightWidth="150rpx" title="政协提案" @clickLeft="getBack" @clickRight="getChFn" :background-color="backgroundColor" :border="false" statusBar='true' fixed="true">
  5. <block slot="left">
  6. <view class="topl">
  7. <image :src="backimg" ></image>
  8. </view>
  9. </block>
  10. <block slot="right">
  11. <view class="topr">
  12. <image :src="ccicoimg"></image>
  13. <view>提案查重</view>
  14. </view>
  15. </block>
  16. </uni-nav-bar>
  17. <view class="plr12 mt18">
  18. <view class="search flex0 mb10">
  19. <image :src="searchimg"></image>
  20. <input placeholder="输入关键字进行查询" />
  21. </view>
  22. </view>
  23. <view class="tablists flexc mb20">
  24. <view v-for="(ite,idx) in tabList" @click="getTabFn(ite.val)" :class="{act:tabidx==ite.val}" :key="idx">{{ite.tit}}</view>
  25. </view>
  26. <view style="height: 56rpx;"></view>
  27. <view class="lbtab flexc">
  28. <image :src="lbicoimg" class="limg"></image>
  29. <view class="lbtabs flexc">
  30. <view class="lbtabp" v-for="(ite,idx) in litablist" :key="idx">
  31. <picker range-key='label' :value="talbidx" :range="taztList" @change='bindDateChangea'>
  32. <view :class="datainfo.dqjz?'':'f16 co80'">{{datainfo.talb || ite.tit}}</view>
  33. </picker>
  34. <image :src="upimg" class="upimg"></image>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. <!-- 列表 -->
  40. <view class="mbox">
  41. <case-list :datalist="list" :wtdt="wtdt" :tajdlist='tajdlist' :type='tabidx' @getDetail="getDetail" @getTuiFn="getTuiFn"></case-list>
  42. </view>
  43. <view class="fwbtns">提交提案</view>
  44. <!-- 弹窗 -->
  45. <pop-up :type='ptype' @getClose="getClose"></pop-up>
  46. </view>
  47. </template>
  48. <script>
  49. import {getCaseListFn} from "@/api/mine/case.js"
  50. import popUp from "@/work/components/popup/popup.vue"
  51. import caseList from "@/work/components/case/list.vue"
  52. import {getDictionaryFn} from "@/api/mine/register.js"
  53. export default{
  54. components:{caseList,popUp},
  55. data(){
  56. return{
  57. searchimg: require("@/work/static/images/search.png"),
  58. ccicoimg:require("@/work/static/images/ccico.png"),
  59. lbicoimg:require("@/work/static/images/lbico.png"),
  60. backimg:require("@/work/static/images/back.png"),
  61. upimg:require("@/work/static/images/up.png"),
  62. backgroundColor:"#1D64E2",
  63. tabidx:7,
  64. tabList:[{tit:'征集通知',val:0},{tit:'提案审查',val:7},{tit:'我的提案',val:1},{tit:'联名提案',val:2},{tit:'推荐优秀',val:3},
  65. {tit:'推荐重点',val:4},{tit:'公开提案',val:5},{tit:'办理质量评议',val:6}],
  66. litablist:[{tit:'提案类别',val:0},{tit:'提案状态',val:1},{tit:'办理状态',val:2},{tit:'联名状态',val:1},{tit:'评议状态',val:1},{tit:'承办单位',val:2},{tit:'选择年份',val:1},{tit:'选择会议',val:3},
  67. {tit:'推荐状态',val:0},{tit:'开始日期',val:1},{tit:'结束日期',val:2},
  68. ],
  69. nvaHeight:44,
  70. talbList:[{},],
  71. taztList:[{label:'是',value:'0'},{label:'否',value:'1'}],
  72. talbidx:'',
  73. datainfo:{
  74. talb:'',
  75. },
  76. ptype:'',//弹窗类型
  77. list:[],
  78. pageSize: 10,
  79. pageNum: 1,
  80. reachflag: true,
  81. wtdt:'',
  82. tajdlist:[]
  83. }
  84. },
  85. onUnload(){
  86. uni.$off('refreshlist')
  87. },
  88. onLoad(e) {
  89. this.getDataFn()
  90. this.init()
  91. uni.$on('refreshlist', (e) => {
  92. this.getDataFn()
  93. })
  94. },
  95. mounted() {
  96. this.getHeightFn()
  97. },
  98. methods:{
  99. // 提案状态
  100. init(){
  101. getDictionaryFn('proposal_progress').then(res=>{
  102. if(res.code==200&&res.data.length){
  103. this.tajdlist = res.data.map(v => {
  104. return {
  105. label: v.dictLabel,
  106. value: Number(v.dictValue)
  107. }
  108. })
  109. }
  110. })
  111. },
  112. getHeightFn(){
  113. var s=uni.getSystemInfoSync().statusBarHeight;
  114. let query = uni.createSelectorQuery().in(this);
  115. //需要给黄色区域设置一个id标识,在这里是demo
  116. query.select('.navbox').boundingClientRect(data => {
  117. this.nvaHeight =s? data.height:Number(data.height)-20//赋值,待会要用
  118. }).exec();
  119. },
  120. getClose(){
  121. this.ptype=""
  122. },
  123. getTabFn(idx){
  124. this.tabidx=idx;
  125. },
  126. getBack(){
  127. uni.navigateBack({
  128. delta:1
  129. })
  130. },
  131. bindDateChangea(e){
  132. console.log(e,2)
  133. },
  134. getChFn(){
  135. this.$tab.navigateTo('/work/pages/case/tacheck')
  136. },
  137. getTuiFn(ite){
  138. this.ptype=ite.type
  139. },
  140. getDetail(data){
  141. this.$tab.navigateTo('/work/pages/case/details?id='+data)
  142. },
  143. getDataFn(){
  144. var params={
  145. pageSize:this.pageSize,
  146. pageNum: this.pageNum,
  147. // visitType:3
  148. }
  149. getCaseListFn(params).then(res=>{
  150. if(res.code==200){
  151. if (res.rows.length < this.pageSize) {
  152. this.reachflag = false
  153. this.wtdt = '到底了~';
  154. } else {
  155. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  156. if (num < res.total) {
  157. this.reachflag = true
  158. this.wtdt = '上拉加载更多'
  159. } else {
  160. this.reachflag = false
  161. this.wtdt = '到底了~';
  162. }
  163. }
  164. if (this.pageNum == 1) {
  165. this.list = res.rows;
  166. } else {
  167. this.list = this.list.concat(res.rows)
  168. }
  169. }else{
  170. this.$toast(res.msg)
  171. }
  172. })
  173. },
  174. }
  175. }
  176. </script>
  177. <style scoped lang="scss">
  178. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4;background-color: $com-cd3;
  179. .topl{width: 60rpx;height: 60rpx;display: flex;align-items: center;justify-content: center;
  180. image{width: 40rpx;height: 30rpx;}
  181. }
  182. .topr{display: flex;align-items: center;
  183. image{width: 26rpx;height: 26rpx;margin-right: 12rpx;}
  184. view{font-weight: 500;font-size: 26rpx;color: #FFFFFF;}
  185. }
  186. .tablists{
  187. overflow: auto;flex-wrap: nowrap;
  188. view{font-weight: bold;font-size: 26rpx;color: #FFFFFF;position: relative;flex: 0 0 auto;padding: 22rpx 24rpx;margin-right: 6rpx;box-sizing: border-box;
  189. &:last-child{margin-right: 0;}
  190. &.act{font-size: 30rpx;
  191. &::after{content: '';width: 62rpx;height: 10rpx;background: #FFFFFF;border-radius: 4rpx;left: 50%;margin-left: -31rpx;bottom: 0rpx;position: absolute;}
  192. }
  193. }
  194. }
  195. .lbtab{height: 114rpx;background: #FFFFFF;border-radius: 30rpx;padding-left: 24rpx;position: absolute;left:24rpx;right: 24rpx;bottom: -58rpx;
  196. .limg{width: 40rpx;height: 34rpx;margin-right: 10rpx;flex:0 0 auto;}
  197. .lbtabs{overflow: auto;flex-wrap: nowrap;
  198. .lbtabp{display: flex;align-items: center;flex: 0 0 auto;margin-right: 24rpx;}
  199. .upimg{width: 18rpx;height: 10rpx;}
  200. }
  201. }
  202. }
  203. .mbox{padding:58rpx 24rpx 28rpx;}
  204. .lbtabs /deep/ picker{padding: 0 18rpx;}
  205. </style>