receiveCasuallyPat.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <!-- 收到随手拍 -->
  2. <template>
  3. <view id="receiveCasuallyPat">
  4. <view class="top-button-box">
  5. <view :class="tabIndex==0?'view-color-a':'view-color-b'" @click="tabClick(0)">待处理</view>
  6. <view :class="tabIndex==1?'view-color-a':'view-color-b'" @click="tabClick(1)">已处理</view>
  7. </view>
  8. <scroll-view scroll-y @scrolltolower="scrollGet" class="info-max-box">
  9. <view class="for-info-box" v-for="(item,index) in infoList" :key="index" @click="goCasuallyPatInfo(item)">
  10. <view class="title-box">
  11. <view>{{item.subName}}</view>
  12. <view>{{item.createTimeStr}}</view>
  13. </view>
  14. <view class="text-box">{{item.describe}}</view>
  15. </view>
  16. <view class="get-null-box" v-if="!infoList[0]">暂无数据</view>
  17. </scroll-view>
  18. </view>
  19. </template>
  20. <script>
  21. import { getAppList ,photonoteList} from '@/api/index.js'
  22. export default {
  23. data() {
  24. return {
  25. tabIndex:0,
  26. infoList:[],
  27. //列表请求参数
  28. getData:{
  29. page:1,
  30. pageSize:20,
  31. getType:true,
  32. nullDataType:true,
  33. }
  34. }
  35. },
  36. onLoad() {
  37. },
  38. onShow(){
  39. this.clearData();
  40. this.getList();
  41. },
  42. methods: {
  43. tabClick(type){
  44. if(this.tabIndex != type){
  45. this.tabIndex = type;
  46. this.infoList = [];
  47. this.getData.page = 1;
  48. this.getData.getType = true;
  49. this.getData.nullDataType = true;
  50. this.getList();
  51. }
  52. },
  53. //清除
  54. clearData(){
  55. this.infoList = [];
  56. this.getData.page = 1;
  57. this.getData.getType = true;
  58. this.getData.nullDataType = true;
  59. },
  60. //去详情页
  61. goCasuallyPatInfo(item){
  62. if(item.handleStatus == 0){
  63. }
  64. uni.navigateTo({
  65. url: '/pages_manage/workbench/receiveCasuallyPat/casuallyPatInfo?item='+encodeURIComponent(JSON.stringify(item))
  66. });
  67. },
  68. //滚动事件
  69. scrollGet(){
  70. if(this.getData.getType){
  71. this.getData.page += 1;
  72. this.getList();
  73. }
  74. },
  75. //获取列表数据
  76. async getList(){
  77. let self = this;
  78. let obj = {
  79. pageNum:this.getData.page,
  80. pageSize:this.getData.pageSize,
  81. handleStatus:this.tabIndex
  82. }
  83. const {data} = await getAppList(obj)
  84. if(data.code==200){
  85. if(self.page==1){
  86. if(data.rows.length > 0 && data.rows.length == self.getData.pageSize){
  87. self.infoList = data.rows;
  88. }else if(data.rows.length > 0 && data.rows.length != self.getData.pageSize){
  89. self.infoList = data.rows;
  90. self.getData.getType = false;
  91. self.getData.nullDataType = true;
  92. }else{
  93. self.getData.getType = false;
  94. self.getData.nullDataType = true;
  95. }
  96. }else{
  97. if(data.rows.length > 0 && data.rows.length == self.getData.pageSize){
  98. self.infoList = self.infoList.concat(data.rows)
  99. }else if(data.rows.length > 0 && data.rows.length != self.getData.pageSize){
  100. self.infoList = self.infoList.concat(data.rows);
  101. self.getData.getType = false;
  102. self.getData.nullDataType = true;
  103. }else{
  104. self.getData.getType = false;
  105. self.getData.nullDataType = true;
  106. }
  107. }
  108. }
  109. },
  110. }
  111. }
  112. </script>
  113. <style lang="stylus" scoped>
  114. #receiveCasuallyPat{
  115. height:100%;
  116. width:100%;
  117. display flex
  118. flex-direction column
  119. .top-button-box{
  120. margin:20rpx 125rpx;
  121. display flex
  122. view{
  123. width:250rpx;
  124. line-height:80rpx;
  125. text-align center;
  126. font-size:28rpx;
  127. }
  128. view:nth-child(1){
  129. border-top-left-radius :40rpx;
  130. border-bottom-left-radius:40rpx;
  131. }
  132. view:nth-child(2){
  133. border-top-right-radius :40rpx;
  134. border-bottom-right-radius:40rpx;
  135. }
  136. .view-color-a{
  137. background #0183FA;
  138. color:#fff;
  139. }
  140. .view-color-b{
  141. background #e6e6e6;
  142. color:#999;
  143. }
  144. }
  145. .info-max-box{
  146. flex:1;
  147. overflow: scroll
  148. padding-bottom:20rpx;
  149. border-radius 20rpx
  150. .for-info-box:nth-child(1){
  151. .title-box{
  152. border:none;
  153. }
  154. border-top-left-radius 20rpx
  155. border-top-right-radius 20rpx
  156. }
  157. .for-info-box:last-child{
  158. border-bottom-left-radius 20rpx
  159. border-bottom-right-radius 20rpx
  160. }
  161. .for-info-box{
  162. background #fff
  163. margin:0 20rpx;
  164. .title-box{
  165. padding-top:12rpx;
  166. border-top:1rpx solid #e0e0e0;
  167. display flex
  168. margin 0 20rpx
  169. view{
  170. font-size:28rpx;
  171. line-height:60rpx;
  172. }
  173. view:nth-child(1){
  174. flex:1;
  175. }
  176. view:nth-child(2){
  177. font-size:24rpx;
  178. color:#999999;
  179. text-align right
  180. }
  181. }
  182. .text-box{
  183. margin 0 20rpx
  184. font-size:24rpx;
  185. line-height:40rpx;
  186. color:#666;
  187. padding-bottom:20rpx;
  188. }
  189. }
  190. .get-null-box{
  191. height:100rpx;
  192. line-height:100rpx;
  193. color:#999;
  194. text-align center
  195. }
  196. }
  197. }
  198. </style>