to_excel.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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" />
  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="" @click="endAdd(true)">
  41. </image>
  42. </view>
  43. <!-- <add-file @newMsg="endAdd"></add-file>-->
  44. </view>
  45. </uni-popup>
  46. </view>
  47. </template>
  48. <script>
  49. import CreditItem from "./components/credit-item.vue";
  50. import tools from "@/service/tools";
  51. // import AddFile from "@/page_subpack/transition/components/add-file.vue";
  52. export default {
  53. components: {
  54. // AddFile,
  55. CreditItem,
  56. },
  57. data() {
  58. return {
  59. value: '',
  60. current: 0,
  61. navHeight: 0,
  62. swiperCurrent: 0,
  63. tabsList: [{
  64. name: '全部',
  65. dot_color: 'red',
  66. disabled: false,
  67. 'id': 0,
  68. }, {
  69. name: '待转换',
  70. dot_color: 'yellow',
  71. disabled: false,
  72. 'id': 1,
  73. }, {
  74. 'id': 2,
  75. name: '转换中',
  76. dot_color: '',
  77. disabled: false
  78. }, {
  79. 'id': 3,
  80. name: '已完成',
  81. dot_color: '',
  82. disabled: false
  83. }, {
  84. 'id': 4,
  85. name: '已完成',
  86. dot_color: '',
  87. disabled: false
  88. }],
  89. subCurrent: 0,
  90. tabsDate: ['全部', '当日', '本周'],
  91. list: [],
  92. page: 1,
  93. total: null,
  94. isAjax: false,
  95. }
  96. },
  97. onReady() {
  98. this.getFilterHeight()
  99. },
  100. onLoad() {},
  101. mounted() {
  102. this.startList()
  103. },
  104. methods: {
  105. addPdf(){
  106. this.$refs.popup.open('bottom')
  107. },
  108. endAdd(type){
  109. this.$refs.popup.close('bottom')
  110. if(!type)this.startList()
  111. },
  112. startList() {
  113. this.list = []
  114. this.page = 1
  115. this.scrollTop = 0
  116. this.total = null
  117. this.isAjax = false
  118. this.getTransferList()
  119. },
  120. getTransferList() {
  121. if (this.isAjax || this.list.length === this.total) {
  122. return
  123. }
  124. getTransferList({
  125. 'status': this.tabId
  126. }).then(res => {
  127. if (res.code === 1) {
  128. this.list.push(...res.data.items)
  129. this.total = res.data.total
  130. } else {
  131. tools.error(res.msg)
  132. }
  133. this.isAjax = false
  134. })
  135. },
  136. tabsChange(index) {
  137. if (index !== this.current) {
  138. this.current = index;
  139. this.startList()
  140. }
  141. },
  142. onSubChange(current) {
  143. this.subCurrent = current
  144. },
  145. // 下拉刷新
  146. onRefresh() {
  147. console.log('下拉刷新');
  148. setTimeout(() => {
  149. this.$refs.scroll.onEndPulling()
  150. }, 500)
  151. },
  152. // 滚动到底部
  153. onScrollBottom() {
  154. console.log('滚动到底部');
  155. },
  156. getFilterHeight() {
  157. const query = uni.createSelectorQuery().in(this);
  158. query.select('.header-filter').boundingClientRect(data => {
  159. if (data) {
  160. console.log(data.height);
  161. this.navHeight = data.height
  162. }
  163. }).exec();
  164. }
  165. },
  166. }
  167. </script>
  168. <style lang="scss" scoped>
  169. .subsection {
  170. width: 430rpx;
  171. }
  172. .credit_earch {
  173. width: 250rpx;
  174. height: 69rpx;
  175. }
  176. .en-button {
  177. border: none;
  178. color: #fff;
  179. font-size: 30rpx;
  180. border: 1rpx solid #0FB160 !important;
  181. line-height: 80rpx;
  182. border-radius: 100rpx;
  183. background-color: #0FB160;
  184. }
  185. .fixed-button {
  186. position: fixed;
  187. bottom: 0;
  188. z-index: 10;
  189. background: #fff;
  190. width: calc(100% - 60rpx);
  191. padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
  192. }
  193. button::after {
  194. border: none;
  195. }
  196. </style>