to_excel.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <template>
  2. <view class="total-page page-box page-env-20 scroll_content task-bg">
  3. <Nav title="转换工具" :genre="1" is_fixed></Nav>
  4. <view class="header-filter">
  5. <view class="row-justify-sb center m-20">
  6. <view class="subsection">
  7. <uv-subsection :list="tabsDate" :bgColor="'#FFF'" :barBg="'#0FB160'" :activeColor="'#fff'"
  8. :inactiveColor="'#0FB160'" :fontSize="14" custom-style="height: 70rpx;border-radius: 30rpx;"
  9. custom-item-style="border-radius: 30rpx;" :current="subCurrent"
  10. @change="onSubChange"></uv-subsection>
  11. </view>
  12. <view class="row credit_earch center sys-background-fff r-30 p-l16">
  13. <uni-icons type="search" size="18" color="#999"></uni-icons>
  14. <input class="flex m-l10 m-r20 size-28 sys-background-fff" type="text" placeholder="搜索文件名称"
  15. placeholder-style="font-size:28rpx;color:#999" v-model="value" @change="startList" />
  16. </view>
  17. </view>
  18. <view style="height: 100rpx;">
  19. <z-tabs ref="tabs" :list="tabsList" :active-style="{color:'#10B261',fontWeight:'bold',fontSize:'28rpx'}"
  20. :bar-style="{background:'#10B261'}" :inactive-style="{fontWeight:'bold',fontSize:'28rpx'}"
  21. :current="current" :bar-animate-mode="'worm'" @change="tabsChange" />
  22. </view>
  23. </view>
  24. <EnScroll ref="scroll" :navHeight="navHeight" is_tabHeight @onRefresh="onRefresh"
  25. @onScrollBottom="onScrollBottom">
  26. <CreditItem :list="list"></CreditItem>
  27. </EnScroll>
  28. <view class="fixed-button p-t20 p-lr30">
  29. <button class="en-button button-background sys-weight-500 row-justify-c center" type="default"
  30. hover-class="is-hover" @click="addPdf">
  31. <!-- <image class="wh-36 m-lr16" src="/static/img/task/task-phone.png" mode="aspectFill"></image>-->
  32. 添加转换文件
  33. </button>
  34. </view>
  35. <uni-popup ref="popup" type="bottom">
  36. <view class="page-env-160 sys-background-fff r-20">
  37. <view class="row-justify-sb center p-lr30 p-t30">
  38. <view class="wh-25"></view>
  39. <text class="size-30 sys-weight-600">添加文件</text>
  40. <image class="wh-25" src="/page_subpack/static/img/task-details/close.png" mode=""
  41. @click="endAdd(true)">
  42. </image>
  43. </view>
  44. <add-file @newMsg="endAdd" :is_multifile="false"></add-file>
  45. </view>
  46. </uni-popup>
  47. </view>
  48. </template>
  49. <script>
  50. import CreditItem from "./components/credit-item.vue";
  51. import tools from "@/service/tools";
  52. import AddFile from "@/page_subpack/transition/components/add-file.vue";
  53. import {
  54. getTransferList
  55. } from "@/api/transfer";
  56. export default {
  57. components: {
  58. AddFile,
  59. CreditItem,
  60. },
  61. data() {
  62. return {
  63. value: '',
  64. current: 0,
  65. navHeight: 0,
  66. swiperCurrent: 0,
  67. tabsList: [{
  68. name: '全部',
  69. dot_color: 'red',
  70. disabled: false,
  71. 'id': 0,
  72. }, {
  73. name: '待转换',
  74. dot_color: 'yellow',
  75. disabled: false,
  76. 'id': 1,
  77. }, {
  78. 'id': 2,
  79. name: '转换中',
  80. dot_color: '',
  81. disabled: false
  82. }, {
  83. 'id': 3,
  84. name: '已完成',
  85. dot_color: '',
  86. disabled: false
  87. }, {
  88. 'id': 4,
  89. name: '已完成',
  90. dot_color: '',
  91. disabled: false
  92. }],
  93. subCurrent: 0,
  94. tabsDate: ['全部', '当日', '本周'],
  95. list: [],
  96. page: 1,
  97. total: null,
  98. isAjax: false,
  99. }
  100. },
  101. onReady() {
  102. // this.getFilterHeight()
  103. },
  104. onLoad() {},
  105. mounted() {
  106. // this.startList()
  107. },
  108. methods: {
  109. addPdf() {
  110. this.$refs.popup.open('bottom')
  111. },
  112. endAdd(type) {
  113. this.$refs.popup.close('bottom')
  114. if (!type) this.startList()
  115. },
  116. startList() {
  117. this.list = []
  118. this.page = 1
  119. this.scrollTop = 0
  120. this.total = null
  121. this.isAjax = false
  122. this.getTransferList()
  123. },
  124. getTransferList() {
  125. if (this.isAjax || this.list.length === this.total) {
  126. return
  127. }
  128. getTransferList({
  129. 'status': this.current,
  130. 'dateType': this.subCurrent,
  131. 'text': this.value,
  132. }).then(res => {
  133. if (res.code === 1) {
  134. this.list.push(...res.data.items)
  135. this.total = res.data.total
  136. } else {
  137. tools.error(res.msg)
  138. }
  139. this.isAjax = false
  140. })
  141. },
  142. tabsChange(index) {
  143. if (index !== this.current) {
  144. this.current = index;
  145. this.startList()
  146. }
  147. },
  148. onSubChange(current) {
  149. this.subCurrent = current
  150. },
  151. // 下拉刷新
  152. onRefresh() {
  153. console.log('下拉刷新');
  154. setTimeout(() => {
  155. this.$refs.scroll.onEndPulling()
  156. }, 500)
  157. },
  158. // 滚动到底部
  159. onScrollBottom() {
  160. console.log('滚动到底部');
  161. },
  162. getFilterHeight() {
  163. const query = uni.createSelectorQuery().in(this);
  164. query.select('.header-filter').boundingClientRect(data => {
  165. if (data) {
  166. console.log(data.height);
  167. this.navHeight = data.height
  168. }
  169. }).exec();
  170. }
  171. },
  172. }
  173. </script>
  174. <style lang="scss" scoped>
  175. .subsection {
  176. width: 430rpx;
  177. }
  178. .credit_earch {
  179. width: 250rpx;
  180. height: 69rpx;
  181. }
  182. .en-button {
  183. color: #fff;
  184. font-size: 30rpx;
  185. border: 1rpx solid #0FB160 !important;
  186. line-height: 80rpx;
  187. border-radius: 100rpx;
  188. background-color: #0FB160;
  189. }
  190. .fixed-button {
  191. position: fixed;
  192. bottom: 0;
  193. z-index: 10;
  194. background: #fff;
  195. width: calc(100% - 60rpx);
  196. padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
  197. }
  198. button::after {
  199. border: none;
  200. }
  201. </style>