loan.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. <template>
  2. <view class="flex-common-css page-box task-bg">
  3. <Nav title=" " :back="false" :is_fixed="true" :justify="'left'" :color="'#fff'">
  4. <view class="p-20">
  5. <IndexPersonal ref="memberObj" ></IndexPersonal>
  6. <IndexColumn ref="columnObj"></IndexColumn>
  7. </view>
  8. </Nav>
  9. <view class="common-view-css common-view-box flex-direction" ref="commonView" id="commonView">
  10. <LoanItem @onCalculate="onCalculate" :commonHeight='commonHeight'></LoanItem>
  11. </view>
  12. <Tab class="tabView" :tab-index="0"></Tab>
  13. </view>
  14. </template>
  15. <script>
  16. // 任务列表
  17. import LoanItem from "@/common/task/loan-item.vue";
  18. import {
  19. getLoanList
  20. } from "@/api/task";
  21. import tools from "@/service/tools";
  22. import loanItem from "@/common/task/loan-item.vue";
  23. import EnSelect from "@/components/en-utils/en-select/en-select.vue";
  24. import ClientType from "@/pages/loan/components/clientType.vue";
  25. // 个人信息
  26. import IndexColumn from "@/pages/index/module/index_column.vue"
  27. // 顶部栏目
  28. import IndexPersonal from "@/pages/index/module/index_personal.vue"
  29. export default {
  30. components: {
  31. ClientType,
  32. EnSelect,
  33. LoanItem,
  34. IndexColumn,
  35. IndexPersonal
  36. },
  37. data() {
  38. return {
  39. current: 0,
  40. tabsList: [{
  41. name: '全部',
  42. disabled: false
  43. }, {
  44. name: '未完成(0)',
  45. dot_color: 'red',
  46. is_dot: false,
  47. disabled: false
  48. }, {
  49. name: '已完成',
  50. dot_color: 'red',
  51. is_dot: false,
  52. disabled: false
  53. }],
  54. searchText: "",
  55. fromData: {
  56. status: 0,
  57. interest_rate: '', //利率区间 数组或者字符串,连接
  58. residue_num: '', //剩余期数
  59. product_name: '', //产品名称
  60. phone: '', //电话号码
  61. selectStr: '', //电话号码
  62. name: '', //客户名称
  63. productId: '', //产品ID
  64. page: 1,
  65. },
  66. total: 0,
  67. list: [],
  68. loanItem: {
  69. interest_rate: 0,
  70. id: 0,
  71. new_rate: '',
  72. client_id: '',
  73. },
  74. commonHeight: ''
  75. }
  76. },
  77. watch: {},
  78. onShow() {
  79. this.getList()
  80. },
  81. onLoad() {},
  82. mounted() {
  83. this.commonViewHeight()
  84. },
  85. methods: {
  86. commonViewHeight() {
  87. this.$nextTick(() => {
  88. let tabView = ''
  89. uni.createSelectorQuery().select('.tabView').boundingClientRect(data => {
  90. // this.commonHeight = data.height;
  91. tabView = data.height
  92. }).exec()
  93. uni.createSelectorQuery().select('.common-view-box').boundingClientRect(data => {
  94. console.log(data.height,tabView,'1111111');
  95. this.commonHeight = data.height - tabView;
  96. console.log(this.commonHeight,'1111111');
  97. }).exec()
  98. });
  99. },
  100. // setMemberData(memberData) {
  101. // this.memberData = memberData
  102. // this.$refs.columnObj.updateMemberData()
  103. // },
  104. startList() {
  105. this.fromData.status = this.current
  106. this.total = 999;
  107. this.list = [];
  108. this.page = 1;
  109. this.isAjax = false;
  110. this.getList();
  111. },
  112. setSearch(text) {
  113. this.fromData.selectStr = text
  114. this.startList()
  115. },
  116. getList() {
  117. console.log(this.list, '1111111111');
  118. // getLoanList(this.fromData).then((res) => {
  119. // if (res.code === 1) {
  120. // this.list = [...this.list, ...res.data.items]
  121. // this.total = res.data.total
  122. // this.tabsList[1].name = '未完成(' + res.data.noNum + ')'
  123. // this.tabsList[1].is_dot = res.data.noNum > 0;
  124. // } else {
  125. // tools.error(res.msg)
  126. // }
  127. // })
  128. },
  129. tabsChange(index) {
  130. this.current = index;
  131. // this.startList()
  132. },
  133. // 下拉刷新
  134. onRefresh() {
  135. setTimeout(() => {
  136. this.$refs.scroll.onEndPulling()
  137. }, 200)
  138. console.log("下拉刷新");
  139. },
  140. // 滚动到底部
  141. onScrollBottom() {
  142. uni.showLoading({
  143. title: '数据加载中'
  144. })
  145. setTimeout(() => {
  146. uni.showToast({
  147. title: '加载完成',
  148. icon: 'none'
  149. })
  150. }, 1000)
  151. console.log("到底部了");
  152. },
  153. setComputation() {
  154. uni.navigateTo({
  155. url: "/pages/loan/module/rate_compare?loanId=" + this.loanItem.id +
  156. '&interestRate=' + this.loanItem.interest_rate +
  157. '&newInterestRate=' + this.loanItem.new_rate
  158. })
  159. },
  160. onPerfectRate() {
  161. uni.navigateTo({
  162. url: "/pages/loan/module/perfect_rate"
  163. })
  164. },
  165. onCalculate(data) {
  166. this.loanItem.id = data.item.id
  167. if (data.type === 1) {
  168. this.loanItem.interest_rate = data.item.interest_rate
  169. this.$refs.popup.open('bottom')
  170. } else {
  171. this.loanItem.client_id = data.item.client_id
  172. this.$refs.clientPopup.open('bottom')
  173. }
  174. },
  175. onClose() {
  176. this.$refs.popup.close('bottom')
  177. this.$refs.clientPopup.close('bottom')
  178. },
  179. moveHandle() {
  180. return false
  181. }
  182. },
  183. }
  184. </script>
  185. <style lang="scss" scoped>
  186. // .page-box{
  187. // height: 100vh;
  188. // background-image: url("https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/index/index-bg.png?imageMogr2/quality/20");
  189. // background-repeat: no-repeat;
  190. // background-size: 100% auto;
  191. // display: flex;
  192. // flex-direction: column;
  193. // .top-data{
  194. // flex: 1;
  195. // overflow: hidden;
  196. // .top-row{
  197. // height: 680rpx;
  198. // }
  199. // }
  200. // .bottom-data{
  201. // }
  202. // }
  203. </style>