to_excel.vue 5.6 KB

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