index.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <template>
  2. <view>
  3. <view class="search" v-if="show">
  4. <u-divider text="展开搜索"></u-divider>
  5. <u--input v-model="param.xx" placeholder="输入条件" class="input" clearable></u--input>
  6. <u--input v-model="param.xx" placeholder="输入条件" class="input" clearable></u--input>
  7. <u--input v-model="param.xx" placeholder="输入条件" class="input" clearable></u--input>
  8. <u--input v-model="param.xx" placeholder="输入条件" class="input" clearable></u--input>
  9. <u--input v-model="param.xx" placeholder="输入条件" class="input" clearable></u--input>
  10. <view class="flex">
  11. <view class="f"><button class="btn c" @click="clear()">重置</button></view>
  12. <view class="f"><button class="btn" @click="search()">搜索</button></view>
  13. </view>
  14. </view>
  15. <view class="list">
  16. <view class="item" v-for="(item, index) in list" :key="index" @click="detail(item.id)">
  17. <view class="title">
  18. <text class="tv">{{item.items.__yZMMXcXNnmKq5pTTfPH.value}}</text>
  19. <text class="icon">&#xe631;</text>
  20. <view class="clear"></view>
  21. </view>
  22. <view class="con">
  23. <view class="it">
  24. <view class="label">委托单编号:</view>
  25. <view class="name">{{item.items.__BFdnHQXCEaXwAC4nryK.value}}</view>
  26. </view>
  27. <view class="it">
  28. <view class="label">申请单位:</view>
  29. <view class="name">{{item.items.__VP07fdxAVMa7bSHb8ZU.value}}</view>
  30. </view>
  31. <view class="it">
  32. <view class="label">试验部门:</view>
  33. <view class="name">{{item.items.__DVAKyCmSOS9bvFpome2.value}}</view>
  34. </view>
  35. <view class="it">
  36. <view class="label">当前审批人:</view>
  37. <view class="name">{{item.items.__hInQ1R0YkMQNrgTq3q0.value}}</view>
  38. </view>
  39. <view class="tag">{{item.items.__oUywWKvn4BhpnBmxqYT.value}}</view>
  40. </view>
  41. </view>
  42. <view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
  43. <u-empty v-if="!loadMore && list.length == 0"></u-empty>
  44. </view>
  45. <view class="footer"><button class="btn" style="width: 30%;border-radius: 25px;">新建</button></view>
  46. </view>
  47. </template>
  48. <script>
  49. export default {
  50. data() {
  51. return {
  52. param: {appId:"__gAPYBW4YxB3UePM3lqO",containTitle:"申请单",opentarget:"detail",viewId:"__km3aURKW95BHxp12XVt" },
  53. list: [],
  54. show: false,
  55. loadMore: true,
  56. pageNum:1
  57. };
  58. },
  59. onLoad(e) {
  60. //this.getaccessToken();
  61. this.getData();
  62. console.log("0000===");
  63. },
  64. methods: {
  65. getaccessToken() {
  66. this.http.request({
  67. url: this.http.urls.accessToken,
  68. data: this.param,
  69. loading: 'false',
  70. success: res => {
  71. //console.log("gfgh==="+JSON.stringify(res));
  72. if(res.data.errcode==0){
  73. uni.removeStorageSync('user');
  74. uni.setStorageSync('user', res.data.data);
  75. this.getData();
  76. console.log("res.data.resultCode==="+res.data.errcode);
  77. }
  78. }
  79. });
  80. }, getData() {
  81. this.http.request({
  82. url: this.http.urls.wt_list+'&_currpage='+this.pageNum,
  83. data: this.param,
  84. method:'POST',
  85. loading: 'false',
  86. success: res => {
  87. console.log("res.data.data.page==="+JSON.stringify(res));
  88. console.log("this.pageNum==="+this.pageNum);
  89. this.loadMore = res.data.data.page > this.pageNum? true : false;
  90. res.data.data.data.forEach(item => {
  91. this.list.push(item);
  92. });
  93. //console.log("this.list==="+JSON.stringify(this.list));
  94. }
  95. });
  96. },
  97. //刷新数据
  98. refresh() {
  99. this.loadMore = true;
  100. this.pageNum = 1;
  101. this.list = [];
  102. this.getData();
  103. console.log("11111===");
  104. },
  105. //跳转到详情
  106. detail(id) {
  107. uni.navigateTo({
  108. url: '/pages/index/detail?id=' + id
  109. });
  110. }
  111. },
  112. //下拉刷新
  113. onPullDownRefresh() {
  114. console.log("222===");
  115. setTimeout(() => {
  116. this.refresh();
  117. uni.stopPullDownRefresh();
  118. }, 1000);
  119. },
  120. //上拉加载
  121. onReachBottom() {
  122. console.log("333===");
  123. if (this.loadMore) {
  124. this.pageNum++;
  125. console.log("this.pageNum==="+this.pageNum);
  126. this.getData();
  127. }
  128. },
  129. //展开搜索
  130. onNavigationBarButtonTap() {
  131. this.show = !this.show;
  132. }
  133. };
  134. </script>
  135. <style lang="scss">
  136. page {
  137. background-color: #f2f3f5;
  138. }
  139. .search {
  140. background-color: white;
  141. padding: 5px 15px;
  142. .input {
  143. margin-bottom: 10px;
  144. }
  145. .f {
  146. padding: 5px;
  147. background-color: white;
  148. }
  149. .c {
  150. background-color: #f44336;
  151. }
  152. }
  153. .list {
  154. padding: 0px 15px;
  155. .item {
  156. margin-top: 10px;
  157. background-color: white;
  158. border-radius: 5px;
  159. overflow: hidden;
  160. padding-bottom: 5px;
  161. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  162. .title {
  163. border-bottom: 1px solid #efefef;
  164. padding: 12px;
  165. .tv {
  166. float: left;
  167. width: 90%;
  168. }
  169. }
  170. .con {
  171. position: relative;
  172. .it {
  173. font-size: 14px;
  174. padding: 5px 12px 5px 12px;
  175. .label {
  176. float: left;
  177. color: #969696;
  178. }
  179. }
  180. .tag {
  181. position: absolute;
  182. top: 10%;
  183. right: 0px;
  184. padding: 3px 10px;
  185. background-color: red;
  186. color: white;
  187. border-radius: 15px 0px 0px 15px;
  188. }
  189. }
  190. }
  191. }
  192. </style>